YOLOv5-CASP Clinical CADx — Lung Nodule Suite
Deep Learning CADx suite for pulmonary nodule detection using YOLOv5-CASP with CBAM, ASPP & CoT3
01 // SYSTEM OVERVIEW
Lung cancer causes nearly 1.8 million deaths annually worldwide. Early detection via low-dose CT and CXR dramatically improves 5-year survival. This research thesis and clinical suite develops YOLOv5-CASP: an enhanced object detector incorporating CBAM attention, ASPP multi-scale context, and CoT3 contextual transformers to overcome high false-positive rates on ambiguous sub-centimeter lung nodules.
02 // THE PROBLEM & ENGINEERING SIGNIFICANCE
Small pulmonary nodules (< 6mm) blend into vascular structures, ribs, and soft tissue, leading to high false-negative rates in standard clinical screenings.
Early stage I detection increases survival rates to over 60%, but radiologists face high cognitive fatigue reviewing hundreds of axial slices per patient.
- •Resolving low contrast between benign pulmonary parenchyma and malignant micro-nodules.
- •Handling extreme scale variance: nodules range from 3mm punctate lesions to 30mm masses.
- •Providing interpretable spatial attention maps so radiologists can verify algorithmic reasoning.
03 // DATA PIPELINE & PREPROCESSING
- Hounsfield Unit (HU) lung-window clipping (-1000 to +400 HU) for tissue contrast normalization
- Histogram equalization, CLAHE enhancement, and multi-slice axial slice projection
- Ablation-specific augmentation: mosaic, mixup, random affine, and perspective warping
04 // SYSTEM ARCHITECTURE & DATA FLOW
Custom YOLOv5-CASP backbone and neck: Feature extraction through CSP-Darknet -> CBAM (Channel & Spatial Attention) -> ASPP (Dilated context) -> CoT3 (Contextual Transformer) -> Multi-Scale Detection Heads.
Channel and spatial attention gates suppress non-relevant vascular background noise.
Atrous convolutions capture both micro-nodule details and surrounding lobar morphology.
Contextual self-attention models spatial correlations across neighboring anatomical regions.
Streamlit radiologist workstation with interactive thresholding and REST inference API.
Standard YOLOv5s baseline on 2D PNG exports; suffered 2.87 false alarms per scan and failed on nodules < 5mm.
Custom architectural injection of CBAM channel/spatial attention and ASPP dilated convolutions; reduced false positives by 42%.
Production clinical PACS CADx suite with CoT3 contextual transformer neck, automated Lung-RADS triaging, Grad-CAM interpretability, and live Streamlit workstation.
05 // MODEL ENGINEERING & HYPERPARAMETERS
Trained with SGD optimizer, cosine learning rate scheduler, warm-up epochs, and automatic mixed precision (AMP).
- • Batch Size: 16
- • Image Size: 640x640
- • Epochs: 150
- • Initial LR: 0.01
- • Weight Decay: 0.0005
06 // FAILURE ANALYSIS & ZERO-TRUST SAFEGUARDS
- • Pleural-based subpleural nodules abutting the chest wall.
- • Motion artifacts from severe patient breathing during scan acquisition.
Clinical safety mandate: Missing a malignant nodule is catastrophic, but false alarms cause radiologist alarm fatigue.
Standard cross-entropy loss biased model predictions toward background parenchyma due to 99.8% negative pixel imbalance.
Engineered Focal Loss with gamma=2.0 and alpha=0.25 paired with CIoU geometric bounding box penalty.
Boosted small-nodule sensitivity to 94.2% while reducing false-positive detections per scan to 1.12.
07 // PRODUCTION DEPLOYMENT SPECS
08 // ARCHITECTURAL DECISIONS & TRADE-OFFS
09 // PLANNED IMPROVEMENTS & NEXT REVISIONS
- →Extend pipeline to native 3D volumetric convolution (V-Net / 3D Swin) across entire contiguous CT volumes.
- →Integrate automated longitudinal scan comparison to track nodule volume doubling time (VDT).
Designed strictly for dark-environment radiology reading rooms: High-contrast monochrome DICOM viewer with non-blinding cyan/amber lesion bounding boxes and 1-click Lung-RADS score export.
python -m pytest tests/test_casp_architecture.py -vValidated CIoU loss, CBAM attention gate tensors, and Lung-RADS threshold categorization.
- Q1:"Why did you choose YOLOv5-CASP over 3D U-Net or Mask R-CNN for this clinical screening workflow?"
- Q2:"How did Hounsfield Unit (HU) windowing specifically impact model convergence during DICOM preprocessing?"
- Q3:"How does the CoT3 contextual transformer neck assist in differentiating subpleural nodules from chest wall structures?"