Pipeline crack pattern recognition method based on improved SSA-SVM algorithm
Through the improved SSA-SVM algorithm, the SVM hyperparameters are optimized using the Sparrow Search algorithm, which solves the problems of noise interference and hyperparameter optimization in pipeline crack detection, and achieves higher detection accuracy and real-time performance.
Patent Information
- Application Number
- CN202510230696.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art has problems such as noise interference, difficulty in optimizing SVM hyperparameters, and insufficient real-time and efficient in pipeline crack detection.
The improved SSA-SVM algorithm is adopted to optimize the hyperparameters of the SVM model through the sparrow search algorithm to improve the performance and accuracy of the SVM model.
It significantly improves the accuracy and real-time performance of pipeline crack detection, reduces false detection and missed detection, improves overall detection performance, and maintains excellent performance in noisy environments.
Smart Images

Figure CN120067834A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pipeline detection, and in particular to a pipeline crack pattern recognition method based on an improved SSA-SVM algorithm. Background Technique
[0002] With the acceleration of the global industrialization process, especially in industries such as oil, gas, chemical engineering, and nuclear power, pipelines, as important transportation facilities, undertake huge transportation tasks. However, due to being exposed to extreme working environments for a long time, pipelines are often affected by corrosion, fatigue, mechanical damage, and external factors, resulting in the occurrence of defects such as cracks, holes, and corrosion. The formation of pipeline cracks not only threatens the safety of pipelines but may also lead to serious leakage accidents, causing huge economic losses and environmental pollution. Therefore, the early detection and accurate diagnosis of pipeline cracks are of great significance for ensuring the safe operation and timely maintenance of pipelines. At present, the methods for pipeline crack detection mainly include traditional manual inspection, ultrasonic detection, X-ray detection, magnetic particle detection, eddy current detection, etc. Although these methods can play a role in some cases, there are also some drawbacks that cannot be ignored. Despite the advantages and disadvantages of the above methods, they cannot meet the monitoring requirements of real-time, automation, and long-term operation. Especially when dealing with large pipeline systems and high-frequency detections, the cost and efficiency of traditional methods are unbearable.
[0003] In recent years, acoustic emission (AE) technology, as a new type of non-destructive testing method, has been widely used in pipeline crack detection. Acoustic emission technology can accurately reflect the formation and propagation processes of cracks, corrosion, and other defects by real-time monitoring of the acoustic wave signals generated by materials under external forces. The advantages of acoustic emission technology lie in its real-time, non-destructive, automated, remote monitoring, and high-sensitivity characteristics, which are especially suitable for the long-term monitoring of structures such as pipelines, pressure vessels, and bridges. Acoustic emission signals are high-frequency signals generated by the propagation of internal cracks, micro-cracks, holes, corrosion, and other defects in an object. By installing acoustic emission sensors on pipelines, the instantaneous changes such as crack propagation and corrosion occurrence can be captured in real time. The time-domain characteristics (such as peak value, duration, amplitude, etc.), frequency-domain characteristics (such as frequency, frequency band, etc.), and waveform characteristics (such as waveform sharpness, amplitude, etc.) of acoustic emission signals are closely related to the type, location, and propagation degree of cracks.
[0004] Acoustic emission technology can provide "real-time monitoring" during pipeline operation. Compared with traditional periodic detection methods, it can detect potential cracks or other defects more promptly, reduce the probability of accidents, and reduce maintenance costs. Through acoustic emission technology, not only can the pipeline be monitored in real time during operation, but also the trend of crack expansion can be warned, providing an important basis for pipeline maintenance. However, the processing of acoustic emission signals faces an important challenge: the problem of signal noise. Due to the complexity of the external environment of the pipeline, the collected acoustic emission signals often contain a lot of noise, which may come from mechanical vibration, electromagnetic interference, airflow noise, etc. Therefore, how to extract effective features from complex acoustic emission signals and accurately judge the existence and development of cracks has become a key difficulty in the application of acoustic emission technology.
[0005] Support vector machine (SVM) is a machine learning method widely used in pattern recognition and classification, especially for classification problems with small samples, nonlinearity, and high-dimensional data. SVM divides data into different categories by maximizing the classification boundary and is highly robust to noise. Its advantages are:
[0006] For complex nonlinear classification problems, SVM can map low-dimensional space to high-dimensional space by using kernel functions (such as radial basis kernel) to find the optimal classification boundary of data. SVM can effectively avoid overfitting problems when facing noisy data by introducing soft intervals and penalty parameters. SVM has been widely used in image recognition, speech processing, text classification and other fields. In recent years, it has also been gradually applied to non-destructive testing and fault diagnosis. In particular, in pipeline crack detection, SVM can achieve efficient crack identification by classifying acoustic emission signals.
[0007] However, the performance of SVM depends on the selection of hyperparameters (such as penalty factor C and kernel parameter g). Traditional manual selection methods usually cannot guarantee the optimal parameter combination, which affects its classification accuracy. Therefore, how to select appropriate SVM hyperparameters in crack detection becomes a key issue to improve SVM performance.
[0008] Although acoustic emission (AE) technology and support vector machine (SVM) have been used in pipeline crack detection, the following problems still exist:
[0009] Noise interference: Acoustic emission signals are affected by environmental noise, and existing noise processing methods still find it difficult to completely eliminate the interference of noise on recognition results.
[0010] Difficulty in optimizing SVM hyperparameters: Traditional manual parameter adjustment methods make it difficult to find the optimal SVM hyperparameters, which affects the accuracy and stability of the model.
[0011] Lack of real-time performance and efficiency: Although SVM has good classification ability, how to achieve efficient real-time processing in a large amount of acoustic emission signal data remains a challenge. Summary of the Invention
[0012] To overcome the above defects in the prior art, the present invention provides a pipeline crack pattern recognition method based on an improved SSA-SVM algorithm, which uses the improved sparrow search algorithm to optimize the hyperparameters of the SVM model, can greatly improve the performance of the SVM model, and through reasonable parameter optimization, the SVM model can make more accurate judgments, thereby providing more effective pipeline safety monitoring.
[0013] To achieve the above object, the present invention adopts the following technical solutions, including:
[0014] A pipeline crack pattern recognition method based on an improved SSA-SVM algorithm, comprising the following steps:
[0015] S1, Determine the input and output of the fault diagnosis model, that is, the SVM model. The characteristics of the pipeline crack acoustic emission signal are used as the input of the fault diagnosis model, and the corresponding crack pattern is used as the output of the fault diagnosis model, and a training and test sample set is established.
[0016] S2, Initialize the parameters of the SSA algorithm, including the population size n, the proportions of discoverers, joiners, and scouts, the warning threshold R 2 and the safety threshold S N ; Initialize the parameters of the SVM model, including the penalty factor C and the kernel parameter g; Initialize the population of the SSA algorithm.
[0017] S3, Establish a prediction model of the SSA-SVM hybrid algorithm. Among them, the SVM model is used to explore the relationship between the pipeline crack acoustic emission signal and the crack pattern; the SSA algorithm is used to optimize the parameters of the SVM model, that is, the values of the penalty factor C and the kernel parameter g are used as individuals of the SSA algorithm.
[0018] S4, Calculate the fitness value of each individual, and sort them to find the individuals with the best and worst fitness values and their positions.
[0019] S5, Update the position of the discoverer according to the discoverer update formula of the SSA algorithm; Update the position of the joiner according to the joiner update formula of the SSA algorithm; Update the position of the scout according to the scout update formula of the SSA algorithm.
[0020] S6, Compare the fitness value of the new population with the fitness value of the original population, and update the individual positions.
[0021] In S7, it is judged whether the iteration end condition is reached. If not, jump to step S4 to continue the update; otherwise, stop the iteration, output the optimal individual, that is, the optimal SVM model parameters, obtain the optimal SVM model, input the test set samples into the optimal SVM model, and output the diagnosis result.
[0022] Preferably, in step S4, through cross-validation, the training samples are classified, and the accuracy rate of cross-validation is used as the fitness of the individual. The specific method is: divide the training set into k subsets, each time select k - 1 subsets from the k subsets as the training set, and the remaining 1 subset as the validation set, and use the average classification accuracy rate of k times of training and validation as the fitness value of the individual.
[0023] Preferably, in the SSA algorithm, the problem dimension is d-dimensional, the population size is n, and the population individual position Y is as follows:
[0024]
[0025] In the formula, Y is the position of the individual in the sparrow population, and y i,j is the position of the i-th sparrow in the j-th dimension, i = 1, 2,..., n, j = 1, 2,..., d, n is the population size, and d is the problem dimension;
[0026] The fitness F corresponding to the position Y of the sparrow population individual Y is as follows:
[0027]
[0028] In the formula, f([y 1,1 y 1,2 … y 1,d ) is the individual fitness value, and the average classification accuracy rate of cross-validation is used as the individual fitness value.
[0029] Preferably, in the SSA algorithm, the update formula for the discoverer is:
[0030]
[0031] In the formula, t is the iteration number; I iter,max is the maximum iteration number; is the value of the i-th discoverer in the j-th dimension in the (t + 1)-th iteration process; is the value of the i-th discoverer in the j-th dimension in the t-th iteration process; j = 1, 2,..., d; α is a random number with a value in (0, 1]; Q is a random number subject to a normal distribution; L is a 1×d-dimensional matrix, and all elements are 1; R 2 is a warning threshold with a value in [0, 1]; S N is a safety threshold with a value in [0.5, 1].
[0032] Preferably, in the SSA algorithm, the joiner update formula is:
[0033]
[0034] Where t is the number of iterations; Q is a random number that obeys the normal distribution; is the value of the i-th participant in the j-th dimension during the t+1-th iteration; is the value of the i-th participant in the j-th dimension during the t-th iteration; is the global worst joiner position during the t-th iteration; is the global optimal joiner position in the t+1th iteration; A is a 1×d-dimensional matrix in which each element is randomly assigned a value of 1 or -1, and satisfies A + =A T (AA T ) -1 ; L is a 1×d-dimensional matrix, and all elements are 1; H i,j is the step size factor of the ith joiner in the jth dimension; s 1 =0.001,s 2 =1;M j is the maximum distance between the current joiner and the optimal finder position in the jth dimension; is the value of the global optimal joiner position in the jth dimension during the t+1th iteration.
[0035] Preferably, in the SSA algorithm, the update formula of the scout is:
[0036]
[0037] Where t is the number of iterations; is the value of the i-th investigator in the j-th dimension during the t+1-th iteration; is the value of the i-th investigator in the j-th dimension during the t-th iteration; β is the step size adjustment parameter, which is a normal distribution random number with a mean of 0 and a variance of 1; is the global optimal scout position in the tth iteration; B is the moving direction of the sparrow, which is a random number in [-1,1]; f w 、f g 、f i are the fitness of the global worst scout, the fitness of the global best scout, and the fitness of the current scout respectively; σ is a minimum constant.
[0038] Preferably, the initialization population of the chaotic mapping SSA algorithm of the Logistic-Tent compound chaotic system is used.
[0039] The present invention also provides a readable storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed, the method for identifying pipeline crack patterns based on an improved SSA-SVM algorithm is implemented.
[0040] The present invention also provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the method for identifying pipeline crack patterns based on an improved SSA-SVM algorithm is implemented.
[0041] The present invention also provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the method for identifying pipeline crack patterns based on an improved SSA-SVM algorithm is implemented.
[0042] The advantages of the present invention are as follows:
[0043] (1) The parameters of the support vector machine (SVM) are optimized by using the improved sparrow search algorithm (SSA), significantly improving the accuracy of pipeline crack detection. Compared with traditional methods, this model can more accurately identify complex cracks, especially in the case of smaller or more complex crack morphologies, significantly reducing false detections and missed detections and improving the overall detection performance.
[0044] (2) The improved sparrow search algorithm has excellent global search ability and fast convergence speed, and can find the optimal SVM parameter configuration in a short time.
[0045] (3) The improved sparrow search algorithm (SSA) adjusts the search path flexibly according to the current optimization state through adaptive step size adjustment and dynamic search strategy, improving the efficiency of the optimization process and maintaining excellent performance in complex data environments.
[0046] (4) The improved sparrow search algorithm exhibits strong robustness, can optimize the SVM parameters under conditions of high noise interference and data uncertainty, improve the stability of the model, and still maintain high detection accuracy when facing non-linear or highly uncertain data.
[0047] (5) Traditional parameter optimization usually relies on manual tuning, which is a cumbersome and time-consuming process. After introducing the improved sparrow search algorithm, the optimization process is automated, significantly reducing manual intervention and improving work efficiency.
[0048] (6) This method is not only applicable to pipeline crack detection, but also can be extended to fields such as power equipment fault diagnosis, intelligent manufacturing, medical image analysis, and traffic monitoring. The combination of the improved sparrow search algorithm and SVM provides an efficient parameter optimization solution, with broad application potential and promotion prospects.
[0049] (7) The Sparrow Search Algorithm (SSA) is a newly emerging heuristic optimization algorithm that simulates the natural phenomenon of sparrow foraging behavior to solve optimization problems. Compared with traditional optimization algorithms (such as Particle Swarm Optimization, Genetic Algorithm, etc.), SSA has the following advantages: Strong global search ability: It can effectively avoid falling into local optimal solutions and has high global exploration ability. Fast convergence speed, and it can converge to the global optimal solution quickly in multiple iterations. Strong applicability, suitable for dealing with complex and high-dimensional optimization problems, especially outstanding in parameter optimization problems.
[0050] (8) In pipeline crack detection, using the improved Sparrow Search Algorithm to optimize the hyperparameters (penalty factor C and kernel parameter g) of SVM can greatly improve the performance of the SVM model. Through reasonable parameter optimization, the SVM model can judge more accurately, thus providing more effective pipeline safety monitoring.
[0051] (9) Combining the improved Sparrow Search Algorithm to optimize the SVM parameters can effectively improve the accuracy and real-time performance of pipeline crack detection, solve the deficiencies in existing methods, and has important innovative significance and broad application prospects. Description of the Drawings
[0052] Figure 1 It is a flowchart of a pipeline crack pattern recognition method based on the improved SSA-SVM algorithm.
[0053] Figure 2 It is a graph of actual classification and predicted classification of the test set based on the improved SSA-SVM model.
[0054] Figure 3 It is a graph of actual classification and predicted classification of the test set based on the unimproved SSA-SVM model. Detailed Implementation Manner
[0055] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0056] The Sparrow Search Algorithm (SSA) is a new type of swarm intelligence optimization algorithm that obtains the optimal hyperparameters (penalty factor C and kernel parameter g) of the Support Vector Machine (SVM) by simulating the foraging process of sparrows. Compared with other optimization algorithms, this algorithm has the advantages of fast convergence speed, high search accuracy, and strong robustness. Its implementation principle is as follows: The entire sparrow population is divided into three groups: discoverers, joiners, and scouts. Among them, the discoverers and scouts each account for 10% - 20% of the population, and the rest are joiners. Discoverers have strong search capabilities and guide the entire population to search and forage; joiners obtain better fitness by following the discoverers to search for food; scouts improve their own predation rate by monitoring the discoverers; when threatened by natural enemies, they send warning signals and the population makes anti-predation behaviors.
[0057] In the SSA algorithm, assuming that the size (dimension) of the search space is d-dimensional and the number of sparrows is n, the individual position Y of the sparrow population is as follows:
[0058]
[0059] where Y is the individual position of the sparrow population, and y i,j is the position of the i-th sparrow in the j-th dimension, i = 1, 2,..., n, j = 1, 2,..., d, n is the population size, and d is the problem dimension. In the present invention, the problem dimension d = 2, including two dimensions of the penalty factor C and the kernel parameter g.
[0060] The fitness F corresponding to the individual position Y of the sparrow population Y is as follows:
[0061]
[0062] where F Y is the fitness corresponding to the individual position Y of the sparrow population; f([y 1,1 y 1,2 …y 1,d ) is the fitness value of the individual (the first sparrow). In the present invention, the average classification accuracy of cross-validation is used as the individual fitness value.
[0063] The position update of the discoverers is as follows:
[0064]
[0065] where t is the iteration number; I iter,max is the maximum iteration number; is the value of the i-th discoverer in the j-th dimension in the (t + 1)-th iteration process; is the value of the i-th discoverer in the j-th dimension in the t-th iteration process; j = 1, 2,..., d; I iter,maxis the maximum number of iterations; α is a random number with a value in the range (0, 1]; Q is a random number following a normal distribution; L is a 1×d dimensional matrix with all elements being 1; R 2 is the vigilance threshold with a value in the range [0, 1]; S N is the safety threshold with a value in the range [0.5, 1].
[0066] When R 2 < S N it means that there is no predator in the sparrow population, and the discoverer can continue the search; on the contrary, when R 2 ≥ S N some sparrows in the population have already detected the predator, then a warning signal is sent to alert the discoverer to take anti-predation actions, timely adjust the search strategy, and go to a safe area to continue searching for food.
[0067] The position update of the traditional joiner is as follows:
[0068]
[0069] In the formula, t is the iteration number; Q is a random number following a normal distribution; is the value of the i-th joiner in the j-th dimension during the (t + 1)-th iteration; is the value of the i-th joiner in the j-th dimension during the t-th iteration; is the position of the global worst joiner during the t-th iteration; is the position of the global best joiner during the (t + 1)-th iteration; A is a 1×d dimensional matrix with each element randomly assigned 1 or -1, and satisfies A + = A T (AA T ) -1 ; L is a 1×d dimensional matrix with all elements being 1. When i > n / 2, it indicates that the i-th joiner has not found food, has a low survival rate, and needs to go to other areas to search for food to improve its own fitness.
[0070] From the traditional joiner update formula, it can be seen that the joiner will approach the optimal position of the discoverer with a certain probability, but the distance that the joiner moves towards the optimal discoverer position is random. After the position update, the joiner should not be too far from the optimal position of the discoverer. If the distance is too large, it is likely to lead to a slow convergence rate of the algorithm and poor local search ability at the optimal position. Therefore, the present invention introduces an adaptive step factor to control the distance between the joiner and the discoverer in each dimension. When the distance between the joiner and the optimal discoverer position is far, the step size is large to increase the convergence rate of the algorithm, and vice versa, the step size is reduced to increase the local search ability of the algorithm.
[0071] Therefore, the position update of the improved joiner in the present invention is as follows:
[0072]
[0073] In the formula, H i,j is the step size factor of the i-th joiner in the j-th dimension; s 1 = 0.001, s 2 = 1; M j is the maximum distance between the current joiner and the optimal finder position in the j-th dimension; is the value of the global optimal joiner position in the j-th dimension during the (t + 1)-th iteration process.
[0074] The position update of the scout is as follows:
[0075]
[0076] In the formula, t is the number of iterations; is the value of the i-th scout in the j-th dimension during the (t + 1)-th iteration process; is the value of the i-th scout in the j-th dimension during the t-th iteration process; β is the step size adjustment parameter, taking a random number that follows a normal distribution with a mean of 0 and a variance of 1; is the global optimal scout position during the t-th iteration process; B is the sparrow movement direction, taking a random number within [-1, 1]; f w 、f g 、f i are the fitness of the global worst scout, the fitness of the global optimal scout, and the fitness of the current scout respectively; σ is a very small constant to avoid the denominator being 0;
[0077] When f i > f g , it means that the sparrow (scout) is active in the edge zone of the population and is likely to be discovered by predators and attacked; when f i = f g , it means that the sparrow (scout) is located at the center of the population and has detected the danger of being attacked, and needs to quickly move closer to the sparrows in other areas.
[0078] To enhance the randomness and ergodicity of the initial population and improve the global search ability of the algorithm, a chaotic mapping initialization strategy is usually selected to replace the method of randomly generating the population in the SSA algorithm to maintain the diversity of the population. Common chaotic mappings include the Circle chaotic mapping, the Logistic mapping, and the Tent chaotic mapping. The present invention adopts a Logistic-Tent composite chaotic system generated by integrating the classical one-dimensional Logistic chaotic system and the Tent chaotic system. This Logistic-Tent composite chaotic system combines the complex chaotic dynamics characteristics of Logistic and the faster iteration speed, more self-correlation, and the characteristics applicable to a large number of sequences of the Tent chaotic system.
[0079] A pipeline crack pattern recognition method based on an improved SSA-SVM algorithm of the present invention includes the following steps:
[0080] S1. Determine the input and output of the fault diagnosis model, i.e., the SVM model. The pipeline crack acoustic emission signal features are used as the input of the fault diagnosis model, and the corresponding crack patterns are used as the output of the fault diagnosis model, and a training and test sample set is established.
[0081] S2. Initialize the parameters of the SSA algorithm, including the population size n, the proportions of the discoverer, the joiner, and the scout, and the warning threshold R 2 and the safety threshold S N ; Initialize the parameters of the SVM model, including the penalty factor C and the kernel parameter g; Use the Logistic-Tent composite chaotic system to chaotic map the initialization population of the SSA algorithm.
[0082] S3. Establish a prediction model of the SSA-SVM hybrid algorithm. Among them, the SVM model is used to explore the relationship between the pipeline crack acoustic emission signal and the crack pattern; the SSA algorithm is used to optimize the parameters of the SVM model, that is, the values of the penalty factor C and the kernel parameter g are used as individuals of the SSA algorithm.
[0083] S4. Through cross-validation, classify the training samples, use the accuracy rate of cross-validation as the fitness of the individual, calculate the fitness value of each individual, and sort them to find the individuals with the best and worst fitness values and their positions.
[0084] Specifically, divide the training set into k subsets. Each time, select k - 1 subsets from the k subsets as the training set, and the remaining 1 subset as the validation set. The average classification accuracy rate of k times of training and validation is used as the fitness value of the individual.
[0085] S5. Update the position of the discoverer according to the discoverer update formula of the SSA algorithm; update the position of the joiner according to the joiner update formula of the SSA algorithm; update the position of the scout according to the scout update formula of the SSA algorithm.
[0086] S6. Compare the fitness value of the new population with that of the original population and update the individual positions.
[0087] S7. Determine whether the iteration loop end condition is reached. If not, jump to step S4; otherwise, stop, output the optimal individual, i.e., the optimal SVM model parameters, obtain the optimal SVM model, input the test set samples into the optimal SVM model, and output the diagnostic results.
[0088] In step S1, use an acoustic emission acquisition device to obtain the original acoustic emission signal of the pipeline defect location, i.e., the pipeline leakage signal, and extract the characteristic parameters related to the crack as the feature vector (i.e., the acoustic emission signal feature of the pipeline crack).
[0089] The signal excitation part has a calibration device and a steel pipe (L = 1000 mm, d = 30 mm); the signal receiving part consists of a sensor, a preamplifier, an acoustic emission host, and upper computer software. The standard configuration of the acoustic emission host has a data acquisition card with a sampling rate of 10 M / S per channel, a sampling accuracy of 16 bits, low system noise, and a high dynamic range. Each data acquisition card is equipped with a 1 Gb waveform buffer to perfectly achieve full waveform acquisition without data loss, and the signal length is 1000. The pipeline crack acoustic emission signal x(t) is exported to the upper computer software for denoising processing.
[0090] The excitation part mainly simulates different crack signals on the surface of the steel pipe by the calibration device. The mechanical vibration of the material is collected by the sensor in the receiving part and converted into an electrical signal, which is amplified and processed by the preamplifier. Then, it is processed and recorded by the acoustic emission host and transmitted to the upper computer for processing. Extract the relevant characteristic parameter groups to form a 7-dimensional feature vector and match it with the crack mode. The crack mode is divided into three categories, namely, the crack initiation stage, the crack propagation plastic stage, and the stable crack propagation stage. Build a training sample set and a test sample set. Finally, 180 training data are built for training and learning.
[0091] In step S2, a prediction model of the SSA-SVM hybrid algorithm is established. Among them, SVM is used to explore the relationship between the acoustic emission signals of pipeline cracks and crack patterns, and the improved SSA algorithm is used to optimize SVM. Since the SSA algorithm is prone to falling into local optimum and cannot obtain the global optimum solution, the improved SSA algorithm is used to improve the searchability of the global solution and update the global optimum solution by optimizing the initial solution and improving the adaptive step factor. The improved SSA algorithm is used to optimize the hyperparameters (penalty factor C and kernel parameter g) of SVM, so as to realize the relationship between the nonlinear prediction of pipeline crack patterns and their influencing feature vectors in the high-dimensional space. According to simulation experience and dataset characteristics, the parameters of the SSA-SVM hybrid model are set as follows: the number of sparrows (population size) is 50, the maximum number of iterations is 20, the proportion of discoverers is 0.7, the proportion of joiners is 0.3, the proportion of scouts is 0.2, and the safety threshold S N is 0.6. r_logistic = 3.99 and r_tent = 1.5 in the Logistic-Tent composite chaotic system. The number of cross-validation folds k is 5.
[0092] After the calculation and optimization in steps S4-S7, the parameters of the SVM model are obtained as penalty factor C = 6.76 and kernel parameter g = 9.83 respectively. Using this value to train the model, after the model is trained, the improved SSA-SVM model is tested using the test set, and the prediction results are as Figure 2 shown, and the final recognition accuracy is 97.78%; using the unimproved SSA-SVM for optimization, training and testing, the prediction results are as Figure 3 shown, and its recognition accuracy is 87.78%. This shows that the improved SSA-SVM model has a good test effect and small error. Whether for the test set or the training set, the recognition results of the improved SSA-SVM model are basically consistent with the true experimental values, which indicates that the improved SSA-SVM model proposed in the present invention can effectively identify the expansion stage of pipeline cracks.
[0093] The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A pipeline crack pattern recognition method based on an improved SSA-SVM algorithm, characterized in that: The following steps are involved: S1, determine the input and output of the fault diagnosis model, i.e., the SVM model. The acoustic emission signal characteristics of pipeline cracks are used as the input of the fault diagnosis model, and the corresponding crack pattern is used as the output of the fault diagnosis model to establish training and test sample sets; S2, initialize the parameters of the SSA algorithm, including the population size n, the proportion of discoverers, joiners and scouts, the warning threshold R2 and the safety threshold S N ; Initialize the parameters of the SVM model, including the penalty factor C and the kernel parameter g; Initialize the population of the SSA algorithm; S3, establish a prediction model of the SSA-SVM hybrid algorithm, in which the SVM model is used to explore the relationship between the pipeline crack acoustic emission signal and the crack mode; the SSA algorithm is used to optimize the parameters of the SVM model, that is, the values of the penalty factor C and the kernel parameter g are used as individuals of the SSA algorithm; S4, calculate the fitness value of each individual, sort them, and find the individuals with the best and worst fitness values and their positions; S5, update the discoverer position according to the discoverer update formula of the SSA algorithm; update the joiner position according to the joiner update formula of the SSA algorithm; update the scout position according to the scout update formula of the SSA algorithm; S6, compare the fitness value of the new population with the fitness value of the original population and update the individual position; S7, determine whether the iteration end condition is met. If not, jump to step S4 to continue updating; otherwise, stop the iteration, output the optimal individual, that is, the optimal SVM model parameters, obtain the optimal SVM model, input the test set samples into the optimal SVM model, and output the diagnosis results.
2. According to claim 1, a pipeline crack pattern recognition method based on an improved SSA-SVM algorithm is characterized in that: In step S4, the training samples are classified through cross-validation, and the accuracy of cross-validation is used as the individual fitness. The specific method is: divide the training set into k subsets, select k-1 from the k subsets each time as the training set, and the remaining 1 as the validation set, and the average classification accuracy of k training validations is used as the individual fitness value.
3. The pipeline crack pattern recognition method based on the improved SSA-SVM algorithm according to claim 1 is characterized in that: In the SSA algorithm, the problem dimension is d, the population size is n, and the position Y of the individuals in the population is as follows: Where Y is the individual position of the sparrow population, y i,j is the position of the i-th sparrow in the j-dimension, i = 1, 2, ..., n, j = 1, 2, ..., d, n is the population size, d is the problem dimension; The fitness F corresponding to the position Y of the sparrow population Y As shown below: In the formula, f([y 1,1 y 1,2 … y 1,d ]) is the individual fitness value, and the average classification accuracy of cross-validation is taken as the individual fitness value.
4. The pipeline crack pattern recognition method based on the improved SSA-SVM algorithm according to claim 1 is characterized in that: In the SSA algorithm, the discoverer update formula is: Where t is the number of iterations; I iter,max is the maximum number of iterations; is the value of the i-th discoverer in the j-th dimension during the t+1-th iteration; is the value of the i-th discoverer in the j-th dimension during the t-th iteration; j = 1, 2, ..., d; α is a random number with a value in (0, 1]; Q is a random number that follows a normal distribution; L is a 1×d-dimensional matrix, and all elements are 1; R2 is the warning threshold with a value in [0, 1]; S N is a safety threshold in the range of [0.5,1].
5. The pipeline crack pattern recognition method based on the improved SSA-SVM algorithm according to claim 1 is characterized in that: In the SSA algorithm, the joiner update formula is: Where t is the number of iterations; Q is a random number that obeys the normal distribution; is the value of the i-th participant in the j-th dimension during the t+1-th iteration; is the value of the i-th participant in the j-th dimension during the t-th iteration; is the global worst joiner position during the t-th iteration; is the global optimal joiner position in the t+1th iteration; A is a 1×d-dimensional matrix in which each element is randomly assigned a value of 1 or -1, and satisfies A + =A T (AA T ) -1 ; L is a 1×d-dimensional matrix, and all elements are 1; H i,j is the step size factor of the ith participant in the jth dimension; s1 = 0.001, s2 = 1; M j is the maximum distance between the current joiner and the optimal finder position in the jth dimension; is the value of the global optimal joiner position in the jth dimension during the t+1th iteration.
6. The pipeline crack pattern recognition method based on the improved SSA-SVM algorithm according to claim 1 is characterized in that: In the SSA algorithm, the update formula of the scout is: Where t is the number of iterations; is the value of the i-th investigator in the j-th dimension during the t+1-th iteration; is the value of the i-th investigator in the j-th dimension during the t-th iteration; β is the step size adjustment parameter, which is a normal distribution random number with a mean of 0 and a variance of 1; is the global optimal scout position in the tth iteration; B is the moving direction of the sparrow, which is a random number in [-1,1]; f w 、f g 、f i are the fitness of the global worst scout, the fitness of the global best scout, and the fitness of the current scout respectively; σ is a minimum constant.
7. The pipeline crack pattern recognition method based on the improved SSA-SVM algorithm according to claim 1 is characterized in that: Use the initialization population of the chaotic mapping SSA algorithm of the Logistic-Tent compound chaotic system.
8. A readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the pipeline crack pattern recognition method based on the improved SSA-SVM algorithm described in any one of claims 1 to 7 is implemented.
9. An electronic device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a pipeline crack pattern recognition method based on an improved SSA-SVM algorithm as described in any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, realizes a pipeline crack pattern recognition method based on an improved SSA-SVM algorithm as described in any one of claims 1 to 7.