Image processing method and system for industrial inspection

By combining preset general network and initial preprocessing network, using common features of defect types, the construction process of industrial detection image processing models is simplified, and the model construction efficiency and training speed are improved.

CN119380083BActive Publication Date: 2025-08-22GUANGDONG ACADEMY OF SCIENCES CERTIFICATION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411411180.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-08-22
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

The existing artificial intelligence model used for image processing for industrial detection is not efficient in building, it takes a lot of time and human resources, and it fails to fully utilize the commonalities of defect types.

Method used

Using a combination of preset general network and initial preprocessing network, the initial preprocessing network is trained through preset data sets, the target defect identification network is established, and the common characteristics of defect types are used to simplify the model construction process.

Benefits of technology

It improves model construction efficiency, reduces the complexity of data preparation and training time, and achieves efficient defect recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119380083B_ABST
    Figure CN119380083B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence neural network technology, and specifically to an image processing method and system applied to industrial inspection, which first obtains a preset general network, then establishes an initial preprocessing network, and trains the initial preprocessing network to obtain an optimized preprocessing network, and then connects the optimized preprocessing network and the preset general network to establish a target defect recognition network for industrial inspection image processing. Compared with the existing technology, the preset general network in the present invention is mainly used to analyze the common characteristics of defects in industrial inspection, while the initial preprocessing network and the optimized preprocessing network are used to analyze the specific characteristics of different scenarios. This means that in practice, people only need to train the initial processing model to complete the construction of the entire target defect recognition network, making full use of the common characteristics of defect types, and solving the problem of low efficiency in the construction of existing artificial intelligence models for image processing applied to industrial inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence neural network technology, and in particular to an image processing method and system applied to industrial detection. Background Art

[0002] Artificial intelligence image processing technology is gaining popularity in the field of industrial inspection. Its core strategy is to use deep learning algorithms, particularly neural networks, to identify and classify defects in product images. Currently, the commonly used approach is to build and train complex neural network models to detect defects on product surfaces.

[0003] In practical applications, while inspection requirements vary across different fields, the types of defects encountered often share certain commonalities. For example, stains, cracks, and edge burrs are common across various fields and scenarios; in practice, only the specific carriers and scenarios in which they appear vary.

[0004] However, existing techniques typically involve rebuilding and training a complete neural network model for a specific situation. This not only requires collecting and preparing datasets, but also involves a tedious debugging process, consuming significant time and human resources. More critically, this approach fails to fully exploit the commonalities among defect types, resulting in inefficient model building. Therefore, a more efficient image processing method for industrial inspection applications is needed. Summary of the Invention

[0005] The purpose of the present invention is to provide an image processing method and system for industrial inspection to solve the following technical problems:

[0006] The existing artificial intelligence model construction efficiency of image processing applied to industrial inspection is not high.

[0007] The purpose of the present invention can be achieved through the following technical solutions:

[0008] An image processing method for industrial inspection includes the following steps:

[0009] Obtaining a preset universal network, where the preset universal network is used to identify the defect type of the defect image according to the defect image;

[0010] Obtain an initial preprocessing network, which is used to input the original image and output a context vector. The length of the context vector is the same as the length of the input vector of the preset general network;

[0011] Train the initial preprocessing network based on the preset data set to obtain a trained optimized preprocessing network;

[0012] Connect the optimized preprocessing network and the preset general network to establish the target defect recognition network:

[0013] Industrial inspection image processing based on target defect recognition network.

[0014] As a further solution of the present invention: a preset data set includes multiple original images and a defect type corresponding to each original image; an initial preprocessing network is trained based on the preset data set to obtain a trained optimized preprocessing network, including:

[0015] Based on the defect type, establish the true label corresponding to each original image;

[0016] Input the original image into the initial preprocessing network to obtain the output original context vector;

[0017] Inputting the original context vector into a preset universal network, and establishing a first loss function based on the true label and the output result of the preset universal network;

[0018] Calculate the partial derivative of the first loss function for each element in the context vector as the deviation of each element in the original context vector;

[0019] Perform a backpropagation optimization on the initial preprocessing network based on the deviation amount.

[0020] As a further solution of the present invention: a preset universal network includes a logical output layer and a normalization layer connected in sequence, the logical output layer is used to output a probability logical value of each defect type, the probability logical value is used to represent the probability that the input defect image is a defect type, and the normalization layer is used to normalize the multiple probability logical values ​​output by the logical output layer and output the output result of the preset universal network; the original context vector is input into the preset universal network, and based on the true label, a first loss function is established according to the output result of the preset universal network, including:

[0021] Input the original context vector into the preset universal network to obtain multiple original probability logic values ​​output by the logic output layer;

[0022] Get a preset scaling factor, which is used to increase the difference between the normalized values ​​of multiple original probability logic values;

[0023] Based on a preset scaling factor, a normalization layer normalizes multiple original probability logic values ​​and outputs the original output result;

[0024] The first loss function is established based on the difference between the original output result and the true label.

[0025] As a further solution of the present invention: the expression corresponding to the normalization layer is:

[0026]

[0027] Among them, k and i are the serial numbers of defect types, S i Indicates the value corresponding to the i-th defect type in the original output result, l i represents the original probability logic value corresponding to the i-th defect type, l k represents the original probability logic value corresponding to the k-th defect type, T represents the preset scaling factor, and exp() represents the natural exponential function.

[0028] As a further solution of the present invention: the first loss function is:

[0029] L1=-∑ i (t i ×log(s i ));

[0030] Among them, L1 represents the first loss function, t i It represents the value corresponding to the i-th defect type in the true label, and log() represents the logarithmic function.

[0031] As a further solution of the present invention, a back propagation optimization is performed on the initial preprocessing network based on the deviation, including:

[0032] Based on the deviation, the theoretical correction value of each element in the original context vector is obtained;

[0033] Establishing a second loss function based on the difference between the original value and the theoretical corrected value of each element in the original context vector;

[0034] Based on the second loss function, a back-propagation optimization is performed on the initial pre-processing network.

[0035] As a further solution of the present invention, the theoretical correction value of each element in the original context vector is obtained by the following formula:

[0036] v1=v0-a×d;

[0037] Among them, v1 represents the theoretical correction value of an element in the original context vector, v2 represents the original value of the element in the original context vector, a represents the preset learning rate, and d represents the deviation corresponding to the element in the original context vector.

[0038] An image processing system for industrial inspection, comprising:

[0039] A general network preparation module is used to obtain a preset general network, and the preset general network is used to identify the defect type of the defect image according to the defect image;

[0040] A primary network building module is used to obtain an initial preprocessing network. The initial preprocessing network is used to input the original image and output a context vector. The length of the context vector is the same as the length of the input vector of the preset universal network.

[0041] The network training optimization module is used to train the initial preprocessing network based on the preset data set to obtain the trained optimized preprocessing network;

[0042] Advanced network building module, used to connect the optimized pre-processing network and the preset general network to establish the target defect recognition network:

[0043] Image processing and detection module, used for industrial inspection image processing based on target defect recognition network.

[0044] Beneficial effects of the present invention:

[0045] The present invention provides an image processing method and system for industrial inspection. The method first obtains a preset universal network, then establishes an initial preprocessing network, and trains the initial preprocessing network based on a preset data set to obtain a trained optimized preprocessing network. The optimized preprocessing network and the preset universal network are then connected to establish a target defect recognition network. Finally, industrial inspection image processing is performed based on the target defect recognition network. The preset universal network is used to identify the defect type of the defect image based on the defect image, and the initial preprocessing network is used to input the original image and output a context vector. The length of the context vector is the same as the length of the input vector of the preset universal network. Compared with the prior art, the preset universal network in the present invention can be understood as a universal model with good generalization ability, mainly used to analyze the common characteristics of defects in industrial inspection. The initial preprocessing network and the optimized preprocessing network can be understood as preprocessing models that convert specific original images into input data that can be used for the preset universal network. Their main function is to analyze the specific characteristics of different scenarios. This means that in practice, people only need to train the initial processing model to complete the construction of the entire target defect recognition network, fully utilizing the common characteristics of defect types and solving the problem of low efficiency in the construction of existing artificial intelligence models for image processing used in industrial inspection. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The present invention will be further described below with reference to the accompanying drawings.

[0047] Figure 1 Schematic diagram of the process of the image processing method for industrial inspection provided by the present invention;

[0048] Figure 2 yes Figure 1 Specific step diagram of step S103;

[0049] Figure 3 for Figure 2 Specific step diagram of step S203;

[0050] Figure 4 This is a system structure diagram of the image processing system applied to industrial inspection provided by the present invention. DETAILED DESCRIPTION

[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0052] See also Figure 1 As shown, the present invention is an image processing method applied to industrial inspection, comprising the following steps:

[0053] S101, obtaining a preset universal network, where the preset universal network is used to identify the defect type of the defect image according to the defect image;

[0054] S102, obtaining an initial preprocessing network, where the initial preprocessing network is used to input an original image and output a context vector, where the length of the context vector is the same as the length of the input vector of the preset universal network;

[0055] S103, training an initial preprocessing network based on a preset data set to obtain a trained optimized preprocessing network;

[0056] S104. Connect the optimized preprocessing network and the preset general network to establish a target defect recognition network:

[0057] S105. Perform industrial inspection image processing based on the target defect recognition network.

[0058] Compared with the existing technology, the preset universal network in the present invention can be understood as a universal model with good generalization ability, which is mainly used to analyze the common characteristics of defects in industrial inspection. The initial preprocessing network and the optimized preprocessing network can be understood as preprocessing models that convert specific original images into input data that can be used for the preset universal network. Its main function is to analyze the specific characteristics of different scenes. This means that in practice people only need to train the initial processing model to complete the construction of the entire target defect recognition network, make full use of the commonalities of defect types, and solve the problem of low efficiency in the construction of existing artificial intelligence models for image processing applied to industrial inspection.

[0059] In the above process, the preset universal network is a pre-trained neural network model that can identify the type of defect based on a fixed-size defect image, and it has good versatility. In practice, the same defect may appear differently on different products. For example, the same defect such as a crack may appear in different positions, colors, contrasts, brightness, and sizes on different product surfaces (such as glass, plastic shells, standard parts, and other different products). If you want to input the actual original image into the preset universal network, you need to perform a series of preprocessing processes, such as cropping, rotation, resolution adjustment, binarization, etc. The initial preprocessing network in this embodiment can be understood as a neural network that performs the above preprocessing process. The parameters in the initial preprocessing network can be the initial default values, and the optimized preprocessing network is the initial preprocessing network that has been trained and optimized. The data used to train the initial preprocessing network is the preset data set.

[0060] The initial preprocessing network does not need to identify specific defect types. Compared with other complete defect recognition models, it only needs to perform front-end preprocessing, so its training process is simpler. For example, in a certain application scenario, defect recognition requires three processes: cropping, binarization, and defect recognition. Defect recognition is performed by the preset general network, while the cropping and binarization operations can be handed over to the initial preprocessing network. At this time, the preset data set only needs to include the original image and the preprocessed image obtained by cropping and binarization from the original image. There is no need to prepare a label for each preprocessed image to indicate its specific defect type, which greatly simplifies the difficulty of data preparation.

[0061] Obviously, for the above example, the context vector represents the vector corresponding to the pre-processed image. The present invention also provides a preferred embodiment, in which the context vector does not have a clear meaning, but can further improve training efficiency and accuracy.

[0062] Combine Figure 2 As shown, in a preferred embodiment, the preset data set includes multiple original images and the defect type corresponding to each original image. On this basis, the above step S103, training the initial preprocessing network based on the preset data set to obtain the trained optimized preprocessing network, specifically includes:

[0063] S201. Establish a true label corresponding to each original image based on the defect type;

[0064] S202, inputting the original image into the initial preprocessing network to obtain an output original context vector;

[0065] S203: Input the original context vector into a preset universal network, and establish a first loss function based on the true label and the output result of the preset universal network;

[0066] S204. Calculate the partial derivative of the first loss function with respect to each element in the context vector as the deviation of each element in the original context vector;

[0067] S205. Perform a back propagation optimization on the initial preprocessing network based on the deviation amount.

[0068] The original context vector in the above process is the context vector corresponding to the original image input during this backpropagation optimization. It can be understood that by repeating the above steps based on the preset dataset, the optimized initial preprocessing network is finally obtained.

[0069] In this embodiment, because the context vector lacks a clear, interpretable meaning, the preset dataset does not require the preparation of preprocessed images. Instead, the defect type for each original image must be prepared. However, it is understandable that, compared to the previous example, inputting the defect type for each original image is undoubtedly much simpler and easier to prepare the data for the preset dataset than inputting preprocessed images, further simplifying training.

[0070] Given that the context vector lacks a clear meaning, this embodiment uses a pre-set universal network to indirectly train the initial pre-processing network. The principle is that if the initial pre-processing network outputs an accurate and reasonable raw context vector based on an original image, then inputting it into the pre-set universal network should also yield an accurate result. Since the meaning of the pre-set universal network's output is known, the deviation of the raw context vector from the theoretically optimal raw context vector can be inferred from the deviation of the pre-set universal network's output, thereby enabling the training of the initial pre-processing network.

[0071] Therefore, this embodiment first inputs the original context vector into the preset general network in step S203, and uses a first loss function to represent the degree of deviation between the actual output of the preset general network and the ideal output. Then, in step S204, the deviation of each element in the original context vector is calculated by calculating the partial derivative of the first loss function with respect to each element in the context vector. This deviation is then used to perform a backpropagation optimization on the initial preprocessing network, i.e., step S205.

[0072] It's important to emphasize that in existing neural network training techniques, the biases in neural network parameters (weights, biases, etc.) are analyzed based on accurate input data in the hope of correcting these parameters. This process can be simply described as using the input data as coefficients and the network parameters as variables. The partial derivatives of each parameter in the loss function are calculated using a chained derivation method to represent the degree of error in each parameter. The parameter values ​​are then updated based on these partial derivatives, completing gradient descent.

[0073] This embodiment, on the other hand, analyzes the deviation of the input data (the original context vector) based on the accurate parameters of a pre-set general network, hoping to correct the original context vector. The specific calculation process in this embodiment is to use the parameters of the pre-set general network as coefficients and the input data (the original context vector) as variables. The partial derivative of each element of the original context vector in the first loss function is calculated through chain derivation to represent the error level of that element, thereby obtaining the deviation of the original context vector from the theoretically optimal original context vector.

[0074] As can be seen, the above process is essentially equivalent to knowledge transfer from the preset general network to the initial preprocessing network. The initial preprocessing network learns the knowledge related to defect recognition from the preset general network through the deviation of the context vector. Clearly, compared to training the initial preprocessing network solely with the preset dataset, the training process in this embodiment adds the preset general network as a reference, significantly shortening the learning time and making the training process of the initial preprocessing network more efficient.

[0075] Since the above process is essentially equivalent to the knowledge transfer process, the present invention also refers to an existing knowledge transfer technology - knowledge distillation to improve the process of establishing the first loss function to further improve the learning efficiency of the initial preprocessing network.

[0076] Specifically, combined Figure 3 As shown, in a preferred embodiment, the preset universal network includes a logical output layer and a normalization layer connected in sequence. The logical output layer is used to output a probability logical value for each defect type, and the probability logical value is used to represent the probability that the input defect image is a certain defect type. The normalization layer is used to normalize the multiple probability logical values ​​output by the logical output layer and output the output result of the preset universal network. Based on this, the above step S203, inputting the original context vector into the preset universal network, and establishing a first loss function based on the output result of the preset universal network based on the true label, includes:

[0077] S301: Input the original context vector into a preset universal network to obtain multiple original probability logic values ​​output by the logic output layer;

[0078] S302: Obtain a preset scaling factor, where the preset scaling factor is used to increase the difference between the normalized values ​​of the multiple original probability logic values;

[0079] S303, based on a preset scaling factor, normalize the multiple original probability logic values ​​through a normalization layer and output an original output result;

[0080] S304: Establish a first loss function based on the difference between the original output result and the true label.

[0081] Existing knowledge distillation techniques increase the distillation temperature during the normalization step in the teacher model to change the smoothness of the different probability distributions in the output results, making them contain more information and thus controlling the learning effect of the student model. Similarly, this embodiment also adds calculations related to the preset scaling factor during the normalization of multiple probability logical values ​​before establishing the first loss function to increase the information contained in the original output results, thereby improving the efficiency of knowledge transfer from the preset general network to the initial preprocessing network.

[0082] Specifically, in a preferred embodiment, the expression corresponding to the normalization layer is:

[0083]

[0084] Among them, k and i are the serial numbers of defect types, S i Indicates the value corresponding to the i-th defect type in the original output result, l i represents the original probability logic value corresponding to the i-th defect type, l k represents the raw probability logical value corresponding to the kth defect type, T represents the preset scaling factor, and exp() represents the natural exponential function. In the above formula, T can be compared to the distillation temperature in existing knowledge distillation techniques. When T is 1, the above formula is a standard softmax function. When T is less than 1, the difference between the values ​​corresponding to different defect types in the raw output increases.

[0085] Furthermore, in a preferred embodiment, the first loss function is:

[0086] L1=-∑ i (t i ×log(s i ));

[0087] Among them, L1 represents the first loss function, t i It represents the value corresponding to the i-th defect type in the true label, and log() represents the logarithmic function.

[0088] The above formula is a loss function established in the form of cross entropy, which indicates the difference between the original output result and the true label. In practice, other forms of formulas such as square root can also be used to establish the first loss function.

[0089] Furthermore, in a preferred embodiment, the above step S205, performing a back propagation optimization on the initial preprocessing network based on the deviation, specifically includes:

[0090] Based on the deviation, the theoretical correction value of each element in the original context vector is obtained;

[0091] Establishing a second loss function based on the difference between the original value and the theoretical corrected value of each element in the original context vector;

[0092] Based on the second loss function, a back-propagation optimization is performed on the initial pre-processing network.

[0093] In the above process, the original value of each element in the original context vector is the current actual value of each element in the original context vector. The theoretical correction value is the theoretically optimal value for each element in the original up-down vector. This can be thought of as the "true label" used to correct the initial preprocessing network. In practice, the theoretical correction value can be obtained by subtracting the original value of each element in the original context vector from the corresponding deviation, and then performing the conventional backpropagation optimization process.

[0094] The present invention also provides a preferred embodiment, in which the theoretical correction value of each element in the original context vector is obtained by the following formula:

[0095] v1=v0-a×d;

[0096] Among them, v1 represents the theoretical correction value of an element in the original context vector, v2 represents the original value of the element in the original context vector, a represents the preset learning rate, and d represents the deviation corresponding to the element in the original context vector.

[0097] The above formula controls the correction amplitude of the theoretical correction value by presetting the learning rate to prevent the occurrence of overfitting. It should be emphasized that although the form of the above formula is the same as the formula for updating the neural network parameters in the existing back propagation technology (hereinafter referred to as the existing formula), the meaning is different. It can be understood that, on the one hand, the role of the existing formula is to correct the numerical value of the parameters in the initial preprocessing network rather than the numerical value of the output result, while in this embodiment, on the contrary, the formula in this embodiment is used to correct the numerical value of the output result in the initial preprocessing network rather than the numerical value of the parameter. On the other hand, in the prior art, the calculation of the existing formula is an action that needs to be performed during the back propagation process. The formula in this embodiment is a prerequisite that needs to be completed before the back propagation begins.

[0098] Combine Figure 4 As shown, the present invention also provides an image processing system for industrial detection, comprising:

[0099] A general network preparation module 410 is used to obtain a preset general network, and the preset general network is used to identify the defect type of the defect image according to the defect image;

[0100] A primary network establishment module 420 is used to obtain an initial preprocessing network, which is used to input an original image and output a context vector. The length of the context vector is the same as the length of the input vector of the preset universal network;

[0101] The network training optimization module 430 is used to train the initial preprocessing network based on the preset data set to obtain a trained optimized preprocessing network;

[0102] The advanced network building module 440 is used to connect the optimized pre-processing network and the preset general network to establish a target defect recognition network:

[0103] The image processing and detection module 450 is used to perform industrial detection image processing based on the target defect recognition network.

[0104] Working principle of the present invention:

[0105] The present invention provides an image processing method and system for industrial inspection. The method first obtains a preset universal network, then establishes an initial preprocessing network, and trains the initial preprocessing network based on a preset data set to obtain a trained optimized preprocessing network. The optimized preprocessing network and the preset universal network are then connected to establish a target defect recognition network. Finally, industrial inspection image processing is performed based on the target defect recognition network. The preset universal network is used to identify the defect type of the defect image based on the defect image, and the initial preprocessing network is used to input the original image and output a context vector. The length of the context vector is the same as the length of the input vector of the preset universal network. Compared with the prior art, the preset universal network in the present invention can be understood as a universal model with good generalization ability, mainly used to analyze the common characteristics of defects in industrial inspection. The initial preprocessing network and the optimized preprocessing network can be understood as preprocessing models that convert specific original images into input data that can be used for the preset universal network. Their main function is to analyze the specific characteristics of different scenarios. This means that in practice, people only need to train the initial processing model to complete the construction of the entire target defect recognition network, fully utilizing the common characteristics of defect types and solving the problem of low efficiency in the construction of existing artificial intelligence models for image processing used in industrial inspection.

[0106] The above is a detailed description of an embodiment of the present invention. However, the content described is only a preferred embodiment of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.

Claims

1. An image processing method for industrial inspection, characterized in that: The following steps are involved: Obtaining a preset universal network, where the preset universal network is used to identify the defect type of the defect image according to the defect image; Obtain an initial preprocessing network, which is used to input the original image and output a context vector. The length of the context vector is the same as the length of the input vector of the preset general network; Train the initial preprocessing network based on the preset data set to obtain a trained optimized preprocessing network; Connect the optimized preprocessing network and the preset general network to establish a target defect recognition network; Industrial inspection image processing based on target defect recognition network; The preset data set includes multiple original images and the defect type corresponding to each original image; the initial preprocessing network is trained based on the preset data set to obtain a trained optimized preprocessing network, including: Based on the defect type, establish the true label corresponding to each original image; Input the original image into the initial preprocessing network to obtain the output original context vector; Inputting the original context vector into a preset universal network, and establishing a first loss function based on the true label and the output result of the preset universal network; Calculate the partial derivative of the first loss function for each element in the context vector as the deviation of each element in the original context vector; Perform a backpropagation optimization on the initial preprocessing network based on the deviation amount.

2. The image processing method for industrial inspection according to claim 1, characterized in that: The preset universal network includes a logic output layer and a normalization layer connected in sequence. The logic output layer is used to output a probability logic value of each defect type. The probability logic value is used to represent the probability that the input defect image is a defect type. The normalization layer is used to normalize the multiple probability logic values ​​output by the logic output layer and output the output result of the preset universal network. The original context vector is input into the preset universal network, and based on the true label, a first loss function is established according to the output result of the preset universal network, including: Input the original context vector into the preset universal network to obtain multiple original probability logic values ​​output by the logic output layer; Get a preset scaling factor, which is used to increase the difference between the normalized values ​​of multiple original probability logic values; Based on a preset scaling factor, a normalization layer normalizes multiple original probability logic values ​​and outputs the original output result; The first loss function is established based on the difference between the original output result and the true label.

3. The image processing method for industrial inspection according to claim 2, characterized in that: The expression corresponding to the normalization layer is: ; Where k and i are the serial numbers of the defect types, S i Indicates the value corresponding to the i-th defect type in the original output result, l i represents the original probability logic value corresponding to the i-th defect type, l k represents the original probability logic value corresponding to the k-th defect type, T represents the preset scaling factor, and exp() represents the natural exponential function.

4. The image processing method for industrial inspection according to claim 3, characterized in that: The first loss function is: ; Among them, L1 represents the first loss function, t i It represents the value corresponding to the i-th defect type in the true label, and log() represents the logarithmic function.

5. The image processing method for industrial inspection according to claim 1, characterized in that: Perform a backpropagation optimization on the initial preprocessing network based on the deviation, including: Based on the deviation, the theoretical correction value of each element in the original context vector is obtained; Establishing a second loss function based on the difference between the original value and the theoretical corrected value of each element in the original context vector; Based on the second loss function, a back-propagation optimization is performed on the initial pre-processing network.

6. The image processing method for industrial inspection according to claim 5, characterized in that: The theoretical correction value of each element in the original context vector is obtained by the following formula: ; Among them, v1 represents the theoretical correction value of an element in the original context vector, v0 represents the original value of the element in the original context vector, a represents the preset learning rate, and d represents the deviation corresponding to the element in the original context vector.

7. An image processing system for industrial inspection, characterized in that: include: A general network preparation module is used to obtain a preset general network, and the preset general network is used to identify the defect type of the defect image according to the defect image; A primary network building module is used to obtain an initial preprocessing network. The initial preprocessing network is used to input the original image and output a context vector. The length of the context vector is the same as the length of the input vector of the preset universal network. The network training optimization module is used to train the initial preprocessing network based on the preset data set to obtain the trained optimized preprocessing network; Advanced network building module, used to connect the optimized pre-processing network and the preset general network to establish the target defect recognition network; Image processing and detection module, used for industrial inspection image processing based on target defect recognition network; The preset data set includes multiple original images and the defect type corresponding to each original image; the initial preprocessing network is trained based on the preset data set to obtain a trained optimized preprocessing network, including: Based on the defect type, establish the true label corresponding to each original image; Input the original image into the initial preprocessing network to obtain the output original context vector; Inputting the original context vector into a preset universal network, and establishing a first loss function based on the true label and the output result of the preset universal network; Calculate the partial derivative of the first loss function for each element in the context vector as the deviation of each element in the original context vector; Perform a backpropagation optimization on the initial preprocessing network based on the deviation amount.

Citation Information

Patent Citations

  • Industrial defect detection method, device and equipment and readable storage medium

    CN115239638A