FedAgain: A Trust-Based and Robust Federated Learning Strategy for an Automated Kidney Stone Identification in Ureteroscopy
Authors: Ivan Reyes-Amezcua, Francisco Lopez-Tiro, Clément Larose, Christian Daul, Andres Mendez-Vazquez, Gilberto Ochoa-Ruiz
Organizations: Centro de Investigación y de Estudios Avanzados del IPN (CINVESTAV), Departamento de Ciencias Computacionales, Guadalajara, 45017, Jalisco, Mexico · Escuela de Ingeniería y Ciencias, Tecnológico de Monterrey, Monterrey, 64849, N.L., Mexico · CRAN UMR 7039, Université de Lorraine and CNRS, Vandœuvre-lès-Nancy, France · CHRU de Nancy-Brabois, Service d’urologie, Vandœuvre-lès-Nancy, France
The reliability of artificial intelligence (AI) in medical imaging critically depends on its robustness to heterogeneous and corrupted images acquired with diverse devices across different hospitals which is highly challenging. Therefore, this paper introduces FedAgain, a trust-based Federated Learning (Federated Learning) strategy designed to enhance robustness and generalization for automated kidney stone identification from endoscopic images. FedAgain integrates a dual trust mechanism that combines benchmark reliability and model divergence to dynamically weight client contributions, mitigating the impact of noisy or adversarial updates during aggregation. The framework enables the training of collaborative models across multiple institutions while preserving data privacy and promoting stable convergence under real-world conditions. Extensive experiments across five datasets, including two canonical benchmarks (MNIST and CIFAR-10), two private multi-institutional kidney stone datasets, and one public dataset (MyStone), demonstrate that FedAgain consistently outperforms standard Federated Learning baselines under non-identically and independently distributed (non-IID) data and corrupted-client scenarios. By maintaining diagnostic accuracy and performance stability under varying conditions, FedAgain represents a practical advance toward reliable, privacy-preserving, and clinically deployable federated AI for medical imaging.
Figures & tables
Figure 1: Overview of the federated learning paradigm. At round t , each client k∈[1,∣K∣] (e.g., a public hospital or a private clinic) trains a local model on its private dataset TDk and transmits only the resulting sets Wk(t) of model parameters wk,j(t) to the central server. The server applies a federated strategy, such as weighted averaging (see Eq. ( 3 )), to aggregate these updates and produce a new server model weight set Wserver(t+1) . This updated model is then redistributed to all clients, enabling thus to exploit collaborative learning across heterogeneous and decentralized data sources without exposing private client data.
θc∼Dirichlet(βc)
(5)
Algorithm 1 Dirichlet-based Non-IID Partitioning for Federated Learning.
Figure 2: Overview of the proposed FedAgain federated strategy. At round t , each client trains a local model k∈[1,∣K∣] on its private dataset TDk and sends the resulting parameter set Wk(t) , along with the benchmark error Ek(t) , to the server. The server computes a trust score Tk(t) for each client, normalizes these trust scores to obtain weights T^k(t) , and aggregates the local updated model weights wk,j(t) to form the new global model Wserver(t+1) . This trust-weighted aggregation scheme improves convergence robustness by down-weighting unreliable or corrupted clients.
Figure 3: Comparison of kidney stone identification methods. Traditional MCA (left) relies on ex-vivo visual inspection after extraction combined with FTIR, while endoscopic stone recognition (ESR, center) depends on the expert’s visual assessment during the ureteroscopy. The proposed automated ESR approach (Title in the right colomn) integrates deep learning models for in-vivo stone type prediction.
Figure 4: Examples of ex-vivo kidney stone images acquired with two different devices. The two upper lines show complete stone fragment surfaces (SUR) and sections (SEC), whereas the two lower lines give image patches (small fragment parts) extracted from the fragment images. (a) Dataset A acquired with a CCD camera ( Corrales et al. (2021) ). The image background is uniform in color and the six subtypes (WW, CAR, CAR2, STR, BRU and CYS) are described in section 4.2.1 . (b) Dataset B acquired with a flexible ureteroscope ( El Beze et al. (2022) ). The image background is non uniform and the six subtypes (WW, WD, UA, STR, BRU and CYS) are described in section 4.2.2 .
Figure 5: Michel Daudon dataset (Dataset A) showing example patches of Carbapatite variants (IVa, IVa2) alongside common stone types, across three imaging modalities (MIX, SEC, and SUR).
Figure 6: Jonathan El-Beze dataset (Dataset B) showing example patches of the six kidney stone subtypes across three imaging modalities (MIX, SEC, and SUR).
Figure 7: Samples of the MyStone dataset. The first row gives complete stone fragment images (MIX image set type), whereas the second row shows patches extracted from the images (small fragment parts). The image background is uniform in color and the six subtypes (Ia, IIa, HAP, IVc, IVd and IIIa) are described in section 4.2.3 .
Stone Type (morphology)
Subtype
MyStone
Jonathan El-Beze
Michel Daudon
Common Across All
Calcium Oxalate Monohydrate (Whewellite)
Ia
Yes
Yes
Yes
Yes
Calcium Oxalate Dihydrate (Weddellite)
IIa
Yes
Yes
–
Partially
Uric Acid
IIIa
Yes
Yes
–
Partially
Hydroxyapatite
HAP
Yes
–
–
No
Carbapatite
IVa
–
–
Yes
No
Carbapatite Type 2
IVa2
–
–
Yes
No
Table 1: Comparison of the content of the three databases in terms of kidney stone subtypes. Each dataset includes six subtypes of the Daudon’s worldwide reference classification ( Corrales et al. (2021) ). “Yes” indicates presence of a given subtype in a dataset or accros all datasets for the last column; “Partially” stands for subtypes shared by only two datasets.
Dataset
Image types
Subtypes/classes
Train patches
Test patches
Total amount
Michel Daudon (A)
MIX, SEC, SUR
6
14,400
3,600
18,000
Jonathan El-Beze (B)
MIX, SEC, SUR
6
14,400
3,600
18,000
MyStone (C)
MIX
6
4,800
1,200
6,000
Patch Generation
Non-overlapping 256×256 patches extracted from non-image background regions; prevents data leakage.
Split Ratio
Data stratification for all datasets: 80% of patches for training and 20% for testing.
Table 2: Overview of the data type subsets (SEC, SUR and/or MIX views) and and the available patches for the three classes.
Category
Corruption Type
Description
Real-World Cause
Noise
Gaussian Noise
Additive white Gaussian noise
Sensor thermal noise in imaging hardware
Shot Noise
Poisson-distributed photon noise
Low-light or high-sensitivity imaging
Impulse Noise
Salt-and-pepper pixel dropouts
Transmission or sensor readout errors
Speckle Noise
Multiplicative noise pattern
Ultrasound or coherent imaging interference
Blur
Defocus Blur
Out-of-focus blurring
Lens misalignment or depth-of-field limitation
Glass Blur
Diffusion through translucent medium
Imaging through barriers (e.g., glass)
Table 3: Summary of corruption types used to simulate image degradation. Corruptions are grouped into four categories: noise, blur, weather, and digital distortions, reflecting common sources of quality degradation encountered in real-world imaging benchmarks and medical scenarios.
Figure 8: Performance comparison of federated learning strategies on kidney stone datasets under clean conditions (IID distribution, 10 clients, 1 round). The evaluated datasets include A (Daudon), B (Jonathan), and C (MyStone). Shaded bands represent the performance range of each dataset across all five aggregation strategies. The nearly horizontal curves and narrow bands indicate that, in the absence of corruption, the choice of aggregation strategy has minimal impact on model performance. Instead, the observed variations are primarily driven by the intrinsic complexity of the datasets rather than by the aggregation method itself.
Figure 9: Performance comparison of federated learning strategies under light (10%), moderate (30%), and heavy (40%) corruption levels across the seven kidney stone datasets. Bars indicate mean scores with the associated standard deviations.
Figure 10: Direct comparison of FedAgain, FedAvg, and FedMedian across three corruption scenarios under matched conditions (non-IID label distribution). Each scenario combines a corruption ratio with its corresponding severity level: Light (10%, Sev. 3), Moderate (30%, Sev. 4), and Heavy (40%, Sev. 5). FedAgain consistently outperforms FedAvg across all scenarios and evaluation metrics, with improvements reaching up to +7.1% in accuracy under heavy corruption. Notably, FedMedian achieves comparable or slightly higher accuracy than FedAgain under light and heavy corruption. However, FedAgain remains competitive while providing the additional advantage of not requiring prior knowledge of the number of Byzantine clients.
Figure 11: FedAgain consistently outperforms FedAvg across IID, Non-IID (Label), and Non-IID (Dirichlet) settings under 30% client corruption (severity 3), with up to +4.8% accuracy gain in the most heterogeneous scenario. It also shows lower variance and competitive performance against FedMedian, while adding trust-based weighting to better handle unreliable clients in realistic federated environments.
Figure 12: Scalability comparison of FedAvg and FedAgain as the number of participating clients increases from 5 to 20 under non-IID (Label Skew) data distribution with 30% corrupted clients at severity level 3, evaluated on three kidney stone datasets. The green shaded region denotes the accuracy gap between both strategies. FedAgain (solid green line) consistently outperforms FedAvg (red line) on Datasets A and B, with the gap becoming more pronounced at 20 clients. Dataset C represents the most challenging classification setting, where both methods exhibit performance degradation as the number of clients increases.
Figure 13: Ablation study on CIFAR-10 (left) and MNIST (right) comparing FedAgain with FedAvg under non-IID Label Skew conditions. Top row: Accuracy under progressively stronger corruption, with increasing fractions of corrupted clients and higher corruption severity. Bottom row: Accuracy as the number of participating clients increases from 5 to 20 under fixed corruption (30%, severity 3). The shaded region denotes the performance gap between both methods. FedAgain shows a progressively larger advantage on CIFAR-10 as corruption intensifies and the federation scales, whereas both methods remain comparatively similar on MNIST, reflecting its lower task complexity.
Department of Computer Science, COMSATS University Islamabad, Attock Campus, Attock 43600, Pakistan · Faculty of Computer Studies, Arab Open University, Riyadh, Saudi Arabia · Department of Artificial Intelligence, Kyungdong University Global, Toseong-myeon 24764, South Korea. +1
Department of Applied Mechanics Indian Institute of Technology Delhi · Grainger College of Engineering Nuclear, Plasma & Radiological Engineering Department National Center for Supercomputing Applications, Urbana, IL, USA · Department of Applied Mechanics Yardi School of Artificial Intelligence (ScAI) Grainger College of Engineering Indian Institute of Technology Delhi University of Illinois Urbana-Champaign, Urbana, IL, USA