# A Time-Frequency Image Quality Evaluation Method Based on Improved LIME
## 2 Materials and Methods
### Technical Route
#### 2.3.3 Improved LIME  
The improvement in LIME in this paper is reflected in two aspects: how to perturb the sample and select features for the selected interpretable model for interpretation. * How to perturb the sample  
To learn the local behavior of \(f\) near the sample \(x\), sample set \(Z\) needs to be generated in the neighborhood by perturbing the sample \(x\). The perturbation should ensure that the number of classification results of the original model \(f\) for the sample set \(Z\) are not less than 2, as this ensures that there is a solution to the selected model g. For image samples, this goal is usually achieved by adding salt and pepper noise, that is, setting the gray value of a random pixel to 0. This is because the features of the image sample are usually local, and adding salt and pepper noise can effectively destroy the local features of the image. However, for time-frequency images generated by vibration signals, in the frequency direction, fault information exists in multiple frequency bands and in their sidebands in the form of modulation, and in the time direction, the fault characteristics exist in the whole period with certain periodicity. Therefore, for time-frequency images, their features are global features, and the method of adding local noise is often difficult to achieve effective disturbance, so it is necessary to add global noise instead. Taking the time-frequency image of the vibration signal in a healthy state as the target sample \(x\), global Gaussian noise with a variance of 0-1 is added to simulate the impact response generated in the vibration signal when root cracks, missing teeth, and broken teeth occur on the time-frequency image, and global multiplicative noise with a variance of 0-1 is added to simulate the impact on the time-frequency image when tooth surface wear occurs. Figure 4: A diagram of the network structure. This structure contains the input and output layers, eight effective computation layers, and several auxiliary layers for optimization. * How to select features The linear model \(g\) can be expressed as follows: \[g(x)=W\times X+b\] (12) \[W=[w_{1}\,w_{2}\dots\,\,w_{n}]^{\prime}\] (13) \[X=[x_{1}\,x_{2}\dots x_{n}]\] (14) where \(W\) is the coefficient matrix, \(b\) is the bias, \(X\) is the feature matrix, and \(n\) is the number of features. The larger the absolute value of the coefficients in the coefficient matrix, the more important the corresponding features are in the network's decision making. For example, when weight \(w_{1}\) is very large and weight \(w_{2}\) is very small, the interpretation of the original model \(f\) through the interpretable model \(g\) can be expressed as follows: when the model makes a decision, it focuses on features \(x_{1}\) but not \(x_{2}\) features. To explain the local behavior of \(f\) through \(g\), in addition to requiring that the interpretable model \(g\) is simple enough to be understood, it is also necessary that the features of \(g\) are understandable. The understandability of input features includes two aspects: the feature has practical significance to the task objective and the number of features must be limited. Usually, for image classification tasks, LIME adopts the superpixel segmentation of the original image as a new feature, because these superpixels are often of practical significance. However, for the time-frequency image of the vibration signal, its superpixel is not of practical significance, so other features need to be selected. Two kinds of Haralick features generated from the gray co-occurrence matrix are selected to describe the texture features of time-frequency images, respectively:  
Angular Second Moment is the feature that measures the roughness of image texture. The larger the value is, the more concentrated the distribution of elements in the grayscale co-occurrence matrix is near the diagonal line, and the more regular the texture change in the original image is.