# Investigating the Performance of FixMatch for COVID-19 Detection in Chest X-rays
## 5 Exploratory Imbalance Analysis  
### Methodology  
While the dataset selected has a balanced distribution across all classes, it may be worth investigating the performance for the semi-supervised algorithm in cases where the dataset is imbalanced in nature. This is especially relevant to the domain in question, where newer diseases would have significantly lesser available data as compared to previously established diseases. Therefore, in circumstances such as these, any detection model would be trained on various forms on imbalance data. In order to develop an imbalancing procedure, we first identified three target imbalance distributions which could simulate a variety of imbalance situations. A Weibull distribution was used in order to select the target imbalance distributions. This is a widely used model in the field of modern statistics, due to its ability to fit data from a large range of applications, from economics to engineering [68]. While a variety of variations of the Weibull distribution exist, the implementation followed by this work is based on the Weibull distribution calculator developed by [PERSON] at the University of Iowa [69]. The probability density function that was applied in this case is seen in Equation (6). \[f(x)=\frac{\alpha}{\beta}\bigg{(}\frac{x}{\beta}\bigg{)}^{\alpha-1}e^{-(\frac {x}{\beta})^{\alpha}} \tag{6}\]  
where \(x>0\), shape \(\alpha>0\) and scale \(\beta>0\). In order to generate different distributions, the shape and scale are varied, and three of the resulting distributions are selected based on varying entropies. Figure 3 displays the final selected imbalance distributions, along with the uniform distribution, which is used as a baseline. The \(x\)-axis represents the classes, and the \(y\)-axis represents the proportion of the overall data the corresponding class occupies. As can be seen in the figure, the distribution with many majority classes has the lowest number of minority classes, as its right tail is less defined than the other chosen distributions. The distribution with less majority classes has a long right tail with a well-defined peak on the left side, resulting in a very small number of samples existing in the classes corresponding to the probability on the right side. Furthermore, this long  
Figure 3: Various imbalance distributions used. tail leads to there being a greater number of minority classes, and this would affect the training. Finally, the equal majority-minority distribution has both a right tail and a left tail. This means that there are minority classes on both ends of the distribution, with an overwhelming majority class corresponding to the middle of the distribution. Due to the tails on both side, this leads to a larger number of minority classes, such that the proportion of majority to minority classes is approximately equal. In order to better describe the chosen distributions, the entropies of each of the distributions are calculated based on the formula seen in Equation (7), where in \(P(x_{i})\) is the probability of the given point. \[H(X)=-\sum_{i=1}^{n}P(x_{i})\log P(x_{i}) \tag{7}\]  
The resulting entropies can be seen in Table 10.  
To estimate the difference between the chosen distributions, the Kullback-Leibler divergence [70] and the Jensen-Shannon distance [71] between the distributions were measured. The formula used to calculate the Kullback-Leibler divergence can be seen in Equation (8), and the formula used to calculate the Jensen-Shannon distance can be seen in Equation (9), where \(P\) and \(Q\) are the two distributions being compared. \[D_{KL}(P||Q)=\sum_{i=1}^{n}P(x_{i})\log\left(\frac{P(x_{i})}{Q(x_{i})}\right) \tag{8}\]  
\[JS(P||Q)=\frac{1}{2}KL(P||M)+\frac{1}{2}KL(Q||M)\text{ where }M=\frac{1}{2}(P+Q) \tag{9}\]  
Table 11 displays the KL divergences between the distributions, while Table 12 displays the JS distance. The distributions are ascendingly ordered based on their entropy.