Convolutional neural networks (CNNs) are typically evaluated using held-out classification accuracy, an approach that presupposes predictions are based primarily on the intended object of interest rather than incidental surrounding context. We test this assumption in CNN-based agricultural image classification by comparing model performance on original images with performance on background-dominated patches extracted from the same images across eight publicly available agricultural benchmark datasets and four widely used CNN architectures. Background-dominated patches were classified above dataset-specific random chance for six of the eight datasets, and substantially above chance for four of them, indicating that contextual information contributes to model predictions for the majority of datasets evaluated. For these four datasets, we further evaluated whether this behavior reflected genuine class-discriminative information or was primarily attributable to class imbalance using macro-averaged precision, recall, and F1 together with class-balanced test subsets. The results show that contextual reliance does not admit a single explanation: class imbalance accounts for a substantial portion of the observed signal for some datasets and architectures, whereas above-chance contextual classification persists after balancing for others. Together with previous evidence from curated object recognition and cancer pathology imaging, these findings support the growing view that contextual bias is a recurring characteristic of CNN-based image classification rather than a phenomenon confined to a single application domain. More broadly, this work provides a systematic framework for quantifying contextual bias across heterogeneous image datasets by combining dataset-specific random-chance baselines, contextual bias categorization, macro-averaged evaluation, and class-balanced robustness analysis.
Figures & tables
Figure 1: Illustration of the patch extraction procedure using an image from PlantVillage. Five 20×20 pixel regions are extracted from the top-left, top-right, center, bottom-left, and bottom-right locations. Each patch retains the label of the original image and is evaluated using a CNN trained on full-content images.
Figure 2: Examples of original images and corresponding 20×20 patches extracted from five spatial locations across six datasets. The patches retain background textures, acquisition characteristics, and, in some cases, limited foreground content.
Dataset
Task
# Images
# Classes
Acquisition setting
PlantVillage
Disease classification
54,000
15
Controlled
PlantDoc
Disease classification
2,569
27
Field
DeepWeeds
Species classification
17,509
9
Field
Cassava
Disease classification
21,397
5
Field
WeedCrop
Crop/weed classification
2,822
2
Field
Oxford 102
Species classification
8,189
102
Natural/uncontrolled
Table 1: Summary of the agricultural and plant-related image datasets used in the evaluation. Image counts correspond to the dataset versions used in the experiments.
Figure 3: Original-image and patch-based classification accuracy for the four datasets exhibiting the strongest contextual reliance: OpenSprayer, WeedCrop, Cassava, and DeepWeeds (clockwise from top-left). Each panel reports accuracy for the original test set and for patches extracted from the top-left, top-right, center, bottom-left, and bottom-right image regions, across all four CNN architectures.
Figure 4: Original-image and patch-based classification accuracy for the four datasets showing weaker contextual reliance, evaluated across all four CNN architectures and five patch locations. Datasets are grouped by the contextual bias category assigned in Section 4.2 : moderate (top) and low (bottom).
Dataset
# Classes
Random Chance
Mean Original
Patch Acc. Range
Mean Patch
Margin
Category
WeedCrop
2
50.0%
92.2%
85.6–92.4%
91.1%
41.1 pp
High
DeepWeed
9
11.1%
68.1%
51.3–55.0%
51.7%
40.6 pp
High
OpenSprayer
2
50.0%
93.4%
58.4–80.6%
70.2%
20.2 pp
High
Cassava
5
20.0%
71.3%
16.0–55.8%
33.6%
13.6 pp
High
Sugarcane
11
9.1%
77.5%
11.4–22.8%
16.9%
7.8 pp
Moderate
PlantVillage
15
6.7%
87.5%
9.1–19.1%
12.9%
6.2 pp
Moderate
Table 2: Summary of original-image and patch-based classification performance across the eight evaluated datasets. For each dataset, the table reports the number of classes, dataset-specific random-chance accuracy, mean original-image accuracy, the range and mean of patch accuracy across four CNN architectures and five spatial locations, the resulting margin above chance, and the corresponding contextual bias category (High, Moderate, or Low), as defined in Section 3.4.2 .
Figure 5: Performance of the four CNN architectures on the WeedCrop dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Figure 6: Performance of the four CNN architectures on the DeepWeeds dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Figure 7: Performance of the four CNN architectures on the OpenSprayer dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Figure 8: Performance of the four CNN architectures on the Cassava dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Dataset
Accuracy %
Precision %
Recall %
F1 %
WeedCrop
50.0
50.0
50.0
38.7
DeepWeeds
11.1
11.1
11.2
09.0
OpenSprayer
49.8
50.1
50.2
44.8
Cassava
20.0
19.8
19.7
16.1
Table 3: Random-prediction baselines for the high-contextual-bias datasets. Values correspond to the mean of 20 independent random-prediction trials and provide reference performance for the macro-averaged evaluation metrics.
Figure 9: Performance of the four CNN architectures on the WeedCrop dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Figure 10: Performance of the four CNN architectures on the DeepWeeds dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Figure 11: Performance of the four CNN architectures on the OpenSprayer dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Figure 12: Performance of the four CNN architectures on the Cassava dataset. Classification accuracy (top left), macro-averaged F1 score (top right), macro-averaged precision (bottom left), and macro-averaged recall (bottom right) are reported for the original test images and the five background-dominated patch locations (top-left, top-right, center, bottom-left, and bottom-right).
Convolutional Neural Networks have shown promising effectiveness in identifying different types of cancer from radiographs. However, the opaque nature of CNNs makes it difficult to fully understand the way they operate, limiting their assessment to empirical evaluation. Here we study the soundness of the standard practices by which CNNs are evaluated for the purpose of cancer pathology. Thirteen highly used cancer benchmark datasets were analyzed, using four common CNN architectures and different types of cancer, such as melanoma, carcinoma, colorectal cancer, and lung cancer. We compared the accuracy of each model with that of datasets made of cropped segments from the background of the original images that do not contain clinically relevant content. Because the rendered datasets contain no clinical information, the null hypothesis is that the CNNs should provide mere chance-based accuracy when classifying these datasets. The results show that the CNN models provided high accuracy when using the cropped segments, sometimes as high as 93%, even though they lacked biomedical information. These results show that some CNN architectures are more sensitive to bias than others. The analysis shows that the common practices of machine learning evaluation might lead to unreliable results when applied to cancer pathology. These biases are very difficult to identify, and might mislead researchers as they use available benchmark datasets to test the efficacy of CNN methods.
Michael Okonoda, Eder Martinez, Abhilekha Dalal +1
Department of Computer Science, Kansas State University, Manhattan, KS 66506, USA
Cross-dataset transfer in rice leaf disease classification remains a significant challenge, with models trained on one image collection performing substantially worse when deployed on another. We conduct a systematic benchmark across three Bangladeshi rice leaf disease datasets (5,419 images, 6 transfer pairs, 3 CNN backbones, 3 random seeds) to characterize and diagnose this failure. Strong augmentation recovers a mean cross-dataset macro-F1 improvement of +0.070 (Wilcoxon p < 0.001, 15 of 18 transfer pairs positive). Removing non-leaf image content via segmentation shows directional benefit (mean +0.066, p = 0.062, n = 36 paired observations) that is consistent across two independent segmentation methods but does not reach conventional significance. A self-supervised ViT control (DINOv2 linear probe) exhibits equivalent cross-dataset collapse to CNNs, ruling out architecture inductive bias as the primary driver and pointing to acquisition-condition shift. Adaptive batch normalization uniformly harms transfer performance, with harm magnitude correlating with source-target label-prior divergence and model depth (Spearman rho = 0.621, p = 0.009). Grad-CAM attribution analysis on 12 sampled predictions does not distinguish correct from incorrect cross-domain predictions (p = 0.462), indicating that common attribution proxies are insufficient for diagnosing shift at practical sample sizes. We document all frozen results, prespecified analysis criteria, and reproducibility artifacts in a public repository with SHA-256 integrity verification. This work establishes a rigorous empirical baseline for understanding cross-dataset generalization in agricultural computer vision and identifies both effective (augmentation) and ineffective (AdaBN) adaptation strategies.
Anindya Paul
Department of Computer Science and Engineering BRAC University, Dhaka, Bangladesh
Recent advances in attention-based deep learning have motivated their adoption for remote sensing image classification; however, their benefits for cryospheric imagery, where surface states are dominated by fine-grained textures and class imbalance, remain unclear. In this work, we revisit a benchmark Greenland Ice Sheet image dataset, previously shown to favor convolutional neural networks (CNNs), to examine whether modern attention-based and hybrid architectures improve class-wise reliability. We conduct a controlled comparison between a classical CNN (AlexNet), a modern CNN (ConvNeXt-Tiny), a pure attention-based model (Swin-Tiny), and a hybrid convolution-attention model (CoAtNet-0) under identical training and evaluation protocols. Results show that AlexNet achieves the highest accuracy and the strongest balanced performance as measured by macro-averaged F1, while ConvNeXt-Tiny exhibits the highest macro-averaged AUC, indicating strong class separability but less consistent final decision quality. Class-wise analysis reveals that hybrid architectures improve recall for rare and structurally distinct surface classes, whereas convolutional models remain more reliable for texture-dominated categories. These findings highlight the importance of aligning architectural inductive bias with cryospheric data characteristics and suggest that increased model complexity does not necessarily translate to improved reliability for ice-sheet surface classification.
Chhaya Kulkarni, Emam Hossain
Department of Computer and Information Sciences Towson University · Department of Information Systems University of Maryland, Baltimore County