Smooth Attention for Deep Multiple Instance Learning: Application to CT Intracranial Hemorrhage Detection
The codes for the paper accepted in MICCAI 2023.
Table of Contents
Multiple Instance Learning (MIL) has been widely applied to medical imaging diagnosis, where bag labels are known and instance labels inside bags are unknown. Traditional MIL assumes that instances in each bag are independent samples from a given distribution. However, instances are often spatially or sequentially ordered, and one would expect similar diagnostic importance for neighboring instances. To address this, in this study, we propose a smooth attention deep MIL (SA-DMIL) model. Smoothness is achieved by the introduction of first and second order constraints on the latent function encoding the attention paid to each instance in a bag. The method is applied to the detection of intracranial hemorrhage (ICH) on head CT scans. The results show that this novel SA-DMIL: (a) achieves better performance than the non-smooth attention MIL at both scan (bag) and slice (instance) levels; (b) learns spatial dependencies between slices; and (c) outperforms current state-of-the-art MIL methods on the same ICH test set.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- The codes use Tensorflow and you can download all packages in requirements.txt.
matplotlib==3.7.1
numpy==1.22.4
opencv_contrib_python==4.7.0.72
opencv_python==4.7.0.72
opencv_python_headless==4.7.0.72
pandas==1.5.3
scikit_learn==1.2.2
tensorflow==2.12.0
- Pip install requirements.txt
pip install requirements.txt
- Open SA-MIL-preprocessing.ipynb - How to process head CTs
- Open SA-MIL-training.ipynb - Train SA-DMIL
- Open Non-SA-MIL-training.ipynb - Train Att-MIL
- Open SA-MIL-testing.ipynb - Test SA-DMIL and Att-MIL
- Open vis-SA-MIL.ipynb - Visualize at slice level
The dataset used in this paper can be download via Kaggle Challenge Dataset
- Model training at scan level
- Model testing at scan level
- Model testing at slice level
Distributed under the MIT License. See LICENSE.txt
for more information.