Strip steel surface defect identification method based on grouping mutation particle swarm optimization

By automatically searching for optimal hyperparameters using a grouped mutation particle swarm optimization algorithm, the problem of low efficiency in manual parameter tuning is solved, and the accuracy and recognition capability of strip steel surface defects are improved.

CN121860958APending Publication Date: 2026-04-14CHANGCHUN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing deep learning-based methods for identifying surface defects in strip steel rely on manual hyperparameter selection, which is inefficient and experience-dependent, making it difficult to achieve efficient defect identification.

Method used

The grouped mutation particle swarm optimization algorithm is adopted, which automatically searches for the optimal hyperparameters through state feedback-driven inertial weights, probability switching search mechanism and group mutation mechanism, thereby improving the accuracy of the defect identification model.

Benefits of technology

It effectively overcomes the problem of manual parameter tuning relying on experience, and improves the accuracy and recognition ability of the defect identification model, especially the ability to identify different types of defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860958A_ABST
    Figure CN121860958A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing and artificial intelligence, and particularly discloses a strip steel surface defect identification method based on a grouping mutation particle swarm algorithm, which is used for solving the problems of low detection accuracy, excessive dependence on experience and the like of the existing defect identification model based on deep learning due to the fact that hyper-parameters depend on manual tuning. The method comprises the following steps: firstly, acquiring a strip steel surface defect data set, and dividing the strip steel surface defect data set into a training set, a verification set and a test set; and then, carrying out automatic optimization on hyper-parameters of the defect identification deep convolutional neural network by utilizing an improved particle swarm algorithm. The algorithm improvement comprises: (1) a state feedback inertia weight mechanism: dynamically adjusting an inertia weight according to a historical optimal fitness value change so as to adaptively balance the global exploration and local development capability of the algorithm; (2) a probability switching search mechanism: based on search boundary information, further enhancing the algorithm exploration performance; and (3) a grouping variation mechanism: based on hyper-parameter priori knowledge, carrying out key disturbance on key dimensions so as to prevent a search process from falling into a local optimal solution. Through the improvement, high-efficiency automatic optimization of hyper-parameters is realized, and the automation level and the detection precision of strip steel surface defect identification are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of image processing technology and artificial intelligence technology, and in particular to a method for identifying surface defects in strip steel based on a grouped mutated particle swarm algorithm. Background Technology

[0002] In industrial production, surface defect detection of strip steel is a crucial aspect of quality control. In recent years, deep learning-based surface defect recognition methods have gradually become mainstream, but their superior performance largely depends on the settings of hyperparameters (learning rate, dropout rate, weight decay rate, batch size). Manual hyperparameter selection suffers from inefficiency and reliance on experience. Summary of the Invention

[0003] To address the aforementioned problems, this invention provides a method for identifying surface defects in strip steel based on a grouped mutation particle swarm optimization algorithm. By automatically searching for optimal hyperparameters, the accuracy of the defect identification model is improved. Compared to the standard particle swarm optimization algorithm, this invention introduces "state feedback-driven inertial weights, probability switching search mechanism, and grouped mutation mechanism" into the particle swarm optimization algorithm to enhance the algorithm's global search capability and improve convergence speed.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] A method for identifying surface defects in strip steel based on a grouped mutation particle swarm optimization algorithm includes the following steps:

[0006] Step 1: Obtain the image dataset of surface defects on the strip steel, and divide it into training set, validation set and test set according to a preset ratio;

[0007] Step 2: Construct a deep convolutional neural network for strip surface defect identification;

[0008] Step 3: Set the parameters for the grouped mutation particle swarm optimization algorithm, including the number of particles N and the maximum number of iterations t. max Initialize particle velocity V i (i = 1, 2, ..., N) and position X i (i = 1, 2, ..., N), where the position vector of each particle represents a set of hyperparameter combinations, and the velocity vector represents the direction and magnitude of hyperparameter adjustment;

[0009] Step 4 uses the weighted sum of the accuracies of the training and validation sets of the deep learning-based strip surface defect classification model as the fitness function, where the training set accuracy has a weight of 0.2 and the validation set accuracy has a weight of 0.8. The initial fitness of each particle is calculated, and the individual's historical best position, pbest, is initialized. 0 and the global historical best position gbest 0 ;

[0010] Perform iterative optimization, repeatedly executing steps 5.1 to 5.5 until the maximum number of iterations t is reached. max :

[0011] Step 5.1 Update the state feedback-driven inertia weights, calculate the difference between the current iteration and the global optimal fitness of the previous iteration, and adaptively select different strategies to update the inertia weights w based on whether the difference is zero. t ;

[0012] Step 5.2 During the position update process, the particle position is updated based on a probability switching search mechanism. A random number is generated; if this random number is greater than a fixed threshold c... a , where c a If the probability coefficient is used, the particle position is updated based on the particle swarm optimization algorithm; otherwise, the particle position is updated based on the boundary information of the hyperparameter.

[0013] Step 5.3 Calculate the fitness value (X) of the particle swarm after the position update. i ), and update the individual historical best position and the global historical best position;

[0014] Step 5.4 executes the grouping and mutation mechanism to generate a new population. To avoid getting stuck in local optima during the search process, three mutated subpopulations are generated based on the positions of the previous generation particles: the first subpopulation, the second subpopulation, and the third subpopulation. The number of mutated particles are NG1 = round(N / 3), NG2 = round(N / 3), and NG3 = N - NG1 - NG2, respectively. The initial learning rate is crucial to the model's convergence speed and final accuracy and requires fine-tuning. The Dropout rate and weight decay rate are mainly used to control model overfitting. Based on this knowledge, this method, after grouping, focuses on perturbing the learning rate dimension for the first group, focuses on the Dropout rate and weight decay rate for the second group, and perturbs all dimensions for the third group to enhance population diversity.

[0015] The first subpopulation employs a fine-grained mutation strategy, targeting the initial learning rate S, which is related to the model's feature extraction capability. g1 The perturbation is performed. The mathematical model for generating the positions of the first subpopulation can be expressed as:

[0016]

[0017] in, Let U be the position value of the i-th, j-th dimension, and t+1 iteration mutation particle, where U(-std,std) is a value generated by random distribution within the range [-std,std], and std is the boundary parameter.

[0018] The mathematical model of std can be expressed as:

[0019]

[0020] Among them, std start ∈(0,0.5] is the initial fixed value, std end ∈(0,0.3] is the final fixed value;

[0021] The second subpopulation consists of set S, which comprises hyperparameters related to model regularization, namely Dropout rate and weight decay rate. g2 The mathematical model for generating the positions of the second subpopulation can be expressed as:

[0022]

[0023] The third subpopulation employs a global perturbation mutation strategy, performing elite mutation operations across all dimensions. Its mathematical model can be expressed as:

[0024]

[0025] Step 5.5 Calculate the fitness value of the mutated particle and update the global historical best position again;

[0026] Step 6 outputs the combination of hyperparameters corresponding to the global historical best position as the optimal hyperparameters;

[0027] Step 7: Use the optimal hyperparameters to train the deep convolutional neural network and obtain the strip steel surface defect recognition model.

[0028] The features of this invention are:

[0029] The specific update method for the state feedback-driven inertia weight in step 5.1 is as follows:

[0030] Step 5.1.1: During initialization, the inertial weight is taken as the initial inertial weight value w. 0 =w start The state feedback mechanism is enabled from the first iteration;

[0031] Step 5.1.2, for the t-th iteration (t≥1), calculate the search state evaluation coefficient st. t :

[0032] st t =fitness(gbest) t )-fitness(gbest t-1 ),

[0033] Among them, st t Let fitness(gbest) be the search state evaluation coefficient for the t-th iteration. t Let be the global historical best fitness value in the t-th iteration, gbestt-1 The fitness value is the globally historical best value in the (t-1)th iteration.

[0034] Step 5.1.3, if st t ≠0, global fitness value can be improved, inertia weight w t Based on the decreasing trend of the quadratic function, the mathematical model can be expressed as:

[0035]

[0036] Among them, w end For the final inertia weight, t max This represents the maximum number of iterations.

[0037] Step 5.1.4, if st t =0, enhancing global search capabilities, then the inertia weight w t Updated to:

[0038] w t = a + b * rand,

[0039] Where a∈[0.5,1] and b∈[0.5,1] are global search capability control coefficients, and rand is a uniformly distributed random number in the interval [0,1].

[0040] Step 5.2 The specific implementation method based on the probability switching search mechanism is as follows:

[0041] If rand > c a Based on the standard particle swarm optimization algorithm, the particle positions are updated, and the mathematical model can be expressed as:

[0042]

[0043]

[0044] in, Let be the velocity value of the i-th particle in the j-th dimension at iteration t+1, where t is the iteration number, c1 and c2 are learning factors, and r1∈[0,1] and r2∈[0,1] are random numbers. Let be the position value of the i-th particle in the j-th dimension at the (t+1)-th iteration.

[0045] If rand≤c a Position updates are performed based on hyperparameter boundary information:

[0046]

[0047] Among them, ub d lb d , respectively, represent the upper and lower limits of the values ​​that can be taken in the d-dimensional space, and γ∈(0,0.5] is the proportionality coefficient;

[0048] The beneficial effects of this invention are:

[0049] This invention provides a method for identifying surface defects in strip steel based on a grouped mutation particle swarm optimization (PSO) algorithm. Improvements to the standard PSO algorithm include: first, proposing a state feedback-driven inertial weight to adaptively balance global and local searches; second, designing a probability-switching search mechanism to enhance the algorithm's global search capability; and finally, proposing a grouped mutation mechanism to prevent the algorithm from getting trapped in local optima. This method for identifying surface defects in strip steel based on the grouped mutation PSO algorithm effectively overcomes the problems of manual parameter tuning relying on experience and low efficiency, thus improving the accuracy of the defect identification model. Attached Figure Description

[0050] like Figure 1 This is a flowchart of the strip surface defect identification method based on the grouped mutation particle swarm algorithm of the present invention;

[0051] like Figure 2 This is the confusion matrix diagram of the strip surface defect identification method based on the grouped mutation particle swarm algorithm of the present invention on the test set. Implementation

[0052] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0053] This invention provides a method for identifying surface defects in strip steel based on a grouped mutation particle swarm optimization algorithm, as follows: Figure 1 As shown, please follow these steps:

[0054] Step 1: Obtain images of the strip surface containing various defects, including cracks, inclusions, patches, pitting, and scratches, and divide them into training, validation, and test sets according to proportions.

[0055] Step 2: Construct a deep convolutional neural network for strip surface defect identification. Use ResNet18 as the base model and modify the output dimension of its last fully connected layer to 6 to correspond to the six types of defects.

[0056] Step 3: Grouping and Mutation Particle Swarm Optimization Algorithm Parameters: including the number of particles N and the maximum number of iterations t. max Considering time costs, this example is a simplified version and does not represent the actual model. We set N=5 and t... max =5, initialize particle velocity V i (i = 1, 2, ..., N) and position X i(i = 1, 2, ..., N), where the position vector of each particle represents a set of hyperparameter values. The position vector is set to D = 4, with the first dimension being the learning rate, the second dimension being the dropout rate, the third dimension being the weight decay rate, and the fourth dimension being the batch size. The velocity vector represents the direction of hyperparameter adjustment.

[0057] Step 4 uses the weighted sum of the accuracy of the training and validation sets of the deep learning-based strip surface defect classification model as the fitness function. For each particle, the model is trained for a small number of periods (10 epochs) using the training set. The formula for calculating the fitness function can be expressed as:

[0058] fitness(X i ) = 0.2 * accuracy Tra (X i )+0.8*accuracy Val (X i ),

[0059] Among them, accuracy Tra (X i () represents the training set accuracy. Val (X i ) for particle X i Validation set accuracy;

[0060] Initialize the individual's historical best position pbest 0 and the global historical best position gbest 0 ;

[0061] Perform iterative optimization until the maximum number of iterations t is reached. max Each iteration includes the following sub-steps:

[0062] Step 5.1 Update the state feedback-driven inertia weights, including the following sub-steps;

[0063] Step 5.1.1: During initialization, the inertial weight is taken as the initial inertial weight value w. start =0.9, the state feedback mechanism is enabled from the first iteration;

[0064] Based on the current optimal fitness value gbest t Compared to the previous generation's best fitness value (gbest) t-1 The difference is used to calculate the feedback value of the search state. The mathematical model can be expressed as:

[0065] st t =gbest t -gbest t-1 ,

[0066] Among them, st tLet gbest be the search state evaluation coefficient for the t-th iteration. t Let gbest be the globally best historical position in the t-th iteration. t-1 This represents the globally optimal position in the (t-1)th iteration.

[0067] Step 5.1.2, if st t If w ≠ 0, it indicates that the algorithm iteration is normal, and the inertia weight decreases in the form of a quadratic function. t The mathematical model can be expressed as:

[0068]

[0069] Among them, w end =0.1 is the final inertia weight, t max This represents the maximum number of iterations.

[0070] If st t =0 indicates that the historical best fitness value has not improved, thus enhancing the algorithm's global search capability. t The update is as follows:

[0071] w t = a + b * rand,

[0072] Where a and b are global search capability control coefficients, in this example a = 0.8 and b = 0.5;

[0073] Step 5.2, execute the probability switching search mechanism, specifically as follows:

[0074] Set the probability coefficient c a =0.1, if rand>c a Based on the standard particle swarm optimization algorithm, the particle positions are updated, and the mathematical model can be expressed as:

[0075]

[0076]

[0077] in, Let be the velocity value of the i-th particle in the j-th dimension at the (t+1)-th iteration, where t is the iteration number, c1 = c2 = 2 are the learning factors, and r1 ∈ [0,1] and r2 ∈ [0,1] are random numbers. Let be the position value of the i-th particle in the j-th dimension at the (t+1)-th iteration.

[0078] If rand≤c a Position updates are performed based on boundary information:

[0079]

[0080] Among them, ub d Let lb be the upper bound of d-dimensional space. d This is the lower bound of the d-dimensional space;

[0081] Step 5.3 Calculate the fitness value of the particle swarm after the position update, and update the individual historical best position and the global historical best position;

[0082] Step 5.4 Executes a grouping mutation mechanism to generate a new population. To enhance the robustness of the strip steel surface defect classification and recognition model and avoid getting trapped in local optima during the search process, three mutated subpopulations are generated based on the positions of the previous generation of particles: the first subpopulation, the second subpopulation, and the third subpopulation, with 2, 2, and 1 mutated particles respectively. The initial learning rate is crucial to the model's convergence speed and final accuracy and requires fine-tuning. The Dropout rate and weight decay rate are mainly used to control model overfitting. Based on this knowledge, after grouping, this method focuses on perturbing the learning rate dimension for the first group, on the hyperparameters Dropout rate and weight decay rate for the second group, and on all dimensions for the third group to enhance population diversity. The specific implementation steps are as follows:

[0083] Step 5.4.1, for the first subpopulation, a fine-grained mutation strategy is used, targeting the initial learning rate S, which is related to the model's feature extraction capability. g1 The perturbation is performed. The mathematical model for generating the positions of the first subpopulation is as follows:

[0084]

[0085] Where U(-std,std) is a value generated by a random distribution within the range [-std,std], std is a boundary parameter, and S g1 The dimension randomly selected for the first group;

[0086] Calculate std:

[0087]

[0088] Among them, std start std is the initial setting value. end For the final set value, std in this example start =0.1, std end =0.005;

[0089] Step 5.4.2, for the second group, the hyperparameters related to model regularization, Dropout rate and weight decay rate, constitute a set S. g2 The mathematical model for generating the positions of the second subpopulation can be expressed as:

[0090]

[0091] Step 5.4.3, for the third group, perform elite mutation on all dimensions. The mathematical model can be expressed as:

[0092]

[0093] Step 5.5 Calculate the fitness value of the mutated particle and update the global historical best position again;

[0094] Step 6 outputs the combination of hyperparameters corresponding to the global historical best position as the optimal hyperparameters;

[0095] Step 7 uses the optimal hyperparameters to train the deep convolutional neural network and obtains the strip steel surface defect recognition model, which can be used to automatically classify new strip steel surface defect images.

[0096] Under the same surface defect dataset and basic network structure, hyperparameter optimization was performed using both the standard particle swarm optimization (PSO) algorithm and the proposed grouped mutation PSO algorithm. Under the same conditions, the output fitness value of this invention was 0.6531, while the output fitness value of the standard PSO algorithm was 0.6281. Compared to the standard PSO algorithm, the fitness value of this invention was improved by 3.98%, and the performance improvement was close to 4%. This indicates that the state feedback-driven inertial weights, probability switching search mechanism, and grouped mutation mechanism proposed in this invention can improve the hyperparameter search effect. The confusion matrix diagram of the strip surface defect identification method based on the grouped mutation PSO algorithm on the test set is shown below. Figure 2 As shown in the diagram, detailed analysis of the confusion matrix reveals that the optimized model of this invention achieves an overall recognition accuracy of 98.52% on the test set, with F1 scores for all six defect types exceeding 0.95. This indicates that the defect recognition model trained with the optimized hyperparameters of this invention not only boasts high overall accuracy but also exhibits balanced recognition capabilities across different defect types, effectively avoiding bias in specific categories.

[0097] It should be added that the above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention should be considered equivalent substitutions and are included within the protection scope of the present invention.

Claims

1. A method for identifying surface defects in strip steel based on a grouped mutated particle swarm optimization algorithm, characterized in that, To address the technical problem in deep learning-based strip surface defect recognition methods where the hyperparameter optimization process easily gets trapped in local optima, resulting in hyperparameter combinations that fail to achieve optimal recognition performance, a grouping mutation mechanism is designed to effectively maintain search diversity and avoid premature convergence. This mechanism adaptively optimizes the hyperparameter space of the convolutional neural network to obtain a defect recognition model with stronger generalization performance. The method includes the following steps: Step 1: Obtain the image dataset of surface defects on the strip steel and divide it into training set, validation set and test set; Step 2: Construct a deep convolutional neural network for strip surface defect identification. The hyperparameters to be optimized include learning rate, Dropout rate, weight decay rate, and batch size. Step 3: Set the parameters for the grouped mutation particle swarm optimization algorithm, including the number of particles N and the maximum number of iterations t. max Initialize particle velocity V i (i = 1, 2, ..., N) and position X i (i = 1, 2, ..., N), where the position vector of each particle represents a set of hyperparameter values, and the velocity vector represents the direction and magnitude of hyperparameter adjustment; Step 4 uses the weighted sum of the accuracies of the training and validation sets of the deep learning-based strip surface defect classification model as the fitness function, where the training set accuracy has a weight of 0.2 and the validation set accuracy has a weight of 0.

8. The initial fitness of each particle is calculated, and the individual's historical best position, pbest, is initialized. 0 and the global historical best position gbest 0 ; Step 5 involves iterative optimization, repeatedly executing steps 5.1 to 5.5 until the maximum number of iterations t is reached. max : Step 5.1 Update the state feedback-driven inertia weights. Based on the difference between the global optimal fitness of the current iteration and the previous iteration, adaptively select the inertia weight update strategy. Step 5.2 Update particle positions based on probability switching search mechanism: Generate a random number r∈[0,1], if r>c a (c a If ∈(0,1) is the probability coefficient, the particle position is updated based on the standard particle swarm optimization algorithm; otherwise, the particle position is updated based on the boundary information of the hyperparameters. Step 5.3 Calculate the updated fitness value (X) for each particle. i Update the individual's historical best position pbest. t Global historical best position gbest t ; Step 5.4 Executes a group mutation mechanism to generate a new population to avoid the search process getting trapped in local optima. Based on the positions of the previous generation of particles, three mutated subpopulations are generated: the first subpopulation, the second subpopulation, and the third subpopulation. The number of mutated particles are NG1 = round(N / 3), NG2 = round(N / 3), and NG3 = N - NG1 - NG2, respectively. The three mutated subpopulations are generated through the following three different mutation rules: (1) The first subpopulation adopts a fine mutation strategy, targeting the initial learning rate S which is related to the model's feature extraction capability. g1 The perturbation is performed. The mathematical model for generating the positions of the first subpopulation can be expressed as: In formula (1), Let U be the position value of the i-th, j-th dimension, and t+1 iteration mutation particle, where U(-std,std) is a value generated by random distribution within the range [-std,std], and std is the boundary parameter. Calculate std using formula (2): In formula (2), std start ∈(0,0.5] is the initial fixed value, std end ∈(0,0.3] is the final fixed value; (2) The second subpopulation consists of set S, which is related to the model regularization hyperparameters Dropout rate and weight decay rate. g2 The mathematical model for generating the positions of the second subpopulation can be expressed as: (3) The third subpopulation adopts a global perturbation mutation strategy, performing elite mutation operations in all dimensions. Its mathematical model can be expressed as: Step 5.5 Calculate the fitness value of the mutated particle and update the global historical best position again; Step 6 outputs the combination of hyperparameters corresponding to the global historical best position as the optimal hyperparameters; Step 7: Use the optimal hyperparameters to train the deep convolutional neural network and obtain the strip steel surface defect recognition model.

2. The method according to claim 1, characterized in that, Step 5.1 specifically includes: Step 5.1.1: During initialization, the inertial weight is taken as the initial inertial weight value w. 0 =w start The state feedback mechanism is enabled from the first iteration; Step 5.1.2, for the t-th iteration (t≥1), calculate the search state evaluation coefficient st. t : st t =fitness(gbest t )-fitness(gbest t-1 ) (5) In formula (5), st t Let fitness(gbest) be the search state evaluation coefficient for the t-th iteration. t Let be the global historical best fitness value in the t-th iteration, gbest t-1 The fitness value is the globally historical best value in the (t-1)th iteration. Step 5.1.3, if st t ≠0, global fitness value can be improved, inertia weight w t Decreasing according to a quadratic function: In formula (6), w end For the final inertia weight, t max This represents the maximum number of iterations. Step 5.1.4, if st t =0, enhancing global search capabilities, then the inertia weight w t Updated to: In formula (7), a∈[0.5,1] and b∈[0.5,1] are global search capability control coefficients, and rand is a random number uniformly distributed in the interval [0,1].

3. The method according to claim 1, characterized in that, In step 5.2: If rand > c a Based on the standard particle swarm optimization algorithm, the particle positions are updated using formulas (8) and (9): In formula (8), Let be the velocity value of the i-th, j-th dimension, and t+1-th iteration particle, where t is the iteration number, c1 and c2 are learning factors, and r1∈[0,1] and r2∈[0,1] are random numbers; in formula (9), Let be the position value of the i-th particle in the j-th dimension at the (t+1)-th iteration. If rand≤c a Position updates are performed based on hyperparameter boundary information: In formula (10), ub d lb d are the upper and lower limits of the values ​​that can be taken in the d-dimensional space, respectively, and γ∈(0,0.5] is the proportionality coefficient.