Coder Social home page Coder Social logo

crossmodal-feature-mapping's Introduction

Multimodal Industrial Anomaly Detection by Crossmodal Feature Mapping (CVPR 2024)


๐Ÿšจ This repository contains download links to the datasets, code snippets, and checkpoints of our work "Multimodal Industrial Anomaly Detection by Crossmodal Feature Mapping", CVPR 2024

by Alex Costanzino*, Pierluigi Zama Ramirez*, Giuseppe Lisanti, and Luigi Di Stefano. * Equal Contribution

University of Bologna

๐ŸŽฌ Introduction

Recent advancements have shown the potential of leveraging both point clouds and images to localize anomalies. Nevertheless, their applicability in industrial manufacturing is often constrained by significant drawbacks, such as the use of memory banks, which lead to a substantial increase in terms of memory footprint and inference time. We propose a novel light and fast framework that learns to map features from one modality to the other on nominal samples and detect anomalies by pinpointing inconsistencies between observed and mapped features. Extensive experiments show that our approach achieves state-of-the-art detection and segmentation performance, in both the standard and few-shot settings, on the MVTec 3D-AD dataset while achieving faster inference and occupying less memory than previous multimodal AD methods. Furthermore, we propose a layer pruning technique to improve memory and time efficiency with a marginal sacrifice in performance.

Alt text

๐Ÿ–‹๏ธ If you find this code useful in your research, please cite:

@inproceedings{costanzino2024cross,
    title = {Multimodal Industrial Anomaly Detection by Crossmodal Feature Mapping},
    author = {Costanzino, Alex and Zama Ramirez, Pierluigi and Lisanti, Giuseppe and Di Stefano, Luigi},
    booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
    note = {CVPR},
    year = {2024},
}

๐Ÿ—„๏ธ Datasets

In our experiments, we employed two datasets featuring rgb images and point clouds: MVTec 3D-AD and Eyecandies. You can preprocess them with the scripts contained in processing.

๐Ÿ“ฅ Checkpoints

Here, you can download the weights of CFMs employed in the results of Table 1 and Table 2 of our paper.

To use these weights, please follow these steps:

  1. Create a folder named checkpoints/checkpoints_CFM_mvtec in the project directory;
  2. Download the weights [Download];
  3. Copy the downloaded weights into the checkpoints_CFM_mvtec folder.

๐Ÿ“ Code

Warning:

  • The code utilizes wandb during training to log results. Please be sure to have a wandb account. Otherwise, if you prefer to not use wandb, disable it in cfm_training.py with the flag mode = 'disabled'.

๐Ÿ› ๏ธ Setup Instructions

Dependencies: Ensure that you have installed all the necessary dependencies. The list of dependencies can be found in the ./requirements.txt file.

๐Ÿš€ Inference CFMs

The cfm_inference.py script test the CFMs. It can be used to generate anomaly maps.

You can specify the following options:

  • --dataset_path: Path to the root directory of the dataset.
  • --checkpoint_folder: Path to the directory of the checkpoints, i.e., checkpoints/checkpoints_CFM_mvtec.
  • --class_name: Class on which the CFMs was trained.
  • --epochs_no: Number of epochs used in CFMs optimization.
  • --batch_size: Number of samples per batch employed for CFMs optimization.
  • --qualitative_folder: Folder on which the anomaly maps are saved.
  • --quantitative_folder: Folder on which the metrics are saved.
  • --visualize_plot: Flag to visualize qualitatived during inference.
  • --produce_qualitatives: Flag to save qualitatived during inference.

You can reproduce the results of Table 1 and Table 2 of the paper by running 02_eval_mvtec.sh.

If you haven't downloaded the checkpoints yet, you can find the download links in the Checkpoints section above.

๐Ÿš€ Train CFMs

To train CFMs refer to the example in 01_train_mvtec.sh and 03_train_eyecandies.sh.

The cfm_training.py script train the CFMs.

You can specify the following options:

  • --dataset_path: Path to the root directory of the dataset.
  • --checkpoint_savepath: Path to the directory on which checkpoints will be saved, i.e., checkpoints/checkpoints_CFM_mvtec.
  • --class_name: Class on which the CFMs are trained.
  • --epochs_no: Number of epochs for CFMs optimization.
  • --batch_size: Number of samples per batch for CFMs optimization.

โœ‰๏ธ Contacts

For questions, please send an email to [email protected] or [email protected].

๐Ÿ™ Acknowledgements

We would like to extend our sincere appreciation to the authors of the following projects for making their code available, which we have utilized in our work:

  • We would like to thank the authors of M3DM, 3D-ADS and AST for providing their code, which has been instrumental in our experiments.

crossmodal-feature-mapping's People

Contributors

alex-costanzino avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.