Automatic Detection and Classification of Bleeding and Non-Bleeding frames in Wireless Capsule Endoscopy
- Adarsh Ghimire
- Basit Alawode
- Divya Velayudhan
- Shibani Hamza
We split the given training data into new training and validation splits using the ratio 80:20. We provide the link to these splits below:
- Train and Validation Split link
The respective folders in the link also include the xml generated from the given dataset mask of each image.
Accuracy (%) | Recall (%) | F1-Score (%) | |
---|---|---|---|
98.28 | 96.79 | 98.37 |
Average Precision (AP @ 0.5) | Mean-Average Precision (mAP) | Recall (@ 0.5:0.95) | |
---|---|---|---|
0.7447 | 0.7328 | 0.7706 |
Below is a plot showing the mean average precision (mAP) of the model on the validation set during training.
NOTE: The below interpretability images are independent of the above predictions.
NOTE: The below interpretability images are independent of the above predictions.
NOTE: The below interpretability images are independent of the above predictions.
- Trained Model Weights:
Our trained model weights can be downloaded from here
- Test Dataset Results Excel Sheets:
The excel sheets for the test sets can be found inside the results/excel folder.
-
Download this repository and open in a python editor (preferably VS code).
-
Create the python environment
conda create -y --name bleedgen python==3.7.16
conda activate bleedgen
- Install pytorch and torchvision
pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
- Install other packages
pip install -r requirements.txt
-
Download the train and validation data using this link
-
Unzip and put the train and validation data into their respective folders (train/Train) and (train/Val).
-
Also, put the test data into their respective folders (test/Test_Dataset_1) and (test/Test_Dataset_2).
To train, open and run train.py in the created environment.
python train.py
NOTE:
- Training results will be available inside the runs folder.
To test:
-
Download our already trained model weights here and put inside the trained_weights folder.
-
Open and run test.py in the created environment.
python test.py
NOTE:
-
Comment any two of Lines 17, 18, and 19 in test.py to select one of validation set, test set 1, and test set 2 for testing.
-
Testing results will be available inside the results folder.
- This work is based on this vision transformer library.