Skip to content

dzem2912/Generative3DCounterfactuals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Generative 3D Point Cloud Counterfactuals: Explaining 3D Semantic Segmentation through Generative AI-based Counterfactuals

This repository contains the implementation of Explaining 3D Semantic Segmentation through Generative AI-based Counterfactuals, a generative framework for counterfactual explanations in 3D semantic segmentation.

The framework introduces a latent-space navigation approach to generate counterfactuals for 3D point cloud models. By leveraging autoencoder-based latent representations, UMAP embeddings, and graph traversal (Delaunay triangulation + shortest-path search), the method produces counterfactual point clouds that remain both geometrically plausible and semantically meaningful.

Graphical-Abstract

Figure 1: Graphical Abstract - Schematic diagram of the proposed framework for generating counter- factuals in 3D PCD.


Overview

  • PointNet++ Autoencoder for compact latent representations.
  • Latent space counterfactual generation with:
    • UMAP projection for semantic neighborhood preservation.
    • Graph construction via Delaunay triangulation.
    • Geodesic shortest-path search guided by plausibility + classifier confidence.
  • Semantic segmentation classifier (PointNet++) to validate plausibility.
  • Interpretability metrics:
    • Similarity - closeness to the original point cloud
    • Validity - intensity in classification change
    • Sparsity - intensity of local change given a epsilon value
  • Supports ShapeNet classes: car, bus, boat, tower, motorcycle, airplane.

πŸ“‚ Project Structure

source/
│── main_syn.py                  # Main script for counterfactual experiments
β”‚
β”œβ”€β”€ generative/                  # Generative Autoencoder Source code 
β”‚   β”œβ”€β”€ dataset.py
β”‚   β”œβ”€β”€ model.py                  # Autoencoder (PointNet++ encoder + decoder)
β”‚   β”œβ”€β”€ pointnet_utils.py
β”‚   β”œβ”€β”€ train.py
β”‚   β”œβ”€β”€ train_utils.py
β”‚   └── preds/                    # Example counterfactual outputs (.pcd)
β”‚
β”œβ”€β”€ semseg/                       # Semantic Segmentation Classifier
β”‚   β”œβ”€β”€ dataset.py
β”‚   β”œβ”€β”€ model.py                  # PointNet++ semantic segmentation model
β”‚   β”œβ”€β”€ train.py
β”‚   └── test.py
β”‚
└── scripts/
    └── instance_preprocessing.py # ShapeNet preprocessing

About

This repository contains the implementation of Generative 3D Counterfactuals, a generative framework for counterfactual explanations in 3D semantic segmentation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages