.. _Deep learning page:
Deep learning
*****************
Deep learning models can be seen as a subset of machine learning models,
typically based on artificial neural networks. Using deep learning models
for point cloud processing often demands top-level hardware. Users interested
in these models are strongly encouraged to have a computer with no less than
:math:`128\,\mathrm{GB}` of RAM, a manycore processor (with many **real**
cores for efficient parallel processing), and a top-level coprocessor like a
GPU or a TPU. It is worth mentioning that training deep learning models for
dense point clouds is not feasible with a typical CPU, so the coprocessor is a
must. However, using an already trained deep learning model might be possible
without a coprocessor, provided the system has a top-level CPU and high amounts
of RAM.
The deep learning models in the VL3D framework are based on the strategy
represented in the figure below. First, it is necessary to **select** a set of
neighborhoods that represents the input point cloud. These can overlap between
themselves, i.e., the same point can be in more than one neighborhood.
The neighborhoods can be defined as spheres, voxels, cylinders, or many more.
Now, note that each neighborhood can contain a different number of points.
In the VL3D framework, the input neighborhoods must be transformed into
**fixed-size** representations (in terms of the number of points) that will be
later grouped into batches to be **fed into the neural network**.
Once the neural network has computed the output, it will be **propagated** back
from the fixed-size receptive fields to the original neighborhoods, for
example, through a nearest-neighbor strategy. As there might be many outputs
for the same point, the values in the neighborhoods are **aggregated** (also
reduced), so there is one final value per point in the original point cloud
(provided that the input neighborhoods cover the entire point cloud).
.. figure:: ../img/dl_paradigm_final_transparent.png
:scale: 35
:alt: Figure representing the deep learning strategy used in the VL3D
framework.
Visualization of the deep learning strategy used by the VL3D framework.
The VL3D framework uses `Keras `_ and
`TensorFlow `_ as the deep
learning backend. The usage of deep learning models is documented below.
However, for this documentation users are expected to be already familiar
with the framework, especially with how to define pipelines. If that is not
the case, we strongly encourage you to read the
:ref:`documentation about pipelines ` before.
Models
========
PointNet-based point-wise classifier
---------------------------------------
The :class:`PointNetPwiseClassif` can be used to solve point-wise classification
tasks. This model is based on the PointNet architecture and it can be defined
as shown in the JSON below:
.. code-block:: json
{
"train": "PointNetPwiseClassifier",
"fnames": ["AUTO"],
"training_type": "base",
"random_seed": null,
"model_args": {
"num_classes": 5,
"class_names": ["Ground", "Vegetation", "Building", "Urban furniture", "Vehicle"],
"num_pwise_feats": 16,
"pre_processing": {
"pre_processor": "furthest_point_subsampling",
"to_unit_sphere": false,
"support_strategy": "grid",
"support_chunk_size": 2000,
"support_strategy_fast": false,
"_training_class_distribution": [1000, 1000, 1000, 1000, 1000],
"center_on_pcloud": true,
"num_points": 4096,
"num_encoding_neighbors": 1,
"fast": false,
"neighborhood": {
"type": "rectangular3D",
"radius": 5.0,
"separation_factor": 0.8
},
"nthreads": 12,
"training_receptive_fields_distribution_report_path": "*/training_eval/training_receptive_fields_distribution.log",
"training_receptive_fields_distribution_plot_path": "*/training_eval/training_receptive_fields_distribution.svg",
"training_receptive_fields_dir": "*/training_eval/training_receptive_fields/",
"receptive_fields_distribution_report_path": "*/training_eval/receptive_fields_distribution.log",
"receptive_fields_distribution_plot_path": "*/training_eval/receptive_fields_distribution.svg",
"receptive_fields_dir": "*/training_eval/receptive_fields/",
"training_support_points_report_path": "*/training_eval/training_support_points.las",
"support_points_report_path": "*/training_eval/support_points.las"
},
"kernel_initializer": "he_normal",
"pretransf_feats_spec": [
{
"filters": 32,
"name": "prefeats32_A"
},
{
"filters": 32,
"name": "prefeats_32B"
},
{
"filters": 64,
"name": "prefeats_64"
},
{
"filters": 128,
"name": "prefeats_128"
}
],
"postransf_feats_spec": [
{
"filters": 128,
"name": "posfeats_128"
},
{
"filters": 256,
"name": "posfeats_256"
},
{
"filters": 64,
"name": "posfeats_end_64"
}
],
"tnet_pre_filters_spec": [32, 64, 128],
"tnet_post_filters_spec": [128, 64, 32],
"final_shared_mlps": [512, 256, 128],
"skip_link_features_X": false,
"include_pretransf_feats_X": false,
"include_transf_feats_X": true,
"include_postransf_feats_X": false,
"include_global_feats_X": true,
"skip_link_features_F": false,
"include_pretransf_feats_F": false,
"include_transf_feats_F": true,
"include_postransf_feats_F": false,
"include_global_feats_F": true,
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"class_weight": [0.25, 0.5, 0.5, 1, 1],
"training_epochs": 200,
"batch_size": 16,
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
},
"early_stopping": {
"monitor": "loss",
"mode": "min",
"min_delta": 0.01,
"patience": 5000
},
"prediction_reducer": {
"reduce_strategy" : {
"type": "MeanPredReduceStrategy"
},
"select_strategy": {
"type": "ArgMaxPredSelectStrategy"
}
}
},
"compilation_args": {
"optimizer": {
"algorithm": "SGD",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 2000,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": true,
"show_layer_names": true,
"rankdir": "TB",
"expand_nested": true,
"dpi": 300,
"show_layer_activations": true
}
},
"training_evaluation_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_class_evaluation_metrics": ["P", "R", "F1", "IoU"],
"training_evaluation_report_path": "*/training_eval/evaluation.log",
"training_class_evaluation_report_path": "*/training_eval/class_evaluation.log",
"training_confusion_matrix_report_path": "*/training_eval/confusion.log",
"training_confusion_matrix_plot_path": "*/training_eval/confusion.svg",
"training_class_distribution_report_path": "*/training_eval/class_distribution.log",
"training_class_distribution_plot_path": "*/training_eval/class_distribution.svg",
"training_classified_point_cloud_path": "*/training_eval/classified_point_cloud.las",
"training_activations_path": "*/training_eval/activations.las"
}
The JSON above defines a :class:`.PointNetPwiseClassif` that uses a
furthest point subsampling strategy with a 3D rectangular neighborhood. The
optimization algorithm to train the neural network is stochastic gradient
descent (SGD). The loss function is a categorical cross-entropy that accounts
for class weights. The class weights can be used to handle data imbalance.
.. _PointNet arguments:
**Arguments**
-- ``fnames``
The names of the features that must be considered by the neural network.
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further
details, read the :ref:`training strategies section `.
-- ``random_seed``
Can be used to specify an integer like seed for any randomness-based
computation. Mostly to be used for reproducibility purposes. Note that
the initialization of a neural network is often based on random
distributions. This parameter does not affect those distributions, so
it will not guarantee reproducibility for of deep learning models.
-- ``model_args``
The model specification.
-- ``fnames``
If the input to the model involves features, their names must be given
again inside the ``model_args`` dictionary due to technical reasons.
-- ``num_classess``
An integer specifying the number of classes involved in the
point-wise classification tasks.
-- ``class_names``
The names of the classes involved in the classification task. Each
string corresponds to the class associated to its index in the list.
-- ``num_pwise_feats``
How many point-wise features must be computed.
-- ``pre_processing``
How the **select** and **fix** stages of the deep learning strategy
must be handled. See the
:ref:`receptive fields section ` for further
details.
-- ``kernel_initializer``
The name of the kernel initialization method. See
`Keras documentation on layer initializers `_
for further details.
-- ``pretransf_feats_spec``
A list of dictionaries where each dictionary defines a layer to be placed
before the transformation block in the middle. Each dictionary must
contain ``filters`` (an integer specifying the output dimensionality of
the layer) and ``name`` (a string representing the layer's name).
-- ``postransf_feats_spec``
A list of dictionaries where each dictionary defines a layer to be placed
after the transformation block in the middle. Each dictionary must
contain ``filters`` (an integer specifying the output dimensionality of
the layer) and ``name`` (a string representing the layer's name).
-- ``tnet_pre_filters_spec``
A list of integers where each integer specifies the output dimensionality
of a convolutional layer placed before the global pooling.
-- ``tnet_post_filters_spec``
A list of integers where each integer specifies the output dimensionality
of a dense layer (MLP) placed after the global pooling.
-- ``final_shared_mlps``
A list of integers where each integer specifies the output dimensionality
of the shared MLP (i.e., 1D Conv with unitary window and stride). These
are called final because they are applied immediately before the
convolution that reduces the number of point-wise features that
constitute the input of the final layer.
-- ``skip_link_features_X``
Whether to propagate the input structure space to the final
concatenation of features (True) or not (False).
-- ``include_pretransf_feats_X``
Whether to propagate the values of the hidden layers that processed
the structure space before the second transformation block to the final
concatenation of features (True) or not (False).
-- ``include_transf_feats_X``
Whether to propagate the values of the hidden layers that processed the
structure space in the second transformation block to the final
concatenation of features (True) or not (False).
-- ``include_postransf_feats_X``
Whether to propagate the values of the hidden layers that processed
the structure space after the second transformation block to the
final concatenation of features (True) or not (False).
-- ``include_global_feats_X``
Whether to propagate the global features derived from the structure
space to the final concatenation of features (True) or not (False).
-- ``skip_link_features_F``
Whether to propagate the input feature space to the final
concatenation of features (True) or not (False).
-- ``include_pretransf_feats_F``
Whether to propagate the values of the hidden layers that processed
the feature space before the second transformation block to the final
concatenation of features (True) or not (False).
-- ``include_transf_feats_F``
Whether to propagate the values of the hidden layers that processed the
feature space in the second transformation block to the final
concatenation of features (True) or not (False).
-- ``include_postransf_feats_F``
Whether to propagate the values of the hidden layers that processed
the feature space after the second transformation block to the
final concatenation of features (True) or not (False).
-- ``include_global_feats_F``
Whether to propagate the global features derived from the feature
space to the final concatenation of features (True) or not (False).
-- ``features_structuring_layer`` **EXPERIMENTAL**
Specification for the :class:`.FeaturesStructuringLayer` that uses
radial basis functions to transform the features. This layer is
experimental and it is not part of typical PointNet-like architectures.
Users are strongly encouraged to avoid using this layer. At the moment
it is experimental and should only be used for development and research
purposes.
.. _PointNet architecture graph path:
-- ``architecture_graph_path``
Path where the plot representing the neural network's architecture wil be
exported.
.. _PointNet architecture graph args:
-- ``architecture_graph_args``
Arguments governing the architecture's graph. See
`Keras documentation on plot_model `_
for further details.
.. _PointNet model handling:
-- ``model_handling``
Define how to handle the model, i.e., not the architecture itself but
how it must be used.
-- ``summary_report_path``
Path where a text describing the built network's architecture must
be exported.
-- ``training_history_dir``
Path where the data (plots and text) describing the training
process must be exported.
-- ``class_weight``
The class weights for the model's loss. It can be ``null`` in which
case no class weights will be considered. Alternatively, it can be
``"AUTO"`` to automatically compute the class weights based on
`TensorFlow's imbalanced data tutorial `_.
It can also be a list with as many elements as classes where each
element governs the class weight for the corresponding class.
-- ``training_epochs``
How many epochs must be considered to train the model.
-- ``batch_size``
How many receptive fields per batch must be grouped together as
input for the neural network.
-- ``checkpoint_path``
Path where a checkpoint of the model's current status can be
exported. When given, it will be used during training to keep
the best model. The extension of the file must be necessarily
``".weights.h5"``.
-- ``checkpoint_monitor``
What metric must be analyzed to decide what is the best model when
using the checkpoint strategy. See the
`Keras documentation on ModelCheckpoint `_
for more information.
-- ``learning_rate_on_plateau``
When given, it can be used to configure the learning rate on
plateau callback. See the
`Keras documentation on ReduceLROnPlateau `_
for more information.
-- ``early_stopping``
When given, it can be used to configure the early stopping
callback. See the
`Keras documentation on EarlyStopping `_
for more information.
-- ``prediction_reducer``
Can be used to modify the default prediction reduction strategies.
It is a dictionary that supports a ``"reduce_strategy"``
specification and also a ``"select_strategy"`` specification.
-- ``reduce_strategy``
Supported types are :class:`.SumPredReduceStrategy`,
:class:`.MeanPredReduceStrategy` (default),
:class:`.MaxPredReduceStrategy`, and
:class:`.EntropicPredReduceStrategy`.
-- ``select_strategy``
Supported types are :class:`.ArgMaxPredSelectStrategy`
(default).
-- ``fit_verbose``
Whether to use silent mode (0), show a progress bar (1), or print
one line per epoch (2) when training a model. Alternatively,
``"auto"`` can be used, which typically means (1).
-- ``predict_verbose``
Whether to use silent mode (0), show a progress bar (1), or print
one line per epoch (2) when using a model to predict. Alternatively,
``"auto"`` can be used, which typically means (1).
.. _PointNet compilation args:
-- ``compilation_args``
The arguments governing the model's compilation. They include the
optimizer, the loss function and the metrics to be monitored during
training. See the :ref:`optimizers section ` and
:ref:`losses section ` for further details.
-- ``training_evaluation_metrics``
What metrics must be considered to evaluate the model on the training data.
* ``"OA"`` Overall accuracy.
* ``"P"`` Precision.
* ``"R"`` Recall.
* ``"F1"`` F1 score (harmonic mean of precision and recall).
* ``"IoU"`` Intersection over union (also known as Jaccard index).
* ``"wP"`` Weighted precision (weights by the number of true instances for each class).
* ``"wR"`` Weighted recall (weights by the number of true instances for each class).
* ``"wF1"`` Weighted F1 score (weights by the number of true instances for each class).
* ``"wIoU"`` Weighted intersection over union (weights by the number of true instances for each class).
* ``"MCC"`` Matthews correlation coefficient.
* ``"Kappa"`` Cohen's kappa score.
-- ``training_class_evaluation_metrics``
What class-wose metrics must be considered to evaluate the model on the
training data.
* ``"P"`` Precision.
* ``"R"`` Recall.
* ``"F1"`` F1 score (harmonic mean of precision and recall).
* ``"IoU"`` Intersection over union (also known as Jaccard index).
-- ``training_evaluation_report_path``
Path where the report about the model evaluated on the training data
must be exported.
-- ``training_class_evaluation_report_path``
Path where the report about the model's class-wise evaluation on the
training data must be exported.
-- ``training_confusion_matrix_report_path``
Path where the confusion matrix must be exported (in text format).
-- ``training_confusion_matrix_plot_path``
Path where the confusion matrix must be exported (in image format).
-- ``training_class_distribution_report_path``
Path where the analysis of the classes distribution must be exported
(in text format).
-- ``training_class_distribution_plot_path``
Path where the analysis of the classes distribution must be exported
(in image format).
-- ``training_classifier_point_cloud_path``
Path where the training data with the model's predictions must be exported.
-- ``training_activations_path``
Path where a point cloud representing the point-wise activations of the
model must be exported. It might demand a lot of memory. However, it can be
useful to understand, debug, and improve the model.
Hierarchical autoencoder point-wise classifier
------------------------------------------------
Hierarchical autoencoders for point-wise classification are available in the
framework through the :class:`.ConvAutoencPwiseClassif` architecture. They are
also referred to in the documentation as convolutional autoencoders. In the
scientific literature they are widely known as hierarchical feature extractors
too. The figure below summarized the main logic of hierarchical autoencoders
for point clouds.
.. figure:: ../img/dl_hierarchical_rfs.png
:scale: 50
:alt: Figure representing the logic of hierarchical autoencoders for point
clouds based on hierarchical receptive fields.
Representation of the main logic governing hierarchical autoencoders for
point clouds based on hierarchical receptive fields.
Initially, we have a 3D structure space
:math:`\pmb{X} \in \mathbb{R}^{m \times 3}` with :math:`m` points and the
corresponding feature space :math:`\pmb{F} \in \mathbb{R}^{m \times n_f}`
with :math:`n_f` features. For a given depth, for example for depth three
(as illustrated in the figure above), there is a set of downsampling stages
followed by a set of upsampling stages.
At a given depth :math:`d`, there is a non downsampled structure space
:math:`\pmb{X_{d-1}} \in \mathbb{R}^{R_{d-1} \times 3}` and its corresponding
:math:`\pmb{X_{d}} \in \mathbb{R}^{R_d \times 3}` downsampled version.
The neighborhood :math:`\mathcal{N}_d^D` can be represented with an indexing
matrix :math:`\pmb{N}_{d}^{D} \in \mathbb{Z}^{R_d \times \kappa_d^D}` that
defines for each of the :math:`R_d` points in the downsampled space its
:math:`\kappa_d^D` closest neighbors in the non downsampled space.
Once in the downsampling space, a transformation :math:`T_d^D` is applied to
downsampled feature space to obtain a new set of features. This transformation
can be done using different operators like PointNet or Kernel Point
Convolution (KPConv). Further details about them will be given below in the
:ref:`hierarchical feature extraction with PointNet ` and
the :ref:`hierarchical feature extraction with KPConv `
sections.
After finishing the downsampling and feature extraction operations, it is
time to restore the original dimensionality through upsampling. First, the
:math:`\mathcal{N}_d^U` neighborhood is reresented by an indexing matrix
:math:`\pmb{N}_{d}^U \in \mathbb{Z}^{R_{d-1} \times \kappa_d^U}` that defines
for each of the :math:`R_{d-1}` points in the upsampled space its
:math:`\kappa_d^U` closest neighbors in the non upsampled space. Then, the
:math:`T_d^U` upsampling operation is applied. Typically, it is a SharedMLP
(i.e., a unitary 1D discrete convolution).
Note that the last upsampling operation is not applied inside the neural
network. Instead, the estimations of the network are computed on the first
receptive field with structure space
:math:`\pmb{X_1} \in \mathbb{R}^{R_1 \times 3}` (the one
with more points, and thus, closer to the original neighborhood). Finally,
the last upsampling is computed to transform the predictions of the neural
network (:math:`\hat{z}`) back to the original input neighborhood (with an arbitrary number
of points).
.. _Hierarchical PNet:
Hierarchical feature extraction with PointNet
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :class:`.ConvAutoencPwiseClassif` architecture can be configured with
PointNet for feature extraction operations. The downsampling strategy can be
defined through the :class:`.FeaturesDownsamplingLayer`, the upsampling
strategy through the :class:`.FeaturesUpsamplingLayer`, and the feature
extraction through the :class:`.GroupingPointNetLayer`. The JSON below
illustrates how to configure PointNet++-like hierarchical feature extractors
using the VL3D framework. For further details on the original PointNet++
architecture, readers are referred to
`the PointNet++ paper (Qi et al., 2017) `_
.
.. code-block:: json
{
"in_pcloud": [
"/mnt/netapp2/Store_uscciaep/lidar_data/hessigheim/data/Mar18_train.laz"
],
"out_pcloud": [
"/mnt/netapp2/Store_uscciaep/lidar_data/hessigheim/vl3d/hae_X_FPS50K/T1/*"
],
"sequential_pipeline": [
{
"train": "ConvolutionalAutoencoderPwiseClassifier",
"training_type": "base",
"fnames": ["AUTO"],
"random_seed": null,
"model_args": {
"num_classes": 11,
"class_names": ["LowVeg", "ImpSurf", "Vehicle", "UrbanFurni", "Roof", "Facade", "Shrub", "Tree", "Soil/Gravel", "VertSurf", "Chimney"],
"pre_processing": {
"pre_processor": "hierarchical_fps",
"support_strategy_num_points": 50000,
"to_unit_sphere": false,
"support_strategy": "fps",
"support_chunk_size": 2000,
"support_strategy_fast": true,
"center_on_pcloud": true,
"neighborhood": {
"type": "rectangular3D",
"radius": 3.0,
"separation_factor": 0.8
},
"num_points_per_depth": [512, 256, 128, 64, 32],
"fast_flag_per_depth": [false, false, false, false, false],
"num_downsampling_neighbors": [1, 16, 8, 8, 4],
"num_pwise_neighbors": [32, 16, 16, 8, 4],
"num_upsampling_neighbors": [1, 16, 8, 8, 4],
"nthreads": 12,
"training_receptive_fields_distribution_report_path": "*/training_eval/training_receptive_fields_distribution.log",
"training_receptive_fields_distribution_plot_path": "*/training_eval/training_receptive_fields_distribution.svg",
"training_receptive_fields_dir": null,
"receptive_fields_distribution_report_path": "*/training_eval/receptive_fields_distribution.log",
"receptive_fields_distribution_plot_path": "*/training_eval/receptive_fields_distribution.svg",
"receptive_fields_dir": null,
"training_support_points_report_path": "*/training_eval/training_support_points.las",
"support_points_report_path": "*/training_eval/support_points.las"
},
"feature_extraction": {
"type": "PointNet",
"operations_per_depth": [2, 1, 1, 1, 1],
"feature_space_dims": [64, 64, 128, 256, 512, 1024],
"bn": true,
"bn_momentum": 0.0,
"H_activation": ["relu", "relu", "relu", "relu", "relu", "relu"],
"H_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"H_regularizer": [null, null, null, null, null, null],
"H_constraint": [null, null, null, null, null, null],
"gamma_activation": ["relu", "relu", "relu", "relu", "relu", "relu"],
"gamma_kernel_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"gamma_kernel_regularizer": [null, null, null, null, null, null],
"gamma_kernel_constraint": [null, null, null, null, null, null],
"gamma_bias_enabled": [true, true, true, true, true, true],
"gamma_bias_initializer": ["zeros", "zeros", "zeros", "zeros", "zeros", "zeros"],
"gamma_bias_regularizer": [null, null, null, null, null, null],
"gamma_bias_constraint": [null, null, null, null, null, null]
},
"_structure_alignment": {
"tnet_pre_filters_spec": [64, 128, 256],
"tnet_post_filters_spec": [128, 64, 32],
"kernel_initializer": "glorot_normal"
},
"features_alignment": null,
"downsampling_filter": "gaussian",
"upsampling_filter": "mean",
"upsampling_bn": true,
"upsampling_momentum": 0.0,
"conv1d_kernel_initializer": "glorot_normal",
"output_kernel_initializer": "glorot_normal",
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"features_structuring_representation_dir": "*/training_eval/feat_struct_layer/",
"class_weight": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
"training_epochs": 200,
"batch_size": 16,
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
}
},
"compilation_args": {
"optimizer": {
"algorithm": "SGD",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 15000,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": true,
"show_layer_names": true,
"rankdir": "TB",
"expand_nested": true,
"dpi": 300,
"show_layer_activations": true
}
},
"autoval_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_evaluation_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_class_evaluation_metrics": ["P", "R", "F1", "IoU"],
"training_evaluation_report_path": "*/training_eval/evaluation.log",
"training_class_evaluation_report_path": "*/training_eval/class_evaluation.log",
"training_confusion_matrix_report_path": "*/training_eval/confusion.log",
"training_confusion_matrix_plot_path": "*/training_eval/confusion.svg",
"training_class_distribution_report_path": "*/training_eval/class_distribution.log",
"training_class_distribution_plot_path": "*/training_eval/class_distribution.svg",
"training_classified_point_cloud_path": "*/training_eval/classified_point_cloud.las",
"training_activations_path": null
},
{
"writer": "PredictivePipelineWriter",
"out_pipeline": "*pipe/HAE_T1.pipe",
"include_writer": false,
"include_imputer": false,
"include_feature_transformer": false,
"include_miner": false,
"include_class_transformer": false
}
]
}
The JSON above defines a :class:`.ConvAutoencPwiseClassif` that uses a
hierarchical furthest point sampling strategy with a 3D rectangular
neighborhood and the PointNet operator for feature extraction. It is expected
to work only on the structure space, i.e., the input feature space will be a
single column of ones.
**Arguments**
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further details,
read the :ref:`training strategies section `.
-- ``fnames``
The name of the features that must be given as input to the neural network.
For hierarchical autoencoders this list can contain ``"ones"`` to specify
whether to include a column of ones in the input space matrix. This
architecture does not support empty feature spaces as input, thus, when
no features are given, the input feature space must be represented with a
column of ones.
-- ``random_seed``
Can be used to specify an integer like seed for any randomness-based
computation. Mostly to be used for reproducibility purposes. Note that
the initialization of a neural network is often based on random
distributions. This parameter does not affect those distributions, so
it will not guarantee reproducibility for of deep learning models.
-- ``model_args``
The model specification.
-- ``num_classess``
An integer specifying the number of classes involved in the
point-wise classification tasks.
-- ``class_names``
The names of the classes involved in the classification task. Each
string corresponds to the class associated to its index in the list.
-- ``pre_processing``
How the **select** and **fix** stages of the deep learning strategy
must be handled. Note that hierarchical autoencoders demand
hierarchical receptive fields. See the
:ref:`receptive fields ` and
:ref:`hierarchical FPS receptive field `
sections for further details.
-- ``feature_extraction``
The definition of the feature extraction operator. A detailed
description of the case when ``"type": "PointNet"`` is given below.
For a description of the case when ``"type": "KPConv"`` see
:ref:`the KPConv operator documentation `.
-- ``operations_per_depth``
A list specifying how many operations per depth level. The i-th
element of the list gives the number of feature extraction
operations at depth i.
-- ``feature_space_dims``
A list specifying the output dimensionality of the feature space
after each feature extraction operation. The i-th element of the
list gives the dimensionality of the i-th feature extraction
operation.
-- ``bn``
Boolean flag to decide whether to enable batch normalization for
feature extraction.
.. _Hierarchical PNet args bn_momentum:
-- ``bn_momentum``
Momentum for the moving average of the batch normalization, such
that
``new_mean = old_mean * momentum + batch_mean * (1 - momentum)``.
See the
`Keras documentation on batch normalization `_
for more details.
-- ``H_activation``
The activation function for the SharedMLP of each feature
extraction operation.
See
`the keras documentation on activations `_
for more details.
-- ``H_initializer``
The initialization method for the SharedMLP of each feature
extraction operation.
See
`the keras documentation on initializers `_
for more details.
-- ``H_regularizer``
The regularization strategy for the SharedMLP of each feature
extraction operation.
See
`the keras documentation on regularizers `_
for more details.
-- ``H_constraint``
The constraints for the SharedMLP of each feature extraction
operation.
See
`the keras documentation on constraints `_
for more details.
-- ``gamma_activation``
The constraints for the MLP of each feature extraction
operation.
See
`the keras documentation on activations `_
for more details.
-- ``gamma_kernel_initializer``
The initialization method for the MLP of each feature extraction
operation (ignoring the bias term).
See
`the keras documentation on initializers `_
for more details.
-- ``gamma_kernel_regularizer``
The regularization strategy for the MLP of each feature
extraction operation (ignoring the bias term).
See
`the keras documentation on regularizers `_
for more details.
-- ``gamma_kernel_constraint``
The constraints for the MLP of each feature extraction operation
(ignoring the bias term).
See
`the keras documentation on constraints `_
for more details.
-- ``gamma_bias_enabled``
Whether to enable the bias term for the MLP of each feature
extraction operation.
-- ``gamma_bias_initializer``
The initialization method for the bias term of the MLP of each
feature extraction operation.
See
`the keras documentation on initializers `_
for more details.
-- ``gamma_bias_regularizer``
The regularization strategy for the bias term of the MLP of each
feature extraction operation.
See
`the keras documentation on regularizers `_
for more details.
-- ``gamma_bias_constraint``
The constraints for the bias term of the MLP of each feature
extraction operation.
See
`the keras documentation on constraints `_
for more details.
-- ``structure_alignment``
When given, this specification will govern the alignment of the
structure space.
-- ``tnet_pre_filters_spec``
List defining the number of pre-transformation filters at
each depth.
-- ``tnet_post_filters_spec``
List defining the number of post-transformation filters at
each depth.
-- ``kernel_initializer``
The kernel initialization method for the structure alignment
layers.
See
`the keras documentation on initializers `_
for more details.
-- ``features_alignment``
When given, this specification will govern the alignment of the
feature space. It is like the ``structure_alignment`` dictionary
but it is applied to the features instead of the structure space.
It must be null to mimic a classical KPConv model.
-- ``downsampling_filter``
The type of downsampling filter. See
:class:`.FeaturesDownsamplingLayer`,
:class:`.StridedKPConvLayer`,
:class:`.StridedLightKPConvLayer`, and
:class:`.InterdimensionalPointTransformerLayer` for more details.
-- ``upsampling_filter``
The type of upsampling filter. See
:class:`.FeaturesUpsamplingLayer` and
:class:`.InterdimnsionalPointTransformerLayer` for more details.
-- ``upsampling_bn``
Boolean flag to decide whether to enable batch normalization for
upsampling transformations.
-- ``upsampling_momentum``
Momentum for the moving average of the upsampling batch normalization,
such that
``new_mean = old_mean * momentum + batch_mean * (1-momentum)``.
See the
`Keras documentation on batch normalization `_
for more details.
-- ``conv1d_kernel_initializer``
The initialization method for the 1D convolutions during upsampling.
See
`the keras documentation on initializers `_
for more details.
.. _Hierarchical PNet args neck:
-- ``neck``
The neck block that connects the feature extraction hierarchy with the
segmentation head. It can be ``null`` if no neck is desired. If given,
it must be a dictionary governing the neck block.
-- ``max_depth``
An integer specifying the depth of the neck block.
-- ``hidden_channels``
A list with the number of hidden channels (output dimensionality) at
each depth of the neck block.
-- ``kernel_initializer``
A list with the initialization method for the layers at each depth
of the neck block.
See
`the keras documentation on initializers `_
for more details.
-- ``kernel_regularizer``
A list with the regularization method for the layers at each depth
of the neck block.
See
`the keras documentation on regularizers `_
for more details.
-- ``kernel_constraint``
A list with the constraint for the layers at each depth
of the neck block.
See
`the keras documentation on constraints `_
for more details.
-- ``bn_momentum``
A list with the momentum for the moving average of the batch
normalization at each depth of the neck block, such that
``new_mean = old_mean * momentum + batch_mean * (1 - momentum)``.
See the
`Keras documentation on batch normalization `_
for more details.
-- ``activation``
A list with the name of the activation function to be used at each
depth of the neck block.
These names must match those listed in the
`Keras documentation on activations `_.
.. _Hierarchical PNet args contextual_head:
-- ``contextual_head``
The specification of the contextual head to be built on top of the
standard output head of the neural network. If not given, then no
contextual head will be used at all. Note that the contextual head
is implemented as a :class:`.ContextualPointLayer`.
-- ``multihead``
Let :math:`\mathcal{L}^{(1)}` be the loss function from the
standard output head and :math:`\mathcal{L}^{(2)}` the loss
function from the contextual head output. If the architecture
has a single head (i.e., multihead set to `false`), then the
model's loss function will be
:math:`\mathcal{L} = \mathcal{L}^{(2)}`. However, if the
architecture is multiheaded (i.e., multihead set to `true`), then
the model's loss function will be
:math:`\mathcal{L} = \mathcal{L}^{(1)} + \mathcal{L}^{(2)}`
.
-- ``max_depth``
The number of contextual point layers in the contextual head.
-- ``hidden_channels``
A list with the dimensionality of the hidden feature space for each
contextual point layer.
-- ``output_channels``
A list with the dimensionality of the output feature space for each
contextual point layer.
-- ``bn``
A list governing whether to include batch normalization at each
contextual point layer.
-- ``bn_momentum``
A list with the momentum for the batch normalization of each
contextual point layer such that
``new_mean = old_mean * momentum + batch_mean * (1 - momentum)``.
See the
`Keras documentation on batch normalization `_
for more details.
-- ``bn_along_neighbors``
A list governing whether to apply the batch normalization to the
neighbors instead of the features, when possible.
-- ``activation``
A list with the activation function for each contextual point layer.
See
`the keras documentation on activations `_
for more details.
-- ``distance``
A list with the distance that must be used at each contextual point
layer. Supported values are ``"euclidean"`` and ``"squared"``.
-- ``ascending_order``
Whether to force distance-based ascending order of the neighborhoods
(``true``) or not (``false``).
-- ``aggregation``
A list with the aggregation strategy for each contextual point
layer, either ``"max"`` or ``"mean"``.
-- ``initializer``
A list with the initializer for the matrices and vectors of weights.
See
`Keras documentation on layer initializers `_
for further details.
-- ``regularizer``
A list with the regularizer for the matrices and vectors of weights.
See
`the keras documentation on regularizers `_
for more details.
-- ``constraint``
A list with the constraint for the matrices and vectors of weights.
See
`the keras documentation on constraints `_
for more details.
-- ``output_kernel_initializer``
The initialization method for the final 1D convolution that computes
the point-wise outputs of the neural network.
See
`the keras documentation on initializers `_
for more details.
-- ``model_handling``
Define how to handle the model, i.e., not the architecture itself but
how it must be used.
See the description of
:ref:`PointNet model handling `
for more details.
-- ``compilation_args``
The arguments governing the model's compilation. They include the
optimizer, the loss function and the metrics to be monitored during
training. See the :ref:`optimizers section ` and
:ref:`losses section ` for further details.
-- ``training_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_plot``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_distribution_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_classified_point_cloud_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_activations_path``
See :ref:`PointNet-like point-wise classifier arguments `.
.. _Hierarchical KPConv:
Hierarchical feature extraction with KPConv
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :class:`.ConvAutoencPwiseClassif` architecture can be configured with
Kernel Point Convolution (KPConv) for feature extraction operations. The
downsampling strategy can be defined through the
:class:`.FeaturesDownsamplingLayer` or the :class:`.StridedKPConvLayer`,
the upsampling strateg through the :class:`.FeaturesUpsamplingLayer`, and
the feature extraction through the :class:`.KPConvLayer`. The JSON below
illustrates how to configure KPConv-based hierarchical feature extractor using
the VL3D framework. For further details on the original KPConv architecture,
readers are referred to
`the KPConv paper (Thomas et al., 2019) `_
.
.. code-block:: json
{
"in_pcloud": [
"/mnt/netapp2/Store_uscciaep/lidar_data/hessigheim/vl3d/mined/Mar18_train_hsv_std.laz"
],
"out_pcloud": [
"/mnt/netapp2/Store_uscciaep/lidar_data/hessigheim/vl3d/kpconv_R/T1/*"
],
"sequential_pipeline": [
{
"train": "ConvolutionalAutoencoderPwiseClassifier",
"training_type": "base",
"fnames": ["Reflectance", "ones"],
"random_seed": null,
"model_args": {
"fnames": ["Reflectance", "ones"],
"num_classes": 11,
"class_names": ["LowVeg", "ImpSurf", "Vehicle", "UrbanFurni", "Roof", "Facade", "Shrub", "Tree", "Soil/Gravel", "VertSurf", "Chimney"],
"pre_processing": {
"pre_processor": "hierarchical_fps",
"support_strategy_num_points": 60000,
"to_unit_sphere": false,
"support_strategy": "fps",
"support_chunk_size": 2000,
"support_strategy_fast": true,
"center_on_pcloud": true,
"neighborhood": {
"type": "sphere",
"radius": 3.0,
"separation_factor": 0.8
},
"num_points_per_depth": [512, 256, 128, 64, 32],
"fast_flag_per_depth": [false, false, false, false, false],
"num_downsampling_neighbors": [1, 16, 8, 8, 4],
"num_pwise_neighbors": [32, 16, 16, 8, 4],
"num_upsampling_neighbors": [1, 16, 8, 8, 4],
"nthreads": 12,
"training_receptive_fields_distribution_report_path": "*/training_eval/training_receptive_fields_distribution.log",
"training_receptive_fields_distribution_plot_path": "*/training_eval/training_receptive_fields_distribution.svg",
"training_receptive_fields_dir": null,
"receptive_fields_distribution_report_path": "*/training_eval/receptive_fields_distribution.log",
"receptive_fields_distribution_plot_path": "*/training_eval/receptive_fields_distribution.svg",
"receptive_fields_dir": null,
"training_support_points_report_path": "*/training_eval/training_support_points.las",
"support_points_report_path": "*/training_eval/support_points.las"
},
"feature_extraction": {
"type": "KPConv",
"operations_per_depth": [2, 1, 1, 1, 1],
"feature_space_dims": [64, 64, 128, 256, 512, 1024],
"bn": true,
"bn_momentum": 0.0,
"activate": true,
"sigma": [3.0, 3.0, 3.0, 3.0, 3.0, 3.0],
"kernel_radius": [3.0, 3.0, 3.0, 3.0, 3.0, 3.0],
"num_kernel_points": [15, 15, 15, 15, 15, 15],
"deformable": [false, false, false, false, false, false],
"W_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W_regularizer": [null, null, null, null, null, null],
"W_constraint": [null, null, null, null, null, null],
"unary_convolution_wrapper": {
"activation": "relu",
"initializer": "glorot_uniform",
"bn": true,
"bn_momentum": 0.98,
"feature_dim_divisor": 2
}
},
"structure_alignment": null,
"features_alignment": null,
"downsampling_filter": "strided_kpconv",
"upsampling_filter": "mean",
"upsampling_bn": true,
"upsampling_momentum": 0.0,
"conv1d_kernel_initializer": "glorot_normal",
"output_kernel_initializer": "glorot_normal",
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"kpconv_representation_dir": "*/training_eval/kpconv_layers/",
"skpconv_representation_dir": "*/training_eval/skpconv_layers/",
"class_weight": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
"training_epochs": 300,
"batch_size": 16,
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
}
},
"compilation_args": {
"optimizer": {
"algorithm": "SGD",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 15000,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": true,
"show_layer_names": true,
"rankdir": "TB",
"expand_nested": true,
"dpi": 300,
"show_layer_activations": true
}
},
"autoval_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_evaluation_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_class_evaluation_metrics": ["P", "R", "F1", "IoU"],
"training_evaluation_report_path": "*/training_eval/evaluation.log",
"training_class_evaluation_report_path": "*/training_eval/class_evaluation.log",
"training_confusion_matrix_report_path": "*/training_eval/confusion.log",
"training_confusion_matrix_plot_path": "*/training_eval/confusion.svg",
"training_class_distribution_report_path": "*/training_eval/class_distribution.log",
"training_class_distribution_plot_path": "*/training_eval/class_distribution.svg",
"training_classified_point_cloud_path": "*/training_eval/classified_point_cloud.las",
"training_activations_path": null
},
{
"writer": "PredictivePipelineWriter",
"out_pipeline": "*pipe/KPC_T1.pipe",
"include_writer": false,
"include_imputer": false,
"include_feature_transformer": false,
"include_miner": false,
"include_class_transformer": false
}
]
}
The JSON above defines a :class:`.ConvAutoencPwiseClassif` that uses a
hierarchical furthest point sampling strategy with a 3D spherical neighborhood
and the KPConv operator for feature extraction. It is expected to work on a
feature space with a column of ones (for feature-unbiased geometric features)
and another of reflectances.
**Arguments**
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further details,
read the :ref:`training strategies section `.
.. _KPConv args fnames:
-- ``fnames``
The name of the features that must be given as input to the neural network.
For hierarchical autoencoders this list can contain ``"ones"`` to specify
whether to include a column of ones in the input space matrix. This
architecture does not support empty feature spaces as input, thus, when
no features are given, the input feature space must be represented with a
column of ones. **NOTE** that, for technical reasons, the feature names
should also be given inside the ``model_args`` dictionary.
.. _KPConv args random_seed:
-- ``random_seed``
Can be used to specify an integer like seed for any randomness-based
computation. Mostly to be used for reproducibility purposes. Note that
the initialization of a neural network is often based on random
distributions. This parameter does not affect those distributions, so
it will not guarantee reproducibility for of deep learning models.
-- ``model_args``
The model specification.
.. _KPConv args model fnames:
-- ``fnames``
The feature names must be given again inside the ``model_args``
dictionary due to technical reasons.
.. _KPConv args num_classes:
-- ``num_classess``
An integer specifying the number of classes involved in the
point-wise classification tasks.
.. _KPConv args class_names:
-- ``class_names``
The names of the classes involved in the classification task. Each
string corresponds to the class associated to its index in the list.
.. _KPConv args pre_processing:
-- ``pre_processing``
How the **select** and **fix** stages of the deep learning strategy
must be handled. Note that hierarchical autoencoders demand
hierarchical receptive fields. See the
:ref:`receptive fields ` and
:ref:`hierarchical FPS receptive field `
sections for further details.
-- ``feature_extraction``
The definition of the feature extraction operator. A detailed
description of the case when ``"type": "KPConv"`` is given below.
For a description of the case when ``"type": "PointNet"`` see
:ref:`the PointNet operator documentation `.
.. _KPConv args operations_per_depth:
-- ``operations_per_depth``
A list specifying how many operations per depth level. The i-th
element of the list gives the number of feature extraction
operations at depth i.
.. _KPConv args feature_space_dims:
-- ``feature_space_dims``
A list specifying the output dimensionality of the feature space
after each feature extration operation. The i-th element of the
list gives the dimensionality of the i-th feature extraction
operation.
.. _KPConv args bn:
-- ``bn``
Boolean flag to decide whether to enable batch normalization for
feature extraction.
.. _KPConv args bn_momentum:
-- ``bn_momentum``
Momentum for the moving average of the batch normalization, such
that
``new_mean = old_mean * momentum + batch_mean * (1 - momentum)``.
See the
`Keras documentation on batch normalization `_
for more details.
.. _KPConv args activate:
-- ``activate``
``True`` to activate the output of the KPConv, ``False`` otherwise.
.. _KPConv args sigma:
-- ``sigma``
The influence distance of the kernel points for each KPConv.
.. _KPConv args kernel_radius:
-- ``kernel_radius``
The radius of the ball where the kernel points belong for each
KPConv.
.. _KPConv args num_kernel_points:
-- ``num_kernel_points``
The number of points (i.e., structure space dimensionality) for
each KPConv kernel.
.. _KPConv args deformable:
-- ``deformable``
Whether the structure space of the KPConv will be optimized
(``True``) or not (``False``), for each KPConv.
-- ``W_initializer``
The initialization method for the weights of each KPConv.
See
`the keras documentation on initializers `_
for more details.
-- ``W_regularizer``
The regularization strategy for weights of each KPConv.
See
`the keras documentation on regularizers `_
for more details.
-- ``W_constraint``
The constraints of the weights of each KPConv.
See
`the keras documentation on constraints `_
for more details.
.. _KPConv args unary_convolution_wrapper:
-- ``unary_convolution_wrapper``
The specification of the unary convolutions (aka SharedMLPs) to
be applied before the KPConv layer to half the feature
dimensionality and also after to restore it.
-- ``activation``
The activation function for each unary convolution / SharedMLP.
See
`the keras documentation on activations `_
for more details.
-- ``activate_postwrap``
Whether to include an activation function after the unary
convolution (after the batch normalization, if any).
-- ``initializer``
The initialization method for the point-wise unary convolutions
(SharedMLPs). See
`the keras documentation on initializers `_
for more details.
-- ``bn``
Whether to enable batch normalization (``True``) or not
(``False``).
-- ``bn_momentum``
Momentum for the moving average of the batch normalization,
such that
``new_mean = old_mean * momentum + batch_mean * (1 - momentum)``.
See the
`Keras documentation on batch normalization `_
for more details.
-- ``postwrap_bn``
Whether to include a batch normalization layer after the unary
convolution.
-- ``feature_dim_divisor``
The divisor for the dimensionality in the unary convolution
wrapper. The number of features will be divided by this number.
The default is :math:`2`.
-- ``structure_alignment``
When given, this specification will govern the alignment of the
structure space.
-- ``tnet_pre_filters_spec``
List defining the number of pre-transformation filters at
each depth.
-- ``tnet_post_filters_spec``
List defining the number of post-transformation filters at
each depth.
-- ``kernel_initializer``
The kernel initialization method for the structure alignment
layers.
See
`the keras documentation on initializers `_
for more details.
.. _KPConv args features_alignment:
-- ``features_alignment``
When given, this specification will govern the alignment of the
feature space. It is like the ``structure_alignment`` dictionary
but it is applied to the features instead of the structure space.
-- ``downsampling_filter``
The type of downsampling filter. See
:class:`.StridedKPConvLayer`,
:class:`.FeaturesDownsamplingLayer`, and
:class:`.InterdimensionalPointTransformerLayer` for more details.
-- ``upsampling_filter``
The type of upsampling filter. See
:class:`.FeaturesUpsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` for more details.
.. _KPConv args upsampling_bn:
-- ``upsampling_bn``
Boolean flag to decide whether to enable batch normalization for
upsampling transformations.
.. _KPConv args upsampling_momentum:
-- ``upsampling_momentum``
Momentum for the moving average of the upsampling batch normalization,
such that
``new_mean = old_mean * momentum + batch_mean * (1-momentum)``.
See the
`Keras documentation on batch normalization `_
for more details.
.. _KPConv args conv1d_kernel_initializer:
-- ``conv1d_kernel_initializer``
The initialization method for the 1D convolutions during upsampling.
See
`the keras documentation on initializers `_
for more details.
.. _KPConv args output_kernel_initializer:
-- ``output_kernel_initializer``
The initialization method for the final 1D convolution that computes
the point-wise outputs of the neural network.
See
`the keras documentation on initializers `_
for more details.
.. _KPConv args model_handling:
-- ``model_handling``
Define how to handle the model, i.e., not the architecture itself but
how it must be used.
See the description of
:ref:`PointNet model handling `
for more details.
The main difference for hierarchical autoencoders using KPConv are:
-- ``kpconv_representation_dir``
Path where the plots and CSV data representing the KPConv kernels
will be stored.
-- ``skpconv_representation_dir``
Path where the plots and CSV data representing the strided KPConv
kernels will be stored.
.. _KPConv args compilation_args:
-- ``compilation_args``
The arguments governing the model's compilation. They include the
optimizer, the loss function and the metrics to be monitored during
training. See the :ref:`optimizers section ` and
:ref:`losses section ` for further details.
-- ``training_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_plot``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_distribution_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_classified_point_cloud_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_activations_path``
See :ref:`PointNet-like point-wise classifier arguments `.
.. _Hierarchical SFL-NET:
Hierarchical feature extraction with SFL-NET
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :class:`.ConvAutoencPwiseClassif` architecture can be configured as a
Slight Filter Learning Network (SFL-NET). This neural network for 3D point
clouds was introduced in
`the SFL-NET paper (Li et al., 2023) `_
. It uses a simplified version of KPConv and changes the shared MLPs by
hourglasses in the upsampling and final layers. On top of that, it uses the
hourglass layer to define a residual hourglass block that wraps each
feature extraction layer at the different depths of the encoding hierarchy.
The JSON below illustrates how to configure a SFL-NET-like hierarchical feature
extractor using the VL3D framework.
.. code-block:: json
{
"in_pcloud": [
"/oldext4/lidar_data/vl3dhack/data/dales/train/5080_54435.laz"
],
"out_pcloud": [
"/oldext4/lidar_data/vl3dhack/multiclass/out/DL_SFLNET/T1/*"
],
"sequential_pipeline": [
{
"class_transformer": "ClassReducer",
"on_predictions": false,
"input_class_names": ["noclass", "ground", "vegetation", "cars", "trucks", "powerlines", "fences", "poles", "buildings"],
"output_class_names": ["ground", "vegetation", "buildings", "powerlines", "objects", "noclass"],
"class_groups": [["ground"], ["vegetation"], ["buildings"], ["powerlines"], ["cars", "trucks", "fences", "poles"], ["noclass"]],
"report_path": "*class_reduction.log",
"plot_path": "*class_reduction.svg"
},
{
"train": "ConvolutionalAutoencoderPwiseClassifier",
"training_type": "base",
"fnames": ["ones"],
"random_seed": null,
"model_args": {
"fnames": ["ones"],
"num_classes": 6,
"class_names": ["ground", "vegetation", "buildings", "powerlines", "objects", "noclass"],
"pre_processing": {
"pre_processor": "hierarchical_fps",
"support_strategy_num_points": 200000,
"to_unit_sphere": false,
"support_strategy": "fps",
"support_chunk_size": 10000,
"support_strategy_fast": true,
"receptive_field_oversampling": {
"min_points": 2,
"strategy": "nearest",
"k": 3,
"radius": 0.5
},
"center_on_pcloud": true,
"neighborhood": {
"type": "sphere",
"radius": 6.0,
"separation_factor": 0.8
},
"num_points_per_depth": [256, 128, 64, 32, 16],
"fast_flag_per_depth": [false, false, false, false, false],
"num_downsampling_neighbors": [1, 16, 16, 16, 16],
"num_pwise_neighbors": [16, 16, 16, 16, 16],
"num_upsampling_neighbors": [1, 16, 16, 16, 16],
"nthreads": -1,
"training_receptive_fields_distribution_report_path": "*/training_eval/training_receptive_fields_distribution.log",
"training_receptive_fields_distribution_plot_path": "*/training_eval/training_receptive_fields_distribution.svg",
"training_receptive_fields_dir": "*/training_eval/training_rf/",
"receptive_fields_distribution_report_path": "*/training_eval/receptive_fields_distribution.log",
"receptive_fields_distribution_plot_path": "*/training_eval/receptive_fields_distribution.svg",
"_receptive_fields_dir": "*/training_eval/receptive_fields/",
"training_support_points_report_path": "*/training_eval/training_support_points.las",
"support_points_report_path": "*/training_eval/support_points.las"
},
"feature_extraction": {
"type": "LightKPConv",
"operations_per_depth": [2, 1, 1, 1, 1],
"feature_space_dims": [64, 64, 128, 256, 512, 1024],
"bn": true,
"bn_momentum": 0.98,
"activate": true,
"sigma": [6.0, 6.0, 7.5, 9.0, 10.5, 12.0],
"kernel_radius": [6.0, 6.0, 6.0, 6.0, 6.0, 6.0],
"num_kernel_points": [15, 15, 15, 15, 15, 15],
"deformable": [false, false, false, false, false, false],
"W_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W_regularizer": [null, null, null, null, null, null],
"W_constraint": [null, null, null, null, null, null],
"A_trainable": [true, true, true, true, true ,true],
"A_regularizer": [null, null, null, null, null, null],
"A_constraint": [null, null, null, null, null, null],
"A_initializer": ["ones", "ones", "ones", "ones", "ones", "ones"],
"unary_convolution_wrapper": null,
"hourglass_wrapper": {
"internal_dim": [2, 2, 4, 16, 32, 64],
"parallel_internal_dim": [8, 8, 16, 32, 64, 128],
"activation": ["relu", "relu", "relu", "relu", "relu", "relu"],
"activation2": [null, null, null, null, null, null],
"regularize": [true, true, true, true, true, true],
"W1_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W1_regularizer": [null, null, null, null, null, null],
"W1_constraint": [null, null, null, null, null, null],
"W2_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W2_regularizer": [null, null, null, null, null, null],
"W2_constraint": [null, null, null, null, null, null],
"loss_factor": 0.1,
"subspace_factor": 0.125,
"feature_dim_divisor": 4,
"bn": false,
"bn_momentum": 0.98,
"out_bn": true,
"out_bn_momentum": 0.98,
"out_activation": "relu"
}
},
"features_alignment": null,
"downsampling_filter": "strided_lightkpconv",
"upsampling_filter": "mean",
"upsampling_bn": true,
"upsampling_momentum": 0.98,
"upsampling_hourglass": {
"activation": "relu",
"activation2": null,
"regularize": true,
"W1_initializer": "glorot_uniform",
"W1_regularizer": null,
"W1_constraint": null,
"W2_initializer": "glorot_uniform",
"W2_regularizer": null,
"W2_constraint": null,
"loss_factor": 0.1,
"subspace_factor": 0.125
},
"conv1d": false,
"conv1d_kernel_initializer": "glorot_normal",
"output_kernel_initializer": "glorot_normal",
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"kpconv_representation_dir": "*/training_eval/kpconv_layers/",
"skpconv_representation_dir": "*/training_eval/skpconv_layers/",
"lkpconv_representation_dir": "*/training_eval/lkpconv_layers/",
"slkpconv_representation_dir": "*/training_eval/slkpconv_layers/",
"class_weight": [1.0, 1.0, 1.0, 1.0, 1.0, 0.0],
"training_epochs": 300,
"batch_size": 64,
"training_sequencer": {
"type": "DLSequencer",
"random_shuffle_indices": true,
"augmentor": {
"transformations": [
{
"type": "Rotation",
"axis": [0, 0, 1],
"angle_distribution": {
"type": "uniform",
"start": -3.141592,
"end": 3.141592
}
},
{
"type": "Scale",
"scale_distribution": {
"type": "uniform",
"start": 0.99,
"end": 1.01
}
},
{
"type": "Jitter",
"noise_distribution": {
"type": "normal",
"mean": 0,
"stdev": 0.001
}
}
]
}
},
"prediction_reducer": {
"reduce_strategy" : {
"type": "MeanPredReduceStrategy"
},
"select_strategy": {
"type": "ArgMaxPredSelectStrategy"
}
},
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
}
},
"compilation_args": {
"optimizer": {
"algorithm": "Adam",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 9000,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": true,
"show_layer_names": true,
"rankdir": "TB",
"expand_nested": true,
"dpi": 300,
"show_layer_activations": true
}
},
"autoval_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_evaluation_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_class_evaluation_metrics": ["P", "R", "F1", "IoU"],
"training_evaluation_report_path": "*/training_eval/evaluation.log",
"training_class_evaluation_report_path": "*/training_eval/class_evaluation.log",
"training_confusion_matrix_report_path": "*/training_eval/confusion.log",
"training_confusion_matrix_plot_path": "*/training_eval/confusion.svg",
"training_class_distribution_report_path": "*/training_eval/class_distribution.log",
"training_class_distribution_plot_path": "*/training_eval/class_distribution.svg",
"training_classified_point_cloud_path": "*/training_eval/classified_point_cloud.las",
"training_activations_path": null
},
{
"writer": "PredictivePipelineWriter",
"out_pipeline": "*/model/SFLNET.pipe",
"include_writer": false,
"include_imputer": true,
"include_feature_transformer": true,
"include_miner": true,
"include_class_transformer": false,
"include_clustering": false,
"ignore_predictions": false
}
]
}
The JSON above defines a :class:`.ConvAutoencPwiseClassif` that uses a
hierarchical furthest point sampling strategy with a 3D spherical neighborhood
to prepare the input for a SFL-NET model. The subspace and loss factors are
configured to :math:`\alpha=1/8` and :math:`\beta=1/10`, as recommended in
`the SFL-NET paper (Li et al., 2023) `_
.
**Arguments**
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further details,
read the :ref:`training strategies section `.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``random_seed``
See :ref:`KPConv arguments documentation `.
-- ``model_args``
The model specification.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``num_classes``
See :ref:`KPConv arguments documentation `.
-- ``class_names``
See :ref:`KPConv arguments documentation `.
-- ``pre_processing``
See :ref:`KPConv arguments documentation `.
-- ``feature_extraction``
The definition of the feature extraction operator. A detailed
description of the case when ``"type": "LightKPConv"`` and all
the shared MLPs / unary convolutions are replaced by hourglass
layers and hourglass residual blocks is given below. For a
description of the case when ``"type": "KPConv"`` see
:ref:`the KPConv operator documentation `.
For a description of the general case ``"type": "LightKPConv"``
see
:ref:`the LightKPConv operator documentation `
.
-- ``operations_per_depth``
See :ref:`KPConv arguments documentation `.
-- ``feature_space_dims``
See :ref:`KPConv arguments documentation `.
-- ``bn``
See :ref:`KPConv arguments documentation `.
-- ``bn_momentum``
See :ref:`KPConv arguments documentation `.
-- ``activate``
See :ref:`KPConv arguments documentation `.
-- ``sigma``
See :ref:`KPConv arguments documentation `.
-- ``kernel_radius``
See :ref:`KPConv arguments documentation `.
-- ``num_kernel_points``
See :ref:`KPConv arguments documentation `.
-- ``deformable``
See :ref:`KPConv arguments documentation `.
-- ``W_initializer``
The initialization method for the weights of each light KPConv.
See
`the keras documentation on initializers `_
for more details.
-- ``W_regularizer``
The regularization strategy for the weights of each light KPConv.
See
`the keras documentation on regularizers `_
for more details.
-- ``W_constraint``
The constraints of the weights of each light KPConv.
See
`the keras documentation on constraints `_
for more details.
-- ``unary_convolution_wrapper``
To mimic a SFL-NET this specification must be set to null because
SFL-NET uses a residual hourglass block instead of shared MLPs.
.. _SFL-NET args hourglass_wrapper:
-- ``hourglass_wrapper``
The specification of how to use hourglass layers to wrap the
feature extraction layers. To mimic a SFL-NET it is necessary
to use an hourglass wrapper and avoid unary convolutions at all.
-- ``internal_dim``
A list with the internal dimensions for the first transform
in a :class:`.HourglassLayer`. **NOTE that this value is
ignored when a subspace factor** :math:`\alpha` **is given**.
-- ``parallel_internal_dim``
A list with the internal dimensions for the
:class:`.HourglassLayer` in the residual block.
**NOTE that this value is ignored when a subspace factor**
:math:`\alpha` **is given**.
-- ``activation``
The first activation function (i.e., :math:`\sigma_1`) for each
:class:`.HourglassLayer`.
See
`the keras documentation on activations `_
for more details.
-- ``activation2``
The second activation function (i.e., :math:`\sigma_2`) for each
:class:`.HourglassLayer`.
See
`the keras documentation on activations `_
for more details.
-- ``activate_postwrap``
Whether to include an activation function to finish the
wrapping of the feature extractor operator.
-- ``activate_residual``
Whether to include an activation function to finish the
residual block. Note that the standard practice is to avoid
activation functions at the end of residual feature extraction
blocks to keep them linear.
-- ``regularize``
Whether to regularize each :class:`.HourglassLayer` by adding
:math:`\beta + \mathcal{L}_h` to the loss function (``True``)
or not (``False``).
-- ``spectral_strategy``
What strategy use to compute the spectral norm. It can be
either "unsafe" (fast but might break during training),
"safe" (will work during training but can be twice slower),
or "approx" (as fast as unsafe but computing the approximated
norm after applying a small tikhonov regularization to prevent
numerical issues, DEFAULT).
-- ``W1_initializer``
The initialization method for the first matrix of weights for
each :class:`.HourglassLayer`. See
`the keras documentation on initializers `_
for more details.
-- ``W1_regularizer``
The regularization strategy for the first matrix of weights
for each :class:`.HourglassLayer`. See
`the keras documentation on regularizers `_
for more details.
-- ``W1_constraint``
The constraint of the first matrix of weights for each
:class:`.HourglassLayer`. See
`the keras documentation on constraints `_
for more details.
-- ``W2_initializer``
The initialization method for the second matrix of weights for
each :class:`.HourglassLayer`. See
`the keras documentation on initializers `_
for more details.
-- ``W2_regularizer``
The regularization strategy for the second matrix of weights
for each :class:`.HourglassLayer`. See
`the keras documentation on regularizers `_
for more details.
-- ``W2_constraint``
The constraint of the second matrix of weights for each
:class:`.HourglassLayer`. See
`the keras documentation on constraints `_
for more details.
-- ``loss_factor``
The loss factor :math:`\beta` for any :class:`.HourglassLayer`.
It governs the impact of the extra term :math:`\beta \mathcal{L}_h`
in the loss function. **NOTE that the loss factor will only be
considered when regularize is set to** ``True``.
-- ``subspace_factor``
The subspace factor :math:`\alpha` for any :class:`.HourglassLayer`.
When given, the internal dimensionality :math:`D_h` will be:
.. math::
D_h = \alpha \; \max \; \left\{D_{\mathrm{in}}, D_{\mathrm{out}}\right\}
**NOTE that when given, any specification of the internal
dimensionalities will be replaced by the values derived by
applying the subspace factor**.
.. _SFL-NET args parallel_internal_dim:
-- ``feature_dim_divisor``
The divisor to determine the output dimensionality of the
pre-wrapper hourglass layer. The dimensionality will be
calculated as
:math:`D_{\text{in}} / \text{feature_dim_divisor}`.
.. _SFL-NET args hourglass bn:
-- ``bn``
Whether to include batch normalization to the main branch
before merging with the residual block.
-- ``bn_momentum``
The momentum for the moving average of the batch normalization
(as explained for
:ref:`PointNet++ bn_momentum specification `
).
-- ``out_bn``
Whether to include a batch normalization layer after the linear
superposition of the residual block with the main branch
(``true``) or not (``false``).
-- ``merge_bn``
Alias for ``out_bn``. Note that if both are specified,
``out_bn`` has preference over ``merge_bn``.
-- ``out_bn_momentum``
The momentum for the moving average of the batch normalization
after the linear superposition of the residual block with the
main branch (as explained for
:ref:`PointNet++ bn_momentum specification `
).
-- ``out_activation``
Whether to include an activation layer after the linear
superposition (and after the batch normalization, if any)
of the residual block with the main branch (``true``) or
not (``false``).
-- ``features_alignment``
It must be null to mimic a SFL-NET model.
See :ref:`KPConv arguments documentation `
for further details.
-- ``downsampling_filter``
It must be configured to ``"strided_lightkpconv"`` (see
:class:`.StridedLightKPConvLayer`) to mimic a SFL-NET model.
-- ``upsampling_filter``
The original upsampling strategy for KPConv and derived architectures
is ``"nearest"`` (i.e., nearest upsampling). However, in VL3D++
examples we often use ``"mean"`` for our baseline models because
we found it yields better results. See
:class:`.FeaturesUpsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` for more details.
-- ``upsampling_bn``
See :ref:`KPConv arguments documentation `.
-- ``upsampling_momentum``
See :ref:`KPConv arguments documentation `.
-- ``conv1d``
Boolean flag governing whether to use unary convolutions (shared
MLPs) to wrap the hourglass or not. SFL-NET models use hourglass
layers instead of shared MLPs so it must be set to ``False``
when mimicking this model.
-- ``conv1d_kernel_initializer``
See :ref:`KPConv arguments documentation `.
-- ``output_kernel_initializer``
See :ref:`KPConv arguments documentation `.
-- ``model_handling``
See :ref:`KPConv arguments documentation `
and :ref:`LightKPConv arguments documentation `
.
-- ``compilation_args``
See :ref:`KPConv arguments documentation `.
-- ``training_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_plot``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_distribution_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_classified_point_cloud_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_activations_path``
See :ref:`PointNet-like point-wise classifier arguments `.
.. _Hierarchical LightKPConv:
Hierarchical feature extraction with LightKPConv
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :class:`.ConvAutoencPwiseClassif` architecture can be configured using a
light-weight version of the :class:`.KPConvLayer` that for :math:`K` kernel
points uses only two matrices: 1) the weights
:math:`\pmb{W} \in \mathbb{R}^{D_{\mathrm{in}} \times D_{\mathrm{out}}}` and
2) the scale factors
:math:`\pmb{A} \in \mathbb{R}^{m_q \times D_{\mathrm{in}}}`. Furthe details
can be seen in the :class:`.LightKPConvLayer` documentation. The main
difference with the classical :class:`.KPConvLayer` consists in updating
the original equation:
.. math::
\left(\pmb{P} * \mathcal{Q}\right) (\pmb{x}_{i*}) =
\sum_{\pmb{x}_{j*} \in \mathcal{N}_{\pmb{x}_{i*}}}{
\Biggl[{
\sum_{k=1}^{m_q} \max \; \biggl\{
0,
1 - \dfrac{
\lVert
\pmb{x}_{j*} -
\pmb{x}_{i*} -
\pmb{q}_{k*}
\rVert
}{
\sigma
}
\biggr\}
}
\pmb{W}_{k}^\intercal
\Biggr]
\pmb{f}_{j*}
}
to the light-weight version:
.. math::
\left(\pmb{P} * \mathcal{Q} \right) (\pmb{x}_{i*}) =
\sum_{\pmb{x}_{j*} \in \mathcal{N}_{\pmb{x}_{i*}}}
\left(\operatorname{diag}\left[\sum_{k=1}^{m_q}{
\max \; \left\{
0,
1 - \dfrac{
\lVert
\pmb{x}_{j*} -
\pmb{x}_{i*} -
\pmb{q}_{k*}
\rVert
}{
\sigma
}
\right\}
\pmb{a}_{k*}
}
\right] \pmb{W}\right)^{\intercal} \pmb{f}_{j*}
Note that, when all the shared MLPs are replaced by hourglass blocks, the
:class:`.LightKPConvLayer` can be used in the context of a
:class:`.ConvAutoencPwiseClassif` model to mimic the SFL-NET model as described
in the
:ref:`hierarchical feature extraction with SFL-NET section `
. The rest of this section is devoted to describe the general usage of the
:class:`.LightKPConvLayer`. The JSON bellow illustrates how to configure
LightKPConv-based hierarchical feature extractors using the VL3D framework.
.. code-block:: json
{
"in_pcloud": [
"/oldext4/lidar_data/vl3dhack/data/dales/train/5080_54435.laz"
],
"out_pcloud": [
"/oldext4/lidar_data/vl3dhack/multiclass/out/DL_LKPC/T1/*"
],
"sequential_pipeline": [
{
"class_transformer": "ClassReducer",
"on_predictions": false,
"input_class_names": ["noclass", "ground", "vegetation", "cars", "trucks", "powerlines", "fences", "poles", "buildings"],
"output_class_names": ["ground", "vegetation", "buildings", "powerlines", "objects", "noclass"],
"class_groups": [["ground"], ["vegetation"], ["buildings"], ["powerlines"], ["cars", "trucks", "fences", "poles"], ["noclass"]],
"report_path": "*class_reduction.log",
"plot_path": "*class_reduction.svg"
},
{
"train": "ConvolutionalAutoencoderPwiseClassifier",
"training_type": "base",
"fnames": ["ones"],
"random_seed": null,
"model_args": {
"fnames": ["ones"],
"num_classes": 6,
"class_names": ["ground", "vegetation", "buildings", "powerlines", "objects", "noclass"],
"pre_processing": {
"pre_processor": "hierarchical_fps",
"support_strategy_num_points": 200000,
"to_unit_sphere": false,
"support_strategy": "fps",
"support_chunk_size": 10000,
"support_strategy_fast": true,
"receptive_field_oversampling": {
"min_points": 2,
"strategy": "nearest",
"k": 3,
"radius": 0.5
},
"center_on_pcloud": true,
"neighborhood": {
"type": "sphere",
"radius": 6.0,
"separation_factor": 0.8
},
"num_points_per_depth": [256, 128, 64, 32, 16],
"fast_flag_per_depth": [false, false, false, false, false],
"num_downsampling_neighbors": [1, 16, 16, 16, 16],
"num_pwise_neighbors": [16, 16, 16, 16, 16],
"num_upsampling_neighbors": [1, 16, 16, 16, 16],
"nthreads": -1,
"training_receptive_fields_distribution_report_path": "*/training_eval/training_receptive_fields_distribution.log",
"training_receptive_fields_distribution_plot_path": "*/training_eval/training_receptive_fields_distribution.svg",
"training_receptive_fields_dir": "*/training_eval/training_rf/",
"receptive_fields_distribution_report_path": "*/training_eval/receptive_fields_distribution.log",
"receptive_fields_distribution_plot_path": "*/training_eval/receptive_fields_distribution.svg",
"_receptive_fields_dir": "*/training_eval/receptive_fields/",
"training_support_points_report_path": "*/training_eval/training_support_points.las",
"support_points_report_path": "*/training_eval/support_points.las"
},
"feature_extraction": {
"type": "LightKPConv",
"operations_per_depth": [2, 1, 1, 1, 1],
"feature_space_dims": [64, 64, 128, 256, 512, 1024],
"bn": true,
"bn_momentum": 0.98,
"activate": true,
"sigma": [6.0, 6.0, 7.5, 9.0, 10.5, 12.0],
"kernel_radius": [6.0, 6.0, 6.0, 6.0, 6.0, 6.0],
"num_kernel_points": [15, 15, 15, 15, 15, 15],
"deformable": [false, false, false, false, false, false],
"W_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W_regularizer": [null, null, null, null, null, null],
"W_constraint": [null, null, null, null, null, null],
"A_trainable": [true, true, true, true, true ,true],
"A_regularizer": [null, null, null, null, null, null],
"A_constraint": [null, null, null, null, null, null],
"A_initializer": ["ones", "ones", "ones", "ones", "ones", "ones"],
"_unary_convolution_wrapper": {
"activation": "relu",
"initializer": "glorot_uniform",
"bn": true,
"bn_momentum": 0.98,
"feature_dim_divisor": 2
},
"hourglass_wrapper": {
"internal_dim": [2, 2, 4, 16, 32, 64],
"parallel_internal_dim": [8, 8, 16, 32, 64, 128],
"activation": ["relu", "relu", "relu", "relu", "relu", "relu"],
"activation2": [null, null, null, null, null, null],
"regularize": [true, true, true, true, true, true],
"W1_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W1_regularizer": [null, null, null, null, null, null],
"W1_constraint": [null, null, null, null, null, null],
"W2_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W2_regularizer": [null, null, null, null, null, null],
"W2_constraint": [null, null, null, null, null, null],
"loss_factor": 0.1,
"subspace_factor": 0.125,
"feature_dim_divisor": 4,
"bn": false,
"bn_momentum": 0.98,
"out_bn": true,
"out_bn_momentum": 0.98,
"out_activation": "relu"
}
},
"features_alignment": null,
"downsampling_filter": "strided_lightkpconv",
"upsampling_filter": "mean",
"upsampling_bn": true,
"upsampling_momentum": 0.98,
"_upsampling_hourglass": {
"activation": "relu",
"activation2": null,
"regularize": true,
"W1_initializer": "glorot_uniform",
"W1_regularizer": null,
"W1_constraint": null,
"W2_initializer": "glorot_uniform",
"W2_regularizer": null,
"W2_constraint": null,
"loss_factor": 0.1,
"subspace_factor": 0.125
},
"conv1d": true,
"conv1d_kernel_initializer": "glorot_normal",
"output_kernel_initializer": "glorot_normal",
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"_features_structuring_representation_dir": "*/training_eval/feat_struct_layer/",
"kpconv_representation_dir": "*/training_eval/kpconv_layers/",
"skpconv_representation_dir": "*/training_eval/skpconv_layers/",
"lkpconv_representation_dir": "*/training_eval/lkpconv_layers/",
"slkpconv_representation_dir": "*/training_eval/slkpconv_layers/",
"class_weight": [1.0, 1.0, 1.0, 1.0, 1.0, 0.0],
"training_epochs": 300,
"batch_size": 64,
"training_sequencer": {
"type": "DLSequencer",
"random_shuffle_indices": true,
"augmentor": {
"transformations": [
{
"type": "Rotation",
"axis": [0, 0, 1],
"angle_distribution": {
"type": "uniform",
"start": -3.141592,
"end": 3.141592
}
},
{
"type": "Scale",
"scale_distribution": {
"type": "uniform",
"start": 0.99,
"end": 1.01
}
},
{
"type": "Jitter",
"noise_distribution": {
"type": "normal",
"mean": 0,
"stdev": 0.001
}
}
]
}
},
"prediction_reducer": {
"reduce_strategy" : {
"type": "MeanPredReduceStrategy"
},
"select_strategy": {
"type": "ArgMaxPredSelectStrategy"
}
},
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
}
},
"compilation_args": {
"optimizer": {
"algorithm": "Adam",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 9000,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": true,
"show_layer_names": true,
"rankdir": "TB",
"expand_nested": true,
"dpi": 300,
"show_layer_activations": true
}
},
"autoval_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_evaluation_metrics": ["OA", "P", "R", "F1", "IoU", "wP", "wR", "wF1", "wIoU", "MCC", "Kappa"],
"training_class_evaluation_metrics": ["P", "R", "F1", "IoU"],
"training_evaluation_report_path": "*/training_eval/evaluation.log",
"training_class_evaluation_report_path": "*/training_eval/class_evaluation.log",
"training_confusion_matrix_report_path": "*/training_eval/confusion.log",
"training_confusion_matrix_plot_path": "*/training_eval/confusion.svg",
"training_class_distribution_report_path": "*/training_eval/class_distribution.log",
"training_class_distribution_plot_path": "*/training_eval/class_distribution.svg",
"training_classified_point_cloud_path": "*/training_eval/classified_point_cloud.las",
"training_activations_path": null
},
{
"writer": "PredictivePipelineWriter",
"out_pipeline": "*/model/LKPConv.pipe",
"include_writer": false,
"include_imputer": true,
"include_feature_transformer": true,
"include_miner": true,
"include_class_transformer": false,
"include_clustering": false,
"ignore_predictions": false
}
]
}
The JSON above defines a :class:`.ConvAutoencPwiseClassif` that uses a
hierarchical furthest point sampling strategy with a 3D spherical neighborhood
to prepare the input for a LightKPConv-based model. It uses
:class:`.HourglassLayer` and :class:`.StridedLightKPConvLayer` during
the hierarchical encoding (similar to a
:ref:`SFL-NET model `) and a
:class:`.FeaturesUpsamplingLayer` with a mean reduction as well as
shared MLPs (unary convolutions) during the hierarchical decoding.
**Arguments**
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further details,
read the :ref:`training strategies section `.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``random_seed``
See :ref:`KPConv arguments documentation `.
-- ``model_args``
The model specification.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``num_classes``
See :ref:`KPConv arguments documentation `.
-- ``class_names``
See :ref:`KPConv arguments documentation `.
-- ``pre_processing``
See :ref:`KPConv arguments documentation `.
-- ``feature_extraction``
The definition of the feature extraction operator. A detailed
description of the case when ``"type": "LightKPConv"`` is given below.
For a description of the case when ``"type": "PointNet"`` see
:ref:`the PointNet operator documentation `,
for the case ``"type": "KPConv"`` see
:ref:`the KPConv operator documentation `,
and to mimic a SFL-NET model see
:ref:`the SFL-NET documentation `.
-- ``operations_per_depth``
See :ref:`KPConv arguments documentation `.
-- ``feature_space_dims``
See :ref:`KPConv arguments documentation `.
-- ``bn``
See :ref:`KPConv arguments documentation `.
-- ``bn_momentum``
See :ref:`KPConv arguments documentation `.
-- ``activate``
See :ref:`KPConv arguments documentation `.
-- ``sigma``
See :ref:`KPConv arguments documentation `.
-- ``kernel_radius``
See :ref:`KPConv arguments documentation `.
-- ``num_kernel_points``
See :ref:`KPConv arguments documentation `.
-- ``deformable``
See :ref:`KPConv arguments documentation `.
-- ``W_initializer``
The initialization method for the weights of each light KPConv.
See
`the keras documentation on initializers `_
for more details.
-- ``W_regularizer``
The regularization strategy for weights of each light KPConv.
See
`the keras documentation on regularizers `_
for more details.
-- ``W_constraint``
The constraints of the weights of each light KPConv.
See
`the keras documentation on constraints `_
for more details.
-- ``unary_convolution_wrapper``
It can be used to configure a LightKPconv model that uses
shared MLPs to wrap the feature extraction operators like a
:ref:`KPConv model ` or it can be set
to null to use an ``hourglass_wrapper`` instead, similar to
a :ref:`SFL-NET model `. See
:ref:`the KPConv arguments documentation `
for further details.
-- ``hourglass_wrapper``
The specification of how to use hourglass layers to wrap the
feature extraction layers. See
:ref:`the SFL-NET arguments documentation `
for further details.
-- ``features_alignment``
See :ref:`KPConv arguments documentation `.
-- ``downsampling_filter``
It can be configured to ``"strided_lightkpconv"`` (see
:class:`.StridedLightKPConvLayer`) but it is also possible to use
``"strided_kpconv"`` to use the classical :class:`.StridedKPConvLayer`
during downsampling. The :class:`.FeaturesDownsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` are also
supported.
-- ``upsampling_filter``
The original upsampling strategy for KPConv and derived architectures
is ``"nearest"`` (i.e., nearest upsampling). However, in VL3D++
examples we often use ``"mean"`` for our baseline models because
we found it yields better results. See
:class:`.FeaturesUpsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` for more details.
-- ``upsampling_bn``
See :ref:`KPConv arguments documentation `.
-- ``upsampling_momentum``
See :ref:`KPConv arguments documentation `.
-- ``conv1d``
Boolean flag governing whether to use unary convolutions (shared
MLPs) to wrap the hourglass or not. SFL-NET models use hourglass
layers instead (i.e., ``False``), classical KPConv models use shared
MLPs instead (i.e., ``True``).
-- ``conv1d_kernel_initializer``
See :ref:`KPConv arguments documentation `.
-- ``output_kernel_initializer``
See :ref:`KPConv arguments documentation `.
.. _LightKPConv args model_handling:
-- ``model_handling``
The model handling specification can be read in
:ref:`the KPConv arguments documentation `.
Here, only the special arguments for LightKPConv-based models are
detailed:
-- ``lkpconv_representation_dir``
Path where the plots and CSV data representing the LightKPConv
layers will be stored.
-- ``slkpconv_representation_dir``
Path where the plots and CSV data representing the strided
LightKPConv layers will be stored.
-- ``compilation_args``
See :ref:`KPConv arguments documentation `.
-- ``training_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_plot``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_distribution_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_classified_point_cloud_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_activations_path``
See :ref:`PointNet-like point-wise classifier arguments `.
.. _Hierarchical PointTransformer:
Hierarchical feature extraction with PointTransformer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :class:`.ConvAutoencPwiseClassif` architecture can be configured using
:class:`.PointTransformerLayer` as the feature extraction strategy. Besides, the
downsampling and upsampling operations can be carried out through
:class:`.InterdimensionalPointTransformerLayer`. The
:class:`.PointTransformerLayer` feature extractor can be summarized through the
following equation
.. math::
\pmb{\hat{f}}_{i*} = \sum_{\pmb{x}_{j*} \in \mathcal{N}(\pmb{x}_{i*})}{
\sigma\bigl(
\gamma(\psi(\pmb{f}_{j*}) - \phi(\pmb{f}_{i*}) + \delta(\pmb{x}_{i*}, \pmb{x}_{j*}))
\bigr) \odot \bigl(
\alpha(\pmb{f}_{j*}) + \delta(\pmb{x}_{i*}, \pmb{x}_{j*})
\bigr)
}
,
where the positional encoding :math:`\delta(\pmb{x}_{i*}, \pmb{x}_{j*})`
corresponds to
.. math::
\delta(\pmb{x}_{i*}, \pmb{x}_{j*}) = \tilde{\sigma}_{\theta}\bigl(
\sigma_{\theta}(
(\pmb{x}_{j*} - \pmb{x}_{i*}) \pmb{\Theta} \oplus \pmb{\theta}
) \pmb{\widetilde{\Theta}} \oplus \pmb{\tilde{\theta}}
\bigr)
.
For further details about the variables see the :class:`.PointTransformerLayer`
class documentation and
`the Point Transformer paper (Zhao et al., 2021) `_.
The JSON below illustrates how to configure Point Transformer-based
hierarchical feature extractors using the VL3D++ framework.
.. code-block:: json
{
"in_pcloud": [
"/ext4/hei/Hessigheim_Benchmark/Epoch_March2018/vl3d/mined/Mar18_train_hsv_std.laz"
],
"out_pcloud": [
"/ext4/hei/Hessigheim_Benchmark/Epoch_March2018/vl3d/out/pttransf/T1/*"
],
"sequential_pipeline": [
{
"train": "ConvolutionalAutoencoderPwiseClassifier",
"training_type": "base",
"fnames": ["ones", "HSV_Hrad", "HSV_S", "HSV_V"],
"random_seed": null,
"model_args": {
"fnames": ["ones", "HSV_Hrad", "HSV_S", "HSV_V"],
"num_classes": 11,
"class_names": ["LowVeg", "ImpSurf", "Vehicle", "UrbanFurni", "Roof", "Facade", "Shrub", "Tree", "Soil/Gravel", "VertSurf", "Chimney"],
"pre_processing": {
"pre_processor": "hierarchical_fpspp",
"support_strategy_num_points": 25000,
"to_unit_sphere": false,
"support_strategy": "fps",
"support_strategy_fast": 2,
"min_distance": 0.03,
"receptive_field_oversampling": {
"min_points": 2,
"strategy": "nearest",
"k": 3,
"radius": 0.5
},
"center_on_pcloud": true,
"training_class_distribution": [2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250],
"neighborhood": {
"type": "sphere",
"radius": 5.0,
"separation_factor": 0.8
},
"num_points_per_depth": [4096, 1024, 256, 64, 16],
"fast_flag_per_depth": [4, 4, false, false, false],
"num_downsampling_neighbors": [1, 16, 16, 16, 16],
"num_pwise_neighbors": [16, 16, 16, 16, 16],
"num_upsampling_neighbors": [1, 16, 16, 16, 16],
"nthreads": -1,
"training_receptive_fields_distribution_report_path": null,
"training_receptive_fields_distribution_plot_path": null,
"training_receptive_fields_dir": null,
"receptive_fields_distribution_report_path": null,
"receptive_fields_distribution_plot_path": null,
"receptive_fields_dir": null,
"training_support_points_report_path": null,
"support_points_report_path": null
},
"feature_extraction": {
"type": "PointTransformer",
"operations_per_depth": [2, 1, 1, 1, 1],
"feature_space_dims": [64, 64, 96, 128, 192, 256],
"bn": true,
"bn_momentum": 0.98,
"activate": true,
"Phi_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Phi_regularizer": [null, null, null, null, null, null],
"Phi_constraint": [null, null, null, null, null, null],
"Psi_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Psi_regularizer": [null, null, null, null, null, null],
"Psi_constraint": [null, null, null, null, null, null],
"A_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"A_regularizer": [null, null, null, null, null, null],
"A_constraint": [null, null, null, null, null, null],
"Gamma_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Gamma_regularizer": [null, null, null, null, null, null],
"Gamma_constraint": [null, null, null, null, null, null],
"Theta_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Theta_regularizer": [null, null, null, null, null, null],
"Theta_constraint": [null, null, null, null, null, null],
"ThetaTilde_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"ThetaTilde_regularizer": [null, null, null, null, null, null],
"ThetaTilde_constraint": [null, null, null, null, null, null],
"phi_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"phi_regularizer": [null, null, null, null, null, null],
"phi_constraint": [null, null, null, null, null, null],
"psi_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"psi_regularizer": [null, null, null, null, null, null],
"psi_constraint": [null, null, null, null, null, null],
"a_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"a_regularizer": [null, null, null, null, null, null],
"a_constraint": [null, null, null, null, null, null],
"gamma_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"gamma_regularizer": [null, null, null, null, null, null],
"gamma_constraint": [null, null, null, null, null, null],
"theta_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"theta_regularizer": [null, null, null, null, null, null],
"theta_constraint": [null, null, null, null, null, null],
"thetaTilde_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"thetaTilde_regularizer": [null, null, null, null, null, null],
"thetaTilde_constraint": [null, null, null, null, null, null],
"point_transformer_wrapper": {
"feature_dim_divisor": 2,
"residual": true,
"bn": true,
"postwrap_bn": true,
"merge_bn": false,
"bn_momentum": 0.98,
"activation": "relu",
"activate_postwrap": true,
"activate_residual": false,
"Phi_initializer": "glorot_uniform",
"Phi_regularizer": null,
"Phi_constraint": null,
"Psi_initializer": "glorot_uniform",
"Psi_regularizer": null,
"Psi_constraint": null,
"A_initializer": "glorot_uniform",
"A_regularizer": null,
"A_constraint": null,
"Gamma_initializer": "glorot_uniform",
"Gamma_regularizer": null,
"Gamma_constraint": null,
"Theta_initializer": "glorot_uniform",
"Theta_regularizer": null,
"Theta_constraint": null,
"ThetaTilde_initializer": "glorot_uniform",
"ThetaTilde_regularizer": null,
"ThetaTilde_constraint": null,
"phi_initializer": "glorot_uniform",
"phi_regularizer": null,
"phi_constraint": null,
"psi_initializer": "glorot_uniform",
"psi_regularizer": null,
"psi_constraint": null,
"a_initializer": "glorot_uniform",
"a_regularizer": null,
"a_constraint": null,
"gamma_initializer": "glorot_uniform",
"gamma_regularizer": null,
"gamma_constraint": null,
"theta_initializer": "glorot_uniform",
"theta_regularizer": null,
"theta_constraint": null,
"thetaTilde_initializer": "glorot_uniform",
"thetaTilde_regularizer": null,
"thetaTilde_constraint": null
}
},
"features_alignment": null,
"downsampling_filter": "interdimensional_point_transformer",
"upsampling_filter": "interdimensional_point_transformer",
"upsampling_bn": true,
"upsampling_momentum": 0.98,
"conv1d": false,
"conv1d_kernel_initializer": "glorot_normal",
"output_kernel_initializer": "glorot_normal",
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"class_weight": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"training_epochs": 150,
"batch_size": 16,
"training_sequencer": {
"type": "DLSequencer",
"random_shuffle_indices": true,
"augmentor": {
"transformations": [
{
"type": "Rotation",
"axis": [0, 0, 1],
"angle_distribution": {
"type": "uniform",
"start": -3.141592,
"end": 3.141592
}
},
{
"type": "Scale",
"scale_distribution": {
"type": "uniform",
"start": 0.985,
"end": 1.015
}
},
{
"type": "Jitter",
"noise_distribution": {
"type": "normal",
"mean": 0,
"stdev": 0.0033
}
}
]
}
},
"prediction_reducer": {
"reduce_strategy" : {
"type": "MeanPredReduceStrategy"
},
"select_strategy": {
"type": "ArgMaxPredSelectStrategy"
}
},
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
}
},
"compilation_args": {
"optimizer": {
"algorithm": "Adam",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 5000,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": true,
"show_layer_names": true,
"rankdir": "TB",
"expand_nested": true,
"dpi": 300,
"show_layer_activations": true
}
},
"autoval_metrics": null,
"training_evaluation_metrics": null,
"training_class_evaluation_metrics": null,
"training_evaluation_report_path": null,
"training_class_evaluation_report_path": null,
"training_confusion_matrix_report_path": null,
"training_confusion_matrix_plot_path": null,
"training_class_distribution_report_path": null,
"training_class_distribution_plot_path": null,
"training_classified_point_cloud_path": null,
"training_activations_path": null
},
{
"writer": "PredictivePipelineWriter",
"out_pipeline": "*/model/PointTransformer.pipe",
"include_writer": false,
"include_imputer": true,
"include_feature_transformer": true,
"include_miner": true,
"include_class_transformer": false,
"include_clustering": false,
"ignore_predictions": false
}
]
}
The JSON above defines a :class:`.ConvAutoencPwiseClassif` that uses a
hierarchical furthest point sampling strategy with a 3D spherical neighborhood
to prepare the input for a PointTransformer-based model. It uses
:class:`.PointTransformerLayer` for feature extraction and
:class:`.InterdimensionalPointTransformerLayer` for downsampling and
upsampling.
**Arguments**
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further details,
read the :ref:`training strategies section `.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``random_seed``
See :ref:`KPConv arguments documentation `.
-- ``model_args``
The model specification.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``num_classes``
See :ref:`KPConv arguments documentation `.
-- ``class_names``
See :ref:`KPConv arguments documentation `.
-- ``pre_processing``
See :ref:`KPConv arguments documentation `.
-- ``feature_extraction``
The definition of the feature extraction operator. A detailed
description of the case when ``"type": "PointTransformer"`` is given
below. For a description of the case when ``"type": "PointNet"`` see
:ref:`the PointNet operator documentation `,
for the case ``"type": "KPConv"`` see
:ref:`the KPConv operator documentation `,
to mimic a SFL-NET model see
:ref:`the SFL-NET documentation `, and
for the case ``"type": "LightKPConv"`` see
:ref:`the LightKPConv operator documentation `.
-- ``operations_per_depth``
See :ref:`KPConv arguments documentation `.
-- ``feature_space_dims``
See :ref:`KPConv arguments documentation `.
-- ``bn``
See :ref:`KPConv arguments documentation `.
-- ``bn_momentum``
See :ref:`KPConv arguments documentation `.
-- ``activate``
See :ref:`KPConv arguments documentation `.
.. _PointTransformer args Phi_initializer:
-- ``Phi_initializer``
The initialization method for the :math:`\pmb{\Phi}` weights matrix
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args Phi_regularizer:
-- ``Phi_regularizer``
The regularization strategy for the :math:`\pmb{\Phi}` weights
matrix of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args Phi_constraint:
-- ``Phi_constraint``
The constraints of the :math:`\pmb{\Phi}` weights matrix of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args Psi_initializer:
-- ``Psi_initializer``
The initialization method for the :math:`\pmb{\Psi}` weights matrix
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args Psi_regularizer:
-- ``Psi_regularizer``
The regularization strategy for the :math:`\pmb{\Psi}` weights
matrix of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args Psi_constraint:
-- ``Psi_constraint``
The constraints of the :math:`\pmb{\Psi}` weights matrix of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args A_initializer:
-- ``A_initializer``
The initialization method for the :math:`\pmb{A}` weights matrix
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args A_regularizer:
-- ``A_regularizer``
The regularization strategy for the :math:`\pmb{A}` weights
matrix of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args A_constraint:
-- ``A_constraint``
The constraints of the :math:`\pmb{A}` weights matrix of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args Gamma_initializer:
-- ``Gamma_initializer``
The initialization method for the :math:`\pmb{\Gamma}` weights matrix
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args Gamma_regularizer:
-- ``Gamma_regularizer``
The regularization strategy for the :math:`\pmb{\Gamma}` weights
matrix of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args Gamma_constraint:
-- ``Gamma_constraint``
The constraints of the :math:`\pmb{\Gamma}` weights matrix of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args Theta_initializer:
-- ``Theta_initializer``
The initialization method for the :math:`\pmb{\Theta}` weights matrix
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args Theta_regularizer:
-- ``Theta_regularizer``
The regularization strategy for the :math:`\pmb{\Theta}` weights
matrix of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args Theta_constraint:
-- ``Theta_constraint``
The constraints of the :math:`\pmb{\Theta}` weights matrix of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args ThetaTilde_initializer:
-- ``ThetaTilde_initializer``
The initialization method for the :math:`\pmb{\widetilde{\Theta}}`
weights matrix of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args ThetaTilde_regularizer:
-- ``ThetaTilde_regularizer``
The regularization strategy for the :math:`\pmb{\widetilde{\Theta}}`
weights matrix of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args ThetaTilde_constraint:
-- ``ThetaTilde_constraint``
The constraints of the :math:`\pmb{\widetilde{\Theta}}` weights
matrix of each Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args phi_initializer_vec:
-- ``phi_initializer``
The initialization method for the :math:`\pmb{\phi}` weights vector
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args phi_regularizer_vec:
-- ``phi_regularizer``
The regularization strategy for the :math:`\pmb{\phi}` weights
vector of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args phi_constraint_vec:
-- ``phi_constraint``
The constraints of the :math:`\pmb{\phi}` weights vector of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args psi_initializer_vec:
-- ``psi_initializer``
The initialization method for the :math:`\pmb{\psi}` weights vector
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args psi_regularizer_vec:
-- ``psi_regularizer``
The regularization strategy for the :math:`\pmb{\psi}` weights
vector of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args psi_constraint_vec:
-- ``psi_constraint``
The constraints of the :math:`\pmb{\psi}` weights vector of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args a_initializer_vec:
-- ``a_initializer``
The initialization method for the :math:`\pmb{a}` weights vector
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args a_regularizer_vec:
-- ``a_regularizer``
The regularization strategy for the :math:`\pmb{a}` weights
vector of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args a_constraint_vec:
-- ``a_constraint``
The constraints of the :math:`\pmb{a}` weights vector of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args gamma_initializer_vec:
-- ``gamma_initializer``
The initialization method for the :math:`\pmb{\gamma}` weights vector
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args gamma_regularizer_vec:
-- ``gamma_regularizer``
The regularization strategy for the :math:`\pmb{\gamma}` weights
vector of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args gamma_constraint_vec:
-- ``gamma_constraint``
The constraints of the :math:`\pmb{\gamma}` weights vector of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args theta_initializer_vec:
-- ``theta_initializer``
The initialization method for the :math:`\pmb{\theta}` weights vector
of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args theta_regularizer_vec:
-- ``theta_regularizer``
The regularization strategy for the :math:`\pmb{\theta}` weights
vector of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args theta_constraint_vec:
-- ``theta_constraint``
The constraints of the :math:`\pmb{\theta}` weights vector of each
Point Transformer. See
`the keras documentation on constraints `_
for more details.
.. _PointTransformer args thetaTilde_initializer_vec:
-- ``thetaTilde_initializer``
The initialization method for the :math:`\pmb{\tilde{\theta}}`
weights vector of each PointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _PointTransformer args thetaTilde_regularizer_vec:
-- ``thetaTilde_regularizer``
The regularization strategy for the :math:`\pmb{\tilde{\Theta}}`
weights vector of each PointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _PointTransformer args thetaTilde_constraint_vec:
-- ``thetaTilde_constraint``
The constraints of the :math:`\pmb{\tilde{\theta}}` weights
vector of each Point Transformer. See
`the keras documentation on constraints `_
for more details.
-- ``unary_convolution_wrapper``
It can be used to configure a LightKPconv model that uses
shared MLPs to wrap the feature extraction operators like a
:ref:`KPConv model ` or it can be set
to null to use an ``hourglass_wrapper`` instead, similar to
a :ref:`SFL-NET model `. See
:ref:`the KPConv arguments documentation `
for further details.
-- ``hourglass_wrapper``
The specification of how to use hourglass layers to wrap the
feature extraction layers. See
:ref:`the SFL-NET arguments documentation `
for further details.
.. _PointTransformer args wrapper:
-- ``point_transformer_wrapper``
The specification of how to use Point Transformer layers to wrap the
feature extraction layers (with/out residual block).
-- ``feature_dim_divisor``
See
:ref:`SFL-NET hourglass documentation on feature_dim_divisor `
.
-- ``residual``
Whether to include another :class:`.PointTransformerLayer` in
a residual branch. Default is ``false``.
-- ``bn``
See
:ref:`SFL-NET hourglass documentation on batch normalization `
-- ``postwrap_bn``
Whether to include a batch normalization layer after the
feature extractor but before merging with the parallel
branch.
-- ``merge_bn``
Whether to include a batch normalization layer after the linear
superposition of the residual block with the main branch
(``true``) or not (``false``).
-- ``bn_momentum``
The momentum for the moving average of the batch normalization
(as explained for
:ref:`PointNet++ bn_momentum specification `
).
-- ``activation``
The activation function for the wrapper and residual point
transformers. See
`the keras documentation on activations `__
for more details.
-- ``activate_postwrap``
Whether to include an activation function after the point
transformer (after the batch normalization, if any) but before
merging with the residual parallel branch.
-- ``activate_residual``
Whether to activate the parallel branch after the feature
extraction (and the batch normalization, if any).
Note that when using parallel branches as residual blocks
the typical approach is to avoid activation to keep it
linear.
-- ``Phi_initializer``
See
:ref:`the Phi initializer documentation `.
-- ``Phi_regularizer``
See
:ref:`the Phi initializer documentation `.
-- ``Phi_constraint``
See
:ref:`the Phi initializer documentation `.
-- ``Psi_initializer``
See
:ref:`the Psi initializer documentation `.
-- ``Psi_regularizer``
See
:ref:`the Psi initializer documentation `.
-- ``Psi_constraint``
See
:ref:`the Psi initializer documentation `.
-- ``Gamma_initializer``
See
:ref:`the Gamma initializer documentation `.
-- ``Gamma_regularizer``
See
:ref:`the Gamma initializer documentation `.
-- ``Gamma_constraint``
See
:ref:`the Gamma initializer documentation `.
-- ``A_initializer``
See
:ref:`the A initializer documentation `.
-- ``A_regularizer``
See
:ref:`the A initializer documentation `.
-- ``A_constraint``
See
:ref:`the A initializer documentation `.
-- ``Theta_initializer``
See
:ref:`the Theta initializer documentation `.
-- ``Theta_regularizer``
See
:ref:`the Theta initializer documentation `.
-- ``Theta_constraint``
See
:ref:`the Theta initializer documentation `.
-- ``ThetaTilde_initializer``
See
:ref:`the ThetaTilde initializer documentation `.
-- ``ThetaTilde_regularizer``
See
:ref:`the ThetaTilde initializer documentation `.
-- ``ThetaTilde_constraint``
See
:ref:`the ThetaTilde initializer documentation `.
-- ``phi_initializer``
See
:ref:`the phi initializer documentation `.
-- ``phi_regularizer``
See
:ref:`the phi initializer documentation `.
-- ``phi_constraint``
See
:ref:`the phi initializer documentation `.
-- ``psi_initializer``
See
:ref:`the psi initializer documentation `.
-- ``psi_regularizer``
See
:ref:`the psi initializer documentation `.
-- ``psi_constraint``
See
:ref:`the psi initializer documentation `.
-- ``gamma_initializer``
See
:ref:`the gamma initializer documentation `.
-- ``gamma_regularizer``
See
:ref:`the gamma initializer documentation `.
-- ``gamma_constraint``
See
:ref:`the gamma initializer documentation `.
-- ``a_initializer``
See
:ref:`the a initializer documentation `.
-- ``a_regularizer``
See
:ref:`the a initializer documentation `.
-- ``a_constraint``
See
:ref:`the a initializer documentation `.
-- ``theta_initializer``
See
:ref:`the theta initializer documentation `.
-- ``theta_regularizer``
See
:ref:`the theta initializer documentation `.
-- ``theta_constraint``
See
:ref:`the theta initializer documentation `.
-- ``thetaTilde_initializer``
See
:ref:`the thetaTilde initializer documentation `.
-- ``thetaTilde_regularizer``
See
:ref:`the thetaTilde initializer documentation `.
-- ``thetaTilde_constraint``
See
:ref:`the thetaTilde initializer documentation `.
-- ``features_alignment``
See :ref:`KPConv arguments documentation `.
-- ``downsampling_filter``
It can be configured to ``"strided_lightkpconv"`` (see
:class:`.StridedLightKPConvLayer`) but it is also possible to use
``"strided_kpconv"`` to use the classical :class:`.StridedKPConvLayer`
during downsampling. The :class:`.FeaturesDownsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` are also supported.
-- ``upsampling_filter``
The original upsampling strategy for KPConv and derived architectures
is ``"nearest"`` (i.e., nearest upsampling). However, in VL3D++
examples we often use ``"mean"`` for our baseline models because
we found it yields better results. See
:class:`.FeaturesUpsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` for more details.
-- ``upsampling_bn``
See :ref:`KPConv arguments documentation `.
-- ``upsampling_momentum``
See :ref:`KPConv arguments documentation `.
-- ``conv1d``
Boolean flag governing whether to use unary convolutions (shared
MLPs) to wrap the hourglass or not. SFL-NET models use hourglass
layers instead (i.e., ``False``), classical KPConv models use shared
MLPs instead (i.e., ``True``).
-- ``conv1d_kernel_initializer``
See :ref:`KPConv arguments documentation `.
-- ``output_kernel_initializer``
See :ref:`KPConv arguments documentation `.
.. _PointTransformer args model_handling:
-- ``model_handling``
The model handling specification can be read in
:ref:`the KPConv arguments documentation `.
-- ``compilation_args``
See :ref:`KPConv arguments documentation `.
-- ``training_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_plot``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_distribution_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_classified_point_cloud_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_activations_path``
See :ref:`PointNet-like point-wise classifier arguments `.
.. _Hierarchical GroupedPointTransformer:
Hierarchical feature extraction with GroupedPointTransformer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :class:`.ConvAutoencPwiseClassif` architecture can be configured using
:class:`.GroupedPointTransformerLayer` as the feature extraction strategy.
For further details about the variables see the
:class:`.GroupedPointTransformerLayer` class documentation and
`the Point Transformer v2 paper about Grouped Vector Attention (Wu et al., 2022) `_.
The JSON below illustrates how to configure Grouped Point Transformer-based
hierarchical feature extractors using the VL3D++ framework.
.. code-block:: json
{
"in_pcloud": [
"/ext4/hei/Hessigheim_Benchmark/Epoch_March2018/vl3d/mined/Mar18_train_hsv_std.laz"
],
"out_pcloud": [
"/ext4/hei/Hessigheim_Benchmark/Epoch_March2018/vl3d/out/gpttransf_alt/T1/*"
],
"sequential_pipeline": [
{
"train": "ConvolutionalAutoencoderPwiseClassifier",
"training_type": "base",
"fnames": ["ones", "HSV_Hrad", "HSV_S", "HSV_V"],
"random_seed": null,
"model_args": {
"fnames": ["ones", "HSV_Hrad", "HSV_S", "HSV_V"],
"num_classes": 11,
"class_names": ["LowVeg", "ImpSurf", "Vehicle", "UrbanFurni", "Roof", "Facade", "Shrub", "Tree", "Soil/Gravel", "VertSurf", "Chimney"],
"pre_processing": {
"pre_processor": "hierarchical_fpspp",
"support_strategy_num_points": 25000,
"to_unit_sphere": false,
"support_strategy": "fps",
"support_strategy_fast": 2,
"min_distance": 0.03,
"receptive_field_oversampling": {
"min_points": 2,
"strategy": "nearest",
"k": 3,
"radius": 0.5
},
"center_on_pcloud": true,
"training_class_distribution": [2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250],
"neighborhood": {
"type": "sphere",
"radius": 5.0,
"separation_factor": 0.8
},
"num_points_per_depth": [4096, 1024, 256, 64, 16],
"fast_flag_per_depth": [4, 4, false, false, false],
"num_downsampling_neighbors": [1, 16, 16, 16, 16],
"num_pwise_neighbors": [16, 16, 16, 16, 16],
"num_upsampling_neighbors": [1, 16, 16, 16, 16],
"nthreads": -1,
"training_receptive_fields_distribution_report_path": null,
"training_receptive_fields_distribution_plot_path": null,
"training_receptive_fields_dir": null,
"receptive_fields_distribution_report_path": null,
"receptive_fields_distribution_plot_path": null,
"receptive_fields_dir": null,
"training_support_points_report_path": null,
"support_points_report_path": null
},
"feature_extraction": {
"type": "GroupedPointTransformer",
"operations_per_depth": [2, 1, 1, 1, 1],
"feature_space_dims": [64, 64, 96, 128, 192, 256],
"init_ftransf_bn": true,
"init_ftransf_bn_momentum": 0.98,
"groups": [8, 8, 12, 16, 24, 32],
"dropout_rate": [0.25, 0.25, 0.25, 0.25, 0.25, 0.25],
"bn": false,
"bn_momentum": 0.98,
"activate": false,
"Q_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Q_regularizer": [null, null, null, null, null, null],
"Q_constraint": [null, null, null, null, null, null],
"Q_bn_momentum": [0.98, 0.98, 0.98, 0.98, 0.98, 0.98],
"q_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"q_regularizer": [null, null, null, null, null, null],
"q_constraint": [null, null, null, null, null, null],
"K_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"K_regularizer": [null, null, null, null, null, null],
"K_constraint": [null, null, null, null, null, null],
"K_bn_momentum": [0.98, 0.98, 0.98, 0.98, 0.98, 0.98],
"k_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"k_regularizer": [null, null, null, null, null, null],
"k_constraint": [null, null, null, null, null, null],
"V_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"V_regularizer": [null, null, null, null, null, null],
"V_constraint": [null, null, null, null, null, null],
"v_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"v_regularizer": [null, null, null, null, null, null],
"v_constraint": [null, null, null, null, null, null],
"ThetaA_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"ThetaA_regularizer": [null, null, null, null, null, null],
"ThetaA_constraint": [null, null, null, null, null, null],
"thetaA_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"thetaA_regularizer": [null, null, null, null, null, null],
"thetaA_constraint": [null, null, null, null, null, null],
"ThetaTildeA_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"ThetaTildeA_regularizer": [null, null, null, null, null, null],
"ThetaTildeA_constraint": [null, null, null, null, null, null],
"thetaTildeA_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"thetaTildeA_regularizer": [null, null, null, null, null, null],
"thetaTildeA_constraint": [null, null, null, null, null, null],
"deltaA_bn_momentum": [0.98, 0.98, 0.98, 0.98, 0.98, 0.98],
"ThetaB_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"ThetaB_regularizer": [null, null, null, null, null, null],
"ThetaB_constraint": [null, null, null, null, null, null],
"thetaB_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"thetaB_regularizer": [null, null, null, null, null, null],
"thetaB_constraint": [null, null, null, null, null, null],
"ThetaTildeB_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"ThetaTildeB_regularizer": [null, null, null, null, null, null],
"ThetaTildeB_constraint": [null, null, null, null, null, null],
"thetaTildeB_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"thetaTildeB_regularizer": [null, null, null, null, null, null],
"thetaTildeB_constraint": [null, null, null, null, null, null],
"deltaB_bn_momentum": [0.98, 0.98, 0.98, 0.98, 0.98, 0.98],
"Omega_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Omega_regularizer": [null, null, null, null, null, null],
"Omega_constraint": [null, null, null, null, null, null],
"omega_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"omega_regularizer": [null, null, null, null, null, null],
"omega_constraint": [null, null, null, null, null, null],
"omega_bn_momentum": [0.98, 0.98, 0.98, 0.98, 0.98, 0.98],
"OmegaTilde_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"OmegaTilde_regularizer": [null, null, null, null, null, null],
"OmegaTilde_constraint": [null, null, null, null, null, null],
"omegaTilde_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"omegaTilde_regularizer": [null, null, null, null, null, null],
"omegaTilde_constraint": [null, null, null, null, null, null],
"hourglass_wrapper": {
"internal_dim": [2, 2, 4, 16, 32, 64],
"parallel_internal_dim": [8, 8, 16, 32, 64, 128],
"activation": ["relu", "relu", "relu", "relu", "relu", "relu"],
"activation2": [null, null, null, null, null, null],
"activate_postwrap": true,
"activate_residual": false,
"regularize": [true, true, true, true, true, true],
"W1_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W1_regularizer": [null, null, null, null, null, null],
"W1_constraint": [null, null, null, null, null, null],
"W2_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"W2_regularizer": [null, null, null, null, null, null],
"W2_constraint": [null, null, null, null, null, null],
"loss_factor": 0.1,
"subspace_factor": 0.125,
"feature_dim_divisor": 4,
"bn": false,
"merge_bn": false,
"bn_momentum": 0.98,
"out_bn": true,
"out_bn_momentum": 0.98,
"out_activation": "relu"
}
},
"features_alignment": null,
"downsampling_filter": "mean",
"upsampling_filter": "mean",
"upsampling_bn": true,
"upsampling_momentum": 0.98,
"conv1d": false,
"conv1d_kernel_initializer": "glorot_normal",
"output_kernel_initializer": "glorot_normal",
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"class_weight": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"training_epochs": 200,
"batch_size": 32,
"training_sequencer": {
"type": "DLSequencer",
"random_shuffle_indices": true,
"augmentor": {
"transformations": [
{
"type": "Rotation",
"axis": [0, 0, 1],
"angle_distribution": {
"type": "uniform",
"start": -3.141592,
"end": 3.141592
}
},
{
"type": "Scale",
"scale_distribution": {
"type": "uniform",
"start": 0.985,
"end": 1.015
}
},
{
"type": "Jitter",
"noise_distribution": {
"type": "normal",
"mean": 0,
"stdev": 0.0033
}
}
]
}
},
"prediction_reducer": {
"reduce_strategy" : {
"type": "MeanPredReduceStrategy"
},
"select_strategy": {
"type": "ArgMaxPredSelectStrategy"
}
},
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
}
},
"compilation_args": {
"optimizer": {
"algorithm": "Adam",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 1000,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": true,
"show_layer_names": true,
"rankdir": "TB",
"expand_nested": true,
"dpi": 300,
"show_layer_activations": true
}
},
"autoval_metrics": null,
"training_evaluation_metrics": null,
"training_class_evaluation_metrics": null,
"training_evaluation_report_path": null,
"training_class_evaluation_report_path": null,
"training_confusion_matrix_report_path": null,
"training_confusion_matrix_plot_path": null,
"training_class_distribution_report_path": null,
"training_class_distribution_plot_path": null,
"training_classified_point_cloud_path": null,
"training_activations_path": null
},
{
"writer": "PredictivePipelineWriter",
"out_pipeline": "*/model/PointTransformer.pipe",
"include_writer": false,
"include_imputer": true,
"include_feature_transformer": true,
"include_miner": true,
"include_class_transformer": false,
"include_clustering": false,
"ignore_predictions": false
}
]
}
The JSON above defines a :class:`.ConvAutoencPwiseClassif` that uses a
hierarchical furthest point sampling strategy with a 3D spherical neighborhood
to prepare the input for a GroupedPointTransformer-based model. It uses
:class:`.GroupedPointTransformerLayer` for feature extraction,
:class:`.FeaturesDownsamplingLayer` for downsampling with mean filter,
and analogously also :class:`.FeaturesUpsamplingLayer` for mean-based
upsampling.
**Arguments**
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further details,
read the :ref:`training strategies section `.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``random_seed``
See :ref:`KPConv arguments documentation `.
-- ``model_args``
The model specification.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``num_classes``
See :ref:`KPConv arguments documentation `.
-- ``class_names``
See :ref:`KPConv arguments documentation `.
-- ``pre_processing``
See :ref:`KPConv arguments documentation `.
-- ``feature_extraction``
The definition of the feature extraction operator. A detailed
description of the case when ``"type": "GroupedPointTransformer"`` is
given below. For a description of the case when ``"type": "PointNet"``
see :ref:`the PointNet operator documentation `,
for the case ``"type": "KPConv"`` see
:ref:`the KPConv operator documentation `,
to mimic a SFL-NET model see
:ref:`the SFL-NET documentation `,
for the case ``"type": "LightKPConv"`` see
:ref:`the LightKPConv operator documentation `,
and to mimic a PointTransformed model see
:ref:`the PointTransformer documentation `.
-- ``operations_per_depth``
See :ref:`KPConv arguments documentation `.
-- ``feature_space_dims``
See :ref:`KPConv arguments documentation `.
-- ``bn``
See :ref:`KPConv arguments documentation `.
-- ``bn_momentum``
See :ref:`KPConv arguments documentation `.
-- ``activate``
See :ref:`KPConv arguments documentation `.
.. _GroupedPointTransformer args init_ftransf_bn:
-- ``init_ftransf_bn``
The batch normalization for the feature transform before the
grouped point transformer-based feature extraction. It can be
enabled with ``True`` or disabled with ``False``. Note that it is
applied also before any wrapper block (if any).
.. _GroupedPointTransformer args init_ftransf_bn_momentum:
-- ``init_ftransf_bn_momentum``
The momentum governing how to update the standardization parameters
for the batch normalization before the grouped point
transformer-based feature extraction. See
:ref:`the Hierarchical PointNet bn_momentum documentation `
for further details.
.. _GroupedPointTransformer args groups:
-- ``groups``
The number of groups at each depth. Note that it must be a divisor
for the number of channels at that depth.
.. _GroupedPointTransformer args dropout_rate:
-- ``dropout_rate``
The ratio in :math:`[0, 1]` governing how many weight encoding units
must be randomly disabled during training.
.. _GroupedPointTransformer args Q_initializer:
-- ``Q_initializer``
The initialization method for the :math:`\pmb{Q}` weights matrix
of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args Q_regularizer:
-- ``Q_regularizer``
The regularization strategy for the :math:`\pmb{Q}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args Q_constraint:
-- ``Q_constraint``
The constraints of the :math:`\pmb{Q}` weights matrix of each
GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args q_initializer_vec:
-- ``q_initializer``
The initialization method for the :math:`\pmb{q}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args q_regularizer_vec:
-- ``q_regularizer``
The regularization method for the :math:`\pmb{q}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args q_constraint_vec:
-- ``q_constraint``
The constraint method for the :math:`\pmb{q}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args K_initializer:
-- ``K_initializer``
The initialization method for the :math:`\pmb{K}` weights matrix
of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args K_regularizer:
-- ``K_regularizer``
The regularization strategy for the :math:`\pmb{K}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args K_constraint:
-- ``K_constraint``
The constraints of the :math:`\pmb{K}` weights matrix of each
GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args k_initializer_vec:
-- ``k_initializer``
The initialization method for the :math:`\pmb{k}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args k_regularizer_vec:
-- ``k_regularizer``
The regularization method for the :math:`\pmb{k}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args k_constraint_vec:
-- ``k_constraint``
The constraint method for the :math:`\pmb{k}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args V_initializer:
-- ``V_initializer``
The initialization method for the :math:`\pmb{V}` weights matrix
of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args V_regularizer:
-- ``V_regularizer``
The regularization strategy for the :math:`\pmb{V}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args V_constraint:
-- ``V_constraint``
The constraints of the :math:`\pmb{V}` weights matrix of each
GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args v_initializer_vec:
-- ``v_initializer``
The initialization method for the :math:`\pmb{v}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args v_regularizer_vec:
-- ``v_regularizer``
The regularization method for the :math:`\pmb{v}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args v_constraint_vec:
-- ``v_constraint``
The constraint method for the :math:`\pmb{v}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args ThetaA_initializer:
-- ``ThetaA_initializer``
The initialization method for the :math:`\pmb{\Theta_A}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args ThetaA_regularizer:
-- ``ThetaA_regularizer``
The regularization strategy for the :math:`\pmb{\Theta_A}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args ThetaA_constraint:
-- ``ThetaA_constraint``
The constraints of the :math:`\pmb{\Theta_A}` weights matrix of each
GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args thetaA_initializer_vec:
-- ``thetaA_initializer``
The initialization method for the :math:`\pmb{\theta_A}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args thetaA_regularizer_vec:
-- ``thetaA_regularizer``
The regularization method for the :math:`\pmb{\theta_A}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args thetaA_constraint_vec:
-- ``thetaA_constraint``
The constraint method for the :math:`\pmb{\theta_A}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args ThetaTildeA_initializer:
-- ``ThetaTildeA_initializer``
The initialization method for the :math:`\pmb{\widetilde{\Theta}_A}`
weights matrix of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args ThetaTildeA_regularizer:
-- ``ThetaTildeA_regularizer``
The regularization strategy for the :math:`\pmb{\widetilde{\Theta}_A}`
weights matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args ThetaTildeA_constraint:
-- ``ThetaTildeA_constraint``
The constraints of the :math:`\pmb{\widetilde{\Theta}_A}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args thetaTildeA_initializer_vec:
-- ``thetaTildeA_initializer``
The initialization method for the :math:`\pmb{\tilde{\theta}_A}`
weights vector of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args thetaTildeA_regularizer_vec:
-- ``thetaTildeA_regularizer``
The regularization method for the :math:`\pmb{\tilde{\theta}_A}`
weights vector of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args thetaTildeA_constraint_vec:
-- ``thetaTildeA_constraint``
The constraint method for the :math:`\pmb{\tilde{\theta}_A}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args deltaA_bn_momentum:
-- ``deltaA_bn_momentum``
The momentum for the batch normalization of the multiplier
positional encoding. See
:ref:`the Hierarchical PointNet bn_momentum documentation `
for further details.
.. _GroupedPointTransformer args ThetaB_initializer:
-- ``ThetaB_initializer``
The initialization method for the :math:`\pmb{\Theta_B}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args ThetaB_regularizer:
-- ``ThetaB_regularizer``
The regularization strategy for the :math:`\pmb{\Theta_B}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args ThetaB_constraint:
-- ``ThetaB_constraint``
The constraints of the :math:`\pmb{\Theta_B}` weights matrix of each
GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args thetaB_initializer_vec:
-- ``thetaB_initializer``
The initialization method for the :math:`\pmb{\theta_B}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args thetaB_regularizer_vec:
-- ``thetaB_regularizer``
The regularization method for the :math:`\pmb{\theta_B}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args thetaB_constraint_vec:
-- ``thetaB_constraint``
The constraint method for the :math:`\pmb{\theta_B}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args ThetaTildeB_initializer:
-- ``ThetaTildeB_initializer``
The initialization method for the :math:`\pmb{\widetilde{\Theta}_B}`
weights matrix of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args ThetaTildeB_regularizer:
-- ``ThetaTildeB_regularizer``
The regularization strategy for the :math:`\pmb{\widetilde{\Theta}_B}`
weights matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args ThetaTildeB_constraint:
-- ``ThetaTildeB_constraint``
The constraints of the :math:`\pmb{\widetilde{\Theta}_B}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args thetaTildeB_initializer_vec:
-- ``thetaTildeB_initializer``
The initialization method for the :math:`\pmb{\tilde{\theta}_B}`
weights vector of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args thetaTildeB_regularizer_vec:
-- ``thetaTildeB_regularizer``
The regularization method for the :math:`\pmb{\tilde{\theta}_B}`
weights vector of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args thetaTildeB_constraint_vec:
-- ``thetaTildeB_constraint``
The constraint method for the :math:`\pmb{\tilde{\theta}_B}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args deltaB_bn_momentum:
-- ``deltaB_bn_momentum``
The momentum for the batch normalization of the bias
positional encoding. See
:ref:`the Hierarchical PointNet bn_momentum documentation `
for further details.
.. _GroupedPointTransformer args Omega_initializer:
-- ``Omega_initializer``
The initialization method for the :math:`\pmb{\Omega}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args Omega_regularizer:
-- ``ThetaA_regularizer``
The regularization strategy for the :math:`\pmb{\Omega}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args Omega_constraint:
-- ``Omega_constraint``
The constraints of the :math:`\pmb{\Omega}` weights matrix of each
GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args omega_initializer_vec:
-- ``omega_initializer``
The initialization method for the :math:`\pmb{\omega}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args omega_regularizer_vec:
-- ``omega_regularizer``
The regularization method for the :math:`\pmb{\omega}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args omega_constraint_vec:
-- ``omega_constraint``
The constraint method for the :math:`\pmb{\omega}` weights vector
of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args OmegaTilde_initializer:
-- ``OmegaTilde_initializer``
The initialization method for the :math:`\pmb{\widetilde{\Omega}}`
weights matrix of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args OmegaTilde_regularizer:
-- ``OmegaTilde_regularizer``
The regularization strategy for the :math:`\pmb{\widetilde{\Omega}}`
weights matrix of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args OmegaTilde_constraint:
-- ``OmegaTilde_constraint``
The constraints of the :math:`\pmb{\widetilde{\Omega}}` weights
matrix of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args omegaTilde_initializer_vec:
-- ``omegaTilde_initializer``
The initialization method for the :math:`\pmb{\tilde{\omega}}`
weights vector of each GroupedPointTransformer. See
`the keras documentation on initializers `_
for more details.
.. _GroupedPointTransformer args omegaTilde_regularizer_vec:
-- ``omegaTilde_regularizer``
The regularization method for the :math:`\pmb{\tilde{\omega}}`
weights vector of each GroupedPointTransformer. See
`the keras documentation on regularizers `_
for more details.
.. _GroupedPointTransformer args omegaTilde_constraint_vec:
-- ``omegaTilde_constraint``
The constraint method for the :math:`\pmb{\tilde{\omega}}` weights
vector of each GroupedPointTransformer. See
`the keras documentation on constraints `_
for more details.
.. _GroupedPointTransformer args omega_bn_momentum:
-- ``omega_bn_momentum``
The momentum for the batch normalization of the weight encoding. See
:ref:`the Hierarchical PointNet bn_momentum documentation `
for further details.
-- ``unary_convolution_wrapper``
It can be used to configure a LightKPconv model that uses
shared MLPs to wrap the feature extraction operators like a
:ref:`KPConv model ` or it can be set
to null to use an ``hourglass_wrapper`` instead, similar to
a :ref:`SFL-NET model `. See
:ref:`the KPConv arguments documentation `
for further details.
-- ``hourglass_wrapper``
The specification of how to use hourglass layers to wrap the
feature extraction layers. See
:ref:`the SFL-NET arguments documentation `
for further details.
-- ``point_transformer_wrapper``
The specification of how to use Point Transformer layers to wrap the
feature extraction layers (with/out residual block). See
:ref:`the PointTransformer arguments documentation `.
-- ``features_alignment``
See :ref:`KPConv arguments documentation `.
-- ``downsampling_filter``
It can be configured to ``"strided_lightkpconv"`` (see
:class:`.StridedLightKPConvLayer`) but it is also possible to use
``"strided_kpconv"`` to use the classical :class:`.StridedKPConvLayer`
during downsampling. The :class:`.FeaturesDownsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` are also supported.
-- ``upsampling_filter``
The original upsampling strategy for KPConv and derived architectures
is ``"nearest"`` (i.e., nearest upsampling). However, in VL3D++
examples we often use ``"mean"`` for our baseline models because
we found it yields better results. See
:class:`.FeaturesUpsamplingLayer` and
:class:`.InterdimensionalPointTransformerLayer` for more details.
-- ``upsampling_bn``
See :ref:`KPConv arguments documentation `.
-- ``upsampling_momentum``
See :ref:`KPConv arguments documentation `.
-- ``conv1d``
Boolean flag governing whether to use unary convolutions (shared
MLPs) to wrap the hourglass or not. SFL-NET models use hourglass
layers instead (i.e., ``False``), classical KPConv models use shared
MLPs instead (i.e., ``True``).
-- ``conv1d_kernel_initializer``
See :ref:`KPConv arguments documentation `.
-- ``output_kernel_initializer``
See :ref:`KPConv arguments documentation `.
.. _GroupedPointTransformer args model_handling:
-- ``model_handling``
The model handling specification can be read in
:ref:`the KPConv arguments documentation `.
-- ``compilation_args``
See :ref:`KPConv arguments documentation `.
-- ``training_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_metrics``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_evaluation_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_confusion_matrix_report_plot``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_class_distribution_report_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_classified_point_cloud_path``
See :ref:`PointNet-like point-wise classifier arguments `.
-- ``training_activations_path``
See :ref:`PointNet-like point-wise classifier arguments `.
.. _Hierarchical PointMLP:
Hierarchical feature extraction with PointMLP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :class:`.ConvAutoencPwiseClassif` architecture can be configured using
:class:`.PointMLPLayer` as the feature extraction strategy.
For further details about the variables see the
:class:`.PointMLPLayer` class documentation and
`the PointMLP paper (Xu Ma et al., 2022) `_.
The JSON below illustrates how to configure PointMLP-based hierarchical feature
extractors using the VL3D++ framework.
.. code-block:: json
{
"in_pcloud": [
"/ext4/hei/Hessigheim_Benchmark/Epoch_March2018/vl3d/mined/Mar18_train_hsv_std.laz"
],
"out_pcloud": [
"/ext4/hei/Hessigheim_Benchmark/Epoch_March2018/vl3d/out/pointmlp_dumean_neck_ctxhead/T1/*"
],
"sequential_pipeline": [
{
"train": "ConvolutionalAutoencoderPwiseClassifier",
"training_type": "base",
"fnames": ["ones", "HSV_Hrad", "HSV_S", "HSV_V"],
"random_seed": null,
"model_args": {
"fnames": ["ones", "HSV_Hrad", "HSV_S", "HSV_V"],
"num_classes": 11,
"class_names": ["LowVeg", "ImpSurf", "Vehicle", "UrbanFurni", "Roof", "Facade", "Shrub", "Tree", "Soil/Gravel", "VertSurf", "Chimney"],
"pre_processing": {
"pre_processor": "hierarchical_fpspp",
"support_strategy_num_points": 25000,
"to_unit_sphere": false,
"support_strategy": "fps",
"support_strategy_fast": 2,
"min_distance": 0.03,
"receptive_field_oversampling": {
"min_points": 2,
"strategy": "nearest",
"k": 3,
"radius": 0.5
},
"center_on_pcloud": true,
"training_class_distribution": [2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250, 2250],
"neighborhood": {
"type": "sphere",
"radius": 5.0,
"separation_factor": 0.8
},
"num_points_per_depth": [4096, 1024, 256, 64, 16],
"fast_flag_per_depth": [4, 4, false, false, false],
"num_downsampling_neighbors": [1, 16, 16, 16, 16],
"num_pwise_neighbors": [16, 16, 16, 16, 16],
"num_upsampling_neighbors": [1, 16, 16, 16, 16],
"nthreads": -1,
"training_receptive_fields_distribution_report_path": null,
"training_receptive_fields_distribution_plot_path": null,
"training_receptive_fields_dir": null,
"receptive_fields_distribution_report_path": null,
"receptive_fields_distribution_plot_path": null,
"receptive_fields_dir": null,
"training_support_points_report_path": null,
"support_points_report_path": null
},
"feature_extraction": {
"type": "PointMLP",
"operations_per_depth": [2, 1, 1, 1, 1],
"feature_space_dims": [64, 64, 96, 128, 192, 256],
"bn": true,
"bn_momentum": 0.90,
"activate": true,
"groups": [4, 4, 4, 4, 4, 4],
"Phi_blocks": [2, 2, 2, 2, 2, 2],
"Phi_residual_expansion": [2, 2, 2, 2, 2, 2],
"Phi_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Phi_regularizer": [null, null, null, null, null, null],
"Phi_constraint": [null, null, null, null, null, null],
"Phi_bn": [true, true, true, true, true, true],
"Phi_bn_momentum": [0.90, 0.90, 0.90, 0.90, 0.90, 0.90],
"Psi_blocks": [2, 2, 2, 2, 2, 2],
"Psi_residual_expansion": [2, 2, 2, 2, 2, 2],
"Psi_initializer": ["glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform", "glorot_uniform"],
"Psi_regularizer": [null, null, null, null, null, null],
"Psi_constraint": [null, null, null, null, null, null],
"Psi_bn": [true, true, true, true, true, true],
"Psi_bn_momentum": [0.90, 0.90, 0.90, 0.90, 0.90, 0.90]
},
"features_alignment": null,
"downsampling_filter": "mean",
"upsampling_filter": "mean",
"upsampling_bn": true,
"upsampling_momentum": 0.90,
"conv1d": true,
"conv1d_kernel_initializer": "glorot_normal",
"neck":{
"max_depth": 2,
"hidden_channels": [64, 64],
"kernel_initializer": ["glorot_uniform", "glorot_uniform"],
"kernel_regularizer": [null, null],
"kernel_constraint": [null, null],
"bn_momentum": [0.90, 0.90],
"activation": ["relu", "relu"]
},
"output_kernel_initializer": "glorot_normal",
"contextual_head": {
"max_depth": 2,
"hidden_channels": [64, 64],
"output_channels": [64, 64],
"bn": [true, true],
"bn_momentum": [0.90, 0.90],
"bn_along_neighbors": [true, true],
"activation": ["relu", "relu"],
"distance": ["euclidean", "euclidean"],
"ascending_order": [true, true],
"aggregation": ["max", "max"],
"initializer": ["glorot_uniform", "glorot_uniform"],
"regularizer": [null, null],
"constraint": [null, null]
},
"model_handling": {
"summary_report_path": "*/model_summary.log",
"training_history_dir": "*/training_eval/history",
"class_weight": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"training_epochs": 200,
"batch_size": 16,
"training_sequencer": {
"type": "DLSequencer",
"random_shuffle_indices": true,
"augmentor": {
"transformations": [
{
"type": "Rotation",
"axis": [0, 0, 1],
"angle_distribution": {
"type": "uniform",
"start": -3.141592,
"end": 3.141592
}
},
{
"type": "Scale",
"scale_distribution": {
"type": "uniform",
"start": 0.985,
"end": 1.015
}
},
{
"type": "Jitter",
"noise_distribution": {
"type": "normal",
"mean": 0,
"stdev": 0.0033
}
}
]
}
},
"prediction_reducer": {
"reduce_strategy" : {
"type": "MeanPredReduceStrategy"
},
"select_strategy": {
"type": "ArgMaxPredSelectStrategy"
}
},
"checkpoint_path": "*/checkpoint.weights.h5",
"checkpoint_monitor": "loss",
"learning_rate_on_plateau": {
"monitor": "loss",
"mode": "min",
"factor": 0.1,
"patience": 2000,
"cooldown": 5,
"min_delta": 0.01,
"min_lr": 1e-6
}
},
"compilation_args": {
"optimizer": {
"algorithm": "Adam",
"learning_rate": {
"schedule": "exponential_decay",
"schedule_args": {
"initial_learning_rate": 1e-2,
"decay_steps": 2250,
"decay_rate": 0.96,
"staircase": false
}
}
},
"loss": {
"function": "class_weighted_categorical_crossentropy"
},
"metrics": [
"categorical_accuracy"
]
},
"architecture_graph_path": "*/model_graph.png",
"architecture_graph_args": {
"show_shapes": true,
"show_dtype": false,
"show_layer_names": true,
"rankdir": "LR",
"expand_nested": false,
"dpi": 200,
"show_layer_activations": false
}
},
"autoval_metrics": null,
"training_evaluation_metrics": null,
"training_class_evaluation_metrics": null,
"training_evaluation_report_path": null,
"training_class_evaluation_report_path": null,
"training_confusion_matrix_report_path": null,
"training_confusion_matrix_plot_path": null,
"training_class_distribution_report_path": null,
"training_class_distribution_plot_path": null,
"training_classified_point_cloud_path": null,
"training_activations_path": null
},
{
"writer": "PredictivePipelineWriter",
"out_pipeline": "*/model/PointMLP.pipe",
"include_writer": false,
"include_imputer": true,
"include_feature_transformer": true,
"include_miner": true,
"include_class_transformer": false,
"include_clustering": false,
"ignore_predictions": false
}
]
}
The JSON above defines a :class:`.ConvAutoencPwiseClassif` that uses a
hierarchical furthest point sampling strategy with a 3D spherical neighborhood
to prepare the input for a PointMLP-based model. It uses
:class:`.PointMLPLayer` for feature extraction,
:class:`.FeaturesDownsamplingLayer` for downsampling with mean filter,
analogously also :class:`.FeaturesUpsamplingLayer` for mean-based
upsampling, a neck before the head, and a contextual head after the standard
segmentation head based on :class:`.ContextualPointLayer`.
**Arguments**
-- ``training_type``
Typically it should be ``"base"`` for neural networks. For further details,
read the :ref:`training strategies section `.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``random_seed``
See :ref:`KPConv arguments documentation `.
-- ``model_args``
The model specification.
-- ``fnames``
See :ref:`KPConv arguments documentation `.
-- ``num_classes``
See :ref:`KPConv arguments documentation `.
-- ``class_names``
See :ref:`KPConv arguments documentation `.
-- ``pre_processing``
See :ref:`KPConv arguments documentation `.
-- ``feature_extraction``
The definition of the feature extraction operator. A detailed
description of the case when ``"type": "PointMLP"`` is given
below. For a description of the case when ``"type": "PointNet"``
see :ref:`the PointNet operator documentation `,
for the case ``"type": "KPConv"`` see
:ref:`the KPConv operator documentation `,
to mimic a SFL-NET model see
:ref:`the SFL-NET documentation `,
for the case ``"type": "LightKPConv"`` see
:ref:`the LightKPConv operator documentation