Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 May 31;16:24830. doi: 10.1038/s41598-026-53453-z

HAMNet: Hierarchical Multi-scale Attention Network for precise disease detection in pearl millet using spatial fusion

S Ramya 1,✉, D Pradeep 2
PMCID: PMC13458237  PMID: 42219448

Abstract

Pearl millet is a vital crop in arid and semi-arid regions, but its productivity is significantly impacted by fungal and bacterial diseases. Traditional disease detection methods, including manual inspection and conventional machine learning techniques, often suffer from inefficiencies due to subjectivity, time consumption, and limited feature extraction capabilities. Deep learning-based segmentation models such as U-Net, SegNet, DeepLabV3, and FCN have been employed to automate disease identification, but they exhibit limitations in accurately localizing disease-affected regions, handling complex spatial patterns, and maintaining high segmentation precision. To address these challenges, this study proposes HAMNet-Mask R-CNN, an AI-powered hierarchical multi-scale attention network integrated with a spectral-spatial fusion module for precise pearl millet disease detection. The novel framework enhances disease localization by utilizing hierarchical multi-scale feature learning, where low, mid, and high-level features contribute to superior classification accuracy. The attention mechanism prioritizes critical disease regions, reducing false positives, while Mask R-CNN enables pixel-wise segmentation, refining disease boundary identification. The proposed model is implemented using Python and TensorFlow with high-resolution image datasets. Performance evaluation demonstrates HAMNet-Mask R-CNN achieving a 99.35% Dice score, 98.80% IoU, 99.75% Precision, 99.78% Recall, and 99.65% Accuracy, outperforming U-Net (95.03% Dice, 90.53% IoU), SegNet (94.58% Dice, 89.73% IoU), DeepLabV3 (98.31% Dice, 96.69% IoU) and FCN(98.47% Dice score, 97.00% IoU). The results confirm the model’s superiority in disease segmentation and classification, offering a robust and scalable solution for real-time disease monitoring in smart agriculture. The integration of hierarchical attention and spectral-spatial fusion significantly enhances detection accuracy, ensuring reliable disease identification and contributing to improved agricultural productivity.

Keywords: Pearl millet, Hierarchical Multi-Scale Attention Network, Disease detection, Adaptive mechanism, Segmentation

Subject terms: Computational biology and bioinformatics, Engineering, Mathematics and computing

Introduction

Pearl millet (Pennisetum glaucum) functions as a vital staple food plant throughout arid and semi-arid zones of Africa and Asia supplying essential sustenance for these areas1. The resistance of pearl millet to dry conditions does not protect it from serious disease threats that include downy mildew (Sclerospora graminicola), blast (Pyricularia grisea), and rust (Puccinia substriata)2. The diseases inflict yield reductions between 15% and 70% which leads to major financial losses for farmers. The newly appearing stem rot pathogen Klebsiella aerogenes threatens pearl millet production because it has been recorded with a severity level of 23.8% in India3. Visual inspection remains the standard method for disease detection but has proven ineffective experts disease cases at a rate between 30–40%4. The excessive spread of these pathogens gets worse because of climate change which makes both early identification and precise diagnosis urgently needed5. The fungal diseases rust and downy mildew afflict pearl millet in a harmful way that leads to severe yield reductions6. Rust infection occurs because of Puccinia substriata while it produces reddish-brown pustules that form on plant leaves and stems7. Each pustule of this fungal disease contains spores that fly easily through the air to infect new plants adjacent to the infected ones. The disease causes early leaf death and dims the plant’s photosynthetic functions which results in shortness of the plant structure and reduced harvest quantities8.

The infection from Downy mildew fungus Sclerospora graminicola begins with chlorotic streaks on leaves that transform into white or gray fungal growth when humid conditions prevail9,10. Panicles infected by systemic agents become deformed which causes infertility to negatively affect yield production. The infection of seedlings becomes severe because necrotic lesions appear on them in just several days11. The diseases need to be addressed promptly because their growth occurs optimally when temperatures are warm and moisture is high12. The practical utilization of automated disease detection technology through deep learning and IoT-enabled sensors remains restricted because of ecological factors and variations in lesion dimensions along with multiple disease interferences13. AI diagnostic tools gain lower levels of acceptance from farmers because of inherent challenges with AI explainability. Precise disease detection technologies for pearl millet need immediate development because they need to work effectively under all field environments while gaining acceptance from farmers14.

Recent innovation and its limits

The development of deep learning technology has substantially advanced the management of pearl millet diseases yet it presents several performance constraints. CNN models showed a wide acceptance for disease classification because they reached 98.08% accuracy when detecting blast or rust in controlled environments15. The detection models maintain a low accuracy in actual field conditions because environmental factors including occlusions and dust along with changing light conditions interfere with their performance13. The high price of IoT hardware prevents it from reaching small-scale farmers who need it. Genetic markers which include QTLs for blast resistance located in LG4 and LG7 identify resistant strains yet they do not provide immediate diagnostic capabilities16. Grad-CAM visualizations from deep learning models pinpoint irrelevant leaf vein regions instead of lesion boundaries which leads farmers to question their trust and adoption of the technology17.

Problem statement

Millet crops which serve as food staples in hot and dry regions struggle against growing infections caused by leaf blast and rust alongside downy mildew18. The current strategy for disease detection through manual visual assessment proves to be slow and both imprecise and unavailable for use by small-scale farmers19. The success of deep learning and IoT-based approaches depends on solving the ongoing problems with widespread disease detection across different environments and achieving effective model generalization as well as affordable expansion of their capabilities20. This research develops an AI-based detection system that combines adaptability with scalability and explainable features to detect millet disease early while maintaining accuracy and accessibility for minimal farmers5.

Research motivation

The important food grain crop pearl millet faces severe yield reductions from diseases including rust, blast, and downy mildew particularly in dry areas. Current disease detection systems use manual inspection for detection yet this process proves slow and demanding with human error possibilities. The available automated detection systems operate with limited accuracy when environmental complexity arises. The research aims to develop a precise disease detection method that unites Spatial Fusion with Hierarchical Multi-Scale Attention technology to reduce yield losses through improved disease detection accuracy.

Research significance

HAMNet uses Hierarchical Multi-Scale Attention mechanisms to identify diseases at granular levels together with Spatial Fusion to understand disease context leading to precise pearl millet disease detection. The research plays a significant role because it increases the early disease detection accuracy which leads to decreased crop losses as well as supports precision agriculture practices. The study creates an efficient automated AI-based approach that sustains agricultural practices thus allowing farmers access to successful proactive disease management which improves both food security and economic stability.

Key contribution

  • A novel Hierarchical Multi-Scale Attention Network designed for precise disease detection in pearl millet by integrating adaptive attention and spatial fusion mechanisms.

  • Utilizes Mask R-CNN to generate segmentation masks, enabling pixel-wise classification of diseased regions, ensuring accurate disease boundary identification.

  • Hierarchical Multi-Scale feature learning captures disease patterns at multiple levels to enhance disease identification accuracy by preserving fine-grained details.

  • Adaptive Attention Mechanism a dynamic weighting approach that prioritizes disease-affected regions, reducing false positives and improving computational efficiency without increasing model complexity.

  • Spatial Fusion merges disease-related features across different hierarchical levels, refining disease boundaries and improving segmentation accuracy for better classification.

The paper is organized as follows: Sect. “Introduction” introduces the research problem, motivation and significance. In Sect. “Related works”, related works on disease detection are discussed. Proposed HAMNet Methodology is presented in Sect. "Proposed HAMNET for disease detection in pearl millet usingspatial fusion". In Sect. "Results and discussion", experimental setup, results, and assessment metrics are provides. Section "Conclusion and future scope" concludes with directions for future work.

Related works

Muntaqim et al. (2026) discuss that dual-layer encryption is employed at both the consumer and server levels of this unique Homomorphic Encrypted Federated Learning (HEFL) framework21, which was designed for privacy-preserving agricultural image processing. This enables secure model training, preventing the disclosure of sensitive data at any point during training. The proposed approach effectively maintained model performance equivalent to a unified background while allocating significant data across prediction and reconfiguration attacks, and MobileNetV2 achieved accuracy within the HEFL architecture while maintaining computational power suitable for resource-constrained farming areas.

Zahin Muntaqim et al. (2025) discuss robust disease diagnosis with limited labelled data using FL and FSL to address the problem of cauliflower leaf disease detection with non-identical data distributions22. The dataset was first split into 80% for training and 20% for testing. After that, the training data was divided into five distributed consumers in a non-IID manner. The rate of non-identification was determined by either changes in feature distributions or class label imbalance.

Smrity et al. (2025) state that the dataset shows a moderate class imbalance between healthy and diseased leaves23. Data augmentation techniques, including rotation, flipping, and normalization, were used, especially for minority classes, to reduce bias in model training. Such augmentation techniques assist in increasing sample diversity and enhancing generalization from the model. The test accuracies for datasets 1 and 2 were 99.89% and 99.10%, respectively. Further, the soft voting accuracy of SQL Guard Net for dataset1 was 98.14%, and for dataset 2, 97.46%. Notably, SQL Guard Net achieves an accuracy of 99.12% on the test dataset dataset-3, while its soft voting accuracy was 97.46%.

Muntaqim et al. (2025) provide a centralized test dataset comprising 20% of the original datasets24; it is used to evaluate the reliability of the models after completing the rounds of the federated learning approach. The experimental results demonstrate that the VGG19 model achieves 97.18% accuracy on FedAVG, 98.24% on Fed Prox, and 98.45% on Scaffold, improving the state of the art. Federated learning (FL) is a significant approach to decentralizing machine learning training while preserving data privacy.

The related works about detecting millet diseases together with advances in agriculture are described in Table 1. The monitoring of crops receives enhancement through different methods that combine deep learning with IoT and UAVs alongside spectroscopy. GrabCut and Grad-CAM tools help doctors segment disease areas yet the disease classification operates at high accuracy rates with ResNet-50 and Custom-Net CNN-based models. A combination of IoT technologies with Raspberry Pi allows programmed disease detection in real-time which minimizes expenses related to manual work. Predictions about millet yield variations are made precisely through UAV-powered machine learning systems. The assessment of millet grain nutrients by spectroscopy methods enhances breeding programs and efficiency. The improvements in AI technology continue while obstacles remain such as its restricted environmental application zone and restricted datasets and computing needs. Future studies need to enhance model resilience and cut down training duration while simultaneously making disease monitoring more effective across different weather conditions to develop affordable expansive solutions.

Table 1.

Literature review.

Reference Method Findings Demerits
Naik et al.,(2025)25 ResNet-50, GrabCut with Masking Achieved 94% accuracy in millet disease recognition. Limited adaptability across diverse environmental conditions.
Mishra et al.,(2023)26 Customized CNN, Raspberry Pi, Cloud Server Customized-CNN reached 98.8% accuracy, 98.2% precision, and 97.7% F-score for millet disease detection. Requires 67 s for training and 88 s for testing, limiting real-time efficiency.
Kundu et al.,(2021)27 IoT and Deep Learning (Automatic and Intelligent Data Collector, Custom-Net model) Achieved 98.78% accuracy with 86.67% reduction in training time. Deployment may be challenging in resource-limited areas.
Yadav et al.,(2025)5 Near-Infrared Spectroscopy (MPLS Regression, standard normal variate, detrending techniques) High predictive accuracy (0.969–0.993 R²) in nutrient estimation for biofortification programs. Minor variations in predictive precision across different nutrients.
Tiwari et al.,(2025)20 IoT-based Multimodal Data Acquisition (RGB & Infrared Cameras, P-CNN, Bayesian Inference) High disease classification accuracy with refined disease severity estimation. Increased computational requirements due to multimodal image processing.
Mansour Diene et al.,(2024)28 UAV-based machine learning (Gradient Boosting Machine, vegetation indices) Achieved 78% yield variability explanation with 16 g/m² RMSE. Effective yield prediction using UAV data. Limited applicability in fields without UAV infrastructure.
Singh et al.,(2023)29 ANN, Image Segmentation Achieved 97.25% training accuracy and 96.88% testing accuracy in millet disease detection. Faces challenges with small datasets, requiring dataset expansion for better generalization.
Johnson et al.,(2024)30 Deep Millet, CNN model Deep Millet reached 98.86% accuracy in pearl millet disease detection, outperforming ResNet-50 and VGG19. Requires field image datasets for effective training, making it data-dependent.
Divya et al.,(2024)31 SANDNES model, Edge Supervision Achieved F1 score of 89.04% for millet disease diagnosis, with 94.88% accuracy for healthy crops. Computationally intensive due to high-resolution aerial imaging.
Hadimani et al.,(2023)32 Fungal Effector Protein Analysis (35983 g protein, PAL, POX activity) Identified effector protein as a biomarker for downy mildew resistance in pearl millet. Limited generalizability to other fungal diseases beyond downy mildew.

Proposed HAMNET for disease detection in pearl millet using spatial fusion

The proposed HAMNet with Adaptive Attention Mechanism methodology functions to detect diseases precisely in pearl millet through spatial fusion methods is shown in Fig. 1. The methodology starts with obtaining high-resolution images of healthy and diseased pearl millet leaves from agricultural research databases combined with data collected in fields. The images go through normalization processes and receive augmentation through techniques that include rotation and flipping for better model robustness. Disease localization happens in the annotation and labeling stage where bounding box annotations plus Mask R-CNN segmentation masks are used to achieve pixel-wise classification which improves disease localization accuracy. Feature Learning uses Hierarchical Multi-Scale to extract disease characteristics from three different levels which examine leaf texture along with color variations at a low level followed by disease spread pattern detection at mid-level and complete disease-affected region examination at a high level. The Adaptive Attention Mechanism determines dynamic weight distribution towards disease-infected areas thus minimizing processor effort on healthy parts. The model balances greater accuracy in disease mapping through its algorithm for computing feature importance scores and attention weighting function which depends on risk assessment. These procedures help improve detection while requiring minimal additional computational power. The Spatial Fusion Module uses multi-scale features for boundary refinement which minimizes false detection signals. The model conducts disease classification through fully connected layers which use softmax activation for results validation. The particular hyperparameters, including learning rate, batch size, and architectural outlines, were determined analytically through initial experiments to stability detection accuracy, convergence stability, and computational efficiency. For better clarity, unnecessary descriptions of the methodologies and contributions have been avoided. In addition, to encourage reproducibility and transparency, the data set used in the training will be conduct available to the public upon acceptance.

Fig. 1.

Fig. 1

Proposed framework.

Input data

The dataset features high-resolution leaf images of Pearl Millet37, split into multiple disease categories based on their health condition. Images used in the dataset were obtained from agricultural research datasets, combined with field survey records and expert personnel’s annotations to capture various environmental conditions and disease presentation types. Although the dataset contains a limited number of diseased images, data augmentation and hierarchical multi-scale feature learning were employed to improve the model’s robustness, and still a potential risk of overfitting and dataset bias. The dataset contains both healthy and diseased leaves, with precise annotations to improve detection accuracy14. Table 2 provides details on the dataset’s image counts.

Table 2.

Dataset summary.

Class Image count
Downy Mildew 87
Healthy 103
Rust 149
Disease 236

Data preprocessing

The preprocessing phase involved multiple steps, starting with image size adjustment, followed by normalization and the introduction of data augmentation through rotation and flipping techniques to strengthen model performance.

Normalization

The fundamental images exhibit various brightness and contrast values alongside intensity modifications because of environmental elements and camera performance alongside differences in illumination. Through normalizing all values the model becomes able to concentrate on distinctive disease profiles instead of confusing irrelevant random factors. The normalization process employs a Min-Max scale to distribute image pixel values between Inline graphic for maintaining uniformity throughout images. Mean Normalization uses computed mean and standard deviation values of the dataset for normalization purposes.

graphic file with name d33e600.gif 1

In Eq. (1)  N is the original value, Inline graphicand Inline graphic​ are the minimum and maximum values in the feature column. The value range extends from  0 to  1 through this method while maintaining the original spatial positions between pixels.

Data augmentation

The model must demonstrate excellent generalization characteristics to detect diseases in Pearl Millet when faced with different viewing angles lighting conditions and leaf positioning. The model receives extra data diversity through Data Augmentation to accomplish this objective. The model remains unbiased toward particular orientations because rotation augmentation is applied to leaf images that can be photographed at various angles. The Inline graphic random image rotation keeps disease detection independent from camera angle positions which maintains model performance stability and stops it from focusing on training dataset orientations. Leaf diseases can appear at different locations as well as in different orientations on the leaf so the flipping augmentation allows the model to remain independent of disease symptom positioning. Horizontal flipping mirrors the image along the vertical axis, while vertical flipping mirrors it along the horizontal axis. The technique creates new versions of inputs to improve model variability which leads to position-independent operation.

Mask R-CNN for segmentation

A segmentation ability that identifies diseased regions within Pearl Millet leaves is incorporated into Mask R-CNN which builds on Faster R-CNN to create object detection and segmentation functionality. Despite its ability to track object boxes, the fundamental functionality of Mask R-CNN includes generating object-specific masks that provide extremely precise localization. Through pixel-level disease area segmentation, Mask R-CNN proves itself as an efficient tool for detecting Pearl Millet diseases whereas most object detection tools use bounding boxes. The Mask R-CNN system operates through three sequential stages starting with ResNet-101 + FPN for feature extraction followed by a region proposal network (RPN), then region of interest alignment is shown in Fig. 2.

Fig. 2.

Fig. 2

Mask R-CNN.

a) Feature Extraction Using ResNet-101 + FPN.

The input Pearl Millet leaf image  p is passed through ResNet-101 with Feature Pyramid Network (FPN) to generate multi-scale feature maps is given in Eq. (2):

graphic file with name d33e668.gif 2

The disease-oriented data about leaf textures and spots with their boundary definitions exists within the feature maps.

b) Region Proposal Network.

RPN produces several Regions of Interest (RoI) in which diseased areas could exist. The method provides score assignments without objects to identify areas as either diseased or healthy. For an anchor box  A, the probabilityInline graphic of containing a diseased region is:

graphic file with name d33e688.gif 3

In Eq. (3),  w is the weight matrix,  A means Anchor box features,Inline graphic means bias term, Inline graphic Sigmoid activation function. RPN also predicts bounding box coordinates  (x,y,w,h) using regression and it is given in Eq. (4), where Inline graphicand Inline graphic​ are learnable weights.

graphic file with name d33e729.gif 4

c) Region of Interest Align.

Through RoI Align the proposed regions receive accurate feature extraction since it prevents rounding distortions that occur in RoI Pooling. Bilinear interpolation takes the place of quantization as the processing method. For a feature map  F, the interpolated value at position  (x,y) is computed as in Eq. (5)

graphic file with name d33e750.gif 5

Here Inline graphic represents are bilinear interpolation weights. The extracted RoI features are used for multi-class disease classification and bounding box refinement.

graphic file with name d33e761.gif 6

In Eq. (6),Inline graphic Probability of disease class  k, Inline graphicrefers to raw score from fully connected layer and Inline graphicNumber of disease classes. The Softmax function generates probabilities that sum to one. Bounding Box Regression Formula is given in Eq. (7) and refines box coordinates  (x,y,w,h)

graphic file with name d33e793.gif 7

A fully convolutional network (FCN) generates binary disease forecasts for every RoI. The model shows its capabilities by dividing the disease areas into pixel-based segments. For each pixel  (i,j) in the mask

graphic file with name d33e803.gif 8

In Eq. (8)Inline graphic refers to ground truth disease mask (1 for diseased pixels, 0 for healthy) and Inline graphicPredicted probability of disease at  (i,j). Through its operation R-CNN generates three outcomes consisting of area localization using bounding boxes alongside disease area segmentation through masks and type classification of diseases.

Hierarchical Multi-Scale Attention Network

HAMNet depends on accurate diagnosis through Hierarchical Multi-Scale Feature Extraction because this method enables disease detection by recognizing patterns at various abstraction levels. Through this method the model can study detailed information at various measurement scales which leads to better detection of minor disease indicators while retaining spatial relationships. Three hierarchical levels compose the hierarchical feature extraction mechanism including Low-Level Feature Extraction (Texture & Color Details) and Mid-Level Feature Extraction (Disease Spread Patterns) and High-Level Feature Extraction (Complete Disease Region Identification). The extraction process advances at successive stages to capture small spots of sickness while protecting the overall leaf shape. Through its features extraction process the model reveals subtle information about damaged regions that includes texture modifications and color variations. Biological disease manifestations result in changes in texture between diseased and healthy regions with rust disease causing rough lesions and downy mildew producing fuzzy mold-like structures. Through its learning process the model acquires knowledge about unhealthful green tones that enables it to note subtle early infections without specific disease characteristics. A solid understanding together with pest management requires this information.

graphic file with name d33e828.gif 9

In Eq. (9) Inline graphic represents the low-level feature map,  I(x,y) is the input image intensity at pixel  (x,y),  W(i,j) is the convolutional kernel andInline graphic is the kernel size. The model analyses the spread patterns of diseases over different areas of the leaf by recognizing boundary conditions and evaluating shapes and spread extent. The model detects clean abrupt edges between healthy tissue and diseased regions while correctly differentiating between different disorders such as root infections from yellow striping along leaf veins. Such disease recognition understanding helps both early detection and disease classification which improves complete disease management efficiency.

graphic file with name d33e858.gif 10

In Eq. (10) Inline graphic represents the mid-level feature map,  d is the dilation rate, controlling the spacing of kernel elements. The extraction process through the model detects full diseased regions by applying Mask R-CNN-based segmentation along with spatial fusion to enhance disease boundary detection while minimizing misidentifications from healthy tissues. Precise disease classification and severity estimation becomes possible because of this global disease impact understanding which ensures better disease understanding.

graphic file with name d33e875.gif 11

The disease-important features emerge from the summation process through weights represented by Inline graphic in Eq. (11). In the final phase the model selects the entire diseased areas to perform accurate Mask R-CNN-based segmentation of affected regions. The approach successfully defines disease boundaries and eliminates erroneous positive outcomes through its implementation of spatial fusion for healthy/diseased leaf separation. The classification precision together with the severity measurements improves because of this method. The global disease impact understanding capability of the network results in dependable detection capabilities which enhance agricultural disease control. The combination of hierarchical elements enhances model reliability which makes it perform better in practical usage conditions. All extracted features enter the final stage where the network performs segmentation together with classification of diseased regions. The model enhances its detection accuracy through an approach which uses various scales to analyze information.

graphic file with name d33e888.gif 12

In Eq. (12) Inline graphic are weight factors for different feature levels and Inline graphic​Inline graphic represent low, mid, and high-level features. Different diseases can be recognized when the model combines spread patterns along with color and texture features into a single disease signature. Standard weight beginning performances and subsequently enhanced during the training process through backpropagation to ensure stable convergence and effective feature allowance.

Adaptive attention mechanism

The network performs dynamic focus on disease-prone areas to lower its calculations on healthy parts of the leaf. During operation the network creates Feature Importance Scores to mark dangerous regions on leaves. The model performs channel-wise attention and spatial attention to direct its analysis toward disease-prone areas without wasting time on the complete leaf. This attention scores get computed from self-attention for a feature map F which maintains dimensions Inline graphic, according to Eq. (13), was recognized analytically via pre-experimentations in which the act of the model was estimated to optimize the weighing and accuracy of the segmentation.

graphic file with name d33e920.gif 13

Where,Inline graphic represents the attention weight assigned to pixel Inline graphic and  b are learnable parameters and Inline graphic is the sigmoid function, which scales the scores betweenInline graphic,  1. The algorithm proceeds by normalizing the scores to locate areas containing disease. The model distributes enhanced attention to pixels with disease indications when it performs feature importance analysis and reduces attention to healthy leaf areas. The adaptive attention mask enables this operation. The adaptive attention weights receive their calculation from:

graphic file with name d33e951.gif 14

In Eq. (14), Inline graphic is the attention weight map computed earlierInline graphic is the original feature map before applying attention, and Inline graphic is the attention-weighted feature map (disease-prioritized). The approach increases local disease detection precision and minimizes incorrect disease classification of healthy leaf regions. HAMNet enhances computing efficiency through its ability to shift resources toward high-risk areas while minimizing processing in the healthy territory and achieving faster results with no accuracy compromises. Through its implementation, the system achieves better disease identification along with the removal of false positive results stemming from leaf variations and it runs efficiently while requiring no new hardware additions.

Spatial fusion for disease recognition

Disease boundaries receive enhanced segmentation accuracy through the process of combining information from various hierarchical levels. The spatial fusion layers put together information derived from low, mid and high levels of extraction. The combination of Concatenation and Weighted Fusion methods maintains all important disease patterns within the system. The feature fusion operates according to Eq. (15).

graphic file with name d33e979.gif 15

Here Inline graphic are learnable weights to assign importance to different feature levels and Inline graphic are the extracted multi-scale features. The system performs better disease boundary definition through the combination of features that describe texture characteristics and spread properties and global region elements. The method minimizes incorrect results since it analyses disease information across multiple observational points. Features obtained from fusion processes are subject to spatial attention mechanisms which focus on vital areas for disease segmentation.

graphic file with name d33e993.gif 16

The attention weightInline graphiccombined with Inline graphic features leads to disease-affected region analysis through Eq. (16). A multi-class classification model performs disease categorization on the detected segmented regions. The spatial fusion procedure leads disease features to transform into a feature vector which goes through Fully Connected layers.

graphic file with name d33e1010.gif 17

The final feature vector Inline graphiccontains the disease characteristics as described in Eq. (17). The disease label comes from a softmax classifier that receives the flattened vector  Z.

graphic file with name d33e1027.gif 18

The final probability value Inline graphicdescribes the disease class  k and Inline graphic along with Inline graphicrepresents learnable parameters in Eq. (18). The Softmax operation guarantees that the total probabilities within the calculation sum to  1. The classification depends on disease pattern identifications which can include Rust and Downy Mildew types along with alternative disease categories. Sampling at various levels through adaptive attention provides this system its high disease recognition precision. Figure 3 depicts the working of HAMNET framework.

Fig. 3.

Fig. 3

HAMNET architecture.

Precision disease diagnosis for pearl millet leaves becomes possible through the HAMNet with Adaptive Attention Mechanism because it implements a Hierarchical Multi-Scale Feature Extraction strategy. Traditional models that depend on single features lack the functionality of HAMNet which combines low level and mid level and high level feature extraction to detect disease elements such as texture alterations and color variations with spread pattern analysis thus improving overall localization together with classification precision. The model utilizes Mask R-CNN for segmentation functions that replaces bounding box-based classification methods to achieve more precise disease border recognition. The Adaptive Attention Mechanism serves as an important innovation because it uses a dynamic approach for disease-prone area emphasis but maintains minimal effort on healthy regions. The optimization approach lowers computing efforts and improves diagnostic abilities through leaf infection-based specifications. The integration of spatial fusion methods between different feature scales helps reduce incorrect observations and enhances precision of disease border segmentation. The implementation of data augmentation through rotation and flipping strengthens the model’s resistance to environmental changes which enables it to operate on leaves with varying lighting conditions and orientations. The system improves detection accuracy through its ability to structure disease patterns while using attention mechanism weight features that establish it as a performing quantitative method for agricultural health monitoring systems.

Algorithm 1.

Algorithm 1

HAMNet-based pearl millet disease detection system.

The disease classification in the HAMNet-Based Pearl Millet Disease Detection System is shown through algorithm 1. The initial stage includes preprocessing along with data augmentation through rotation and flipping to improve image quality beyond variability control. The system executes annotation and labelling through both bounding boxes combined with Mask R-CNN to precisely identify disease areas. A Hierarchical Multi-Scale Feature Extraction module extracts multiple levels of features starting from low resolution up to high resolution in order to detect disease patterns. Through the Adaptive Attention Mechanism the model allocates more weight value to diseased parts to enhance its operating efficiency. The Spatial Fusion Layer combines multi-scale features through a process that optimizes disease boundary detection. The disease type classification process utilizes SoftMax to select the most probable diagnosis. The system performs optimal feature analysis to minimize mistakes and maintains both high detection accuracy and computational speed for Pearl Millet disease identification. Data moves around, weight setup, and optimizing processes. Each experiment was carried out 5 times independently, and the final performance metrics reported in this study are the average of these repeated trials. This technique reduces stochastic variation and ensures an accurate assessment of the recommended hierarchical multi-scale attention Mask R-CNN framework for pearl millet disease classification.

Figure 4 shows the flowchart of the proposed framework and system procedure starts with dataset loading of Pearl Millet Leaf images which requires subsequent image preprocessing steps that include resizing and normalization. The process of annotation and labelling uses bounding boxes in combination with Mask R-CNN for disease segmentation. The Hierarchical Multi-Scale Feature Extraction module performs three levels of disease feature extraction beginning from low and progressing to high features. The Adaptive Attention Mask evaluates specific areas affected by diseases. Before performing its first decision the system weighs attention on diseased areas to refine disease boundary identification when diseases exist or mark leaves as healthy when no diseases are present. After SoftMax classification the system executes Decision 2 which outputs the disease type only when the confidence score reaches the threshold else the leaf becomes marked healthy. The system then terminates after classification.

Fig. 4.

Fig. 4

Flowchart.

Results and discussion

A performance evaluation of the proposed HAMNet model for precise disease detection in pearl millet takes place within the results section. This section explores how data preparation and the Mask R-CNN disease detection process contribute to the effectiveness of the hierarchical multi-scale attention mechanism. The segmentation accuracy, classification performance, and computational efficiency prove better in traditional deep learning models than in the proposed HAMNet. The novel developed model demonstrates its ability to accurately diagnose disease while reducing incorrect readings, enabling real-time deployment in precision farming operations. The output validates the relationship between model attention and pathological features by demonstrating that the HAM-Net approach preferentially concentrates on disease-affected leaf regions, such as lesions and colour change regions. This increases accessibility and enhances farmers’ confidence in advanced disease detection. Although Mask R-CNN and attention-based architectures are well-known approaches, their direct relevance to pearl millet disease segmentation is limited by complex lesion structures, environmental variation, and dataset constraints.

Table 3 shows the simulation parameter configuration. The HAMNet and Mask R-CNN simulation tests relied on TensorFlow along with Detectron2 to run Mask R-CNN. Python served as the implementation platform which executed on the Windows 10 operating system. The system hardware consisted of performance components namely an NVIDIA RTX 3090 GPU connected to an Intel Core i9 CPU and 32GB RAM and a 1 TB SSD to accelerate dataset processing during model training. The training process used a batch size of 32 for HAMNet and 16 for Mask R-CNN under 50 epochs. It employed Adam optimization with a 0.0005 learning rate for HAMNet and a 0.001 learning rate for Mask R-CNN. The configuration system produced exceptional computational efficiency which led to perfect deep learning model performance results.

Table 3.

Simulation parameters configuration.

Component Specification
Software Framework TensorFlow
Programming Language Python
Deep Learning Library Detectron2 (for Mask R-CNN)
Operating System Windows 10
GPU NVIDIA RTX 3090
CPU Intel Core i9
RAM 32GB DDR4
Storage 1 TB SSD (for dataset processing & model training)
Batch Size 32 (HAMNet), 16 (Mask R-CNN)
Learning Rate 0.0005 (HAMNet), 0.001 (Mask R-CNN)
Optimizer Adam
Training Epochs 50

All the models (HAMNet-Mask R-CNN, U-Net, SegNet, DeepLabV3 and FCN) were trained 5 times to control the variability which emerged due to the stochastic optimization and random weight first-initiation. The entire reproducibility has been ensured through a controlled random seed strategy: Python (random. seed (42)) NumPy (np. random. seed (42)) and TensorFlow (tf. random. set seed (42)). There were independent runs with a fixed seed (e.g., 42, 52, 62, 72, 82) to achieve the variability between the independent runs, but guarantee reproducibility. The images were trained using high-resolution images of Pearl millet leaves with steady data augmentation, Adam optimizer (learning rate 0.001), batch size of 16 and as many as 50 epochs with early stopping based on validation loss. To provide a powerful impression of the model reliability and statistical significance, it has provided the performance measures (mean, standard deviation and 95% confidence intervals) on the independent runs.

Dataset analysis and findings

High-resolution images of pearl millet leaves form the basis of this dataset that differentiates between disease classes. The detailed distribution assessment ensures equal representation of healthy along with diseased samples. Due to its diverse input data the model achieves better generalization along with accurate detection of multiple pearl millet crop diseases.

The high resolution pearl millet leaf image data set was divided into training, validating and test data to guarantee that no biases were used to judge. In particular, 70% of the pictures were used in training, 15% in validation and 15% in testing. The random sampling was stratified by disease category to ensure all the disease categories in the study were represented proportionally among the subsets. The identical split was applied in all independent training runs, and controlled random seeds were used to ensure reproducibility and reasonable comparison of models.

Figure 5 demonstrates how four disease classes namely Downy Mildew (87 images) and Healthy (103 images) and Rust (149 images) and Disease (236 images) split the image collection. The dataset contains most images under the “Disease” classification and the smallest number belongs to “Downy Mildew.” The dataset includes varying types of samples which ensures appropriate diagnosis capabilities for pearl millet diseases.

Fig. 5.

Fig. 5

Distribution of pearl millet.

Figure 6 contains high-resolution images of healthy pearl millet leaves. The presented images show green uniform coloration and smooth texture with no signs of disease symptoms including discolorations or lesions or fungal growth. The HAMNet model needs the healthy leaf dataset for its training process so it can identify healthy plants from diseased ones.

Fig. 6.

Fig. 6

Healthy pearl millet.

Figure 7 shows pearl millet leaves that have different types of fungal disease developments. The rust infection on two leaves results in reddish-brown pustules produced by “Puccinia substriata”. Downy mildew infections are evident on the third leaf because it displays chlorotic streaks joined with pale discoloration. The fourth picture presents leaf blight along with early senescence which causes the tip of leaves to brown while they curl. Various fungal diseases cause pearl millet to develop distinct visual symptoms which demonstrate the widespread destruction they create against crop health and yield production.

Fig. 7.

Fig. 7

Diseased pearl millet.

Disease segmentation using Mask R-CNN

The advanced deep learning method known as Disease Segmentation Mask R-CNN delivers exact plant disease identification together with their spatial localization. The method joins object detection methods with pixel-wise segmentation to produce exact areas highlighting potential disease infection. The detection method provides advanced plant disease recognition strength which helps monitor illnesses early before delivering precise interventions for agricultural productivity growth.

Figure 8 depicts annotation boundaries along with segmentation boundaries for detecting diseases that affect Pearl Millet leaves. In the first visual row (a) a healthy leaf appears the left image shows a Pearl Millet leaf free of disease symptoms in. A red box marks the display area’s bounding box. This image presents the Mask R-CNN segmentation output, which uses a green color to cover the selected area. While the next (b) the left picture features a rust-infected Pearl Millet leaf which presents brown spots throughout the leaf surface. A red boundary indicates the area of infection. The segmentation mask in the right image distinguishes the targeted affected zone on the diseased area. and (c) contain Rust-infected and Downy Mildew-affected leaves the left image shows, a Pearl Millet leaf with Downy Mildew exhibits chlorotic patches and fungal growth. The diseased elements within the leaf fall inside the red boundary segment. The segmentation mask of the right image shows the diseased portion painted with green color. The original examined images with marked disease areas in boxes occupy the left column and Mask R-CNN generates separate segmentation visualizations that highlight these regions during the right panel viewing.

Fig. 8.

Fig. 8

Segmentation results.

Figure 9 shows the IoU Intersection scores, which illustrates the accuracy of the segmentation masks generated by Mask R-CNN for pearl millet that are in different conditions. The IoU score for healthy leaves has the highest value at 99.1%. Downy Mildew is marked with an IoU of 98.2%, while Rust is found to have an 97.9% score. The “Disease” category gets the combined IoU of 98.5%. These scores are indicative of the very good degree of overlap between the predicted projections and the exact truth masks, pointing out the effective performance of the model in these categories. At the same time, the model most accurately performed the segmentation of healthy leaves.

Fig. 9.

Fig. 9

IoU analysis.

Figure 10 shows IoU accuracy for training and validation over 20 epochs. Both training and validation accuracies are showing improvement and eventually stabilizing and showing value after a few epochs. The training accuracy curve starts lower but it converges quickly, this shows the model learns well. As the distance between the curves is quite small at both, it can be inferred that good generalization is achieved and no overfitting occurs as the model retains constant model performance.

Fig. 10.

Fig. 10

Training and validation of IoU.

Figure 11 presents the Dice Loss which shows the training loss and validation loss in plot over several epochs. In the beginning, both losses are very high, showing that the segmentation is performing poorly. These decreasing losses as training proceeds shows us the model is learning and becoming more accurate. Like the training loss, there is little overfitting in the validation loss curve. As the Dice Loss reduces, the model exhibits more capacity for segmentation, implying a better distinction of the diseased and healthy parts of the plant in the dataset.

Fig. 11.

Fig. 11

Training and validation loss of dice.

To perform a comparative analysis, the paired statistical tests were used to test the significance of performance changes under HAMNet-Mask R-CNN and base models. Particularly, paired t-tests were conducted with the use of per-image Dice and IoU scores through the test set, and the degrees of freedom were equal to. n − 1, where n is the number of test images, and the level of two tailed significance value of 0.05. Secondly, the mean inference time per image was also determined on the same hardware setup and reported ~ 42 ms per high-resolution image with HAMNet-Mask R-CNN, which means that the model is not only highly accurate, but also computationally efficient to implement in smart agriculture in real time.

HAMNet performance

Various performance metrics are shown to assess the efficacy of HAMNet for accurately detecting and segmenting diseases on Pearl Millet. The calculated metrics to measure the accuracy, efficiency, and reliability of the proposed model for both classification and segmentation tasks are shown in Table 4. Intersection over Union (IoU) is a commonly used metric in image segmentation tasks to measure the overlap between the predicted and ground-truth regions. Dice Similarity Coefficient (DSC) measures segmentation accuracy by quantifying spatial overlap between the two sets. Using paired t-tests on performance indicators across several runs, the HAMNet-Mask R-CNN model outperforms recognized baseline approaches (p < 0.05).

Table 4.

Performance metrics.

Metrics Formula
Accuracy Inline graphic
Precision Inline graphic
Recall Inline graphic
Dice Inline graphic
Inline graphic Inline graphic
Inline graphic Inline graphic

Here Inline graphic means true positive, Inline graphic means true negative.  FP refers to false positive.  FN refers to false negative. |A ∪ B| denotes the number of elements of the concatenated set of A and B. A is the set of predicted results, B is the set of proper labels, |A| denotes the number of elements in set A, |B| represents the number of factors in set B, and |A∩B| indicates the number of elements in the intersection of A and B.

The Fig. 12 depicts the performance of Semantic segmentation for three plant disease conditions namely Healthy, Rust, Downy Mildew with Mask R-CNN and HAMNet. Each row is associated with a condition, demonstrating (a) the image, (b) the Mask R-CNN, and (c) the HAMNet output. Mask R-CNN uses bounding boxes and segmentation masks (green) to detect diseased areas, but the segmented areas do often contain background area outside the diseased region. In comparison, HAMNet generates fluid and precisely defined segmentation masks (blue) which lie down more closely to lesion borders, thus lowering false positives. The comparison shows that HAMNet has better segmentation accuracy and can refine the localization of the disease. This indicates that HAMNet can yield more accurate segmentation than Mask R-CNN and thus, if the focus of the detection field is in the area of plant disease detection under precision agriculture. HAMNET refined segmentation masks can lead to better automated disease classification, intervention tactics and yield protection, thereby enhancing agricultural decision-making.

Fig. 12.

Fig. 12

HAMNET performance.

Table 5 shows the performance of the adaptive mechanism. The Adaptive Attention Mechanism greatly improves disease detection by attending to diseased regions more while avoiding computational overload at healthy locations. After deployment, the classification precision increased to 99.7% from 95.1%, the IoU score increased to 98.8%, and the inference time decreased by 23.4%. Moreover, the False Positive and False Negative Rates were reduced, resulting in higher-performing disease segmentation. For high-performance metrics, the results must be properly taken because there is frequently bias in the dataset or environmental variability, which can occur under real-world agricultural conditions, and the data are given as mean ± standard deviation.

Table 5.

Adaptive attention mechanism performance analysis.

Metric Before attention After attention
Classification Accuracy (%) 94.6 99.6
Precision (%) 95.1 99.7
Recall (%) 94.3 99.7
IoU Score (%) 92.5 98.8
Dice Coefficient (%) 93.2 99.3
Inference Time Reduction (%) 25.5 23.4
False Positive Rate (%) 4.8 1.2
False Negative Rate (%) 5.4 0.9

Figure 13 shows the computation efficiency analysis depicts the efficiency metrics of HAMNet-Mask R-CNN, including inference time (ms), model parameters (M), and FLOPs (G) The model names are in the x-axis and the computational values are in the y-axis. This figure highlights that the efficiency of HAMNet-Mask R-CNN is superior and receives the best detection performance with the optimized computational cost. HAMNet outperforms existing deep learning approach, achieving a significant reduction in inference time and FLOPs while maintaining high segmentation accuracy, making it a practical model for real-time disease detection in pearl millet.

Fig. 13.

Fig. 13

Computational efficiency.

To assess the practical calculation feasibility of our proposed HAMNet–Mask R-CNN, we measured its computational complexity in terms of floating-point operations (FLOPs), model parameters, and inference time. The model is also efficient in terms of FLOPs and computation, even though it includes hierarchical multi-scale attention and spatial fusion components, and achieves competitive computational performance compared to baseline segmentation networks like U-Net, SegNet, DeepLabV3, and FCN. In summary, experimental findings show that HAMNet has achieved improved semantic segmentation exactness at minimal computational cost, making it a viable option for real-time monitoring of agricultural diseases.

Table 6 shows the proposed method performance: Evaluation metric for HAMNET-Mask R-CNN model. The model promotes high accuracy (99.65%), Dice coefficient (99.35%) and IoU (98.80%) which shows its segmentation performance. With the precision (99.75%) and recall (99.78%), the model provides almost no false positives and false negatives. The low loss (1.45%) indicates a successful learning process.

Table 6.

Proposed method performance.

Method Indicators (%)
Loss Dice IoU Precision Recall Accuracy
Proposed HAMNET-Mask R-CNN 1.45 99.35 98.80 99.75 99.78 99.65

Figure 14 shows the Comparison to U-Net, SegNet, DeepLabV3, and FCN, is an analysis of segmentation performance between the Proposed HAMNet-Mask R-CNN and existing deep learning models. The metrics used to evaluate performance are the following segmentation metrics: the Dice coefficient, the Intersection over Union (IoU), the Precision, the Recall, and the Accuracy. The best results for all metrics were found to be achieved by HAMNet-Mask R-CNN with 99.35% Dice 98.80% IoU 99.75% Precision 99.78% Recall, and 99.65% Accuracy (extremely high with a 100% scale), indicating that this segmentation algorithm outperforms the others. The U-Net and SegNet models show bad results, showing low values for the dice and IoU scores, compared to other models where it significantly outperforms. HAMNet outperforms FCN and DeepLabV3. This demonstrates the robustness of HAMNet-Mask R-CNN in accurately segmenting disease. HAMNet achieves higher scores than conventional methods across IoU, Dice, Accuracy, and overall performance in existing disease segmentation models. With lower loss, higher Dice score, higher IoU, higher precision, higher recall, and higher accuracy, its performance in disease segmentation outperforms existing methods. Given the small dataset size (575 images), potential overfitting was reduced through data augmentation, normalization methods, and proper validation processes to improve inference capability; however, further analysis on larger field datasets is needed for thorough assurance. Data enhancing, formalization methods, and validation methodologies were used to increase model generalization, although more testing on larger and more varied datasets is essential for complete validation.

Fig. 14.

Fig. 14

Proposed model performance.

As shown in Table 7 performance comparison, the performance of the proposed HAMNET-Mask R-CNN algorithm is compared with the segmentation algorithms U-Net, SegNet, DeepLabV3, and FCN. The proposed model significantly outperforms the other models as evidenced by the highest Dice (99.35%), IoU (98.80%), Precision (99.75%), Recall (99.78%), and Accuracy (99.65%) values. Though FCN and DeepLabV3 provide competitive results, they gave rise to inferior segmentation performance, resulting in superior recall and precision for HAMNET-Mask R-CNN. The Segmentation accuracy is comparatively low among U-Net and SegNet as observed by their lower IoU values as compared to the proposed model.

Table 7.

Performance comparison.

Method Indicators (%)
Dice IoU Precision Recall Accuracy
Proposed HAMNET-Mask R-CNN 99.35 98.80 99.75 99.78 99.65
U-net (X. Liu et al., 2021)33 95.03 90.53 97.29 98.85 99.21
SegNet (Xing et al., 2022)34 94.58 89.73 97.22 98.76 99.15
DeepLabV3 (Divyanth et al., 2023)35 98.31 96.69 98.91 98.71 98.91
FCN (N. Liu et al., 2024)36 98.47 97.00 99.26 99.63 99.26

The Fig. 15 graph plots the performance of five various deep learning techniques – Proposed HAMNET-Mask R-CNN, U-Net, SegNet, DeepLabV3, and FCN – concerning five different evaluation metrics: Dice, IoU, Precision, Recall, and Accuracy. The y-axis is used for the performance metrics in percentage terms, from 0 to 100. For each technique, five bars are grouped, and each bar corresponds to a different metric. The proposed HAMNET-Mask R-CNN tends to obtain the highest values in all metrics, followed by DeepLabV3. U-Net and SegNet are slightly lower, while FCN is the lowest. This visualization provides a clear comparison of how effective these approaches are in one particular task and indicates the superior performance of the proposed method.

Fig. 15.

Fig. 15

Performance comparison.

The confusion matrix in Fig. 16 illustrates the overall classification performance of the proposed HAMNet model considering Downy Mildew, Healthy, Rust, and Disease as four distinct classes. Each y-axis represents the actual class, and each x-axis represents the predicted class. Correctly classified instances are represented by the values diagonal to each other, whereas the off-diagonal values show the misclassifications. A greater number along the diagonal indicates a good model performance in classifying disease categories. Such insights help evaluate the reliability of the models and identify areas where the models need improvement, especially in differentiating between similar signs of disease.

Fig. 16.

Fig. 16

Confusion matrix.

The Fig. 17 has two subplots that compare the performance of a model over the 100-epoch scale. The left plot shows the Accuracy of Training and Validation - both curves are seen to be moving steadily up and when they reach nearly 1.0, the authors conclude that the model is good. The right plot represents the Training and Validation Loss - the loss curves go down almost to zero and stand near it, thus contributing to the validation and overfitting. The validation accuracy and loss experience slight fluctuation due to the changes in the validation set. The trend shows that the proposed HAMNET-Mask R-CNN model achieves not only high accuracy but also low loss and hence it can segment with a robust, high performance.

Fig. 17.

Fig. 17

Training and validation.

Discussion

The proposed HAMNET-Mask R-CNN model significantly outperforms the other existing segmentation methods like U-Net, SegNet, DeepLabV3, and FCN. The results for the evaluation metrics (loss, Dice coefficient, IoU, precision, recall, and accuracy) indicated much better segmentation results for HAMNET-Mask R-CNN. Achieving 98.80% IoU and 99.35% Dice coefficient using contours that are closer to the boundary of their deviations, we also produce models that at least capture the object to a greater extent. Its 99.65% accuracy is further proof of its robustness. The suggested method not only beats U-Net and SegNet with 90.53% and 89.73% IoU scores. High precision (99.75%) and recall, (99.78) show that the model correctly reduces false positives and false negatives. The capabilities of this particular outcome, its limitations due to size, and the lack of external verification may affect its generalizability. Therefore, these specific results should be properly examined with the possibility of overfitting in mind. Even though the development in the Dice coefficient relation to the baseline in the FCN approach is not large at 0.88%, repeated experiments validate the performance improvement, suggesting that the approach is valued even with a limited set.

An analysis of misclassified and difficult samples showed that most errors were due to complex backgrounds, different variation, overlapping disease indications, and slight visual variances, reflecting areas for further development of the typical. An analysis of misclassified and difficult samples showed that most errors were due to complex backgrounds, different data analysis, overlapping disease symptoms, and slight visual differences, highlighting areas for further model progress. Also, the IoU score for various classes shows that the model is reasonably capable of handling such diverse segmentation tasks. The Best IoU scores belonged to Healthy (99.1%), Disease (98.5), Downy Mildew (98.2), and Rust (97.9) this indicates that the model generalizes well on a category level, while staying within high accuracy. Thus, the study validates HAMNET-Mask R-CNN as a cutting-edge segmentation model with high accuracy, low-loss and superior segmentation capabilities over existing alternatives. Future work potentially concerns the optimization techniques and the transfer of the proposed framework to reactively controllable complex systems with real-time applications.

The dataset being considered shows a moderate level of class imbalance between healthy and diseased leaves. To eliminate any potential bias during the training process, data augmentation techniques such as rotation, flip, and normalization were applied to the data classes to improve their diversity and generalization. The models used for training, including U-Net, SegNet, DeepLabV3, and FCN, were all trained under identical experimental conditions. This included consistent dataset preprocessing, normalization techniques, augmentation tactics, and data splits for training and testing. Hyperparameters such as learning rate, batch size, optimizer type, and training epochs were standardized across models whenever possible, but architecture-specific values were kept in accordance with established procedures.

Conclusion and future scope

The proposed HAMNET-Mask R-CNN model achieves high accuracy when compared with conventional methods like U-Net, SegNet, DeepLabV3, FCN, etc. There are metrics of 99.35% Dice similarity, 98.80% of IoU and 99.65% accuracy for the model to make sure that the most accurate segmentation of boundaries is achieved with least false positive and false negative. Additionally, its precision of 99.75% and recall of 99.78%, demonstrate its robustness to segment complex structures. For this study, the novelty is that by combining advanced deep learning architectures with optimized feature extraction and adaptive learning strategies, it is possible to improve segmentation accuracy and maintain computational efficiency. HAMNET-Mask R-CNN addresses a collection of categories with the ability to balance segmentation resolution and generalization compatibly with segmented scene categories, unlike existing models. It is thus extremely suitable for a host of applications including clinical imaging, precision agriculture and automated defect detection.

HAMNET-Mask R-CNN is a precise, efficient and scalable segmentation model. It is possible that to use the model in real-life applications where accuracy is highly demanded because it has proven its performance on different datasets. It should be investigated in the next research to minimize the computational complexity for real-time implementation in edge devices and IoT-based systems. Furthermore, to use self-supervised learning, domain adaptation, and transfer learning which hold further promise for improving performance on diverse datasets. Potentially there are exceptional avenues to explore by expanding the model for 3D medical image segmentation and real-time autonomous systems. Future work consists of expanding the dataset, which includes cross-validation with k-folds, and evaluating the approach on previous unexplored datasets to assure robustness and real-world application. Additionally, explainable AI techniques can be integrated to improve the transparency of segmentation decisions. HAMNet-Mask R-CNN proves to be highly accurate in segmentation and effective in detecting the disease, however, it has certain limitations, which must be mentioned. To begin with, the data in this study is mostly gathered in certain arid and semi-arid areas and hence may not be generalized in various geographic areas. Second, the model was not cross-datavalidated and its performance on images of various cultivars, environmental conditions, or imaging devices has not yet been assessed. Future research might be based on the extension of the dataset to encompass larger geographical areas and the cross-dataset validation of the model to determine more accurately the robustness and applicability of the model in a wider agricultural setting.

Author contributions

Mrs. S. Ramya led the conceptualization and development of the HAMNet architecture, formulating the hierarchical multi-scale attention mechanism and spatial fusion strategy for enhanced disease detection in pearl millet. She handled data collection, preprocessing, model implementation, and performance evaluation. Dr. D. Pradeep provided technical guidance, supervised the research methodology, and contributed to algorithm optimization and experimental design. He validated the results, refined the analytical framework, and reviewed the manuscript for scientific accuracy. Both authors contributed to the final editing and approved the submitted version.

Data availability

The datasets used and analysed during the current study are available from the corresponding author on reasonable request. The datasets are available from the corresponding author on reasonable request.

Code availability

The custom code developed for the implementation of the proposed HAMNet–Mask R-CNN framework, including data preprocessing, model training, evaluation, and visualization scripts, is publicly available in a GitHub repository. The code can be accessed at: https://github.com/ramyalaksha/Hamnet.git This repository ensures transparency and reproducibility of the experimental results. To facilitate long-term accessibility and citation, the repository can be archived to obtain a DOI using services such as Zenodo. Any restrictions related to third-party libraries or datasets are clearly documented within the repository.

Declarations

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Satyavathi, C. T., Ambawat, S., Khandelwal, V. & Srivastava, R. K. Pearl millet: A climate-resilient nutricereal for mitigating hidden hunger and provide nutritional security. Front. Plant Sci.12, 659938 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Bansal, S. et al. The major diseases of pearl millet in the Indian sub-continent: Current scenarios in resistance and management strategies. In Pearl millet in the 21st century: Food-nutrition-climate resilience-improved livelihoods 305–330 (Springer, 2024).
  • 3.Malik, V. K. et al. & others. Stem rot of pearl millet prevalence, symptomatology, disease cycle, disease rating scale and pathogen characterization in pearl millet-Klebsiella pathosystem. The Plant Pathology Journal, 40(1), 48 (2024). [DOI] [PMC free article] [PubMed]
  • 4.Jafar, A., Bibi, N., Naqvi, R. A., Sadeghi-Niaraki, A. & Jeong, D. Revolutionizing agriculture with artificial intelligence: Plant disease detection methods, applications, and their limitations. Front. Plant Sci.15, 1356260. 10.3389/fpls.2024.1356260 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Yadav, O. P. et al. Genetic gains in pearl millet in India: Insights into historic breeding strategies and future perspective. Front. Plant Sci.12, 645038 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Yadav, O., Gupta, S. & Sanjana Reddy, P. Pearl Millet Breeding for Enhancing Yield and Stability: Strategies, Achievements, and Perspectives. Pearl Millet in the 21st Century: Food-Nutrition-Climate Resilience-Improved Livelihoods, 331–360 (2024).
  • 7.Little, C. R., Perumal, R. & Todd, T. C. Diseases of Pearl Millet. Pearl Millet: A Resilient Cereal Crop for Food, Nutrition, and Climate Security, 299–391 (2024).
  • 8.Singh, S., Sharma, R., Nayaka, C., Satyavathi, S. T. & Raj, C. C., Understanding pearl millet blast caused by Magnaporthe grisea and strategies for its management. Blast Disease Cereal Crops: Evol. Adaptation Context Clim. Change, 151–172 (2021).
  • 9.Jain, A. Recent Plant Protection Measures for Control of Diseases in Millets. Th Souvenir for 4 National Conference 2024, 2050, 63. (2024).
  • 10.Zhang, N. et al. Identification of candidate RXLR effectors from downy mildew of foxtail millet pathogen Sclerospora graminicola and functional analysis of SG_RXLR41. Plant Pathol.73(6), 1425–1435 (2024). [Google Scholar]
  • 11.Bahadur, A., Khan, M. R. & Jamil, A. Pearl millet (bajra): Downy mildew and ergot. In Diseases of Nationally Important Field Crops 203–216 (Today and Tomorrow Printers and Publishers, 2021).
  • 12.Djanaguiraman, M. et al. Impact of Drought and High-temperature Stresses on Growth and Development Stages, Physiological, Reproductive, and Yield Traits on Pearl Millet. Pearl Millet: Resilient Cereal Crop Food Nutr. Clim. Security, 249–276 (2024).
  • 13.Harb, H. E. et al. Recent Advances of Using Innovative Strategies in Management of Millet Plant Pathogens. Genetic Improv. Small Millets, 297–328 (2024).
  • 14.Prabhu, D. A. & Oviya, P. A Review on Disease Management in Millets. (2023).
  • 15.Chikkamath, M., Nath Dwivedi, D., Thimmappa, R. & Basavanthappa Vedamurthy, K. Detection and Categorization of Diseases in Pearl Millet Leaves using Novel Convolutional Neural Network Model. In (eds Kumar, P., Shukla & Kanti Bera, T.) Future Farming: Advancing Agriculture with Artificial Intelligence (41–52). BENTHAM SCIENCE. 10.2174/9789815124729123010006 (2023).
  • 16.Bollam, S. et al. Genetic and Genomic Approaches for Accelerated Pearl Millet Breeding. Pearl Millet: A Resilient Cereal Crop for Food, Nutrition, and Climate Security, 81–120 (2024).
  • 17.O’Halloran, T., Obaido, G., Otegbade, B. & Mienye, I. D. A deep learning approach for Maize Lethal Necrosis and Maize Streak Virus disease detection. Mach. Learn. Appl.16, 100556 (2024). [Google Scholar]
  • 18.Maharajan, T., Duraipandiyan, V., Krishna, T. P. A. & Soosaimanickam, M. Nutritional values of foxtail millet (Setaria italica) and other millets used for common diseases and management. Curr. Nutr. Food Sci.20(9), 1056–1068. 10.2174/0115734013266504231025050553 (2024). [Google Scholar]
  • 19.Yadav, S. et al. Near-infrared reflectance spectroscopy (NIRS): An innovative, rapid, economical, easy and non-destructive whole grain analysis method for nutritional profiling of pearl millet genotypes. J. Food Compos. Anal.142, 107373. 10.1016/j.jfca.2025.107373 (2025). [Google Scholar]
  • 20.Tiwari, S., Gehlot, A., Singh, R., Twala, B. & Priyadarshi, N. Design of an improved model for finger millet leaf disease detection with raspberry Pi using multimodal data acquisition and precision-aware CNN. Results Eng.25, 103969. 10.1016/j.rineng.2025.103969 (2025). [Google Scholar]
  • 21.Muntaqim, M. Z., Kafi, H. M. & Smrity, T. A. Privacy-aware plant disease detection: federated learning with homomorphic encryption on image data, The Visual Computer, 2026 (2026). 10.1007/s00371-025-04261-5
  • 22.Muntaqim, M. Z. et al. Federated learning meets few-shot learning: A voting ensemble based combined approach to cauliflower leaf disease classification across Non-IID data distributions. Array10.1016/j.array.2025.100516 (2025). [Google Scholar]
  • 23.Smrity, T. A. & Muntaqim, M. Z. SQLGuardNet: Deep learning adaptive processing-based pattern recognition for enhanced SQL injection detection. SIViP19, 1152. 10.1007/s11760-025-04642-2 (2025). [Google Scholar]
  • 24.Muntaqim, M. Z. & Smrity, T. A. Federated learning framework for brain tumor detection using MRI images in Non-IID data distributions. J. Imaging Inform. Med.38, 3909–3927. 10.1007/s10278-025-01484-9 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Naik, N. S. Automated Disease Detection in Millet Crops Using Deep Learning. In (eds. C. Sombattheera, P. Weng, & J. Pang), Multi-disciplinary Trends in Artificial Intelligence15432, 194–205 (Springer Nature Singapore, 2025). 10.1007/978-981-96-0695-5_16
  • 26.Mishra, S., Volety, D. R., Bohra, N., Alfarhood, S. & Safran, M. A smart and sustainable framework for millet crop monitoring equipped with disease detection using enhanced predictive intelligence. Alex. Eng. J.83, 298–306. 10.1016/j.aej.2023.10.041 (2023). [Google Scholar]
  • 27.Kundu, N. et al. IoT and interpretable machine learning based framework for disease prediction in pearl millet. Sensors (Basel)21(16), 5386. 10.3390/s21165386 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Mansour Diene, S. et al. Improving Pearl Millet Yield Estimation From UAV Imagery in the Semiarid Agroforestry System of Senegal Through Textural Indices and Reflectance Normalization. IEEE Access.12, 132626–132643. 10.1109/ACCESS.2024.3460107 (2024). [Google Scholar]
  • 29.Singh, S., Dashore, S., Prasad, J. & Naik, N. S. iCrop: A framework for identification of millet crop diseases via segmentation and feature extraction. Indian Phytopathol.76 (3), 803–812. 10.1007/s42360-023-00660-7 (2023). [Google Scholar]
  • 30.Johnson, I. et al. Deep-millet: A deep learning model for pearl millet disease identification to envisage precision agriculture. Environ. Res. Commun.6(10), 105031. 10.1088/2515-7620/ad8415 (2024). [Google Scholar]
  • 31.Divya, A., Sungeetha, D. & Ramesh, S. Efficient protection of golden nutri cereal implementing enhanced disease identification injecting hybrid split-attention mechanism through novel SANDNES mechanism. Multim. Tools Appl.83(38), 85499–85521. 10.1007/s11042-024-19858-6 (2024). [Google Scholar]
  • 32.Hadimani, S., Joshi, S. M., Geetha, N., Shetty, H. S. & Jogaiah, S. Elucidating the role of effector protein as biomarker for enhanced resistance against pearl millet downy mildew disease. Physiol. Mol. Plant Pathol.127, 102076. 10.1016/j.pmpp.2023.102076 (2023). [Google Scholar]
  • 33.Liu, X., Song, L., Liu, S. & Zhang, Y. A review of deep-learning-based medical image segmentation methods. Sustainability (Basel)13(3), 1224. 10.3390/su13031224 (2021). [Google Scholar]
  • 34.Xing, W. et al. CM-SegNet: A deep learning-based automatic segmentation approach for medical images by combining convolution and multilayer perceptron. Comput. Biol. Med.147, 105797. 10.1016/j.compbiomed.2022.105797 (2022). [DOI] [PubMed] [Google Scholar]
  • 35.Divyanth, L., Ahmad, A. & Saraswat, D. A two-stage deep-learning based segmentation model for crop disease quantification based on corn field imagery. Smart Agric. Technol.3, 100108 (2023). [Google Scholar]
  • 36.Liu, N. et al. HMSAM-UNet: A Hierarchical Multi-Scale Attention Module-Based Convolutional Neural Network for Improved CT Image Segmentation. IEEE Access12, 79415–79427. 10.1109/ACCESS.2024.3401669 (2024). [Google Scholar]
  • 37.Pearl millet Dataset > Overview. (2024). https://universe.roboflow.com/leaf-chalmers/pearl-millet-il2bp

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The datasets used and analysed during the current study are available from the corresponding author on reasonable request. The datasets are available from the corresponding author on reasonable request.

The custom code developed for the implementation of the proposed HAMNet–Mask R-CNN framework, including data preprocessing, model training, evaluation, and visualization scripts, is publicly available in a GitHub repository. The code can be accessed at: https://github.com/ramyalaksha/Hamnet.git This repository ensures transparency and reproducibility of the experimental results. To facilitate long-term accessibility and citation, the repository can be archived to obtain a DOI using services such as Zenodo. Any restrictions related to third-party libraries or datasets are clearly documented within the repository.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES