Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

hzzzzzhappy/C3DAD

Open more actions menu

Repository files navigation

Continuous Learning for 3D Anomaly Detection (C3DAD)

This is the official implementation of paper 'C3D-AD: Toward Continual 3D Anomaly Detection via Kernel Attention with Learnable Advisor'. You can read paper here at Research Gate or Github.

Haoquan Lu, Hanzhe Liang, Jie Zhang, Chenxi Hu, Jinbao Wang, Can Gao.

For code-related issues, please contact Hanzhe Liang (email: lianghanzhe2023@email.szu.edu.cn).

For paper-related questions, please contact Haoquan Lu (email: 2200271072@email.szu.edu.cn).

😊If this research helped you, please give it a ⭐.

Pipeline

1. Quick Start

1.1 Requirements

  • Conda virtual environment creation
conda create -n CL3AD python=3.8
conda activate CL3AD
pip install -r requirements.txt
pip install "git+https://github.com/erikwijmans/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib"
pip install --upgrade https://github.com/unlimblue/KNN_CUDA/releases/download/0.2/KNN_CUDA-0.2-py3-none-any.whl

1.2 Checkpoints

  • Download feature extractor pre-trained weights. Point-MAE pre-trained weights can be downloaded here. After downloading, place the modelnet_8k.pth file in the ./pretrain_ckp directory

  • Download checkpoints of model. (Optional) After downloading from here, place the ckpt_best.pth.tar file in the experiments/[dataset]/[load_path from config.yaml] directory. For example, experiments/real3d/checkpoints_x

1.3 Real3D-AD

  • How to get the Real3D-AD dataset. Download the Real3D-AD dataset from here. After downloading, unzip it to the directory you specified.

  • Real3D Downsampling. To simplify the training, you first need to downsampling the training set of Real3D. You can use the following command: python downsample_pcd.py --radl3d_path <Path/to/your/Real3D-AD-PCD> After the above operations are completed, the real3D_down directory will be created in the same directory layer as Real3D-AD-PCD.

  • cd the experiment directory by running cd ./experiments/real3d/.

  • Modify the config.yaml. Please set the dataset.data_dir and net.data_dir of config.yaml to load the absolute path of your Real3D-AD-PCD.

  • Train or eval by running:

    sh train.sh 1 #GPU_ID or sh eval.sh #1 #GPU_ID.

    Note: Multi-gpu training is not currently supported. During eval, please set the saver.load_path of config.yaml to load the checkpoints.

  • Different continual tasks Please match the dataset.task_num, dataset.train / test.meta_file, cls_dataset.train / test.meta_file, saver.load_path, saver.save_dir, evaluator.save_dir.

1.4 Anomaly-ShapeNet

  • How to get the Anomaly-ShapeNet dataset. Download the Anomaly-ShapeNet dataset from here. After downloading, unzip it to the directory you specified. Take out Anomaly-ShapeNet-v2/dataset/pcd and organize it into the following format:
Anomaly-ShapeNet
├── ashtray0
    ├── train
        ├── *template.pcd
        ...
    ├── test
        ├── 1_bulge.pcd
        ├── 2_concavity.pcd
        ...
    ├── GT
        ├── 1_bulge.txt
        ├── 2_sink.txt
        ... 
├── bag0
...
  • Anomaly-ShapeNet dataset setting. Please change the name of the pcd directory to Anomaly-ShapeNet and fill the absolute path of the Anomaly-ShapeNet into dataset.data_dir and net.data_dir in ./experiments/Anomaly-ShapeNet/config.yaml.

  • cd the experiment directory by running cd ./experiments/Anomaly-ShapeNet/.

  • Train or eval by running:

    sh train.sh 1 #GPU_ID or sh eval.sh 1 #GPU_ID.

    Note: During eval, please set config.saver.load_path to load the checkpoints.

  • Different continual tasks Please match the dataset.task_num, dataset.train / test.meta_file, cls_dataset.train / test.meta_file, saver.load_path, saver.save_dir, evaluator.save_dir.

1.5 MulSen_AD

  • How to get the MulSen_AD dataset. Download the MulSen_AD dataset from here. After downloading, unzip it to the directory you specified. Follow Hanzhe Liang to process the dataset into the following format:
MulSen_AD_process
├── cotton
    ├── train
        ├── *template.pcd
        ...
    ├── test
        ├── x_good.pcd
        ├── y_bad.pcd
        ...
    ├── GT
        ├── *.txt
        ├── *.txt
        ... 
├── cube
...
  • MulSen_AD dataset setting. Please change the name of the pcd directory to MulSen_AD_process and fill the absolute path of the MulSen_AD_process into dataset.data_dir and net.data_dir in ./experiments/MulSen_AD_process/config.yaml.

  • cd the experiment directory by running cd ./experiments/MulSen_AD_process/.

  • Train or eval by running:

    sh train.sh 1 #GPU_ID or sh eval.sh 1 #GPU_ID.

    Note: During eval, please set config.saver.load_path to load the checkpoints.

  • Different continual tasks Please match the dataset.task_num, dataset.train / test.meta_file, cls_dataset.train / test.meta_file, saver.load_path, saver.save_dir, evaluator.save_dir.

Baseline method implementation

For the pre-existing methods, we modified the content on their official code implementations to accommodate continuous learning settings. You can find the exact implementation baseline/.

Acknowledgement

Our work is built on MC3D-AD, UniAD, and Reg3D-AD, thanks their extraordinary works!

Licences

MIT License

Copyright (c) 2025 Hanzhe Liang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

This is the official implementation of paper 'C3D-AD: Toward Continual 3D Anomaly Detection via Kernel Attention with Learnable Advisor'.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.