The Lettuce Nutritional Diagnosis Model of ResNet Improved by Integrating the MSA Mechanism
The sustainable production of leafy vegetables in Mediterranean and East Asian regions is increasingly constrained by water scarcity and nutrient imbalance in soil–plant systems, making timely and accurate nutrient diagnosis essential for precision fertilization. Conventional tissue analysis of nitrogen (N), phosphorus (P), and potassium (K) in lettuce is destructive, costly, and time-consuming, while existing non-destructive approaches based on traditional machine learning or deep learning still suffer from limited accuracy and poor generalization. To address these limitations, this study proposes ResNet-SA, a residual convolutional network assisted by a multi-head self-attention (MSA) mechanism, for the rapid and non-destructive estimation of leaf N, P, and K contents from top-view RGB images of lettuce trays under soilless cultivation. Two fusion strategies between the MSA mechanism and the ResNet50 trunk were evaluated, namely lateral side-connection of the attention block (ResNet50_SA_R series) and replacement of a trunk stage (ResNet50_SA_E series), each with three insertion depths. In the fixed-split evaluation, ResNet50_SA_RV1 achieved the best performance, with a test-set R2 of 0.92 versus 0.81 for the ResNet50 baseline (absolute R2 gains of 0.11 and 0.08 for RV1 and RV3, respectively). Grouped five-fold cross-validation by sampling batch tentatively verified the stability of this improvement (ResNet50_SA_RV1: R2 = 0.92 ± 0.03; RMSE = 7.16 ± 1.77 mg/g; MAE = 4.06 ± 1.58 mg/g, macro-averaged across N, P, and K), with significantly lower prediction error than both the ResNet50 baseline (ΔMAE = −2.25 mg/g, 95% CI: −2.88 to −1.62, Holm-adjusted p < 0.001) and four conventional CNN architectures (R2 range: 0.49–0.80). These results demonstrate that integrating the MSA mechanism into ResNet provides a reliable, non-destructive tool for lettuce nutrient diagnosis, offering practical support for precision fertilization and sustainable greenhouse production.
Authors
- Shubo Wang (ORCID: https://orcid.org/0000-0002-4932-5338)
- Qingliang Niu
- Iftikhar Hussain Shah (ORCID: https://orcid.org/0000-0003-0635-6553)
- Liying Chang (ORCID: https://orcid.org/0000-0001-5987-1765)
- Shiwei He (ORCID: https://orcid.org/0000-0003-2838-5830)
- Enqi Zhang
- Zhengheng Shen
- Weihang Zhang
- Zhou Shen
Institutions
- Shanghai Jiao Tong University (CN)
Publication Details
- Journal
- Horticulturae
- Published
- 2026-08-25
- DOI
- https://doi.org/10.3390/horticulturae12091063
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00