Skip to main content
Jeremy Cleland.
WorkAboutResumeWritingLearnContact
Jeremy Cleland.

Director - Senior Software Engineer
Gray Matter Resources
Michigan, USA.

WorkAboutResumeContactWritingLearn
jeremy@clelandco.comGitHubLinkedIn© 2026 Jeremy Cleland
  1. Home
  2. Writing
  3. Why Plant Disease Classifiers Fail in the Field: The PlantVillage Gap
Artificial IntelligencePublished November 12, 2026 · 13 min read

Why Plant Disease Classifiers Fail in the Field: The PlantVillage Gap

Plant disease classifiers that score 99 percent on PlantVillage drop to roughly 31 percent on photos from other sources. The benchmark measures capture conditions as much as disease, and the same tests expose shortcuts in any vision classifier.

By Jeremy ClelandPublished November 12, 2026
  • Computer Vision
  • Dataset Shift
  • Shortcut Learning
  • PlantVillage
  • PlantDoc
  • Model Evaluation
  • Out-of-Distribution Testing
  • Saliency Maps
  • Image Classification
  • Deep Learning
Why Plant Disease Classifiers Fail in the Field: The PlantVillage GapWhy Plant Disease Classifiers Fail in the Field: The PlantVillage Gap
Conceptual illustration: the same leaf on a plain laboratory plate and among overlapping field foliage, with a square viewfinder framing the background plate rather than the leaf.

On this page

    Plant disease classifiers trained on PlantVillage, the largest and most studied public plant disease dataset, routinely report accuracy above 98 percent. The best-known figure dates from 2016, when Mohanty, Hughes, and Salathé trained convolutional networks on 54,306 leaf images from the PlantVillage project, covering 14 crop species and 26 diseases in 38 classes, and reported 99.35 percent accuracy on a held-out test set. The same paper contains a second number that complicates the first. When the best model was run on leaf photos collected from other online sources, accuracy fell to just over 31 percent.

    Both numbers are correct. They answer different questions. The first asks whether the model can label a new photo drawn from the same collection it was trained on. The second asks whether it can label a diseased leaf. The gap between them is a clean case study in dataset shift and shortcut learning: the benchmark score reflects how the images were captured as much as what the disease looks like.

    The argument here is that the PlantVillage gap is a property of the evaluation design, and the plant-specific details are incidental. The tests that expose it apply to any vision classifier, and they are cheap enough to run before a headline accuracy figure goes into a paper, a README, or a slide.

    Why plant disease classifiers score 99 percent on PlantVillage

    Hughes and Salathé released the PlantVillage images in 2015 as an open repository of more than 50,000 expertly curated photos of healthy and infected crop leaves, with the stated aim of enabling mobile disease diagnostics. The collection protocol was controlled. As Noyan's later analysis describes it, leaves were removed from the plant, placed against a grey or black background, and photographed outdoors with a single digital camera.

    Mohanty and colleagues split that collection at random into training and test sets. Under an 80/20 split, GoogLeNet with transfer learning on colour images reached the 99.35 percent figure. Trained on only 20 percent of the data and tested on the remaining 80 percent, the same configuration still reached 98.21 percent.

    A random split guarantees that the test images share everything with the training images except their identity: the same camera, the same backgrounds, the same sessions, the same way of laying a leaf flat. In the vocabulary of Geirhos and colleagues, this is an independent and identically distributed (i.i.d.) test set. A high i.i.d. score shows that the model found a rule that works inside the collection. It does not show which rule.

    The 31 percent result was in the original paper

    Mohanty and colleagues ran the check themselves. They assembled two small sets of images from Bing Image Search and IPM Images, verified them visually, and ended up with 121 and 119 photos. The best PlantVillage model scored 31.40 percent on the first set and 31.69 percent on the second, against 2.63 percent for a random guess across 38 classes.

    These were small web-sourced external image sets, not a prospective farm-field validation. They test transfer away from PlantVillage capture conditions; they do not measure performance for a defined agricultural deployment.

    The authors stated the limits directly. The model was, in their words, constrained to "single leaves, facing up, on a homogeneous background," and they expected more diverse training data to raise field accuracy.

    Thirty-one percent is about twelve times chance, so the network did learn something about leaves and lesions. It is also less than a third of the benchmark figure. A reader who saw only the abstract would have the wrong picture of what had been built.

    PlantDoc repeated the test with a larger wild set

    Singh and colleagues introduced PlantDoc at CoDS-COMAD 2020 to make that outside test repeatable. They downloaded about 20,900 candidate images from Google Images and Ecosia using the names of the 38 PlantVillage classes, filtered them over roughly 300 human hours, and kept 2,598 images across 13 species and 27 classes (17 diseased, 10 healthy). The photos show leaves on the plant, several to a frame, with natural backgrounds and lighting. Cropping each annotated leaf produced a second set, Cropped-PlantDoc, with 9,216 leaf images.

    Their benchmark tables give the cross-dataset numbers:

    Model, test setPlantVillage onlyFine-tuned on PlantDoc
    VGG16, uncropped15.08%29.73%
    VGG16, cropped19.73%60.41%
    InceptionV3, cropped30.78%62.06%
    InceptionResNetV2, cropped39.87%70.53%

    The middle column is a model trained on PlantVillage and tested on all of PlantDoc. The right column is a model pre-trained on PlantVillage, fine-tuned on 80 percent of PlantDoc, and tested on the remaining 20 percent. The difference in the last row is the "up to 31%" improvement the abstract reports.

    Two details matter when reading these numbers. First, the fine-tuned results are themselves i.i.d. scores inside PlantDoc, a web-scraped collection. They describe performance on more photos like PlantDoc's, which is a better proxy for a farm than a grey card but is still one source. Second, the authors list their own limitations: they lacked extensive domain expertise, some images may be wrongly labelled, and visually similar diseases such as tomato bacterial spot and Septoria leaf spot are hard to separate from appearance alone. All images were also resized to 100 by 100 pixels before training.

    Even the best case, 70.53 percent on cropped leaves, sits a long way from 99.35. Set against that benchmark figure, the most favourable result in the table is roughly 29 points lower and the least favourable more than 80.

    Eight background pixels that predict the disease

    The most direct evidence about what the benchmark rewards came in 2022. Noyan reduced every PlantVillage image to eight pixels: the four corners and the four midpoints of the sides. Those pixels sit on the backdrop. In the paper's words, they contain "zero information about diseases" and amount to less than 0.1 percent of the background.

    A random forest with default scikit-learn settings, trained on those eight pixels with the same 80/20 random split used elsewhere in the literature, reached 49.0 percent accuracy on the test set. Random guessing gives 2.6 percent. The same transformation applied to MNIST as a control scored 11.7 percent against a 10 percent chance rate, which is what a dataset without this leak looks like.

    Noyan's explanation is more specific than "the model looks at the background." A grey backdrop has no natural relationship to a disease, so the classic background bias, cows on grass, should not apply. The signal comes from what the paper calls capture bias: device, collector habits, and illumination that varied between classes when the photos were taken. A class photographed on one day under one sky carries that day's fingerprint in every pixel.

    That has an uncomfortable consequence. Capture conditions affect the leaf as well as the backdrop, so cutting the background out does not remove the leak. Noyan tested this with a single feature, image blur. Blur alone predicted the class with 11.7 percent accuracy on the full images, 10.8 percent on backgrounds only, and 10.0 percent on leaves with the background removed, all roughly four times chance.

    The paper also warns that adding field images to fix the problem can make it worse when the new images arrive unevenly. In one extended version of the dataset that it examines, 31 percent of classes came purely from field conditions and 48 percent purely from the laboratory. A model can then separate many classes by learning to tell a lab photo from a field photo.

    Eight highlighted sample squares sit at the four corners and four edge midpoints of a specimen image, away from a central leaf.
    Schematic of the eight background sampling positions in the blind-baseline experiment: four corners and four edge midpoints. This illustration is not a dataset photograph or a saliency map.

    Shortcut learning is the general failure

    Geirhos and colleagues gave this pattern a name in a 2020 perspective in Nature Machine Intelligence. Shortcuts are decision rules that perform well on i.i.d. test data and fail on out-of-distribution (o.o.d.) tests, which reveals a mismatch between the intended solution and the learned one. Their examples come from outside agriculture. A network that appears to classify cows fails when the cow stands on a beach, because grass was the predictor. A pneumonia classifier that worked across several hospitals performed poorly on scans from new ones, having learned to identify the hospital system, for instance from a hospital-specific metal token on the scan, and to lean on each hospital's pneumonia prevalence.

    Two lines from that paper are worth keeping on the wall. One is a caution: "we must not confuse performance on a dataset with the acquisition of an underlying ability." The other is the authors' adaptation of Morgan's Canon for machine learning: "Never attribute to high-level abilities that which can be adequately explained by shortcut learning."

    The size of the PlantVillage gap is unusual. The direction is not. In the WILDS benchmark, Koh and colleagues assembled ten datasets with real distribution shifts and found that out-of-distribution performance was, in their words, "consistently and substantially lower" than in-distribution performance. A tumour classifier trained on tissue patches from some hospitals scored 93.2 percent average accuracy in distribution and 70.3 percent on a different hospital. A wildlife classifier evaluated on camera traps it had never seen dropped from 47.0 to 31.0 macro F1.

    Barbedo's 2018 study of the factors that shape deep learning for plant disease recognition made the domain-specific version of the point two years before Geirhos: the positive results being reported, its abstract says, "hide some issues that are seldom taken into account in the respective experiments."

    How to test a vision classifier for shortcuts

    None of the checks below requires a new architecture. They are evaluation design, and each one maps to something the plant-disease literature already demonstrated.

    Audit what else varies with the label

    Before training, tabulate the capture metadata by class: device, date, site, operator, lighting, background. If any of it lines up with the label, the model will find it. Noyan's recommendation is the one from experimental design: identify the noise factors before collecting data and either control them or randomise them across classes. When the data already exists, the audit at least says which shortcuts are available.

    Run a baseline that cannot see the object

    Train a simple model on inputs with the object removed: border pixels, a background-only crop, a blur score, file size, image dimensions. Geirhos and colleagues call this testing surprisingly strong baselines. The expected result is chance. Anything well above chance is a measured lower bound on how much of the headline score is available without looking at the subject. The eight-pixel experiment needed nothing more than a default random forest, which makes this the cheapest check on the list.

    A blind baseline at chance does not clear the model. Noyan's blur result shows that capture signal lives inside the foreground too, so the baseline can only detect a leak. It cannot certify the absence of one.

    Hold out a whole source, not random rows

    Split by the unit that will change at deployment: capture session, site, device, hospital, farm, camera. WILDS formalises this as domain generalisation, where training and test domains are disjoint. A random split answers the i.i.d. question. A grouped split starts to answer the deployment question. The same logic applies below the source level. When one photograph yields several crops, as with the 9,216 leaves cut from PlantDoc's 2,598 images, I would keep every crop from a photograph on the same side of the split.

    Collect a small in-the-wild test set that matches the use case

    Noyan calls this the most critical step: a separate dataset that matches the use case, with performance reported on it. It does not need to be large to be informative. Mohanty and colleagues changed the reading of their own paper with 240 images. A set that small will not give tight estimates, and the write-up should say how many images it holds and where they came from. Its job is to show whether the gap is five points or sixty.

    Inspect saliency maps, and test the method first

    Saliency maps are the usual next step, and they deserve more suspicion than they get. In "Sanity Checks for Saliency Maps" (NeurIPS 2018), Adebayo and colleagues randomised a trained model's weights, and separately retrained it on shuffled labels, then checked whether each method's maps changed. Gradients and GradCAM passed. Guided Backprop and Guided GradCAM did not: their maps stayed largely the same when the higher layers were randomised, and resembled the output of an edge detector, which needs neither a model nor training data. The authors' conclusion is blunt: "visual inspection is a poor guide in judging whether an explanation is sensitive to the underlying model and data."

    For a leaf classifier that leaves three limits. First, a method that fails the randomisation tests will outline the leaf whatever the network learned. Second, a method that passes still shows where the model is sensitive, not which property of that region it uses. If capture conditions tint or blur the leaf itself, a heat map centred on the leaf is consistent with a model reading the disease and with a model reading the camera. Third, a handful of well-chosen examples is not a sample. The PlantDoc paper shows saliency maps for two images as evidence that the network attends to lesions. That is a reasonable illustration and a weak test.

    Saliency is most useful as a way to find failures: a map that lights up the border, a ruler, a watermark, or a label is strong evidence of a shortcut. A map that looks right is weak evidence of its absence.

    What an honest evaluation report looks like

    Putting those checks together, a report on an image classifier that I would trust contains five things:

    • The in-distribution score, with the split unit named (random image, session, site, device).
    • The score on at least one held-out source, and the gap between the two.
    • The blind-baseline score next to the chance rate.
    • A description of the outside test set: size, origin, who labelled it, and known label noise.
    • A plain statement of what the numbers do not establish.

    The last item costs nothing and is the one most often missing. Mohanty and colleagues included it in 2016. The number misleads only when the 99.35 travels and the 31 stays behind.

    The same standard applies to small projects. The PlantDoc disease classification project on this site is an academic model, an attention-augmented ResNet18 inspected with confusion matrices and GradCAM examples, and its limitations section says what its metrics cannot claim: dataset performance does not establish field accuracy on unfamiliar plants, lighting conditions, or cameras, and it is not a validated agricultural diagnostic product. That sentence belongs next to any benchmark accuracy for a model that has not been tested on a held-out source.

    The principle carries beyond vision. Scoring a system against conditions it will meet, and against observable outcomes instead of a flattering proxy, is the same discipline covered for tool-using agents in how to evaluate production AI agents.

    The number is conditional on the dataset

    A test-set accuracy is a statement about a model and a data distribution together. On PlantVillage, the distribution included one camera, a grey backdrop, and class-specific capture conditions strong enough that eight border pixels recover the label about half the time. On photos from anywhere else, the measured accuracy of models trained there has ranged from about 15 to 40 percent.

    The practical habit is to ask of any reported score what it is conditional on, and then change that condition on purpose. Hold out a source. Blind the model to the object. Collect a few hundred images from the place the system will be used. If the number survives, it means something. If it falls by two thirds, it is better to learn that from a test set than from a field.

    References

    1. Mohanty SP, Hughes DP, Salathé M. "Using Deep Learning for Image-Based Plant Disease Detection." Frontiers in Plant Science 7:1419, 22 September 2016.
    2. Hughes DP, Salathé M. "An open access repository of images on plant health to enable the development of mobile disease diagnostics." arXiv:1511.08060, November 2015.
    3. Singh D, Jain N, Jain P, Kayal P, Kumawat S, Batra N. "PlantDoc: A Dataset for Visual Plant Disease Detection." CoDS-COMAD 2020, Hyderabad, 5–7 January 2020. arXiv:1911.10317.
    4. Noyan MA. "Uncovering bias in the PlantVillage dataset." arXiv:2206.04374, June 2022.
    5. Geirhos R, Jacobsen J-H, Michaelis C, Zemel R, Brendel W, Bethge M, Wichmann FA. "Shortcut Learning in Deep Neural Networks." Nature Machine Intelligence, 2020. arXiv:2004.07780.
    6. Koh PW, Sagawa S, Marklund H, et al. "WILDS: A Benchmark of in-the-Wild Distribution Shifts." Proceedings of the 38th International Conference on Machine Learning (ICML), PMLR 139, 2021.
    7. Adebayo J, Gilmer J, Muelly M, Goodfellow I, Hardt M, Kim B. "Sanity Checks for Saliency Maps." Advances in Neural Information Processing Systems 31 (NeurIPS 2018).
    8. Barbedo JGA. "Factors influencing the use of deep learning for plant disease recognition." Biosystems Engineering 172:84–91, 2018.
    Previous PostWhy Sepsis Prediction Models Fail External Validation
    Next PostOpenTelemetry GenAI: A Reproducible Agent Trace
    With focus in the article, press J for previous post or K for next post

    Share this article

    Post Share

    Related writing.

    • Artificial Intelligence

      Teacher-Forced Accuracy Is Not a Generation Score: Exposure Bias and the Two-Number Report

      Teacher-forced accuracy overstates what a sequence model can do, because at inference the model reads its own outputs. Report free-running decode with whole-sequence metrics, and treat the gap between the two numbers as a diagnostic.

      Jeremy Cleland
    • Artificial Intelligence

      Why Sepsis Prediction Models Fail External Validation

      Sepsis prediction models look strong in development and weaker at the bedside for structural reasons: labels that encode clinician behavior, late predictions, metrics that hide alert burden, and site shift.

      Jeremy Cleland
    • Artificial Intelligence

      Approval Fatigue: An Approve Button Is Not AI Agent Oversight

      An approve button in front of an AI agent is not oversight on its own. Approval fatigue turns it into a rubber stamp unless the action is bounded, the reviewer sees the evidence and blast radius, and the result is verified afterwards.

      Jeremy Cleland
    View all articles

    Let’s connect

    Useful AI starts with
    a real problem.

    Based in Michigan. Connect about agentic AI, software engineering, and the people using what we build.

    Get in touch