Classify three Palmer penguin species from field and isotope data
This reproducible classification study encodes sampling island, clutch completion, morphology, recorded sex and stable-isotope measurements in a direct softmax model. The exported classifier labels 67 of 68 held-out records correctly (98.5%; macro-F1 0.981). The result is strong for this internal random split, but it does not establish transfer to other islands, years or measurement protocols.
1. Scientific objective
The objective is to reproduce a three-species classification benchmark for Adelie, Chinstrap and Gentoo penguins observed in the Palmer Archipelago. The model combines collection context, structural measurements and blood stable-isotope values to assign three class scores. It supports teaching, reproducible method comparison and exploration of multivariate ecological data; it is not a field-identification or population-monitoring system.
Combine bill, flipper and body measurements with island, clutch and recorded-sex fields.
Inspect the exact encoding, trained weights, internal split and executable Python export.
Use the single testing error to examine confounding, score interpretation and limits to transfer.
2. Data and provenance
The downloadable penguin_dataset.csv contains 344 records: 152 Adelie, 68 Chinstrap and 124 Gentoo penguins. The source table includes identifiers and egg dates for traceability; the model uses nine variables that expand to eleven numeric features after island encoding.
| CSV field | Model role | Definition | Unit or coding |
|---|---|---|---|
island | Input → 3 features | Sampling island | Biscoe, Dream or Torgersen |
clutch_completion | Input | Recorded clutch-completion field | No / Yes |
culmen_length_mm | Input | Length of the dorsal ridge of the bill | mm |
culmen_depth_mm | Input | Depth of the bill | mm |
flipper_length_mm | Input | Flipper length | mm |
body_mass_g | Input | Body mass | g |
sex | Input | Recorded sex | FEMALE / MALE |
delta_15_N | Input | Blood nitrogen stable-isotope value | ‰ |
delta_13_C | Input | Blood carbon stable-isotope value | ‰ |
species | Target | Supplied species label | Adelie, Chinstrap or Gentoo |
individual_id, date_egg | Not modelled | Source traceability fields | Identifier and date |
| Subset | Rows | Adelie | Chinstrap | Gentoo | Purpose |
|---|---|---|---|---|---|
| Training | 208 | 88 | 42 | 78 | Estimate model parameters |
| Selection | 68 | 30 | 15 | 23 | Monitor optimization |
| Testing | 68 | 34 | 11 | 23 | Report final internal performance |
The project records 46 missing fields across 20 rows: two missing values in each structural measurement, 11 in recorded sex, 14 in δ15N and 13 in δ13C. Neural Designer replaces missing coded or numeric inputs with the corresponding project mean before scaling.


3. Model
Island is one-hot encoded as Biscoe, Dream and Torgersen. Clutch completion and recorded sex use binary coding; the six continuous inputs use mean-and-standard-deviation scaling. These transformations produce eleven numeric model features.
A single dense softmax layer connects the eleven scaled features directly to three outputs ordered as Adelie, Chinstrap and Gentoo. The architecture has no hidden layer and contains 36 trainable parameters: 33 weights and three biases.

4. Training strategy
The model minimizes multiclass cross-entropy with the quasi-Newton method and no explicit regularization. The stored run contains 14 epoch values (0–13) and stops when the training loss reaches the configured 0.001 goal.
Training cross-entropy decreases from 1.1359 to 0.000714, while selection cross-entropy decreases from 0.3206 to 0.0215. The larger selection error is the more relevant indication of performance on unseen rows.

5. Model selection and baseline
No neuron selection, input selection or architecture selection was performed. The direct 11–3 softmax model is both the base and final architecture. The selection subset monitors optimization; it is not evidence that this architecture is optimal.
| Reference | Testing accuracy | Interpretation |
|---|---|---|
| Largest testing class | 50.0% | Always predict Adelie, represented by 34 of 68 testing rows |
| Uniform three-class chance | 33.3% expected | Reference for three equally likely labels |
| Fixed softmax model | 98.5% | 67 correct labels from the 68-row internal testing subset |
The compact model already separates this random split well. More layers would not resolve the central scientific limitations: island–species association, mean imputation and absence of validation by year, island or external campaign.
6. Scientific validation
The final exported model is evaluated once on 68 held-out records. It correctly classifies every Chinstrap and Gentoo record and 33 of 34 Adelie records. The single error is an Adelie penguin assigned to Chinstrap.
| Testing metric | Value | Interpretation |
|---|---|---|
| Accuracy | 98.5% | 67 correct labels from 68 records |
| 95% Wilson interval for accuracy | 92.1–99.7% | Sampling uncertainty for this finite testing subset |
| Macro precision | 97.2% | Unweighted mean across the three species |
| Macro recall | 99.0% | Unweighted sensitivity across the three species |
| Macro-F1 | 98.1% | Class-balanced precision/recall summary |
| Testing cross-entropy | 0.0492 | Calculated from the exact Python export |
Confusion matrix
| Actual / predicted | Adelie | Chinstrap | Gentoo | Total |
|---|---|---|---|---|
| Adelie | 33 | 1 | 0 | 34 |
| Chinstrap | 0 | 11 | 0 | 11 |
| Gentoo | 0 | 0 | 23 | 23 |
| Total | 33 | 12 | 23 | 68 |
The informative error
Testing record N27A2 is labelled Adelie but receives an Adelie score of 3.62% and a Chinstrap score of 96.38%. It was observed on Dream Island and has measurements that resemble the Chinstrap region of this table. The browser demonstration below reproduces this exact error.
7. Inference and reproducibility
A defensible research workflow starts with a traceable specimen record, verifies the measurement and isotope protocols, checks missingness and units, applies the documented encoding, calculates the three model scores and sends the output to ecological or statistical review.
Held-out error as a deployment case
The default browser values reproduce testing record N27A2. Its supplied label is Adelie; the final model assigns its highest score to Chinstrap. Using a known error makes the operational boundary clearer than demonstrating only an easy, high-confidence match.
| Input | Value |
|---|---|
| Island / clutch | Dream / Yes |
| Bill length / depth | 44.1 / 19.7 mm |
| Flipper length / body mass | 196 mm / 4400 g |
| Recorded sex | MALE |
| δ15N / δ13C | 9.2372 / −24.52698 ‰ |
| Supplied species | Adelie |
Adelie 3.62%; Chinstrap 96.38%; Gentoo <0.0001%. The high score is incorrect for this held-out record.
Try the exported Palmer penguin classifier
The default values reproduce the only misclassified record in the published testing subset: an observed Adelie penguin that the model assigns its highest score to Chinstrap.
Reproduce the inference
The Python package contains the exact export, ordered eleven-feature schema, held-out error and expected scores. The Neural Designer package preserves the split, trained parameters and regenerated analyses.
from model import NeuralNetwork
inputs = [0, 1, 0, 1, 44.1, 19.7, 196, 4400, 1, 9.2372, -24.52698]
scores = NeuralNetwork().calculate_outputs(inputs)8. Validity, uncertainty and limitations
- Internal random split only. The 208/68/68 partition does not test transfer across field season, island, instrument, laboratory or a later population.
- Geographic shortcut risk. In this table, all Chinstrap records are from Dream and all Gentoo records are from Biscoe. Island can therefore support classification without representing portable morphology.
- Missing-data assumptions. The project mean-imputes 46 missing fields across 20 rows. This can reduce variation and does not replace a missingness analysis.
- Laboratory inputs. δ15N and δ13C require stable-isotope measurements. Changes in sample handling, assay calibration or laboratory can shift the model inputs.
- Small class-specific testing counts. Testing includes only 11 Chinstrap and 23 Gentoo records, so error estimates remain uncertain despite high aggregate accuracy.
- Uncalibrated scores. Softmax values rank the three labels but have not been independently calibrated as probabilities.
- Association, not mechanism. The model captures multivariate patterns in the sampled records; it does not establish causal ecological relationships.
- Research boundary. The classifier is suitable for education and reproducible method work, not authoritative field identification, conservation decisions or population assessment.
References
- Horst AM, Hill AP, Gorman KB. palmerpenguins: Palmer Archipelago (Antarctica) penguin data. DOI: 10.5281/zenodo.3960218.
- Gorman KB, Williams TD, Fraser WR. Ecological sexual dimorphism and environmental variability within a community of Antarctic penguins. PLoS ONE. 2014;9(3):e90081.
- Horst AM, Hill AP, Gorman KB. Palmer Archipelago Penguins Data in the palmerpenguins R Package. The R Journal. 2022;14(1):244–254.
- Environmental Data Initiative package links and data documentation for Adelie, Chinstrap and Gentoo records.




