# Classification of Lupinus seeds into sweet and bitter categories using VIS–NIR spectroscopy and machine learning

**Authors:** Josefa Díaz-Álvarez, Francisco A. Galea-Gragera, Francisco Chávez de la O, Pedro A. Salguero-López, Fernando Llera Cid

PMC · DOI: 10.3389/frai.2026.1745720 · 2026-02-27

## TL;DR

Researchers used light and machine learning to non-destructively classify sweet and bitter Lupinus seeds.

## Contribution

A non-destructive method using VIS-NIR spectroscopy and machine learning for classifying Lupinus seeds is proposed.

## Key findings

- SVC and LGR achieved high classification accuracy (92-93%) using VIS-NIR data.
- Hybrid spectral transformations improved discrimination between sweet and bitter seeds.
- Resampling methods helped reduce overfitting due to class imbalance.

## Abstract

The Lupinus germplasm includes sweet and bitter materials distinguished by compounds responsible for bitterness. Conventional identification is often destructive. This study assesses a non-destructive approach based on visible–near infrared (VIS-NIR) spectroscopy and machine learning to classify whole seeds from seven Lupinus species into sweet or bitter classes.

Five machine-learning algorithms were evaluated on two datasets (reflectance and absorbance) acquired with VIS-NIR spectroscopy. Analyses were conducted on raw spectra and on spectra transformed using four spectral-transformation techniques. Because classes were imbalanced, five resampling methods were compared to improve classification performance.

Performance was assessed using F1-score and ROC-AUC. On reflectance, LGR and SVC reached 92.5 and 92.0%; on absorbance, SVC and RF achieved 93.2 and 92.5%. Hybrid transformations consistently improved discrimination, and resampling reduced overfitting associated with class imbalance.

The results indicate that combining VIS–NIR spectroscopy with machine learning provides a suitable non-destructive alternative to discriminate sweet and bitter Lupinus materials/ecotypes.

## Linked entities

- **Species:** Lupinus (taxon 3869)

## Full-text entities

- **Species:** Lupinus (genus) [taxon 3869]

## Figures

11 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12982427/full.md

---
Source: https://tomesphere.com/paper/PMC12982427