π Overview This project detects and classifies lesions in DICOM medical images using DeepLesion (Faster R-CNN) for detection and ResNet50 for classification.
β‘ Features β Lesion Detection β Finds lesion locations using DeepLesion (Faster R-CNN). β Lesion Classification β Identifies lesion type using ResNet50. β False Positive Filtering β Removes misclassified structures (e.g., blood vessels). β Bounding Box Overlays β Draws lesion location & label on the image.
π οΈ Installation 1οΈβ£ Install Required Dependencies bash Copy Edit pip install torch torchvision pydicom numpy matplotlib opencv-python 2οΈβ£ Clone the Repository bash Copy Edit git clone https://github.com/YOUR_GITHUB_USERNAME/DICOM-Lesion-Detection.git cd DICOM-Lesion-Detection 3οΈβ£ Clone DeepLesion (Required for Detection) bash Copy Edit git clone https://github.com/rsummers11/CADLab.git cd CADLab/deep-lesion This contains the pretrained DeepLesion model for detecting lesions.
4οΈβ£ Run the Script Modify the DICOM file path in Dicome_processing.py:
python Copy Edit filepath = r"C:\Users\ccape\Downloads\Radiology_script\sample.dcm" Then, run:
bash Copy Edit python Dicome_processing.py π Project Structure graphql Copy Edit DICOM-Lesion-Detection/ βββ Dicome_processing.py # Main script for detection & classification βββ sample.dcm # Example DICOM file (optional) βββ README.md # Project documentation βββ CADLab/ # DeepLesion (cloned repo) β βββ deep-lesion/ # Pretrained model & utilities π How It Works 1οΈβ£ Load & Preprocess DICOM Reads DICOM images and extracts metadata. Converts grayscale images to RGB (for compatibility). 2οΈβ£ Detect Lesions DeepLesion (Faster R-CNN) locates potential lesions. Filters false positives like thickened blood vessels. 3οΈβ£ Classify Lesion Type ResNet50 model classifies detected lesions as: Tumor Cyst Hemorrhage Inflammation 4οΈβ£ Display Results Bounding boxes highlight detected lesions on the DICOM image. Labels & confidence scores annotate each lesion type. π Example Output Detected Lesions: β Tumor (Score: 0.92) β Bounding Box: (120, 80, 200, 160) β Cyst (Score: 0.85) β Bounding Box: (300, 240, 380, 320)
π· Annotated Image Output (Lesion Bounding Boxes & Labels)
π Next Steps π Explainability (Grad-CAM) β Generate heatmaps showing which lesion areas influenced classification.
π€ Multimodal AI (Lesion Detection + Clinical Reports) β Use NLP models to summarize findings automatically.
π DICOM Export with Annotations β Save annotated images back into DICOM format for PACS/Radiology.
π’ Contributing Want to improve this project? Contributions are welcome! π
Fork the repo Create a feature branch Commit your changes Open a pull request π Acknowledgments Built using:
DeepLesion (NIH) β Universal lesion detection dataset. TorchVision Faster R-CNN β Object detection model. RadImageNet β ResNet50 trained on medical images.