Boehringer-Ingelheim / anomaly-detection-in-histology

Learning image representations for anomaly detection: application to discovery of histological alterations in drug development
MIT License
17 stars 1 forks source link
anomaly-detection convolutional-neural-networks deep-features deep-learning drug-toxicity one-class-classfiation pytorch

Learning Image Representations for Anomaly Detection


This repository contains Pytorch implementation of training image representations and performance evaluation of the approach introduced in I. Zingman, B. Stierstorfer, C. Lempp, F. Heinemann. "Learning image representations for anomaly detection: application to discovery of histological alterations in drug development", Medical Image Analysis, 2024. It is also available on ArXiv and temporary has a free access on Elsevier.

The paper develops a method for anomaly detection in whole slide images of stained tissue samples in order to routinely screen histopathological data for abnormal alterations in tissue.

GitHub Logo

Figure above shows detection of adverse drug reactions by the Boehinger Ingelheim Histological Network (BIHN) based anomaly detection. A: The developed Anomaly Detection (AD) method detects induced tissue alterations in the liver of mouse after administration an experimental compound. The fraction of abnormal tiles increases with the the dosage of the compound. The compound was previously found to have toxic side effects in toxicological screening by pathologists. Each dot corresponds to a single Whole Slide Image (WSI). Three arrows correspond to three WSI examples given in B. Stars on the top of the graph show statistical significance of the change compared to the mean of control group. B: Examples of detected anomalies. In the control group (left image) blood and a few other not pathological structures result in a low level of false positives. Detections in compound treated groups (two right images) correspond to pathological alterations and were confirmed by a pathologist.


Requirements

PyTorch, NumPy, Pillow, scikit-learn

The code in the repository was tested under Python 3.9 with GPU 11GB and packages' listed in the requirements.txt. It, however, should also run with earlier Python versions and smaller GPU memory.

Experiments (training image representations and performance evaluation)

GitHub Logo

Setting up dataset

Folders structure for project's input

 .
 ├── data
     ├── test
     │   ├── NAFLD_anomaly_he_mouse_liver
     │   ├── NAFLD_anomaly_mt_mouse_liver
     │   ├── normal_he_mouse_liver
     │   └── normal_mt_mouse_liver
     └── train
         ├── he_mouse_brain
         ├── he_mouse_heart
         ├── he_mouse_kidney
         ├── he_mouse_liver
         ├── he_mouse_lung
         ├── he_mouse_pancreas
         ├── he_mouse_spleen
         ├── he_rat_liver
         ├── mt_mouse_brain 
         ├── mt_mouse_heart
         ├── mt_mouse_kidney
         ├── mt_mouse_liver
         ├── mt_mouse_lung
         ├── mt_mouse_pancreas
         ├── mt_mouse_spleen
         └── mt_rat_liver

Training

Evaluation

Expected performance of anomaly detection with BIHN models

Staining Balanced accuracy AU-ROC F1 score
H&E 94.20% 97.33% 94.09%
Masson Trichrome 97.51% 99.03% 97.51%

Use of pretrained BIHN models in your own projects

In oder to use pretrained BIHN models (*.pt files that can be downloaded from https://osf.io/gqutd/) to generate feature representations of histopathological images (Masson or H&E) for your own tasks, you can consult the code example in model_use_example.py.

Citing

@article{zingman2022anomaly,
      title={Learning image representations for anomaly detection: application to discovery of histological alterations in drug development},
      author={Igor Zingman and Birgit Stierstorfer and Charlotte Lempp and Fabian Heinemann},
      year={2022},
      journal={CoRR},
      volume={abs/2210.07675},    
      eprinttype = {arXiv},
      url = {https://arxiv.org/abs/2210.07675}
}
@online{NAFLD_dataset,
  author    = {Igor Zingman and Birgit Stierstofer and Fabian Heinemann},
  title     = {{NAFLD} pathology and healthy tissue samples},  
  year      = {2022},
  url       = {https://osf.io/gqutd/},   
}