#### Abstract

In order to detect the assembly quality of the combine harvester accurately and effectively, a method for the assembly quality inspection of the combine harvester based on the improved whale algorithm (IWOA) to optimize the least square support vector machine is proposed. Aiming at the characteristics of whale optimization algorithm’s weak search ability and easy maturity, this paper introduces the cosine control factor and the sine time-varying adaptive weight to improve it and uses the benchmark function to verify the general adaptability of the algorithm. Combined with the local mean decomposition (LMD), the assembly quality inspection model of the combine harvester was established and applied to the Dongfanghong 4LZ-9A2 combine harvester for experimental verification. The experimental results show that the IWOA proposed in this paper has better optimization ability and adaptability. The average accuracy of the IWOA model proposed in this paper reaches 90.5%, which is 4% higher than that of the WOA model, and the standard deviation of the average accuracy is reduced by 0.15%, which indicates that the IWOA model has better stability.

#### 1. Introduction

Combine harvester is a large complex agricultural machine which can harvest, transport, thresh, separate, and clean crops at one time [1, 2]. The reliability of its work process is directly related to the quality and efficiency of crop harvesting operations [3]. Due to the complexity of the transmission system, the assembly failure of the transmission system will aggravate the wear of parts and components in the working process of the combine and seriously reduce the trouble-free working time [4, 5]. Therefore, it is necessary to study the assembly fault detection method of combine to improve its reliability. At present, there have been a lot of research on fault diagnosis of rotating machinery system. At present, most of them build a diagnosis system through the intelligent algorithm to analyze the vibration signal of mechanical system. As a pattern recognition process of multimethod fusion, fault diagnosis usually includes four steps: vibration signal acquisition, signal preprocessing, fault signal feature extraction, and classifier construction [6]. The construction of classifier is the last step to complete fault diagnosis. The performance of classifier directly affects the effect of the whole diagnosis process.

As a classical supervised learning method, support vector machine (SVM) has been widely used since it was introduced in 1960. It is often used in the construction of classifier in fault diagnosis system [7]. Yang, J, and others used SVM to construct classifier to realize face recognition [8]. Suykens et al. introduced the least squares linear theory into the traditional SVM, transformed the original SVM inequality constraints into linear equality constraints, and proposed the least square support vector machine (LSSVM), which made the solution process more efficient and concise, and improved the calculation speed and accuracy [9]. However, the classification effect of LSSVM is easily affected by the parameters in the model. Therefore, some scholars use the metaheuristic algorithm to solve the optimal parameter optimization problem of LSSVM.

In recent years, the metaheuristic algorithm has been used to solve various complex problems and achieved good results. Alweshah et al. [10] uses the Emperor Butterfly Optimization (MBO) algorithm to reduce the size of feature selection for data sets and the calculation time. Fahim et al. [11] used the hunger game search algorithm to optimize the proton exchange membrane fuel cell (PEMFC), which improved the accuracy of the final model. Feng and Wang [12] solved NP-hard combinatorial optimization problems with many different applications using the improved moth search algorithm. Gerey et al. [13] used the Harris Hawks optimization algorithm to optimize hydraulic conductivity and yield-specific parameters of a modular three-dimensional finite difference (MODFLOW) groundwater model, thereby minimizing the sum of absolute deviations between observed and simulated groundwater levels, and achieved good results. Ruan et al. [14] combined the Newmark method with the fourth-order Runge–Kutta algorithm to carry out comprehensive simulation calculation for the adaptive flying-away excitation system, which realizes periodic excitation for the conductor system. In addition, some scholars [15, 16] use genetic algorithm and particle swarm optimization to solve multiobjective problems. However, these algorithms still have some disadvantages such as weak local capability, general global search ability, and premature maturity.

Whale optimization algorithm (WOA) [17] is a new swarm intelligence algorithm obtained by Australian scholar Mirjalili in 2016 through the study of humpback whale foraging behavior. Tong, WY, designed a WOA hybrid algorithm with learning and complementary fusion features for data mining [18]. Elhosseini, MA, uses an improved whale optimization algorithm to achieve the stability of the biped robot [19]. The standard WOA algorithm has the advantages of fewer parameters and good global convergence, so a large number of scholars use it in practical applications. Wu et al. [20] used VNWOA to optimize the regularization parameters and parameters of LSSVM to achieve fault type diagnosis of bearings and achieved good classification effect. Although VNWOA has a fast optimization speed, it still has the problem that it is easy to fall into local optimal solution. The assembly quality detection model of combine is a typical problem of rotating machinery fault diagnosis, so this paper uses WOA to optimize LSSSVM and further optimizes the convergence accuracy of WOA.

Although WOA has the advantages of fewer parameters, simple operation, and strong optimization ability, it still has problems such as low convergence accuracy and easy to fall into local optimal solutions. Based on this, some scholars have carried out improved research on WOA. Some of them combine WOA with other existing optimization algorithms and construct a combined optimization algorithm, which achieves better optimization results [21, 22]. Seyed and Samaneh [23] proposed a new algorithm that combines WOA with differential evolution (DE), which improves the problem that WOA is prone to fall into local optimal solutions. Luo and Shi [24] embedded an improved differential evolution operator with strong exploratory capability in WOA, and accelerated the convergence of WOA by using the asynchronous model, which improved the accuracy of the algorithm. Others have studied and improved the optimization method of whale optimization algorithm itself, mainly for the update method and learning strategy of the algorithm [25–27]. Li et al. [28] proposed a whale optimization algorithm using nonlinear adjustment parameters and Gaussian disturbance operator to locate the critical slip surface of the soil slope. Khashan et al. [29] and others put forward a new WOA improvement, which improved the optimization performance of the algorithm by changing the parameter “A” nonlinearly and randomly and updating the parameter “C” by applying inertial weight strategy and was verified on several benchmark test functions. Yan et al. [30] proposed a whale optimization algorithm based on lateral suppression (LI), which combines the optimization efficiency of WOA and the matching accuracy of LI mechanism and achieves better results in image matching and visual-guided AUV docking. When improving the algorithm, some scholars increase the weight factor in the early stage of the algorithm’s population position update to increase the population diversity [25, 31], but this will cause the population to be in the late stage of shrinking and envelopment, the update rate will slow down, and the local search and global search cannot be well-balanced ability.

In view of the shortcomings in the above problems, this paper introduces the cosine control factor and the sine time-varying adaptive weight on the basis of WOA. In the early stage of the algorithm iteration, the population is relatively scattered, and the slower change of the cosine control factor is conducive to the global search of the algorithm. The change speed of the cosine control factor increases, and the local search capability of the algorithm is enhanced. In particular, this paper only adds sinusoidal time-varying adaptive weights when the spiral position is updated, which enhances the algorithm’s ability to search globally and jump out of the local optimum.

This article first uses 8 benchmark functions to test the improved whale optimization algorithm (IWOA), and the results show that IWOA has a stronger ability to find optimization than WOA. Then IWOA was used to optimize LSSVM and combined with LMD to establish the assembly quality inspection model of the combine harvester, which was tested and verified on the Dongfanghong 4LZ-9A2 combine harvester. The results show that the method used in this paper can accurately and effectively identify the component assembly quality of combine.

#### 2. The Basic Principle of WOA

The whale optimization algorithm is a metaheuristic optimization algorithm that simulates the hunting behavior of humpback whale bubble nets. The hunting process mainly includes three stages: surrounding prey, bubble attack, and searching for prey.

##### 2.1. Surrounding the Prey

Humpback whales can recognize their prey and surround them. Assuming that the current position of the best population individual is the target prey position or the closest to the best target prey position, the rest of the individuals will move towards the target position and update their position. The position update rule in the following equations (3) and (4) is as follows.where A and C represent coefficient vectors, X∗(t) represents the position of the best individual in the population, represents the distance between the best individual and the current individual position, and A and C are defined bywhere the value of decreases linearly from 2 to 0 with the increase of , represents the maximum number of iterations, and are random vectors in the range of [0,1].

##### 2.2. Bubble Attack

The predator model consists of two parts: The first part is shrinking and encircling. The value of A changes with the parameter a to realize the range of prey, which is the local search stage. The second part is the update of the spiral position. The whale uses a spiral motion to achieve envelopment based on the distance between itself and the target. The mathematical model is expressed by equation (6). where represents the distance from *i* to the target, is a parameter generated by random transformation between [-1,1], and represents the spiral constant.

When a whale attacks its prey, the contraction encirclements and the spiral position updates occur simultaneously with the same probability; the model is defined in equation (7).where is a random number between [0, 1].

##### 2.3. Search Phase

Whales randomly search for prey when they attack. When , randomly select individual positions for global search so as not to enter the local optimal solution, which is defined bywhere represents the position vector of the individual whale randomly selected and represents the position vector of the current individual.

#### 3. Improved WOA

##### 3.1. Cosine Variation of Nonlinear Control Factor

The whale optimization algorithm has the advantages of simple and easy-to-understand principles and fewer hyperparameters, but it also needs to balance the capabilities of local search and global optimization in the optimization process, that is, adjust by changing the value of A. It can be seen from formula (3) that the value of A is controlled by the parameter a. The larger the value of a, the stronger the algorithm’s global search ability, and the smaller the value of a, the stronger the algorithm’s local search ability. In the standard whale optimization algorithm, the value of a is a parameter that linearly decreases from 2 to 0, and it is easy to fall into a local optimal solution during operation. Therefore, this paper uses a nonlinear control factor, which is defined in

It can be seen from the above formula that in the early stage of the algorithm iteration, the value of is larger and decreases slowly from 2 to make full use of the global search. In the late stage of the algorithm iteration, the speed of the value of decreases, increases, and the local search ability is enhanced.

##### 3.2. Sine Time-Varying Adaptive Weight Factor

Literature [32] points out that when the weight factor is large, it is conducive to the global search of the algorithm, while when the weight factor is small, it is conducive to the local search of the algorithm. In order to effectively balance the local search and global search ability, an adaptive weight factor is introduced to improve the convergence speed and accuracy. Only sinusoidal time-varying adaptive weight is added when the spiral position is updated, which enhances the ability of the algorithm in global search and jumping out of local optimization. The mathematical model is defined bywhere is defined by

##### 3.3. IWOA Complexity Analysis

Time complexity reflects the operating efficiency of the algorithm and is an important factor in judging the performance of the algorithm. In the improved whale optimization algorithm, the population size of the whale algorithm is *N*, and the set dimension of the individual is *n*. The time to set the initial position of the optimal individual and the initial value of the fitness is *t*_{1}, and the time to initialize each dimension of the whale individual position is *t*_{2}; then the time complexity of the initialization phase is as follows:

After starting the iteration, the total number of iterations is *M*. Assuming that the time for each whale in the population to calculate the fitness value of the objective function is *f(n)*, the replacement time compared with the current best fitness value is *t*_{3}, and the calculation time of the coefficient vectors *A* and *C* is *t*_{4}; then the time complexity at this stage is as follows:

Suppose there are *m*_{1} whales in the population searching for food, the location update time is *t*_{5}, *m*_{2} whales shrink and surround the prey, the location update time is *t*_{6}, and *m*_{3} whales perform spiral position update, and the execution time is *t*_{7}. During the update, the introduced sine time-varying adaptive weight increases the calculation time of *t*_{8}, and the head whale spirally moves and attacks its prey (*N* *=* *m*_{1} *+* *m*_{2} *+* *m*_{3}, 0 ≤ *m*_{1}, *m*_{2}, *m*_{3} ≤ *N*); then at this stage, the time complexity is as follows:

In summary, the total time complexity of IWOA is as follows:

In addition, the space complexity *S(n)* is mainly affected by the size of the population *N* and the dimension of the search space *Dim* and can be expressed as

As shown in Table 1, the increased complexity of the algorithm has a certain impact on the running time of the algorithm.

##### 3.4. Performance Test

In order to verify the performance of the IWOA algorithm, the 8 benchmark test functions shown in Table 2 are tested and compared with the WOA algorithm. The average and standard deviation of the optimal values obtained by the two algorithms are used as evaluation indicators. In this paper, the number of populations is set to 30, the maximum number of iterations is 100, and the dimension is 30. In Table 2, F1–F4 are continuous single-mode functions, and F5–F8 are nonlinear multimode functions. Taking into account the validity and accuracy of the experimental results, the mean, standard deviation, and running time of the two algorithms running 30 independent optimization calculations on 8 benchmark test functions are shown in Table 1.

Analysis of the results in Table 1 shows that the IWOA algorithm is better than the WOA algorithm in the 8 test functions. Among them, F5 and F6 are nonlinear multimodal functions. Under normal circumstances, it is difficult to find the global optimal solution, and the IWOA algorithm is not only short. The optimal solution was found within time and the theoretical value was reached. From the perspective of optimized mean and standard deviation, the IWOA algorithm is significantly better than the WOA algorithm, so the IWOA algorithm has higher convergence accuracy and better optimization capabilities. From the perspective of running time, the optimization time of IWOA is longer than WOA. This is because after IWOA introduces the cosine control factor and the sine time-varying adaptive weight coefficient, the complexity of the algorithm is increased, and the optimization time is increased.

#### 4. Test and Analysis

##### 4.1. Test Procedure

The tested prototype model is the Dongfanghong 4LZ-9A2 combine harvester. The engine speed is 780r/min, and all working parts of the combine harvester work without load. The signal acquisition device is the DH5902 dynamic signal test analyzer of Donghua Test, and the sensor adopts the IEPE piezoelectric acceleration sensor of Donghua Test. The assembly quality problem in this test is manual injection. The specific types and effects are as follows: 1. Misalignment of the auger will cause grain accumulation and clogging of the auger. 2. Misalignment of the cutting knife will cause missing cutting and cutting knife blockage during the working process of the combine. 3. The loosening of the cutter drive pinch wheel will cause insufficient power transmission of the cutter. Figure 1 shows the manual injection assembly quality problem.

This paper detects the assembly quality of combines by collecting vibration signals. The time-domain and frequency-domain characteristics of random vibration signals and decomposed information entropies are fused into feature vectors and classified by using the IWOA-LSSVM model. The potential application of the IWOA optimization algorithm proposed in this paper in the field of fault diagnosis is verified. The inspection process of assembly quality of combines is shown in Figure 2. The steps are as follows:(1)Inject assembly faults into the combine harvester and collect signals(2)Divide the samples of the original signal and use LMD [33, 34] to decompose to obtain several IMF components(3)Use the correlation coefficient to select IMF components, extract the information entropy of each component and the time and frequency features of the signal, and fuse them into a mixed feature set as the final feature vector(4)Input the training set data into IWOA-LSSVM for training to obtain the optimal model and save it(5)Input the test set data into the optimized LSSVM for classification

##### 4.2. Model of IWOA-LSSVM

The regularization parameters and kernel function parameters of the least square support vector machine directly affect the classification accuracy of the model. Therefore, this paper uses IWOA to optimize the parameters above. The IWOA-LSSVM model is shown in Figure 3. The specific process is as follows:(1)Initialize the algorithm parameters, set the population number *N*, the maximum number of iterations tmax, logarithmic spiral constant *b*, random number *l*, and other parameters(2)Randomly generate a population in the solution space, take the classification accuracy error of the least square support vector machine as the fitness function of the individual, calculate the fitness value of each individual, and take the optimal position of the fitness as the target position(3)Update the parameters *a*, *A*, *C*, *l*, *p*, and update the position of the whale according to the rules to obtain the optimal position and record it(4)Determine whether the maximum number of iterations is reached, if the conditions are met, and output the optimal value and the optimal individual position; otherwise, return to step (2) to continue the search

##### 4.3. Signal Acquisition

Separately select normal signals and fault signals and perform time-frequency-domain analysis. Figures 4 and 5 are the time-domain diagram and the frequency spectrum diagram of the normal signal and the fault signal, respectively. By comparing Figures 4 and 5, it can be seen that the amplitude of the normal signal and the fault signal is not obvious. It is difficult to distinguish the signal through observation in the time domain. By comparing the frequency-domain diagrams, we can see that the frequency-domain information of the two signals is complex and there are many interference signals. It is difficult to distinguish fault signals accurately only by time-domain and frequency-domain characteristics. In this case, LMD is used to decompose the signal, extract information entropies and time-domain and frequency-domain characteristics, and construct a mixed feature set.

**(a)**

**(b)**

**(a)**

**(b)**

##### 4.4. Feature Extraction

LMD is used to process the origins signals to extract energy entropy. The length of single sample data is 2000. The normal state was identified as category 1. If the auger is not aligned, it is identified as category 2. If the cutter is not aligned, it is identified as category 3. Loose drive wheels are identified as category 4. The sample length of the four categories is 200, and the total sample length is 800. Among all kinds of samples, 1–150 are training samples and 150–200 are test samples. The total number of training samples is 600, and the total number of test samples is 200. The data set is shown in Table 3.

LMD decomposes four types of signals: normal, auger failure, cutter failure, and transmission system failure to obtain multiple IMF components and uses correlation coefficients to analyze and select the IMF components that contain the main fault information. The correlation coefficient between the original signal and the false component and noise is relatively small, and the correlation coefficient with the real component is relatively large. Table 4 shows the correlation coefficients between the original signal and the IMF components of each order under each working condition.

The correlation coefficient between the original signal and IMF6 under each working condition is less than 0.2, so only the first 5 IMF components are extracted for information entropy. The information entropy and signal peak value, root mean square value and form factor, and other time-domain features and frequency-domain features such as center frequency, frequency root mean square, and frequency kurtosis are fused into a mixed feature set as the final feature vector.

##### 4.5. Classification-Based IWOA-LSSVM

Use the training set to train IWOA-LSSVM and use the test set to verify the accuracy of the trained model. In order to verify the effectiveness of the optimization algorithm proposed in this paper, the three methods of particle swarm optimization (PSO), genetic algorithm (GA), and WOA are tested and compared. GA parameter setting: p_1 = 0.6, p_2 = 0.01; PSO parameter setting: c_1 = 0.5, c_2 = 0.3, = 0.9; the total number of population individuals of the four algorithms is set to 30, and the maximum number of iterations is 100. The classification accuracy of each method when using different features is shown in Table 5. Use the training set to train IWOA-LSSVM and use the test set to verify the accuracy of the trained model. In order to verify the effectiveness of the optimization algorithm proposed in this paper, the three methods of particle swarm optimization (PSO), genetic algorithm (GA), and WOA are tested and compared. GA parameter setting: p_1 = 0.6, p_2 = 0.01; PSO parameter setting: c_1 = 0.5, c_2 = 0.3, = 0.9; the total number of population individuals of the four algorithms is set to 30, and the maximum number of iterations is 100. The classification accuracy of each method when using different features is shown in Table 5.

It can be seen from Table 5 that the accuracy of classification when using various single features is lower than the accuracy when using mixed feature sets. This is because the vibration signal of the combine harvester is relatively complicated. The signal of the vibration measuring point is coupled by the excitation of multiple vibration sources, and the signal of the vibration measuring point is easily interfered by the vibration of other parts. Therefore, the use of a single feature cannot accurately identify the fault type. This paper uses a mixed feature set as the final feature vector. Figure 6 shows the confusion matrix of the classification results of the four methods.

It can be seen from Figure 7 that the classification accuracy of category 1 and category 2 is higher, and category 3 and category 4 are not easy to distinguish, and the classification error is relatively large. Figure 7(a) shows the confusion matrix using PSO to optimize LSSVM. The classification effect of category 3 is poor, and about 29% are misclassified into category 4. Figure 7(b) shows the confusion matrix of LSSVM optimized by GA, in which the classification accuracy of category 4 is low, while the classification accuracy of category 3 is improved compared with the PSO algorithm. Figure 7(c) shows the confusion matrix of LSSVM optimized with WOA, in which category 4 has the worst classification effect, with about 35% wrongly classified into category 3. It can be seen from Figure 7(d) that compared to the WOA algorithm, IWOA has improved recognition of category 3 and category 4, and the classification accuracy of category 4 has increased by about 18%.

**(a)**

**(b)**

**(c)**

**(d)**

As can be seen from Figure 8, GA, WOA, and IWOA are better than PSO in terms of convergence speed and fitness value. The optimization speed of GA and WOA is faster and iterates to about 20 times to find the optimal solution, and the fitness value tends to be stable. IWOA jumps out of local optimal solution to convergence from iteration 25 times. Although the optimization speed is not as fast as GA and WOA, the final fitness value is better than other algorithms.

In order to avoid the interference of random factors, the stability and generalization ability of the proposed model are analyzed, and different test sets are constructed to conduct 10 experiments on various methods, and the average accuracy and standard deviation are recorded. The results are shown in Table 6 and Figure 6.

It can be seen that the average accuracy of the proposed method is 90.5%, which is better than WOA. It shows that WOA can not balance the local and global search ability well in the iterative process, and it is easy to converge to local optimal solution early. The average accuracy of PSO is the lowest, only 86.1%, which is far less than the method proposed in this paper. However, the average accuracy of GA is slightly higher than PSO and WOA, but the standard deviation is 1.47%. The standard deviation of the proposed method is only 0.77%, indicating that it can stably diagnose the assembly quality problems of combine under different faults.

Table 7 shows the comparison of comprehensive performance data of various methods. It can be seen that although IWOA adopted in this paper is not as good as GA and PSO in optimization time, its optimization effect is better than other methods. This proves that the LMD-IWOA-LSSVM model proposed in this paper can effectively identify the assembly fault types of combine harvester.

Although the method proposed in this paper has achieved the best diagnostic effect in comparative analysis, the accuracy of 90.5% still has room for improvement because the feature extraction method has a greater impact on the diagnosis result, the amount of data, the number of model iterations, and batch samples. The number will have a great impact on the final result, and there is still room for optimization in the current model.

#### 5. Conclusions

This paper mainly focuses on the research of combine assembly quality detection and puts forward a method of combine assembly quality detection based on LMD and IWOA-LSSVM. The effectiveness of the method is verified by experiments:(1)In order to solve the problems of WOA such as easy to fall into local optimum and unbalanced searching ability, a nonlinear control factor and adaptive weight are introduced to improve the algorithm. The general applicability of the improved algorithm is verified by eight universal test functions, and its overall optimization effect is better than that of WOA algorithm.(2)The problem of combine assembly quality detection was studied, and a method of combine assembly fault diagnosis based on LMD information entropy extraction, time-frequency feature fusion, and IWOA-optimized LSSVM was put forward.(3)The validity of IWOA and fault diagnosis method is verified by the test. The test results show that the method proposed in this paper can diagnose the assembly failure of combine parts stably and accurately, providing a feasible method for the inspection of assembly quality of combine.

In general, the IWOA proposed can be applied to general optimization problems, and the diagnostic model in this paper can be applied to fault identification in the field of complex rotating machinery. There is still room for further optimization of the final optimization results. Considering the shortcomings of this method, the main ideas for improvement include two points: firstly increasing fault types and batch samples to improve the generality of models and secondly extract deep features with more advanced feature extraction methods to improve the final diagnostic accuracy.

#### Data Availability

The authors have uploaded the programs and examples to the GitHub (https://github.com/zhaosixia/Assembly-quality-inspection).

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.