Code Monkey home page Code Monkey logo

squid's Introduction

๐Ÿฆ‘ SQUID ๐Ÿฆ‘

We propose Space-aware memory QUeues for In-painting and Detecting anomalies from radiography images (abbreviated as SQUID). Radiography imaging protocols focus on particular body regions, therefore producing images of great similarity and yielding recurrent anatomical structures across patients. To exploit this structured information, SQUID consists of a new Memory Queue and a novel in-painting block in the feature space.

SQUID can taxonomize the ingrained anatomical structures into recurrent patterns; and in the inference, SQUID can identify anomalies (unseen/modified patterns) in the image. SQUID surpasses the state of the art in unsupervised anomaly detection by over 5 points on two chest X-ray benchmark datasets.

Paper

This repository provides the official Pytorch implementation of SQUID in the following papers:

SQUID: Deep Feature In-Painting for Unsupervised Anomaly Detection
Tiange Xiang1, Yixiao Zhang2, Yongyi Lu2, Alan L. Yuille2, Chaoyi Zhang1, Weidong Cai1, and Zongwei Zhou2
1University of Sydney, 2Johns Hopkins University
CVPR, 2023
paper | code

Benchmarking SQUID on Chest X-rays

Dependencies

Please clone our environment using the following command:

conda env create -f environment.yml
conda activate squid

File Structures

  • checkpoints/: experiment folders, organized by unique exp identifier.
  • dataloader/: dataloaders for zhanglab, chexpert, and digitanotamy.
  • models/: models for SQUID, inpainting block, all kinds of memory, basic modules, and discriminator.
  • configs/: configure files for different experiments, based on the base configure class.

Usage

Data

ZhangLab Chest X-ray

Please download the offical training/testing and our validation splits from google drive, and unzip it to anywhere you like.

Stanford ChexPert

Please download the offical training/validation and our testing splits from google drive, and unzip it to anywhere you like.

DigitAnatomy

Please unzip the files in data/digitanatomy.zip, and place them to the data root as specified in the configs/base.py.

Configs

Different experiments are controlled by configure files, which are in configs/.

All configure files are inherited from the base configure file: configs/base.py, we suggest you to take a look at this base file first, and change the dataset root path in your machine.

Then, you can inherite the base configure class and change settings as you want.

We provide our default configures for ZhangLab: configs/zhang_best.py, CheXpert: configs/chexpert_best.py and configs/digit_best.py.

The path to a configure file needs to be passed to the program for training.

Train

Train with a configure file and a unique experiment identifier:

python3 main.py --exp zhang_exp1 --config zhang_best

Alternatively, you can modify run.sh and simply run:

./run.sh

Evaluation

Evaluate with an exp identifier (config file will be imported from the exp folder instead):

python3 eval.py --exp zhang_exp1

Alternatively, you can modify eval.sh and simply run:

./eval.sh

Citation

If you use this work for your research, please cite our paper:

@article{xiang2023painting,
  title={In-painting Radiography Images for Unsupervised Anomaly Detection},
  author={Xiang, Tiange and Liu, Yongyi and Yuille, Alan L and Zhang, Chaoyi and Cai, Weidong and Zhou, Zongwei},
  journal={IEEE/CVF Converence on Computer Vision and Pattern Recognition},
  year={2023}
}

Acknowledgement

This work was supported by the Lustgarten Foundation for Pancreatic Cancer Research. We appreciate the constructive suggestions from Yingda Xia, Jessica Han, Yingwei Li, Bowen Li, Adam Kortylewski, Huiyu Wang, and Sonomi Oyagi.

squid's People

Contributors

mrgiovanni avatar tiangexiang 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.