## 3 Proposed Approach
### The HFuzzNDA Approach  
The HFuzzNDA algorithm, in contrast to the PFuzzNDA approach, has an additional parameter, namely the maximum possible number of clusters per class, denoted as \(c_{max}\). This parameter changes over time and is initially set to a minimal value (to be more specific, it is equal to 2). To calculate the new \(c_{max}\) value, the following notations are used:  
1. First, we check how many instances are classified (this number is denoted as \(N_{in}\)); after the offline stage this number is equal to \(p_{offline}\), and grows incrementally during the online stage (one new instance per iteration). 2. Two new parameters are introduced, namely \(p_{in}\) and \(p_{cmax}\); \(p_{in}\) controls the speed at which the \(c_{max}\) value grows, and \(p_{cmax}\) shows how much \(c_{max}\) grows over each iteration. 3. A given number of considered instances, denoted as \(N_{old}\), is saved after some number of iterations, \(N_{old}=p_{offline}\) right after the offline stage. Thus, \(c_{max}\) is updated as shown in Algorithm 1 (note that in Algorithm 1 the temporary variable \(c_{max}^{unr}\) only grows). ```
1:After the offline stage set \(p_{in}=0.1\), \(p_{cmax}=0.01\), \(c_{max}^{unr}=c_{max}\)
2:while online stage do
3:if\((N_{in}-N_{old})==round(p_{in}\times N_{old})\)then
4:\(N_{old}=N_{in}\)
5:\(c_{max}^{unr}=(1+p_{cmax})\times c_{max}^{unr}\)
6:\(c_{max}=round((1+p_{cmax})\times c_{max}^{unr})\)
7:endif
8:endwhile
```  
**Algorithm 1**\(c_{max}\) update procedure  
Evolutionary and biology-inspired optimization algorithms are popular among researchers and are frequently used for anomaly and/or novelty detection. For example, in [82] the hybrid algorithm based on Fruit Fly Algorithm (FFA) and Ant Lion Optimizer (ALO), and in [83] the Farmland Fertility Algorithm were used, respectively, for feature selection to reduce the dimensionality of the data. Data, pre-processed in such a way, were later classified as normal or anomalous by using some well-known machine learning approaches (support vector machines, decision trees, \(k\) nearest neighbours). In this study, we did not apply an evolutionary algorithm as a pre-processing technique, instead it was used for clustering, namely, clusters' centres were determined by the NL-SHADE-RSP algorithm. To be more specific, NL-SHADE-RSP determined centres of clusters belonging to each class and each individual represented the whole set of clusters' centres; and no feature selection was applied. Thus, during the offline stage, the NL-SHADE-RSP approach is used to divide each known class into two clusters. For this purpose, function (2) is optimized and each individual represents the centres of the clusters. After that, the PFCM algorithm is used to obtain the membership \(U\) and typicality \(T\) matrices for these classes. The \"age\" of all clusters, designed during the offline stage, is recorded (they are considered as the oldest clusters). The online stage starts with Algorithm 1 and then proceeds to check conditions, described for the PFuzzND approach, for each new instance iteratively. However, some changes were implemented to the online procedure. To be more specific, a new merging technique is applied to clusters to check if there is a need to decrease their number, and the NL-SHADE-RSP approach is used to refine clusters belonging to each class. The pseudo-code for the online stage is presented in Algorithm 2. Note that in Algorithm 2\(Ncur_{sm}\) is the current number of instances stored in short memory. Furthermore, the NL-SHADE-RSP approach can change the final number of clusters belonging to the considered class. To be more specific, it is executed for all possible variants of the \(k_{class}\) for a given class from 2 to the current value of \(k_{class}\), and the best variant is chosen at the end of the optimization process.