Skip to content
Learning

Pancreatic cancer prediction with machine learning

Classify pancreatic-disease study specimens into three categories

This reproducible Neural Designer example treats diagnosis as one categorical endpoint: no pancreatic disease, benign hepatobiliary disease or pancreatic ductal adenocarcinoma (PDAC). The fixed softmax model correctly classifies 79 of 118 internally held-out specimens and detects 28 of 32 PDAC labels. It is a research benchmark, not a clinical diagnostic or screening system.

590case-control study specimens
66.9%internal testing accuracy
87.5%PDAC recall (28 of 32)
0.677macro-F1 across three classes

1. Clinical question and intended use

The model assigns each processed urine-specimen record to one of three mutually exclusive study labels. This is the coherent formulation for the supplied endpoint: a single categorical target and one three-score softmax output, rather than separate models for each category.

Its defensible use is reproducible biomarker-method research and software education. It may help investigators understand an end-to-end multiclass workflow, but it cannot determine whether an individual patient has pancreatic cancer.

One clinical question

Distinguish no pancreatic disease, benign hepatobiliary disease and PDAC in one categorical experiment.

Auditable cleaning

Remove variables with more than 45% missing values before fitting the model and document what remains.

Reproducible calculation

Inspect the exact split, encoded input contract, coefficients and three returned scores.

Biomarker researchClinical data scienceLaboratory medicineBiostatisticsTranslational oncology
Intended-use boundary. This example is a retrospective case-control research demonstration. It is not validated for population screening, differential diagnosis, clinical triage or treatment decisions.

2. Cohort, measurements and endpoint

The data accompany a multicentre case-control biomarker study and contain 590 specimens: 183 with no pancreatic disease, 208 with benign hepatobiliary disease and 199 with PDAC. The project uses a reproducible random 60/20/20 row split: 354 training, 118 selection and 118 testing records.

Distribution of the three pancreatic-disease study labels

The classes are relatively balanced in this research collection. Their proportions are not population prevalence estimates.

Missing-data cleaning

Neural Designer’s Unuse missing variables task applies a 45% threshold before modelling. It removes the following columns:

VariableMissing rowsMissing rateDecision
stage39166.3%Unused
benign_sample_diagnosis38264.7%Unused
REG1A28448.1%Unused

sample_id is also excluded because it is an identifier. plasma_CA19_9 remains available despite 240 missing values (40.7%), and the stored project replaces missing entries with the mean 654.003. The resulting model uses nine logical predictors, expanded to 12 numeric inputs after categorical encoding.

PredictorRoleProcessing
patient_cohortStudy provenanceBinary encoding
sample_originCollection siteFour one-hot inputs
age, sexDemographicsNumeric/binary scaling
plasma_CA19_9Blood biomarkerMean imputation and scaling
creatinine, LYVE1, REG1B, TFF1Urine measurementsNumeric scaling

Input-target Pearson correlations for the retained pancreatic-cancer predictors

Plasma CA19-9 has the largest displayed univariate association. Correlation with an encoded multiclass target is descriptive and depends on class coding; it is not a causal importance measure.
Provenance and leakage boundary. stage is available mainly for cancer cases and is outcome-adjacent, so excluding it also avoids an obvious shortcut. More subtly, cohort and collection site can encode centre effects. A professional validation should hold out complete sites or cohorts and test a biomarker-only specification.

3. Model

The fixed architecture has no hidden layer. Nine logical predictors become 12 numeric features after encoding cohort, origin and sex; a direct dense layer returns three softmax scores. With 36 weights and three biases, the model has 39 trainable parameters and is equivalent to multinomial logistic regression.

Output contract. The three scores correspond to benign hepatobiliary disease, no pancreatic disease and PDAC, and the largest score supplies the categorical prediction. The scores sum to one but have not been independently calibrated as clinical probabilities.
Fixed pancreatic-cancer categorical architecture with nine logical inputs and one three-class target
Fixed base and final architecture. The diagram shows the categorical diagnosis as one logical output; the exported implementation returns three softmax scores.

4. Training strategy

The training strategy minimizes multiclass cross-entropy with the quasi-Newton method and L2 regularization weight 0.01. Across 35 stored epochs, training cross-entropy falls from about 1.170 to 0.660 and selection cross-entropy from about 0.855 to 0.734.

Cross-entropy training and selection histories for the fixed three-class classifier

The selection curve is used to monitor optimization. It does not turn the internal random split into external clinical validation.

5. Model selection and baseline

No neuron selection, input selection or architecture-selection experiment was performed. The direct 12–3 softmax classifier is both the initial and final model. This restraint is appropriate: adding hidden neurons would not solve centre effects, missing-data bias or the lack of an external cohort.

ReferenceTesting accuracyInterpretation
Majority-class baseline39.0%Always predict benign hepatobiliary disease (46 of 118)
Fixed categorical model66.9%79 of 118 testing records classified correctly

6. Clinical validation

The held-out testing subset contains 46 benign-disease, 40 no-disease and 32 PDAC records. Its class prevalence is therefore 39.0%, 33.9% and 27.1%, respectively. Predictions use the largest of the three scores (an argmax decision rule), not a binary threshold.

A multiclass ROC AUC or precision–recall analysis was not generated for this experiment, so none is claimed. The confusion matrix and per-class metrics provide the auditable evidence available from the exported project.

Testing confusion matrix

Actual / predictedBenign diseaseNo diseasePDACTotal
Benign disease2812646
No disease1423340
PDAC312832
Total453637118
ClassPrecision / PPVRecall / sensitivitySpecificityF1
Benign disease62.2%60.9%76.4%0.615
No disease63.9%57.5%83.3%0.605
PDAC75.7%87.5%89.5%0.812
Macro average67.3%68.6%83.1%0.677
Clinical interpretation. PDAC is the strongest class on this internal split, with 87.5% sensitivity and 89.5% specificity, while benign disease and no disease are confused more often. These are case-control record-level results, not estimates of performance or predictive value in a screening population.

7. Workflow and reproducibility

A credible translational workflow would separate assay processing, model inference and clinical interpretation:

Eligible research specimen
Assay and quality control
Schema, units and missingness
Three-class model scores
Applicability and uncertainty checks
Expert review and confirmation

The interactive calculation below reproduces the project. It deliberately shows provenance fields to make the deployed input contract visible; that does not make those fields appropriate predictors for a future clinical model.

Reproduce a three-class model calculation

The default specimen is the reference vector exported from Neural Designer. The calculation runs locally with the exact preprocessing and trained coefficients.

Research demonstration. Cohort and sample origin are included only because they are inputs in the published project; they are provenance fields, not biomarkers. Values outside the validated domain are rejected. The output must not be used for screening, diagnosis or treatment and must not guide care.








Reproduce the project

The Python package contains the exact 12-input export, schema and reference case. The Neural Designer package preserves the project, split and regenerated analyses. The CSV is the 590-row source table used by this example.

from model import NeuralNetwork
inputs = [0, 0, 0, 1, 0, 47, 1, 21, 2.02, 5.57, 28, 982]
scores = NeuralNetwork().calculate_outputs(inputs)

8. Safety, generalizability and governance

  • Case-control design. The sample deliberately contains disease groups and does not represent screening prevalence, referral pathways or consecutive clinical practice.
  • Internal random split only. There is no external, temporal, prospective or site-held-out validation.
  • Centre proxies. Cohort and sample origin may improve internal discrimination by encoding collection or laboratory differences rather than disease biology.
  • Missing-data risk. CA19-9 is absent in 40.7% of rows. The stored mean is calculated from the complete project data; production-grade evaluation must fit imputation on training data only and examine informative missingness.
  • Uncalibrated scores. Softmax outputs are ranking scores until multiclass calibration is assessed on independent data.
  • Assay portability. Units, pre-analytics, instruments, batches and laboratory quality controls must match the validated specification.
  • Human expert review. Model scores cannot replace specialist interpretation, confirmatory testing or a documented clinical pathway.
  • No early-stage claim. Stage is excluded as a predictor, and this analysis does not establish sensitivity for stage I–II disease.
Decision boundary. Use the example for reproducible research and education only. Consequential interpretation requires a locked biomarker specification, training-only preprocessing, calibration, site-held-out and external prospective validation, and appropriate clinical confirmation.

References