ImmunoHack: TILs – Advancing Breast Cancer Insights
🌟 Inspiration
The idea for this project emerged from the pressing need to enhance traditional cancer diagnostics. Histopathology slide review is time-consuming, error-prone, and constrained by a shortage of expert pathologists. The TIGER Grand Challenge motivated me to delve into computational pathology, aiming to automate Tumor Infiltrating Lymphocytes (TILs) evaluation—a biomarker with significant prognostic value in breast cancer.
Furthermore, NITI Aayog’s healthcare reforms and the digital transformation of Bihar’s healthcare system highlighted the potential of AI-driven, cost-effective, and transparent healthcare solutions. This project aligns with that vision, offering automation in cancer diagnosis and improving access to precision oncology.
🔬 What It Does
This AI-powered solution facilitates:
- Automated detection of Lymphocytes and Plasma Cells from histopathology slides.
- Segmentation of Tumor and Stroma regions for deeper pathological insights.
- TIL Score Calculation to aid in prognostic assessment, ensuring accuracy and reproducibility.
🛠️ How We Built It
1️⃣ Lymphocytes and Plasma Cells Detection
- Preprocessing: Images resized to 512×512 pixels.
- Data Conversion: COCO annotations converted to YOLOv8 format.
- Model Training: YOLOv8 fine-tuned on 1,879 annotated images with hyperparameter optimization.
- Results: Achieved Precision: 0.7 and mAP50: 0.6, demonstrating strong lymphocyte classification.
2️⃣ Tumor and Stroma Segmentation
- Patch Generation: Whole Slide Images (WSIs) split into 256×256 patches to preserve details.
- Stain Normalization: Applied HE normalization to reduce color variability.
- Model: Efficient-UNet trained using a two-phase strategy (frozen encoder phase followed by fine-tuning).
- Performance: Accuracy of 83.6%, F1-score of 0.63.
3️⃣ Automated TIL Score Calculation
Formula: [ \text{TIL Score} = 100 \times \frac{(\text{Number of TILs} \times \text{Area per TIL})}{\text{Stroma Area}} ]
Integration: Combined detection & segmentation results to compute scores, validated against clinician annotations.
🚧 Challenges We Ran Into
🔹 Data Variability
- Issue: Variations in slide staining and quality affected model consistency.
- Solution: Implemented stain normalization and data augmentations to enhance robustness.
🔹 Class Imbalance
- Issue: Underrepresentation of stroma in TAO-4D dataset led to poor segmentation.
- Solution: Used Categorical Focal Loss and Class-weighted Dice Loss to improve performance.
🔹 Overfitting
- Issue: Limited training data caused overfitting.
- Solution: Introduced dropout layers and a two-phase training regime (encoder freezing + fine-tuning).
🔹 Computational Constraints
- Issue: Processing large WSIs (~40,000×40,000 pixels) required significant GPU resources.
- Solution: Optimized memory usage through patch-based workflows.
🏆 Accomplishments That We’re Proud Of
- Developed an end-to-end AI pipeline for TIL quantification.
- Successfully trained YOLOv8 & Efficient-UNet for histopathology tasks.
- Achieved state-of-the-art performance in TIL detection & segmentation.
- Created an interpretable AI model, validated against expert annotations.
- Demonstrated feasibility for real-world clinical applications.
📚 What We Learned
🔬 Medical Imaging Fundamentals
- Gained insights into histopathology workflows, including tissue fixation, staining (H&E), and slide digitization.
🤖 AI in Healthcare
- Mastered ML models such as YOLOv8 for cell detection and U-Net variants for segmentation.
- Tackled the challenges of handling Whole-Slide Images (WSIs) and optimizing AI pipelines for efficiency.
📊 Data Challenges & Model Evaluation
- Worked with datasets like WSIBULK, WSIROIS, and WSITILS.
- Addressed color variation issues with stain normalization.
- Evaluated model performance using precision, mAP50, Jaccard Loss, and F1 scores.
- Implemented class balancing strategies for tumor vs. stroma segmentation.
🚀 What's Next for ImmunoHack: TILs
This project underscores the viability of AI in automating TIL scoring, paving the way for:
- Scaling up: Validating our model on larger and more diverse datasets.
- Clinical Integration: Embedding this tool into real-world pathology workflows.
- Expanding to Other Cancers: Extending the model to other tumor types beyond breast cancer.
- Enhancing Interpretability: Improving model explainability to increase trust among clinicians.
By reducing dependence on manual analysis, AI-driven solutions like ImmunoHack: TILs can democratize precision oncology, especially in resource-limited settings.
💡 Bringing AI-driven precision to histopathology—one cell at a time!
Built With
- artificial-intelligence
- cnn
- computer-vision
- fastapi
- histopathology
- keras
- machine-learning
- matplotlib
- mongodb
- open-slide-image
- opencv
- python
- python-package-index
- railway
- scikit-learn
- segmentation
- tensorflow
- vercel
- yolo

Log in or sign up for Devpost to join the conversation.