Classify historical breast-cytology records with a transparent model
This reproducible Neural Designer example uses nine ordinal cytology ratings from the Breast Cancer Wisconsin (Original) collection. On 136 internally held-out records, the fixed linear sigmoid model reaches ROC AUC 0.998 and classifies 135 records correctly at score threshold 0.50. It is an educational benchmark—not a clinically validated diagnostic device.
1. Clinical question and intended use
The model ranks records from the supplied historical cytology table toward the processed malignant label. Its defensible role is software demonstration and retrospective method benchmarking. It may illustrate how a compact multivariable score could support research review, but it cannot establish or exclude breast cancer for a patient.
Reproducible benchmark
Inspect the exact data split, preprocessing, trained coefficients and regenerated test analyses.
Transparent scoring
Use a direct nine-input sigmoid model whose complete calculation can be reproduced in Python or the browser.
Workflow education
Demonstrate why measurement quality, threshold policy, calibration and confirmatory review remain separate requirements.
2. Cohort, measurements and endpoint
The source is the Breast Cancer Wisconsin (Original) data set, donated to UCI in 1992 from cases reported by Dr William H. Wolberg at University of Wisconsin Hospitals. UCI lists 699 original records, nine integer features, a sample-code identifier, class codes 2 (benign) and 4 (malignant), and missing values in bare_nuclei.
The processed Neural Designer table removes the identifier, excludes the 16 records with missing values and recodes the target to diagnose=0 for benign and diagnose=1 for malignant. It therefore contains 683 complete records: 444 negative labels (65.0%) and 239 positive labels (35.0%).
| Subset | Records | Benign label | Malignant label | Purpose |
|---|---|---|---|---|
| Training | 411 | 270 | 141 | Estimate model parameters |
| Selection | 136 | 90 | 46 | Monitor optimization |
| Testing | 136 | 84 | 52 | Internal final evaluation |
| Total | 683 | 444 | 239 | Complete-case processed table |
| Input field | Scale | Recorded cytology characteristic |
|---|---|---|
clump_thickness | 1–10 | Clump thickness rating |
cell_size_uniformity | 1–10 | Uniformity-of-cell-size rating |
cell_shape_uniformity | 1–10 | Uniformity-of-cell-shape rating |
marginal_adhesion | 1–10 | Marginal-adhesion rating |
single_epithelial_cell_size | 1–10 | Single epithelial-cell-size rating |
bare_nuclei | 1–10 | Bare-nuclei rating |
bland_chromatin | 1–10 | Bland-chromatin rating |
normal_nucleoli | 1–10 | Normal-nucleoli rating |
mitoses | 1–10 | Mitoses rating |


3. Model
All nine inputs use mean-and-standard-deviation scaling. They connect directly to one sigmoid output, with no hidden layer. The model contains ten trainable parameters: nine weights and one bias. It is a logistic classifier represented in Neural Designer’s network framework.
diagnose=1, the processed malignant label. No independent calibration analysis is supplied, so the sigmoid value is a model score—not an individual probability of malignancy.
4. Training strategy
The stored training strategy minimizes class-weighted squared error with the quasi-Newton method and L2 regularization weight 0.01. The processed positive and negative classes receive weights 1.4289 and 0.7691, respectively.
Across 17 stored epochs (0–16), training error decreases from 0.7707 to 0.0847. Selection error starts at 0.0476, reaches its lowest displayed value at the beginning, and finishes at 0.0579. The stopping criterion is minimum loss decrease.

5. Model selection and baseline
No neuron selection, input selection or architecture selection was performed. The direct 9–1 sigmoid model is both the base and final architecture. The selection subset monitors optimization only.
| Reference | Testing accuracy | Interpretation |
|---|---|---|
| Majority-class baseline | 61.8% | Always predict the benign label represented by 84 of 136 testing records |
| Fixed 9–1 model | 99.3% | 135 of 136 testing records classified correctly at score 0.50 |
The compact model is adequate for this internal split. Extra hidden neurons would add complexity without resolving the larger evidence limitations: exact-vector overlap, historical sampling and absence of external validation.
6. Clinical validation
The final model is evaluated on 136 testing records: 52 malignant labels (38.2% testing prevalence) and 84 benign labels. Neural Designer reports ROC AUC 0.998 with a 95% confidence interval of 0.991–1.000.

Operating point at score 0.50
The confusion matrix below uses the fixed reference threshold 0.50. The ROC task also reports a test-derived threshold of 0.33; it produces the same confusion counts in this split but must not be presented as an unbiased clinical cutoff.
| Actual / predicted at 0.50 | Positive | Negative | Total |
|---|---|---|---|
| Malignant label | 52 | 0 | 52 |
| Benign label | 1 | 83 | 84 |
| Total | 53 | 83 | 136 |
| Testing metric | Value | Count-based reading |
|---|---|---|
| Sensitivity | 100% | 52 of 52 malignant labels detected |
| Specificity | 98.8% | 83 of 84 benign labels rejected |
| Precision / observed PPV | 98.1% | 52 of 53 positive calls match the malignant label |
| Observed NPV | 100% | 83 of 83 negative calls match the benign label |
| Accuracy | 99.3% | 135 of 136 records classified correctly |
| F1 score | 0.990 | Harmonic summary of precision and sensitivity |
| ROC AUC | 0.998 | Threshold-independent discrimination; 95% CI 0.991–1.000 |
7. Workflow and reproducibility
A responsible real-world analogue would start after an eligible specimen has entered an approved diagnostic pathway. It would verify specimen identity, measurement provenance and the nine-field schema, check completeness and ranges, calculate a versioned score, detect unsupported inputs, and route the result to specialist review and an established confirmatory method.
Reproducible score example
The vector 5, 1, 1, 1, 2, 1, 1, 1, 1 produces a malignant-class score of 0.034283. This exact feature vector appears in more than one subset, so it verifies the calculation but is not an independent validation case.
Try the exported cytology classifier
Enter the nine ordinal ratings used by the processed data. The default vector reproduces Neural Designer’s exported calculation.
Reproduce the inference
The Python package contains the exact export, ordered schema, reference input and expected score. The Neural Designer package preserves the 411/136/136 split, trained parameters and regenerated analyses.
from model import NeuralNetwork
ratings = [5, 1, 1, 1, 2, 1, 1, 1, 1]
malignant_class_score = NeuralNetwork().calculate_outputs(ratings)[0]8. Safety, generalizability and governance
- Internal random split only. No independent hospital, laboratory, time period, instrument or prospective cohort is evaluated.
- Exact-vector overlap. The 683 rows collapse to 449 unique input vectors; 49 testing rows reproduce a vector already present in training. This can make internal performance optimistic.
- Patient grouping cannot be verified. The processed table removes the source identifier, so repeated records from one patient or specimen cannot be audited or kept in one subset.
- Complete-case restriction. Sixteen of the 699 UCI records are excluded because the source reports missing
bare_nuclei. Performance does not cover incomplete inputs. - Reference-standard detail is incomplete. The processed file does not retain diagnostic-adjudication, biopsy, pathology, timing or follow-up metadata.
- Scores are uncalibrated. The sigmoid output ranks the supplied class but has not been tested as an individual probability. PPV and NPV will change with prevalence.
- No subgroup evidence. Age, ancestry, tumour subtype, lesion spectrum, operator, laboratory and device information are unavailable.
- No clinical-utility evaluation. The example does not compare against pathologist performance, assess workflow impact, quantify net benefit or evaluate patient outcomes.
References
- UCI Machine Learning Repository: Breast Cancer Wisconsin (Original). DOI 10.24432/C5HP4Z; CC BY 4.0.
- Wolberg WH, Mangasarian OL. Multisurface method of pattern separation for medical diagnosis applied to breast cytology. Proceedings of the National Academy of Sciences. 1990;87(23):9193–9196.




