Bearing roller defect detection method, system and device based on image processing

By building a variety of defect detection networks based on image processing, and through feature sharing and collaborative parameter optimization, the problems of low efficiency and accuracy of traditional detection methods are solved, and high-precision detection of bearing roller defects is achieved.

CN119338822BActive Publication Date: 2025-03-11XINCHANG COUNTY CHENGBEN ROLLER BEARING

Patent Information

Application Number
CN202411885850.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-03-11
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Traditional bearing roller defect detection methods are inefficient and difficult to ensure accuracy, especially in high noise and complex background environments, it is difficult to meet the requirements of modern industrial technology.

Method used

Using an image processing-based method, the first defect detection pre-training network and the second defect detection pre-training network are built by acquiring the bearing roller image set for pre-processing and normalizing the processing, which are used for regular and irregular defect detection respectively, and the information complementarity and weighted fusion of detection results are achieved through feature sharing and cooperative parameter optimization.

Benefits of technology

It improves the accuracy and stability of bearing roller defect detection, enhances the adaptability and adaptability of the detection method, and can accurately detect the regular and irregular defects of bearing rollers in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338822B_ABST
    Figure CN119338822B_ABST
Patent Text Reader

Abstract

The present invention discloses a bearing roller defect detection method, system and device based on image processing, the method comprising: preprocessing and normalizing the bearing roller image to obtain image matrix data; building the first and second defect detection pre-training networks and training them to obtain the first and second defect detection models; acquiring the first and second defect features, building a defect detection controller and obtaining the collaboration parameters between the first and second defect detection models through analysis; obtaining the initial fusion features through the collaboration parameters and the first and second defect features, establishing a parameter optimization network and training through the initial fusion features to obtain the parameter optimization model, and obtaining the defect detection results based on the parameter optimization model and the initial fusion features. The present invention realizes efficient, stable and reliable bearing roller defect detection in a complex and changeable industrial environment through image processing technology, and improves the quality and competitiveness of the overall industrial production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a bearing roller defect detection method, system and device based on image processing. Background Art

[0002] At present, bearing rollers are widely used in high-precision mechanical equipment. However, during the production and use of bearing rollers, tiny and difficult-to-detect defects such as cracks, pores, shape deviations, surface flaws, etc. are prone to occur. If defects occur during use and are not discovered in time, it will not only affect the performance and life of the bearing rollers, but may also cause problems such as failure and shutdown of mechanical equipment.

[0003] Traditional bearing roller defect detection methods mainly rely on manual visual inspection and single imaging detection methods, but these methods are inefficient and difficult to guarantee accuracy. Manual visual inspection relies on skilled workers to observe whether there are defects on the surface of the bearing roller by naked eyes, which is easily affected by the subjective judgment of the inspectors, making it difficult to achieve objective and high-precision defect detection, and at the same time wasting a lot of manpower and material resources; with the continuous improvement of industrial automation and intelligent levels, higher requirements are put forward for the real-time, accuracy and adaptability of bearing roller defect detection methods, especially in high-noise and complex background environments. The traditional single imaging method is easily interfered by noise, etc., which affects the accuracy of bearing roller detection, and therefore it is difficult to meet the requirements of modern industrial technology. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides a bearing roller defect detection method, system and device based on image processing.

[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0006] A bearing roller defect detection method based on image processing comprises the following steps:

[0007] Acquire a bearing roller image set, preprocess the bearing roller image to obtain a bearing roller preprocessed image, normalize the bearing roller preprocessed image to obtain a bearing roller normalized image, and obtain image matrix data based on the bearing roller normalized image;

[0008] Building a first defect detection pre-training network and a second defect detection pre-training network, and training the first defect detection pre-training network and the second defect detection pre-training network respectively based on the image matrix data to obtain a first defect detection model and a second defect detection model;

[0009] The first defect feature is obtained by the first defect detection model, and the second defect feature is obtained by the second defect detection model, wherein the first defect detection model is used for regular defect detection of the bearing roller, and the regular defect includes dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of the bearing roller, and the irregular defect includes complex surface flaws and texture anomalies;

[0010] Building a defect detection controller, combining the first defect feature, the second defect feature, the first defect detection model performance parameter, and the second defect detection model performance parameter to obtain a collaboration parameter between the first defect detection model and the second defect detection model;

[0011] An initial fusion feature is obtained through the first defect feature, the second defect feature and the collaborative parameter, a parameter optimization network is established and trained based on the initial fusion feature to obtain a parameter optimization model, the initial fusion feature is processed based on the parameter optimization model to obtain defect features, and defect detection results are obtained through the defect features.

[0012] As an implementable method, the bearing roller image set is obtained by scanning the bearing roller under multi-spectral bands using a multi-modal imaging device;

[0013] The multimodal imaging device includes a visible light imaging device, an infrared imaging device and an X-ray imaging device.

[0014] As an implementable method, preprocessing the bearing roller image to obtain the bearing roller preprocessed image includes the following steps:

[0015] Perform a two-dimensional discrete Fourier transform on the bearing roller image to obtain the bearing roller transformation image, which is expressed as follows:

[0016]

[0017] The bearing roller transformation image is input into a low-pass filter for filtering, and the bearing roller filter image is obtained, which is expressed as follows:

[0018]

[0019] The bearing roller filter image is converted into time domain to obtain the bearing roller time domain image, which is expressed as follows:

[0020]

[0021] The time domain image of the bearing roller is subjected to discrete wavelet transform to obtain the bearing roller detail subband, the bearing roller detail subband is subjected to denoising to obtain the bearing roller denoising subband, and the bearing roller denoising subband is subjected to inverse discrete wavelet transform to obtain the bearing roller preprocessing image, which is expressed as follows:

[0022]

[0023]

[0024]

[0025] in, represents the image of the bearing roller, represents the height of the bearing roller image, represents the width of the bearing roller image, Indicates the height of the pixel position in the bearing roller image, Represents the width of the pixel position in the bearing roller image, represents the number of modalities of a multimodal imaging device, represents the spectral band, Represents the pixel coordinates of the bearing roller image, represents the bearing roller transformation image, represents the bearing roller filtered image, represents a low-pass filter, represents the time domain image of the bearing roller, Represents the bearing roller detail sub-bands at different scales, represents the number of scales, represents the bearing roller denoising subband, represents the threshold value, represents the preprocessed image of the bearing roller, represents the inverse discrete wavelet transform, If, Indicates other.

[0026] As an implementable method, the normalizing the preprocessed image of the bearing roller to obtain the normalized image of the bearing roller includes the following steps:

[0027] Analyze the pixel values ​​of the preprocessed image of the bearing roller to obtain the image pixel value range;

[0028] The preprocessed image of the bearing roller is normalized based on the image pixel value range to obtain the normalized image of the bearing roller, which is expressed as follows:

[0029]

[0030] in, Indicates the height of the pixel position in the bearing roller image, Represents the width of the pixel position in the bearing roller image, The normalized image of the bearing roller is shown at point The pixel value of Indicates the preprocessed image of the bearing roller at point The pixel value of represents the minimum pixel value of the preprocessed image of the bearing roller, Indicates the maximum pixel value of the preprocessed image of the bearing roller.

[0031] As an implementable method, the first defect detection pre-trained network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer;

[0032] The input layer receives image matrix data, and reorganizes and transforms the image matrix data to obtain multi-channel image data;

[0033] The convolution layer extracts the spatial features of multi-channel image data based on the convolution kernel, which is expressed as follows:

[0034]

[0035] The pooling layer receives the output of the convolution layer and performs dimensionality reduction by extracting the main features to obtain the image pooling features, which are expressed as follows:

[0036]

[0037] The fully connected layer integrates and classifies the image pooling features to obtain image connection features, which are expressed as follows:

[0038]

[0039] The output layer classifies and predicts the image connection features to obtain the first defect feature, which is expressed as follows:

[0040]

[0041] in, Indicates The output of the convolutional layer, Indicates The convolution kernel of the convolution layer, Indicates The bias term of the convolutional layer, represents the activation function, represents the number of convolutional layers, represents the image pooling feature, Indicates The output of the pooling layer, represents the number of pooling layers, represents the maximum pooling operation, represents the image connection feature, represents the weight matrix of the fully connected layer, represents the bias vector, Represents the image pooling features output by the last pooling layer, Indicates the first defect feature.

[0042] As an implementation method, it also includes weight optimization of the convolution layer and the fully connected layer based on singular value decomposition, including the following steps:

[0043] Perform singular value decomposition on the convolution kernel of the convolution layer and the weight matrix of the fully connected layer to obtain the convolution singular value decomposition results and the fully connected singular value decomposition results, which are expressed as follows:

[0044]

[0045]

[0046] Set the singular threshold, retain the convolution singular value decomposition results and the fully connected singular value decomposition results that meet the singular threshold in the singular value decomposition results, and obtain the convolution low-rank approximate matrix and the fully connected low-rank approximate matrix, which are expressed as follows:

[0047]

[0048]

[0049]

[0050] The weight matrices of the convolutional layer and the fully connected layer are replaced by the convolutional low-rank approximate matrix and the fully connected low-rank approximate matrix respectively;

[0051] in, Indicates The convolution kernel of the convolution layer, represents the convolution left singular vector matrix, represents the convolution singular value diagonal matrix, represents the convolution right singular vector matrix, represents the weight matrix of the fully connected layer, represents the fully connected left singular vector matrix, represents a fully connected singular value diagonal matrix, represents the fully connected right singular vector matrix, represents the convolution low-rank approximation matrix, represents the convolution low-rank left singular vector matrix, represents the convolution low-rank singular value diagonal matrix, represents the convolution low-rank right singular vector matrix, represents a fully connected low-rank approximation matrix, represents a fully connected low-rank left singular vector matrix, represents a fully connected low-rank singular value diagonal matrix, represents the fully connected low-rank right singular vector matrix, represents the singular threshold, Represents the dimensions of the diagonal matrix of singular values.

[0052] As an implementable embodiment, the second defect detection pre-trained network includes an input layer, a graph convolution layer, a graph pooling layer, a fully connected layer and an output layer;

[0053] The input layer obtains image matrix data and converts the image matrix data into the input format of the graph structure to obtain image node data, which is expressed as follows:

[0054]

[0055]

[0056]

[0057] The graph convolution layer extracts local features in the graph structure through graph convolution operations to obtain graph convolution feature data, which is expressed as follows:

[0058]

[0059] The graph pooling layer is located after the graph convolution layer, and further extracts the graph convolution feature data to obtain the graph pooling feature data, which is expressed as follows:

[0060]

[0061] The fully connected layer is located after the graph convolution layer and the graph pooling layer. The fully connected layer integrates and classifies the graph pooling feature data to obtain graph connection feature data, which is expressed as follows:

[0062]

[0063] The output layer performs classification and prediction based on the graph connection feature data to obtain the second defect feature, which is expressed as follows:

[0064]

[0065] in, Represents image node data, Represents a collection of nodes. represents the edge set, Indicates The graph convolution feature data output by the graph convolution layer, represents the activation function, represents the normalized adjacency matrix, Indicates The weight matrix of the graph convolution layer, Indicates The bias vector of the graph convolutional layer, Indicates The graph pooling feature data output by the graph pooling layer, represents the graph pooling operation, Represents graph connection feature data, represents the weight matrix of the fully connected layer, represents the bias vector of the fully connected layer, Indicates the second defect characteristic.

[0066] As an implementable method, the network parameters of the second defect detection pre-trained network are updated based on the gradient descent method, including the following steps:

[0067] The defect detection loss function is established based on the label of the bearing roller image and the second defect feature, which is expressed as follows:

[0068]

[0069] The gradient of the defect detection loss function for the network parameters in the second defect detection pre-trained network is obtained, and the network parameters are updated by the standard gradient descent algorithm, which is expressed as follows:

[0070]

[0071] Based on the defect detection loss function and network parameter update strategy, forward propagation, defect detection loss function calculation, back propagation and network parameter update are repeated until convergence;

[0072] in, represents the defect detection loss function, represents the number of bearing roller images, represents the number of defect categories, Labels representing the images of bearing rollers, represents network prediction data, represents the network parameters of the second defect detection pre-trained network, represents the learning rate, Indicates update, represents the updated network parameters of the second defect detection pre-trained network.

[0073] As an implementable method, the feature sharing layer is used to share and transfer the image connection features and graph connection feature data obtained by the fully connected layer in the first defect detection pre-training network and the second defect detection pre-training network, including the following steps:

[0074] The image connection feature and graph connection feature data are fused by fusion weight parameters to obtain the fusion defect feature, which is expressed as follows:

[0075]

[0076] The fused defect features are passed to the subsequent layers of the first defect detection pre-training network and the second defect detection pre-training network, respectively, as shown below:

[0077]

[0078]

[0079] in, , represents the fusion weight parameter, represents the image connection feature, Represents graph connection feature data, Indicates the fusion defect characteristics, represents the first defect detection pre-trained network The features after layer fusion, represents the first defect detection pre-trained network The original characteristics of the layer, represents the first The features after layer fusion, represents the first The original characteristics of the layer.

[0080] As an implementable method, the step of obtaining the collaboration parameters between the first defect detection model and the second defect detection model includes the following steps:

[0081] Respectively obtaining a first defect detection model performance parameter and a second defect detection model performance parameter, wherein the model performance parameters include detection accuracy, processing time, and resource utilization rate;

[0082] The state vector of the defect detection controller is constructed by the first defect feature, the second defect feature, the detection accuracy, the processing time and the resource utilization rate, which is expressed as follows:

[0083]

[0084] Setting an initial collaboration strategy, including resource allocation adjustment, priority adjustment and parameter adjustment, wherein the resource allocation adjustment allocates resources to the first defect detection pre-trained network and the second defect detection pre-trained network by setting collaboration parameters, and the priority adjustment obtains the processing order of the first defect detection pre-trained network and the second defect detection pre-trained network when competing for resources by modifying the processing priority;

[0085] The collaboration parameters are expressed as follows:

[0086]

[0087] Through the cooperation parameters, the cooperation vector of the defect detection controller is obtained, which is expressed as follows:

[0088]

[0089] Based on detection accuracy, processing time and resource utilization, the reward function of the defect detection controller is established, which is expressed as follows:

[0090]

[0091] A strategy network is established, wherein the strategy network includes an input layer, a hidden layer, and an output layer. The input layer receives a state vector of a defect detection controller, and the hidden layer includes multiple fully connected layers and an activation function. The state vector of the defect detection controller is analyzed. The output layer outputs a collaboration vector of the defect detection controller based on a collaboration parameter type, and then the collaboration parameters between the first defect detection model and the second defect detection model are obtained based on the collaboration vector. The collaboration vector is expressed as follows:

[0092]

[0093] in, represents the state vector of the defect detection controller, Indicates the first defect characteristic, Indicates the second defect characteristic, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. , represents the collaboration parameters, represents the cooperation vector of the defect detection controller, represents the reward function of the defect detection controller, , , represents the weight coefficient, represents the policy network, represents the exploration noise, represents the parameters of the policy network, Indicates priority adjustment. Indicates parameter adjustment.

[0094] As an implementation method, it also includes optimizing the parameters of the policy network by a policy gradient method, and the policy gradient method includes the following steps:

[0095] Based on the state vector, reward function and state vector of the defect detection controller in the given state, the advantage function of the defect detection controller in the given state is obtained, which is expressed as follows:

[0096]

[0097] Based on the advantage function, the policy network parameters are updated by cutting the objective function of the policy gradient method using multiple small batch update methods, as shown below:

[0098]

[0099]

[0100] in, represents the advantage function of the defect detection controller in the current state, represents the reward function of the defect detection controller in the current state, represents the discount factor, represents the value function, represents the optimization step size, represents the state vector of the defect detection controller in the current state, represents the clipping objective function, represents the shearing parameter, represents the strategy probability ratio, represents the cooperation vector of the defect detection controller in the current state, represents the policy network, represents the policy network before parameter update, Represents the parameters of the policy network.

[0101] As an implementable method, the first defect detection model, the second defect detection model and the defect detection controller are optimized and adjusted, including the following steps:

[0102] Based on classification loss and regularization, the defect loss function is defined as follows:

[0103]

[0104]

[0105]

[0106] The gradient of the defect loss function for the network parameters in the first defect detection model and the second defect detection model is obtained through the back propagation algorithm, which is expressed as follows:

[0107]

[0108] The network parameters and weights in the first defect detection model and the second defect detection model are updated by the standard gradient descent algorithm to obtain the optimized first defect detection model and the second defect detection model, which are expressed as follows:

[0109]

[0110]

[0111] Performing feedback optimization on the defect detection controller based on the optimized first defect detection model and the second defect detection model;

[0112] in, represents the defect loss function, represents the classification loss, represents the regularization term, represents the regularization coefficient, represents the batch size, represents the number of categories, Indicates The sample The true class label, Indicates The sample The predicted probability of the class, Indicates The weight matrix of the layer, represents the gradient of the defect loss function with respect to the network parameters, Indicates update, represents all trainable parameters in the network, represents all updated trainable parameters in the network, Indicates the updated The weight matrix of the layer, Represents the learning rate.

[0113] As an implementable method, the feedback optimization of the defect detection controller includes the following steps:

[0114] The weight adjustment amount is obtained through the synaptic plasticity mechanism, and the weight of the strategy network of the defect detection controller is updated based on the weight adjustment amount, which is expressed as follows:

[0115]

[0116] Based on the updated defect detection controller, the first defect detection model performance parameter and the second defect detection model performance parameter are obtained, and the cooperation parameter is feedback-adjusted by the first defect detection model performance parameter and the second defect detection model performance parameter, which is expressed as follows:

[0117]

[0118]

[0119] If the feedback-adjusted collaboration parameters do not satisfy the constraint condition that the sum is 1, normalization processing is performed, and the normalization processing is expressed as follows:

[0120]

[0121]

[0122] in, represents the parameters of the policy network, represents the learning rate, represents the defect loss function, Indicates the adjustment scale factor, represents the weight adjustment amount, , represents the cooperation parameter between the first defect detection model and the second defect detection model, , represents the adjustment step size, , represents the gradient of detection accuracy with respect to the collaborative parameter, , represents the gradient of processing time with respect to the coordination parameter, Indicates the detection accuracy, Indicates the processing time, Indicates update, represents the parameters of the updated policy network, , The updated cooperation parameter between the first defect detection model and the second defect detection model is represented.

[0123] As an implementable method, establishing a parameter optimization network and training based on the initial fusion features includes the following steps:

[0124] Based on the cooperation parameters between the first defect detection model and the second defect detection model, the first defect feature and the second defect feature are fused to obtain an initial fusion feature, which is expressed as follows:

[0125]

[0126] Obtain the detection accuracy, processing time and resource utilization, and establish the defect objective function, which is expressed as follows:

[0127]

[0128] Based on the collaborative parameters, the defect objective function is optimized by a particle swarm optimization algorithm until convergence, wherein the particle swarm optimization algorithm is expressed as follows:

[0129]

[0130]

[0131] The network defect label is obtained by predicting the initial fusion features. The defect error function is established based on the mean square error through the network defect label and the real defect label, which is expressed as follows:

[0132]

[0133] Through the back propagation mechanism, based on the defect error function, the cooperation parameters between the first defect detection model and the second defect detection model are trained and adjusted, as shown below:

[0134]

[0135]

[0136] If the collaborative parameters of the defect detection controller after training and adjustment do not satisfy the constraint that the sum is 1, normalization is performed, which is expressed as follows:

[0137]

[0138]

[0139] in, represents the initial fusion feature, , represents the coordination parameters of the defect detection controller, Indicates the first defect characteristic, Indicates the second defect characteristic, represents the defect objective function, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. , , represents the weight coefficient, , represents the learning factor, , represents a random number, and , Range is , Indicates your best position. represents the global optimal position, represents the optimization step size, represents the defect error function, represents the number of samples in the bearing roller image set, Indicates the network defect label, represents the true label of the defect, , represents the learning rate, Indicates update, , The updated cooperation parameter between the first defect detection model and the second defect detection model is represented.

[0140] As an implementable method, optimization is also performed by a global optimization algorithm and model performance parameters, including the following steps:

[0141] A comprehensive objective function is established based on the model performance parameters, which include detection accuracy, processing time, and resource utilization, as shown below:

[0142]

[0143] The global optimization algorithm includes a simulated annealing algorithm, a genetic algorithm, and a particle swarm optimization algorithm. The simulated annealing algorithm includes the following steps:

[0144] Set the initial temperature and update the temperature based on the cooling coefficient, as shown below:

[0145]

[0146] The rate of change of the comprehensive objective function is obtained, and the temperature reduction coefficient is adjusted based on the rate of change of the comprehensive objective function to control the change speed of the initial temperature, which is expressed as follows:

[0147]

[0148]

[0149] Based on the initial temperature and the updated temperature obtained after the temperature update, the comprehensive objective function change rate is obtained. Through the objective function change rate and the initial temperature, the updated acceptance probability is obtained. The comprehensive objective function is updated based on the updated acceptance probability. The acceptance probability is expressed as follows:

[0150]

[0151] The genetic algorithm randomly generates a population and calculates the fitness of each individual in the population, selects individuals according to the fitness and re-pairs them to generate offspring individuals, mutates the offspring individuals and changes the current population, and iterates until convergence;

[0152] The particle swarm optimization algorithm includes speed update and position update, which are expressed as follows:

[0153]

[0154]

[0155] in, represents the comprehensive objective function, , , represents the comprehensive weight coefficient, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. No. The rate of change of the comprehensive objective function of the iteration, Indicates the speed of change, , Indicates the preset change threshold, , , Indicates fast, slow, and normal cooling coefficients. , represents the probability of acceptance, Indicates The temperature of the iteration, Represents particles In the The speed of iterations, Represents particles In the The position of the iteration, represents the inertia weight, , is the acceleration constant, , Represents a random number, Represents particles The best location in history, represents the global optimal position, If, Indicates other.

[0156] As an implementable method, the detection accuracy is obtained by analyzing the model detection results based on the true positive data, false positive data and false negative data in the model detection results, and is expressed as follows:

[0157]

[0158] The processing time is obtained by obtaining the current processing time and the number of samples of the bearing roller image set and analyzing them, and is expressed as follows:

[0159]

[0160] The resource utilization rate is obtained by obtaining the number of resource types and the corresponding utilization rates, and is analyzed based on the number of resource types and the corresponding utilization rates, and is expressed as follows:

[0161]

[0162] in, Indicates the detection accuracy, represents true positive data, represents false positive data, represents false negative data, Indicates the processing time, represents the number of samples in the bearing roller image set, Indicates The processing time of a bearing roller image, Indicates resource utilization. Indicates the number of resource types. Indicates The utilization rate of a resource.

[0163] A bearing roller defect detection system based on image processing, comprising an image processing module, a network training module, a feature extraction module, a collaborative analysis module and a detection analysis module;

[0164] The image processing module acquires a bearing roller image set, preprocesses the bearing roller image to obtain a bearing roller preprocessed image, normalizes the bearing roller preprocessed image to obtain a bearing roller normalized image, and obtains image matrix data based on the bearing roller normalized image;

[0165] The network training module builds a first defect detection pre-training network and a second defect detection pre-training network, and trains the first defect detection pre-training network and the second defect detection pre-training network based on the image matrix data to obtain a first defect detection model and a second defect detection model;

[0166] The feature extraction module obtains a first defect feature through a first defect detection model and obtains a second defect feature through a second defect detection model, wherein the first defect detection model is used for regular defect detection of bearing rollers, and regular defects include dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of bearing rollers, and irregular defects include complex surface flaws and texture anomalies;

[0167] The collaborative analysis module builds a defect detection controller, combines the first defect feature, the second defect feature, the first defect detection model performance parameter and the second defect detection model performance parameter, and obtains the collaborative parameters between the first defect detection model and the second defect detection model;

[0168] The detection and analysis module obtains an initial fusion feature through the first defect feature, the second defect feature and the collaborative parameter, establishes a parameter optimization network and performs training based on the initial fusion feature to obtain a parameter optimization model, processes the initial fusion feature based on the parameter optimization model to obtain defect features, and obtains defect detection results through the defect features.

[0169] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method is implemented:

[0170] Acquire a bearing roller image set, preprocess the bearing roller image to obtain a bearing roller preprocessed image, normalize the bearing roller preprocessed image to obtain a bearing roller normalized image, and obtain image matrix data based on the bearing roller normalized image;

[0171] Building a first defect detection pre-training network and a second defect detection pre-training network, and training the first defect detection pre-training network and the second defect detection pre-training network respectively based on the image matrix data to obtain a first defect detection model and a second defect detection model;

[0172] The first defect feature is obtained by the first defect detection model, and the second defect feature is obtained by the second defect detection model, wherein the first defect detection model is used for regular defect detection of the bearing roller, and the regular defect includes dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of the bearing roller, and the irregular defect includes complex surface flaws and texture anomalies;

[0173] Building a defect detection controller, combining the first defect feature, the second defect feature, the first defect detection model performance parameter, and the second defect detection model performance parameter to obtain a collaboration parameter between the first defect detection model and the second defect detection model;

[0174] An initial fusion feature is obtained through the first defect feature, the second defect feature and the collaborative parameter, a parameter optimization network is established and trained based on the initial fusion feature to obtain a parameter optimization model, the initial fusion feature is processed based on the parameter optimization model to obtain defect features, and defect detection results are obtained through the defect features.

[0175] A bearing roller defect detection device based on image processing comprises a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following method when executing the computer program:

[0176] Acquire a bearing roller image set, preprocess the bearing roller image to obtain a bearing roller preprocessed image, normalize the bearing roller preprocessed image to obtain a bearing roller normalized image, and obtain image matrix data based on the bearing roller normalized image;

[0177] Building a first defect detection pre-training network and a second defect detection pre-training network, and training the first defect detection pre-training network and the second defect detection pre-training network respectively based on the image matrix data to obtain a first defect detection model and a second defect detection model;

[0178] The first defect feature is obtained by the first defect detection model, and the second defect feature is obtained by the second defect detection model, wherein the first defect detection model is used for regular defect detection of the bearing roller, and the regular defect includes dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of the bearing roller, and the irregular defect includes complex surface flaws and texture anomalies;

[0179] Building a defect detection controller, combining the first defect feature, the second defect feature, the first defect detection model performance parameter, and the second defect detection model performance parameter to obtain a collaboration parameter between the first defect detection model and the second defect detection model;

[0180] An initial fusion feature is obtained through the first defect feature, the second defect feature and the collaborative parameter, a parameter optimization network is established and trained based on the initial fusion feature to obtain a parameter optimization model, the initial fusion feature is processed based on the parameter optimization model to obtain defect features, and defect detection results are obtained through the defect features.

[0181] The present invention has significant technical effects due to the adoption of the above technical solution:

[0182] The present invention builds two defect detection networks and realizes information complementarity between networks through feature sharing, thereby realizing the detection of regular defects and irregular defects of bearing rollers. The features obtained from the two detection networks are comprehensively analyzed through weighted fusion and optimization algorithms to improve the accuracy of the detection results. At the same time, the collaborative parameters between the two detection networks are optimized to improve the stability and adaptability of the bearing roller defect detection method. BRIEF DESCRIPTION OF THE DRAWINGS

[0183] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0184] Figure 1 It is a schematic flow diagram of the method of the present invention;

[0185] Figure 2 It is an overall schematic diagram of the system of the present invention. DETAILED DESCRIPTION

[0186] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.

[0187] Embodiment 1:

[0188] A bearing roller defect detection method based on image processing, such as Figure 1 As shown, the following steps are included:

[0189] S100, acquiring a bearing roller image set, preprocessing the bearing roller image to obtain a bearing roller preprocessed image, normalizing the bearing roller preprocessed image to obtain a bearing roller normalized image, and obtaining image matrix data based on the bearing roller normalized image;

[0190] S200, building a first defect detection pre-training network and a second defect detection pre-training network, and training the first defect detection pre-training network and the second defect detection pre-training network respectively based on the image matrix data to obtain a first defect detection model and a second defect detection model;

[0191] S300, obtaining a first defect feature through a first defect detection model, and obtaining a second defect feature through a second defect detection model, wherein the first defect detection model is used for regular defect detection of bearing rollers, and regular defects include dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of bearing rollers, and irregular defects include complex surface flaws and texture anomalies;

[0192] S400, building a defect detection controller, combining the first defect feature, the second defect feature, the first defect detection model performance parameter, and the second defect detection model performance parameter to obtain a collaboration parameter between the first defect detection model and the second defect detection model;

[0193] S500, obtaining an initial fusion feature through the first defect feature, the second defect feature and the collaborative parameter, establishing a parameter optimization network and training based on the initial fusion feature to obtain a parameter optimization model, processing the initial fusion feature based on the parameter optimization model to obtain a defect feature, and obtaining a defect detection result through the defect feature.

[0194] The present invention constructs a first defect detection model and a second defect detection model to detect regular defects and irregular defects in bearing rollers respectively, realizes information complementation through a feature sharing mechanism, and simultaneously establishes a controller to optimize the collaboration parameters between the first defect detection model and the second defect detection model. The first defect feature and the second defect feature are obtained by model reasoning through the first defect detection model and the second defect detection model, and then the defect detection results are obtained by analysis based on the collaboration parameters, the first defect feature and the second defect feature, thereby realizing comprehensive and accurate detection of bearing roller defects.

[0195] In modern industrial manufacturing, bearing rollers are widely used in high-precision mechanical equipment and complex industrial environments. However, as the manufacturing process of bearing rollers becomes increasingly complex, various tiny and difficult-to-detect defects are prone to occur during the production process, such as cracks, pores, shape deviations, and surface flaws. These defects are difficult to detect manually and pose a huge safety hazard to industrial production.

[0196] In the method of the present invention, data acquisition and preprocessing are the basic and critical first steps. High-quality raw data is obtained through data acquisition, and then the quality and consistency of the data are improved through preprocessing and normalization. In this embodiment, a high-resolution multimodal imaging device is used, combined with a multispectral imaging model, to image the bearing roller under multimodal and multispectral conditions to obtain a bearing roller image set, and the bearing roller image is preprocessed and normalized, and based on the normalized bearing roller image, image matrix data is obtained. In this embodiment, the preprocessing uses Fourier transform and wavelet transform to denoise the bearing roller image, and the quality of the bearing roller image is improved by processing the detail information at different frequencies, providing high-quality input data for the detection network to ensure the stability and reliability of the data; the normalization process achieves the consistency of the bearing roller image through pixel value analysis. Among them, the multimodal imaging device includes a visible light imaging device, an infrared imaging device and an X-ray imaging device.

[0197] In this embodiment, the bearing roller image is preprocessed and normalized, including the following steps:

[0198] Step 1: Perform a two-dimensional discrete Fourier transform on the bearing roller image to obtain the bearing roller transformation image, which is expressed as follows:

[0199]

[0200] Step 2: Input the bearing roller transformation image into a low-pass filter for filtering to obtain the bearing roller filter image, which is expressed as follows:

[0201]

[0202] Step 3: Perform time domain conversion on the bearing roller filter image to obtain the bearing roller time domain image, which is expressed as follows:

[0203]

[0204] Step 4: Perform discrete wavelet transform on the time domain image of the bearing roller to obtain the bearing roller detail subband, perform denoising on the bearing roller detail subband by soft threshold or hard threshold method to obtain the bearing roller denoising subband, perform inverse discrete wavelet transform on the bearing roller denoising subband to obtain the further denoised bearing roller preprocessed image, which is expressed as follows:

[0205]

[0206]

[0207]

[0208] Step 5: Analyze the pixel values ​​of the bearing roller preprocessing image to obtain the image pixel value range, and normalize the bearing roller preprocessing image based on the image pixel value range to normalize the pixel values ​​to Within the interval, the normalization processing of the bearing roller image is realized, and the normalized image of the bearing roller is obtained, which is expressed as follows:

[0209]

[0210] in, represents the image of the bearing roller, represents the height of the bearing roller image, represents the width of the bearing roller image, Indicates the height of the pixel position in the bearing roller image, Represents the width of the pixel position in the bearing roller image, represents the number of modalities of a multimodal imaging device, represents the spectral band, Represents the pixel coordinates of the bearing roller image, represents the bearing roller transformation image, represents the bearing roller filtered image, represents a low-pass filter, represents the time domain image of the bearing roller, Represents the bearing roller detail sub-bands at different scales, represents the number of scales, represents the bearing roller denoising subband, represents the threshold value, represents the preprocessed image of the bearing roller, represents the inverse discrete wavelet transform, The normalized image of the bearing roller is shown at point The pixel value of Indicates the preprocessed image of the bearing roller at point The pixel value of represents the minimum pixel value of the preprocessed image of the bearing roller, represents the maximum pixel value of the bearing roller preprocessed image, If, Indicates other.

[0211] The first defect detection pre-training network is constructed and trained based on the image matrix data to obtain the first defect detection model. The first defect detection model is used to detect regular defects in bearing rollers, where regular defects include size deviation and shape distortion, and weight optimization is performed in combination with singular value decomposition to reduce model complexity and improve the computational efficiency of the model. The first defect detection pre-training network includes an input layer, a convolution layer, a pooling layer, a fully connected layer, and an output layer. The input layer receives the image matrix data and obtains multi-channel image data by reorganizing and converting it to a format suitable for the input of the first defect detection pre-training network; the convolution layer extracts the spatial features of the multi-channel image data through multi-layer convolution operations, and the output of the convolution layer is calculated by the input and the convolution kernel, as shown below:

[0212]

[0213] A pooling layer is added after some convolutional layers. The pooling layer reduces the dimension of the data by simulating the human visual system. In essence, it compresses the features and extracts the main features, which helps the model pay more attention to whether certain features exist rather than the specific location of the features. In this embodiment, the maximum pooling method is adopted to achieve data dimensionality reduction by receiving the output of the convolutional layer and extracting the main features to obtain the image pooling features, which are expressed as follows:

[0214]

[0215] The fully connected layer is connected to all neurons in the previous layer, and the high-level features obtained through the convolution layer and the pooling layer are integrated and classified. By learning the complex relationship between the high-level features, the image connection features are obtained, which are expressed as follows:

[0216]

[0217] The output layer converts the internal features of the network, that is, classifies and predicts the image connection features to obtain the first defect feature, which is expressed as follows:

[0218]

[0219] in, Indicates The output of the convolutional layer, Indicates The convolution kernel of the convolution layer, Indicates The bias term of the convolutional layer, represents the activation function, represents the number of convolutional layers, represents the image pooling feature, Indicates The output of the pooling layer, represents the number of pooling layers, represents the maximum pooling operation, represents the image connection feature, represents the weight matrix of the fully connected layer, represents the bias vector, Represents the image pooling features output by the last pooling layer, Indicates the first defect feature.

[0220] After the first defect detection pre-training network is built, the weights of the convolutional layer and the fully connected layer in the first defect detection pre-training network are optimized by the matrix decomposition method of singular value decomposition to reduce the model complexity and improve the calculation efficiency, including the following steps:

[0221] Step 1: Perform singular value decomposition on the convolution kernel of the convolution layer and the weight matrix of the fully connected layer in the first defect detection pre-training network to obtain the convolution singular value decomposition result and the fully connected singular value decomposition result, which are expressed as follows:

[0222]

[0223]

[0224] Step 2: Set the singular threshold, ignore the parts of the convolution singular value decomposition results and the fully connected singular value decomposition results that do not meet the singular threshold, retain the main information of the matrix, ignore the small singular values ​​to achieve matrix dimensionality reduction, and obtain the convolution low-rank approximate matrix and the fully connected low-rank approximate matrix, which are expressed as follows:

[0225]

[0226]

[0227]

[0228] Step 3: Replace the weight matrices of the convolutional layer and the fully connected layer with the convolutional low-rank approximate matrix and the fully connected low-rank approximate matrix respectively to reduce the number of parameters and the amount of calculation. Reduce to , storing weights from Reduce to ;

[0229] in, Indicates The convolution kernel of the convolution layer, represents the convolution left singular vector matrix, represents the convolution singular value diagonal matrix, represents the convolution right singular vector matrix, represents the weight matrix of the fully connected layer, represents the fully connected left singular vector matrix, represents a fully connected singular value diagonal matrix, represents the fully connected right singular vector matrix, represents the convolution low-rank approximation matrix, represents the convolution low-rank left singular vector matrix, represents the convolution low-rank singular value diagonal matrix, represents the convolution low-rank right singular vector matrix, represents a fully connected low-rank approximation matrix, represents a fully connected low-rank left singular vector matrix, represents a fully connected low-rank singular value diagonal matrix, represents the fully connected low-rank right singular vector matrix, represents the singular threshold, Represents the dimensions of the diagonal matrix of singular values.

[0230] A second defect detection pre-training network is constructed and trained based on the image matrix data to obtain a second defect detection model, wherein the second defect detection model is used to detect irregular defects of bearing rollers, and irregular defects include complex surface flaws and texture anomalies of bearing rollers. The second defect detection pre-training network includes an input layer, a graph convolution layer, a graph pooling layer, a fully connected layer, and an output layer. The input layer appropriately reorganizes the received image matrix data and converts it to the format of graph structure input to obtain image node data, for example: the image matrix data is divided into nodes, each node represents the characteristics of a local area, and is expressed as follows:

[0231]

[0232]

[0233]

[0234] The graph convolution layer aggregates the information of the node and its neighbors to update the feature representation of the node, and extracts the local features in the graph structure through the graph convolution operation to obtain the graph convolution feature data, which is expressed as follows:

[0235]

[0236] The graph pooling layer is located after the graph convolution layer, and further extracts the graph convolution feature data, so that the network focuses on the main features of the bearing roller image, which helps feature invariance and reduces the complexity of calculation. The graph pooling feature data is obtained, which is expressed as follows:

[0237]

[0238] The fully connected layer is located after the graph convolution layer and the graph pooling layer. The fully connected layer integrates and classifies the graph pooling feature data to obtain graph connection feature data, which is expressed as follows:

[0239]

[0240] The output layer performs classification and prediction based on the graph connection feature data to obtain the second defect feature, which is expressed as follows:

[0241]

[0242] in, Represents image node data, Represents a collection of nodes. represents the edge set, Indicates The graph convolution feature data output by the graph convolution layer, represents the activation function, represents the normalized adjacency matrix, Indicates The weight matrix of the graph convolution layer, Indicates The bias vector of the graph convolutional layer, Indicates The graph pooling feature data output by the graph pooling layer, represents the graph pooling operation, Represents graph connection feature data, represents the weight matrix of the fully connected layer, represents the bias vector of the fully connected layer, Indicates the second defect characteristic.

[0243] After the second defect detection pre-training network is built, the network parameters of the second defect detection pre-training network are dynamically updated based on the gradient descent method to improve the real-time and adaptability of the second defect detection pre-training network. The gradient descent method optimizes the network parameters through continuous iteration to ensure that the network can quickly adapt to data changes, minimize the defect detection loss function, and improve the prediction accuracy of the network, including the following steps:

[0244] The defect detection loss function is established based on the label of the bearing roller image and the second defect feature, which is expressed as follows:

[0245]

[0246] The gradient of the defect detection loss function for the network parameters in the second defect detection pre-trained network is obtained, and the network parameters are updated by the standard gradient descent algorithm, which is expressed as follows:

[0247]

[0248] Based on the defect detection loss function and the network parameter update strategy, forward propagation, defect detection loss function calculation, back propagation and network parameter update are repeated until the defect detection loss function converges or the preset number of training times is reached;

[0249] in, represents the defect detection loss function, represents the number of bearing roller images, represents the number of defect categories, Labels representing the images of bearing rollers, represents network prediction data, represents the network parameters of the second defect detection pre-trained network, represents the learning rate, Indicates update, represents the updated network parameters of the second defect detection pre-trained network.

[0250] In this embodiment, a feature sharing layer is provided between the first defect detection pre-trained network and the second defect detection pre-trained network. The first defect detection pre-trained network and the second defect detection pre-trained network realize feature sharing after the full connection layer through the feature sharing layer, that is, feature sharing between image connection features and graph connection feature data, allowing the two networks to exchange and utilize the features extracted by each other, and through feature sharing and transmission, the richness of feature expression is improved, the collaborative processing of multi-dimensional defects is realized, and the adaptability of the network to complex scenes and the comprehensive recognition ability of different types of defects are enhanced, including the following steps:

[0251] Step 1: Assume that the first defect detection pre-trained network The image connection features extracted by the fully connected layer are , in the second defect detection pre-trained network The graph connection feature data extracted by the fully connected layer is , by fusing weight parameters , After fusion, the fusion defect features are obtained, which are expressed as follows:

[0252]

[0253] Step 2: The fused defect features are respectively transmitted in the subsequent layers of the first defect detection pre-training network and the second defect detection pre-training network to promote information complementarity and collaborative processing, as shown below:

[0254]

[0255]

[0256] in, , represents the fusion weight parameter, represents the image connection feature, Represents graph connection feature data, Indicates the fusion defect characteristics, represents the first defect detection pre-trained network After layer fusion, represents the first defect detection pre-trained network The original characteristics of the layer, represents the first The features after layer fusion, represents the first The original characteristics of the layer.

[0257] A defect detection controller is built to optimize the collaboration strategy between the first defect detection model and the second defect detection model, and to improve the system's adaptability and performance by adjusting network resource allocation and network priority through real-time feedback.

[0258] In this embodiment, the optimization and learning of the collaborative strategy are realized through the policy gradient method in deep reinforcement learning. Deep reinforcement learning continuously learns the optimal strategy to maximize the cumulative reward through interaction with the environment. Among them, the environment of deep reinforcement learning refers to the entire bearing roller defect detection environment, including data collection, data processing, the first defect detection model, the second defect detection model and feature fusion analysis; the controller of deep reinforcement learning is responsible for optimizing the collaborative strategy of the system; the state of deep reinforcement learning includes the output characteristics of the first defect detection model and the second defect detection model and the system performance indicators; the action of deep reinforcement learning includes adjusting the resource allocation ratio and priority of the network; the reward of deep reinforcement learning adjusts the collaborative strategy according to the feedback of the current state and action; the strategy of deep reinforcement learning selects the probability distribution of deep reinforcement learning actions according to the current state.

[0259] The defect detection controller, the first defect detection model, and the second defect detection model are analyzed and optimized to obtain the cooperation parameters, including the following steps:

[0260] Step 1: Obtain model performance parameters of the first defect detection model and the second defect detection model, obtain detection accuracy, processing time and resource utilization based on the model performance parameters, and construct a state vector of the defect detection controller in combination with the first defect feature and the second defect feature, which is expressed as follows:

[0261]

[0262] Step 2: Setting the initial collaboration strategy, including resource allocation adjustment, priority adjustment and parameter adjustment. The resource allocation adjustment allocates resources to the first defect detection model and the second defect detection model by setting collaboration parameters. The priority adjustment modifies the processing priority to obtain the processing order of the first defect detection model and the second defect detection model when competing for resources.

[0263] The collaboration parameters are expressed as follows:

[0264]

[0265] Step 3: Through the cooperation parameters, the cooperation vector of the defect detection controller is obtained, which is expressed as follows:

[0266]

[0267] Step 4: In this embodiment, based on detection accuracy, processing time and resource utilization, combined with weight coefficients to reflect the importance of each part of the network performance parameters, a reward function for the defect detection controller is established, and positive rewards are given to detection accuracy, that is, the higher the detection accuracy, the greater the reward; negative rewards are given to processing time and resource utilization, that is, the longer the processing time, the higher the resource utilization, and the smaller the reward. At the same time, additional positive rewards and negative rewards can be added to the reward function according to specific needs, such as penalties for false detections, balancing detection accuracy and detection speed, etc., to avoid the optimization of a single indicator leading to a decline in other performance indicators. The reward function is feedback obtained based on the current state and action, which is used to guide the optimization of the strategy. The design of the reward function reflects the overall performance goals of the system. The reward function is expressed as follows:

[0268]

[0269] Step 5: Establish a strategy network, the strategy network includes an input layer, a hidden layer and an output layer, the input layer receives the state vector of the defect detection controller, the hidden layer includes multiple fully connected layers and activation functions to analyze the state vector of the defect detection controller, the output layer outputs the collaboration vector of the defect detection controller based on the collaboration parameter type, and then obtains the collaboration parameter based on the collaboration vector, wherein the collaboration vector is expressed as follows:

[0270]

[0271] in, represents the state vector of the defect detection controller, Indicates the first defect characteristic, Indicates the second defect characteristic, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. , represents the collaboration parameters, represents the cooperation vector of the defect detection controller, represents the reward function of the defect detection controller, , , represents the weight coefficient, represents the policy network, represents the exploration noise, represents the parameters of the policy network, Indicates priority adjustment. Indicates parameter adjustment.

[0272] The policy network is optimized by using a policy gradient method to maximize the reward accumulation. The policy gradient method calculates the gradient of the policy and adjusts the network parameters to increase the reward. The policy gradient method includes the following steps:

[0273] Step 1: Through the interaction of the deep reinforcement learning environment, the state vector, reward function and state vector of the defect detection controller in the next state are obtained, and then the advantage function of the defect detection controller taking actions in a given state is obtained, which is expressed as follows:

[0274]

[0275] Step 2: Based on the advantage function, the policy network parameters are updated using the clipping objective function of the policy gradient method using multiple small batch update methods, as shown below:

[0276]

[0277]

[0278] Step 3: During the parameter update process, continuously monitor the performance indicators and optimize using the Adam optimizer or other optimization algorithms;

[0279] in, represents the advantage function of the initial controller for defect detection in the current state, represents the reward function of the initial controller for defect detection in the current state, represents the discount factor used to calculate the weight of future rewards, represents the value function, represents the optimization step size, represents the state vector of the defect detection controller in the current state, represents the clipping objective function, represents the cutting parameter used to control the step size of the policy update, represents the strategy probability ratio, represents the cooperation vector of the defect detection controller in the current state, represents the policy network, represents the policy network before parameter update, Represents the parameters of the policy network.

[0280] In this embodiment, the first defect detection model, the second defect detection model and the defect detection controller are further included in parameter optimization and dynamic adjustment, wherein the parameter optimization of the first defect detection model and the second defect detection model includes the following steps:

[0281] Step 1: Establish a defect loss function based on classification loss and regularization. Regularization prevents overfitting of the defect detection model by adding an additional penalty term to the loss function of the model, thereby improving the generalization ability of the model. The defect loss function is defined as follows:

[0282]

[0283]

[0284]

[0285] Step 2: Obtain the gradient of the defect loss function for the network parameters in the first defect detection model and the second defect detection model through the back propagation algorithm, which is expressed as follows:

[0286]

[0287] The network parameters and weights in the first defect detection model and the second defect detection model are updated by the standard gradient descent algorithm, and the loss value is calculated based on the defect loss function until the defect detection model converges or reaches the preset number of iterations, which is expressed as follows:

[0288]

[0289]

[0290] in, represents the defect loss function, represents the classification loss, represents the regularization term, represents the regularization coefficient, represents the batch size, represents the number of categories, Indicates The sample The true class label, Indicates The sample The predicted probability of the class, Indicates The weight matrix of the layer, represents the gradient of the defect loss function with respect to the network parameters, represents all trainable parameters in the network, represents the learning rate, Indicates update, represents all trainable parameters in the updated network, Indicates the updated The weight matrix of the layer.

[0291] The defect detection controller is dynamically adjusted by integrating the synaptic plasticity mechanism into the defect detection controller, adjusting the network weight according to real-time feedback, and realizing dynamic adjustment of the collaboration parameters. The collaboration parameters directly affect the resource allocation and operation efficiency of the defect detection model, ensuring flexible response in different defect detection scenarios, and improving detection accuracy and response speed. The synaptic plasticity mechanism is used to simulate the possibility of synaptic connection between biological neurons. The adjustment strategy of the synaptic plasticity mechanism is combined with the strategy network in the defect detection controller, so that the defect detection controller can not only optimize the collaboration strategy between networks, but also affect the weight adjustment in the network, including the following steps:

[0292] Step 1: Obtain the weight adjustment amount through the synaptic plasticity mechanism, update the weight of the policy network of the defect detection controller based on the weight adjustment amount, and control the contribution of synaptic plasticity to the weight update by adjusting the proportional coefficient to avoid excessive parameter adjustment. By combining the weight adjustment amount with the gradient descent update, it can adapt to real-time changes more flexibly and improve the stability and adaptability of the network, as shown below:

[0293]

[0294] Step 2: Obtain the cooperation vector of the defect detection controller through the weight-updated strategy network, obtain the model performance parameters based on the cooperation vector, including detection accuracy, processing time and resource utilization rate, adjust the defect detection controller in real time based on the model performance parameters, obtain the cooperation parameters between the first defect detection model and the second defect detection model, ensure the efficient operation of the model under different input conditions, and adjust the cooperation parameters between the detection models according to the real-time feedback of the detection models to achieve the optimization of the overall performance, as shown below:

[0295]

[0296]

[0297] Step 3: If the real-time adjusted collaboration parameters do not satisfy the constraint condition that the sum is 1, normalization is performed to ensure the effectiveness and rationality of resource allocation through collaboration parameters to avoid excessive concentration or waste of resources. The normalization is expressed as follows:

[0298]

[0299]

[0300] in, represents the parameters of the policy network, represents the learning rate, represents the defect loss function, Indicates the adjustment scale factor, represents the weight adjustment amount, , represents the cooperation parameter between the first defect detection model and the second defect detection model, , represents the adjustment step size, , represents the gradient of detection accuracy with respect to the collaborative parameter, , represents the gradient of processing time with respect to the coordination parameter, Indicates the detection accuracy, Indicates the processing time, Indicates update, represents the parameters of the updated policy network, , The updated cooperation parameter between the first defect detection model and the second defect detection model is represented.

[0301] The first defect detection model and the second defect detection model cooperate through collaborative parameters to ensure that the performance of the defect detection model is optimal in different scenarios. The model performance parameters are optimized through the defect objective function to achieve a balance between detection accuracy, processing time and resource utilization. The first defect feature and the second defect feature are weightedly fused, and error minimization optimization is performed based on the parameter optimization network to continuously improve the performance and adaptability of the entire defect detection model, achieve high-precision and robust bearing roller defect detection, and improve the reliability and practicality of the method in complex and changeable industrial environments. At the same time, the model performance parameters are optimized to achieve effective control of computing resource consumption, including the following steps:

[0302] Step 1: Perform weighted fusion on the first defect feature and the second defect feature based on the collaborative parameter to obtain the initial fusion feature, which is expressed as follows:

[0303]

[0304] Step 2: Based on the performance results of the defect detection model, the detection accuracy, processing time and resource utilization are obtained, and a defect objective function is established. The defect objective function maximizes the detection accuracy of the defect detection model while controlling the processing time and resource utilization of the defect detection model, as shown below:

[0305]

[0306] Step 3: Based on the collaborative parameters, the defect objective function is optimized by a particle swarm optimization algorithm until convergence, wherein the particle swarm optimization algorithm is expressed as follows:

[0307]

[0308]

[0309] Step 4: Predict through the initial fusion features to obtain the network defect label. Through the network defect label and the real defect label, the network defect label is adjusted to minimize the error to ensure that the error between the final detection result and the real defect label is as small as possible. In this embodiment, the defect error function is established based on the mean square error, which is expressed as follows:

[0310]

[0311] Step 5: Through the back propagation mechanism, adjust the error between the network defect label and the real defect label to make the error as small as possible, and based on the defect error function, train and adjust the collaboration parameters between the first defect detection model and the second defect detection model, as shown below:

[0312]

[0313]

[0314] Step 6: If the collaborative parameters of the defect detection controller after training and adjustment do not satisfy the constraint that the sum is 1, normalization is performed, as shown below:

[0315]

[0316]

[0317] in, represents the initial fusion feature, , represents the coordination parameters of the defect detection controller, Indicates the first defect characteristic, Indicates the second defect characteristic, represents the defect objective function, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. , , represents the weight coefficient, , represents the learning factor, , represents a random number, and , Range is , Indicates your best position. represents the global optimal position, represents the optimization step size, represents the defect error function, represents the number of samples in the bearing roller image set, Indicates the network defect label, represents the true label of the defect, , represents the learning rate, Indicates update, , The updated cooperation parameter between the first defect detection model and the second defect detection model is represented.

[0318] At the same time, in this embodiment, in order to ensure the robustness and adaptability of the defect detection method in long-term operation, it can automatically detect and repair potential problems during operation, adapt to different environments and complex defect scenarios, and achieve continuous optimization through global optimization algorithms and model performance parameters. While improving the adaptive ability and overall method performance, the detection method can be run efficiently through continuous optimization, including the following steps:

[0319] Step 1: Establish a comprehensive objective function based on model performance parameters, which include detection accuracy, processing time, and resource utilization. The comprehensive objective function is designed to minimize detection error, processing time, and resource utilization, as shown below:

[0320]

[0321] Step 2: In this embodiment, the global optimization algorithm includes a simulated annealing algorithm, a genetic algorithm, and a particle swarm optimization algorithm. The simulated annealing algorithm simulates the physical annealing process and searches for the global optimal solution by gradually reducing the "temperature". It is suitable for solving complex and multi-peak optimization problems. The genetic algorithm selects individuals for reproduction by fitness and generates new individuals based on crossover operations. By randomly mutating the new individuals, a new population is formed and the old population is replaced. The above process simulates natural selection and genetic mechanisms, and searches for the optimal solution by population purification. It is suitable for large-scale search space and multi-objective optimization. The particle swarm optimization simulates the foraging behavior of bird flocks and searches for the optimal solution by information sharing between particles. It is suitable for continuous optimization problems. This method has a faster convergence speed.

[0322] The simulated annealing algorithm comprises the following steps:

[0323] Set the initial temperature and update the temperature based on the cooling coefficient, as shown below:

[0324]

[0325] The rate of change of the comprehensive objective function is obtained, and the temperature reduction coefficient is adjusted based on the rate of change of the comprehensive objective function to control the change speed of the initial temperature, which is expressed as follows:

[0326]

[0327]

[0328] Based on the initial temperature and the updated temperature obtained after the temperature update, the comprehensive objective function change rate is obtained. Through the objective function change rate and the initial temperature, the updated acceptance probability is obtained. The comprehensive objective function is updated based on the updated acceptance probability. The acceptance probability is expressed as follows:

[0329]

[0330] The genetic algorithm randomly generates a population and calculates the fitness of each individual in the population, selects individuals according to the fitness and re-pairs them to generate offspring individuals, mutates the offspring individuals and changes the current population, and iterates until a convergence condition is reached;

[0331] The particle swarm optimization algorithm includes speed update and position update, which are expressed as follows:

[0332]

[0333]

[0334] in, represents the comprehensive objective function, , , represents the comprehensive weight coefficient, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. No. The rate of change of the comprehensive objective function of the iteration, Indicates the speed of change, , Indicates the preset change threshold, , , Indicates fast, slow, and normal cooling coefficients. , represents the probability of acceptance, Indicates The temperature of the iteration, Represents particles In the The speed of iterations, Represents particles In the The position of the iteration, represents the inertia weight, , is the acceleration constant, , Represents a random number, Represents particles The best location in history, represents the global optimal position, If, Indicates other;

[0335] Step 3: Set the detection cycle , each interval detection cycle Evaluate the performance of the defect detection model and set the performance threshold reasonably according to the actual application requirements and performance requirements. , ensuring that the system can respond promptly when performance anomalies occur, and evaluating model performance parameters based on the detection cycle to ensure that the optimization of the model is comprehensive and balanced. , the first defect detection model and the second defect detection model are repaired, and the model repair process is added to the log file for recording, including the trigger time, adjustment measures and performance changes. If model repair occurs frequently, the alarm mechanism is triggered to remind the maintenance personnel to check, and after the repair is completed, the repair results are fed back to the first defect detection model and the second defect detection model.

[0336] The model repair adopted in this embodiment includes one or more of network parameter initialization, network optimization method adjustment, modification of regularization coefficient and network retraining. Among them, when the model performance declines, the network parameter initialization partially or fully initializes the defect detection model parameters, and retrains the model to help the defect detection model jump out of the state of being trapped in the local optimal state and re-explore a better parameter space; the network optimization method adjusts the parameters of the optimization algorithm according to the current model performance parameters, such as the learning rate and the type of optimization algorithm, which helps to adapt to the current needs and status and improve the optimization effect; modifying the regularization coefficient can prevent the model from overfitting, improve the generalization ability of the model, and stabilize the training process of the model, which helps to reduce parameter fluctuations and improve the stability of the system; when the model performance parameters decline, the model can be effectively adjusted through network retraining, which effectively solves the performance degradation problem of the model in long-term operation.

[0337] In this embodiment, the model performance parameters are obtained to analyze the model performance, wherein the model performance parameters include detection accuracy, processing time and resource utilization. At the same time, this embodiment provides a method for calculating the model performance parameters, wherein the detection accuracy is obtained by analyzing the model detection results based on the true positive data, false positive data and false negative data in the model detection results, and is expressed as follows:

[0338]

[0339] The processing time is obtained by obtaining the current processing time and the number of samples of the bearing roller image set and analyzing them, and is expressed as follows:

[0340]

[0341] The resource utilization rate is obtained by obtaining the number of resource types and the corresponding utilization rates, and analyzing based on the number of resource types and the corresponding utilization rates. The resource types include CPU, GPU, memory, etc., as shown below:

[0342]

[0343] in, Indicates the detection accuracy, represents true positive data, represents false positive data, represents false negative data, Indicates the processing time, represents the number of samples in the bearing roller image set, Indicates The processing time of a bearing roller image, Indicates resource utilization. Indicates the number of resource types. Indicates The utilization rate of a resource.

[0344] This method constructs a first defect detection model and a second defect detection model, analyzes the collaborative parameters between the detection models, and periodically analyzes the model performance parameters, thereby realizing an efficient, stable and highly adaptive defect detection method. It can achieve high-precision bearing roller defect detection in industrial production with complex and changeable environments, and has broad application prospects in the field of industrial production.

[0345] Embodiment 2:

[0346] A bearing roller defect detection system based on image processing, such as Figure 2 As shown, it includes an image processing module 100, a network training module 200, a feature extraction module 300, a collaborative analysis module 400 and a detection analysis module 500;

[0347] The image processing module 100 acquires a set of bearing roller images, preprocesses the bearing roller images to obtain bearing roller preprocessed images, normalizes the bearing roller preprocessed images to obtain bearing roller normalized images, and obtains image matrix data based on the bearing roller normalized images;

[0348] The network training module 200 builds a first defect detection pre-training network and a second defect detection pre-training network, and trains the first defect detection pre-training network and the second defect detection pre-training network based on the image matrix data to obtain a first defect detection model and a second defect detection model;

[0349] The feature extraction module 300 obtains a first defect feature through a first defect detection model and obtains a second defect feature through a second defect detection model, wherein the first defect detection model is used for regular defect detection of bearing rollers, and regular defects include dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of bearing rollers, and irregular defects include complex surface flaws and texture anomalies;

[0350] The collaborative analysis module 400 builds a defect detection controller, combines the first defect feature, the second defect feature, the first defect detection model performance parameter and the second defect detection model performance parameter, and obtains the collaborative parameters between the first defect detection model and the second defect detection model;

[0351] The detection and analysis module 500 obtains an initial fusion feature through the first defect feature, the second defect feature and the collaborative parameter, establishes a parameter optimization network and performs training based on the initial fusion feature to obtain a parameter optimization model, processes the initial fusion feature based on the parameter optimization model to obtain a defect feature, and obtains a defect detection result through the defect feature.

[0352] Various changes and modifications can be made without departing from the spirit and scope of the present invention, and all equivalent technical solutions also belong to the scope of the present invention.

[0353] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0354] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0355] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0356] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0357] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0358] It should be noted that:

[0359] The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.

[0360] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A bearing roller defect detection method based on image processing, characterized in that: The following steps are involved: Acquire a bearing roller image set, preprocess the bearing roller image to obtain a bearing roller preprocessed image, normalize the bearing roller preprocessed image to obtain a bearing roller normalized image, and obtain image matrix data based on the bearing roller normalized image; Building a first defect detection pre-training network and a second defect detection pre-training network, and training the first defect detection pre-training network and the second defect detection pre-training network respectively based on the image matrix data to obtain a first defect detection model and a second defect detection model; The first defect feature is obtained by the first defect detection model, and the second defect feature is obtained by the second defect detection model, wherein the first defect detection model is used for regular defect detection of the bearing roller, and the regular defect includes dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of the bearing roller, and the irregular defect includes complex surface flaws and texture anomalies; Building a defect detection controller, combining the first defect feature, the second defect feature, the first defect detection model performance parameter, and the second defect detection model performance parameter to obtain a collaboration parameter between the first defect detection model and the second defect detection model; An initial fusion feature is obtained through the first defect feature, the second defect feature and the collaborative parameter, a parameter optimization network is established and trained based on the initial fusion feature to obtain a parameter optimization model, the initial fusion feature is processed based on the parameter optimization model to obtain defect features, and defect detection results are obtained through the defect features.

2. The bearing roller defect detection method based on image processing according to claim 1 is characterized in that: The bearing roller image set is obtained by scanning the bearing roller under multi-spectral bands using a multi-modal imaging device; The multimodal imaging device includes a visible light imaging device, an infrared imaging device and an X-ray imaging device.

3. The bearing roller defect detection method based on image processing according to claim 1 is characterized in that: The preprocessing of the bearing roller image to obtain the bearing roller preprocessed image comprises the following steps: Perform a two-dimensional discrete Fourier transform on the bearing roller image to obtain the bearing roller transformation image, which is expressed as follows: The bearing roller transformation image is input into a low-pass filter for filtering, and the bearing roller filter image is obtained, which is expressed as follows: The bearing roller filter image is converted into time domain to obtain the bearing roller time domain image, which is expressed as follows: The time domain image of the bearing roller is subjected to discrete wavelet transform to obtain the bearing roller detail subband, the bearing roller detail subband is subjected to denoising to obtain the bearing roller denoising subband, and the bearing roller denoising subband is subjected to inverse discrete wavelet transform to obtain the bearing roller preprocessing image, which is expressed as follows: in, represents the image of the bearing roller, represents the height of the bearing roller image, represents the width of the bearing roller image, Indicates the height of the pixel position in the bearing roller image, Represents the width of the pixel position in the bearing roller image, represents the number of modalities of a multimodal imaging device, represents the spectral band, Represents the pixel coordinates of the bearing roller image, represents the bearing roller transformation image, represents the bearing roller filtered image, represents a low-pass filter, represents the time domain image of the bearing roller, Represents the bearing roller detail sub-bands at different scales, represents the number of scales, represents the bearing roller denoising subband, represents the threshold value, represents the preprocessed image of the bearing roller, represents the inverse discrete wavelet transform, If, Indicates other.

4. The bearing roller defect detection method based on image processing according to claim 1 is characterized in that: The normalizing the preprocessed image of the bearing roller to obtain the normalized image of the bearing roller comprises the following steps: Analyze the pixel values ​​of the preprocessed image of the bearing roller to obtain the image pixel value range; The preprocessed image of the bearing roller is normalized based on the image pixel value range to obtain the normalized image of the bearing roller, which is expressed as follows: in, Indicates the height of the pixel position in the bearing roller image, Represents the width of the pixel position in the bearing roller image, The normalized image of the bearing roller is shown at point The pixel value of The preprocessed image of the bearing roller is shown at point The pixel value of represents the minimum pixel value of the preprocessed image of the bearing roller, Indicates the maximum pixel value of the preprocessed image of the bearing roller.

5. The bearing roller defect detection method based on image processing according to claim 1 is characterized in that: The first defect detection pre-trained network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer; The input layer receives image matrix data, and reorganizes and transforms the image matrix data to obtain multi-channel image data; The convolution layer extracts the spatial features of multi-channel image data based on the convolution kernel, which is expressed as follows: The pooling layer receives the output of the convolution layer and performs dimensionality reduction by extracting the main features to obtain the image pooling features, which are expressed as follows: The fully connected layer integrates and classifies the image pooling features to obtain image connection features, which are expressed as follows: The output layer classifies and predicts the image connection features to obtain the first defect feature, which is expressed as follows: in, Indicates The output of the convolutional layer, Indicates The convolution kernel of the convolution layer, Indicates The bias term of the convolutional layer, represents the activation function, represents the number of convolutional layers, represents the image pooling feature, Indicates The output of the pooling layer, represents the number of pooling layers, represents the maximum pooling operation, represents the image connection feature, represents the weight matrix of the fully connected layer, represents the bias vector, Represents the image pooling features output by the last pooling layer, Indicates the first defect feature.

6. The bearing roller defect detection method based on image processing according to claim 5 is characterized in that: It also includes weight optimization of convolutional layers and fully connected layers based on singular value decomposition, including the following steps: Perform singular value decomposition on the convolution kernel of the convolution layer and the weight matrix of the fully connected layer to obtain the convolution singular value decomposition results and the fully connected singular value decomposition results, which are expressed as follows: Set the singular threshold, retain the convolution singular value decomposition results and the fully connected singular value decomposition results that meet the singular threshold in the singular value decomposition results, and obtain the convolution low-rank approximate matrix and the fully connected low-rank approximate matrix, which are expressed as follows: The weight matrices of the convolutional layer and the fully connected layer are replaced by the convolutional low-rank approximate matrix and the fully connected low-rank approximate matrix respectively; in, Indicates The convolution kernel of the convolution layer, represents the convolution left singular vector matrix, represents the convolution singular value diagonal matrix, represents the convolution right singular vector matrix, represents the weight matrix of the fully connected layer, represents the fully connected left singular vector matrix, represents a fully connected singular value diagonal matrix, represents the fully connected right singular vector matrix, represents the convolution low-rank approximation matrix, represents the convolution low-rank left singular vector matrix, represents the convolution low-rank singular value diagonal matrix, represents the convolution low-rank right singular vector matrix, represents a fully connected low-rank approximation matrix, represents a fully connected low-rank left singular vector matrix, represents a fully connected low-rank singular value diagonal matrix, represents the fully connected low-rank right singular vector matrix, represents the singular threshold, Represents the dimensions of the diagonal matrix of singular values.

7. The bearing roller defect detection method based on image processing according to claim 1 is characterized in that: The second defect detection pre-trained network includes an input layer, a graph convolution layer, a graph pooling layer, a fully connected layer and an output layer; The input layer obtains image matrix data and converts the image matrix data into the input format of the graph structure to obtain image node data, which is expressed as follows: The graph convolution layer extracts local features in the graph structure through graph convolution operations to obtain graph convolution feature data, which is expressed as follows: The graph pooling layer is located after the graph convolution layer, and further extracts the graph convolution feature data to obtain the graph pooling feature data, which is expressed as follows: The fully connected layer is located after the graph convolution layer and the graph pooling layer. The fully connected layer integrates and classifies the graph pooling feature data to obtain graph connection feature data, which is expressed as follows: The output layer performs classification and prediction based on the graph connection feature data to obtain the second defect feature, which is expressed as follows: in, Represents image node data, Represents a collection of nodes. represents the edge set, Indicates The graph convolution feature data output by the graph convolution layer, represents the activation function, represents the normalized adjacency matrix, Indicates The weight matrix of the graph convolution layer, Indicates The bias vector of the graph convolutional layer, Indicates The graph pooling feature data output by the graph pooling layer, represents the graph pooling operation, Represents graph connection feature data, represents the weight matrix of the fully connected layer, represents the bias vector of the fully connected layer, Indicates the second defect characteristic.

8. The bearing roller defect detection method based on image processing according to claim 7 is characterized in that: The method also includes updating the network parameters of the second defect detection pre-trained network based on the gradient descent method, including the following steps: The defect detection loss function is established based on the label of the bearing roller image and the second defect feature, which is expressed as follows: The gradient of the defect detection loss function for the network parameters in the second defect detection pre-trained network is obtained, and the network parameters are updated by the standard gradient descent algorithm, which is expressed as follows: Based on the defect detection loss function and network parameter update strategy, forward propagation, defect detection loss function calculation, back propagation and network parameter update are repeated until convergence; in, represents the defect detection loss function, represents the number of bearing roller images, represents the number of defect categories, Labels representing the images of bearing rollers, represents network prediction data, represents the network parameters of the second defect detection pre-trained network, represents the learning rate, Indicates update, represents the updated network parameters of the second defect detection pre-trained network.

9. The bearing roller defect detection method based on image processing according to claim 1, characterized in that: The feature sharing layer is used to share and transfer the image connection features and graph connection feature data obtained by the fully connected layer in the first defect detection pre-training network and the second defect detection pre-training network, and includes the following steps: The image connection feature and graph connection feature data are fused by fusion weight parameters to obtain the fusion defect feature, which is expressed as follows: The fused defect features are passed to the subsequent layers of the first defect detection pre-training network and the second defect detection pre-training network, respectively, as shown below: in, , represents the fusion weight parameter, represents the image connection feature, Represents graph connection feature data, Indicates the fusion defect characteristics, represents the first defect detection pre-trained network The features after layer fusion, represents the first defect detection pre-trained network The original characteristics of the layer, represents the first The features after layer fusion, represents the first The original characteristics of the layer.

10. The bearing roller defect detection method based on image processing according to claim 1, characterized in that: The step of obtaining the collaboration parameters between the first defect detection model and the second defect detection model comprises the following steps: Respectively obtaining a first defect detection model performance parameter and a second defect detection model performance parameter, wherein the model performance parameters include detection accuracy, processing time, and resource utilization rate; The state vector of the defect detection controller is constructed by the first defect feature, the second defect feature, the detection accuracy, the processing time and the resource utilization rate, which is expressed as follows: Setting an initial collaboration strategy, including resource allocation adjustment, priority adjustment and parameter adjustment, wherein the resource allocation adjustment allocates resources to the first defect detection pre-trained network and the second defect detection pre-trained network by setting collaboration parameters, and the priority adjustment obtains the processing order of the first defect detection pre-trained network and the second defect detection pre-trained network when competing for resources by modifying the processing priority; The collaboration parameters are expressed as follows: Through the cooperation parameters, the cooperation vector of the defect detection controller is obtained, which is expressed as follows: Based on detection accuracy, processing time and resource utilization, the reward function of the defect detection controller is established, which is expressed as follows: A strategy network is established, wherein the strategy network includes an input layer, a hidden layer, and an output layer. The input layer receives a state vector of a defect detection controller, and the hidden layer includes multiple fully connected layers and an activation function. The state vector of the defect detection controller is analyzed. The output layer outputs a collaboration vector of the defect detection controller based on a collaboration parameter type, and then the collaboration parameters between the first defect detection model and the second defect detection model are obtained based on the collaboration vector. The collaboration vector is expressed as follows: in, represents the state vector of the defect detection controller, Indicates the first defect characteristic, Indicates the second defect characteristic, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. , represents the collaboration parameters, represents the cooperation vector of the defect detection controller, represents the reward function of the defect detection controller, , , represents the weight coefficient, represents the policy network, represents the exploration noise, represents the parameters of the policy network, Indicates priority adjustment. Indicates parameter adjustment.

11. The bearing roller defect detection method based on image processing according to claim 10, characterized in that: The policy network is further optimized by a policy gradient method, wherein the policy gradient method comprises the following steps: Based on the state vector, reward function and state vector of the defect detection controller in the given state, the advantage function of the defect detection controller in the given state is obtained, which is expressed as follows: Based on the advantage function, the policy network parameters are updated by cutting the objective function of the policy gradient method using multiple small batch update methods, as shown below: in, represents the advantage function of the defect detection controller in the current state, represents the reward function of the defect detection controller in the current state, represents the discount factor, represents the value function, represents the optimization step size, represents the state vector of the defect detection controller in the current state, represents the clipping objective function, represents the shearing parameter, represents the strategy probability ratio, represents the cooperation vector of the defect detection controller in the current state, represents the policy network, represents the policy network before parameter update, Represents the parameters of the policy network.

12. The bearing roller defect detection method based on image processing according to claim 1, characterized in that: It also includes optimizing and adjusting the first defect detection model, the second defect detection model and the defect detection controller, including the following steps: Based on classification loss and regularization, the defect loss function is defined as follows: The gradient of the defect loss function for the network parameters in the first defect detection model and the second defect detection model is obtained through the back propagation algorithm, which is expressed as follows: The network parameters and weights in the first defect detection model and the second defect detection model are updated by the standard gradient descent algorithm to obtain the optimized first defect detection model and the second defect detection model, which are expressed as follows: Performing feedback optimization on the defect detection controller based on the optimized first defect detection model and the second defect detection model; in, represents the defect loss function, represents the classification loss, represents the regularization term, represents the regularization coefficient, represents the batch size, represents the number of categories, Indicates The sample The true class label, Indicates The sample The predicted probability of the class, Indicates The weight matrix of the layer, represents the gradient of the defect loss function with respect to the network parameters, Indicates update, represents all trainable parameters in the network, represents all updated trainable parameters in the network, Indicates the updated The weight matrix of the layer, Represents the learning rate.

13. The bearing roller defect detection method based on image processing according to claim 12, characterized in that: The feedback optimization of the defect detection controller comprises the following steps: The weight adjustment amount is obtained through the synaptic plasticity mechanism, and the weight of the strategy network of the defect detection controller is updated based on the weight adjustment amount, which is expressed as follows: Based on the updated defect detection controller, the first defect detection model performance parameter and the second defect detection model performance parameter are obtained, and the cooperation parameter is feedback-adjusted by the first defect detection model performance parameter and the second defect detection model performance parameter, which is expressed as follows: If the feedback-adjusted collaboration parameters do not satisfy the constraint condition that the sum is 1, normalization processing is performed, and the normalization processing is expressed as follows: in, represents the parameters of the policy network, represents the learning rate, represents the defect loss function, Indicates the adjustment scale factor, represents the weight adjustment amount, , represents the cooperation parameter between the first defect detection model and the second defect detection model, , represents the adjustment step size, , represents the gradient of detection accuracy with respect to the collaborative parameter, , represents the gradient of processing time with respect to the coordination parameter, Indicates the detection accuracy, Indicates the processing time, Indicates update, represents the parameters of the updated policy network, , The updated cooperation parameter between the first defect detection model and the second defect detection model is represented.

14. The bearing roller defect detection method based on image processing according to claim 1, characterized in that: The step of establishing a parameter optimization network and training based on the initial fusion features includes the following steps: Based on the cooperation parameters between the first defect detection model and the second defect detection model, the first defect feature and the second defect feature are fused to obtain an initial fusion feature, which is expressed as follows: Obtain the detection accuracy, processing time and resource utilization, and establish the defect objective function, which is expressed as follows: Based on the collaborative parameters, the defect objective function is optimized by a particle swarm optimization algorithm until convergence, wherein the particle swarm optimization algorithm is expressed as follows: The network defect label is obtained by predicting the initial fusion features. The defect error function is established based on the mean square error through the network defect label and the real defect label, which is expressed as follows: Through the back propagation mechanism, based on the defect error function, the cooperation parameters between the first defect detection model and the second defect detection model are trained and adjusted, as shown below: If the collaborative parameters of the defect detection controller after training and adjustment do not satisfy the constraint that the sum is 1, normalization is performed, which is expressed as follows: in, represents the initial fusion feature, , represents the coordination parameters of the defect detection controller, Indicates the first defect characteristic, Indicates the second defect characteristic, represents the defect objective function, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. , , represents the weight coefficient, , represents the learning factor, , represents a random number, and , Range is , Indicates your best position. represents the global optimal position, represents the optimization step size, represents the defect error function, represents the number of samples in the bearing roller image set, Indicates the network defect label, represents the true label of the defect, , represents the learning rate, Indicates update, , The updated cooperation parameter between the first defect detection model and the second defect detection model is represented.

15. The bearing roller defect detection method based on image processing according to claim 1, characterized in that: It also includes optimization through a global optimization algorithm and model performance parameters, including the following steps: A comprehensive objective function is established based on the model performance parameters, which include detection accuracy, processing time, and resource utilization, as shown below: The global optimization algorithm includes a simulated annealing algorithm, a genetic algorithm, and a particle swarm optimization algorithm. The simulated annealing algorithm includes the following steps: Set the initial temperature and update the temperature based on the cooling coefficient, as shown below: The rate of change of the comprehensive objective function is obtained, and the temperature reduction coefficient is adjusted based on the rate of change of the comprehensive objective function to control the change speed of the initial temperature, which is expressed as follows: Based on the initial temperature and the updated temperature obtained after the temperature update, the comprehensive objective function change rate is obtained. Through the objective function change rate and the initial temperature, the updated acceptance probability is obtained. The comprehensive objective function is updated based on the updated acceptance probability. The acceptance probability is expressed as follows: The genetic algorithm randomly generates a population and calculates the fitness of each individual in the population, selects individuals according to the fitness and re-pairs them to generate offspring individuals, mutates the offspring individuals and changes the current population, and iterates until convergence; The particle swarm optimization algorithm includes speed update and position update, which are expressed as follows: in, represents the comprehensive objective function, , , represents the comprehensive weight coefficient, Indicates the detection accuracy, Indicates the processing time, Indicates resource utilization. No. The rate of change of the comprehensive objective function of the iteration, Indicates the speed of change, , Indicates the preset change threshold, , , Indicates fast, slow, and normal cooling coefficients. , represents the probability of acceptance, Indicates The temperature of the iteration, Represents particles In the The speed of iterations, Represents particles In the The position of the iteration, represents the inertia weight, , is the acceleration constant, , Represents a random number, Represents particles The best location in history, represents the global optimal position, If, Indicates other.

16. The bearing roller defect detection method based on image processing according to claim 1, characterized in that: The detection accuracy is obtained by analyzing the model detection results based on the true positive data, false positive data and false negative data in the model detection results, and is expressed as follows: The processing time is obtained by obtaining the current processing time and the number of samples of the bearing roller image set and analyzing them, and is expressed as follows: The resource utilization rate is obtained by obtaining the number of resource types and the corresponding utilization rates, and is analyzed based on the number of resource types and the corresponding utilization rates, and is expressed as follows: in, Indicates the detection accuracy, represents true positive data, represents false positive data, represents false negative data, Indicates the processing time, represents the number of samples in the bearing roller image set, Indicates The processing time of a bearing roller image, Indicates resource utilization. Indicates the number of resource types. Indicates The utilization rate of a resource.

17. A bearing roller defect detection system based on image processing, characterized in that: It includes image processing module, network training module, feature extraction module, collaborative analysis module and detection analysis module; The image processing module acquires a bearing roller image set, preprocesses the bearing roller image to obtain a bearing roller preprocessed image, normalizes the bearing roller preprocessed image to obtain a bearing roller normalized image, and obtains image matrix data based on the bearing roller normalized image; The network training module builds a first defect detection pre-training network and a second defect detection pre-training network, and trains the first defect detection pre-training network and the second defect detection pre-training network based on the image matrix data to obtain a first defect detection model and a second defect detection model; The feature extraction module obtains a first defect feature through a first defect detection model and obtains a second defect feature through a second defect detection model, wherein the first defect detection model is used for regular defect detection of bearing rollers, and regular defects include dimensional deviation and shape distortion, and the second defect detection model is used for irregular defect detection of bearing rollers, and irregular defects include complex surface flaws and texture anomalies; The collaborative analysis module builds a defect detection controller, combines the first defect feature, the second defect feature, the first defect detection model performance parameter and the second defect detection model performance parameter, and obtains the collaborative parameters between the first defect detection model and the second defect detection model; The detection and analysis module obtains an initial fusion feature through the first defect feature, the second defect feature and the collaborative parameter, establishes a parameter optimization network and performs training based on the initial fusion feature to obtain a parameter optimization model, processes the initial fusion feature based on the parameter optimization model to obtain defect features, and obtains defect detection results through the defect features.

18. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 16 is implemented.

19. A bearing roller defect detection device based on image processing, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 16 is implemented.

Citation Information

Patent Citations

  • Defect detection method and device of defect generation mode based on Bessel function

    CN118247212A

  • Cardiovascular stent defect detection method based on image recognition

    CN118736277A

Cited By

  • A cross-roller bearing punching processing defect detection system

    CN122780207A