Monday, October 26, 2026
Science
No Result
View All Result
  • Login
  • HOME
  • SCIENCE NEWS
  • CONTACT US
  • HOME
  • SCIENCE NEWS
  • CONTACT US
No Result
View All Result
Scienmag
No Result
View All Result
Home Science News Technology and Engineering

Vision transformer identifies coffee leaf nutrient deficiencies and treatment rules

October 26, 2026
in Technology and Engineering
Alan Morgan
By Alan Morgan Scienmag Editorial Profile - Precision Agriculture
Reading Time: 5 mins read
0
Vision transformer identifies coffee leaf nutrient deficiencies and treatment rules

Vision transformer identifies coffee leaf nutrient deficiencies and treatment rules

65
SHARES
587
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

An explainable Vision Transformer developed for coffee leaf images classified nine nutrient-related conditions with 94% accuracy on an original dataset and 96% after data augmentation, outperforming three convolutional neural network baselines under the same experimental conditions. The system also converted each predicted deficiency into a predefined treatment recommendation and highlighted the leaf regions that most influenced its decision. Across five-fold cross-validation, the transformer achieved an F1-score of 92%, while the recommendation engine produced the expected treatment for 93.72% of images. These results describe a controlled machine-learning study based on 1,196 curated photographs, not a field trial or proof that the system can improve crop yields.

The researchers assembled the dataset from two publicly accessible collections, the CoLeaf dataset and a merged plant-disease dataset. After screening for coffee leaves with clear, single deficiency symptoms, the researchers retained 1,196 images representing eight nutrient-deficiency classes and one healthy class. The categories were boron, calcium, iron, potassium, magnesium, manganese, nitrogen and phosphorus deficiencies, plus healthy leaves. Fifty images were removed because of unclear symptoms, non-coffee content, multiple simultaneous stress conditions or poor visual quality. Duplicate and near-duplicate images were also removed before data partitioning to reduce the possibility that closely related images would appear in both training and testing subsets.

Two agricultural specialists independently assigned the nutrient-deficiency labels by examining visible patterns such as chlorosis, necrosis, interveinal discoloration and leaf deformation. Any disagreements were resolved through discussion until the specialists reached a consensus. Their independent classifications produced a Cohen’s Kappa coefficient of 0.96, indicating near-perfect agreement beyond chance. The treatments were not learned as separate image labels. Instead, the researchers built a transparent knowledge base with one expert-defined rule for each of the nine classes. A predicted nitrogen deficiency, for example, led to a urea recommendation, while a predicted potassium deficiency led to a potassium sulfate recommendation; healthy leaves received no treatment.

Each image was resized to 224 by 224 pixels and transformed into 16-by-16-pixel patches with positional encodings. The resulting token representations passed through transformer encoder layers using multi-head self-attention, allowing the architecture to model relationships across the image as well as finer visual patterns. A fully connected classifier used softmax output to assign one of the nine classes. The researchers used class-weighted cross-entropy loss, the Adam optimizer, batches of 16 and 100 training epochs. The implementation used Python, TensorFlow Keras and Google Colab. Stratified five-fold cross-validation supplied the reported performance estimates, with approximately 861 images for training, 96 for validation and 239 for independent testing in each fold.

Data augmentation was introduced to expand the apparent diversity of the relatively small collection. The pipeline included random cropping, horizontal and vertical flips, rotations between 0 and 30 degrees, Cutout, CutMix and Mixup, together with changes to brightness, contrast, saturation and hue. These operations were intended to simulate changes in leaf orientation, illumination, partial obstruction and camera conditions. On the unaugmented data, the model’s macro-averaged precision, recall and F1-score were 94%, 91% and 92%, respectively, with accuracy of 94% plus or minus 0.37% across folds. Following augmentation, accuracy increased to 96% plus or minus 0.29%, with 95% precision, 94% recall and 94% F1-score.

The transformer outperformed all three comparison architectures in the study’s five-fold evaluation. Without augmentation, ResNet-50 achieved 90% accuracy, EfficientNet-B4 reached 89% and ConvNeXt reached 91%, compared with 94% for XViT. Augmentation raised the baseline accuracies to 91%, 90% and 92%, respectively, while XViT reached 96%. Paired t-tests based on only five fold-level accuracy values per model reported p-values below 0.001 for each comparison with XViT. The authors attributed the transformer’s advantage to its ability to represent global spatial relationships and long-range dependencies, whereas convolutional architectures principally emphasize local visual features. That interpretation is plausible within the architecture, but the limited number of paired folds means the tests should be interpreted cautiously.

Classification was not equally successful for every class. Manganese and phosphorus deficiencies had the highest unaugmented F1-scores, both at 97%, while healthy leaves scored 96%. Nitrogen and magnesium deficiencies were more difficult, with F1-scores of 87% and 88%. The confusion analysis showed nitrogen deficiency being confused with boron and magnesium, while potassium deficiency was sometimes assigned to healthy or phosphorus classes. The reported area under the ROC curve ranged from 88% to 99%, with nitrogen at 88% and iron at 92%. Some classes, including iron and nitrogen, contained only 13 samples, making their class-specific estimates more variable than those for better-represented categories.

To explain its image-based predictions, the researchers applied gradient-weighted class activation mapping to the final transformer encoder block. Patch-token representations were reshaped into a spatial grid, scaled to the original image and superimposed on the leaf photograph as a heatmap. The highlighted areas generally corresponded to visible symptoms such as yellowing, dead tissue, discoloration or marginal scorching, rather than the surrounding background. Quantitative explanation tests gave an AUC-deletion value of 0.18 plus or minus 0.01 and an AUC-insertion value of 0.86 plus or minus 0.02: removing influential regions substantially reduced confidence, while restoring them rapidly recovered it. The researchers also demonstrated a Flask interface that returned the predicted class, rule-based treatment and visual explanation.

The recommendation engine achieved 100% rule coverage because all nine predicted categories had corresponding entries, and 100% rule consistency because identical inputs always produced identical outputs. In an evaluation covering all 239 images in the test fold, 93.72% received the correct end-to-end recommendation. Fifteen recommendations were incorrect because the classifier assigned the wrong deficiency class; the rule engine itself was reported to have processed the predicted labels correctly. Two agricultural specialists separately assessed 100 recommendation cases, yielding a Cohen’s Kappa of 0.93 for their agreement on whether the treatments were appropriate. These results show that the rules were transparent and expert-aligned, but they do not establish that applying the suggested products improves plant health, yield or bean quality in the field.

The study’s principal limitations are the modest dataset size and restricted image diversity. Most inputs were conventional leaf photographs, and the model did not account for soil nutrient concentrations, climate, cultivar, plant age, symptom severity or other information that may influence diagnosis. The expert rules likewise do not optimize dosage, alternatives or site-specific management. Although augmentation, transfer learning and dropout were used to limit overfitting, and duplicate images were removed before splitting, the results may not transfer to farms in other geographies or growing conditions. The researchers accordingly proposed larger, geographically diverse datasets, field-scale validation and integration of soil, weather, sensor and temporal information. Their framework demonstrates a promising way to combine image classification, visual explanation and auditable treatment rules, but its practical agricultural value still requires testing beyond curated images and expert review.

Subject of Research: Machine-learning detection of coffee leaf nutrient deficiencies with explainable visual classification and rule-based treatment mapping

Article Title: Explainable vision transformer for coffee leaf nutrient deficiency detection with rule-based treatment recommendation

Article References: Adugna, F. B. (2026). Explainable vision transformer for coffee leaf nutrient deficiency detection with rule-based treatment recommendation. Discover Artificial Intelligence, 6(1), Article 1055. https://doi.org/10.1007/s44163-026-02160-9

Image Credits: AI Generated

DOI: 10.1007/s44163-026-02160-9

Keywords: coffee leaves, nutrient deficiency, vision transformer, explainable AI, Grad-CAM, precision agriculture, image classification, data augmentation, treatment recommendations, plant nutrition, Explainable, vision

Cite Scienmag News

Alan Morgan. (October 26, 2026). Vision transformer identifies coffee leaf nutrient deficiencies and treatment rules. Scienmag. https://scienmag.com/vision-transformer-identifies-coffee-leaf-nutrient-deficiencies-and-treatment-rules/

Alan Morgan. "Vision transformer identifies coffee leaf nutrient deficiencies and treatment rules." Scienmag, 26 October 2026, https://scienmag.com/vision-transformer-identifies-coffee-leaf-nutrient-deficiencies-and-treatment-rules/. Accessed 26 October 2026.

Alan Morgan. "Vision transformer identifies coffee leaf nutrient deficiencies and treatment rules." Scienmag. October 26, 2026. https://scienmag.com/vision-transformer-identifies-coffee-leaf-nutrient-deficiencies-and-treatment-rules/

Tags: coffee leaf nutrient deficiency detectioncoffee leavesdata augmentationdata augmentation in plant disease datasetsdataset for coffee leaf disease diagnosisdeep learning for coffee plant analysisExplainableexplainable AIexplainable vision transformer in agricultureGrad-CAMhigh-accuracy image classification in agricultureimage classificationimpact of AI on coffee crop managementmachine learning for crop healthmulti-class plant nutrient deficiency identificationnutrient deficiencynutrient deficiency treatment recommendationsplant nutrient deficiency classificationplant nutritionprecision agriculturetreatment recommendationsvisionvision transformervisual explanation of AI decision-making in plant health
Share26Tweet16
Previous Post

Survey reveals distinct health patterns among nonpregnant women aged 20–49 in Nepal

Next Post

Arginine extends quantum material behavior above room temperature

Related Posts

ViolenceBanglaBERT improves Bangla violence-text classification in controlled benchmark
Technology and Engineering

ViolenceBanglaBERT improves Bangla violence-text classification in controlled benchmark

October 26, 2026
Ghanaian study links supervised AI chatbots to stronger science learning
Technology and Engineering

Ghanaian study links supervised AI chatbots to stronger science learning

October 26, 2026
Three partners plan phased energy retrofits for aging Fermilab Village buildings
Technology and Engineering

Three partners plan phased energy retrofits for aging Fermilab Village buildings

October 26, 2026
Student proof of concept pairs virtual reality with warehouse drones
Technology and Engineering

Student proof of concept pairs virtual reality with warehouse drones

October 26, 2026
Engineers use drone sounds to identify pre-flight mechanical damage
Technology and Engineering

Engineers use drone sounds to identify pre-flight mechanical damage

October 26, 2026
Hospital abnormal target and personnel behavior detection using improved YOLOv8
Technology and Engineering

Hospital abnormal target and personnel behavior detection using improved YOLOv8

October 26, 2026
Next Post
Arginine extends quantum material behavior above room temperature

Arginine extends quantum material behavior above room temperature

  • Mothers who receive childcare support from maternal grandparents show more optimized

    Mothers who receive childcare support from maternal grandparents show more parental warmth, finds NTU Singapore study

    27656 shares
    Share 11059 Tweet 6912
  • University of Seville Breaks 120-Year-Old Mystery, Revises a Key Einstein Concept

    1061 shares
    Share 424 Tweet 265
  • Bee body mass, pathogens and local climate influence heat tolerance

    682 shares
    Share 273 Tweet 171
  • Researchers record first-ever images and data of a shark experiencing a boat strike

    546 shares
    Share 218 Tweet 137
  • Groundbreaking Clinical Trial Reveals Lubiprostone Enhances Kidney Function

    531 shares
    Share 212 Tweet 133
Science

Embark on a thrilling journey of discovery with Scienmag.com—your ultimate source for cutting-edge breakthroughs. Immerse yourself in a world where curiosity knows no limits and tomorrow’s possibilities become today’s reality!

RECENT NEWS

  • Tutorial linked to higher oncology confidence among foundation doctors
  • Sleep medication statistically links activity and diabetes in Azar cohort
  • AI system reveals temperature tolerances across medaka fish strains
  • Ethiopia malaria prevalence pooled at 14% in systematic review

Categories

  • Agriculture
  • Anthropology
  • Archaeology
  • Athmospheric
  • Biology
  • Biotechnology
  • Blog
  • Bussines
  • Cancer
  • Chemistry
  • Climate
  • Earth Science
  • Editorial Policy
  • Marine
  • Mathematics
  • Medicine
  • Pediatry
  • Policy
  • Psychology & Psychiatry
  • Science Education
  • Science News
  • Social Science
  • Space
  • Technology and Engineering

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 5,151 other subscribers

© 2025 Scienmag - Science Magazine

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • HOME
  • SCIENCE NEWS
  • CONTACT US

© 2025 Scienmag - Science Magazine

Discover more from Science

Subscribe now to keep reading and get access to the full archive.

Continue reading