{'fraction_non_alphanumeric': 0.026738623819452963, 'fraction_numerical': 0.003924935606525205, 'mean_word_length': 4.934497816593886, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Modified Mean Shift Method for Fault Region Extraction in Infrared Image

Aiming to detect the fault of electrical equipment with infrared thermography, this paper presents a modified mean shift clustering method for finding the region of fault. At the beginning, the whole image is separated by the highest threshold, as to find the coarse fault region. Then the mean shift clustering method is modified by introducing the weight factor associated with the neighboring pixels, in order to cluster the region with similarity. Meanwhile, the original way of mean shift clustering method to iterate in the image is abandoned, and we propose a threshold segmentation mechanism to solve. It thereby promotes the speed of clustering, and extracts the region of fault effectively. Finally, the experiments on real world infrared images show that our method has higher performance than some existing methods, including original mean shift clustering method.


Introduction
In the electrical system, monitoring the status of the electric equipment is considered as an effective way to prevent the electrical fault during its work [1]. Most of the electrical faults will show high temperature phenomenon. Using infrared imaging to highlight the high temperature area can play an important role in fault diagnosis technology.
In order to achieve automatic infrared fault diagnosis, the way to use the image processing has been widely concerned by the researchers. In the early period, fault diagnosis is usually regarded as a classic temperature judgement that the higher than a certain temperature is considered to be faulty, while below a certain threshold is considered as normal. So, Jing [2] takes advantage of the maximum interclass variance (Otsu) threshold method to separate the fault region from the background. Wang [3] used the watershed segmentation algorithm and fuzzy clustering with aiming of improving the extraction effect of fault area. Besides, Xu [4] proposed to improve the fault area of the infrared image by the image segmentation method of the improved PCNN (Pulse-coupled neural network) model. Nevertheless, the fault region often appears blurring or has the intensity overlap between the background and target, thus leading to over segmentation or under segmentation. In this paper, a novel way to extract the region is proposed, which is based on Mean shift method [5]. In contrast to the original mean shift method, our method merges the top-to-bottom thresholding mechanism, and then utilizes the information of the spatial neighbourhood. Meanwhile, the weight is adjusted to improve the performance of clustering. Finally, the experiments on real world infrared image demonstrate our method has the efficient of segmentation.

A modified Mean shift Algorithm
Assume the sampling point xi∈R d , i=1,…,N, the probability density estimation at point x is as follows where Sh is a high-dimensional sphere with a fixed bandwidth h d denotes the dimension, and K (•) is a radial symmetric kernel function Ck,d is a normalized constant, in order to ensure that the integral of the kernel function K (x) is equal to 1; k(x) is the cross-section function of K(x). Roughly speaking, Gaussian kernel assigns the contribution to the center point according to the distance from the sample point to the center point. So, in this work, the Gaussion kernel is used for clustering.
In order to search the point with maximum probability density, the following gradient of the density function is often calculated as and obtain x is the shift vector, and is expressed as Notably, the mean shift vector always points to the direction of the fast growing probability density. Therefore, once the initial point is given, the center is then shifted according to the following two steps. step1: compute the mean shift vector, and change the center point as follows step2: change the space to re-calculate the probability density. Eventually the center point converges to the probability maximum density, or satisfies , the iteration is stopped.
In order to obtain the estimation of probability density for pixels clustering, the following condition are used: (1) the x r characteristic of the pixel x is close to that of the pixel xi, then the probability density is high; and (2) the closer the pixel position xi, the probability density is high. So, the strategy to combine the space and features together to define a new kernel functions where hs is the image space bandwidth, hr is the gray scale bandwidth, and C is a normalized constant. In addition, for the pixel weight ω, it is defined by the neighborhood variance of the pixel xi where cr is the normalized parameter and Ni is the neighborhood of the pixel xi. Obviously, if the neighborhood feature x r is close to the corresponding center point xi, the greater the weight ω(xi) is; and when the neighborhood feature x r is proportional to the center point xi is larger than the difference, then ω (xi) is small, so that the mean is shifted in the direction of smaller variance.
In this work, we abandon the strategy of iterating clustering, and use the threshold segmentation mechanism for clustering. The implementation process is as follows: step (1): Using the mean filter to smooth the image, remove the noise, and calculate the weight ω(xi); step(2): The initial threshold T is set by using the highest intensity value in the image, and the region is then first extracted; step (3): Calculate the density estimate of the neighboring pixel xi around the extracted region. The pixels are then clustered through the mean shift iteration; step(4) Assign the mean of the clustering region to the threshold T, and then segment the image to obtain other possible brightness areas; step (5) If the entire cluster area does not change any more, stop iteration, otherwise turn to step (3). Figure 1 shows the infrared images with the fault region in the electrical equipment. Obviously, the fault appears higher brightness in the image. In the experiment, the initial kernel parameters hs = 3, hr = 5, and the highest intensity is set as the initial threshold, and the segmented region is marked as the clustering region. In order to facilitate comparison and analysis, Otsu method [2], PCNN [4] and mean shift [5] were tested, and all the models are performed on MATLAB 2010b.  Otsu's threshold value is shifted to the low intensity value, because it depends on the maximum criterion of inter-class variance. So that, the result will worse since the faulty area is small. Watershed method is a kind of segmentation method, which is inspired by finding the watershed boundaries, as shown in Figure 3. However, multiple segmentation regions are likely to be generated and need further processing. PCNN model as the segmentation method generally depends on its parameter settings, where the specific parameters were described in [3]. Although this method can extract high brightness area, some of low intensity area is considered as the fault region. The original Mean shift segmentation method is to divide the image into multiple regions with similar characteristics, although the fault area has also been well divided. Nevertheless, our method is built on infrared fault characteristics of the electrical equipment, such as the value of regional brightness as a threshold effectively to determine the clustering area, and finally has less misclassification error [5], as seen in Table 1. Meanwhile, the modified strategy to mean shift method takes the algorithm less iteration than original mean shift, as seen in Table 2. This demonstrates our model has the advantages of performance of segmentation.

Conclusions
In this paper, a modified mean shift clustering method has been presented to improve the performance of image segmentation. In the method, the original way of mean shift clustering method to iterate in the image is abandoned, and proposes to use the threshold segmentation mechanism. Several experiments on some real world infrared images demonstrate that our model has the high performance of segmentation by comparing with the existing methods and the classic mean shift method.