ABSTRACT
Breast cancer is one of the major health challenges worldwide, and early identification of suspicious cases plays an important role in clinical assessment and treatment planning. Machine learning techniques can assist in classifying breast tumors using numerical features derived from diagnostic measurements. However, the reliability and interpretability of machine-learning predictions are important considerations in healthcare applications. This project presents an Explainable Breast Cancer Classification System Using Machine Learning and Explainable Artificial Intelligence (XAI) to classify tumors as benign or malignant and provide understandable explanations for the generated predictions.
The proposed system uses the Wisconsin Diagnostic Breast Cancer (WDBC) dataset, which contains numerical measurements associated with breast tumor characteristics. The dataset undergoes preprocessing, including removal of unnecessary identifier columns, conversion of feature values into numerical format, handling of missing values, and outlier treatment using the interquartile range (IQR) method. Feature selection is performed by combining Mutual Information scores and Random Forest feature importance to identify the 20 most relevant features. The Synthetic Minority Over-sampling Technique (SMOTE) is then applied to the training data to address class imbalance. Three machine-learning algorithms, namely Extra Trees Classifier, Support Vector Machine (SVM), and Extreme Gradient Boosting (XGBoost), are trained and evaluated using a stratified training and validation split. Their performance is compared using accuracy, precision, recall, F1-score, and the Area Under the Receiver Operating Characteristic Curve (ROC-AUC). The Extra Trees Classifier is designated as the final model in the implementation.
To improve interpretability, the system integrates SHapley Additive exPlanations (SHAP) and Local Interpretable Model-agnostic Explanations (LIME). These techniques identify influential input features and illustrate how they contribute to individual model predictions. A web-based interface is developed using the Flask framework, with SQLite for user account storage and secure password hashing for authentication. The application allows registered users to enter the selected tumor measurements, obtain a benign or malignant classification, view the corresponding model probability estimates, and examine feature-contribution visualizations. It also provides a dashboard and an analysis section for presenting model evaluation results and feature-importance information.
The proposed system combines machine-learning-based classification, quantitative performance evaluation, and local prediction explanations in a single web application. It is intended as a research and educational decision-support prototype that demonstrates how explainable machine learning can improve the transparency of automated breast tumor classification. The system is not a substitute for professional medical diagnosis, and its clinical usefulness must be established through independent validation and appropriate clinical evaluation.
INTRODUCTION
Breast cancer is one of the most significant health challenges affecting women worldwide. It develops when abnormal cells in breast tissue grow uncontrollably and may form a tumor. Early identification and accurate assessment of breast tumors are important for improving treatment planning and patient outcomes. Breast tumors are generally classified into two categories: benign and malignant. Benign tumors are non-cancerous, whereas malignant tumors are cancerous and may invade surrounding tissues or spread to other parts of the body. The classification of breast tumors using diagnostic data is therefore an important application of medical data analysis and machine learning.
Traditional diagnostic procedures involve clinical examinations, imaging techniques, and laboratory investigations. Although these approaches are essential in medical practice, analyzing large amounts of diagnostic data can be complex. Machine learning provides computational methods for identifying patterns in numerical data and using those patterns to classify previously unseen cases. By learning from existing diagnostic records, machine-learning models can estimate whether a tumor is more consistent with a benign or malignant classification.
This project, titled “Explainable Breast Cancer Classification System Using Machine Learning and Explainable Artificial Intelligence,” focuses on developing a web-based application that classifies breast tumors using numerical features from the Wisconsin Diagnostic Breast Cancer (WDBC) dataset. The dataset contains measurements describing characteristics of cell nuclei obtained from breast mass samples. These measurements provide input variables for training classification algorithms.
The proposed system implements a structured machine-learning workflow consisting of data preprocessing, feature selection, class balancing, model training, and performance evaluation. During preprocessing, unnecessary identifier columns are removed, numerical values are prepared, missing values are handled, and extreme feature values are treated using the Interquartile Range (IQR) method. A combination of Mutual Information and Random Forest feature importance is used to select the 20 most relevant features. The Synthetic Minority Over-sampling Technique (SMOTE) is applied to the training data to address class imbalance.
Three machine-learning algorithms are considered in the project: Extra Trees Classifier, Support Vector Machine (SVM), and Extreme Gradient Boosting (XGBoost). Their predictive performance is compared using evaluation metrics such as accuracy, precision, recall, F1-score, and the Area Under the Receiver Operating Characteristic Curve (ROC-AUC). Based on the implemented workflow, the Extra Trees Classifier is selected as the final model for integration into the web application.
An important feature of this project is the integration of Explainable Artificial Intelligence (XAI). Although machine-learning models can generate predictions, understanding the factors influencing those predictions is particularly important in healthcare-related applications. To address this requirement, the system incorporates SHapley Additive exPlanations (SHAP) and Local Interpretable Model-agnostic Explanations (LIME). SHAP explains how individual input features contribute to a model prediction, while LIME generates a local explanation by examining the model's behavior around a particular input. These explanations are presented through feature-contribution charts and supporting textual summaries.
The web application is developed using Python and the Flask framework. SQLite is used to store user account information, and password hashing is implemented to protect stored passwords. Registered users can log in, access a dashboard, enter tumor measurements, obtain the predicted classification and associated model probability estimates, and view SHAP and LIME explanations. The application also provides an analysis section for displaying available model evaluation charts and feature-importance information.
The main purpose of this project is to demonstrate how machine learning and explainable AI can be combined to create a transparent and accessible breast tumor classification prototype. By presenting both predictions and their contributing features, the system aims to make model outputs easier to understand and support research into interpretable medical decision-support systems. However, the application is intended for educational and research purposes and cannot replace professional medical assessment, diagnostic investigations, or clinical judgment. Further independent testing and clinical validation would be necessary before considering its use in real-world healthcare settings.
Similar projects you might like