Skip to content

The ML-based Breast Cancer Prediction Model classifies breast tumors as benign or malignant by analyzing key medical features from biopsy data. It offers healthcare professionals a reliable tool for diagnosis and treatment, showcasing the power of AI in healthcare with a focus on precision in detecting malignant tumors to improve patient outcomes.

License

Notifications You must be signed in to change notification settings

virajbhutada/breast-cancer-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breast Cancer Prediction with Machine Learning

Breast cancer is a significant health challenge worldwide, affecting millions of women annually. Early detection and diagnosis are crucial in increasing the chances of successful treatment and survival. This project aims to develop a machine learning model that can accurately predict whether breast tumors are benign (non-cancerous) or malignant (cancerous) based on medical data. By leveraging predictive modeling techniques, this solution will assist healthcare professionals in diagnosing breast cancer early, improving patient outcomes, and potentially saving lives.

Table of Contents

  1. Project Objective
  2. Dataset Information
  3. Data Preprocessing
  4. Model Development and Methodology
  5. Evaluation Metrics
  6. Results
  7. Usage
  8. Future Work
  9. Conclusion and Impact

Project Objective

The primary objective of this project is to develop a highly accurate and reliable machine learning model to predict breast tumor classification—whether a tumor is benign or malignant. The ultimate goal is to provide healthcare professionals with an effective tool that aids in early cancer detection, thereby facilitating timely medical interventions and improving the quality of patient care. By analyzing key tumor characteristics, this model serves as a critical decision-support tool for oncologists and healthcare providers.


Dataset Information

We utilized the Breast Cancer Wisconsin (Diagnostic) Dataset, which contains crucial medical features derived from breast cancer biopsy samples. This dataset is widely used in the medical field for breast cancer research and prediction modeling.

  • Source: The dataset is available on Kaggle here.
  • Features: The dataset includes 30 features, such as:
    • Tumor size
    • Cell shape
    • Texture and smoothness of cells
    • Perimeter and area of the tumor
    • Mitotic count (related to the number of cell divisions)

Each instance in the dataset is labeled as either benign (B) or malignant (M), providing the basis for supervised learning models.

Feature Description
Radius Mean of distances from the center to points on the tumor perimeter
Texture Standard deviation of gray-scale values
Perimeter Measurement of the tumor perimeter
Area Measurement of the tumor area
Smoothness Variability in the smoothness of tumor edges
Diagnosis Target variable: Benign (B) or Malignant (M)

Data Preprocessing

To ensure that the machine learning models perform optimally, comprehensive data preprocessing steps were applied to the raw dataset. These steps are crucial to remove inconsistencies, normalize the data, and prepare it for model training. Key steps include:

  1. Handling Missing Values: We performed imputation or removal of missing data to avoid any gaps that could lead to inaccuracies in predictions.
  2. Feature Scaling: Standardization or normalization of numerical features was performed using Min-Max scaling to ensure uniformity across the feature set, preventing any bias during model training.
  3. Encoding Categorical Variables: The target variable (Diagnosis) was label-encoded, converting benign (B) and malignant (M) into numerical values, allowing the models to interpret the target correctly.
  4. Train-Test Split: The dataset was split into a training set (80%) and a test set (20%) to evaluate the model’s generalization to unseen data.

Model Development and Methodology

We experimented with multiple machine learning models to ensure high accuracy and robustness in our predictions. The following algorithms were employed and evaluated:

  1. Logistic Regression (Tuned): This was the final model selected due to its superior performance in terms of recall, precision, and overall balanced accuracy.
  2. Support Vector Machine (SVM): Explored due to its effectiveness in binary classification problems.
  3. Decision Tree: A non-parametric model that works well for classification tasks with interpretable decision-making.
  4. Random Forest: An ensemble method known for reducing variance and improving accuracy.
  5. Naive Bayes: A simple probabilistic model that performed moderately well in this classification task.
  6. XGBoost: A powerful boosting algorithm often used in structured data competitions and real-world applications.

The Logistic Regression model, after hyperparameter tuning (using grid search and cross-validation), emerged as the best-performing model, achieving a delicate balance between precision and recall, which is critical in medical diagnosis where false negatives can have serious consequences.


Evaluation Metrics

For this project, several key evaluation metrics were considered to ensure the model's effectiveness:

  • Accuracy: The proportion of correctly classified instances over the total instances. However, in medical diagnoses, accuracy alone isn’t enough.
  • Precision: The ratio of true positive predictions to all positive predictions. It helps in determining how many of the predicted positive cases are actually malignant.
  • Recall (Sensitivity): A critical metric for this project, recall is the ability of the model to correctly identify malignant cases, which is vital to minimize false negatives (missed cancer cases).
  • F1-Score: The harmonic mean of precision and recall, providing a balance between the two.
  • ROC-AUC: This metric measures the model’s ability to differentiate between benign and malignant cases across different threshold values, showing how well the model performs regardless of class distribution.

Results

After evaluating all models, the Tuned Logistic Regression model stood out due to its superior balance of precision and recall, making it the optimal choice for predicting breast cancer:

  • Precision: 0.9913
  • Recall: 0.9912
  • Accuracy: 0.9912
  • F1-Score: 0.9912
  • ROC-AUC: 0.9884

These results indicate that the model is exceptionally reliable in distinguishing between benign and malignant cases, minimizing false negatives while maintaining a high degree of precision.


Usage

  1. Clone the repository to your local machine.
  2. Install the required Python libraries from requirements.txt.
  3. Download the dataset from Kaggle and ensure it is placed in the appropriate directory.
  4. Run the Jupyter Notebook or Python script to train and evaluate the model on the dataset.
# Clone the repository
git clone https://github.com/virajbhutada/Breast-Cancer-Prediction.git

# Install dependencies
pip install -r requirements.txt

# Run the notebook
jupyter notebook breast_cancer_prediction.ipynb

Future Work

Looking ahead, there are several avenues for extending and improving this project:

  1. Further Model Refinement: Continued hyperparameter tuning and exploration of deep learning approaches such as Convolutional Neural Networks (CNNs) to enhance prediction accuracy.
  2. Feature Engineering: Exploring additional medical features, or creating derived features, could improve the model’s predictive power.
  3. Clinical Integration: Building a user-friendly interface for healthcare providers to integrate the model into clinical practice, aiding real-time decision-making.
  4. Cross-Dataset Validation: Validating the model on other breast cancer datasets to ensure its generalizability across different populations.

Conclusion and Impact

The development of our Breast Cancer Prediction Model underscores the growing importance of machine learning in healthcare, especially in the early detection of cancer. With its high accuracy and recall, this model empowers healthcare professionals to diagnose breast cancer early, allowing for timely treatment that can dramatically improve survival rates.

By leveraging data-driven techniques, this project illustrates how artificial intelligence can elevate medical diagnostics. The early identification of malignant tumors not only opens doors to more effective treatments but also gives patients a better chance at recovery. Every decision in healthcare carries immense weight, and this model demonstrates the critical role precision can play in saving lives.

In conclusion, this project highlights how machine learning can reshape the future of healthcare, particularly in the fight against breast cancer. As AI technology continues to evolve, integrating models like this into real-world medical workflows will help raise the quality of care, offering hope and better outcomes for countless patients.


License

This project is licensed under the MIT License. You are free to use, modify, and distribute this code in your projects, as long as the original authors are credited. For more details, refer to the LICENSE file.

About

The ML-based Breast Cancer Prediction Model classifies breast tumors as benign or malignant by analyzing key medical features from biopsy data. It offers healthcare professionals a reliable tool for diagnosis and treatment, showcasing the power of AI in healthcare with a focus on precision in detecting malignant tumors to improve patient outcomes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published