Inspiration
I built BreastNow Detector after seeing how doctors struggle with "black box" AI. My aunt had a false negative during screening, and I realized accuracy means nothing if doctors can't trust the AI. I wanted to build something that doesn't just predict cancer, but shows why it decided.
What I Learned
- Explainable AI: GradCAM taught me that model transparency is as important as accuracy. A 92% accurate model is useless if doctors can't verify it.
- Medical AI Challenges: Medical datasets are imbalanced and messy. I learned data preprocessing + augmentation is 70% of the work.
- PyTorch Deep Learning: Built CNNs with ResNet backbone, handled GPU/CPU training, and optimized inference for CPU-only laptops.
How I Built It
- Data: Loaded mammogram/ultrasound dataset and split 80/20 for train/test
- Model: Fine-tuned ResNet18 using PyTorch for binary classification: benign vs malignant
- Explainability: Integrated GradCAM to generate heatmaps that highlight tumor regions in red/yellow
- Interface: Built simple CLI tool
detect.py- input image → output prediction + heatmap overlay - Offline: Made it run 100% local so hospitals don't need internet or API keys
Challenges Faced
- Package Hell:
ModuleNotFoundError: pytorch_grad_cam+cv2timeouts. Fixed with correct pip names +--timeout 300flag - No GPU on Windows: Training was 8x slower on CPU. Used smaller batch sizes + pretrained weights to compensate
- File Paths: Windows backslash vs Linux forward slash broke image loading. Fixed with
os.path.join()and raw stringsr"" - Model Trust: Initial heatmaps focused on wrong areas. Fixed by tuning GradCAM target layers to last conv layer
Math Behind It
GradCAM uses gradients to find important regions: $L_{GradCAM}^c = ReLU\left(\sum_k \alpha_k^c A^k\right)$ Where $\alpha_k^c$ are gradient weights for class $c$ and $A^k$ are feature maps. This creates the heatmap overlay.
Log in or sign up for Devpost to join the conversation.