Transforming a deep learning classification model into a clinically validated, interpretable Medical AI.
This project was developed through a rigorous 18-step Clinical Audit process. We started with a standard EfficientNetB0 classification model and subjected it to "Dual-Validation" by a Clinical Lead. The journey involved:
- Phase 1: Base Training & Domain Freezing: Initial training on 1,600 patients to establish baseline feature extraction.
- Phase 2: Scale-up & Fine-Tuning: Expanding to a balanced 20,000-patient cohort with unfreezing of the visual cortex.
- Phase 3: Adversarial Auditing: Using Grad-CAM to intentionally "catch" the model's errors (Frontal Bone Bias & Calcification Trap).
- Phase 4: Clinical Correction: Applying Hard Negative Mining and Dropout tuning to optimize the Precision-Recall balance.
Instead of relying on single-channel grayscale, we utilized a multi-windowing technique to capture different anatomical structures. The 16-bit DICOM arrays were mapped to 3-channel RGB tensors:
- Red Channel: Brain Window (W:80, L:40) - Detects parenchymal density changes.
- Green Channel: Subdural Window (W:200, L:80) - Optimized for surface hemorrhages.
- Blue Channel: Bone Window (W:2800, L:600) - Contextualizes skull boundaries.
We deployed Grad-CAM to visualize the model's spatial focus.
Audit Evidence: Normal CT (Left) vs. Grad-CAM activation (Right) erroneously fixating on Choroid Plexus and Falx Cerebri calcifications instead of actual pathology.
Audit Discovery: The model initially exhibited a "Clever Hans" effect—it was occasionally right for the wrong reasons. It fixated on Aneurysm Coils, Catheters, and Frontal Bone artifacts instead of the actual blood.
Our audit revealed that over-correcting for False Positives (using 50% Dropout) led to a massive loss in Sensitivity (Recall). By fine-tuning the model to a 20% Dropout rate, we achieved a clinically robust balance, significantly reducing missed bleeds (False Negatives).
We tested the impact of the skull bone on AI perception:
- Intraparenchymal (Deep) Cohort: Detection confidence improved in 28% of cases.
- Subdural/Epidural (Superficial) Cohort: Detection confidence significantly improved in 36% of cases. Conclusion: Removing bone distraction allows the AI to "see" the blood density more clearly, especially in superficial hematomas.
To maintain scientific integrity, we proactively identified these vulnerabilities:
- The Prevalence Trap: In clinical reality, bleeds are rare (~1-5%). A model trained on 50/50 balanced data may overestimate probability in a real-world ER setting.
- Hounsfield Unit (HU) Loss: Compressing 16-bit raw data to 8-bit RGB tensors loses subtle density nuances critical for identifying hyperacute vs. chronic blood.
- ImageNet Bias: EfficientNet was born identifying "cats and dogs." Deep medical textures require even more domain-specific pre-training.
- Slice vs. Volume Gap: 2D analysis ignores the 3D anatomical continuity of blood—the "Gold Standard" requires 3D-aware architectures.
Important
Environment Requirement: This notebook is specifically designed to run within the Kaggle GPU Environment. Local execution is not recommended due to the massive size of the RSNA DICOM dataset (hundreds of gigabytes) and the high GPU memory requirements for the EfficientNetB0 architecture.
- Platform: Create a new notebook on Kaggle.
- Dataset: Attach the RSNA Intracranial Hemorrhage Detection dataset to your notebook.
- Accelerator: Enable GPU T4 x2 or P100 in the Kaggle settings.
- Step 1: Download the Brain_Audit_Final_Lite.ipynb from this repository.
- Step 2: Upload the
.ipynbfile to your Kaggle environment. - Step 3: Ensure essential libraries are available:
pip install pydicom opencv-python tensorflow. - Step 4: Run all cells. The "Clinical Audit" section at the end will automatically perform the 200-patient validation and generate the audit statistics.
- Brain_Audit_Final_Lite.ipynb: The core code (cleaned of heavy outputs for fast loading).
- clinical_audit_report/: Detailed per-patient audit logs and Executive Summary.
- banner.png: Professional project branding.
Note: This project is a hybrid outcome of radiological vision and technical engineering, built to serve as a robust medical AI portfolio piece.
If you are interested in Clinical AI Auditing, Neuroradiology, or AI Safety, feel free to reach out:
- Email: [exhume19@gmail.com]
- LinkedIn: (https://www.linkedin.com/in/emrah-%C5%9Feker-037741237/]