Feature Modes
Choose the right feature set for your machine learning application. IGN LiDAR HD offers predefined feature modes optimized for different use cases.
π― Feature Modes Overviewβ
Mode | Features | Speed | Use Case | v2.4.3+ Export |
---|---|---|---|---|
minimal | ~8 | β‘β‘β‘β‘ | Quick prototyping | β Complete |
lod2 | ~12 | β‘β‘β‘ | Basic building classification | β Complete |
lod3 | ~38 | β‘β‘ | Detailed architectural modeling | β Complete |
full | ~43 | β‘ | Research, complete analysis | β Complete |
custom | Variable | Variable | User-defined selection | β Complete |
All computed features are now saved to disk! Previous versions (< 2.4.3) only exported 12 features even when computing 35+. Regenerate datasets for complete feature sets.
π Feature Set Detailsβ
LOD2 Mode (12 features)β
Essential features for basic building classification:
features:
mode: lod2
k_neighbors: 20
Feature List:
- Normals (3):
normal_x
,normal_y
,normal_z
- Shape (3):
planarity
,linearity
,sphericity
- Height (1):
height_above_ground
- Building (2):
verticality
,wall_score
- Density (1):
density
- Curvature (1):
curvature
- Radiometric (Optional): RGB (3), NIR (1), NDVI (1)
Performance:
- Processing: ~15s per 1M points (CPU)
- Training: Fast convergence
- Memory: ~200 MB per 1M points
Best For:
- Building vs. non-building classification
- LOD2 semantic segmentation
- Baseline model development
- Fast iteration cycles
LOD3 Mode (38 features)β
Complete feature set for detailed architectural modeling:
features:
mode: lod3
k_neighbors: 30
include_extra: true
Complete Feature List:
Normals (3):
normal_x
,normal_y
,normal_z
- complete normal vectors
Shape Descriptors (6):
planarity
,linearity
,sphericity
anisotropy
,roughness
,omnivariance
Curvature (2):
curvature
,change_curvature
Eigenvalues (5):
eigenvalue_1
,eigenvalue_2
,eigenvalue_3
sum_eigenvalues
,eigenentropy
Height Features (3):
height_above_ground
,vertical_std
,z_normalized
Building Scores (3):
verticality
,wall_score
,roof_score
Density Features (5):
density
,local_density
,num_points_2m
neighborhood_extent
,height_extent_ratio
Architectural Features (4):
edge_strength
,corner_likelihood
overhang_indicator
,surface_roughness
Radiometric (Optional):
- RGB (3):
red
,green
,blue
- Infrared (2):
nir
,ndvi
Performance:
- Processing: ~45s per 1M points (CPU)
- Training: Slower but more detailed
- Memory: ~600 MB per 1M points
Best For:
- LOD3 architectural modeling
- Fine structure detection (edges, corners, overhangs)
- Detailed building classification
- Research applications
Full Mode (43+ features)β
Complete feature set for research and analysis:
features:
mode: full
include_extra: true
compute_all: true
All Features (beyond LOD3):
Additional Height Variants (3):
z_absolute
,z_from_ground
,z_from_median
- multiple height normalizations
Additional Geometric (2):
distance_to_center
- radial distance from patch centerlocal_roughness
- fine-scale surface variationhorizontality
- complement to verticality
Output Format (v2.4.2+):
- NPZ/HDF5/PyTorch: Full 43+ feature matrix
- LAZ: All 35+ features as extra dimensions
- Metadata:
feature_names
list,num_features
count
Performance:
- Processing: ~50s per 1M points (CPU)
- Training: Complete geometric description
- Memory: ~700 MB per 1M points
- File Size: ~3-4x larger than LOD2 (worth it for completeness)
Best For:
- Research and feature analysis
- Maximum information extraction
- Feature importance studies
- Complete geometric characterization
- GIS visualization (all features in LAZ)
All computed features are now exported! Previous versions (< 2.4.2) only saved 12 features despite computing 43+. Upgrade and regenerate datasets for complete feature access.
π Quick Start Examplesβ
Example 1: Fast LOD2 Trainingβ
ign-lidar-hd process \
--config-file examples/config_lod2_simplified_features.yaml \
input_dir=data/raw \
output_dir=data/patches
Configuration:
processor:
lod_level: LOD2
num_points: 16384
features:
mode: lod2
k_neighbors: 20
use_rgb: true
compute_ndvi: true
Expected Output:
- 11 features per point
- Fast training convergence
- Good baseline accuracy
Example 2: Detailed LOD3 Modelingβ
ign-lidar-hd process \
--config-file examples/config_lod3_full_features.yaml \
input_dir=data/raw \
output_dir=data/patches
Configuration:
processor:
lod_level: LOD3
num_points: 32768
features:
mode: lod3
k_neighbors: 20
include_extra: true
compute_ndvi: true
Expected Output:
- 38 features per point
- Detailed architectural structures
- Best accuracy for LOD3
Example 3: Complete Feature Set (Full Mode)β
ign-lidar-hd process \
--config-file examples/config_complete.yaml \
input_dir=data/raw \
output_dir=data/patches
Configuration (v2.4.2+):
processor:
lod_level: LOD3
num_points: 32768
features:
mode: full
k_neighbors: 30
include_extra: true
compute_all: true
use_rgb: true
use_infrared: true
compute_ndvi: true
output:
formats: ["npz", "laz"] # LAZ for GIS visualization
include_metadata: true
Expected Output:
- 43+ features per point (all computed features)
- Complete geometric characterization
- LAZ files with all features as extra dimensions
- Metadata with feature names and counts
Verification:
import numpy as np
# Load and check
data = np.load('patches/patch_001.npz')
meta = data['metadata'].item()
print(f"Features: {meta['num_features']}")
print(f"Names: {meta['feature_names']}")
# Expected: 43+ features with full list
Example 4: Multi-Scale Hybridβ
ign-lidar-hd process \
--config-file examples/config_multiscale_hybrid.yaml \
input_dir=data/raw \
output_dir=data/patches
Configuration:
processor:
patch_configs:
- size: 50.0
feature_mode: lod3 # Fine details
num_points: 24000
- size: 100.0
feature_mode: lod3 # Medium context
num_points: 32000
- size: 150.0
feature_mode: lod2 # Coarse generalization
num_points: 32000
Strategy:
- Small patches (50m): LOD3 for fine details
- Large patches (150m): LOD2 for context
- Adaptive feature complexity
π Best Practicesβ
Choosing the Right Modeβ
Use LOD2 (12 features) when:
- β Building basic classification models
- β Need fast training cycles
- β Limited computational resources
- β Prototyping new architectures
- β Building vs. non-building classification
Use LOD3 (38 features) when:
- β Need detailed architectural features
- β Detecting edges, corners, overhangs
- β LOD3 building modeling
- β Maximum accuracy is priority
- β Fine structure detection
Use Full (43+ features) when:
- β Research and feature analysis
- β Need all computed features
- β Feature importance studies
- β Maximum information extraction
- β GIS visualization with LAZ export
Use Custom when:
- β Specific feature requirements
- β Domain knowledge guides selection
- β Optimizing for specific architecture
Feature Selection Strategyβ
Start Simple:
- Begin with LOD2 (11 features)
- Train baseline model
- Evaluate performance
Add Complexity:
- Upgrade to LOD3 if needed
- Monitor overfitting on validation set
- Compare accuracy improvement
Optimize:
- Remove features with low importance
- Custom mode with essential features only
- Balance accuracy vs. training time
Performance Tuningβ
For Faster Processing:
features:
mode: lod2 # Fewer features
k_neighbors: 20 # Lower k
use_gpu: true # GPU acceleration
For Better Accuracy:
features:
mode: lod3 # More features
k_neighbors: 30 # Higher k
include_extra: true # All enhanced features
use_radius: true # Better neighborhoods
For Memory Constraints:
features:
mode: lod2 # Smaller feature set
use_gpu_chunked: true
gpu_batch_size: 500000
π Feature Importance Analysisβ
Critical Features (Present in all modes)β
- planarity - Distinguishes flat surfaces (walls, roofs)
- height_above_ground - Separates ground from buildings
- verticality - Identifies vertical surfaces (walls)
- normals - Direct orientation indicators
LOD3+ High-Value Featuresβ
- edge_strength - Building edges and corners
- wall_score - Direct wall classification
- roof_score - Direct roof classification
- eigenvalue_1 - Dominant structural direction
- corner_likelihood - Junction detection
Full Mode Additional Featuresβ
- horizontality - Horizontal surface identification
- local_roughness - Fine-scale surface variation
- z_from_ground/median - Multiple height references
- distance_to_center - Radial position information
Radiometric Features (Optional in all modes)β
- ndvi - Vegetation vs. building separation
- rgb - Color-based classification
- nir - Vegetation reflectance
π§ Python APIβ
Using Feature Modesβ
from ign_lidar import LiDARProcessor
from ign_lidar.features import get_feature_config
# Get feature configuration
config = get_feature_config("lod3", k_neighbors=30)
print(f"Features: {config.num_features}")
print(f"Names: {config.feature_names}")
# Process with LOD3
processor = LiDARProcessor(
lod_level="LOD3",
use_gpu=True
)
patches = processor.process_tile("input.laz", "output/")
Custom Feature Selectionβ
from ign_lidar.features import get_feature_config
# Define custom features
custom_features = {
'xyz',
'normal_z',
'planarity',
'linearity',
'height_above_ground',
'wall_score',
'roof_score',
'density'
}
# Create custom configuration
config = get_feature_config(
mode="custom",
custom_features=custom_features,
k_neighbors=25
)
# Use in processor
processor = LiDARProcessor(
lod_level="LOD3",
custom_features=custom_features
)
π Benchmark Resultsβ
Processing Speed (1M points, CPU)β
Mode | Features | Time | Speedup vs. Full |
---|---|---|---|
LOD2 | 12 | 15s | 3.3x faster |
LOD3 | 38 | 45s | 1.1x faster |
Full | 43+ | 50s | baseline |
Memory Usage (1M points)β
Mode | Features | RAM | GPU VRAM |
---|---|---|---|
LOD2 | 12 | 200 MB | 150 MB |
LOD3 | 38 | 600 MB | 400 MB |
Full | 43+ | 700 MB | 450 MB |
File Sizes (per patch, 16K points)β
Mode | Features | NPZ Size | LAZ Size |
---|---|---|---|
LOD2 | 12 | ~250 KB | ~180 KB |
LOD3 | 38 | ~650 KB | ~420 KB |
Full | 43+ | ~750 KB | ~480 KB |
Training Performanceβ
Dataset: 100K patches, PointNet++ architecture
Mode | Features | Epochs | Val Accuracy | Inference Time |
---|---|---|---|---|
LOD2 | 12 | 50 | 87.3% | 12ms/patch |
LOD3 | 38 | 80 | 92.1% | 18ms/patch |
Full | 43+ | 90 | 93.5% | 20ms/patch |
Conclusion: LOD3 provides +4.8% accuracy over LOD2. Full mode provides additional +1.4% for research applications.
π Troubleshootingβ
Issue: Out of memory with LOD3β
Solution:
features:
mode: lod2 # Use simpler mode
# Or enable chunking:
use_gpu_chunked: true
gpu_batch_size: 500000
Issue: Training overfits with LOD3β
Solution:
- Increase regularization (dropout, weight decay)
- Add more data augmentation
- Consider LOD2 for better generalization
Issue: Too slow processingβ
Solution:
processor:
use_gpu: true # Enable GPU
features:
mode: lod2 # Fewer features
k_neighbors: 20 # Lower k
π Related Documentationβ
π Example Configurationsβ
All example configs available in examples/
directory:
config_lod2_simplified_features.yaml
- 12 features, fast trainingconfig_lod3_full_features.yaml
- 38 features, detailed modelingconfig_complete.yaml
- 43+ features, complete feature exportconfig_multiscale_hybrid.yaml
- Multi-scale adaptive featuresconfig_training_dataset.yaml
- Production training configs
Choose wisely. Train efficiently. Build better models. π