0% found this document useful (0 votes)
5 views32 pages

Breast Cancer Detection Using Machine Learning

the document above is the machine learning project report
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views32 pages

Breast Cancer Detection Using Machine Learning

the document above is the machine learning project report
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Breast Cancer Detection

Using Machine Learning


A Comparative Study of Classical vs. Deep Learning Models

Lecturer:Dr. Muguro

Date:3rd November 2025

GROUP MEMBERS
NAME REGISTRATION NUMBER
ROBINSON OCHIENG E020-01-1245/2021
KELVIN MUTUA E020-01-1194/2021
KEITH KIPKOGEI E020-01-1178/2021
MARK TONY MWIRA E020-01-1252/2021
KEVIN ROTICH E020-01-1231/2021
KENNEDY KIBET E020-01-0903/2020

Problem Statement
➢Breast cancer is the most commonly diagnosed cancer among women
worldwide, with over 2.3 million new cases and 670,000 deaths reported
in 2022.
➢Despite medical advances, mortality remains high in low-income countries
due to late diagnosis and inadequate screening infrastructure.
➢In Sub-Saharan Africa, breast cancer incidence is estimated at 24.5 per
100,000 women, while survival rates remain below 50%.
➢Early detection efforts are constrained by shortages of diagnostic equipment,
low awareness levels, and insufficient access to trained specialists.
➢There is an urgent need for AI-driven, data-based screening tools that can
assist clinicians in early detection and accurate classification of breast cancer,
especially in resource-limited African settings.

Dataset Overview
Dataset Source:
➢The dataset used in this study was obtained from Kaggle (Breast Cancer Wisconsin Dataset) and
imported into Google Colab for analysis and model training.
Dataset size:
➢Contains 569 records with 30 numerical features derived from digitized images of breast cell nuclei.
Target Classes:
➢Each sample is classified as either:
• Malignant (1): Cancerous cells
• Benign (0): Non-cancerous cells
Feature Description;
• The features represent statistical measurements such as:radius, texture, perimeter, area,
smoothness, compactness, concavity, symmetry, and fractal dimension.
➢The dataset contains 357 benign and 212 malignant cases, meaning the data is slightly
imbalanced towards benign tumors.
➢The dataset was cleaned, normalized, and split into training (80%) and testing (20%) sets using
[Link] preprocessing ensured balanced representation of both classes for unbiased
model evaluation.

Methodology
[Link] Collection
➢The dataset was obtained from Kaggle through aprovided link
[Link] (Breast Cancer
Wisconsin Diagnostic Dataset),a well-established and publicly
available medical dataset.
➢It was imported into Google Colab for analysis and model
implementation.
➢The dataset contains 569 samples, each representing measurements
derived from digitized images of breast cell nuclei.
[Link] Preprocessing.
➢Removed irrelevant columns (id, Unnamed: 32) that did not
contribute to prediction.
➢Checked for missing or duplicate values and confirmed dataset
integrity.
➢Encoded the categorical data.
➢Standardized all numerical features using StandardScaler to ensure
uniform feature scaling.
[Link] Data Analysis (EDA)
➢Generated correlation heatmaps and pairwise scatter plots to explore
relationships between variables.
➢Identified strong correlations among variables like radius_mean,
perimeter_mean, and area_mean.
➢Dropped highly correlated features to reduce multicollinearity and improve
model generalization.
➢ The heatmap shows strong positive
correlations between several
features. For example,
radius_mean and perimeter_mean
have a correlation of about 0.99,
while area_mean and radius_mean
are also highly correlated at around
[Link] means these features
carry similar information, causing
multicollinearity.
➢ The scatter plot matrix above shows pairwise relationships between the dataset’s features, colored by diagnosis
class. Strong linear patterns indicate high positive correlations between several features, while scattered distributions
suggest weaker relationships. Diagonal plots display feature distributions, revealing clear separation between the
two diagnostic categories. Almost perfectly linear patterns between the radius,parameter and area attributes are
hinting at the presence of multicollinearity between this variables(They are highly linearly related).
➢ A triangular mask is applied to hide
redundant values, making the
correlation heatmap cleaner and
easier to interpret by focusing on the
unique feature relationships.
➢ we can verify the presence of
multicollinearity between some of
the [Link] instance,the radius-
mean column has acorrelation of 1
and 0.99 with perimeter_mean and
area_mean columns,[Link]
is because the three columns
essentially contain the same
information,which is the physical size
of the observation (the cell).
➢ Multicollinearity is aproblem as it
undermines the significance of
independent variables and we fixed it
by removing the highly correlated
predictors from the model.
➢ The new correlation heatmap is
achieved after we dropped all the
correlated features from the heatmap that was causing multicollinearity,radius_mean has the strongest positive
correlation with the target diagnosis (0.73), suggesting it is a key predictive feature.

➢ Other features such as compactness_mean (0.60) and texture_mean (0.42) also show moderate correlation with the
diagnosis.

➢ The removal of collinear variables reduces redundancy, minimizes the risk of multicollinearity, and ensures more
stable model performance.
[Link] Splitting
➢ The cleaned and preprocessed dataset was divided into two subsets using
Scikit-learn’s train_test_split function:
• Training Set (80%) – used to train the machine learning models and allow
them to learn patterns from the data.
• Testing Set (20%) – used to evaluate how well the trained models generalize
to unseen data.
➢The stratified sampling approach ensured that both classes (malignant
and benign) maintained their original proportion in the training and
testing subsets.
➢The split helps prevent overfitting, ensuring the model does not memorize
the training data but can make accurate predictions on new, unseen samples.
[Link] Selection.
➢Four machine learning algorithms were chosen for comparison:
[Link] Regression – simple, interpretable, effective for linearly separable
data.
[Link] Vector Machine (SVM) – robust classifier with high accuracy in small
datasets.
3.K-Nearest Neighbors (KNN) – instance-based learning, suitable for smaller
datasets.
[Link] Neural Network (ANN) – deep learning model for complex feature
interactions.
[Link] Training
➢Each model was trained on the training set using Scikit-learn and
TensorFlow libraries.
➢Models were trained using Scikit-learn for classical algorithms and
TensorFlow/Keras for the ANN.
➢Each model learned patterns from the training dataset and generated
predictions on the testing dataset.
[Link] Evaluation
➢Model performance was measured using multiple metrics:
• Accuracy: Overall correctness of predictions.
• Precision & Recall: Reliability in classifying malignant and benign cases.
• F1-Score: Balance between precision and recall.
• ROC-AUC: Ability to discriminate between the two classes.

[Link] & Interpretation


➢Results interpreted using ROC curves, confusion matrices and feature
importance plots.
Methodology Flowchart.
Results and discussions
Logistic Regression

➢ With an AUC of 0.98, the logistic regression model demonstrates excellent predictive
ability and strong class separation.
Logistic regression heatmap Feature importance
➢ confusion results,showing 72 true
matrix negatives,
displays the 37 true positives, and only a few misclassifications (3
model’s false positives and 2 false negatives).
classification ➢ radius_mean shows the strongest effect on predictions,
followed by compactness_mean, radius_se, and
texture_mean.These features have the highest
coefficient magnitudes, indicating their
significant impact on distinguishing between
the diagnostic classes.
Supported Vector Machine(SVM)
➢ An AUC close to 1 indicates excellent ability to distinguish between the two [Link] has 0.98 which means it also
has ahigher ability to distinguish between the two
classes
Confusion matrix heatmap (SVM) Feature importance
➢ Confusion matrix displays SVM classification results,
showing 74 true negatives, 37 true positives, and only
a few misclassifications (1 false positive and 2 false
negatives). This indicates that the SVM model
achieved high accuracy and effectively distinguishes
between the two classes.
➢ Feature importance plot for the Support Vector
Machine
(SVM) model shows that radius_mean and texture_mean
features have a noticeable contribution to the model’s
predictive performance. These features show higher
importance scores compared to the remaining features,
indicating that they play a key role in classifying malignant
and benign tumors
KNN
➢ Also achieved ahigh AUC =0.98 showing its ability to distinguish between the two classes of tumor.
➢ radius_mean and compactness_mean are the most ➢ confusion matrix displays KNN classification influential
features in classifying breast cancer cases. These results,showing 72 true negatives, 37 true
two features have the highest importance scores, indicating positives, and only a few misclassifications (3 that the
model mainly relies on them for accurate false positives and 2 false negatives).
predictions, while the remaining features have minimal impact
on the classifying the cancer tumor.
Deeplearning model(ANN)

➢ deeplearning model has the lowest AUC(0.963) compared to the three classical model trained,deeplearning model
model has alow ability to distinguish between the two classes
compared to the classical model like Logistic regression.

The deep learning model achieved strong
classification performance, correctly predicting
➢ The deep learning model identified radius_mean and most cases with 72 true negatives and 35 true texture_mean as
the most influential features for breast positives, while only 7 cases were misclassified cancer prediction, with
radius_se and texture_se showing
overall.
moderate influence, while other features had minimal impact.
Model perfomance Summary
➢All classical machine learning models performed exceptionally well, achieving
ROC-AUC scores above 0.98.
➢Logistic Regression emerged as the best-performing model with Accuracy:
98%, ROC-AUC: 0.98, and F1-Score: 0.98.
➢SVM and KNN models also showed competitive results with slightly lower
AUC values but consistent precision and recall.
➢The Deep Learning model (ANN) achieved AUC = 0.97, indicating strong
performance, but slightly below the classical models due to dataset size.
➢Confusion matrices showed that misclassifications were minimal across all
models.
Models comparison
ROC curve comparison for all models
➢ All classical models perform very well (AUC ≥
0.98), with Logistic Regression yielding the
highest ROC-AUC. -The Deep Learning model
performs well (AUC = 0.96) but is
outperformed by the classical approaches on
this dataset. -The diagonal line
represents a random classifier (AUC = 0.5).
Classical machine learning models,
especially Logistic Regression and SVM,
achieve superior performance compared to
the deep learning model for this
classification task.
Models Comparison table ➢ The performance comparison among the
classical machine learning models and the deep
learning model shows that all models achieved
excellent predictive capability, with AUC values
above 0.96. Among the classical models, Logistic
Regression attained the highest ROC-AUC (≥
0.98), indicating superior discriminative power.
The SVM, KNN and Deeplearning models also
demonstrated strong results, maintaining high accuracy and robust ROCAUC values close to that of Logistic
Regression.

➢ In contrast, the Deep Learning model performed well (AUC = 0.96) but was slightly outperformed by the
classical models on this dataset. This suggests that the problem’s complexity and data size are better suited to
simpler algorithms rather than deep architectures, which typically require larger datasets to achieve their full
potential.

Conclusion and model justification


➢After evaluating all models using key performance metrics (Accuracy,
Precision, Recall, F1-Score, and ROC-AUC), Logistic Regression
demonstrated the best overall performance among the classical and deep
learning approaches.
➢Logistic Regression achieved the highest ROC-AUC of 0.98 and
accuracy of 0.96, indicating exceptional discriminative power and
reliability in predicting breast cancer [Link] superior
performance can be attributed to the linear separability of the dataset
and the model’s ability to handle multivariate relationships efficiently.

Applications in the Kenyan/African Context


➢Early Detection: Supports doctors in early breast cancer screening, especially
where oncology experts are scarce.
➢Mobile Health: Can be deployed in mobile or cloud tools for accessible
AIbased screening in rural areas.
➢Training & Research: Useful for teaching and studying data-driven diagnosis
and risk prediction.
➢EHR Integration: Can be embedded in electronic health records to give
realtime cancer risk alerts.
Limitations, Challenges, and
Applications(Kenyan/African Context)
Limitations and Challenges
➢Data Availability: High-quality, labeled medical datasets are scarce in Kenya
and Africa due to limited digitization and data privacy issues.
➢Generalizability: The model was trained on non-African data, so its accuracy
may drop when applied to Kenyan or African populations.
➢Feature Gaps: Key factors like patient history, lifestyle, and socio-economic
data were not included, limiting real-world accuracy.
➢Infrastructure: Reliable computing power and internet are still limited in
many healthcare facilities, affecting AI deployment.
Future Work
➢Expand the dataset with more diverse and region-specific samples to
enhance model generalization.
➢Explore ensemble models and deep hybrid architectures for improved
predictive accuracy.
➢Deploy the model into a real-time decision support system or webbased
dashboard.
➢Integrate automated hyperparameter tuning for optimized performance.
➢Evaluate model performance on new unseen datasets for robustness
testing.

References
[Link] (2024): Source of the dataset used for training and testing.
[Link]-learn Documentation (2024): Machine learning model
implementation and metrics.
[Link]/Keras Documentation (2024): Deep learning model
development framework
[Link] & Matplotlib Libraries: Data preprocessing and visualization
tools.
[Link] Articles & Open Datasets: Supporting background for problem
formulation

You might also like