The problem
Breast cancer is among the most common cancers worldwide, and early classification of suspicious tissue as benign or malignant changes treatment paths completely. The Wisconsin Diagnostic Breast Cancer (WDBC) dataset — 569 digitised fine-needle-aspirate samples, each described by 30 computed nuclear features — is the standard teaching benchmark for this task: clean, well-documented, and small enough to train on a laptop. Students often treat it as a generic classification exercise and miss what makes it interesting: the class imbalance is mild but the cost of errors is not symmetric — a false negative (missing a malignancy) is far worse than a false positive, which is why sensitivity and the confusion matrix matter more here than headline accuracy. This project trains a proper pipeline with stratified splitting and cross-validation, evaluates with the clinically relevant metrics, and ships a risk-predictor web demo. Every figure on the page is either from the dataset documentation or labelled as a design target — nothing is presented as a measured result before the training run.
How it works
- The 569 WDBC samples are loaded and split 80/20 with stratification, preserving the benign/malignant ratio in both sets.
- Features are standardised (zero mean, unit variance) with the scaler fit on the training split only.
- A Random Forest (200 trees) is trained; 5-fold cross-validation checks hyperparameter stability before final evaluation.
- The held-out test set (114 samples) is evaluated once: accuracy, sensitivity, specificity, ROC-AUC and the confusion matrix are recorded for the report.
- Feature importances are extracted and plotted, giving the viva a concrete "what does the model look at" answer.
- The web demo embeds a simplified scoring function over the same feature set for interactive demonstration; the notebook's trained model is the deliverable, not the demo's approximation.
Tech stack:
- Python 3, scikit-learn (Random Forest, metrics, CV)
- NumPy, pandas, Matplotlib
- Jupyter Notebook (training & evaluation)
- HTML5 + JavaScript (risk-predictor demo)
- WDBC dataset (UCI ML Repository)
Dataset & model details
- Dataset: Wisconsin Diagnostic Breast Cancer (WDBC) — 569 FNA samples, 30 numeric features (mean, s.e., worst of 10 nuclear properties: radius, texture, perimeter, area, smoothness, compactness, concavity, concave points, symmetry, fractal dimension), 2 classes: 357 benign (62.7%), 212 malignant (37.3%). Source: UCI ML Repository; Wolberg, Street & Mangasarian, University of Wisconsin.
- Task: Binary classification; input = 30 standardized nuclear features, output = benign/malignant probability.
- Model: Random Forest, 200 trees, trained on standardized features after a stratified 80/20 split with 5-fold cross-validation for hyperparameter checking.
- Metrics: Accuracy 97.4% (design target), sensitivity 97.7% (design target), specificity 97.2% (design target), ROC-AUC 0.99 (design target), confusion matrix on the 114-sample held-out test set. No metric is claimed as measured until the training run is executed for the order.
| Parameter | Value |
|---|---|
| Samples | 569 (357 benign / 212 malignant) |
| Features | 30 numeric (10 nuclear properties × mean/s.e./worst) |
| Model | Random Forest, 200 trees (design target config) |
| Test accuracy | 97.4% (design target, not a measured claim) |
| Sensitivity | 97.7% (design target — false negatives minimized) |
| Training time | Approximately 1–2 min on a laptop CPU (expected) |
| Demo | Single-file web app with live risk scoring |
| Deliverable model | Serialized scikit-learn pipeline (.pkl) |
Project features
- [Real WDBC dataset] 569 samples, 30 features (mean, standard error and worst of 10 nuclear properties), 357 benign / 212 malignant — sourced from the UCI ML Repository.
- [Full training notebook] Loading, stratified 80/20 split, standardisation, Random Forest training, 5-fold cross-validation and held-out evaluation in one reproducible notebook.
- [Clinically relevant metrics] Accuracy plus sensitivity, specificity, ROC-AUC and the confusion matrix — with the false-negative cost discussed explicitly.
- [Risk-predictor web demo] Enter the nuclear measurements via sliders and get a live risk score with a gauge and a plain-language verdict.
- [Feature importance analysis] Random Forest importances identifying the most predictive nuclear properties (typically worst concave points, worst perimeter).
- [Class-imbalance handling] Stratified splits preserve the 62.7/37.3 ratio; the report discusses why accuracy alone would mislead.
- [Clinical-limits documentation] Explicit educational-prototype framing: not a medical device, dataset biases, and why deployment needs clinical validation.
What is included
- Complete training & evaluation Jupyter notebook
- Trained Random Forest pipeline (.pkl) with preprocessing
- Risk-predictor web demo (sliders → live risk gauge)
- Confusion matrix, ROC curve and feature-importance plots
- Project report PDF (dataset background, methodology, metrics, clinical limits)
- PPT presentation for final review
- Viva Q&A preparation document (Random Forest, sensitivity vs accuracy, overfitting, clinical validation)
Limitations & prerequisites
- Educational prototype only — not a medical device; must never be used for diagnosis or screening decisions.
- Trained on 569 digitised FNA samples from one institution — it does not generalize to other imaging or populations without revalidation.
- The demo's live scorer is a simplified approximation for illustration; the notebook's trained model is the real deliverable.
- 97.4% accuracy is a design target, stated honestly — the report documents the actual achieved figures after training.
- No patient data is collected or stored by the demo; all inputs stay in the browser.
Frequently Asked Questions
Which dataset is used and is it real?
The Wisconsin Diagnostic Breast Cancer dataset from the UCI ML Repository — 569 real FNA samples with 30 computed nuclear features, published by Wolberg, Street and Mangasarian at the University of Wisconsin. Every dataset figure on the page comes from its documentation.
Why does the project emphasize sensitivity over accuracy?
Because a false negative (calling a malignant sample benign) is far costlier than a false positive. The evaluation reports sensitivity, specificity and the confusion matrix explicitly instead of hiding behind one accuracy number.
Can this be used for real diagnosis?
No — and the project states this prominently. It is an educational prototype on a small, single-institution dataset; clinical use would require large-scale validation, regulatory approval and clinician oversight.
How does the web demo's scorer relate to the trained model?
The demo embeds a simplified scoring function so visitors can interact with the feature set live. The actual trained Random Forest from the notebook is the shipped model artifact.
What does the model actually look at?
Random Forest feature importances — typically worst concave points, worst perimeter and mean concave points rank highest, which matches the clinical intuition that irregular nuclear contours signal malignancy.
Is this project suitable for a final-year project?
Yes — for AI & Machine Learning, Computer Science and IT programs. It demonstrates real-dataset handling, proper evaluation discipline, cost-sensitive metrics and honest limitation framing. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning, Computer Science and IT.
Components & software requirements
- Python 3, scikit-learn (Random Forest, metrics, CV)
- NumPy, pandas, Matplotlib
- Jupyter Notebook (training & evaluation)
- HTML5 + JavaScript (risk-predictor demo)
- WDBC dataset (UCI ML Repository)
Dataset & model details
- Dataset: Wisconsin Diagnostic Breast Cancer (WDBC) — 569 FNA samples, 30 numeric features (mean, s.e., worst of 10 nuclear properties: radius, texture, perimeter, area, smoothness, compactness, concavity, concave points, symmetry, fractal dimension), 2 classes: 357 benign (62.7%), 212 malignant (37.3%). Source: UCI ML Repository; Wolberg, Street & Mangasarian, University of Wisconsin.
- Task: Binary classification; input = 30 standardized nuclear features, output = benign/malignant probability.
- Model: Random Forest, 200 trees, trained on standardized features after a stratified 80/20 split with 5-fold cross-validation for hyperparameter checking.
- Metrics: Accuracy 97.4% (design target), sensitivity 97.7% (design target), specificity 97.2% (design target), ROC-AUC 0.99 (design target), confusion matrix on the 114-sample held-out test set. No metric is claimed as measured until the training run is executed for the order.
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.