An advanced AI tool for early detection of breast cancer through image analysis. This project utilizes computer vision and machine learning to extract diagnostic features from mammogram images and provide accurate classifications.
- About
- Technologies Used
- Features
- Installation
- Usage
- How It Works
- Contributing
- Research Context
- License
Cancer Fight is a web-based diagnostic tool that leverages artificial intelligence to analyze mammogram images for signs of breast cancer. The system extracts critical diagnostic features from X-ray images, processes them through a trained machine learning model, and provides a classification (benign or malignant) along with confidence metrics and visualizations.
This tool is designed as a research prototype to demonstrate how AI can assist medical professionals in early cancer detection.
- Python: Core programming language
- Flask: Web framework for the application server
- OpenCV & scikit-image: Image processing and feature extraction
- scikit-learn: Machine learning model implementation
- Pillow: Additional image processing capabilities
- Matplotlib & Seaborn: Data visualization libraries
- NumPy & Pandas: Data manipulation and analysis
- HTML/CSS/JavaScript: Front-end interface
- Image Upload & Analysis: Process mammogram X-ray images for cancer detection
- Feature Extraction: Extract 30+ diagnostic features from images
- AI Classification: Predict benign or malignant diagnosis with confidence score
- Visual Analytics: Interactive visualizations of diagnostic features
- Key Metrics: Risk assessment, data quality evaluation, and confidence metrics
- Detailed Reporting: Comprehensive breakdown of all extracted features
-
Clone the repository:
git clone https://github.com/Arison99/Cancer-Fight.git cd Cancer-Fight
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Update model paths in
app.py
: Replace the paths with your local paths:model = joblib.load(r'path\to\your\model.joblib') scaler = joblib.load(r'path\to\your\scaler.joblib')
-
Run the application:
python app.py
-
Open your browser and navigate to:
http://127.0.0.1:5000
- Upload Image: Select a mammogram X-ray image using the upload button
- Process Image: Click "Analyze" to process the image
- View Results: Examine the prediction, confidence score, and risk level
- Explore Visualizations: Use the visualization tools to understand feature importance
- Review Details: Check the detailed feature extraction data for in-depth analysis
The system follows a multi-step process:
- Image Preprocessing: Normalize, denoise, and enhance the mammogram image
- Segmentation: Isolate breast tissue from background
- Feature Extraction: Calculate diagnostic features including:
- Radius, texture, perimeter, and area measurements
- Smoothness, compactness, and concavity metrics
- Symmetry and fractal dimension analysis
- Feature Scaling: Normalize extracted features to match the training data scale
- Classification: Process normalized features through the machine learning model
- Result Generation: Produce probability scores, risk assessment, and visualizations
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
Areas where contributions are particularly valuable:
- Improving feature extraction algorithms
- Enhancing UI/UX design
- Optimizing model performance
- Adding support for different types of medical images
- Creating comprehensive documentation
This project is developed for research purposes only and is not intended for clinical use. The goal is to explore how AI and computer vision can assist in medical diagnostics, particularly in regions with limited access to specialist healthcare.
The feature extraction methods are based on established radiomics techniques used in medical image analysis, focusing on the quantitative features that have been shown to correlate with cancer diagnosis.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Arison99 for advancing cancer research and detection