# Lightweight Anomaly Detection in Digit Recognition Using Federated Learning
## 7 Experimental Results and Analysis
### Evaluation of Autoencoder Performance on PC
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Value** & **Usage** \\ \hline Activation function & ReLU & Defines neuron output behavior \\ Optimizer & Adam & Adaptive weight updates \\ Learning rate & 0.001 & Step size for updates \\ Loss function & MSE & Measures prediction error \\ Patience phase 1 & 20 & Dual-phase early stopping \\ Patience phase 2 & 3 & Dual-phase early stopping \\ Acceptable loss & 0.02 & Dual-phase early stopping \\ Min delta & 0.0005 & Dual-phase early stopping \\ AD threshold function & 95 th percentile & AD thresholding \\ gamma & 0.1 & AD thresholding (FL) \\ Patience phase 1 (FL) & 20 & Dual-phase early stopping (FL) \\ Patience phase 2 (FL) & 0 & Dual-phase early stopping (FL) \\ Acceptable loss (FL) & 0.02 & Dual-phase early stopping (FL) \\ Min delta (FL) & 0.0005 & Dual-phase early stopping (FL) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Configuration parameters used throughout all test scenarios. \begin{table}
\begin{tabular}{c c c c c c c c c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Training Configuration**} & \multicolumn{3}{c}{**Training Results**} & \multicolumn{3}{c}{**Anomaly Detection Rate (\%)**} \\ \cline{2-13}
**Model** & **Autoencoder** & **Batch** & **Fleoding** & **Training** & **Training** & **Training (s)** & **MinST-C** & **MinST-C** & **Dataset-C** & **MinST-C** & **EMNIST** & **F1 Score** \\ \cline{2-13}
**Number** & **Architecture** & **Size** & **Epochs** & **Training Loss** & **Time (s)** & **Time (s)** & **Time (s)** & **Time (s)** & **Time (s)** & **Time (s)** & **Time (s)** & **Time (s)** & **Time (s)** \\ \hline \hline \multirow{2}{*}{1} & \multirow{2}{*}{\([196,16,196]\)} & 1 & 11 & 0.0199 & 13.67 & 9.55 & 90.70 & 6.85 & 33.40 & 14.55 & 75.70 & 0.8173 \\  & & 10 & 26 & 0.0122 & 4.96 & 1.06 & 10.40 & 93.30 & 9.55 & 48.00 & 18.75 & 83.45 & 0.8610 \\  & & 50 & 60 & 0.0124 & 4.50 & & 11.60 & 93.65 & 10.60 & 55.05 & 21.20 & 85.90 & **0.8699** \\ \hline \multirow{2}{*}{2} & \multirow{2}{*}{\([196,32,196]\)} & 1 & 13 & 0.0109 & 16.30 & 8.50 & 91.90 & 6.35 & 25.55 & 12.05 & 69.25 & 0.7792 \\  & & 10 & 29 & 0.0065 & 5.10 & 1.13 & 13.90 & 98.15 & 21.30 & 81.50 & 33.05 & 85.90 & 0.8599 \\  & & 50 & 61 & 0.0074 & 4.57 & & 17.35 & 97.95 & 23.90 & 87.90 & 41.30 & 88.75 & **0.8612** \\ \hline \multirow{3}{*}{3} & \multirow{2}{*}{\([196,64,196]\)} & 1 & 16 & 0.0087 & 20.07 & 7.50 & 92.15 & 6.80 & 24.20 & 10.60 & 66.45 & 0.7640 \\  & & 10 & 30 & 0.0040 & 5.37 & 1.24 & 11.40 & 90.05 & 26.80 & 90.10 & 37.10 & 85.15 & **0.8664** \\  & & 50 & 53 & 0.0057 & 4.15 & & 14.40 & 98.15 & 21.80 & 89.25 & 36.15 & 84.95 & 0.8523 \\ \hline \multirow{3}{*}{4} & \multirow{2}{*}{\([196,32,32,196]\)} & 1 & 32 & 0.0122 & 68.04 & 9.60 & 92.90 & 7.65 & 36.10 & 15.20 & 75.80 & 0.8177 \\  & & 50 & 10 & 58 & 0.0119 & 18.01 & 1.31 & 14.10 & 95.00 & 14.70 & 63.20 & 26.00 & 86.35 & 0.8616 \\  & & 50 & 124 & 0.0146 & 12.49 & & 12.55 & 91.70 & 12.60 & 51.30 & 21.25 & 86.80 & **0.8708** \\ \hline \multirow{3}{*}{5} & \multirow{2}{*}{\([196,32,8,32,196]\)} & 1 & 48 & 0.0188 & 134.42 & & 11.85 & 88.40 & 9.95 & 38.80 & 18.80 & 86.95 & 0.8747 \\  & & 94 & 0.0191 & 30.97 & 1.33 & 12.05 & 89.20 & 10.30 & 41.55 & 17.80 & 89.80 & **0.8989** \\  & & 50 & 83 & 0.0437 & 6.36 & & 6.35 & 63.20 & 0.80 & 15.55 & 4.75 & 51.30 To better understand how the AE distinguishes between normal and anomalous inputs, we visualized input and output image pairs for different datasets. Figure 3 shows examples from the MNIST, EMNIST, and MNIST-C test sets. For normal digit inputs, the AE successfully reconstructs the images with high fidelity, indicating that it has learned the underlying structure of the digits. In contrast, inputs from EMNIST or MNIST-C produce degraded reconstructions, resulting in higher reconstruction errors, which are interpreted as AD rates. As shown in Figure 3, the MNIST digits are reconstructed almost perfectly since the model has been trained specifically on this distribution.