## 2 Methodology
### Self-Organizing Fuzzy Logic Classifier
#### 2.3.1 Offline Training Stage  
The purpose of the offline training phase is to select representative samples (prototypes) with different labels and to build fuzzy rules based on the selected prototypes. Figure 2: Coarse-grained process of time series. Suppose that given \(K\) samples, they are divided into \(c\) categories, which can be denoted as \(\{x\}_{K^{c}}^{c}=\{x_{1}^{c},x_{2}^{c},\cdots,x_{K^{c}}^{c}\}(\{x\}_{K^{c}}^{c} \subset\{x\}_{K})\), where \(c=(1,2,\cdots,C)\). The unique set of samples from all categories excluding the same samples is denoted as \(U_{K}^{c}\). The frequency of occurrence of each sample is expressed as \(f_{i}^{c}\). \(K^{c}\) is the number of samples of \(\{x\}_{K^{c}}^{c}\). The specific process of selecting the prototype is as follows:  
1. The multimodal density corresponding to the sample is calculated as shown in the following equation: \[D_{K^{c}}^{MM}(u_{i}^{c})=f_{i}^{c}\frac{\sum\limits_{l=1}^{K}\sum\limits_{j=1 }^{K^{c}}d^{2}\Big{(}x_{i}^{c},x_{j}^{c}\Big{)}}{2K^{c}\sum\limits_{j=1}^{K^{c }}d^{2}\Big{(}u_{i}^{c},x_{j}^{c}\Big{)}},i=1,2,\ldots,U_{K}^{c}\] (9) where \(d\) is the distance between samples, and different measure approaches will give different results. \(u_{i}^{c}\) is the sample in \(U_{K}^{c}\). 2. The samples are sorted according to the calculated multimode density and mutual distance. The sorted sample sequence is written as \(\{r\}=\Big{\{}r_{1},r_{2},\cdots,r_{U_{K}^{c}}\Big{\}}\), where \(r_{1}=\underset{i=1,2,\cdots,U_{K}^{c}}{\text{argmax}}\) (\(D_{K^{c}}^{MM}(u_{i}^{c})\)). \(r_{2}\) is the sample with the smallest distance from \(r_{1}\) in \(U_{K}^{c}\), and \(r_{2}=\underset{i=1,2,\cdots,U_{K-1}^{c}}{\text{argmin}}\) (\(d\big{(}r_{1},u_{i}^{c}\big{)}\)). \(r_{3}\) is the sample with the smallest distance from \(r_{2}\), and this rule is followed. The multimode density set of \(\{r\}\) is indicated as \(\big{\{}D_{K^{c}}^{MM}(r)\big{\}}\). The initial prototype is selected based on the following formula: \[if\Big{(}D_{K^{c}}^{MM}(r_{i})>D_{K^{c}}^{MM}(r_{i+1})\Big{)}and\Big{(}D_{K^{c }}^{MM}(r_{i})>D_{K^{c}}^{MM}(r_{i-1})\Big{)}\text{ }then(r_{i}\in\{p\}_{0})\] (10) where \(\{p\}_{0}\) represents the sequence of the initial prototype. 3. The initial prototype attracts nearby samples to build the data cloud, thus increasing the number of prototypes. The attraction of samples is based on the following principle: \[winning\text{ }prototype=\text{argmin}(d(x_{i},p)),p\in\{p\}_{0},x_{i}\in\{x\}_{K^{c}}^{c}\] (11)
4. The multimodal density of the initial prototype sequence is recalculated according to the following equation: \[D_{K^{c}}^{MM}(\varphi_{i})=S_{i}\frac{\sum\limits_{l=1}^{n}\sum\limits_{j=1 }^{n}d^{2}(\varphi_{l},\varphi_{j})}{2K\sum\limits_{j=1}^{n}d^{2}\big{(} \varphi_{l},\varphi_{j}\big{)}}\] (12) where \(\varphi_{i}\in\{\varphi\}_{0}\), \(S_{i}\) is the total number of elements in the \(ith\) data cloud, \(n\) is the number of elements contained in all data clouds \(\{\varphi\}_{0}\). 5. A sequence of adjacent data cloud centers \(\{\varphi\}_{i}^{neighbor}\) is constructed, and a representative prototype \(\{p\}^{c}\) is selected based on the following equation: \[if\Big{(}D_{K^{c}}^{MM}(\varphi_{i})>D_{K^{c}}^{MM}(\varphi)\Big{)}then( \varphi_{i}\in\{p\}^{c})\] (13) where \(\varphi\in\{\varphi\}_{i}^{neighbor}\). 6. The fuzzy rules for each category are constructed according to the following equation. If the sample is comparable to any prototype in a category, the sample is classified into that category. \[if(x\sim p_{1}^{c})or(x\sim p_{2}^{c})or\cdots or(x\sim p_{N^{c}}^{c})then(x \in(category\text{ }c))\] (14)  
to multiple pre-set scales through the coarse-grain operation in Section 2.2 provides more perspectives for fault diagnosis. The specific steps are as follows:  
1. Acceleration sensors were installed on the rotating machinery vibration test bench to collect rolling bearing vibration signals under different health states to form a fault sample dataset. 2.