## 3 An Instance-Based Learning (IBL) Approach
### Spectrogram Generation and Feature Extraction  
In the PRONOSTIA datasets, data were collected every 10 s for a period of 0.1 s. In every time cycle of 0.1 s, 2560 data points were recorded, thus with a time resolution of 3.91 us and frequency resolution of 10 Hz. Each spectrum obtained for each time cycle contains 1280 frequency components. In order to reduce noise effects, spectrograms are smoothed using moving averaging filters in both time and frequency directions. We chose 80 and 40 as the window sizes in time and frequency, respectively. Figure 2(a),p show the spectrograms of Bearing1-1 as the learning instance and Bearing1-3 as the test instance.  
Figure 2: The proposed IBL approach for RUL estimation.  
For a learning instance, the spectrogram has 1280 frequency components at each of the \(M\) time steps so the PCA technique is utilized for dimension reduction. The PCA can reduce a larger number of features to the representative principal components using a linear transformation while maintaining most of the variability of the dataset [17]. In the proposed IBL approach, PCA is first applied to the spectrogram of the learning instance to generate a set of PCs (i.e., a set of eigenvectors). We chose the first five PCs to represent the bearing degradation states. In Figure 4, we show the mean and first five PCs of the learning instance Bearing1-1. They account for 91.27%, 5.13%, 1.48%, 0.14%, 0.03% of the spectrogram variability respectively, for a total of 99.86% of the data variability.  
Figure 4: The mean and the first five PCs of the spectrogram of learning instance Bearing1-1 (Note: the horizontal axis has a unit of 10 Hz per tick mark).  
Figure 3: Spectrograms and PC feature sequences: (**a,c**) learning instance Bearing1-1; (**b,d**) test instance Bearing1-3.  
By projecting spectrograms onto the five major PCs generated above, the corresponding PC coefficients of both learning and test instances can be obtained. The spectrum at each time cycle \(i\) (or \(j\)) can be approximately represented by coefficients \(x_{k,i}\) (or \(x_{kj}\)) on a total of 5 major principal components \(PC_{k}\) (\(k\) = 1, 2, 3, 4, 5) as shown in Figure 4.  
\[Spectrum(i)=\sum_{k=1}^{5}x_{k,i}\cdot PC_{k} \tag{6}\]  
These coefficients are considered as the prognostic features that are included in the prognostic feature vector \(\mathbf{x}_{i}{}^{(l)}\) or \(\mathbf{x}_{j}{}^{(p)}\) in Equations (2) and (5) to represent a bearing's degradation state.  
As a result, the five PC feature sequences can be obtained as illustrated in Figure 3c,d for Bearing1-1 and Bearing1-3, respectively. From these figures, it can be observed that the 1 st PC mainly captures the variability of the learning instance data over time and also the test instance has a similar trend with respect to the 1 st PC feature sequence. It is reasonable to associate machine health conditions with such variability in the bearing vibration data. Particularly, we can see that the 1 st PC mainly reflects the variability of the vibration signal at two frequency ranges 0-3 kHz and 10-12 kHz, as shown in Figure 4.  
The procedure is summarized as follows:  
\(<\)Procedure-I: Spectrogram Generation and Feature Extraction\(>\)  
1. Spectrogram Generation (1.a) Generate spectrograms from raw vibration signals using the STFT. (1.b) Smooth the spectrogram generated from (1.a) using a moving average filter in frequency. (1.c) Smooth the spectrogram obtained in (1.b) using a moving average filter on time.
2. Feature Extraction (2.a) Apply PCA to the spectrogram of the learning instance generated in (1.c) and select the first five eigenvectors as the principal components for dimension reduction. (2.b) Project the spectrograms onto the PC obtained in (2.a). The coefficients of projection are the prognostic features.