论文信息
论文解读
AI 辅助整理- 方法
- ResNet-18加注意力模块与模型对比联邦学习,Otsu分割量化病斑面积。
- 发现
- 五客户端下分类准确率95.49%、严重度估计94.57%,扩展客户端仍稳定在91%以上。
- 机会点
- 可探索跨作物、跨区域联邦学习中的非独立同分布数据漂移与通信成本优化。
论文摘要
本研究提出了一种隐私感知的联邦学习框架,用于利用在印度各农业区域收集的异构田间数据进行水稻叶片病害分类和严重程度估计。传统的深度学习方法依赖于集中式数据聚合,这在分布式农业环境中引发了与数据隐私、所有权和可扩展性相关的担忧。为应对这些挑战,所提出的框架集成了一个基于ResNet-18的卷积神经网络,并辅以卷积块注意力模块(Convolutional Block Attention Module)以进行判别性特征提取,同时采用模型对比联邦学习策略以缓解非独立同分布数据条件下的客户端漂移。除病害分类外,还引入了一个严重程度估计模块,采用基于Otsu的分割方法量化感染叶片面积的比例,从而能够更全面地评估病害进展。该框架在不同客户端数量的多种联邦设置下进行了评估,以分析收敛性、鲁棒性和可扩展性。实验结果表明,所提出的模型在五客户端设置下达到了95.49%的分类准确率和94.57%的严重程度估计准确率,即使在客户端参与数量增加的情况下,仍分别保持91%和92%以上的稳定性能。较高的宏平均F1分数和清晰的严重程度混淆矩阵进一步验证了模型的可靠性。结果凸显了所提方法在实现可扩展、隐私感知且包含严重程度信息的病害监测方面的有效性,使其适用于实际精准农业应用。
全文
Scientific ReportsARTICLE | Article in Press
https://doi.org/10.1038/s41598-026-76513-w
This Article in Press is shared early to give you faster access to new research. It is citable and carries a permanent DOI.
The final edited version will replace it automatically.
Scientific Reports
Scientific Reports
A privacy preserving federated learning framework for
rice leaf disease classification and severity estimation
using indian field data
Debangana Ram · Manasi Gyanchandani · Akhtar Rasool · Mohit Kushwaha
Received: 28 July 2026 / Accepted: 13 October 2026
© The Author(s) 2026
Abstract
This study presents a privacy-aware federated learning framework for rice leaf disease classification and sever -
ity estimation using heterogeneous field data collected across Indian agricultural regions. Conventional deep
learning approaches rely on centralized data aggregation, which raises concerns related to data privacy, owner -
ship, and scalability in distributed farming environments. To address these challenges, the proposed framework
integrates a ResNet-18-based convolutional neural network enhanced with a Convolutional Block Attention
Module for discriminative feature extraction, along with a model-contrastive federated learning strategy to miti-
gate client drift under non-independent and identically distributed data conditions. In addition to disease classi -
fication, a severity estimation module is incorporated using Otsu-based segmentation to quantify the proportion
of infected leaf area, enabling a more comprehensive assessment of disease progression. The framework is
evaluated across multiple federated settings with varying numbers of clients to analyse convergence, robust -
ness, and scalability. Experimental results demonstrate that the proposed model achieves a classification accu -
racy of 95.49% and a severity estimation accuracy of 94.57% in a five-client setup, while maintaining stable
performance above 91% and 92%, respectively, even with increased client participation. High macro-averaged
F1-scores and well-defined severity confusion matrices further validate the reliability of the model. The results
highlight the effectiveness of the proposed approach in enabling scalable, privacy-aware, and severity-informed
disease monitoring, making it suitable for real-world precision agriculture applications.
Keywords Hybrid and federated learning · Generative models · Smart agriculture · Plant disease
classification · Severity estimation · Data privacy · Rice leaf · Generative models
Introduction
Rice (Oryza sativa)1 is among the widely grown cereal crops and forms a major food source for a large fraction
of the world. Its cultivation is essential in maintaining food security2, especially in developing nations where rice
is a major food staple. Rice productivity is, however, very vulnerable to the biotic stresses, among them being the
leaf diseases3, which are one of the most destructive aspects as regards yield and grain content. India has been
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
considered one of the largest producers of rice 4–6, with its cultivation spread in various agro-ecological regions
that vary in temperature, rainfall, humidity, and soil composition7,8. These environmental factors give preference
to the growth and propagation of rice leaf diseases like bacterial leaf blight9, blast, brown spot10, and leaf smut11.
The visual symptoms of such diseases tend to be on the surface of the leaves and develop slowly; in order to
control the disease well, there is a need to monitor them with accuracy. Traditional field-based diagnosis uses
expert knowledge and manual inspection methods, which are labour-intensive, subjective, and cannot be scaled
to large areas of agriculture.
To eliminate these drawbacks, automated detection of rice leaf disease using images has received a lot of
attention. Initial works used traditional image processing methods, colour spaces, texture measures, shape mea -
sures, and machine learning classifiers like support vector machines or k-nearest neighbours12. As a result of the
development of deep learning, convolutional neural networks have become the most popular because of their
capability to automatically discover hierarchical features of raw images. Recent publications have also demon -
strated a high accuracy of classification of rice leaf disease recognition with CNNs and transfer learning-related
architectures13,14. Despite these developments, most of the current methods take the problem as a disease classi-
fication problem, and their work is mainly confined to determining the disease category that is present in the leaf
image. Disease classification is important because it gives valuable diagnostic data, but it falls short in meeting
the requirements of precision agriculture. There are real farming situations in which disease management choices
are not only dependent on the kind of disease but also on its severity, which is the degree and severity of infection.
The extent of the disease has a direct impact on the yield loss estimation15, the strategy of pesticide application16,
and economic decision-making. This is quantified by a severity index, which is usually described as the ratio
of the area of the leaf that is infected to the overall area of the leaf, which allows more effective and informed
intervention strategies to be developed 17. Nevertheless, the severity estimation has been given relatively little
attention in the study of rice leaf disease, and were done, it is usually modelled based on coarse or subjective
scales of grading. The other issue that is critical when implementing deep learning-based disease detectors is the
data management paradigm. The predominant models that are in use are trained on centralized datasets that are
acquired from a small number of sources. Practically, the rice disease records would be spread naturally over vari-
ous farms, research facilities, and geographical areas, especially in such a big and diverse country as India. The
process of consolidating such data in one location elicits issues related to the privacy of data, the ownership, the
cost of communication, and compliance with regulations. Also, local differences in the manifestation of diseases
and methods of their cultivation lead to non-IID data distributions, which can adversely affect the generalization
capability of centralized models18.
The development of federated learning has become a promising solution to the challenges because it allows
training the models with the collaboration between decentralized sources of data without broadcasting raw
data19,20. A federated learning system involves training models on clients participating in the learning process
with locally available region-specific data, with model parameters or updates only being sent to a central server
to be aggregated 21,22. This approach enhances data confidentiality by keeping raw agricultural images at their
source locations while allowing collaborative model training through exchange of model parameters. However,
federated learning alone does not provide complete privacy guarantees against potential inference attacks unless
combined with additional mechanisms such as secure aggregation or differential privacy. In the agricultural area,
federated learning has demonstrated potential in managing data heterogeneity and boosting resilience at regional
levels. Nevertheless, the bulk of the available federated learning-based research in crop disease analysis is less
concerned with the classification accuracy but does not explicitly address severity estimation, which restricts
their practical implementation. The architecture of federated learning consists of a central server that coordinates
multiple decentralized client devices, where each client locally trains a model on its private data and only shares
model updates with the server for aggregation into a global model is illustrated in Fig. 1.
Despite the growing body of work in federated crop disease detection, existing studies largely focus on disease
classification and often overlook the integration of severity estimation within a privacy-preserving decentralized
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
framework. Moreover, current approaches typically rely on standard convolutional backbones without incor -
porating attention mechanisms to enhance feature representation under varying field conditions. In contrast,
the proposed framework introduces a novel integration of MOON-based federated learning with an attention-
enhanced deep learning architecture and severity-aware modelling. Specifically, the use of contrastive learning in
the MOON framework improves client drift mitigation under non-IID data distributions, while the incorporation
of the Convolutional Block Attention Module (CBAM) enables the model to focus on disease-relevant spatial and
channel features in complex leaf images. Furthermore, the proposed severity-aware modelling strategy extends
beyond conventional classification by jointly learning disease categories and infection severity, thereby providing
more actionable insights for precision agriculture. This combined formulation distinguishes the proposed work
from existing federated learning approaches by simultaneously addressing data privacy, feature refinement, and
fine-grained disease assessment within a unified framework. The primary contribution of the proposed frame -
work lies in the collaborative integration of three key components within a unified federated learning paradigm.
First, the incorporation of MOON-based contrastive learning effectively mitigates client drift under highly non-
IID agricultural data distributions. Second, the integration of CBAM enhances spatial and channel-wise feature
attention, enabling more precise localization of disease-affected regions. Third, the introduction of severity-aware
modelling extends traditional classification by incorporating disease progression information, which is critical
for precision agriculture. Unlike existing federated crop disease detection approaches that focus solely on clas -
sification accuracy, the proposed framework jointly optimizes classification and severity estimation in a privacy-
preserving distributed setting, thereby advancing the state-of-the-art in intelligent agricultural diagnostics.
Unlike existing federated rice disease studies that primarily employ conventional CNN architectures for dis -
ease classification, the proposed framework jointly integrates four complementary components within a unified
learning architecture. ResNet-18 provides a computationally efficient backbone suitable for distributed client
devices, while the Convolutional Block Attention Module (CBAM) enhances discriminative feature learning by
emphasizing disease-relevant spatial regions and feature channels. To address the optimization challenges caused
by statistically heterogeneous (non-IID) client data, the MOON framework introduces representation-level con -
trastive learning that reduces client drift and improves convergence stability during federated training. Further -
more, rather than limiting the framework to disease identification alone, an additional severity estimation branch
quantifies infection progression from segmented lesion regions, enabling simultaneous disease classification and
severity prediction within the same federated model. The novelty of the proposed work therefore lies not in the
individual components themselves, but in their unified integration into a single severity-aware federated learn -
ing framework that simultaneously addresses feature refinement, non-IID optimization, and fine-grained disease
assessment while preserving data locality.
Fig. 1 Architecture of the federated learning frame-
work showing decentralized client-side training, local
data retention, transmission of model updates, server-
side aggregation, and redistribution of the updated
global model. The architecture illustrates how collab-
orative learning is performed without transferring raw
rice leaf images to the central server.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
Contributions of the study
A comprehensive experimental evaluation on a Indian rice leaf dataset with 10,40 images across 10 disease cat -
egories and three severity indices.
● A comprehensive experimental evaluation on a Indian rice leaf dataset comprising 8643 images across 10 dis-
ease categories and three severity levels, addressing the limitation of small-scale and laboratory-based datasets
used in prior studies.
● A novel federated learning framework integrating MOON-based contrastive learning to effectively mitigate
client drift under non-IID agricultural data distributions, which is not adequately handled in conventional ap -
proaches such as FedAvg and FedProx.
● An attention-enhanced deep learning architecture incorporating CBAM to improve discriminative feature rep-
resentation, overcoming the limitations of standard CNN-based federated models that lack spatial–channel
attention mechanisms for complex field conditions.
● A severity-aware modelling approach that jointly performs disease classification and severity estimation using
a disease-specific severity index, whereas most existing federated crop disease studies focus solely on clas -
sification without considering disease progression.
● Extensive validation under realistic non-IID federated settings with scalability analysis across 5, 10, 15, and 36
clients, demonstrating robustness under simulated geographically distributed and statistically heterogeneous
agricultural environments.
Background
Rice is a crucial food crop and a food security pillar in India, but its cultivation is always jeopardized by vari -
ous leaf diseases that have a great effect on yield and economic implications 23–25. Traditional disease detection
methods are mainly visual inspection, which is very slow, subjective, and not practical in the mass monitoring
aspect, especially when focusing on smallholder farmers who, in most cases, do not get access to expert advice
on time. The constraints emphasize the importance of automated, dependable, and scalable disease diagnosis
systems. The latest advancements in the field of image-based plant disease detection made with the help of deep
learning have allowed to classify rice leaf disease based on visual data 26,27. The study28 proposed an enhanced
YOLOv13-based approach for plant leaf disease segmentation and classification, demonstrating the potential of
optimized object-detection architectures for identifying diseased regions. Similarly 29, investigated texture- and
symptom-based features using CNN and ResNet al.gorithms for coffee leaf disease classification, showing the
usefulness of combining traditional visual characteristics with deep feature representations. More recently 30,
developed a Hybrid Vision Graph Neural Network (HV-GNN) for early detection of pest diseases in coffee plants,
demonstrating how graph-based representations can complement visual feature extraction for agricultural disease
analysis. Although these studies demonstrate strong advances in segmentation, classification, and early disease
detection, they primarily focus on centralized image-based learning and do not address privacy-preserving fed -
erated learning with simultaneous disease classification and severity estimation. This motivates the proposed
framework, which integrates deep feature extraction, attention mechanisms, federated optimization, and severity
estimation within a unified architecture.Nevertheless, the majority of offered solutions are confined to the cen -
tralized learning models and concentrate on the disease recognition aspect without fully discussing the disease
severity or limitations imposed on the real-world implementation. In real farming situations, knowledge of the
scale of infection is just as relevant as the disease itself, since the extent of infection is directly proportional to
intervention measures, dose of treatment, and estimating yield.
To address these difficulties, this piece of work highlights a severity-conscious rice disease diagnostic frame -
work that measures the severity of the illness by a severity index based on the image of the leaf. In contrast to the
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
traditional methods based on classification only, the intended system offers fine-grained disease assessment that
can be utilized to aid in precision agriculture and advanced decision-making. Moreover, because of the decentral-
ized nature of agricultural data in India, the proposed study follows a federated learning paradigm, which allows
joint training of models by distributed clients without violating the privacy of data and allowing regional data
heterogeneity31. The combination of disease classification, estimating the severity index, and federated learning
implemented together occurs in this work, where the method is practical and scalable to actual Indian agriculture
settings. The suggested framework is expected to provide precise, privacy-sensitive, and deployable diagnostic
assistance, especially to the benefit of the smallholder farmers, and as a part of the enhanced crop management
and food security.
History of rice leaf diseases
There is a long history of many diseases associated with rice cultivation, and it has been demonstrated that cer -
tain diseases have appeared, disappeared, and spread to different regions over time. Knowledge of the historical
eventualities and distribution of the key. Rice leaf diseases are critical to current diagnostic and management pro-
cedures, especially in data-driven agricultural models32. The history timeline Fig. 2, illustrates the chronological
evolution of rice leaf diseases, highlighting key research advancements and disease outbreaks.
One of the first-recorded bacterial infections of rice is bacterial leaf blight (BLB), which is caused by Xan -
thomonas oryzae pv. Oryzae 33. It was initially documented in Japan in the late nineteenth century, and then it
was disseminated in Asia 34 in the early twentieth century. BLB was initially documented in the late 1950s in
India and was widespread in the 1960s, especially in irrigated rice ecosystems 35. It has since been endemic in
the major rice-growing states, with frequent outbreaks occurring during warm and humid climates. Bacterial leaf
streak (BLS), which is the disease that is caused by Xanthomonas oryzae pv. oryzicola, was first discovered in
Southeast Asia at the beginning of the twentieth century36. Historically, it was thought of as a minor disease, but
it was investigated when rice farming increased in the tropical areas. BLS has been reported sporadically in the
humid rice belts in India, and in many cases BLS has been found with bacterial leaf blight. The pathology nor -
mally shows in the vegetative phase and may be sporadic, but highly prevalent in the rainy and warm seasons.
Bacterial panicle blight is a comparatively less-reported rice infection that is mostly an issue in the crop repro -
ductive phase. It was first observed in tropical areas where rice grows in the second half of the twentieth century
Fig. 2 Historical timeline of major rice
leaf diseases and associated research
developments, illustrating the progres-
sion of disease recognition and manage-
ment across different periods.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
but has also been reported in regions of Ecuador and in Mexico37. In India, the events are local and intermittent,
and in most instances, they are attributed to high humidity at the time of flowering. It has not been historically
epidemic, but its distribution has grown over the past decades because of the altered climatic conditions. One of
the oldest and most devastating diseases of rice in the world is rice blast, which is caused by a fungal pathogen
known as Magnaporthe oryzae 38. It was recorded that in historical times, it happened in seventeenth-century
China, which became the source of its dispersion to the whole world. Blast outbreaks were observed in the early
part of the twentieth century in India, mostly in the southern parts that were covered with rice fields. The disease
has become common and is present in nearly all the rice-producing states, and epidemics occur due to favour -
able environmental conditions 39. The pathogen Cochliobolus miyabeanus has a long and full history of brown
spot disease in rice. It has been known worldwide since the beginning of the twentieth century, though by far its
most striking phenomenon has been during the Bengal famine of 1942-43, during which the effects of brown spot
epidemics were severe enough to play a significant role in crop failure in eastern India 40. This disease remains
rampant in India, especially in soils that are nutrient-deficient and in stress-conducive environments. Dead heart
is a symptom and not a pathogen-specific disease and is usually due to borer attacks of the stem. The stem borers
have been a long-time enemy of the Asian rice production, with recorded occurrences in the twentieth century. In
India, the symptoms of a dead heart are very common in the early vegetative stage, particularly in the rainy sea-
sons. Population dynamics of pests and the stage of crop development have strong effects on their occurrence. In
areas where rice is grown in cool and humid climates, the oomycete pathogens would have caused downy mildew
of rice, although this has been reported sporadically. Though not as common as blast or bacterial diseases, it has
been observed occurring in some parts of Asia since the middle of the twentieth century. Downy mildew 41 spo-
radically occurs in the northern and northeastern parts of India in areas that experience adequate moisture levels
and are usually in the form of small outbreaks, but not epidemics. Rice Hispa is a beetle pest that is a leaf feeder
that has been reported in the Asian rice systems as far back as the early 1900s 42. The pest leaves typical linear
scars on rice, diminishing photosynthetic efficiency. Hispa has been widely reported in eastern and northeastern
states in India, and repeated infestations have been detected during the twentieth century. It is an insect pest, but
it is also important in analysing the disease of rice due to its effects on the health of the leaf. The first disease
was rice tungro disease, which is a viral complex spread by green leafhoppers and first discovered in Southeast
Asia in the 1960s. The disease gained high speed in South and Southeast Asia, including India, where it became
a significant limitation in the irrigated rice systems. The tungro outbreaks have long been observed since the late
twentieth century, especially in the regions populated by vectors, and have resulted in a significant loss of yields
in the epidemic years43. With time, several diseases affecting rice leaves have crossed into intermittent epidem -
ics to become an ongoing and constant danger. Climatic variability, enhanced rice farming, monocropping, and
the use of high-yielding varieties have caused the increased frequency and severity of disease. The presence
of environmental conditions like humidity, changes in temperature, and rainfall is powerful in determining the
occurrence of disease, whereas nutrient stress and pressure of pests are additional factors in exacerbating the dis-
ease process. Traditionally, losses of yield in the case of rice leaf diseases have ranged from medium-scale loss in
the case of mild infection to disastrous loss in the case of an epidemic. Notably, these losses have a very strong
association with the severity of the diseases and not just their presence. Further, most diseases of rice leaves have
similar symptoms in the early phases, and thus manual diagnosis is difficult and unreliable. Although much his -
torical experience was gained on the prevalence of diseases, the majority of conventional methods of diagnosis
are classification-oriented and centralized. This forms an urgent loophole in the management of disease progres-
sion, measurement of severity, and centralized access to data. Such observations are highly encouraging for the
creation of severity-conscious and privacy-conscious diagnostic models, including the federated learning-based
model introduced in this paper.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
Critical comparison of recent plant disease diagnosis, attention-based models, and federated learning
Recent developments in deep learning have substantially improved automated plant disease recognition; how -
ever, existing studies differ considerably in their treatment of data heterogeneity, feature representation, privacy,
and disease severity. Conventional centralized approaches generally benefit from access to large pooled datasets,
but they require data aggregation and therefore do not directly address the privacy and ownership constraints
encountered in geographically distributed agricultural environments. Recent research has increasingly explored
attention mechanisms, Transformer-based architectures, and federated learning to overcome some of these limita-
tions, although important gaps remain in their joint application to plant disease diagnosis. Attention mechanisms
have demonstrated the ability to improve the representation of disease-related visual patterns by emphasizing
informative features 44. proposed a capsule attention network for plant disease classification, demonstrating
the potential of attention-oriented feature learning for distinguishing disease patterns. Similarly 45, developed
an SE-ResNet152-based transfer learning approach for early corn leaf disease identification and classification,
where feature recalibration was employed to improve disease-related representation. More recently46, introduced
an ensemble heterogeneous Transformer model for the diagnosis of multiple plant diseases, highlighting the
effectiveness of heterogeneous Transformer representations for agricultural image classification. These studies
demonstrate the value of attention and Transformer-based feature extraction; however, they primarily focus on
centralized disease recognition and do not address the statistical heterogeneity that arises when agricultural data
are distributed among independent clients. Recent agricultural vision research has further investigated hierar -
chical feature fusion, boundary-aware learning, and fine-grained visual representation 47. proposed CT-HiffNet,
a contour-texture hierarchical feature fusion network for cropland field parcel extraction, demonstrating the
usefulness of jointly modelling complementary spatial and textural information in high-resolution agricultural
imagery48. subsequently developed a CNN-Transformer hybrid network with boundary guidance for cropland
field parcel mapping, illustrating how Transformer representations can be complemented by boundary-aware
feature learning for fine-grained agricultural image analysis. In another recent study 49, proposed PestScope, an
exclusion-aware large multimodal model for fine-grained agricultural pest segmentation, further demonstrating
the importance of context-aware and fine-grained visual representation in agricultural applications. Although
these three studies do not directly address federated plant disease classification, they are relevant to the broader
development of agricultural vision systems because they demonstrate advances in spatial, texture, boundary, and
contextual feature representation. Nevertheless, their centralized or task-specific settings leave open the question
of how such representation-learning strategies perform when training data are distributed across heterogeneous
agricultural clients. Federated learning provides an alternative paradigm in which agricultural institutions or field
devices can collaboratively train models without directly exchanging their locally stored images. Existing feder-
ated plant disease studies have demonstrated the feasibility of privacy-preserving disease classification, but many
rely on conventional aggregation strategies such as FedAvg and evaluate performance under relatively limited
client configurations. The literature therefore provides comparatively less evidence regarding the behaviour of
plant disease classifiers when the number of clients increases and class distributions become increasingly non-
IID. This issue is particularly important in agricultural environments because disease prevalence, crop varieties,
environmental conditions, and image acquisition conditions may vary substantially between locations. Under
such conditions, local models can learn different representations, resulting in client drift and reduced global per-
formance. Recent federated-learning research on non-IID data, such as FedKT, further emphasizes the importance
of knowledge transfer for maintaining performance under heterogeneous client distributions [existing manuscript
reference]. Another important limitation concerns disease severity. A substantial proportion of plant disease rec-
ognition studies formulate the task as disease classification only. While identifying the disease category is impor-
tant, the severity or extent of infection provides additional information for practical agricultural decision-making,
including monitoring, treatment planning, and intervention prioritization. For rice disease specifically, existing
vision-based research has considered disease detection together with severity estimation [existing manuscript
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
reference on Vision Transformers]. However, the simultaneous treatment of disease classification and severity
estimation within a privacy-preserving federated framework remains comparatively underexplored.
Taken together, the literature indicates three partially developed research directions. First, federated learning
addresses data privacy but remains vulnerable to statistical heterogeneity and client drift under strongly non-IID
agricultural data. Second, attention, capsule, Transformer, and feature-fusion approaches improve the extraction
of disease-relevant visual information but are predominantly evaluated in centralized settings. Third, severity
estimation has received attention in agricultural image analysis but is less frequently incorporated into federated
disease diagnosis. Consequently, there remains a need for a unified framework that combines privacy-preserving
federated learning, attention-enhanced feature representation, explicit handling of non-IID client distributions,
and joint disease classification and severity estimation. The present study addresses this intersection by integrat-
ing a lightweight ResNet-18 backbone with CBAM attention, MOON-based contrastive federated optimization,
and a dedicated severity prediction branch. CBAM enhances spatial and channel-wise disease-related representa-
tions, while MOON is employed to reduce representation divergence and client drift under heterogeneous local
data. The framework further evaluates scalability across 5, 10, 15, and 36 clients, thereby explicitly examining
the effect of increasing client heterogeneity rather than evaluating federated learning under a single client config-
uration. In contrast to studies that address only disease classification or only centralized severity estimation, the
proposed framework jointly considers disease identification and three-level severity prediction while retaining
the federated data-locality constraint. Thus, the contribution of the present work lies primarily in the integration
and evaluation of these complementary components within a single severity-aware, non-IID federated framework
rather than in claiming that attention, Transformer learning, or federated optimization are individually novel.
Research gap and motivation
Although several studies have explored federated learning for plant disease detection, most existing approaches
are limited to disease classification and do not consider severity estimation as part of the learning objective.
Furthermore, conventional federated optimization techniques such as FedAvg often suffer from performance
degradation under non-IID data distributions, which are common in real-world agricultural settings. Additionally,
limited attention has been given to integrating attention mechanisms within federated architectures to enhance
feature representation. Although previous federated learning studies have demonstrated promising performance
for plant disease classification, most treat disease recognition as a single-task classification problem and do
not incorporate disease severity estimation within the learning objective. Existing approaches also commonly
employ standard convolutional backbones without attention mechanisms and rely primarily on FedAvg-style
optimization, making them susceptible to client drift under highly heterogeneous non-IID agricultural datas -
ets. Consequently, there remains a lack of a unified federated framework that simultaneously improves feature
representation, mitigates optimization drift, and performs joint disease classification and severity estimation.
This study addresses this gap through the integration of ResNet-18, CBAM, MOON, and a severity prediction
branch within a single federated learning architecture. To address these limitations, the present study proposes a
hybrid framework that combines contrastive federated learning (MOON), attention-based feature enhancement
(CBAM), and severity-aware modelling within a unified architecture.
Problem statement
The overall problem addressed in this study is severity-aware rice leaf disease detection in a decentralized set -
ting, formally defined as follows. Given a leaf image 𝒊𝒊 ∈ 𝑰𝑰, determine whether 𝒊𝒊 belongs to the infected (IF)
or non-infected (NIF) category, where 𝑰𝑰 is the set of all leaf images across multiple clients. If 𝒊𝒊 ∈ 𝑰𝑰𝑰𝑰, identify
the portions 𝒑𝒑 ⊂ 𝒊𝒊 corresponding to infected regions using Otsu-based segmentation and compute the disease
severity as the proportion of infected area. The learning framework is designed to operate under a federated
learning paradigm, where raw data remain locally stored at each participating client, and only model parameters
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
are exchanged during training. In this implementation, privacy is achieved through data locality, meaning that
sensitive agricultural images are not transferred to a centralized repository. The proposed framework does not
incorporate additional privacy-enhancing mechanisms such as differential privacy or secure aggregation; there -
fore, it is considered privacy-aware rather than providing formal privacy guarantees. This decentralized set -
ting reflects real-world agricultural deployments, where data sharing is restricted due to privacy, ownership,
and logistical constraints. Additionally, client datasets exhibit significant heterogeneity arising from regional
variations in disease prevalence, environmental conditions, and image acquisition practices. To address these
challenges, the proposed framework jointly learns disease classification and severity estimation while ensuring
privacy conservation and robustness to non-IID data distributions. By integrating severity-aware learning into a
federated setting, the proposed approach enables scalable, collaborative, and privacy-preserving disease moni -
toring across geographically distributed agricultural institutions, thereby supporting large-scale smart agriculture
applications. The methodology flowchart Fig. 3, illustrates a sequential pipeline where raw leaf images are first
collected and preprocessed, followed by Otsu-based segmentation for disease region extraction, feature learning
using a ResNet-18 model enhanced with CBAM attention, integration into a MOON-based federated learning
framework, and finally disease classification with severity estimation through systematic training and evaluation.
Methodology
Dataset description
The rice leaf image dataset used in this study is derived from the publicly available Paddy Doctor Visual Image
Dataset, accessible through IEEE DataPort50, and consists of high-resolution field images collected from paddy
fields in the Tirunelveli district of Tamil Nadu, India, as illustrated in Fig. 4. The dataset contains rice leaf images
captured under natural agricultural field conditions, including variations in illumination, background complexity,
leaf orientation, and disease progression stages, thereby providing realistic environmental diversity for robust
model development. According to the dataset creators, the images were curated and annotated by agricultural
domain experts during the development of the original dataset, with each image assigned a disease label based
on visual symptom analysis under real cultivation conditions. In the present study, these pre-existing annota -
tions were directly used for model training and evaluation, and no additional expert annotation or validation was
performed by the authors. The dataset includes multiple rice leaf diseases such as bacterial leaf blight, bacterial
leaf streak, bacterial panicle blight, blast, brown spot, dead heart, downy mildew, Hispa, tungro, and healthy leaf
samples. Since the disease annotations were already provided as part of the publicly available dataset, no addi -
tional disease annotation was performed by the authors in this study. Although both RGB and infrared images
Fig. 3 Overall workflow of the proposed
MOON-based federated framework, includ-
ing preprocessing, Otsu-based segmentation,
CBAM-enhanced feature extraction, federated
optimization, and severity prediction.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
were available during data acquisition, only RGB images were utilized in this study for disease classification and
severity estimation.
The original Paddy Doctor Visual Image Dataset contains 10,386 RGB images. During the preprocessing
stage, duplicate, low-quality, and incomplete samples were removed as part of dataset organization and qual -
ity verification. Consequently, a total of 8,643 RGB images were retained for the experiments conducted in this
study. The retained images were further subjected to preprocessing to ensure consistency in image resolution and
suitability for disease classification and severity estimation. The dataset captures substantial variability in disease
symptoms and field conditions, making it appropriate for evaluating federated learning under heterogeneous agri-
cultural environments. The original high-resolution images (1080 × 1440 pixels) were resized to a standardized
resolution to facilitate efficient model training and computation. Table 1 presents the class-wise distribution of
the final dataset used in this study.
However, although the dataset provides disease-category annotations, it does not contain explicit severity labels
corresponding to disease progression levels. Therefore, a severity estimation mechanism was introduced in this
study to enable fine-grained disease assessment. Severity labels were algorithmically generated using an Otsu-
based thresholding approach applied to segmented leaf regions in order to quantify the proportion of infected
area relative to the total leaf area. Initially, leaf regions were segmented to separate diseased and healthy portions,
after which a continuous severity index was computed based on the infected-area ratio. The obtained severity
values were subsequently discretized into three predefined severity categories: mild, moderate, and severe. To
ID Disease Type Total Images Class Percentage (%)
1 Bacterial leaf blight 479 5.54
2 Bacterial leaf streak 380 4.40
3 Bacterial panicle blight 337 3.90
4 Blast 1738 20.11
5 Brown spot 965 11.17
6 Dead heart 1442 16.68
7 Downy mildew 620 7.17
8 Hispa 1594 18.44
9 Tungro 1088 12.59
Total 8643 100
Table 1 Class-wise dis-
tribution of the rice leaf
image dataset used in the
experiments.
Fig. 4 Representative rice leaf images from the disease categories used in the study. The examples illustrate the visual vari-
ability of disease symptoms under field conditions and the differences in lesion patterns used by the proposed framework for
disease classification.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
ensure reproducibility and reliability of the automatically generated severity labels, A subset of images was visu-
ally inspected by the authors to verify that the severity labels were consistent with observable lesion distribution
and disease progression characteristics. This inspection was intended only as a qualitative sanity check and did
not involve agricultural domain experts. The segmentation masks and severity assignments were found to be
consistent with expected lesion distributions and infection spread patterns. This integration of expert-annotated
disease labels with severity annotations enabled the construction of a comprehensive dataset suitable for joint
disease classification and severity estimation within a federated learning framework. The present study did not
modify the original disease annotations supplied with the dataset. The proposed methodology utilizes the existing
disease labels for classification, while severity labels use the proposed Otsu-based severity estimation procedure.
Data preprocessing
The raw rice leaf images collected from real field environments exhibit significant variability in illumination,
background clutter, resolution, and leaf orientation. To ensure consistency and improve model generalization,
a structured preprocessing pipeline is applied before training. Initially, all high-resolution RGB images of size-
18 backbone while reducing computational overhead. Let the original image be denoted as 𝑰𝑰 ∈ ℝ𝑯𝑯𝑯 𝑯𝑯𝑯 𝑯 , and the
resized image as 𝑰𝑰𝒓𝒓 ∈ ℝ224× 224× 3 . Subsequently, pixel normalization is performed to scale the intensity values to a
bounded range:
𝑰𝑰n (𝒊𝒊𝒊 𝒊𝒊𝒊 𝒊𝒊) = 𝐼𝐼 (𝑖𝑖𝒊 𝑖𝑖𝒊 𝑖𝑖)255
𝑰𝑰 (𝒊𝒊𝒊 𝒊𝒊𝒊 𝒊𝒊) ∈ {0,1𝒊 … 𝒊 255} represents the raw integer pixel intensity at spatial coordinates (𝒊𝒊𝒊 𝒊𝒊) for color channel
𝒄𝒄 ∈ {𝑹𝑹𝑹 𝑹𝑹𝑹 𝑹𝑹}, and 𝑰𝑰norm (𝒊𝒊𝒊 𝒊𝒊𝒊 𝒊𝒊) ∈ [0𝒊 1] is the normalized floating-point pixel value.
𝑰𝑰𝒏𝒏 =
𝑰𝑰𝒓𝒓
255
where 𝑰𝑰𝒏𝒏 represents the normalized image with pixel values in [0, 1]. This normalization stabilizes gra-
dient updates during training. To enhance lesion visibility and suppress irrelevant background noise, HSV-based
masking is applied to isolate the leaf region. The RGB image is transformed into HSV space:
𝑰𝑰𝑯𝑯𝑯𝑯𝑯𝑯 =𝒇𝒇 𝑯𝑯𝑯𝑯𝑯𝑯 (𝑰𝑰𝒏𝒏)
A binary mask 𝑀𝑀is then generated to extract the leaf region, eliminating soil, sky, and other background artifacts:
𝑰𝑰𝒍𝒍𝒍𝒍𝒍𝒍𝒍𝒍 =𝑰𝑰 𝒏𝒏 ⊙ 𝑴𝑴where ⊙ denotes element-wise multiplication. Finally, grayscale conversion is performed for
severity estimation via Otsu segmentation:
𝑰𝑰𝒈𝒈𝒈𝒈𝒈𝒈𝒈𝒈 =𝒇𝒇 𝒈𝒈𝒈𝒈𝒈𝒈𝒈𝒈 (𝑰𝑰𝒍𝒍𝒍𝒍𝒈𝒈𝒇𝒇)This preprocessing pipeline ensures that the model focuses on disease-relevant regions while
maintaining computational efficiency and robustness across heterogeneous data sources.
Data augmentation
To improve model generalization and mitigate overfitting, extensive data augmentation techniques are applied
during local client training. These transformations simulate real-world variations in agricultural environments,
including changes in viewpoint, lighting, and leaf deformation, as shown in Table 2.
𝑰𝑰′ =𝑻𝑻 (𝑰𝑰𝒏𝒏)
where 𝑻𝑻𝑻⋅ ) represents a stochastic composition of augmentation transformations. These augmentations signifi -
cantly enhance the diversity of training samples, particularly under federated non-IID settings, where each client
may observe limited and biased data distributions.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
Image quality impact analysis
Image quality plays a critical role in determining the performance of deep learning models for plant disease detec-
tion. Variations in resolution, illumination, and noise directly affect feature extraction and classification accuracy.
Low-quality images with poor contrast or motion blur can obscure lesion boundaries, leading to incorrect sever-
ity estimation. Let 𝑸𝑸 (𝑰𝑰) denote the quality of an image, which can be approximated as a function of sharpness,
contrast, and signal-to-noise ratio:
𝑸𝑸 (𝑰𝑰) =𝜶𝜶𝜶𝜶 (𝑰𝑰) +𝜷𝜷𝜷𝜷 (𝑰𝑰) +𝜸𝜸 SNR (𝑰𝑰)
where 𝑺𝑺 (𝑰𝑰), 𝑪𝑪 (𝑰𝑰), and SNR (𝑰𝑰) represent sharpness, contrast, and signal-to-noise ratio, respectively. To ease quality-
related degradation, preprocessing and augmentation steps are designed to standardize illumination and enhance
feature visibility. Additionally, normalization and contrast adjustments ensure that the learned feature representa-
tions remain invariant to environmental variations. The federated setting further amplifies the importance of qual-
ity robustness, as different clients may capture images under diverse field conditions. The proposed framework
ensures stability by learning invariant representations across varying image qualities.
Preprocessing and otsu’s thresholding segmentation
In the proposed framework, disease severity is quantified using an unsupervised image segmentation approach
based on Otsu’s thresholding method. This technique enables automatic separation of diseased and healthy
regions by analysing the grayscale intensity distribution of the leaf image, thereby eliminating the need for
manual threshold selection. Such automation is particularly important in federated learning environments, where
large-scale annotation is impractical.
Let the grayscale leaf image be represented as 𝑰𝑰𝑰𝑰𝑰𝑰 𝑰𝑰𝑰, with intensity levels {0, 1, 2, … , 𝑳𝑳 𝑳 1}. The histogram of
the image is defined as:
𝒑𝒑𝒊𝒊 = 𝒏𝒏𝒊𝒊𝑵𝑵 , 𝒊𝒊 = 𝒊, 𝒊, 𝒊 , 𝒊𝒊 𝒊 𝒊
where 𝒏𝒏𝒊𝒊 is the number of pixels with intensity 𝒊𝒊, and 𝑵𝑵 is the total number of pixels in the leaf region. The objec-
tive of Otsu’s method is to determine an optimal threshold 𝒕𝒕∗ that separates pixels into two classes: corresponding
to healthy tissue ( 𝑪𝑪0) and diseased tissue ( 𝑪𝑪1). The optimal threshold is computed as:
𝒕𝒕∗ = 𝐚𝐚𝐚𝐚𝐚𝐚𝐚𝐚𝐚𝐚𝐚𝐚
𝒕𝒕
𝝈𝝈 2𝒃𝒃 (𝒕𝒕)
where 𝝈𝝈 2𝒃𝒃 (𝒕𝒕)denotes the inter-class variance.
Augmentation Technique Parameters Purpose
Random Rotation ± 25∘ Simulates different camera angles and leaf orientations
Horizontal Flip Probability = 0.5 Captures mirror variations of leaf structures
Vertical Flip Probability = 0.5 Improves invariance to leaf placement
Random Zoom Range = [0.8, 1.2] Mimics varying distances from the camera
Width/Height Shift Range = 0.1 Simulates positional displacement of leaves
Brightness Adjustment Range = [0.7, 1.3] Models’ illumination variability in field conditions
Contrast Variation Range = [0.8, 1.2] Enhances visibility of disease patterns
Gaussian Noise Mean = 0,
Variance = 0.01
Improves robustness to sensor noise
Table 2 Data augmenta-
tion techniques, param-
eter settings, and their
intended effect on model
generalization.
Mathematically, an augmented
image 𝑰𝑰′ is obtained as:
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
Using this threshold, the image is binarized to obtain a segmentation mask distinguishing infected and non-
infected regions. To ensure robustness against illumination variations, all images are pre-processed using gray -
scale conversion and intensity normalization prior to thresholding.
Severity label generation
Following segmentation, disease severity is quantified by computing the ratio of infected pixels to the total leaf
area. Let 𝑷𝑷𝒅𝒅 denote the number of diseased pixels and 𝑷𝑷𝒍𝒍 denote the total number of leaf pixels. The severity index
𝑺𝑺 is defined as:
𝑺𝑺𝑺
𝑷𝑷𝒅𝒅
𝑷𝑷𝒍𝒍
× 100. where S represents the percentage of infected leaf area. The diseased region is extracted using
Otsu-based threshold segmentation, which separates symptomatic and non-symptomatic regions of the rice leaf.
To illustrate the severity estimation process employed in the proposed framework, Fig. 5 presents the Otsu-based
lesion segmentation pipeline used for infected-area extraction and severity label generation. The figure demon -
strates how segmented lesion regions are utilized to compute the severity index from diseased pixel proportions.
The computed continuous severity index is subsequently converted into discrete severity categories to facili -
tate structured model learning, standardized evaluation, and reproducible severity assessment. Based on the per-
centage of infected leaf area, severity levels are defined as:
Severity = {
Mild, 0 ≤ 𝑺𝑺 𝑺 𝑺0𝑺
Moderate, 𝑺1𝑺 ≤ 𝑺𝑺 𝑺 𝑺0𝑺
Severe, 𝑺𝑺 ≥ 𝑺1𝑺
The continuous infected-area ratio obtained from Otsu segmentation was discretized into three severity cat -
egories using predefined thresholds of 0–30% (Mild), 30–70% (Moderate), and > 70% (Severe). These thresh -
olds were selected to provide a simple, deterministic, and reproducible severity grading strategy based on the
Fig. 5 Otsu-based lesion seg-
mentation and severity label
generation process showing leaf
preprocessing, lesion extraction,
infected-area computation, and
severity categorization into mild,
moderate, and severe infection
levels.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
proportion of visibly infected leaf tissue. Leaves exhibiting infection over less than approximately one-third of
the leaf area generally correspond to localized lesions with limited disease progression and are therefore catego-
rized as Mild. Infection affecting between one-third and two-thirds of the leaf surface indicates substantial lesion
expansion and is categorized as Moderate, whereas infection extending beyond approximately two-thirds of the
leaf area reflects widespread tissue damage and advanced disease progression, and is therefore categorized as
Severe. Fixed thresholds were intentionally adopted for all experiments to ensure consistent severity-label gen -
eration across different federated clients and communication rounds, thereby eliminating subjective variations
that could arise from manually selecting image-specific thresholds. Although these thresholds provide a practi -
cal and reproducible severity grading mechanism for this study, they should be regarded as heuristic categories
based on infected-area proportion rather than clinically validated disease-rating scales. Algorithm 1 summarizes
the complete Otsu-based severity estimation pipeline, including HSV-based preprocessing, lesion segmentation,
infected-area computation, severity index calculation, and severity categorization into mild, moderate, and severe
classes.
Severity estimation and validation
Since the dataset does not provide ground truth severity annotations, a validation strategy was designed to assess
the reliability of the automatically generated severity labels. The validation was performed using a combination
of qualitative inspection and quantitative agreement analysis. For qualitative validation, the segmented outputs
obtained through Otsu-based thresholding were visually examined across multiple disease categories. The objec-
tive was to verify whether the extracted regions correspond to visible symptoms such as lesions, chlorosis, and
necrosis. The segmentation masks were observed to constantly align with visually identifiable infected regions,
indicating that the method effectively captures disease-affected areas. To further assess reliability, a subset of
images was randomly selected and annotated based on visual estimation of infected leaf area using the predefined
severity thresholds. Each image in this subset was assigned a severity label (Mild, Moderate, or Severe) follow -
ing the same criteria used for automated label generation. The assigned labels were then compared with the cor-
responding Otsu-based labels to evaluate agreement. The consistency between manual and automated labels was
quantified using standard evaluation metrics, including overall classification accuracy and Cohen’s Kappa coef -
ficient, which measures inter-rater agreement beyond chance. This quantitative validation framework enables an
objective assessment of the reliability of the proposed severity estimation approach. Furthermore, the choice of
Otsu’s method is supported by its effectiveness in handling bimodal intensity distributions, which are commonly
observed in diseased leaf images where infected regions exhibit distinct intensity variations compared to healthy
tissue. Its unsupervised nature ensures reproducibility and eliminates user-dependent bias. While the absence of
fully annotated pixel-level ground truth remains a limitation, the proposed validation strategy provides a practical
Input: RGB leaf image
- Convert the RGB image to HSV color space.
- Extract the leaf region using HSV-based masking to remove background pixels.
- Convert the segmented leaf image to grayscale.
- Compute the grayscale histogram and pixel probabilities.
- For each possible threshold , compute class probabilities, class means, and between-class
variance. - Select the optimal threshold ∗that maximizes between-class variance.
- Apply threshold ∗to segment diseased and healthy regions.
- Count diseased pixels and total leaf pixels .
- Compute the severity index =( / )× 100.
- Assign severity label based on prede/g976ined thresholds:
Mild if 0 ≤ S ≤ 0.30
Moderate if 0.30 < S ≤ 0.70
Severe if S > 0.70
Output: Severity label (Mild / Moderate / Severe)
Algorithm 1: Otsu-Based Severity Quantifica-
tion and Label Generation
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
and scalable mechanism to ensure label reliability in field conditions agricultural scenarios, where large-scale
manual annotation is often infeasible.
ResNet-18–CBAM architecture for joint disease classification and severity prediction
In the proposed work, disease classification is performed using a deep convolutional neural network built upon a
ResNet-18 backbone enhanced with a Convolutional Block Attention Module (CBAM). This design is motivated
by the need to accurately identify visually similar crop diseases that often exhibit subtle and localized symptoms
on leaf surfaces. Traditional CNNs tend to treat all spatial regions and feature channels equally, which can dilute
the discriminative cues present in lesion regions. To address this limitation, attention mechanisms are incorpo -
rated to guide the network toward disease-relevant features.
Let an input RGB image be represented as 𝑿𝑿 ∈ ℝ𝑯𝑯𝑯 𝑯𝑯𝑯 𝑯 . The ResNet-18 backbone extracts hierarchical feature
representations using residual learning. Each residual block learns a residual mapping defined as:
𝐲𝐲 𝐲 𝐲𝐲𝐲𝐲𝐲 𝐲𝐲𝐲 𝐲 𝐲𝐲
where 𝐱𝐱 and 𝐲𝐲 denote the input and output feature maps of the block, and ℱ(⋅ )represents a sequence of convo -
lution, batch normalization, and non-linear activation operations. This residual formulation allows the network
to learn identity mappings easily, thereby mitigating the vanishing gradient problem and enabling deeper archi -
tectures to be trained effectively. In this work, ResNet-18 is selected due to its favourable trade-off between
representational capacity and computational efficiency. Compared to deeper architectures such as EfficientNet
or transformer-based models, ResNet-18 requires significantly fewer parameters and lower computational cost,
which is critical in federated learning settings where client devices may have limited processing power and com-
munication bandwidth. Moreover, prior studies in plant disease classification have demonstrated that lightweight
residual networks provide competitive performance while ensuring faster convergence and reduced communica-
tion overhead, making them suitable for distributed agricultural deployments. The proposed network employs
ResNet-18 as the shared feature extraction backbone. Each input RGB rice leaf image is processed through the
initial convolutional layer, batch normalization, ReLU activation, and max-pooling layer, followed by the four
residual stages (Layer1–Layer4) of ResNet-18. The output feature map generated by the final residual stage
(Layer4) is then passed to a Convolutional Block Attention Module (CBAM). Positioning CBAM after the final
residual stage enables refinement of high-level semantic features by sequentially applying channel attention
followed by spatial attention before global feature aggregation. This placement enhances lesion-related feature
representation while introducing minimal computational overhead, making it suitable for federated learning envi-
ronments. After feature extraction by ResNet-18, CBAM is applied to refine the feature maps. The choice of
CBAM is motivated by its lightweight architecture and its ability to sequentially model channel-wise and spatial
attention without introducing substantial computational overhead. Unlike more complex attention mechanisms,
CBAM effectively enhances discriminative regions while remaining efficient for federated environments. Given
a feature map 𝑭𝑭 ∈ ℝ𝑪𝑪𝑪 𝑪𝑪𝑪 𝑪𝑪 , channel attention is computed using both average pooling and max pooling across
spatial dimensions:
𝐟𝐟𝒂𝒂𝒂𝒂𝒂𝒂 = AvgPool (𝑭𝑭) ,𝐟𝐟 𝒎𝒎𝒂𝒂𝒎𝒎 = MaxPool (𝑭𝑭)
These pooled features are passed through a shared multi-layer perceptron (MLP):
𝑴𝑴𝒄𝒄 (𝑭𝑭) =𝝈𝝈 (MLP (𝐟𝐟𝒂𝒂𝒂𝒂𝒂𝒂) + MLP (𝐟𝐟𝒎𝒎𝒂𝒂𝒎𝒎))
where 𝜎𝜎𝜎 ⋅ )denotes the sigmoid activation. The channel-refined feature map is obtained as:
𝑭𝑭′ =𝑴𝑴 𝒄𝒄 (𝑭𝑭) ⊗ 𝑭𝑭
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
This operation emphasizes channels corresponding to disease-related texture and color patterns. The spatial atten-
tion module highlights where important disease regions are located. From the channel-refined feature map 𝐹𝐹′
, spatial attention is computed as:
𝑴𝑴𝒔𝒔 (𝑭𝑭′ ) =𝝈𝝈 (Conv7× 7 [AvgPool (𝑭𝑭′ ) ; MaxPool (𝑭𝑭′ )])
The final refined feature map is:
𝑭𝑭′′ =𝑴𝑴 𝒔𝒔 (𝑭𝑭′ ) ⊗ 𝑭𝑭′
This enables the model to focus on lesion regions such as spots, streaks, and necrotic patches while suppressing
background and healthy leaf regions. The attention-refined feature map 𝑭𝑭′′ is passed through a global average
pooling layer, producing a feature vector 𝐳𝐳 ∈ ℝ𝑪𝑪. A fully connected layer then outputs disease class scores:
̂𝐲𝐲 𝐲Softmax(𝑾𝑾𝒅𝒅𝐳𝐳𝐳𝐳𝐳 𝒅𝒅)
where 𝑾𝑾𝒅𝒅 and 𝐛𝐛𝒅𝒅 are learnable parameters. The disease classification loss is computed using cross-entropy:
ℒ𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅𝒅 =− ∑ 𝑲𝑲𝒌𝒌𝒌𝒌𝒚𝒚𝒌𝒌𝐥𝐥𝐥𝐥𝐥𝐥 ( ˆ𝒚𝒚𝒌𝒌)
where 𝑲𝑲 is the number of disease classes.
The attention-refined feature map is subsequently passed through a Global Average Pooling (GAP) layer to
obtain a compact shared feature representation. This shared embedding serves as the common latent feature space
for two task-specific prediction heads. The disease classification head consists of a fully connected layer followed
by a Softmax activation to predict the rice disease category. In parallel, the severity prediction head consists of an
independent fully connected layer followed by a Softmax activation to predict one of the three severity categories
(Mild, Moderate, or Severe). Both prediction heads share the same ResNet-18–CBAM backbone and are jointly
optimized during local training using disease classification loss, severity prediction loss, and the MOON contras-
tive loss. This multi-task design enables the backbone to learn feature representations that are simultaneously
discriminative for disease recognition and informative for severity estimation. Disease classification is jointly
optimized with severity prediction using a multi-task learning strategy. The shared backbone learns common
representations, while task-specific heads predict disease type and severity index. Training is performed locally
on each client, and model updates are aggregated using federated averaging, ensuring data privacy and scalability.
This flowchart Fig. 6 illustrates a multi-task deep learning architecture using a ResNet-18 backbone integrated
with CBAM attention modules to simultaneously perform plant disease classification and severity estimation
from leaf images.
Model-based severity prediction
The severity index is a quantitative measure designed to assess the extent of disease progression on a plant leaf.
While disease classification identifies the infection type, severity estimation evaluates the proportion of the leaf
area affected, which is crucial for precision agriculture decisions such as treatment scheduling, monitoring, or
no intervention. In this study, disease severity is categorized into three levels: Mild, Moderate, and Severe, cor -
responding to increasing infection spread. According to the adopted scale, severity estimation is categorized into
three discrete levels based on the proportion of infected leaf area. Mild severity corresponds to infection ratios
between 0 and 30%, moderate severity corresponds to infection ratios between 30% and 70%, and severe severity
corresponds to infection ratios exceeding 70%. These thresholds provide a standardized and reproducible severity
grading mechanism for federated severity prediction. Severity estimation is formulated as a multi-class learning
problem with 𝑪𝑪𝑪𝑪 classes. Given an input leaf image 𝒙𝒙, Discriminative features are extracted using a ResNet-18
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
backbone augmented with Convolutional Block Attention Modules (CBAM), which emphasize lesion regions,
discoloration, and texture abnormalities associated with disease intensity.
Let 𝒇𝒇𝒌𝒌 (𝒙𝒙) ∈ ℝ𝒅𝒅 denote the feature embedding produced at the client 𝒌𝒌. These features are passed to a severity
prediction head consisting of a fully connected layer followed by a softmax function:
̂𝐲𝐲𝒔𝒔 = Softmax (𝑾𝑾𝒔𝒔𝒇𝒇𝒌𝒌( 𝒙𝒙 𝒙𝒙𝒙𝒙 𝒔𝒔𝒙,
where ̂𝐲𝐲𝒔𝒔 = [𝒑𝒑1,𝒑𝒑 2,𝒑𝒑 3] represents the predicted probabilities for Mild, Moderate, and Severe classes. To obtain a
continuous severity indicator, a severity index is computed as a weighted sum of class probabilities:
Severity Index (𝒙𝒙) = ∑ 𝑪𝑪𝒊𝒊𝒊𝒊𝒑𝒑𝒊𝒊 ⋅ 𝒔𝒔𝒊𝒊,
where 𝒔𝒔𝒊𝒊 ∈{ 1, 2, 3} denotes the numeric severity score. This formulation captures gradual transitions between
severity index beyond hard class assignments. The severity head is trained using categorical cross-entropy loss:
Input: Leaf image
Output: Severity label and severity index
- Extract feature embedding ( )from the input image using ResNet-18 with CBAM.
- Compute severity index probabilities
=[ , , ]
using the severity prediction head. - Assign severity index and infection ranges: Mild (Class 1, 0–30%), Moderate (Class 2,
31–70%), Severe (Class 3, >71%). - Compute the severity index as
Severity Index( )= ⋅1 + ⋅2 + ⋅3 . - Determine the severity label as
Severity Label = arg max
∈{ , , }
. - Output the severity label and severity index.
Algorithm 2: Severity Prediction
Fig. 6 Architecture of the ResNet-18 with CBAM backbone for multi-task plant disease classification and severity estimation.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
𝑳𝑳severity =− ∑ 𝑪𝑪𝒊𝒊𝒊𝒊𝒚𝒚𝒔𝒔 (𝒊𝒊) 𝐥𝐥𝐥𝐥𝐥𝐥 ( ˆ𝒚𝒚𝒔𝒔( 𝒊𝒊 )) .
Within the federated MOON framework, severity learning is jointly optimized with disease classification and
contrastive representation alignment. The total local objective is defined as:
𝑳𝑳total =𝑳𝑳 disease +𝝀𝝀 𝒔𝒔𝑳𝑳severity +𝝀𝝀 𝒎𝒎𝑳𝑳MOON.
Severity prediction is performed locally at each client, and only model parameters are shared for aggregation, pre-
serving data privacy. By integrating probabilistic severity estimation with MOON-based representation consis -
tency, the proposed framework enables robust, privacy-preserving severity assessment under non-IID federated
settings, making it suitable for large-scale agricultural deployments. Algorithm 2 performs severity prediction
by extracting features from the input leaf image using ResNet-18 with CBAM, computing class probabilities for
mild, moderate, and severe infection, and then determining the final severity label via the maximum probability
while calculating a weighted severity index based on these probabilities.
Handling class imbalance
The dataset exhibits inherent class imbalance due to the natural prevalence of certain diseases over others in
field conditions. This imbalance can bias the model toward majority classes, degrading performance on minority
classes. Let 𝑵𝑵𝒄𝒄 denote the number of samples in class 𝒄𝒄, and 𝑪𝑪 be the total number of classes. The imbalance
ratio is defined as:
𝑰𝑰𝑰𝑰 𝑰
𝐦𝐦𝐦𝐦𝐦𝐦(𝑵𝑵𝒄𝒄 )
𝐦𝐦𝐦𝐦𝐦𝐦(𝑵𝑵𝒄𝒄 )
To address this issue, a combination of data-level and algorithm-level strategies is employed. At the
data level, augmentation is selectively applied more aggressively to minority classes, effectively increasing their
representation. At the algorithm level, class-weighted cross-entropy loss is used:
ℒ𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘 =− ∑ 𝑪𝑪𝒄𝒄𝒄𝒄𝒘𝒘𝒄𝒄𝒚𝒚𝒄𝒄𝐥𝐥𝐥𝐥𝐥𝐥 ( ˆ𝒚𝒚𝒄𝒄)
where the class weight 𝒘𝒘𝒄𝒄 is defined as:
𝒘𝒘𝒄𝒄 = 𝑵𝑵𝑪𝑪 ⋅ 𝑵𝑵𝒄𝒄
and 𝑵𝑵 is the total number of samples. This formulation ensures that minority classes contribute more significantly
to the loss, improving recall and F1-score in imbalanced scenarios.
Dataset imbalance analysis and robustness strategy
A rigorous analysis of class distribution is fundamental for designing reliable deep learning models, particularly
in a federated learning environment where data heterogeneity is inherently amplified. The dataset employed in
this study exhibits significant class imbalance, as summarized in Table 3, which mirrors field conditions agricul-
tural scenarios where certain rice diseases occur more frequently than others due to environmental and climatic
variations.
𝑰𝑰𝑰𝑰 𝑰 𝐦𝐦𝐦𝐦𝐦𝐦 (𝑵𝑵𝒄𝒄)𝐦𝐦𝐦𝐦𝐦𝐦 (𝑵𝑵𝒄𝒄)
where 𝑵𝑵𝒄𝒄 denotes the number of samples in class 𝒄𝒄. A high value of 𝑰𝑰𝑰𝑰 indicates severe imbalance, necessitating
targeted mitigation strategies. In the context of federated learning, this challenge becomes more pronounced due
to non-IID data partitioning across clients. Each client may possess a highly skewed subset of classes, which
can significantly affect global model convergence. To address this, a Dirichlet-based distribution is employed to
simulate realistic client-level heterogeneity:
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
𝐩𝐩𝒄𝒄 ∼ Dirichlet (𝜶𝜶 )
where 𝜶𝜶 is the concentration parameter controlling the degree of skewness. Lower values of 𝛼𝛼 result in highly
imbalanced client distributions, thereby emulating field conditions decentralized agricultural data collection sce-
narios. To enhance robustness against such imbalance, the proposed framework integrates MOON-based contras-
tive learning, which enforces representation consistency between local and global models. This mechanism can
be expressed as:
ℒ𝑴𝑴𝑴𝑴𝑴𝑴𝑴𝑴 =ℒ 𝑪𝑪𝑪𝑪 +𝝁𝝁 ⋅ ℒ𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄
where ℒ𝑪𝑪𝑪𝑪 denotes the standard cross-entropy loss, and ℒ𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄𝒄 aligns local representations with the global
feature space. This alignment reduces the tendency of local models to overfit dominant classes and helps pre -
serve discriminative features for minority categories. Furthermore, model evaluation is conducted using macro-
averaged metrics to ensure unbiased performance assessment across all classes. The macro-averaged F1-score is
defined as:
𝑭𝑭𝑭𝒎𝒎𝒎𝒎𝒎𝒎𝒎𝒎𝒎𝒎 = 𝑭𝑪𝑪 ∑ 𝑪𝑪𝒎𝒎𝒄𝒄𝑭𝑭𝑭𝒎𝒎
where 𝑪𝑪 represents the total number of classes. Unlike accuracy, which can be misleading in imbalanced set -
tings, macro-averaged metrics assign equal importance to each class, thereby providing a more reliable measure
of model performance. Collectively, this multi-level strategy, encompassing dataset-level analysis, controlled
non-IID distribution, contrastive representation learning, and balanced evaluation metrics, ensures that the pro -
posed federated framework achieves robustness, fairness, and generalization even under severe class imbalance
conditions.
Design foundation and architectural justification
The design choices in the proposed framework are guided by both practical deployment considerations and
robustness under heterogeneous data distributions. The selection of ResNet-18 as the backbone network is moti-
vated by its relatively lightweight architecture and reduced computational complexity compared to deeper mod-
els such as EfficientNet or Vision Transformers, making it suitable for edge-device deployment in agricultural
environments where computational resources are limited. Furthermore, the incorporation of the Convolutional
Block Attention Module (CBAM) enhances feature representation by sequentially applying channel and spatial
attention, enabling the model to focus on disease-relevant regions while effectively suppressing background noise
commonly present in field-acquired images. For federated optimization, the MOON framework is adopted due to
Table 3 Class-wise distribution and imbalance analysis of the dataset.
Disease Class Number of Images Class Percentage (%) Imbalance Level
Bacterial Leaf Blight 479 5.54 Minority
Bacterial Leaf Streak 380 4.39 Minority
Bacterial Panicle Blight 337 3.89 Minority
Blast 1738 20.11 Majority
Brown Spot 965 11.16 Moderate
Dead Heart 1442 16.69 Majority
Downy Mildew 620 7.17 Moderate
Hispa 1594 18.45 Majority
Tungro 1088 12.59 Moderate
The imbalance is quantitatively evident, with dominant classes such as Blast and Hispa contributing a disproportionately large number of
samples, whereas bacterial diseases constitute a relatively small fraction of the dataset. This skewed distribution introduces a bias in model
learning, where the optimization process tends to favor majority classes, leading to degraded sensitivity and generalization for minority classes.
To formally characterize the imbalance, the imbalance ratio 𝑰𝑰𝑰𝑰 is defined as:
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
its ability to mitigate client drift through representation-level contrastive learning, offering improved convergence
stability compared to conventional methods such as FedAvg and FedProx, particularly under non-IID data distri-
butions. The Dirichlet distribution parameter α is set to 0.3 to simulate realistic data heterogeneity, where certain
disease classes and severity index are unevenly distributed across clients, reflecting field conditions agricultural
scenarios. Additionally, the number of communication rounds is fixed at eight based on empirical convergence
observations, where further increases resulted in marginal performance gains while incurring higher communi -
cation overhead. Collectively, these design decisions ensure a balance between computational efficiency, model
generalization, and robustness in decentralized and resource-constrained agricultural settings.
Federated data distribution across clients using the dirichlet distribution
In practical FL deployments for agricultural applications, data collected from geographically distributed regions
is inherently heterogeneous. Variations in agro-climatic conditions, cultivation practices, disease prevalence, crop
growth stages, and image acquisition protocols result in substantial differences in disease categories and sever -
ity distributions across locations. Consequently, the commonly assumed independent and identically distributed
(IID) data setting is unrealistic and often leads to overly optimistic performance estimates that do not generalize
to real-world agricultural systems. To reflect operational conditions faithfully, this study explicitly adopts a non-
IID data distribution across clients, where each client possesses a statistically distinct and locally biased dataset.
In this work, non-IID partitioning is designed to simulate decentralized rice disease monitoring across multiple
regional agricultural institutions. Each client represents an independent research centre or field station, with
variations introduced in both disease class frequencies and severity-level distributions. As the number of clients
increases, statistical heterogeneity becomes more pronounced. Smaller configurations (5 and 10 clients) allow
each client to observe relatively larger datasets with partial overlap in disease and severity categories, whereas
larger configurations (15 and 36 clients) result in smaller, highly skewed local datasets dominated by a limited
subset of diseases and severity index. The 36-client setting closely reflects a national-scale deployment across
India, where regional centres typically observe only locally prevalent disease patterns.
To systematically control the degree of heterogeneity, data partitioning is performed using a Dirichlet distribu-
tion. Let the dataset contain 𝑲𝑲 disease classes and 𝑪𝑪 clients. For each disease class 𝒌𝒌 ∈{ 1, 2, … , 𝑲𝑲}, a class-wise
proportion vector.
𝝅𝝅 𝒌𝒌 = [𝝅𝝅 𝒌𝒌𝒌𝒌,𝝅𝝅 𝒌𝒌𝒌𝒌,… ,𝝅𝝅 𝒌𝒌𝒌𝒌𝒌]
is sampled as
𝝅𝝅 𝒌𝒌 ∼ Dirichlet (𝜶𝜶𝜶 ) ,
where 𝜶𝜶 is the concentration parameter and 1 is a vector of ones. The value 𝝅𝝅 𝒌𝒌𝒌𝒌𝒌 determines the fraction of
samples from class 𝒌𝒌 assigned to the client 𝒄𝒄. A low 𝛼𝛼 is chosen to induce strong label and severity skew, closely
mimicking real agricultural data collection patterns. Evaluating the proposed framework under large-scale, highly
non-IID settings, particularly the 36-client configuration, constitutes a methodological strength. It provides a
rigorous stress test for robustness, scalability, and convergence under extreme statistical heterogeneity, demon -
strating suitability for nation-scale, privacy-preserving agricultural monitoring systems. The figures provide a
comprehensive visualization of how non-IID data distributions are structured across clients in federated learning,
using a Dirichlet allocation with concentration parameter α = 0.3 is selected to simulate a strongly non-IID setting.
This choice is motivated by prior federated learning studies, where values in the range of 0.1 to 0.5 are commonly
used to model realistic data imbalance. A lower value of 𝛼𝛼 leads to highly skewed client distributions, where each
client observes only a limited subset of disease classes and severity index. The selected value of 𝛼𝛼 𝛼 𝛼𝛼𝛼 provides
a balance between extreme heterogeneity and sufficient data availability per client, ensuring that local models
can still learn meaningful representations while preserving realistic distribution shifts observed in agricultural
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
datasets. This setting is particularly suitable for simulating regional agricultural institutions, where disease pat -
terns are localized and unevenly distributed. Together, they highlight the richness of class diversity across clients
and demonstrate the scalability of federated systems as the number of participating clients increases. These
figures illustrate the distribution of data samples across clients. At k = 5 shown in Fig. 7(a), each client receives
a substantial subset of data, and all classes are represented across the federation, ensuring diversity in local
datasets. At k = 10 shown in Fig. 7(b), the distribution becomes more fine-grained, with each client contributing
distinct proportions of classes. To evaluate the robustness of the proposed framework under different realizations
of non-IID data distributions, five independent experimental runs were conducted for each client configuration (5,
10, 15, and 36 clients). In each run, a new client partition was generated by independently sampling the Dirichlet
distribution while maintaining the same concentration parameter (α = 0.3). Consequently, the disease-class allo-
cation among clients varied across runs, providing multiple statistically distinct non-IID federated scenarios. All
other experimental settings, including the model architecture, hyperparameters, communication rounds, and local
training procedure, were kept identical. The reported performance metrics correspond to the mean and standard
deviation obtained over these five independent runs, thereby reducing the influence of any single random client
partition and providing a more reliable assessment of model robustness under heterogeneous data distributions.
By k = 15 shown in Fig. 7 (c), the distribution demonstrates even greater granularity, with clients holding unique
combinations of classes. This progression highlights the scalability of federated learning, where increasing the
number of clients enriches the global model by integrating knowledge from a wider variety of local perspectives.
This figure extends the analysis to 36 clients, showcasing the system’s ability to scale to large federations. Each
client contributes meaningful subsets of classes, and collectively, the federation maintains representation across
all categories shown in Fig. 7(d). The visualization demonstrates that federated learning can successfully accom-
modate large-scale participation, integrate diverse data sources, while preserving class coverage. This reflects the
robustness of the framework in field conditions scenarios where many clients contribute simultaneously.
This figure provides a complementary perspective by tracking the sample sizes of each class as the number
of clients increases (k = 5,10,15,36) in Fig. 7(e). The results confirm that all classes remain represented across
different client configurations, even as the federation scales. This balanced representation ensures that the global
model benefits from comprehensive exposure to all classes, supporting effective generalization. The visualization
highlights the adaptability of federated learning, showing that class diversity is preserved across varying scales
of client participation.
Together, these figures demonstrate the strength of federated learning in leveraging heterogeneous, non-IID
data distributions. The Dirichlet-based partitioning ensures that each client contributes unique yet complemen -
tary subsets of the dataset, enriching the global model with diverse class information. As the number of clients
increases, the system scales effectively, maintaining representation across all classes and enabling collaborative
learning at larger scales. These results highlight the adaptability and robustness of federated learning frameworks,
confirming their suitability for field conditions applications where data is naturally distributed and heterogeneous.
Proposed MOON-based federated learning for disease and severity prediction
The proposed system adopts an FL paradigm, as shown in Fig. 8, to enable collaborative training of a disease
and severity prediction model across multiple geographically distributed agricultural institutions while preserv -
ing data privacy. Instead of aggregating all paddy leaf images at a centralized location, the dataset is partitioned
across multiple clients, each representing an independent agricultural research centre or state-level organization.
In this study, the federated setup is simulated using 5, 10, 15, and 36 clients, where the 36-client configuration
reflects a realistic nationwide deployment scenario across India. Each client retains exclusive access to its local
data and participates in training without sharing raw images, thereby adhering to field conditions data governance
and privacy constraints. At the beginning of federated training, a central server initializes a global model ℳ𝒈𝒈
, which consists of a ResNet-18 backbone augmented with a CBAM, followed by two task-specific classifica -
tion heads for disease identification and severity prediction. The global model parameters are broadcast to all
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
Fig. 7 (a). Class and sample distribution across simulated federated clients under the Dirichlet-based non-IID partitioning
scheme (Non-IID, α = 0.3, k = 5) (b). Class and sample distribution across simulated federated clients under the Dirichlet-
based non-IID partitioning scheme (Non-IID, α = 0.3, k = 10). (c). Class and sample distribution across simulated federated
clients under the Dirichlet-based non-IID partitioning scheme (Non-IID, α = 0.3, k = 15). (d). Class and sample distribution
across simulated federated clients under the Dirichlet-based non-IID partitioning scheme (Non-IID, α = 0.3, k = 36). (e).
Sample-size distribution across disease classes for the different client configurations.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
participating clients. Each client 𝑘𝑘initializes its local model ℳ𝒌𝒌 using the received global parameters and per -
forming multiple epochs of local training on its private dataset. Due to variations in regional disease prevalence,
severity distribution, environmental conditions, and image acquisition settings, the data across clients is inher -
ently non-independent and non-IID. Under such heterogeneity, conventional FedAvg often suffers from client
drift, where local models diverge from the global optimization objective, leading to unstable convergence and
degraded global performance. Federated Averaging defines how local edge model updates are aggregated into the
global weights is shown in the equation below equation
𝑤𝑤𝑡𝑡𝑡𝑡 = ∑ 𝐾𝐾𝑘𝑘𝑘𝑡 𝑛𝑛𝑘𝑘𝑁𝑁 𝑤𝑤𝑡𝑡𝑡𝑡𝑘𝑘
Fig. 7 (continued)
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
𝒘𝒘𝒕𝒕𝒕𝒕 represents the updated global model weights at communication round 𝒕𝒕𝒕𝒕 , 𝑲𝑲 is the number of active partici-
pating clients, 𝑛𝑛𝑘𝑘 is the local sample size on client 𝒌𝒌, 𝑵𝑵𝑵 ∑ 𝑲𝑲𝒌𝒌𝒌𝒌𝒏𝒏𝒌𝒌 is the total sample count across participating
clients, and 𝒘𝒘𝒕𝒕𝒕𝒕𝒌𝒌 is the local model weight vector uploaded from client 𝒌𝒌.
To mitigate client drift caused by non-IID data, the MOON framework is integrated into the FL pipeline.
MOON introduces a contrastive learning mechanism at the feature representation level, ensuring that local model
updates remain aligned with the global representation space. During local training, each client extracts feature
embeddings for the same input image 𝒙𝒙 from three different models:
● 𝒇𝒇𝒌𝒌 (𝒙𝒙): feature representation from the current local model at the client 𝑘𝑘,
● 𝒇𝒇𝒈𝒈 (𝒙𝒙): feature representation from the current global model,
● 𝒇𝒇𝒑𝒑 (𝒙𝒙): feature representation from the global model of the previous communication round.
All feature representations are extracted from the shared backbone (ResNet-18 + CBAM) before the classification
heads. To ensure fair comparison, embeddings are normalized using L2 normalization. The similarity between
two feature vectors is computed using cosine similarity:
sim(𝒂𝒂𝒂 𝒂𝒂𝒂 𝒂 𝒂𝒂 ⋅ 𝒂𝒂∥ 𝒂𝒂 ∥∥ 𝒂𝒂 ∥
MOON enforces representation consistency by encouraging similarity between the local and current global model,
while discouraging similarity with the outdated global model. This mechanism effectively reduces client drift and
stabilizes training under non-IID conditions. After local training, each client transmits only model parameters to
Fig. 8 Overall architecture of the proposed MOON-based federated learning framework for rice leaf disease classification
and severity estimation.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
the central server. No raw data or intermediate features are shared. The server aggregates the received parameters
using Federated Averaging:
𝜽𝜽
(𝒕𝒕𝒕𝒕)
𝒈𝒈 = ∑ 𝑲𝑲𝒌𝒌𝒌𝒕 𝒏𝒏𝒌𝒌∑ 𝑲𝑲𝒋𝒋𝒌𝒕𝒏𝒏𝒋𝒋 𝜽𝜽 (𝒕𝒕)𝒌𝒌
where 𝒏𝒏𝒌𝒌 denotes the number of samples at the client 𝒌𝒌, and 𝑲𝑲 is the total number of clients. The updated global
model is then redistributed for the next communication round, while the previous global model is retained for
contrastive learning. This iterative process continues until convergence. Algorithm 3 describes a MOON-based
federated learning framework in which multiple clients collaboratively train a global model for disease classifica-
tion and severity prediction by optimizing a combined loss of classification, severity, and contrastive (MOON)
objectives, with periodic server-side aggregation of locally updated models. The selection of the MOON frame -
work is driven by its effectiveness in handling statistical heterogeneity inherent in field conditions federated agri-
cultural systems. Unlike traditional approaches such as FedAvg, which do not explicitly address representation
Algorithm 3: MOON-Based Federated Learning
for Disease and Severity Prediction
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
divergence, or FedProx and SCAFFOLD, which introduce parameter-level constraints or control variates, MOON
operates directly in the feature space through contrastive learning. This enables explicit alignment of local and
global feature representations, which is particularly advantageous for image-based disease analysis tasks where
subtle visual patterns and localized features are critical for accurate classification. Furthermore, the integration
of MOON enhances convergence stability and improves generalization performance under highly non-IID data
distributions, especially in large-scale settings such as the 36-client configuration. These characteristics make
MOON a suitable and effective choice for developing a scalable, privacy-preserving, and robust federated learn-
ing framework for nationwide agricultural disease monitoring systems.
Loss function and optimization
The proposed framework employs a multi-task optimization strategy that jointly learns disease classification,
severity prediction, and representation alignment. The disease classification task is trained using categorical
cross-entropy loss, which measures the discrepancy between the predicted disease probabilities and the ground
truth labels. Similarly, severity prediction is formulated as a multi-class classification problem and optimized
using categorical cross-entropy loss. To address the challenges posed by non-IID data in federated learning, a
contrastive loss component based on the MOON framework is incorporated. This loss operates at the feature
representation level and encourages the local model to align with the current global model while diverging from
the previous global model. The contrastive objective is defined as:
ℒMOON = −𝐥𝐥𝐥𝐥𝐥𝐥 𝐞𝐞𝐞𝐞𝐞𝐞 (sim( 𝒇𝒇𝒌𝒌 (𝒙𝒙) ,𝒇𝒇 𝒈𝒈 (𝒙𝒙))/𝝉𝝉 )𝐞𝐞𝐞𝐞𝐞𝐞 (sim( 𝒇𝒇𝒌𝒌 (𝒙𝒙) ,𝒇𝒇 𝒈𝒈 (𝒙𝒙))/𝝉𝝉 ) 𝝉 𝐞𝐞𝐞𝐞𝐞𝐞 (sim( 𝒇𝒇𝒌𝒌 (𝒙𝒙) ,𝒇𝒇 𝒑𝒑 (𝒙𝒙))/𝝉𝝉 )
where 𝝉𝝉 is a temperature parameter controlling the sharpness of the similarity distribution. The overall training
objective combines all components into a unified loss function:
𝑳𝑳total =𝑳𝑳 disease +𝝀𝝀 𝒔𝒔𝑳𝑳severity +𝝀𝝀 𝒎𝒎𝑳𝑳MOON
w. re 𝝀𝝀 𝒔𝒔 and 𝝀𝝀 𝒎𝒎 These are weighting coefficients that balance the contributions of severity prediction and contras-
tive learning, respectively. This formulation ensures that the model simultaneously learns discriminative features
for disease classification and severity estimation while maintaining consistency across distributed clients. The
combined optimization objective enables robust learning under heterogeneous data distributions and enhances
the overall performance and stability of the federated system.
Training protocol
The training protocol of the proposed framework is built upon a MOON-based federated learning strategy to
ensure stable convergence and robustness under non-IID data distributions. Initially, the central server initializes
the global model and broadcasts it to all participating clients. Each client performs local training on its private
dataset without sharing raw data, thereby preserving data privacy. During each communication round, clients
train the model locally for a fixed number of epochs using mini-batch optimization, where feature representa -
tions are extracted using the ResNet-18 with CBAM backbone, followed by parallel heads for disease classifica-
tion and severity estimation. Unlike conventional federated learning, the local objective function incorporates
MOON-based contrastive loss in addition to disease classification and severity prediction losses, enabling align-
ment between local and global feature representations while explicitly reducing client drift. For each input, fea -
ture embeddings from the current local model, current global model, and previous global model are compared
using cosine similarity to compute the contrastive objective. After local training, only model parameters are
transmitted to the server, where aggregation is performed using weighted federated averaging (FedAvg), and the
updated global model is redistributed for the next round while retaining the previous global model for contrastive
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
learning. This iterative optimization continues for a fixed number of communication rounds, ensuring consistent
global convergence even under high statistical heterogeneity. The detailed training configuration governing local
updates, MOON integration, and communication strategy is summarized in Table 4.
Hyperparameter configuration
The selection of hyperparameters in the proposed federated learning framework is guided by a combination of
empirical tuning and established practices reported in prior federated and deep learning studies. Initial ranges for
critical parameters, including the learning rate, batch size, number of local epochs, and communication rounds,
were identified based on commonly adopted configurations in convolutional neural networks and federated opti-
mization literature. These parameters were subsequently refined through a series of controlled pilot experiments
conducted under non-IID data settings to ensure stable convergence, improved generalization, and robustness
across heterogeneous client distributions. The final configuration reflects a careful trade-off between convergence
stability, computational efficiency, and communication overhead, which are key challenges in federated learning
environments. Table 5 presents the finalized hyperparameter settings of the proposed MOON-based federated
learning system for rice leaf disease classification and severity estimation. The learning rate was set to 0.0001 to
ensure stable and gradual model convergence under non-IID federated learning conditions. In heterogeneous cli-
ent environments, lower learning rates are commonly preferred as they help mitigate the impact of client drift and
prevent instability during local updates. This choice is also consistent with prior studies in federated optimization
Hyperparameter Value Description
Activation functions ReLU,
Softmax
ReLU is used for feature learning, while Softmax produces
probabilistic outputs for classification tasks.
Contrastive loss MOON = 0.5 Model-contrastive loss is used to align local and global feature
representations and mitigate client drift.
Dirichlet parameter Α = 0 . 3 Controls how unevenly data is split across clients.
Severity loss weight
(λₛ)
0.5 Controls the contribution of the severity estimation loss relative
to the disease classification loss during multi-task optimization.
MOON loss weight
(λₘ)
0.1 Controls the influence of the MOON contrastive loss used for
aligning local and global feature representations and reducing
client drift.
MOON temperature (τ) 0.5 Controls the sharpness of the contrastive similarity distribution
during MOON-based representation alignment.
Table 5 Hyperparameter set-
tings in the proposed model.
Parameter Value Description
Framework MOON-based FL model Model-contrastive federated
optimization
Global model initialization Central server Initial global model broadcast to
clients
Number of clients 5, 10, 15, 36 Different federation scales
Communication rounds 8 Total global aggregation iterations
Local epochs per round 3 Local training iterations per client
Batch size 32 Samples per training step
Optimizer Adam Adaptive optimizer for stable training
Learning rate 0.0001 Step size for parameter updates
Loss function CE (disease) + CE (severity) +
MOON loss
Joint multi-task + contrastive loss
Contrastive components Local, Global, Previous Global Used for representation alignment
Aggregation method FedAvg Weighted averaging of client models
Model backbone ResNet-18 + CBAM Feature extraction network
Training strategy Multi-task + Contrastive learning Joint disease and severity prediction
Data sharing Not allowed Only model weights are exchanged
Table 4 Training protocol
configuration of the pro-
posed federated learning
framework.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
and deep learning, where conservative learning rates are used to maintain convergence stability when training
across distributed and statistically diverse datasets. Disease classification and severity prediction were optimized
using categorical cross-entropy losses. The severity prediction loss was assigned a weighting coefficient of λₛ
= 0.5, while the MOON contrastive loss was weighted by λₘ = 0.1. The contrastive temperature parameter was
fixed at τ = 0.5 throughout all experiments. The CBAM module was embedded within the ResNet-18 backbone
and trained jointly with the backbone parameters using the same optimizer and learning rate; therefore, no inde-
pendent optimization settings were used for CBAM.
The Adam optimizer is employed due to its adaptive learning mechanism and robustness to noisy and sparse
gradients, which are common in decentralized training scenarios. Its ability to dynamically adjust learning rates
for individual parameters contributes to faster convergence and improved training stability when compared to
conventional stochastic gradient descent methods, particularly in federated settings. A batch size of 32 is used
to maintain a balance between computational efficiency and gradient stability. Experimental observations indi -
cated that smaller batch sizes introduced higher variance in gradient updates, while larger batch sizes increased
memory consumption and reduced the frequency of parameter updates. The selected batch size ensures efficient
utilization of computational resources while preserving stable optimization dynamics. The number of local train-
ing epochs per client is fixed at 3, which was determined empirically to balance local learning capability and
global model consistency. Increasing the number of local epochs resulted in improved local fitting but signifi -
cantly increased client drift due to non-IID data distributions. On the other hand, reducing the number of epochs
limited the model’s ability to learn meaningful feature representations. Therefore, three local epochs provide an
effective compromise between local model expressiveness and global alignment. The number of communication
rounds is set to 8 based on convergence analysis performed during preliminary experiments. It was observed
that the majority of performance improvements occurred within the early communication rounds, after which
the gains became marginal. This configuration reduces communication overhead while ensuring sufficient global
model convergence. To systematically evaluate scalability and robustness, the number of participating clients is
varied across 5, 10, 15, and 36. These configurations simulate increasing levels of decentralization and statistical
heterogeneity, ranging from moderately distributed environments to highly fragmented field conditions in agri -
cultural scenarios. In the proposed architecture, the Rectified Linear Unit (ReLU) activation function is utilized
in convolutional layers due to its computational efficiency and effectiveness in mitigating vanishing gradient
problems, while the Softmax function is applied in the output layer to generate probabilistic predictions for both
classification and severity estimation tasks. To address the challenge of representation divergence under non-IID
data, the MOON-based contrastive loss is incorporated into the training objective with a weighting factor of
0.5. This value was selected through empirical tuning to balance the influence of the classification loss and the
contrastive alignment objective. A lower weight reduced the effectiveness of representation alignment, whereas
a higher weight negatively impacted classification performance. The chosen value ensures effective alignment
between local and global feature representations while preserving task-specific learning. Furthermore, the non-
IID nature of the client data distribution is modelled using a Dirichlet distribution with a concentration parameter
α = 0.3. This parameter was selected to simulate realistic heterogeneous data partitions, where smaller values of
α result in higher statistical heterogeneity across clients. The chosen setting enables rigorous evaluation of the
proposed framework under challenging field conditions, thereby strengthening the reliability and generalizability
of the experimental results.
Hardware and software infrastructure
The implementation of the proposed FedEMNet framework was carried out using a high-performance computing
environment to facilitate efficient model training, federated simulation, and evaluation. The experiments were
executed on a Kaggle-hosted Jupyter Notebook environment with sufficient computational resources and popular
deep learning libraries. The details of the hardware and software configurations used are provided in Table 6.
Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-76513-w
This environment ensured sufficient computational power to simulate federated learning across multiple cli -
ents and perform contrastive learning with EfficientNet-B0. The code was modularized for easy experimentation
across different parameters and client configurations.
Results
This part provides the experimental outcome of the proposed MOON-CBAM-based federated learning frame -
work classification and severity progression prediction of the rice leaf disease. The measures will be classification
accuracy, the performance in severe prediction, convergence behaviour, and how it works when faced with dif -
ferent amounts of client heterogeneity. The experiments are given a non-IID data distribution with varying client
numbers to determine the term scalability and practicality.
Validation of otsu-based severity labels
To evaluate the reliability of the automatically generated severity labels, a small-scale validation study was con-
ducted using a annotated subset of images shown in Table 7. The same predefined severity thresholds were con-
sistently used during both manual annotation and automated severity estimation to ensure unbiased validation.
Since pixel-level ground truth severity annotations are not available in the dataset, Manual severity labels for the
validation subset were assigned by the authors through visual estimation of the infected leaf area using the pre -
defined severity thresholds. These labels were used solely to assess the consistency of the proposed Otsu-based
Table 7 Validation of Otsu-based severity categories against person-assigned visual reference labels on the manually
inspected image subset.
Image ID Manual Label Otsu Label Agreement
01 Mild Mild Yes
02 Moderate Moderate Yes
03 Severe Moderate No
04 Mild Mild Yes
05 Moderate Moderate Yes
06 Severe Severe Yes
07 Mild Mild Yes
08 Moderate Severe No
09 Severe Severe Yes
10 Mild Moderate No
Note: The reference severity labels were assigned by
论文原文与出版信息
Scientific Reports