EfficientNet-CBAM-prototype: an attention-guided EfficientNet framework with dynamic prototype representation for tomato disease classification
In the field of precision agriculture, one of the major hurdles is the early and accurate identification of plant diseases. Farmers may face serious irreversible loss in yield if there is a delay in diagnosis by even a few days. The CNN model has helped in improving the classification of plant diseases but faces difficulty in distinguishing fine-grained symptoms, has limited generalizability, and is not easily interpretable. Though the deep CNN model performs well in classifying plant diseases, the current methods have several flaws. Most importantly, existing algorithms misclassify visually complex samples due to their limited spatial differentiation of disease-specific morphological features, including lesion borders and necrotic regions. Classification reliability is further compromised by low inter-class embedding separability for visually comparable illness phenotypes. Apart from these representational problems, training instability is still a major problem for attention-based models. Combining randomly initialized attention modules with pretrained backbone networks causes this instability, which still limits practical application. We suggest EfficientNet-CBAM-Prototype (ECP-Net), a unique end-to-end deep learning architecture, to overcome these constraints. Three complementary techniques are combined into a single framework by ECP-Net. First, parameter-efficient multi-scale feature extraction is done using an EfficientNetB0 backbone. Second, joint channel-wise and spatial feature recalibration is performed using a stabilized convolutional block attention module (CBAM). Third, a dynamic prototype memory layer uses cosine similarity-based categorization and exponential moving average (EMA) updates to maintain class-representative embedding vectors. To overcome the instability caused by randomly initialized attention weights, we further propose a two-phase training strategy wherein CBAM is frozen during phase 1 to allow prototype stabilization and then jointly fine-tuned with the learning rate in phase 2. Evaluated on the PlantVillage tomato subset comprising 10 disease classes across a class-balanced split of 10,000 training, 500 validation, and 500 test samples, ECP-Net achieves 98.6% test accuracy, 98.59% F1-score, and 98.65% precision with only 4.80M parameters and 85.04 ms average inference time. These results outperformed baselines including VGG16 (97.00%), ResNet50 (81.20%), MobileNetV2 (81.20%), and CNN (70.00%). Generalization is further validated on 35 real-field tomato leaf images captured under natural, uncontrolled conditions, confirming practical deployment potential.