# Detecting and Processing Unuspected Sensitive Variables for Robust Machine Learning
## 6 A Generic Pipeline to Detect and to Treat Unsuspected Sensitive Variables  
We have given, in the previous sections, an overview of the tools to quantify, detect and mitigate undesired algorithmic biases in machine learning, with a particular focus on complex and high-dimensional data such as images. As described in the introduction, we believe that a widely unexplored issue with strong industrial implication is the detection of unsuspected sensitive variables with high-dimensional data. We then present in this section a novel _Human-in-the-loop_ strategy based on Section 4.2 ([[https://github.com/deel-ai/influenciae](https://github.com/deel-ai/influenciae)]([https://github.com/deel-ai/influenciae](https://github.com/deel-ai/influenciae)), accessed on 30 October 2023) to address this issue. Our pipeline is designed for machine learning models that are trained using a gradient-descent approach (stochastic or not), which is the case for neural network models. It is developed in Algorithm 1, and illustrated in Section 7. ```
0: A trained machine learning model \(f_{\theta}\). 0: The dataset \(\{x_{i},y_{i}\}_{i=1,\ldots,n}\) used to train \(f_{\theta}\). 1: Use [93] to quantify the influence \(\gamma_{i}>0\) of each observation \(\{x_{i},y_{i}\}\) on the decisions of \(f_{\theta}\). Since \(f_{\theta}\) is already trained, a high value of \(\gamma_{i}\) indicates that the decision rules of \(f_{\theta}\) would be particularly impacted by \((x_{i},y_{i})\) with more training iterations, meaning that the relation between \(x_{i}\) and \(y_{i}\) is potentially poorly captured by \(f_{\theta}\) (see Section 4.2). 2: Select the most influential observations, i.e., those with the highest \(\gamma_{i}\) values. The amount of selected observations must be sufficiently small, so that a human can observe all of them. It also has to be sufficiently large to detect whether a significant amount of these observations present similar features. 3: A _human_ then observes the selected observations to define whether a significant amount of them present a common feature. 4: If a common feature is detected in the selected observations, then a sensitive variable \(A\) can be defined. Note that this requires to quantify this feature from the input observations \(x_{i}\), which will again be made by using a _human_ intervention. 5: Use the bias metrics of Section 3 with the sensitive variable \(A\) to quantify to which extent this sensitive variable is related to an undesired algorithmic bias. 6: If it turns out that \(f_{\theta}\) is significantly biased with respect to \(A\), the persons in charge of the model optimisation can try understanding the causes of this bias, as explained in Section 2.2, in order to later properly optimise \(f_{\theta}\). 7: Alternatively to the previous step, a bias mitigation strategy of Section 5, with \(A\) as a sensitive variable, can be directly used. ## 7 A Use-Case for EuroSAT

We now illustrate the notions and concepts of algorithmic bias that can be encountered in industrial applications on the RGB version of the EuroSAT dataset ([[https://madm.dfki.de/downloads](https://madm.dfki.de/downloads)]([https://madm.dfki.de/downloads](https://madm.dfki.de/downloads)), accessed on 30 October 2023) [5]. It contains 27000 remote sensing images of 64 \(\times\) 64 pixels with a ground sampling distance of 10 m. The RGB channels were also reconstructed based on the original 13-band Sentinel-2 satellite images. Each image has a label indicating the kind of land it covers, as shown in Figure 2 (left). ### The Blue Veil Effect in the EuroSAT Dataset

The blue-veil effect is caused by uncommon atmospheric conditions when acquiring Sentinel-2 images on the original 13 spectral bands, and becomes particularly noticeable when they are transformed into the visible spectrum. In essence, the picture acquires a blueish hue, as depicted in Figure 2 (right), that can trick classification models into thinking that it contains a mass of water. About 3% of the dataset is corrupted by what we call the blue-veil effect.