# Threshold-Optimized Swarm Decomposition Using Grey Wolf Optimizer for the Acoustic-Based Internal Defect Detection of Arc Magnets

Authors: Qinyuan Huang; Qiang Li; Maoxia Ran; Xin Liu; Ying Zhou
Journal: Shock and Vibration
 (2021)

---

## Abstract

The acoustic-based internal defect detection is essential to ensure the quality of arc magnets efficiently. Swarm decomposition (SWD) is conducive to processing acoustic signals, but it is still confronted with threshold optimization problems. Especially, the existing optimization methods for the SWD thresholds are merely available for a single signal with exclusive characteristics, instead of the various signals with similar characteristics. Therefore, a threshold-optimized SWD using grey wolf optimizer (GWO) is proposed to solve these issues and applied to detect the internal defects of arc magnets. In this method, a fitness function is designed to indicate the relationship between the SWD thresholds and the overall decomposition effect of similar signals. The minimum value of it corresponds to the threshold setting yielding the optimal decomposition. GWO is used for searching such a minimum value, and the obtained optimal threshold setting allows SWD to decompose any signal into a series of oscillatory components. The frequency information in the two oscillatory components with the highest energy ratio is extracted as the internal defect features. Random forest is carried out to identify these features. Experimentally, the detection accuracy reaches above 97%, and the detection speed per single arc magnet does not exceed 3.4 seconds. The proposed method cannot only determine the unified threshold setting of SWD for similar signals but also achieve an accurate, rapid detection for the internal defects.


---

## Body

## 1. Introduction

Arc magnet is a tile-shaped magnetic segment, which is used to form a constant magnetic field within motors [1]. The quality of arc magnets plays a decisive role in the performance and life of motors. However, arc magnets may occasionally suffer from internal defects, due to some unexpected factors during the manufacturing process, such as the improper temperature and pressure. These internal defects will significantly weaken the mechanical integrity and physical properties of an arc magnet, resulting in severe performance degradation or even damage to the motor [2]. Consequently, the internal defect detection of arc magnets is particularly important to ensure the performance and safety of motors. Nonetheless, detecting internal defects is full of challenges. For one thing, internal defects are difficult to identify accurately, owing to their invisibility, complex types, uncertain locations, and varying degrees. For another, the large-scale production of arc magnets always must require a rapid detection efficiency. Meanwhile, a growing number of arc magnet manufacturers tend to prefer low-cost detection approaches. The traditional and existing methods are quite incompetent to enable effective detection. The commonly used detection strategy is to determine whether the internal defects exist through the sensitive human hearing when an arc magnet collides with a mental block, since internal defects are able to change the acoustic and vibration characteristics of an arc magnet being excited [3]. Such a detection method has low efficiency and poor accuracy, and, more importantly, is easily prone to be errors because of human factors. Therefore, how to achieve a fast, accurate, low-cost, and automatic detection for internal defects becomes the critical problem to be solved urgently in the manufacture of arc magnets.Acoustic signals have been widely employed for developing defect detections and fault diagnoses [4, 5]; the reason for this is that they are easily and quickly acquired at low cost. The acoustic signal characteristics of an object are closely linked to its physical structure vibration. The internal defects are bound to change the physical structure of an arc magnet and, further, make an inevitable impact on the corresponding acoustic signal characteristics when the arc magnet vibrates in the air. There is always a characteristic difference in acoustic signals between qualified and defective arc magnets. Besides, instantaneous external forces, such as striking or colliding, provide a convenient and reliable way to excite an arc magnet to produce its high-quality acoustic signal, owing to its high hardness and excellent compressive strength. Analyzing the acoustic signal of arc magnets is expected to realize the internal defect detection. However, the related acoustic signal analysis is also extremely challenging for the internal defect detection. The nonlinearity and instability of acoustic signals can seriously hinder the extraction and identification of the signal features regarding internal defects. This is the reason why the acoustic-based detection for the internal defects of arc magnets is relatively less explored and reported.Some modern signal processing technologies based on the multiscale adaptive decomposition have already opened the possibility to analyze the acoustic signal of arc magnets. Due to the advantage in decomposing an original signal into several different components adaptively, these methods, for instance, empirical mode decomposition (EMD) [6], local mean decomposition (LMD) [7], ensemble empirical mode decomposition (EEMD) [8], and variational mode decomposition (VMD) [9], are rather beneficial to explore the features and even weak information in nonstationary and nonlinear signals. However, the inability to overcome the adverse influence of the mode aliasing severely limits the decomposition accuracy of both EMD and LMD [10]. Also, EEMD finds it unable to avoid the inefficient computing problem, even though it poses the ability to weaken the mode aliasing significantly [11]. In many recent studies, VMD is confirmed to be superior in both the mode aliasing elimination and the adaptive decomposition, but the difficulty of selecting multiple preset parameters in a wide range greatly restricts its applications [12]. Recently, Apostolidis and Hadjileontiadis proposed a novel approach in the nonlinear, nonstationary signal decomposition, namely, swarm decomposition (SWD) [13], which fosters rules of biological swarms to address signal analysis problems. SWD shows the significant advantages over other signal decomposition technologies in improving the decomposing adaptability and overcoming the mode aliasing. SWD has attracted increasing attention in some studies and has been utilized to cope with different kinds of signals, such as vibrational, biological, and electrical signals. For example, Wan and Peng [14] adopted SWD to analyze the bearing signal and realized a fault diagnosis of the rotating bearing. By using SWD to process biological signals, Baltatzis et al. [15] developed a detection to determine whether a bullying incident occurred on campus. Alnuaimi et al. [16] employed SWD for analyzing the Doppler signal of the fetal heart, which made it possible to detect the disease early and reduce fetal disease mortality.Considering the advantages and applications of SWD compared to other signal decomposition methods, it appears that SWD has considerable potential for analyzing the acoustic signal of arc magnets because of the similarity between acoustic signals and vibration signals. Besides, it is well accepted that the optimal decomposition of a signal is most conducive to presenting the characteristics of the signal accurately. However, the performance of SWD is strictly subject to two preset thresholds, includingPth and StDth, which are termed as the peak threshold and the iteration deviation threshold, respectively. These two thresholds have a wide selection range, but the best performance of SWD commonly corresponds to a specific selection of them. Moreover, such a specific threshold setting is inconsistent in different signals. To realize the best decomposition of SWD, it is necessary to select the optimal threshold setting accurately before performing the decomposition of each signal. A growing number of research studies regarding SWD have come to recognize the importance and necessity of the proper threshold selection depending on optimization algorithms. A few meaningful attempts at the SWD threshold selection using optimization algorithms have emerged. For example, Miao et al. [17] proposed the whale optimization algorithm (WOA) to optimize the thresholds of SWD and then used the SWD with optimized thresholds to achieve the accurate decomposition of the rolling bearing vibration signal in the fault diagnosis. Although the optimization methods for SWD thresholds are not yet common, continuing efforts and progress have been made to resolve parameter optimization problems in the other applications. Samanta and Nataraj [18] adopted particle swarm optimization (PSO) to determine the optimal classifier parameters and achieved the accurate classification of bearing faults. Cerrada et al. [19] applied the genetic algorithm (GA) for the best set selection of gearbox condition parameters on time, frequency, and time-frequency domains and then developed the multiclass fault diagnosis in spur gears. All parameter or threshold optimization processes above need to express the characteristics and rules of parameters as a fitness function; the extremum of it corresponds to the optimal parameter setting. Remarkably, the optimization algorithm based on metaheuristics is responsible for searching the function extremum in the parameter space.A metaheuristic optimization algorithm is a higher-level heuristic method that can provide an effective solution to an optimization problem, especially, in the cases of imperfect information or limited computation capacity. It is widely applied in solving various complex optimization problems, due to its distinct advantages in simplicity, flexibility, derivation-free mechanism, and local optima avoidance. The common feature of all metaheuristics is that the search process is divided into the exploration and the exploitation. The exploration is to investigate the promising areas of the search space, whereas the exploitation refers to build the local search capability around the promising regions. Metaheuristics generally have three main classes, including evolutionary algorithms (EA), physics-based algorithms (PA), and swarm intelligence (SI). EA is inspired by the evolution in nature, and some typical algorithms in this branch are GA [20], differential evolution (DE) [21], evolutionary programing (EP) [22], genetic programing (GP) [23], and biogeography-based optimizer (BBO) [24]. PA is derived from imitating physical rules, and some of the most popular algorithms are simulated annealing (SA) [25], gravitational local search (GLS) [26], bigbang-bigcrunch (BBBC) [27], charged system search (CSS) [28], and central force optimization (CFO) [29]. SI refers to the metaheuristic algorithm mimicking the social behavior of swarms of creatures in nature. Recently, in comparison to EA and PA, SI has become the most interesting branch of metaheuristics because of fewer parameters to adjust, less operators, easier implementation, and more comprehensive information about the search space. Some of the widely used algorithms include PSO [30], ant colony optimization (ACO) [31], and artificial bee colony (ABC) [32]. Moreover, some of the typically recent and popular algorithms proposed so far are bat-inspired algorithm (BA) [33], WOA [34], grey wolf optimizer (GWO) [35], grasshopper optimization algorithm (GOA) [36], and fruit fly optimization algorithm (FOA) [37]. Among them, GWO performs an optimization by imitating the hunting mechanism and leadership hierarchy of grey wolves in nature. It has significant merits in the low computational time, the fast convergence, and the little possibility to be trapped at the local minimum. GWO constantly receives relatively wide attention and is used in various engineering fields. For example, Zhang et al. [38] proposed an adaptive stochastic resonance method for machinery fault diagnosis, in which the stochastic resonance system parameters are optimized by GWO algorithm using a redefined signal-to-noise ratio as optimization objective function. Sanjay et al. [39] employed the GWO algorithm for achieving the optimal global solution of the nonconvex discrete distributed generation problem. Verma et al. [40] utilized the GWO algorithm to optimize the parameters of the fractional-order controller for controlling the time-delay and higher-order system. Multiple studies for the parameter optimization show that GWO usually has a high-efficiency optimization performance in unknown, challenging search spaces and is able to provide highly competitive search results compared to other well-known metaheuristics. Thus, adopting GWO would be possible to enable the proper SWD threshold optimization.According to the literature reviews mentioned above, it can be concluded that the combination of SWD and GWO would have intrinsic yet complementary advantages in the acoustic signal decomposition that depends on the threshold optimization. However, it is still unknown and unclear how such a combination in the acoustic signal analysis could be reasonably and properly used for the internal defect detection of arc magnets. Moreover, most of the optimization methods merely focus on a single signal and its exclusive characteristics, resulting in that the optimization results are inapplicable to another signal even if they are quite similar. In parallel, a fast detection for arc magnets also does not allow an individual threshold optimization to be performed for each acoustic signal because of the inevitable time-consuming and complicated calculations during the optimization process. To address these issues, we propose an acoustic signal analysis method for detecting the internal defects of arc magnets based on the optimized SWD, in which GWO is used to determine the optimalPth and StDth thresholds of SWD. The fitness function used for GWO is designed to denote the relationship between the SWD thresholds and the overall optimal decomposition performance of similar signals. The experimental results demonstrated that the proposed method realizes a unified optimization of SWD thresholds for the various similar signals and offers the reliable performance to detect the existence of internal defects of arc magnets rapidly and accurately.


## 2. Materials and Methods

### 2.1. Swarm Decomposition

SWD has the ability to iteratively extract the oscillation component (OC) from a multicomponent signal through the appropriate parametric swarm filtering (SWF). Each of OCs can be regarded as a real component of the original signal. There are two aspects to SWD, including the swarming model and the swarm-prey hunting. To achieve the swarm-prey hunting, the swarming model contains two interaction forces. The first one is the driving force, and the other one is the cohesive force. For thei-member at the step n, the driving force, Fdrn,i, is defined as(1)Fdrn,i=Ppreyn−Pin−1,where Ppreyn represents the position of the prey at the step n and Pin−1 represents the position of the i-member at the step n−1.Unlike the driving force, the cohesive force refers to the inductive force between all members. The cohesion force for thei-member at the step n, Fcohn,i, is described as(2)Fcohn,i=1M−1⋅∑j=1,j≠iNfPin−1−Pjn−1,fd=−sgnd⋅lnddcr,where M represents the number of members in the swarm model, d refers to the distance between the two members, dcr is defined as the standard distance that keeps the two members not to affect each other, sgn⋅ denotes the sign function, f⋅ determines the type of the cohesion from the jth member to the ith member, and fdcr=0.To track the prey, the members need to update their respective positions. Sequentially, the velocity and position of theith member at the step n is described as(3)Vin=Vin−1+δ⋅Fdrn,i+Fcohn,i,Pin=Pin−1+δ⋅Vin,where δ is used to control the flexibility of the swarm and Vin represents the velocity of the ith member at the step n. It is worth noting that Ppreyn, Pin, and Vin are sequences of scalar values in order to simplify the data.When the hunting is completed, the positions of all members in the swarm are summed as the output of SWF, and the corresponding equation is expressed as(4)yn=β⋅∑i=1MPin,where β is the scale factor that impacts the order of M and β=0.005 affects the smallest reasonable M. Through the above analysis, δ and M as the decisive factor have an impact on the output of SWF. Therefore, the best δ and M can be calculated by the following equations with the normalized frequency ω¯:(5)Mω¯=33.46ω¯−0.375−29.1,δω¯=−1.5ω¯2+3.454ω¯−0.01.The core idea of SWD is to perform the filtering-like operations on a multicomponent input signal iteratively. In each iteration, a frequency band with a significant amplitude in the energy spectral density is selected as a candidate for optimizing the extraction mode. The optimal frequency bandω¯m can be calculated by the following equation:(6)ω¯m=argmaxS′Xitω¯>Pth,S′Xitω¯=SGFSXitω¯,where SXit⋅ represents the fast Fourier transform of Xitn and ω¯ denotes the normalized signal frequency.The algorithm framework of SWD is summarized as follows [41]:Step 1: input the original signal,Xn, and initialize the preset thresholds Pth and StDth, where ∀n=0,…,L−1.Step 2: discretizeXn into Xitn and assign it to y0n, where the subscript, it, in X is the serial number and it=0 initially.Step 3: smooth the energy spectrum ofy0n and calculate its optimal frequency band ω¯m.Step 4: the swarm parameters, namely,M and δ, are calculated based on the optimal frequency band ω¯m.Step 5: with the swarm parametersM and δ, SWF is performed on the discretized signal Xitn to obtain yin, where i is initially 1.Step 6: calculate the variance betweenyin and its initial signal, where the equation is as follows:(7)StD=∑n=1Nyin−yi−1n2yi−1n2.IfStD>StDth, assign yin to the input signal Xitn, return to Step 2 to perform SWF, and set i=i+1. Otherwise, assign yin to Xit′n.Step 7: update the input signal, according to the calculation equation that is as follows:(8)Xit+1n=Xitn−Cω¯dqn,Cω¯dqn=Xit′n−τdelay,τdelay=argmaxτRxit,xit′τ,whereRxit,xit′τ is the correlation number, τ is the delay, and −L−1≤τ≤L−1. Through the updated signal, repeat Step 2 to Step 7 until S′Xitω¯≤Pth, ∀ω¯.Step 8: extract the OCs and the residue signalrn. Defining Ω is the set of the recognized OCs, the corresponding calculation equations are as follows:(9)OCm≡Cω¯n,∀m=1,2,3,…,Ω,Cω¯n=Σq=1NCω¯dqn,∀ω¯∈Ω,Ω:ω¯:ω¯=ω¯dom,rn=Xitnit=final.


### 2.2. Grey Wolf Optimizer

GWO is a new type of bionic swarm intelligent optimization algorithm proposed by Mirjalili et al. [42]. This algorithm mainly imitates the grey wolf leadership mechanism and hunting mechanism in nature. All grey wolves are divided into four levels, including w1, w2, w3, and w4. As a decision maker, w1 is responsible for the hunting guidance as well as the decision formulation. As a subordinate of w1, w2 primarily helps w1 in its decision-making. w3 is chiefly in charge of patrolling their land, warning the wolf pack in case of emergencies, guarding weak wolves, and hunting the prey. In this hierarchical system, though w4 has the lowest status, it can perform as a venting object for other members when they suffer setbacks.In fact, the hunting hierarchy of GWO can be considered as the process to find a globally optimal solution, wherew1, w2, w3, and w4 are assumed as the first, second, third, and fourth optimal solution, respectively. To hunt the prey successfully, the prey must be surrounded firstly. The surrounding behavior can be described by the following equations [43]:(10)D=C⟶⋅X⟶Pt−X⟶t,X⟶t+1=X⟶Pt−A⟶⋅D⟶,where t represents the current iteration number, X⟶Pt and X⟶t are the position vectors of the prey and grey wolf, respectively, and A⟶ and C⟶ are coefficient vectors, and they can be calculated as follows:(11)A⟶=2⋅d⟶⋅r⟶1−d⟶,C⟶=2⋅r⟶2,where r⟶1 and r⟶2 are random vectors within [0, 1] and d⟶ decreases linearly from 2 to 0 during the entire iteration.After the encircle of the prey is realized, the search agent constantly updates its position through the position ofw1, w2, and w3, to reduce the encircling circle rapidly. The corresponding mathematical equations are as follows [44]:(12)D⟶w1=C⟶1⋅X⟶w1−X⟶,D⟶w2=C⟶2⋅X⟶w2−X⟶,D⟶w3=C⟶3⋅X⟶w3−X⟶,X⟶1=X⟶w1−A⟶1⋅D⟶w1,X⟶2=X⟶w2−A⟶2⋅D⟶w2,X⟶3=X⟶w3−A⟶3⋅D⟶w3,X⟶t+1=X⟶1+X⟶2+X⟶33.


### 2.3. Random Forest

RF is a robust and practical decision tree learning method, which trains several weak models to form a strong model, and it belongs to an integrated machine learning method [45]. Taking a binary decision tree as an example, when training a model, it needs to consider how to segment variables and points, and how to measure their quality. Generally, the quality of the variables and points are measured by the impurity of the nodes after the segmentation. The calculation equation can be defined as follows:(13)Gxl,vlk=nleftNsHXleft+nrightNsHXright,where xl is a feature of the segmentation vector, vlk is a value of the segmentation variable, nleft, nright, and NS are the number of training samples of the left child node, the number of training samples of the right child node, and the number of all training samples in the current stage, respectively, Xleft and Xright are the training sample sets of the left and right child nodes, respectively, and HX is a function to measure the impurity of the node.The machine learning model of RF can be transformed into an optimization problem of finding the smallest segmentation vectorx∗ and segmentation value vector vk∗, as shown below [46]:(14)argminx∗,vk∗Gx,vk.


### 2.4. Experimental Sample

The unmagnetized ferrite arc magnets with four different sizes are procured as experimental samples, whose appearances and specifications are given in Figure1(a) and Table 1, respectively. The set of all collected samples is able to form a robust representativeness of conventional arc magnets because the regular material and general size of arc magnets are covered by samples. According to the sizes, the samples are divided into four categories, which are termed as Type A, B, C, and D, severally. For ease of description, R, H, T, L, and W, in turn, are used to represent the radius, height, thickness, length, and width of an arc magnet. Each category of samples is made up of 240 arc magnets, which is equally split between qualified samples and defective samples. The qualified one refers to the arc magnet without any defects, while the defective one has only internal defects. Both qualified and defective samples in each category are further broken down into two groups as training samples and testing samples. Randomly collected 50-qualified and 50-defective samples from each category act as the training group to develop the detection algorithm. In contrast, the remaining samples in each category serve as the testing group for the performance verification of the detection algorithm. In order to ensure the reliability of experimental samples, the condition of all collected arc magnets has been consistently confirmed by three or more experienced inspectors through the manual detection method.Figure 1
The detection experiment. (a) The appearance of four types of arc magnets. (b) The detection system. (c) The flowchart of the detection algorithm.
(a)(b)(c)Table 1
The specification of experimental samples.
TypeSize (mm)ConditionNumber of the training samplesNumber of the test samplesRHTLWA502383664Qualified5070Defective5070B452173062Qualified5070Defective5070C301055021Qualified5070Defective5070D20933525Qualified5070Defective5070


### 2.5. Experimental Detection System

As exhibited in Figure1(b), the acoustic-based internal defect detection of arc magnets is a low-cost automation system composed of mechanical and electrical devices. Its running process is made up of three parts in sequence, including exciting an acoustic signal, collecting the acoustic signal, and processing the signal data. Firstly, a stepped structure consisting of two conveyor belts of different heights is used for transporting arc magnets from the upper conveyor to the lower one at a uniform speed. The vertical drop of each arc magnet occurs at this step, and then, the falling arc magnet collides with a metal block placed in the direction of falling to excite an acoustic signal. The difference in height between the two conveyors is set to 20 mm according to the engineering experience to ensure that the collision does not damage the arc magnet while producing a high-quality acoustic signal. Additionally, a pair of photoelectric sensors is also installed in the direction of falling. It will generate a trigger signal to initiate the signal acquisition if its optical path is blocked by a falling arc magnet. At this point, a 0.5-second acoustic signal can be acquired by a microphone having a frequency response ranging from 10 Hz to 20 kHz. The signal conditioning is employed for filtering and amplifying the collected signal. After that, a data acquisition card with a 40 kHz sampling rate and a 12 bit resolution is responsible for converting this signal into digital data stored in a computer with 2.5 GHz CPU and 16 GB RAM. Finally, the signal data is analyzed by a detection algorithm developed by a MATLAB program. Such an algorithm is able to provide a result regarding the presence or absence of internal defects in an arc magnet through extracting and identifying features of the acoustic signal. A push rod driven by an air cylinder is in charge of transferring the detected arc magnet to the lower conveyor, and subsequently, the sorting air cylinder is devoted to delivering the arc magnet to the corresponding outlet in accordance with the detection result.


### 2.6. Experimental Detection Algorithm

The acoustic-based detection for internal defects of arc magnets is to determine whether the internal physical structure is abnormal by the relationship between the structure attribute and its acoustic characteristics. As illustrated in Figure1(c), the algorithm flow refers to the process of analyzing the acoustic signal of arc magnet, which is divided into the signal decomposition, the feature extraction, and the feature identification, respectively.In the first part, the signal decomposition is in charge of locating the feature information from a large amount of the signal data. The acquired acoustic signal of each sample is processed by a high-pass filter to remove the frequency information below 4 kHz. Then, according to characteristics for acoustic signals of arc magnets, a fitness function, which can reflect the relationship between the threshold setting of bothPth and StDth and the SWD performance for the whole samples, is constructed. Moreover, the function minimum is designed to indicate the overall optimal SWD effect. Next, GWO is responsible for searching this value from the selectable threshold range to determine the optimal threshold setting. After that, the acoustic signals of all samples are uniformly decomposed by SWD with the optimal threshold setting so that each signal can be processed as optimally as possible.In the next part, the feature extraction is responsible for combining all specific signal information into the feature data. The first two OCs with the highest energy ratio, which can be considered to have the greatest characteristic contributions, are selected from the SWD results. Among them, the one with the highest energy ratio is referred to as the first characteristic OC (COC1), and the other is the second characteristic OC (COC2). Then, the frequencies of the maximum peak are, respectively, extracted from COC1 and COC2 as the feature data. Such two obtained data are combined into a feature vector that quantifies whether there are internal defects in the sample generated the corresponding acoustic signal.In the last part, the feature identification is used to identify the extracted feature data and determine whether the arc magnet corresponding to the acoustic signal is defective. The feature vectors of all training samples in the same category are input to RF to train a classifier model for the corresponding category. Then, this classifier is employed for identifying the feature vector of each testing sample in the category. According to the identification result, whether each sample has internal defects can be determined.


## 2.1. Swarm Decomposition

SWD has the ability to iteratively extract the oscillation component (OC) from a multicomponent signal through the appropriate parametric swarm filtering (SWF). Each of OCs can be regarded as a real component of the original signal. There are two aspects to SWD, including the swarming model and the swarm-prey hunting. To achieve the swarm-prey hunting, the swarming model contains two interaction forces. The first one is the driving force, and the other one is the cohesive force. For thei-member at the step n, the driving force, Fdrn,i, is defined as(1)Fdrn,i=Ppreyn−Pin−1,where Ppreyn represents the position of the prey at the step n and Pin−1 represents the position of the i-member at the step n−1.Unlike the driving force, the cohesive force refers to the inductive force between all members. The cohesion force for thei-member at the step n, Fcohn,i, is described as(2)Fcohn,i=1M−1⋅∑j=1,j≠iNfPin−1−Pjn−1,fd=−sgnd⋅lnddcr,where M represents the number of members in the swarm model, d refers to the distance between the two members, dcr is defined as the standard distance that keeps the two members not to affect each other, sgn⋅ denotes the sign function, f⋅ determines the type of the cohesion from the jth member to the ith member, and fdcr=0.To track the prey, the members need to update their respective positions. Sequentially, the velocity and position of theith member at the step n is described as(3)Vin=Vin−1+δ⋅Fdrn,i+Fcohn,i,Pin=Pin−1+δ⋅Vin,where δ is used to control the flexibility of the swarm and Vin represents the velocity of the ith member at the step n. It is worth noting that Ppreyn, Pin, and Vin are sequences of scalar values in order to simplify the data.When the hunting is completed, the positions of all members in the swarm are summed as the output of SWF, and the corresponding equation is expressed as(4)yn=β⋅∑i=1MPin,where β is the scale factor that impacts the order of M and β=0.005 affects the smallest reasonable M. Through the above analysis, δ and M as the decisive factor have an impact on the output of SWF. Therefore, the best δ and M can be calculated by the following equations with the normalized frequency ω¯:(5)Mω¯=33.46ω¯−0.375−29.1,δω¯=−1.5ω¯2+3.454ω¯−0.01.The core idea of SWD is to perform the filtering-like operations on a multicomponent input signal iteratively. In each iteration, a frequency band with a significant amplitude in the energy spectral density is selected as a candidate for optimizing the extraction mode. The optimal frequency bandω¯m can be calculated by the following equation:(6)ω¯m=argmaxS′Xitω¯>Pth,S′Xitω¯=SGFSXitω¯,where SXit⋅ represents the fast Fourier transform of Xitn and ω¯ denotes the normalized signal frequency.The algorithm framework of SWD is summarized as follows [41]:Step 1: input the original signal,Xn, and initialize the preset thresholds Pth and StDth, where ∀n=0,…,L−1.Step 2: discretizeXn into Xitn and assign it to y0n, where the subscript, it, in X is the serial number and it=0 initially.Step 3: smooth the energy spectrum ofy0n and calculate its optimal frequency band ω¯m.Step 4: the swarm parameters, namely,M and δ, are calculated based on the optimal frequency band ω¯m.Step 5: with the swarm parametersM and δ, SWF is performed on the discretized signal Xitn to obtain yin, where i is initially 1.Step 6: calculate the variance betweenyin and its initial signal, where the equation is as follows:(7)StD=∑n=1Nyin−yi−1n2yi−1n2.IfStD>StDth, assign yin to the input signal Xitn, return to Step 2 to perform SWF, and set i=i+1. Otherwise, assign yin to Xit′n.Step 7: update the input signal, according to the calculation equation that is as follows:(8)Xit+1n=Xitn−Cω¯dqn,Cω¯dqn=Xit′n−τdelay,τdelay=argmaxτRxit,xit′τ,whereRxit,xit′τ is the correlation number, τ is the delay, and −L−1≤τ≤L−1. Through the updated signal, repeat Step 2 to Step 7 until S′Xitω¯≤Pth, ∀ω¯.Step 8: extract the OCs and the residue signalrn. Defining Ω is the set of the recognized OCs, the corresponding calculation equations are as follows:(9)OCm≡Cω¯n,∀m=1,2,3,…,Ω,Cω¯n=Σq=1NCω¯dqn,∀ω¯∈Ω,Ω:ω¯:ω¯=ω¯dom,rn=Xitnit=final.


## 2.2. Grey Wolf Optimizer

GWO is a new type of bionic swarm intelligent optimization algorithm proposed by Mirjalili et al. [42]. This algorithm mainly imitates the grey wolf leadership mechanism and hunting mechanism in nature. All grey wolves are divided into four levels, including w1, w2, w3, and w4. As a decision maker, w1 is responsible for the hunting guidance as well as the decision formulation. As a subordinate of w1, w2 primarily helps w1 in its decision-making. w3 is chiefly in charge of patrolling their land, warning the wolf pack in case of emergencies, guarding weak wolves, and hunting the prey. In this hierarchical system, though w4 has the lowest status, it can perform as a venting object for other members when they suffer setbacks.In fact, the hunting hierarchy of GWO can be considered as the process to find a globally optimal solution, wherew1, w2, w3, and w4 are assumed as the first, second, third, and fourth optimal solution, respectively. To hunt the prey successfully, the prey must be surrounded firstly. The surrounding behavior can be described by the following equations [43]:(10)D=C⟶⋅X⟶Pt−X⟶t,X⟶t+1=X⟶Pt−A⟶⋅D⟶,where t represents the current iteration number, X⟶Pt and X⟶t are the position vectors of the prey and grey wolf, respectively, and A⟶ and C⟶ are coefficient vectors, and they can be calculated as follows:(11)A⟶=2⋅d⟶⋅r⟶1−d⟶,C⟶=2⋅r⟶2,where r⟶1 and r⟶2 are random vectors within [0, 1] and d⟶ decreases linearly from 2 to 0 during the entire iteration.After the encircle of the prey is realized, the search agent constantly updates its position through the position ofw1, w2, and w3, to reduce the encircling circle rapidly. The corresponding mathematical equations are as follows [44]:(12)D⟶w1=C⟶1⋅X⟶w1−X⟶,D⟶w2=C⟶2⋅X⟶w2−X⟶,D⟶w3=C⟶3⋅X⟶w3−X⟶,X⟶1=X⟶w1−A⟶1⋅D⟶w1,X⟶2=X⟶w2−A⟶2⋅D⟶w2,X⟶3=X⟶w3−A⟶3⋅D⟶w3,X⟶t+1=X⟶1+X⟶2+X⟶33.


## 2.3. Random Forest

RF is a robust and practical decision tree learning method, which trains several weak models to form a strong model, and it belongs to an integrated machine learning method [45]. Taking a binary decision tree as an example, when training a model, it needs to consider how to segment variables and points, and how to measure their quality. Generally, the quality of the variables and points are measured by the impurity of the nodes after the segmentation. The calculation equation can be defined as follows:(13)Gxl,vlk=nleftNsHXleft+nrightNsHXright,where xl is a feature of the segmentation vector, vlk is a value of the segmentation variable, nleft, nright, and NS are the number of training samples of the left child node, the number of training samples of the right child node, and the number of all training samples in the current stage, respectively, Xleft and Xright are the training sample sets of the left and right child nodes, respectively, and HX is a function to measure the impurity of the node.The machine learning model of RF can be transformed into an optimization problem of finding the smallest segmentation vectorx∗ and segmentation value vector vk∗, as shown below [46]:(14)argminx∗,vk∗Gx,vk.


## 2.4. Experimental Sample

The unmagnetized ferrite arc magnets with four different sizes are procured as experimental samples, whose appearances and specifications are given in Figure1(a) and Table 1, respectively. The set of all collected samples is able to form a robust representativeness of conventional arc magnets because the regular material and general size of arc magnets are covered by samples. According to the sizes, the samples are divided into four categories, which are termed as Type A, B, C, and D, severally. For ease of description, R, H, T, L, and W, in turn, are used to represent the radius, height, thickness, length, and width of an arc magnet. Each category of samples is made up of 240 arc magnets, which is equally split between qualified samples and defective samples. The qualified one refers to the arc magnet without any defects, while the defective one has only internal defects. Both qualified and defective samples in each category are further broken down into two groups as training samples and testing samples. Randomly collected 50-qualified and 50-defective samples from each category act as the training group to develop the detection algorithm. In contrast, the remaining samples in each category serve as the testing group for the performance verification of the detection algorithm. In order to ensure the reliability of experimental samples, the condition of all collected arc magnets has been consistently confirmed by three or more experienced inspectors through the manual detection method.Figure 1
The detection experiment. (a) The appearance of four types of arc magnets. (b) The detection system. (c) The flowchart of the detection algorithm.
(a)(b)(c)Table 1
The specification of experimental samples.
TypeSize (mm)ConditionNumber of the training samplesNumber of the test samplesRHTLWA502383664Qualified5070Defective5070B452173062Qualified5070Defective5070C301055021Qualified5070Defective5070D20933525Qualified5070Defective5070


## 2.5. Experimental Detection System

As exhibited in Figure1(b), the acoustic-based internal defect detection of arc magnets is a low-cost automation system composed of mechanical and electrical devices. Its running process is made up of three parts in sequence, including exciting an acoustic signal, collecting the acoustic signal, and processing the signal data. Firstly, a stepped structure consisting of two conveyor belts of different heights is used for transporting arc magnets from the upper conveyor to the lower one at a uniform speed. The vertical drop of each arc magnet occurs at this step, and then, the falling arc magnet collides with a metal block placed in the direction of falling to excite an acoustic signal. The difference in height between the two conveyors is set to 20 mm according to the engineering experience to ensure that the collision does not damage the arc magnet while producing a high-quality acoustic signal. Additionally, a pair of photoelectric sensors is also installed in the direction of falling. It will generate a trigger signal to initiate the signal acquisition if its optical path is blocked by a falling arc magnet. At this point, a 0.5-second acoustic signal can be acquired by a microphone having a frequency response ranging from 10 Hz to 20 kHz. The signal conditioning is employed for filtering and amplifying the collected signal. After that, a data acquisition card with a 40 kHz sampling rate and a 12 bit resolution is responsible for converting this signal into digital data stored in a computer with 2.5 GHz CPU and 16 GB RAM. Finally, the signal data is analyzed by a detection algorithm developed by a MATLAB program. Such an algorithm is able to provide a result regarding the presence or absence of internal defects in an arc magnet through extracting and identifying features of the acoustic signal. A push rod driven by an air cylinder is in charge of transferring the detected arc magnet to the lower conveyor, and subsequently, the sorting air cylinder is devoted to delivering the arc magnet to the corresponding outlet in accordance with the detection result.


## 2.6. Experimental Detection Algorithm

The acoustic-based detection for internal defects of arc magnets is to determine whether the internal physical structure is abnormal by the relationship between the structure attribute and its acoustic characteristics. As illustrated in Figure1(c), the algorithm flow refers to the process of analyzing the acoustic signal of arc magnet, which is divided into the signal decomposition, the feature extraction, and the feature identification, respectively.In the first part, the signal decomposition is in charge of locating the feature information from a large amount of the signal data. The acquired acoustic signal of each sample is processed by a high-pass filter to remove the frequency information below 4 kHz. Then, according to characteristics for acoustic signals of arc magnets, a fitness function, which can reflect the relationship between the threshold setting of bothPth and StDth and the SWD performance for the whole samples, is constructed. Moreover, the function minimum is designed to indicate the overall optimal SWD effect. Next, GWO is responsible for searching this value from the selectable threshold range to determine the optimal threshold setting. After that, the acoustic signals of all samples are uniformly decomposed by SWD with the optimal threshold setting so that each signal can be processed as optimally as possible.In the next part, the feature extraction is responsible for combining all specific signal information into the feature data. The first two OCs with the highest energy ratio, which can be considered to have the greatest characteristic contributions, are selected from the SWD results. Among them, the one with the highest energy ratio is referred to as the first characteristic OC (COC1), and the other is the second characteristic OC (COC2). Then, the frequencies of the maximum peak are, respectively, extracted from COC1 and COC2 as the feature data. Such two obtained data are combined into a feature vector that quantifies whether there are internal defects in the sample generated the corresponding acoustic signal.In the last part, the feature identification is used to identify the extracted feature data and determine whether the arc magnet corresponding to the acoustic signal is defective. The feature vectors of all training samples in the same category are input to RF to train a classifier model for the corresponding category. Then, this classifier is employed for identifying the feature vector of each testing sample in the category. According to the identification result, whether each sample has internal defects can be determined.


## 3. Results and Discussion

### 3.1. Comparison of Acoustic Signals of the Qualified and Defective Samples

Exploring the signal characteristic differences between qualified and defective samples are crucial to the success of the detection. It is generally accepted that both time domain and frequency domain are the most conventional signal analysis methods. To this end, a qualified sample and a defective sample are randomly selected from Type A to analyze their differences in the time and frequency domain. In order to fairly compare the characteristics of signals that are likely to be of different magnitudes, each signal of selected samples is normalized by the proportion of the signal amplitude to its maximum value. As can be seen in Figure2(a), there are no significant distinctions in the time domain waveforms of qualified and defective samples. Likewise, as exhibited in Figure 2(b), their waveforms in the frequency domain are also quite similar. Directly analyzing the time-frequency characteristics of the entire signal seems to be unable to distinguish between qualified and defective samples easily, but it can be seen that their acoustic signals are obviously composed of multiple frequency components. Moreover, it is worth noting that the characteristics of the acoustic signal of an arc magnet, such as significant peaks, are mainly concentrated in the high-frequency components. For example, several prominent peaks always appear in the high-frequency parts, regardless of whether they belong to a qualified sample or a defective one. In contrast, the low-frequency components of both qualified and defective samples are too low in amplitude and too similar to each other, resulting in that it is hard to establish a robust distinction. Thus, decomposing the signal into multiple frequency components is supposed to play an important role in achieving an effective signal analysis.Figure 2
Comparison of acoustic signals of randomly selected samples in type A. (a) The time-domain diagram of acoustic signals of a qualified sample and a defective sample. (b) The frequency-domain diagram of acoustic signals of a qualified sample and a defective sample. (c) The results of EMD when decomposing a qualified acoustic signal. (d) The results of VMD atK=3, α=100, τ=0, and ε=10−4 when decomposing the same qualified acoustic signal. (e) The results of VMD at K=4, α=2000, τ=0.1, and ε=10−6 when decomposing the same qualified acoustic signal. (f) The results of SWD at Pth=0.3 and StDth=0.4 when decomposing the same qualified acoustic signal. (g) The results of SWD at Pth=0.3 and StDth=0.2 when decomposing the same qualified acoustic signal.
(a)(b)(c)(d)(e)(f)(g)


### 3.2. Advantages and Limitations of SWD

To obtain multiple frequency components of the acoustic signal, SWD is selected as the signal decomposition method. To demonstrate the superiority of SWD, two widely used signal decomposition methods, namely, EMD and VMD, are applied to compare with it. In order to perform a fair comparison between algorithms, the same qualified sample in Type A is randomly selected out, and then its signal is separately decomposed by EMD, VMD, and SWD. As seen in Figure2(c), a total of 6 intrinsic mode functions (IMF) are generated by EMD. The frequency spectrum of the first IMF is extremely similar to that of the original signal, and the remaining IMFs only correspond to the low-frequency components. As a result, EMD is not suitable for the fine decomposition of the frequency components in the arc magnet acoustic signal, especially those in the high-frequency part. In addition, the same signal is processed by VMD. Since the implementation of VMD requires four parameters to be set in advance, two different parameter settings are chosen to analyze and compare the decomposition performance of VMD. These four parameters in each setting are termed as the mode number K, the penalty factor α, the Lagrange multiplier τ, and the iteration accuracy ε, respectively. It can be seen from Figure 2(d) that a total of three modes are obtained by using the parameter setting at K=3, α=100, τ=0, and ε=10−4, but Mode 1 and Mode 2 in the decomposition results are quite similar, indicating that the mode aliasing has occurred. Simultaneously, Figure 2(e) shows the results of decomposing the same signal through VMD with the other parameter setting at K=4, α=2000, τ=0.1, and ε=10−6. It can be seen that there are four obtained modes, each of which corresponds to an exclusive frequency component. Accordingly, VMD is indeed superior to EMD in decomposing such a signal. However, the performance of VMD depends on the proper setting of these four parameters within wide ranges. More importantly, the parameter K directly determines the number of modes, namely, the number of signal components that can be expressed, but the exact number of signal components is commonly unknown or uncertain before the decomposition. On the contrary, a better decomposition effect than EMD and VMD is given by SWD. Figure 2(f) shows the results of SWD at Pth=0.3 and StDth=0.4, when decomposing the same signal. With this threshold setting, SWD can produce a total of three OCs, which are all linked to different high-frequency components. Furthermore, the last OC indicates the residue after the decomposition, which is not available in other methods. The results show that high-frequency components representing signal characteristics can be obtained separately by SWD, resulting in that the differences in signal details between qualified and defective samples are conducive to discovery. Compared to VMD, SWD relies on fewer parameters, does not need to determine the number of signal components in advance, and provides more information. However, the implementation of SWD is always inseparable from the presets of both Pth and StDth. As exhibited in Figure 2(g), after changing the threshold setting to Pth=0.3 and StDth=0.2, the SWD results are completely different from the previous one. For instance, a total of four different OCs can be obtained, in which the high-frequency components are broken down more finely. Hence, it is necessary to make the optimal selection for the threshold setting in order to realize the best decomposition results.


### 3.3. Preprocessing of Original Signals

Since only the high-frequency components are meaningful for detecting the internal defects, removing low-frequency components before starting the signal decomposition can significantly reduce the amount of the data processing, decrease the processing difficulty, and shorten the processing time. The high-pass filter is considered as an effective tool to remove low-frequency components, but its filtering range needs to be determined in advance. As seen in Figure2(b), the frequency components below the dominant peak are relatively similar. However, removing components near the dominant peak may result in the loss of too much potentially useful information because they are inextricably linked to the dominant peak characteristics despite their weak amplitude. In addition, a similar low-frequency range between different samples may not be the same. To determine the unified range used for a high-pass filter, five qualified and five defective samples are randomly selected from each type. Figure 3 shows their frequency spectra, respectively. By observing the similarity in low-frequency components between all qualified and defective samples, 4 kHz is suitable as the filtering range of a high-pass filter. Below such a frequency, the four types of samples always have the greatest similarity between qualified and defective samples. On the contrary, above this frequency, there is a distinction between qualified and defective samples. It means that the internal defect information of arc magnets carried by acoustic signals would most likely exist in the high-frequency part above 4 kHz. The analysis of the low-frequency part presumably brings about ineffective calculations as well as redundant time consumptions. Therefore, to simplify the signal data and realize an accurate signal analysis, each acoustic signal is preprocessed by a 4 kHz high-pass filter before being decomposed by SWD.Figure 3
Frequency spectra of randomly selected five qualified and five defective samples. (a) Type A. (b) Type B. (c) Type C. (d) Type D.
(a)(b)(c)(d)


### 3.4. Acoustic Signal Decomposition Based on the Threshold-Optimized SWD

#### 3.4.1. Fitness Function for the Optimization

The signal decomposition performance heavily depends on two preset thresholds, includingPth and StDth. Inappropriate thresholds can cause either over-decomposition or under-decomposition. The over-decomposition inevitably produces redundancy results, such as completely repetitive or excessively approximate OCs. As shown in Figure 4(a), the threshold setting at Pth=0.1 and StDth=0.1 leads to the over-decomposition of the previous qualified sample. For example, OC 1 and OC 2 are so extremely similar that they only contribute the same information of signal details but require extra computation to obtain these two components. Conversely, the under-decomposition is bound to result in the inability to break down several components into a set of separate and different OCs. As shown in Figure 4(b), the under-decomposition occurs in the same sample when Pth=0.5 and StDth=0.5. The significant frequency components of the original signal are integrated into the same OC 2, and they cannot be separately obtained by any individual OC. Consequently, SWD using the optimal threshold should be able to minimize the over-decomposition as well as the under-decomposition.Figure 4
Results of the threshold optimization and signal decomposition of SWD for type A. (a) The over-decomposition results of SWD atPth=0.1 and StDth=0.1 when decomposing the same signal. (b) The under-decomposition results of SWD at Pth=0.5 and StDth=0.5 when decomposing the same signal. (c) The search path of the SWD threshold optimization using GWO for the whole training samples. (d) Five optimizations of the SWD thresholds for the whole training samples. (e) The overall optimal decomposition results of SWD at Pth=0.382 and StDth=0.092. (f) The individual optimal decomposition results of SWD at Pth=0.357 and StDth=0.124. (g) The energy ratio distribution of OCs from a qualified sample and a defective sample.
(a)(b)(c)(d)(e)(f)(g)These two thresholds have a wide selectable range, and any value in their range can be set as a possible threshold. The threshold optimization is to select a proper setting from such a range to avoid the over-decomposition and the under-decomposition. To quantify the relationship between the decomposition performance and the threshold setting, a fitness function,fPth,StDth, is designed as follows:(15)fPth,StDth=1Nt∑i=1Nt1−Cixi,yi+Mi,Cixi,yi=∑t=1Lxit−x¯iyit−y¯i∑t=1Lxit−x¯i2∑t=1Lyit−y¯i2,xi=∑j=1k−1uji,Mi=∑j=1k−1vji,vji=1,ifCiuj−1i,uji>0.1andj>1,0,ifCiuj−1i,uji≤0.1orj≤1,where Nt is the number of training samples, yi is the original signal of the ith sample, xi is the sum of the first k−1 OCs obtained from yi by SWD, k represents the number of all obtained OCs, uji refers to the jth OC of yi, L is the length of the data, x¯i and y¯i, respectively, represent the average of xi and yi, Cixi,yi indicates the Pearson correlation coefficient [47] between xi and yi, Mi is the number of times that the Pearson correlation coefficient of adjacent OCs in yi is greater than 0.1, and vji is the specific binary result of the Pearson correlation coefficient between two adjacent OCs, namely, uj−1i and uji.In such a fitness function, the two thresholds of SWD, includingPth and StDth, are regarded as the function variables. Since the last OC often acts as the residue of the decomposition, only the first k−1 OCs are used for this function. The increase of Cixi,yi means that the obtained components are closer to the original signal so that the smaller 1−Cixi,yi indicates the less possibility of under-decomposition. On the contrary, the decrease in Mi accounts for the fact that the obtained components are more irrelevant to each other. The lower Mi signifies that the over-decomposition is less likely to occur. Hence, the combination of 1−Cixi,yi and Mi has the ability to simultaneously reflect the degree of over-decomposition and under-decomposition, resulting in that the decomposition performance of SWD for a single signal can be fully expressed. Besides, the average of the decomposition performance of all training samples is utilized to quantify the overall decomposition performance of samples in the same type. As a result, the designed fitness function can establish a sufficient correlation between the threshold setting and the whole or individual decomposition performance of SWD. Any setting regarding Pth and StDth is able to produce a unique value of this fitness function; the minimum of it corresponds to the optimal threshold setting.


#### 3.4.2. SWD Threshold Optimization with GWO

The threshold optimization is to search the minimum of the function above from the available threshold range. Both thresholds range from 0 to 0.5, and consequently, this function is distributed in a three-dimensional space, which is composed ofPth∈0,0.5, StDth∈0,0.5, and fPth,StDth. To complete the optimization, GWO is used to search for the coordinates of the minimum function value in this space. The GWO algorithm in this work is performed through fixed parameters determined by both empirical values and specific search ranges, including na, ni, nd, bl, and bu. The first two parameters indicate the number of search agents and the maximum number of iterations, respectively, which are empirically set as na=10 and ni=10. The third parameter, namely, nd, denotes the number of search objects and is set to two because of two dimensions formed by Pth and StDth.The last two parameters are the lower and upper limit vectors of search ranges, respectively, and bl=0,0 and bu=0.5,0.5. Taking all training samples in Type A as an example, Figure 4(c) shows the searching path and result of the threshold optimization. It can be seen that the minimum value of the function, namely, 0.087, is found at the coordinate of Pth=0.382 and StDth=0.092 through ten iterations of the searching location update. To verify the consistency of the optimization results, such a threshold optimization was performed five times, separately. As shown in Figure 4(d), although the starting coordinate of each optimization is different, the final function value searched by the five optimizations is exactly the same. Moreover, each optimization always consumes only ten iterations, during which the searched values converge rapidly. As also shown in Figure 4(d), the searched function value will no longer change after the tenth iteration, even if the number of iterations is increased. Obviously, GWO provides a short searching path, a low number of iterations, a fast optimization speed, and a result that does not trap in the local optimization.ThePth and StDth at the found coordinates can be considered as the optimal threshold setting. Since the function represents the whole decomposition performance of samples in Type A, the determined optimal threshold setting can enable each sample to reach the overall optimal decomposition effect rather than a single optimal effect. As shown in Figure 4(e), the acoustic signal of the previous qualified sample is decomposed by SWD using the obtained optimal threshold setting. Unlike the over-decomposition and under-decomposition, the optimal threshold setting for the overall samples can produce more elaborate results without redundant information. At the same time, the optimal threshold setting for a single sample can be also obtained by using the designed function and this signal. As shown in Figure 4(f), the optimal threshold setting, which is Pth=0.357 and StDth=0.124, is different from the one for the overall samples, but both of them produce almost identical decomposition results. It indicates that the optimal decomposition results for the overall samples do approximate to those for an individual sample. It further means that the optimal Pth and StDth for the overall samples can be used as the uniform threshold setting to decompose other signals in the same type, instead of carrying out the threshold optimization for each congeneric new signal. Consequently, the threshold setting for performing the SWD processing of each signal in the same type can be determined from a one-time optimization based on the signals of all training samples. Since the optimization takes only one time and the optimal threshold setting is unique, the sensitivity and uncertainty of the thresholds no longer seriously affect the optimal decomposition performance of SWD. Moreover, such a threshold optimization can tremendously contribute to achieving a rapid signal analysis through the least amount of the optimization because any optimization process always imposes additional computational burdens and extra time consumption on data processing. Similarly, the optimal threshold for other types of samples can also be obtained by GWO. Table 2 shows the results of the threshold optimization for four types of samples.Table 2
Optimization results of SWD thresholds for four types of samples.
TypePthStDthA0.3820.092B0.4350.361C0.3910.393D0.3240.196


### 3.5. Feature Extraction

#### 3.5.1. OC Selection

After the original signal is decomposed by SWD using the optimal threshold setting, a set of OCs can be obtained, each of which can be regarded as a component. However, the information representing the internal defects is generally only part of the signal decomposition results, rather than all of it. The meaningful results refer to those OCs that are likely to contain the signal characteristics related to internal defects. The energy ratio would be exceptionally useful and beneficial for quantifying how much signal characteristic information an OC contains because the more abundant characteristic information in a signal component tends to the higher the energy. The energy ratio of each OC can be defined as follows:(16)Ek=∑j=1Lkukj2∑j=1Lyyj2,where uk denotes the kth OC, Ek acts as its energy ratio, y indicates the original signal, Lk is the length of uk, and Ly is the length of y.Within the results of SWD, the OC with the largest energy ratio inevitably has the most signal characteristic information, leading to that it has the highest probability of having the most information regarding internal defects. An example can be found from the energy ratio distribution of OCs, which is derived from a qualified sample and a defective sample, respectively. As seen in Figure4(g), regardless of qualified or defective samples, the first two OCs with the largest energy ratio almost account for the majority of the whole signal energy. Obviously, the features of internal defects are suitable to be extracted from these two OCs. However, SWD does not ensure that each signal can be decomposed into the same number of OCs. To this end, the two OCs used for the feature extraction are determined as follows:(17)COC1=ue1,COC2=ue2Nu>1,COC1=COC2=ue1Nu=1,where ue1 and ue2 are the first and second OCs with the largest energy ratio, Nu is the number of all OCs, and COC1 and COC2 denote the first and second characteristic OCs for the feature extraction. Such a determination method can guarantee that there are always two OCs for the feature extraction regardless of the number of the SWD results.


#### 3.5.2. Acoustic Signal Features of Arc Magnet Internal Defects

Much direct and indirect information in a signal, such as entropy [48], variance [49], and minimum redundancy [50], can be considered as signal characteristics. The vector or matrix composed of their complicated set is often adopted as the feature data, resulting in the huge difficulty and excessive computation of the feature extraction. For a rapid detection, simple yet effective features are vitally important. In this work, the frequencies of the maximum peak in both COC1 and COC2 are directly regarded as features representing the existence of internal defects. The frequency of the maximum peak in COC1 is termed as F1, while the one in COC2 corresponds to F2. The combination of F1,F2 is the final feature vector for each signal. As depicted in Figure 5, the feature distribution of four types of training samples shows that the extracted features provide a robust distinguishability between qualified and defective samples. The features related to qualified samples are concentrated in a relatively small region, but those belonging to defective samples are randomly distributed in a vast region. Although the minority of features for qualified and defective samples is quite close together, not only do they have no obvious overlap and intersection but also have a clear boundary between each other. Such clustering results of extracted features are conducive to the identification because the feature data of qualified and defective samples are completely different.Figure 5
Results of extracted features. (a) Type A. (b) Type B. (c) Type C. (d) Type D.
(a)(b)(c)(d)


### 3.6. Feature Identification and Detection Results

In this work, RF serves as the classifier to identify the features and determine the detection results. To fairly verify the effectiveness of the feature identification with RF, two frequently used identification methods, namely, support vector machine (SVM) [51] and k-nearest neighbors (KNN) [52], are selected as the classifiers to compare with RF. The classifiers corresponding to these three methods are trained and tested by the same sample signals. The classifier of each type of samples is trained by their own training samples, while the testing samples are employed for the identification using the trained classifier. The recognition accuracy of the detection algorithm for all samples is shown in Table 3. The accuracy includes AD, AN, and ADN, which can be defined as follows:(18)AD=IDND,AN=INNN,ADN=100%×ID+INND+NN,where ID and IN indicate the number of defective and qualified samples correctly identified, respectively, ND and NN are the number of defective and qualified testing samples, respectively, AD and AN denote the recognition rate of defective and qualified samples, respectively, and ADN represents the overall recognition rate of qualified and defective samples.Table 3
The recognition accuracy of detection algorithm using three different classifiers.
TypeRFSVMKNNADANADNADANADNADANADNA70/7070/70100%70/7062/7094.29%70/7068/7098.57%B70/7070/70100%70/7050/7085.71%70/7070/70100%C70/7070/70100%70/7062/7094.29%70/7070/70100%D70/7067/7097.86%68/7062/7092.86%70/7066/7097.14%It can be seen that RF achieves the best results compared to the other two classifiers, regardless of the types of samples. In the results of RF, the overall recognition rate for Type A, B, and C reaches 100%, but that of Type D is 97.86%. Although three qualified samples in Type D are not correctly identified, the recognition rate of all defective samples is still 100%. By contrast, due to the lowest false detection rate, such an algorithm using RF has a significant value of utilization.In addition to the recognition accuracy, the running time is also another important performance of the detection algorithm. According to the designed detection algorithm, it consists of the time cost of the preparation and detection. The former refers to the time consumption of processing all training sample signals, including the acoustic signal acquisition, the threshold optimization, the feature extraction, and the classifier training. The latter is on behalf of the time consumed by a single testing sample from starting the signal acquisition to producing the detection result by the well-trained classifier. Table4 shows the running time of the detection algorithm in units of seconds. Ta denotes the time consumption of collecting all training sample signals of each type of samples. As aforementioned, the number of training samples in each type is 50-qualified and 50-defective samples, and the duration of each signal is 0.5 seconds, results in Ta=0.5×100. To indicates the time consumption of the SWD threshold optimization using GWO. Since each iteration during the optimization needs to perform the signal decomposition with the corresponding thresholds, To is the time consumed by both a series of the signal decomposition with SWD for all training samples and multiple threshold searches with GWO. Tc is the sum of time costs regarding the feature extraction and the classifier training. On the contrary, tmax, tmin, and tave are separately the maximum, minimum, and average time consumption for detecting a single testing sample. Any of them is made up of four time costs, including the signal acquisition with 0.5 seconds, the signal decomposition with the threshold-optimized SWD, the feature extraction, and the internal defect identification based on the trained classifier. Significantly, tave representing the average performance can be regarded as the primary detection speed, whereas Ta, To, and Tc occurring before the detection always belong to the time consumption generated by the offline processing. It can be seen from these running time results that To is the longest time cost. It also means that the optimization process is always the most time-consuming, but the unified thresholds obtained by the proposed method eliminate the need for the threshold optimization during the detection of each signal, which greatly reduces the time consumption. Although the time cost in different types of samples is quite distinct from each other, the maximum detection time for a single sample does not exceed 3.4 seconds. Therefore, the proposed detection algorithm is able to achieve an acceptable detection speed with a relatively short running time.Table 4
The running time of the detection algorithm in units of seconds.
TypePreparationDetectionTaToTctmaxtmintaveA0.5 × 100116151.3892.4722.4412.457B0.5 × 100115971.3622.5412.5132.525C0.5 × 100116111.3962.2512.2182.235D0.5 × 100116091.4013.3963.3673.389Besides, since the acoustic signal differences in Type D between qualified and defective samples are relatively similar, the extraction and identification of features are difficult to process, resulting in a lower recognition rate and more extended time consumption. More notably, the running time of the algorithm could be further shortened by either optimizing the algorithm code or improving the computer hardware configuration.


### 3.7. Evaluation and Validation

#### 3.7.1. Influence of the Filtering Range on the Detection Performance

To confirm the rationality of the used filtering range for the high-pass filter, its influence on the detection performance, including the accuracy and speed, is obtained by adjusting the filtering range. The overall recognition rate of all testing samples in each type is regarded as the accuracy, while their time consumption from preprocessing the signal to identifying the features is defined as the speed. The filtering range is adjusted from 0 Hz to 6 kHz, and each filtering range corresponds to an exclusive accuracy and speed. It can be found in Figure6(a) that the speed decreases obviously synchronously with the increase of the filtering range because the larger filtering range means fewer signal data to be processed. However, the decrease in the accuracy occurs after 4 kHz, and the highest accuracy is always stable within 4 kHz. According to these results, the filtering range exceeding 4 kHz is bound to lose some beneficial signal information for the extraction or identification of features, resulting in an obvious decrease in the accuracy. It also suggests that the acoustic signal characteristics representing the presence or absence of the internal defects are distributed within the relatively high-frequency range instead of the low-frequency part below 4 kHz. Therefore, for the sake of both the highest overall recognition rate and the lowest time consumption, the selected 4 kHz is the best filtering range for all samples in each type.Figure 6
The evaluation and validation of the detection performance. (a) The influence of different filtering ranges on the accuracy and speed. (b) The effect of different quantities of training samples on the detection accuracy. (c) The impact of optimized and nonoptimized thresholds on the detection accuracy. (d) The effect of different GWO parameter values on the detection accuracy for type A.
(a)(b)(c)(d)


#### 3.7.2. Impact of Training Sample Quantities on the Detection Accuracy

The training sample quantities have a primary impact on the identification performance of the RF classifier. Too many training samples will cause more calculations and longer training time, while too few training samples will lead to a lack of feature information. To assess the most appropriate number of training samples, seven training groups with different amounts of training samples are used for establishing an RF classifier for each type. Each group is equally divided between the qualified and defective samples. All training samples in each group are randomly collected from the same type. The previous testing samples are applied to obtain the corresponding detection accuracy. The accuracy results are utilized to verify the best number of training samples. It can be seen from Figure6(b) that testing samples in Type B obtain the stable highest detection accuracy in any training group, but other types of samples get the highest accuracy only at the beginning of the training group made up of 50 qualified and 50 defective samples. In the training group where the number of training samples is lower than that of 50 qualified and 50 defective samples, the accuracy of Type B, C, and D increases with the number of samples. The accuracy of training groups exceeding this number tends to be stable, neither increasing nor decreasing. Therefore, the best setting for training sample quantities is the combination of 50 qualified and 50 defective samples.


#### 3.7.3. Influence of the Threshold Optimization on the Detection Accuracy

To verify the importance and validity of the threshold optimization for SWD, all testing samples in each type are decomposed by the nonoptimized thresholds and then used for the internal defect detection. The nonoptimized thresholds refer toPth and StDth that are available within the threshold range except the optimal threshold setting determined by the optimization. Figure 6(c) shows the detection accuracy of all testing samples under the optimized and nonoptimized thresholds. It can be clearly seen that the detection accuracy corresponding to the nonoptimized thresholds is always lower than that of optimized thresholds regardless of the sample type. It also means that only the optimal thresholds can make SWD produce the best signal decomposition, resulting in the highest detection accuracy. Furthermore, the accurate decomposition results would be quite helpful in exposing even relatively weak signal characteristics in detail. Thus, it is necessary to optimize the SWD thresholds properly, and adopting the proposed method helps to realize the optimized SWD.


#### 3.7.4. Influence of Different Parameters on the Optimization Performance of GWO

As aforementioned, the number of search agents and the maximum number of iterations, namely,na and ni, respectively, can be regarded as the main controlling parameters of GWO. However, the optimization performance of GWO might be sensitive to the values of its main controlling parameters, whereas the execution of GWO in this work is based on fixed parameters. To prove the validity of the used parameters, different values for na and ni are employed for implementing the threshold optimization for Type A. Then, the detection accuracy for all testing samples is applied to evaluate the influence of different parameter values on the optimization performance of GWO. As depicted in Figure 6(d), these two parameters have a relatively wide range of values for achieving the optimal accuracy. For instance, any position of the area consisting of na∈10,16 and ni∈10,20 always corresponds to the best accuracy. It signifies that the performance of GWO in the SWD threshold optimization is not extremely sensitive to changes in the controlling parameter values. The fixed parameter values we used, namely, na=10 and ni=10, are located within the most suitable value range, and more importantly, they are the smallest value in the range. It also means that our parameter values are able to perform the optimization more efficiently compared with other values because small controlling parameter value in GWO usually corresponds to less calculation and low complexity. Therefore, the used controlling parameter values for GWO in this work are reasonable and effective. In addition, it is worth noting that the increase of na and ni is generally beneficial to obtain higher accuracy, but the best one cannot be obtained when these two parameters get too large. The reason is that too large parameters complicate the decision-making mechanism, which is not conducive to the correct search.


#### 3.7.5. Comparison of Different Threshold Optimization Methods

Although the necessity of the threshold optimization is incontrovertible, there are many ways to achieve the optimization. In relevant studies, some methods have been proven to have excellent optimization capabilities. To verify the validity of GWO in the threshold optimization, a total of other five optimization algorithms are applied to compare with GWO because they are widely used for many cases for determining the optimal value. These algorithms are all derived from metaheuristics similar to GWO and are composed of some typically popular and recent methods, including GA, PSO, ACO, WOA, and GOA. To make a comparison under the same conditions, they are arranged in the same numerical space and the same random initial location to search for the minimum of the same fitness function based on the identical training samples in Type A. After that, all these algorithms can find the same optimal thresholds as obtained by GWO, resulting in the same optimization accuracy. However, their optimization efficiency, such as iterations and their time cost, is completely different from that of GWO. As listed in Table5, compared with the other five optimization algorithms, GWO obviously has the lowest number of iterations as well as the least time consumption. As aforementioned, the time consumption covers both a series of the signal decomposition with SWD for all training samples and multiple threshold searches with GWO. According to these results, the combination of GWO and the designed fitness function not only is suitable as a threshold optimization method for SWD but also provides a fast and accurate optimization result. In comparison to other metaheuristic optimization algorithms with the same fitness function, the metaheuristic strategy of GWO has relatively high efficiency and is further more suitable for the determination of the SWD threshold performance reflected by the acoustic signal characteristics of arc magnets. It can also confirm the rationality of choosing GWO in this work.Table 5
The comparison of different optimization methods for type A.
PerformanceGWOWOAGOAACOPSOGAIteration number101216162030Time consumption (s)116151792231581374084205275320


#### 3.7.6. Potential Applications of the Proposed Method

This work focuses on achieving the acoustic-based detection for internal defects of arc magnets via the threshold-optimized SWD, and consequently, the proposed method is also likely applicable to other cases where the acoustic signal analysis is used to determine defects or faults. Not only that, it has the potential to be applied to decompose other signals with similar characteristics to acoustic signals. To evaluate such a possibility, the vibration signal of a rotating machine is imitated, and then, our method is performed to decompose the simulated vibration signal. In general, there are similarities between acoustic signals and vibration signals, but the vibration signals measured in industrial environments are subject to multiple components, various excitations, and low signal-to-noise ratio (SNR) [53]. To establish a signal model as realistic as possible, the simulated vibration signal consists of five frequently encountered components, which are described as the following equation [54]:(19)xt=∑i=1MAicos2πifot+αi︸Rotor  vibrations+∑i=1NBicos2πiGfot+βi︸Gear meshing vibrations+∑i=1PCiSit−iT−τi︸Fault impulses+∑i=1QDiSit−Ok︸External shocks+nt︸Noises.For such a simulated vibration signalxt, the first term indicates the rotor vibration components, where fo is the fundamental rotating frequency and Ai and αi, respectively, stand for the amplitude and initial phase of the ith harmonic. The second term represents the normal gear meshing vibration components, where G denotes the number of gear tooth, and Bi and βi are, respectively, the amplitude and initial phase of the ith meshing frequency. The third term is the impulse components caused by mechanical faults in a gear or a rolling element bearing, where Ci specifies the amplitude of the ith impulse, T is the time interval between two adjacent impulses, τi is a random variable with zero-mean, which simulates the roller slip effect and typically accounts for 1-2% of fault period [55], and Sit denotes the ith impulse with the unit amplitude, which can be expressed by an exponentially decaying sinusoid as [56](20)Sit=e−θitsin2πfrit,where fri denotes the resonance frequency excited by the ith impact impulse and θi is the decay rate of the corresponding impulse. The fourth term represents some random external shock components from occasional strikes on the machine casing, or electromagnetic interferences during the data acquisition, where two random variables, Di and Ok, indicate the amplitude and occurrence time of the occasional impulses, respectively. The last term is the white Gaussian noise components with the SNR of 0 dB.The parameters for the simulated vibration signal are listed in Table6. The waveform and frequency spectrum of such a signal and all its components are shown in Figure 7(a). It can be seen that the fault-related component is unable to be visualized from neither the time domain nor the frequency domain in the final vibration signal because of the noises and undesirable components. Therefore, the mechanical fault diagnosis using a vibration signal analysis is to eliminate these interferences, such that the fault features can be confidently recognized. For this purpose, the simulated signal is analyzed by our method, in which the optimal threshold setting is determined as Pth=0.215 and StDth=0.490, and then, the threshold-optimized SWD is applied to provide the appropriate decomposition of the vibration signal. As illustrated in Figure 7(b), a total of four OCs are obtained. As aforementioned, the last OC belongs to the residue after the decomposition, which is almost unavailable in the signal analysis. However, the frequency-domain spectra of the first three OCs exhibit some significant information that contributes to the fault diagnosis. In the first OC, the rotor vibration frequency fo and two gear meshing vibration frequencies Gfo and 2Gfo exactly correspond to the frequencies of the first-three maximum peaks in turn. In the second OC, the fault impulse frequency fr1 is precisely the frequency of the maximum peak. Similarly, the external shock frequency fr2 is completely equal to the frequency of the maximum peak in the third OC. As a result, the weak fault component that is difficult to be visualized under the severe interference can be conveniently and accurately identified by our method. Thus, it is obvious that the proposed method is also competent to analyze some vibration signals precisely, resulting in that our method is expected to be extended to more potential applications, not just the acoustic-based detection of arc magnet internal defects.Table 6
The parameters for the vibration simulation of a rotating machine.
Rotor vibrationGear meshing vibrationsFault impulseExternal shockSampling frequencyTime lengthA1α1foGB1β1B2β2fr1θ1C1Tfr2θ210000 Hz0.3 s0.2π/220 Hz80.16π/20.12π/22400 Hz4000.251/1204000 Hz1200Figure 7
The application of the vibrational signal decomposition using the proposed method. (a) The simulation for the vibrational signal of a rotating machine. (b) The decomposition results of the simulated vibrational signal.
(a)(b)


## 3.1. Comparison of Acoustic Signals of the Qualified and Defective Samples

Exploring the signal characteristic differences between qualified and defective samples are crucial to the success of the detection. It is generally accepted that both time domain and frequency domain are the most conventional signal analysis methods. To this end, a qualified sample and a defective sample are randomly selected from Type A to analyze their differences in the time and frequency domain. In order to fairly compare the characteristics of signals that are likely to be of different magnitudes, each signal of selected samples is normalized by the proportion of the signal amplitude to its maximum value. As can be seen in Figure2(a), there are no significant distinctions in the time domain waveforms of qualified and defective samples. Likewise, as exhibited in Figure 2(b), their waveforms in the frequency domain are also quite similar. Directly analyzing the time-frequency characteristics of the entire signal seems to be unable to distinguish between qualified and defective samples easily, but it can be seen that their acoustic signals are obviously composed of multiple frequency components. Moreover, it is worth noting that the characteristics of the acoustic signal of an arc magnet, such as significant peaks, are mainly concentrated in the high-frequency components. For example, several prominent peaks always appear in the high-frequency parts, regardless of whether they belong to a qualified sample or a defective one. In contrast, the low-frequency components of both qualified and defective samples are too low in amplitude and too similar to each other, resulting in that it is hard to establish a robust distinction. Thus, decomposing the signal into multiple frequency components is supposed to play an important role in achieving an effective signal analysis.Figure 2
Comparison of acoustic signals of randomly selected samples in type A. (a) The time-domain diagram of acoustic signals of a qualified sample and a defective sample. (b) The frequency-domain diagram of acoustic signals of a qualified sample and a defective sample. (c) The results of EMD when decomposing a qualified acoustic signal. (d) The results of VMD atK=3, α=100, τ=0, and ε=10−4 when decomposing the same qualified acoustic signal. (e) The results of VMD at K=4, α=2000, τ=0.1, and ε=10−6 when decomposing the same qualified acoustic signal. (f) The results of SWD at Pth=0.3 and StDth=0.4 when decomposing the same qualified acoustic signal. (g) The results of SWD at Pth=0.3 and StDth=0.2 when decomposing the same qualified acoustic signal.
(a)(b)(c)(d)(e)(f)(g)


## 3.2. Advantages and Limitations of SWD

To obtain multiple frequency components of the acoustic signal, SWD is selected as the signal decomposition method. To demonstrate the superiority of SWD, two widely used signal decomposition methods, namely, EMD and VMD, are applied to compare with it. In order to perform a fair comparison between algorithms, the same qualified sample in Type A is randomly selected out, and then its signal is separately decomposed by EMD, VMD, and SWD. As seen in Figure2(c), a total of 6 intrinsic mode functions (IMF) are generated by EMD. The frequency spectrum of the first IMF is extremely similar to that of the original signal, and the remaining IMFs only correspond to the low-frequency components. As a result, EMD is not suitable for the fine decomposition of the frequency components in the arc magnet acoustic signal, especially those in the high-frequency part. In addition, the same signal is processed by VMD. Since the implementation of VMD requires four parameters to be set in advance, two different parameter settings are chosen to analyze and compare the decomposition performance of VMD. These four parameters in each setting are termed as the mode number K, the penalty factor α, the Lagrange multiplier τ, and the iteration accuracy ε, respectively. It can be seen from Figure 2(d) that a total of three modes are obtained by using the parameter setting at K=3, α=100, τ=0, and ε=10−4, but Mode 1 and Mode 2 in the decomposition results are quite similar, indicating that the mode aliasing has occurred. Simultaneously, Figure 2(e) shows the results of decomposing the same signal through VMD with the other parameter setting at K=4, α=2000, τ=0.1, and ε=10−6. It can be seen that there are four obtained modes, each of which corresponds to an exclusive frequency component. Accordingly, VMD is indeed superior to EMD in decomposing such a signal. However, the performance of VMD depends on the proper setting of these four parameters within wide ranges. More importantly, the parameter K directly determines the number of modes, namely, the number of signal components that can be expressed, but the exact number of signal components is commonly unknown or uncertain before the decomposition. On the contrary, a better decomposition effect than EMD and VMD is given by SWD. Figure 2(f) shows the results of SWD at Pth=0.3 and StDth=0.4, when decomposing the same signal. With this threshold setting, SWD can produce a total of three OCs, which are all linked to different high-frequency components. Furthermore, the last OC indicates the residue after the decomposition, which is not available in other methods. The results show that high-frequency components representing signal characteristics can be obtained separately by SWD, resulting in that the differences in signal details between qualified and defective samples are conducive to discovery. Compared to VMD, SWD relies on fewer parameters, does not need to determine the number of signal components in advance, and provides more information. However, the implementation of SWD is always inseparable from the presets of both Pth and StDth. As exhibited in Figure 2(g), after changing the threshold setting to Pth=0.3 and StDth=0.2, the SWD results are completely different from the previous one. For instance, a total of four different OCs can be obtained, in which the high-frequency components are broken down more finely. Hence, it is necessary to make the optimal selection for the threshold setting in order to realize the best decomposition results.


## 3.3. Preprocessing of Original Signals

Since only the high-frequency components are meaningful for detecting the internal defects, removing low-frequency components before starting the signal decomposition can significantly reduce the amount of the data processing, decrease the processing difficulty, and shorten the processing time. The high-pass filter is considered as an effective tool to remove low-frequency components, but its filtering range needs to be determined in advance. As seen in Figure2(b), the frequency components below the dominant peak are relatively similar. However, removing components near the dominant peak may result in the loss of too much potentially useful information because they are inextricably linked to the dominant peak characteristics despite their weak amplitude. In addition, a similar low-frequency range between different samples may not be the same. To determine the unified range used for a high-pass filter, five qualified and five defective samples are randomly selected from each type. Figure 3 shows their frequency spectra, respectively. By observing the similarity in low-frequency components between all qualified and defective samples, 4 kHz is suitable as the filtering range of a high-pass filter. Below such a frequency, the four types of samples always have the greatest similarity between qualified and defective samples. On the contrary, above this frequency, there is a distinction between qualified and defective samples. It means that the internal defect information of arc magnets carried by acoustic signals would most likely exist in the high-frequency part above 4 kHz. The analysis of the low-frequency part presumably brings about ineffective calculations as well as redundant time consumptions. Therefore, to simplify the signal data and realize an accurate signal analysis, each acoustic signal is preprocessed by a 4 kHz high-pass filter before being decomposed by SWD.Figure 3
Frequency spectra of randomly selected five qualified and five defective samples. (a) Type A. (b) Type B. (c) Type C. (d) Type D.
(a)(b)(c)(d)


## 3.4. Acoustic Signal Decomposition Based on the Threshold-Optimized SWD

### 3.4.1. Fitness Function for the Optimization

The signal decomposition performance heavily depends on two preset thresholds, includingPth and StDth. Inappropriate thresholds can cause either over-decomposition or under-decomposition. The over-decomposition inevitably produces redundancy results, such as completely repetitive or excessively approximate OCs. As shown in Figure 4(a), the threshold setting at Pth=0.1 and StDth=0.1 leads to the over-decomposition of the previous qualified sample. For example, OC 1 and OC 2 are so extremely similar that they only contribute the same information of signal details but require extra computation to obtain these two components. Conversely, the under-decomposition is bound to result in the inability to break down several components into a set of separate and different OCs. As shown in Figure 4(b), the under-decomposition occurs in the same sample when Pth=0.5 and StDth=0.5. The significant frequency components of the original signal are integrated into the same OC 2, and they cannot be separately obtained by any individual OC. Consequently, SWD using the optimal threshold should be able to minimize the over-decomposition as well as the under-decomposition.Figure 4
Results of the threshold optimization and signal decomposition of SWD for type A. (a) The over-decomposition results of SWD atPth=0.1 and StDth=0.1 when decomposing the same signal. (b) The under-decomposition results of SWD at Pth=0.5 and StDth=0.5 when decomposing the same signal. (c) The search path of the SWD threshold optimization using GWO for the whole training samples. (d) Five optimizations of the SWD thresholds for the whole training samples. (e) The overall optimal decomposition results of SWD at Pth=0.382 and StDth=0.092. (f) The individual optimal decomposition results of SWD at Pth=0.357 and StDth=0.124. (g) The energy ratio distribution of OCs from a qualified sample and a defective sample.
(a)(b)(c)(d)(e)(f)(g)These two thresholds have a wide selectable range, and any value in their range can be set as a possible threshold. The threshold optimization is to select a proper setting from such a range to avoid the over-decomposition and the under-decomposition. To quantify the relationship between the decomposition performance and the threshold setting, a fitness function,fPth,StDth, is designed as follows:(15)fPth,StDth=1Nt∑i=1Nt1−Cixi,yi+Mi,Cixi,yi=∑t=1Lxit−x¯iyit−y¯i∑t=1Lxit−x¯i2∑t=1Lyit−y¯i2,xi=∑j=1k−1uji,Mi=∑j=1k−1vji,vji=1,ifCiuj−1i,uji>0.1andj>1,0,ifCiuj−1i,uji≤0.1orj≤1,where Nt is the number of training samples, yi is the original signal of the ith sample, xi is the sum of the first k−1 OCs obtained from yi by SWD, k represents the number of all obtained OCs, uji refers to the jth OC of yi, L is the length of the data, x¯i and y¯i, respectively, represent the average of xi and yi, Cixi,yi indicates the Pearson correlation coefficient [47] between xi and yi, Mi is the number of times that the Pearson correlation coefficient of adjacent OCs in yi is greater than 0.1, and vji is the specific binary result of the Pearson correlation coefficient between two adjacent OCs, namely, uj−1i and uji.In such a fitness function, the two thresholds of SWD, includingPth and StDth, are regarded as the function variables. Since the last OC often acts as the residue of the decomposition, only the first k−1 OCs are used for this function. The increase of Cixi,yi means that the obtained components are closer to the original signal so that the smaller 1−Cixi,yi indicates the less possibility of under-decomposition. On the contrary, the decrease in Mi accounts for the fact that the obtained components are more irrelevant to each other. The lower Mi signifies that the over-decomposition is less likely to occur. Hence, the combination of 1−Cixi,yi and Mi has the ability to simultaneously reflect the degree of over-decomposition and under-decomposition, resulting in that the decomposition performance of SWD for a single signal can be fully expressed. Besides, the average of the decomposition performance of all training samples is utilized to quantify the overall decomposition performance of samples in the same type. As a result, the designed fitness function can establish a sufficient correlation between the threshold setting and the whole or individual decomposition performance of SWD. Any setting regarding Pth and StDth is able to produce a unique value of this fitness function; the minimum of it corresponds to the optimal threshold setting.


### 3.4.2. SWD Threshold Optimization with GWO

The threshold optimization is to search the minimum of the function above from the available threshold range. Both thresholds range from 0 to 0.5, and consequently, this function is distributed in a three-dimensional space, which is composed ofPth∈0,0.5, StDth∈0,0.5, and fPth,StDth. To complete the optimization, GWO is used to search for the coordinates of the minimum function value in this space. The GWO algorithm in this work is performed through fixed parameters determined by both empirical values and specific search ranges, including na, ni, nd, bl, and bu. The first two parameters indicate the number of search agents and the maximum number of iterations, respectively, which are empirically set as na=10 and ni=10. The third parameter, namely, nd, denotes the number of search objects and is set to two because of two dimensions formed by Pth and StDth.The last two parameters are the lower and upper limit vectors of search ranges, respectively, and bl=0,0 and bu=0.5,0.5. Taking all training samples in Type A as an example, Figure 4(c) shows the searching path and result of the threshold optimization. It can be seen that the minimum value of the function, namely, 0.087, is found at the coordinate of Pth=0.382 and StDth=0.092 through ten iterations of the searching location update. To verify the consistency of the optimization results, such a threshold optimization was performed five times, separately. As shown in Figure 4(d), although the starting coordinate of each optimization is different, the final function value searched by the five optimizations is exactly the same. Moreover, each optimization always consumes only ten iterations, during which the searched values converge rapidly. As also shown in Figure 4(d), the searched function value will no longer change after the tenth iteration, even if the number of iterations is increased. Obviously, GWO provides a short searching path, a low number of iterations, a fast optimization speed, and a result that does not trap in the local optimization.ThePth and StDth at the found coordinates can be considered as the optimal threshold setting. Since the function represents the whole decomposition performance of samples in Type A, the determined optimal threshold setting can enable each sample to reach the overall optimal decomposition effect rather than a single optimal effect. As shown in Figure 4(e), the acoustic signal of the previous qualified sample is decomposed by SWD using the obtained optimal threshold setting. Unlike the over-decomposition and under-decomposition, the optimal threshold setting for the overall samples can produce more elaborate results without redundant information. At the same time, the optimal threshold setting for a single sample can be also obtained by using the designed function and this signal. As shown in Figure 4(f), the optimal threshold setting, which is Pth=0.357 and StDth=0.124, is different from the one for the overall samples, but both of them produce almost identical decomposition results. It indicates that the optimal decomposition results for the overall samples do approximate to those for an individual sample. It further means that the optimal Pth and StDth for the overall samples can be used as the uniform threshold setting to decompose other signals in the same type, instead of carrying out the threshold optimization for each congeneric new signal. Consequently, the threshold setting for performing the SWD processing of each signal in the same type can be determined from a one-time optimization based on the signals of all training samples. Since the optimization takes only one time and the optimal threshold setting is unique, the sensitivity and uncertainty of the thresholds no longer seriously affect the optimal decomposition performance of SWD. Moreover, such a threshold optimization can tremendously contribute to achieving a rapid signal analysis through the least amount of the optimization because any optimization process always imposes additional computational burdens and extra time consumption on data processing. Similarly, the optimal threshold for other types of samples can also be obtained by GWO. Table 2 shows the results of the threshold optimization for four types of samples.Table 2
Optimization results of SWD thresholds for four types of samples.
TypePthStDthA0.3820.092B0.4350.361C0.3910.393D0.3240.196


## 3.4.1. Fitness Function for the Optimization

The signal decomposition performance heavily depends on two preset thresholds, includingPth and StDth. Inappropriate thresholds can cause either over-decomposition or under-decomposition. The over-decomposition inevitably produces redundancy results, such as completely repetitive or excessively approximate OCs. As shown in Figure 4(a), the threshold setting at Pth=0.1 and StDth=0.1 leads to the over-decomposition of the previous qualified sample. For example, OC 1 and OC 2 are so extremely similar that they only contribute the same information of signal details but require extra computation to obtain these two components. Conversely, the under-decomposition is bound to result in the inability to break down several components into a set of separate and different OCs. As shown in Figure 4(b), the under-decomposition occurs in the same sample when Pth=0.5 and StDth=0.5. The significant frequency components of the original signal are integrated into the same OC 2, and they cannot be separately obtained by any individual OC. Consequently, SWD using the optimal threshold should be able to minimize the over-decomposition as well as the under-decomposition.Figure 4
Results of the threshold optimization and signal decomposition of SWD for type A. (a) The over-decomposition results of SWD atPth=0.1 and StDth=0.1 when decomposing the same signal. (b) The under-decomposition results of SWD at Pth=0.5 and StDth=0.5 when decomposing the same signal. (c) The search path of the SWD threshold optimization using GWO for the whole training samples. (d) Five optimizations of the SWD thresholds for the whole training samples. (e) The overall optimal decomposition results of SWD at Pth=0.382 and StDth=0.092. (f) The individual optimal decomposition results of SWD at Pth=0.357 and StDth=0.124. (g) The energy ratio distribution of OCs from a qualified sample and a defective sample.
(a)(b)(c)(d)(e)(f)(g)These two thresholds have a wide selectable range, and any value in their range can be set as a possible threshold. The threshold optimization is to select a proper setting from such a range to avoid the over-decomposition and the under-decomposition. To quantify the relationship between the decomposition performance and the threshold setting, a fitness function,fPth,StDth, is designed as follows:(15)fPth,StDth=1Nt∑i=1Nt1−Cixi,yi+Mi,Cixi,yi=∑t=1Lxit−x¯iyit−y¯i∑t=1Lxit−x¯i2∑t=1Lyit−y¯i2,xi=∑j=1k−1uji,Mi=∑j=1k−1vji,vji=1,ifCiuj−1i,uji>0.1andj>1,0,ifCiuj−1i,uji≤0.1orj≤1,where Nt is the number of training samples, yi is the original signal of the ith sample, xi is the sum of the first k−1 OCs obtained from yi by SWD, k represents the number of all obtained OCs, uji refers to the jth OC of yi, L is the length of the data, x¯i and y¯i, respectively, represent the average of xi and yi, Cixi,yi indicates the Pearson correlation coefficient [47] between xi and yi, Mi is the number of times that the Pearson correlation coefficient of adjacent OCs in yi is greater than 0.1, and vji is the specific binary result of the Pearson correlation coefficient between two adjacent OCs, namely, uj−1i and uji.In such a fitness function, the two thresholds of SWD, includingPth and StDth, are regarded as the function variables. Since the last OC often acts as the residue of the decomposition, only the first k−1 OCs are used for this function. The increase of Cixi,yi means that the obtained components are closer to the original signal so that the smaller 1−Cixi,yi indicates the less possibility of under-decomposition. On the contrary, the decrease in Mi accounts for the fact that the obtained components are more irrelevant to each other. The lower Mi signifies that the over-decomposition is less likely to occur. Hence, the combination of 1−Cixi,yi and Mi has the ability to simultaneously reflect the degree of over-decomposition and under-decomposition, resulting in that the decomposition performance of SWD for a single signal can be fully expressed. Besides, the average of the decomposition performance of all training samples is utilized to quantify the overall decomposition performance of samples in the same type. As a result, the designed fitness function can establish a sufficient correlation between the threshold setting and the whole or individual decomposition performance of SWD. Any setting regarding Pth and StDth is able to produce a unique value of this fitness function; the minimum of it corresponds to the optimal threshold setting.


## 3.4.2. SWD Threshold Optimization with GWO

The threshold optimization is to search the minimum of the function above from the available threshold range. Both thresholds range from 0 to 0.5, and consequently, this function is distributed in a three-dimensional space, which is composed ofPth∈0,0.5, StDth∈0,0.5, and fPth,StDth. To complete the optimization, GWO is used to search for the coordinates of the minimum function value in this space. The GWO algorithm in this work is performed through fixed parameters determined by both empirical values and specific search ranges, including na, ni, nd, bl, and bu. The first two parameters indicate the number of search agents and the maximum number of iterations, respectively, which are empirically set as na=10 and ni=10. The third parameter, namely, nd, denotes the number of search objects and is set to two because of two dimensions formed by Pth and StDth.The last two parameters are the lower and upper limit vectors of search ranges, respectively, and bl=0,0 and bu=0.5,0.5. Taking all training samples in Type A as an example, Figure 4(c) shows the searching path and result of the threshold optimization. It can be seen that the minimum value of the function, namely, 0.087, is found at the coordinate of Pth=0.382 and StDth=0.092 through ten iterations of the searching location update. To verify the consistency of the optimization results, such a threshold optimization was performed five times, separately. As shown in Figure 4(d), although the starting coordinate of each optimization is different, the final function value searched by the five optimizations is exactly the same. Moreover, each optimization always consumes only ten iterations, during which the searched values converge rapidly. As also shown in Figure 4(d), the searched function value will no longer change after the tenth iteration, even if the number of iterations is increased. Obviously, GWO provides a short searching path, a low number of iterations, a fast optimization speed, and a result that does not trap in the local optimization.ThePth and StDth at the found coordinates can be considered as the optimal threshold setting. Since the function represents the whole decomposition performance of samples in Type A, the determined optimal threshold setting can enable each sample to reach the overall optimal decomposition effect rather than a single optimal effect. As shown in Figure 4(e), the acoustic signal of the previous qualified sample is decomposed by SWD using the obtained optimal threshold setting. Unlike the over-decomposition and under-decomposition, the optimal threshold setting for the overall samples can produce more elaborate results without redundant information. At the same time, the optimal threshold setting for a single sample can be also obtained by using the designed function and this signal. As shown in Figure 4(f), the optimal threshold setting, which is Pth=0.357 and StDth=0.124, is different from the one for the overall samples, but both of them produce almost identical decomposition results. It indicates that the optimal decomposition results for the overall samples do approximate to those for an individual sample. It further means that the optimal Pth and StDth for the overall samples can be used as the uniform threshold setting to decompose other signals in the same type, instead of carrying out the threshold optimization for each congeneric new signal. Consequently, the threshold setting for performing the SWD processing of each signal in the same type can be determined from a one-time optimization based on the signals of all training samples. Since the optimization takes only one time and the optimal threshold setting is unique, the sensitivity and uncertainty of the thresholds no longer seriously affect the optimal decomposition performance of SWD. Moreover, such a threshold optimization can tremendously contribute to achieving a rapid signal analysis through the least amount of the optimization because any optimization process always imposes additional computational burdens and extra time consumption on data processing. Similarly, the optimal threshold for other types of samples can also be obtained by GWO. Table 2 shows the results of the threshold optimization for four types of samples.Table 2
Optimization results of SWD thresholds for four types of samples.
TypePthStDthA0.3820.092B0.4350.361C0.3910.393D0.3240.196


## 3.5. Feature Extraction

### 3.5.1. OC Selection

After the original signal is decomposed by SWD using the optimal threshold setting, a set of OCs can be obtained, each of which can be regarded as a component. However, the information representing the internal defects is generally only part of the signal decomposition results, rather than all of it. The meaningful results refer to those OCs that are likely to contain the signal characteristics related to internal defects. The energy ratio would be exceptionally useful and beneficial for quantifying how much signal characteristic information an OC contains because the more abundant characteristic information in a signal component tends to the higher the energy. The energy ratio of each OC can be defined as follows:(16)Ek=∑j=1Lkukj2∑j=1Lyyj2,where uk denotes the kth OC, Ek acts as its energy ratio, y indicates the original signal, Lk is the length of uk, and Ly is the length of y.Within the results of SWD, the OC with the largest energy ratio inevitably has the most signal characteristic information, leading to that it has the highest probability of having the most information regarding internal defects. An example can be found from the energy ratio distribution of OCs, which is derived from a qualified sample and a defective sample, respectively. As seen in Figure4(g), regardless of qualified or defective samples, the first two OCs with the largest energy ratio almost account for the majority of the whole signal energy. Obviously, the features of internal defects are suitable to be extracted from these two OCs. However, SWD does not ensure that each signal can be decomposed into the same number of OCs. To this end, the two OCs used for the feature extraction are determined as follows:(17)COC1=ue1,COC2=ue2Nu>1,COC1=COC2=ue1Nu=1,where ue1 and ue2 are the first and second OCs with the largest energy ratio, Nu is the number of all OCs, and COC1 and COC2 denote the first and second characteristic OCs for the feature extraction. Such a determination method can guarantee that there are always two OCs for the feature extraction regardless of the number of the SWD results.


### 3.5.2. Acoustic Signal Features of Arc Magnet Internal Defects

Much direct and indirect information in a signal, such as entropy [48], variance [49], and minimum redundancy [50], can be considered as signal characteristics. The vector or matrix composed of their complicated set is often adopted as the feature data, resulting in the huge difficulty and excessive computation of the feature extraction. For a rapid detection, simple yet effective features are vitally important. In this work, the frequencies of the maximum peak in both COC1 and COC2 are directly regarded as features representing the existence of internal defects. The frequency of the maximum peak in COC1 is termed as F1, while the one in COC2 corresponds to F2. The combination of F1,F2 is the final feature vector for each signal. As depicted in Figure 5, the feature distribution of four types of training samples shows that the extracted features provide a robust distinguishability between qualified and defective samples. The features related to qualified samples are concentrated in a relatively small region, but those belonging to defective samples are randomly distributed in a vast region. Although the minority of features for qualified and defective samples is quite close together, not only do they have no obvious overlap and intersection but also have a clear boundary between each other. Such clustering results of extracted features are conducive to the identification because the feature data of qualified and defective samples are completely different.Figure 5
Results of extracted features. (a) Type A. (b) Type B. (c) Type C. (d) Type D.
(a)(b)(c)(d)


## 3.5.1. OC Selection

After the original signal is decomposed by SWD using the optimal threshold setting, a set of OCs can be obtained, each of which can be regarded as a component. However, the information representing the internal defects is generally only part of the signal decomposition results, rather than all of it. The meaningful results refer to those OCs that are likely to contain the signal characteristics related to internal defects. The energy ratio would be exceptionally useful and beneficial for quantifying how much signal characteristic information an OC contains because the more abundant characteristic information in a signal component tends to the higher the energy. The energy ratio of each OC can be defined as follows:(16)Ek=∑j=1Lkukj2∑j=1Lyyj2,where uk denotes the kth OC, Ek acts as its energy ratio, y indicates the original signal, Lk is the length of uk, and Ly is the length of y.Within the results of SWD, the OC with the largest energy ratio inevitably has the most signal characteristic information, leading to that it has the highest probability of having the most information regarding internal defects. An example can be found from the energy ratio distribution of OCs, which is derived from a qualified sample and a defective sample, respectively. As seen in Figure4(g), regardless of qualified or defective samples, the first two OCs with the largest energy ratio almost account for the majority of the whole signal energy. Obviously, the features of internal defects are suitable to be extracted from these two OCs. However, SWD does not ensure that each signal can be decomposed into the same number of OCs. To this end, the two OCs used for the feature extraction are determined as follows:(17)COC1=ue1,COC2=ue2Nu>1,COC1=COC2=ue1Nu=1,where ue1 and ue2 are the first and second OCs with the largest energy ratio, Nu is the number of all OCs, and COC1 and COC2 denote the first and second characteristic OCs for the feature extraction. Such a determination method can guarantee that there are always two OCs for the feature extraction regardless of the number of the SWD results.


## 3.5.2. Acoustic Signal Features of Arc Magnet Internal Defects

Much direct and indirect information in a signal, such as entropy [48], variance [49], and minimum redundancy [50], can be considered as signal characteristics. The vector or matrix composed of their complicated set is often adopted as the feature data, resulting in the huge difficulty and excessive computation of the feature extraction. For a rapid detection, simple yet effective features are vitally important. In this work, the frequencies of the maximum peak in both COC1 and COC2 are directly regarded as features representing the existence of internal defects. The frequency of the maximum peak in COC1 is termed as F1, while the one in COC2 corresponds to F2. The combination of F1,F2 is the final feature vector for each signal. As depicted in Figure 5, the feature distribution of four types of training samples shows that the extracted features provide a robust distinguishability between qualified and defective samples. The features related to qualified samples are concentrated in a relatively small region, but those belonging to defective samples are randomly distributed in a vast region. Although the minority of features for qualified and defective samples is quite close together, not only do they have no obvious overlap and intersection but also have a clear boundary between each other. Such clustering results of extracted features are conducive to the identification because the feature data of qualified and defective samples are completely different.Figure 5
Results of extracted features. (a) Type A. (b) Type B. (c) Type C. (d) Type D.
(a)(b)(c)(d)


## 3.6. Feature Identification and Detection Results

In this work, RF serves as the classifier to identify the features and determine the detection results. To fairly verify the effectiveness of the feature identification with RF, two frequently used identification methods, namely, support vector machine (SVM) [51] and k-nearest neighbors (KNN) [52], are selected as the classifiers to compare with RF. The classifiers corresponding to these three methods are trained and tested by the same sample signals. The classifier of each type of samples is trained by their own training samples, while the testing samples are employed for the identification using the trained classifier. The recognition accuracy of the detection algorithm for all samples is shown in Table 3. The accuracy includes AD, AN, and ADN, which can be defined as follows:(18)AD=IDND,AN=INNN,ADN=100%×ID+INND+NN,where ID and IN indicate the number of defective and qualified samples correctly identified, respectively, ND and NN are the number of defective and qualified testing samples, respectively, AD and AN denote the recognition rate of defective and qualified samples, respectively, and ADN represents the overall recognition rate of qualified and defective samples.Table 3
The recognition accuracy of detection algorithm using three different classifiers.
TypeRFSVMKNNADANADNADANADNADANADNA70/7070/70100%70/7062/7094.29%70/7068/7098.57%B70/7070/70100%70/7050/7085.71%70/7070/70100%C70/7070/70100%70/7062/7094.29%70/7070/70100%D70/7067/7097.86%68/7062/7092.86%70/7066/7097.14%It can be seen that RF achieves the best results compared to the other two classifiers, regardless of the types of samples. In the results of RF, the overall recognition rate for Type A, B, and C reaches 100%, but that of Type D is 97.86%. Although three qualified samples in Type D are not correctly identified, the recognition rate of all defective samples is still 100%. By contrast, due to the lowest false detection rate, such an algorithm using RF has a significant value of utilization.In addition to the recognition accuracy, the running time is also another important performance of the detection algorithm. According to the designed detection algorithm, it consists of the time cost of the preparation and detection. The former refers to the time consumption of processing all training sample signals, including the acoustic signal acquisition, the threshold optimization, the feature extraction, and the classifier training. The latter is on behalf of the time consumed by a single testing sample from starting the signal acquisition to producing the detection result by the well-trained classifier. Table4 shows the running time of the detection algorithm in units of seconds. Ta denotes the time consumption of collecting all training sample signals of each type of samples. As aforementioned, the number of training samples in each type is 50-qualified and 50-defective samples, and the duration of each signal is 0.5 seconds, results in Ta=0.5×100. To indicates the time consumption of the SWD threshold optimization using GWO. Since each iteration during the optimization needs to perform the signal decomposition with the corresponding thresholds, To is the time consumed by both a series of the signal decomposition with SWD for all training samples and multiple threshold searches with GWO. Tc is the sum of time costs regarding the feature extraction and the classifier training. On the contrary, tmax, tmin, and tave are separately the maximum, minimum, and average time consumption for detecting a single testing sample. Any of them is made up of four time costs, including the signal acquisition with 0.5 seconds, the signal decomposition with the threshold-optimized SWD, the feature extraction, and the internal defect identification based on the trained classifier. Significantly, tave representing the average performance can be regarded as the primary detection speed, whereas Ta, To, and Tc occurring before the detection always belong to the time consumption generated by the offline processing. It can be seen from these running time results that To is the longest time cost. It also means that the optimization process is always the most time-consuming, but the unified thresholds obtained by the proposed method eliminate the need for the threshold optimization during the detection of each signal, which greatly reduces the time consumption. Although the time cost in different types of samples is quite distinct from each other, the maximum detection time for a single sample does not exceed 3.4 seconds. Therefore, the proposed detection algorithm is able to achieve an acceptable detection speed with a relatively short running time.Table 4
The running time of the detection algorithm in units of seconds.
TypePreparationDetectionTaToTctmaxtmintaveA0.5 × 100116151.3892.4722.4412.457B0.5 × 100115971.3622.5412.5132.525C0.5 × 100116111.3962.2512.2182.235D0.5 × 100116091.4013.3963.3673.389Besides, since the acoustic signal differences in Type D between qualified and defective samples are relatively similar, the extraction and identification of features are difficult to process, resulting in a lower recognition rate and more extended time consumption. More notably, the running time of the algorithm could be further shortened by either optimizing the algorithm code or improving the computer hardware configuration.


## 3.7. Evaluation and Validation

### 3.7.1. Influence of the Filtering Range on the Detection Performance

To confirm the rationality of the used filtering range for the high-pass filter, its influence on the detection performance, including the accuracy and speed, is obtained by adjusting the filtering range. The overall recognition rate of all testing samples in each type is regarded as the accuracy, while their time consumption from preprocessing the signal to identifying the features is defined as the speed. The filtering range is adjusted from 0 Hz to 6 kHz, and each filtering range corresponds to an exclusive accuracy and speed. It can be found in Figure6(a) that the speed decreases obviously synchronously with the increase of the filtering range because the larger filtering range means fewer signal data to be processed. However, the decrease in the accuracy occurs after 4 kHz, and the highest accuracy is always stable within 4 kHz. According to these results, the filtering range exceeding 4 kHz is bound to lose some beneficial signal information for the extraction or identification of features, resulting in an obvious decrease in the accuracy. It also suggests that the acoustic signal characteristics representing the presence or absence of the internal defects are distributed within the relatively high-frequency range instead of the low-frequency part below 4 kHz. Therefore, for the sake of both the highest overall recognition rate and the lowest time consumption, the selected 4 kHz is the best filtering range for all samples in each type.Figure 6
The evaluation and validation of the detection performance. (a) The influence of different filtering ranges on the accuracy and speed. (b) The effect of different quantities of training samples on the detection accuracy. (c) The impact of optimized and nonoptimized thresholds on the detection accuracy. (d) The effect of different GWO parameter values on the detection accuracy for type A.
(a)(b)(c)(d)


### 3.7.2. Impact of Training Sample Quantities on the Detection Accuracy

The training sample quantities have a primary impact on the identification performance of the RF classifier. Too many training samples will cause more calculations and longer training time, while too few training samples will lead to a lack of feature information. To assess the most appropriate number of training samples, seven training groups with different amounts of training samples are used for establishing an RF classifier for each type. Each group is equally divided between the qualified and defective samples. All training samples in each group are randomly collected from the same type. The previous testing samples are applied to obtain the corresponding detection accuracy. The accuracy results are utilized to verify the best number of training samples. It can be seen from Figure6(b) that testing samples in Type B obtain the stable highest detection accuracy in any training group, but other types of samples get the highest accuracy only at the beginning of the training group made up of 50 qualified and 50 defective samples. In the training group where the number of training samples is lower than that of 50 qualified and 50 defective samples, the accuracy of Type B, C, and D increases with the number of samples. The accuracy of training groups exceeding this number tends to be stable, neither increasing nor decreasing. Therefore, the best setting for training sample quantities is the combination of 50 qualified and 50 defective samples.


### 3.7.3. Influence of the Threshold Optimization on the Detection Accuracy

To verify the importance and validity of the threshold optimization for SWD, all testing samples in each type are decomposed by the nonoptimized thresholds and then used for the internal defect detection. The nonoptimized thresholds refer toPth and StDth that are available within the threshold range except the optimal threshold setting determined by the optimization. Figure 6(c) shows the detection accuracy of all testing samples under the optimized and nonoptimized thresholds. It can be clearly seen that the detection accuracy corresponding to the nonoptimized thresholds is always lower than that of optimized thresholds regardless of the sample type. It also means that only the optimal thresholds can make SWD produce the best signal decomposition, resulting in the highest detection accuracy. Furthermore, the accurate decomposition results would be quite helpful in exposing even relatively weak signal characteristics in detail. Thus, it is necessary to optimize the SWD thresholds properly, and adopting the proposed method helps to realize the optimized SWD.


### 3.7.4. Influence of Different Parameters on the Optimization Performance of GWO

As aforementioned, the number of search agents and the maximum number of iterations, namely,na and ni, respectively, can be regarded as the main controlling parameters of GWO. However, the optimization performance of GWO might be sensitive to the values of its main controlling parameters, whereas the execution of GWO in this work is based on fixed parameters. To prove the validity of the used parameters, different values for na and ni are employed for implementing the threshold optimization for Type A. Then, the detection accuracy for all testing samples is applied to evaluate the influence of different parameter values on the optimization performance of GWO. As depicted in Figure 6(d), these two parameters have a relatively wide range of values for achieving the optimal accuracy. For instance, any position of the area consisting of na∈10,16 and ni∈10,20 always corresponds to the best accuracy. It signifies that the performance of GWO in the SWD threshold optimization is not extremely sensitive to changes in the controlling parameter values. The fixed parameter values we used, namely, na=10 and ni=10, are located within the most suitable value range, and more importantly, they are the smallest value in the range. It also means that our parameter values are able to perform the optimization more efficiently compared with other values because small controlling parameter value in GWO usually corresponds to less calculation and low complexity. Therefore, the used controlling parameter values for GWO in this work are reasonable and effective. In addition, it is worth noting that the increase of na and ni is generally beneficial to obtain higher accuracy, but the best one cannot be obtained when these two parameters get too large. The reason is that too large parameters complicate the decision-making mechanism, which is not conducive to the correct search.


### 3.7.5. Comparison of Different Threshold Optimization Methods

Although the necessity of the threshold optimization is incontrovertible, there are many ways to achieve the optimization. In relevant studies, some methods have been proven to have excellent optimization capabilities. To verify the validity of GWO in the threshold optimization, a total of other five optimization algorithms are applied to compare with GWO because they are widely used for many cases for determining the optimal value. These algorithms are all derived from metaheuristics similar to GWO and are composed of some typically popular and recent methods, including GA, PSO, ACO, WOA, and GOA. To make a comparison under the same conditions, they are arranged in the same numerical space and the same random initial location to search for the minimum of the same fitness function based on the identical training samples in Type A. After that, all these algorithms can find the same optimal thresholds as obtained by GWO, resulting in the same optimization accuracy. However, their optimization efficiency, such as iterations and their time cost, is completely different from that of GWO. As listed in Table5, compared with the other five optimization algorithms, GWO obviously has the lowest number of iterations as well as the least time consumption. As aforementioned, the time consumption covers both a series of the signal decomposition with SWD for all training samples and multiple threshold searches with GWO. According to these results, the combination of GWO and the designed fitness function not only is suitable as a threshold optimization method for SWD but also provides a fast and accurate optimization result. In comparison to other metaheuristic optimization algorithms with the same fitness function, the metaheuristic strategy of GWO has relatively high efficiency and is further more suitable for the determination of the SWD threshold performance reflected by the acoustic signal characteristics of arc magnets. It can also confirm the rationality of choosing GWO in this work.Table 5
The comparison of different optimization methods for type A.
PerformanceGWOWOAGOAACOPSOGAIteration number101216162030Time consumption (s)116151792231581374084205275320


### 3.7.6. Potential Applications of the Proposed Method

This work focuses on achieving the acoustic-based detection for internal defects of arc magnets via the threshold-optimized SWD, and consequently, the proposed method is also likely applicable to other cases where the acoustic signal analysis is used to determine defects or faults. Not only that, it has the potential to be applied to decompose other signals with similar characteristics to acoustic signals. To evaluate such a possibility, the vibration signal of a rotating machine is imitated, and then, our method is performed to decompose the simulated vibration signal. In general, there are similarities between acoustic signals and vibration signals, but the vibration signals measured in industrial environments are subject to multiple components, various excitations, and low signal-to-noise ratio (SNR) [53]. To establish a signal model as realistic as possible, the simulated vibration signal consists of five frequently encountered components, which are described as the following equation [54]:(19)xt=∑i=1MAicos2πifot+αi︸Rotor  vibrations+∑i=1NBicos2πiGfot+βi︸Gear meshing vibrations+∑i=1PCiSit−iT−τi︸Fault impulses+∑i=1QDiSit−Ok︸External shocks+nt︸Noises.For such a simulated vibration signalxt, the first term indicates the rotor vibration components, where fo is the fundamental rotating frequency and Ai and αi, respectively, stand for the amplitude and initial phase of the ith harmonic. The second term represents the normal gear meshing vibration components, where G denotes the number of gear tooth, and Bi and βi are, respectively, the amplitude and initial phase of the ith meshing frequency. The third term is the impulse components caused by mechanical faults in a gear or a rolling element bearing, where Ci specifies the amplitude of the ith impulse, T is the time interval between two adjacent impulses, τi is a random variable with zero-mean, which simulates the roller slip effect and typically accounts for 1-2% of fault period [55], and Sit denotes the ith impulse with the unit amplitude, which can be expressed by an exponentially decaying sinusoid as [56](20)Sit=e−θitsin2πfrit,where fri denotes the resonance frequency excited by the ith impact impulse and θi is the decay rate of the corresponding impulse. The fourth term represents some random external shock components from occasional strikes on the machine casing, or electromagnetic interferences during the data acquisition, where two random variables, Di and Ok, indicate the amplitude and occurrence time of the occasional impulses, respectively. The last term is the white Gaussian noise components with the SNR of 0 dB.The parameters for the simulated vibration signal are listed in Table6. The waveform and frequency spectrum of such a signal and all its components are shown in Figure 7(a). It can be seen that the fault-related component is unable to be visualized from neither the time domain nor the frequency domain in the final vibration signal because of the noises and undesirable components. Therefore, the mechanical fault diagnosis using a vibration signal analysis is to eliminate these interferences, such that the fault features can be confidently recognized. For this purpose, the simulated signal is analyzed by our method, in which the optimal threshold setting is determined as Pth=0.215 and StDth=0.490, and then, the threshold-optimized SWD is applied to provide the appropriate decomposition of the vibration signal. As illustrated in Figure 7(b), a total of four OCs are obtained. As aforementioned, the last OC belongs to the residue after the decomposition, which is almost unavailable in the signal analysis. However, the frequency-domain spectra of the first three OCs exhibit some significant information that contributes to the fault diagnosis. In the first OC, the rotor vibration frequency fo and two gear meshing vibration frequencies Gfo and 2Gfo exactly correspond to the frequencies of the first-three maximum peaks in turn. In the second OC, the fault impulse frequency fr1 is precisely the frequency of the maximum peak. Similarly, the external shock frequency fr2 is completely equal to the frequency of the maximum peak in the third OC. As a result, the weak fault component that is difficult to be visualized under the severe interference can be conveniently and accurately identified by our method. Thus, it is obvious that the proposed method is also competent to analyze some vibration signals precisely, resulting in that our method is expected to be extended to more potential applications, not just the acoustic-based detection of arc magnet internal defects.Table 6
The parameters for the vibration simulation of a rotating machine.
Rotor vibrationGear meshing vibrationsFault impulseExternal shockSampling frequencyTime lengthA1α1foGB1β1B2β2fr1θ1C1Tfr2θ210000 Hz0.3 s0.2π/220 Hz80.16π/20.12π/22400 Hz4000.251/1204000 Hz1200Figure 7
The application of the vibrational signal decomposition using the proposed method. (a) The simulation for the vibrational signal of a rotating machine. (b) The decomposition results of the simulated vibrational signal.
(a)(b)


## 3.7.1. Influence of the Filtering Range on the Detection Performance

To confirm the rationality of the used filtering range for the high-pass filter, its influence on the detection performance, including the accuracy and speed, is obtained by adjusting the filtering range. The overall recognition rate of all testing samples in each type is regarded as the accuracy, while their time consumption from preprocessing the signal to identifying the features is defined as the speed. The filtering range is adjusted from 0 Hz to 6 kHz, and each filtering range corresponds to an exclusive accuracy and speed. It can be found in Figure6(a) that the speed decreases obviously synchronously with the increase of the filtering range because the larger filtering range means fewer signal data to be processed. However, the decrease in the accuracy occurs after 4 kHz, and the highest accuracy is always stable within 4 kHz. According to these results, the filtering range exceeding 4 kHz is bound to lose some beneficial signal information for the extraction or identification of features, resulting in an obvious decrease in the accuracy. It also suggests that the acoustic signal characteristics representing the presence or absence of the internal defects are distributed within the relatively high-frequency range instead of the low-frequency part below 4 kHz. Therefore, for the sake of both the highest overall recognition rate and the lowest time consumption, the selected 4 kHz is the best filtering range for all samples in each type.Figure 6
The evaluation and validation of the detection performance. (a) The influence of different filtering ranges on the accuracy and speed. (b) The effect of different quantities of training samples on the detection accuracy. (c) The impact of optimized and nonoptimized thresholds on the detection accuracy. (d) The effect of different GWO parameter values on the detection accuracy for type A.
(a)(b)(c)(d)


## 3.7.2. Impact of Training Sample Quantities on the Detection Accuracy

The training sample quantities have a primary impact on the identification performance of the RF classifier. Too many training samples will cause more calculations and longer training time, while too few training samples will lead to a lack of feature information. To assess the most appropriate number of training samples, seven training groups with different amounts of training samples are used for establishing an RF classifier for each type. Each group is equally divided between the qualified and defective samples. All training samples in each group are randomly collected from the same type. The previous testing samples are applied to obtain the corresponding detection accuracy. The accuracy results are utilized to verify the best number of training samples. It can be seen from Figure6(b) that testing samples in Type B obtain the stable highest detection accuracy in any training group, but other types of samples get the highest accuracy only at the beginning of the training group made up of 50 qualified and 50 defective samples. In the training group where the number of training samples is lower than that of 50 qualified and 50 defective samples, the accuracy of Type B, C, and D increases with the number of samples. The accuracy of training groups exceeding this number tends to be stable, neither increasing nor decreasing. Therefore, the best setting for training sample quantities is the combination of 50 qualified and 50 defective samples.


## 3.7.3. Influence of the Threshold Optimization on the Detection Accuracy

To verify the importance and validity of the threshold optimization for SWD, all testing samples in each type are decomposed by the nonoptimized thresholds and then used for the internal defect detection. The nonoptimized thresholds refer toPth and StDth that are available within the threshold range except the optimal threshold setting determined by the optimization. Figure 6(c) shows the detection accuracy of all testing samples under the optimized and nonoptimized thresholds. It can be clearly seen that the detection accuracy corresponding to the nonoptimized thresholds is always lower than that of optimized thresholds regardless of the sample type. It also means that only the optimal thresholds can make SWD produce the best signal decomposition, resulting in the highest detection accuracy. Furthermore, the accurate decomposition results would be quite helpful in exposing even relatively weak signal characteristics in detail. Thus, it is necessary to optimize the SWD thresholds properly, and adopting the proposed method helps to realize the optimized SWD.


## 3.7.4. Influence of Different Parameters on the Optimization Performance of GWO

As aforementioned, the number of search agents and the maximum number of iterations, namely,na and ni, respectively, can be regarded as the main controlling parameters of GWO. However, the optimization performance of GWO might be sensitive to the values of its main controlling parameters, whereas the execution of GWO in this work is based on fixed parameters. To prove the validity of the used parameters, different values for na and ni are employed for implementing the threshold optimization for Type A. Then, the detection accuracy for all testing samples is applied to evaluate the influence of different parameter values on the optimization performance of GWO. As depicted in Figure 6(d), these two parameters have a relatively wide range of values for achieving the optimal accuracy. For instance, any position of the area consisting of na∈10,16 and ni∈10,20 always corresponds to the best accuracy. It signifies that the performance of GWO in the SWD threshold optimization is not extremely sensitive to changes in the controlling parameter values. The fixed parameter values we used, namely, na=10 and ni=10, are located within the most suitable value range, and more importantly, they are the smallest value in the range. It also means that our parameter values are able to perform the optimization more efficiently compared with other values because small controlling parameter value in GWO usually corresponds to less calculation and low complexity. Therefore, the used controlling parameter values for GWO in this work are reasonable and effective. In addition, it is worth noting that the increase of na and ni is generally beneficial to obtain higher accuracy, but the best one cannot be obtained when these two parameters get too large. The reason is that too large parameters complicate the decision-making mechanism, which is not conducive to the correct search.


## 3.7.5. Comparison of Different Threshold Optimization Methods

Although the necessity of the threshold optimization is incontrovertible, there are many ways to achieve the optimization. In relevant studies, some methods have been proven to have excellent optimization capabilities. To verify the validity of GWO in the threshold optimization, a total of other five optimization algorithms are applied to compare with GWO because they are widely used for many cases for determining the optimal value. These algorithms are all derived from metaheuristics similar to GWO and are composed of some typically popular and recent methods, including GA, PSO, ACO, WOA, and GOA. To make a comparison under the same conditions, they are arranged in the same numerical space and the same random initial location to search for the minimum of the same fitness function based on the identical training samples in Type A. After that, all these algorithms can find the same optimal thresholds as obtained by GWO, resulting in the same optimization accuracy. However, their optimization efficiency, such as iterations and their time cost, is completely different from that of GWO. As listed in Table5, compared with the other five optimization algorithms, GWO obviously has the lowest number of iterations as well as the least time consumption. As aforementioned, the time consumption covers both a series of the signal decomposition with SWD for all training samples and multiple threshold searches with GWO. According to these results, the combination of GWO and the designed fitness function not only is suitable as a threshold optimization method for SWD but also provides a fast and accurate optimization result. In comparison to other metaheuristic optimization algorithms with the same fitness function, the metaheuristic strategy of GWO has relatively high efficiency and is further more suitable for the determination of the SWD threshold performance reflected by the acoustic signal characteristics of arc magnets. It can also confirm the rationality of choosing GWO in this work.Table 5
The comparison of different optimization methods for type A.
PerformanceGWOWOAGOAACOPSOGAIteration number101216162030Time consumption (s)116151792231581374084205275320


## 3.7.6. Potential Applications of the Proposed Method

This work focuses on achieving the acoustic-based detection for internal defects of arc magnets via the threshold-optimized SWD, and consequently, the proposed method is also likely applicable to other cases where the acoustic signal analysis is used to determine defects or faults. Not only that, it has the potential to be applied to decompose other signals with similar characteristics to acoustic signals. To evaluate such a possibility, the vibration signal of a rotating machine is imitated, and then, our method is performed to decompose the simulated vibration signal. In general, there are similarities between acoustic signals and vibration signals, but the vibration signals measured in industrial environments are subject to multiple components, various excitations, and low signal-to-noise ratio (SNR) [53]. To establish a signal model as realistic as possible, the simulated vibration signal consists of five frequently encountered components, which are described as the following equation [54]:(19)xt=∑i=1MAicos2πifot+αi︸Rotor  vibrations+∑i=1NBicos2πiGfot+βi︸Gear meshing vibrations+∑i=1PCiSit−iT−τi︸Fault impulses+∑i=1QDiSit−Ok︸External shocks+nt︸Noises.For such a simulated vibration signalxt, the first term indicates the rotor vibration components, where fo is the fundamental rotating frequency and Ai and αi, respectively, stand for the amplitude and initial phase of the ith harmonic. The second term represents the normal gear meshing vibration components, where G denotes the number of gear tooth, and Bi and βi are, respectively, the amplitude and initial phase of the ith meshing frequency. The third term is the impulse components caused by mechanical faults in a gear or a rolling element bearing, where Ci specifies the amplitude of the ith impulse, T is the time interval between two adjacent impulses, τi is a random variable with zero-mean, which simulates the roller slip effect and typically accounts for 1-2% of fault period [55], and Sit denotes the ith impulse with the unit amplitude, which can be expressed by an exponentially decaying sinusoid as [56](20)Sit=e−θitsin2πfrit,where fri denotes the resonance frequency excited by the ith impact impulse and θi is the decay rate of the corresponding impulse. The fourth term represents some random external shock components from occasional strikes on the machine casing, or electromagnetic interferences during the data acquisition, where two random variables, Di and Ok, indicate the amplitude and occurrence time of the occasional impulses, respectively. The last term is the white Gaussian noise components with the SNR of 0 dB.The parameters for the simulated vibration signal are listed in Table6. The waveform and frequency spectrum of such a signal and all its components are shown in Figure 7(a). It can be seen that the fault-related component is unable to be visualized from neither the time domain nor the frequency domain in the final vibration signal because of the noises and undesirable components. Therefore, the mechanical fault diagnosis using a vibration signal analysis is to eliminate these interferences, such that the fault features can be confidently recognized. For this purpose, the simulated signal is analyzed by our method, in which the optimal threshold setting is determined as Pth=0.215 and StDth=0.490, and then, the threshold-optimized SWD is applied to provide the appropriate decomposition of the vibration signal. As illustrated in Figure 7(b), a total of four OCs are obtained. As aforementioned, the last OC belongs to the residue after the decomposition, which is almost unavailable in the signal analysis. However, the frequency-domain spectra of the first three OCs exhibit some significant information that contributes to the fault diagnosis. In the first OC, the rotor vibration frequency fo and two gear meshing vibration frequencies Gfo and 2Gfo exactly correspond to the frequencies of the first-three maximum peaks in turn. In the second OC, the fault impulse frequency fr1 is precisely the frequency of the maximum peak. Similarly, the external shock frequency fr2 is completely equal to the frequency of the maximum peak in the third OC. As a result, the weak fault component that is difficult to be visualized under the severe interference can be conveniently and accurately identified by our method. Thus, it is obvious that the proposed method is also competent to analyze some vibration signals precisely, resulting in that our method is expected to be extended to more potential applications, not just the acoustic-based detection of arc magnet internal defects.Table 6
The parameters for the vibration simulation of a rotating machine.
Rotor vibrationGear meshing vibrationsFault impulseExternal shockSampling frequencyTime lengthA1α1foGB1β1B2β2fr1θ1C1Tfr2θ210000 Hz0.3 s0.2π/220 Hz80.16π/20.12π/22400 Hz4000.251/1204000 Hz1200Figure 7
The application of the vibrational signal decomposition using the proposed method. (a) The simulation for the vibrational signal of a rotating machine. (b) The decomposition results of the simulated vibrational signal.
(a)(b)


## 4. Conclusions

This paper developed an SWD algorithm with GWO for the acoustic signal analysis and applied it to rapidly detect the presence or absence of internal defects of arc magnets at low cost. The main contributions of this paper are outlined as follows:(1)
The use of a high-pass filter allows the acoustic signal data to be effectively reduced, and the meaningful signal characteristics can be fully retained. It is conducive to weakening the complexity and workload of the signal decomposition.(2)
With the correlation between oscillation components, a fitness function to reflect the association between the SWD threshold setting and the overall decomposition effect in similar signals can be established. The optimal threshold setting corresponds to the extremum of the function, and the GWO algorithm enables the fewer iterations to carry out a rapid, accurate search for the fitness function extremum. More importantly, GWO can highly avoid the blind search and escape the traps of local minima. Through such a fitness function and its extremum search process, the threshold optimizations that are supposed to perform multiple times are simplified to the one-time optimization.(3)
The unified threshold setting determined by the optimization ensures the consistent decomposition for all signals, and each original signal is expressed by a set of OCs. In addition, the first two OCs with the highest energy ratio have the most obvious information linked to the internal defects. The information regarding the frequency of the maximum peak in these two OCs can be combined as the acoustic signal features associated with the internal defects of arc magnets.(4)
Not only the identification difficulty but also the dependence of the classifier on a large number of training samples are significantly decreased owing to the advantages in concise features with clearly distinguishable clustering distributions. Furthermore, the simple structure of RF is suitable for the rapid feature classification.In addition to contributions and advantages, the proposed method has some limitations that are worthy of attention. On the one hand, performing the proper optimization for the unified SWD threshold setting and training the correct feature classifier can hardly be done without a certain number of precisely known signals. On the other hand, the recognition rate and running time of the proposed method are not ultimate in the ideal detection performance. Consequently, we will endeavour to raise the accuracy and speed of the detection through enhancing the optimization efficiency and improving the feature extraction in the future work.



---

*Source: 6636873-2021-03-15.xml*