# Real-Time and Robust Hydraulic System Fault Detection via Edge Computing
## 6 Correlation and Redundancy-Aware Feature Selection Using a Genetic Algorithm  
A GA is designed to find optimal solutions within a large search space by exploiting the process of natural selection. As a GA can discover more fit solutions after each generation, it can then identify the best solution among these [31]. Thus, a GA does not require domain knowledge to assist in the search process. Three standard operators exist to regulate the population, including a selection, crossover, and mutation operator. The selection operator determines the parents from the population, and the crossover operator defines a recombination method between the parents. Then, the mutation operator defines the genetic diversity among the offspring. The GA iterations are terminated when a pre-defined stopping criterion is met, which typically is a maximum generation number. In terms of the feature selection problem, the GA considers all possible subsets of the given feature set [32]. The individual is represented as an \(n\)-bit binary string that reflects a certain feature subset. Each bit represents the elimination or inclusion of the related feature, such that 0 represents elimination, and 1 represents the inclusion of the feature. The CRFS process is presented in Algorithm 2 and follows the goal of selecting features based on their correlation. CRFS adopts the non-dominated sorting genetic algorithm (NSGA) that works with the multiobjective problem [33]. CRFS minimizes three objectives formulated in Equation (5). First, \(g_{cor_{t}}(x)\) attempts to obtain features with a high correlation to the output label, which is important for the learning process. Second, \(g_{cor_{f}}(x)\) maintains the selected features that have a low correlation to each other because high feature-to-feature correlations represent redundant features. Avoiding these redundant features results in fewer feature subsets, reduces model overfitting, and enables the model to identify interactions and important interrelated information better [34]. In our case, length \(n\) is 17 representing the number of all sensor features, and \(k\) is the number of features included in the solution. These objectives ensure that the selected features have a high correlation, low redundancy, and are part of a smaller feature subset. CRFS automatically defines the number of selected features because it is included in the objective. At the end of the iteration, we obtain the non-dominated individuals at the Pareto front, from which we select only one solution by first normalizing the values and then applying the weight (importance) of each objective with respect to the others. In lines 2-3 of Algorithm 2, CRFS calculates the Pearson correlation coefficient [35] using Equation (4), which represents the linear relationship between two variables ranging between \(-1\) and \(1\). The values of \(-1\) and \(1\) represent a perfect relationship, while 0 indicates the absence of a relationship between the variables. We take the absolute value because 1 and \(-1\) have the same meaning, and then we run the NSGA from lines 4 through 13. In line 14, we obtain the non-dominated individuals at the Pareto front and select the fittest one among these by scaling the objectives using Equation (6). Then, this scaled objective is applied to calculate each objective weight formulated with Equation (7), where the weight represents each objective priority. The total of the objective weights is 1, and the weighted and scaled objective score ranges between 0 and 1, as presented in Equation (8). Because this process is a minimization problem, we select the solution with the lowest objective value, as performed in lines 15-17:  
Figure 3: Plots of noisy data collected at the TS1 sensor with different signal-to-noise ratios.