- iToBoS 2024 – Skin Lesion Detection with 3D-TBP
- Kaggle link: https://www.kaggle.com/competitions/itobos-2024-detection
- NinjaX Result:
- Detect skin lesions in high resolution skin patch images
- Output bounding boxes per image in the Kaggle submission format
- Training and inference scripts for a YOLO based detector
- A second stage classifier filter (MedViT) to remove false positives
- Utilities for dataset preparation, split, and evaluation
- Example submissions produced by the pipeline
- Ultralytics YOLO models (see
yolo_train.py) - Train on YOLO format labels
- Use a 1024 input size at inference (see
yolo_test2.pyandtest_models.py)
- Blur non skin background to reduce background driven false positives
- Script:
preprocess.py - Output:
split_dataset_blurred(configurable inside the script)
- Run YOLO on each test image
- For each predicted box, crop an expanded patch and classify it with MedViT
- Keep the box if
- YOLO confidence is high (hard keep), or
- MedViT predicts lesion (keep), else drop
- Script:
test_models.py
prediction_stringstores repeated groups of 5 valuesx_min y_min x_max y_max class_id- This repo uses
class_id = 0(single class) - Scripts producing the CSV
yolo_test2.py(YOLO only)test_models.py(YOLO + MedViT filtering)
iToBoS-main/
├── params.yaml
├── preprocess.py
├── split_data.py
├── yolo_train.py
├── yolo_test2.py
├── test_models.py
├── compute_map.py
├── utils.py
├── predictions/
│ ├── filtered_predictions_0.6792.csv
│ └── filtered_predictions_0.6793.csv
├── filtered_predictions1.csv
├── Lesion-Detection-Challange/ (git submodule)
└── MedViT/ (git submodule)
git clone --recursive https://github.com/solonso/iToBoS.git
cd iToBoS- Python 3.9 or newer recommended
- Core packages used in this repo:
ultralyticstorchtorchvisionopencv-pythonnumpypandaspillowtqdm
- Download from the Kaggle competition page
- Prepare folders to match the paths in
params.yamland the scripts - Labels must be in YOLO format
- Set dataset paths (train, val, test)
- Set YOLO dataset yaml path (train_yaml)
- Set model list and training parameters if needed
These scripts use top of file constants, not CLI flags:
preprocess.pySOURCE_DIR,DEST_DIR,BLUR_STRENGTH
split_data.py- reads
params.yaml
- reads
yolo_train.py- reads
params.yaml
- reads
yolo_test2.py- set model path and test dir inside the file
test_models.py- YOLO weights path, MedViT checkpoint path, output dirs inside the file
python preprocess.pypython split_data.pypython yolo_train.pypython yolo_test2.pypython test_models.pypredictions/filtered_predictions_0.6793.csvpredictions/filtered_predictions_0.6792.csv
- Each row is one
image_id prediction_stringis empty for images with no detections- Each detection uses 5 values (
x_min y_min x_max y_max class_id)
- File:
predictions/filtered_predictions_0.6793.csv - Images in file: 8481
- Average boxes per image: 3.45
- Images with zero boxes: 1944 (22.9 percent)
- Best score label saved with the file name: 0.6793
- Competition and dataset: iToBoS 2024 (Kaggle)
- Official dataset tooling and format converters: iToBoS Lesion Detection Challenge repository
- Dataset description and scale: ISIC archive DOI page for the iToBoS 2024 detection dataset
- Background context on the dataset: arXiv paper describing the iToBoS 3D-TBP derived skin region images


