# Reducing Defense Vulnerabilities in Federated Learning:
## 4 Attack Scenarios and Results
### Performance Analysis
#### 4.3.3 Data Poisoning Scenario and Results (Non-IID)  
In this scenario, the distribution characteristics of users' local datasets play a crucial role in system performance and training dynamics. These distributions can be categorized into two fundamental patterns: IID and non-IID data. In the IID scenario, each user's local dataset serves as a representative sample of the complete data distribution, containing samples that mirror the overall pattern found in the global dataset. However, real-world applications often present more complex non-IID scenarios, where users' local datasets may differ significantly from one another in two key dimensions: the representation of different classes within their data and the relative frequency of samples per class. This heterogeneity means that while one user might have a balanced representation of all classes in their local dataset (resembling an IID distribution), another user's dataset might exhibit significant class imbalances or even completely lack certain classes, creating challenges for the federated learning process and requiring robust approaches to handle such diversity in data distributions. We use Dirichlet distribution. For \(K\) classes and \(N\) clients, the probability density function of the Dirichlet distribution is the following:  
\[\text{P}(\text{p}_{1},\ldots,\text{p}_{k};\alpha_{1},\ldots,\alpha_{k})=(1/ \text{B}(\alpha))\prod\text{i}=1^{k}\text{p}_{i}\text{'}(\alpha_{i}\text{'}^{ -1}) \tag{21}\]  
where  
* \(\text{p}_{i}\) represents the proportion of data for class \(i\);
* \(\alpha_{i}\) is the concentration parameter for class i (adjusted to 1 to avoid extreme non-IID scenarios);
* \(\text{B}(\alpha)\) is the multivariate beta function. Our federated learning analysis confronts a key challenge in real-world implementations: the intrinsic variation in how data naturally cluster across participating nodes. Figure 3 employs heat mapping to showcase this distribution variance, examining patterns across a hundred distinct nodes. The visualization maps the distribution intensity relative to the baseline uniformity (denoted by 100%), revealing compelling variations in data concentration. Notable clustering emerges in certain regions, with some nodes exhibiting nearly double the baseline concentration (reaching 180% intensity) depending on the parameter \(\alpha_{i}\) for specific categories. These pronounced variations manifest in distinctive columns throughout the heat map, highlighting systematic deviations from uniform distribution. Such inherent data asymmetry exemplifies a fundamental consideration in practical federated systems, where natural data clustering significantly influences system dynamics. The observed patterns underscore how real-world data naturally gravitate toward non-uniform distributions across participating nodes, creating inherent variations that must be addressed in system design. Table 9 presents the performance against label flipping in non-IID CIFAR-10 environments. NC-FLD maintains consistent accuracy above 74% even with increasing attack intensity. Examining defense effectiveness across dataset architectures yields illuminating insights into framework resilience. While the F-MNIST evaluations demonstrated strong baseline performance approaching 86%, the MNIST implementation revealed substantially enhanced robustness, with accuracy metrics consistently exceeding 98% under standard conditions, as given in Table 10. The framework stability remained notable even under intensified attack scenarios, with performance maintaining above 97% under maximum malicious participant attendance. These findings suggest meaningful advancements in preserving model integrity across varied data distributions and attack intensities for data poisoning cases. Figure 3: Non-IID data distribution sample across 100 participants given as percentage of uniform distribution. (%100 corresponds to uniform distribution for the given data class).