How watson752/ai_detection_model works
This repository is a glioma-versus-healthy MRI slice classification workflow. Users place MRI data in the configured raw-data folders, build normalized central-slice datasets, train a CNN, then evaluate it or inspect predictions with Grad-CAM. The graph includes the documented evaluation and interpretability branches. Source excerpts show the main calls and file exchanges; raw-data placement and command entry points are documented in the README.
Main entry points: train.py Training workflow · config.py Path and image config · evaluate.py Test evaluation · grad_cam.py Grad-CAM visualization
Components 13
MRI preparation
- Dataset builder
src/make_dataset.py - DICOM preprocessing
src/data_prep.py - Processed arrays
Model training
- Training workflow
src/train.py - Binary CNN
src/model.py - Saved models
Evaluation and interpretation
- Test evaluation
src/evaluate.py - Classification metrics
src/evaluate.py - Grad-CAM visualization
src/grad_cam.py - MRI heatmap overlay
src/grad_cam.py
Shared configuration
- Path and image config
src/config.py
Other components
- Dataset user
- Raw MRI data
Connections 26
- Dataset user → Raw MRI data: places scans
README.md - Dataset user → Dataset builder: runs
README.md - Dataset builder → DICOM preprocessing: builds classes
src/make_dataset.py - DICOM preprocessing → Raw MRI data: reads DICOM
README.md - Dataset builder → Processed arrays: writes arrays
src/make_dataset.py - Dataset builder → Path and image config: uses paths
src/make_dataset.py - DICOM preprocessing → Path and image config: uses image size
src/data_prep.py - Dataset user → Training workflow: runs
README.md - Training workflow → Processed arrays: loads arrays
src/train.py - Training workflow → Processed arrays: writes test split
src/train.py - Training workflow → Binary CNN: builds model
src/train.py - Training workflow → Saved models: saves checkpoints
src/train.py - Training workflow → Path and image config: uses paths
src/train.py - Binary CNN → Path and image config: uses dimensions
src/model.py - Dataset user → Test evaluation: runs
README.md - Test evaluation → Processed arrays: loads test data
src/evaluate.py - Test evaluation → Saved models: loads best model
src/evaluate.py - Test evaluation → Classification metrics: computes scores
src/evaluate.py - Classification metrics → Dataset user: reports results
README.md - Test evaluation → Path and image config: uses paths
src/evaluate.py - Dataset user → Grad-CAM visualization: runs
README.md - Grad-CAM visualization → Processed arrays: loads test sample
src/grad_cam.py - Grad-CAM visualization → Saved models: loads best model
src/grad_cam.py - Grad-CAM visualization → MRI heatmap overlay: generates overlay
src/grad_cam.py - Grad-CAM visualization → Path and image config: uses paths
src/grad_cam.py - MRI heatmap overlay → Dataset user: displays visualization
src/grad_cam.py