Skip to content

zyh16143998882/CASL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CASL: Curvature-Augmented Self-supervised Learning for 3D Anomaly Detection

This repository provides the official implementation of CASL: Curvature-Augmented Self-supervised Learning for 3D Anomaly Detection at AAAI 2026.

1. Introduction

Deep learning-based 3D anomaly detection methods have demonstrated significant potential in industrial manufacturing. However, many approaches are specifically designed for anomaly detection tasks, which limits their generalizability to other 3D understanding tasks. In contrast, self-supervised point cloud models aim for general-purpose representation learning, yet our investigation reveals that these classical models are suboptimal at anomaly detection under the unified fine-tuning paradigm. This motivates us to develop a more generalizable 3D model that can effectively detect anomalies without relying on task-specific designs. Interestingly, we find that using only the curvature of each point as its anomaly score already outperforms several classical self-supervised and dedicated anomaly detection models, highlighting the critical role of curvature in 3D anomaly detection. In this paper, we propose a Curvature-Augmented Self-supervised Learning (CASL) framework based on a reconstruction paradigm. Built upon the classical U-Net architecture, our approach introduces multi-scale curvature prompts to guide the decoder in predicting the spatial coordinates of each point. Without relying on any dedicated anomaly detection mechanisms, it achieves leading detection performance through straightforward anomaly classification fine-tuning. Moreover, the learned representations generalize well to standard 3D understanding tasks such as point cloud classification.

img.png

In the following, we will guide you how to use this repository step by step. 🤗

2. Preparation

git clone https://github.com/zyh16143998882/CASL.git
cd CASL/

2.1 Requirements

conda create -y -n casl python=3.8
conda activate casl

pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu117
pip install -r requirements.txt

conda install openblas-devel -c anaconda
git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd MinkowskiEngine/
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas

2.2 Download the point cloud datasets and organize them properly

Before running the code, we need to make sure that everything needed is ready. First, the working directory is expected to be organized as below:

click to expand 👈
CASL/
├── data/
│   ├── Anomaly-ShapeNet-v2/ 
│   │   └── dataset/
│   │       ├── new_obj
│   │       ├── new_pcd
│   │       ├── obj
│   │       └──pcd
│   ├── Real3D/ # ModelNet Few-shot
│   │   ├── Real3D-AD-PCD/
│   │       ├── airplane
│   │       ├── ...
│   │       └── toffees
│   │   ├── Real3D-AD-PLY/
│   │       ├── airplane
│   │       ├── ...
│   │       └── toffees

Here we have also collected the download links of required datasets for you:

  • Real3D-AD: [link].
  • Anomaly-ShapeNet: [link].

3. Pre-training

You can start the pre-training of the CASL model from scratch by using the following commands:

cd casl_pretrain
CUDA_VISIBLE_DEVICES=5 python train.py --logpath ./log/pretrain/

Or you can directly fine-tune using our pre-trained model. The link of our model is here.

4. Fine-tuning

Set Dataset Path:

cd casl_ft/
ln -s ../data .

Real3d-AD

cd casl_ft/sh
bash real.sh  

Anomaly-ShapeNet

cd casl_ft/sh
bash shape.sh  

5. Validate with checkpoints

You can reproduce our results in the following way:

  1. Download the following ckpts to the "casl_ft/checkpoints" folder;

  2. Run "real_test.sh"

cd casl_ft/sh
bash real_test.sh  
Dataset Category O-AUROC P-AUROC Checkpoints Download
Real3DAD Airplane 0.808 0.842 ckpts
Real3DAD Car 0.799 0.905 ckpts
Real3DAD Candybar 0.848 0.932 ckpts
Real3DAD Chicken 0.657 0.713 ckpts
Real3DAD Diamond 0.976 0.988 ckpts
Real3DAD Duck 0.836 0.895 ckpts
Real3DAD Fish 0.935 0.935 ckpts
Real3DAD Gemstone 0.769 0.916 ckpts
Real3DAD Seahorse 0.643 0.814 ckpts
Real3DAD Shell 0.791 0.873 ckpts
Real3DAD Starfish 0.893 0.839 ckpts
Real3DAD Toffees 0.924 0.937 ckpts

6. Bibliography

If you find this code useful or use the toolkit in your work, please consider citing:

@article{zha2025casl,
  title={CASL: Curvature-Augmented Self-supervised Learning for 3D Anomaly Detection},
  author={Zha, Yaohua and Yuerong, Xue and Fan, Chunlin and Wang, Yuansong and Dai, Tao and Chen, Ke and Xia, Shu-Tao},
  journal={arXiv preprint arXiv:2511.12909},
  year={2025}
}

7. Acknowledgements

Our codes are built upon PO3AD, Real3D-AD, Anomaly-ShapeNet. Thanks for their efforts.

8. Contact

If you have any question, you can raise an issue or email Yaohua Zha (zyh1614399882@gmail.com).

About

The code for the paper "CASL: Curvature-Augmented Self-supervised Learning for 3D Anomaly Detection" (AAAI'26).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors