Image processing method and system applied to industrial detection

By establishing target defect recognition networks, the preset general network and initial pre -processing network are used to solve the problem of low efficiency of image processing model construction in industrial testing, and achieve more efficient model construction and image processing effects.

CN119380083AActive Publication Date: 2025-01-28GUANGDONG ACADEMY OF SCIENCES CERTIFICATION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing artificial intelligence model used in image processing for industrial detection is not efficient in building, and the commonalities of defect types are not fully utilized.

Method used

By obtaining the preset general network and the initial pre -processing network, based on the preset data set training initial processing network, the pre -processing network is optimized, and the pre -processing network and the preset general network are connected to establish a target defect recognition network for the use Industrial testing image processing.

Benefits of technology

A more efficient model construction is achieved, the commonality of the flaws is made to simplify the data preparation and model training process, and the efficiency of industrial testing image processing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119380083A_ABST
    Figure CN119380083A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence neural networks, in particular to an image processing method and system applied to industrial detection, and the method comprises the steps: firstly obtaining a preset universal network, then building an initial preprocessing network, training the initial preprocessing network to obtain an optimized preprocessing network, and then connecting the optimized preprocessing network with the preset universal network, and establishing a target defect identification network to carry out industrial detection image processing. Compared with the prior art, the preset universal network is mainly used for analyzing common characteristics of defects in industrial detection, and the initial preprocessing network and the optimization preprocessing network are used for analyzing specific characteristics of different scenes. Therefore, in practice, people only need to train the initial processing model to complete the construction of the whole target defect recognition network, the generality of defect types is fully utilized, and the problem that the construction efficiency of an existing artificial intelligence model applied to image processing of industrial detection is not high is solved.
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] In the field of industrial inspection, artificial intelligence image processing technology is becoming increasingly popular. Its core strategy is to use deep learning algorithms, especially neural networks, to identify and classify defects through product images. At present, the commonly used method is to build and train complex neural network models to achieve defect detection on the product surface.

[0003] In actual applications, although the inspection requirements in different fields have their own characteristics, the types of defects faced often have certain commonalities. For example, defects such as stains, cracks and edge burrs are very common in various fields and scenarios. In practice, only the specific carriers and scenarios in which they appear are different.

[0004] However, existing technologies usually rebuild and train a complete neural network model for a specific situation, which not only requires collecting and preparing data sets by yourself, but also involves a tedious debugging process, which consumes a lot of time and human resources. More importantly, this method fails to fully utilize the commonality of defect types, resulting in low model building efficiency. Therefore, people need an image processing method for industrial inspection with higher model building efficiency. 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] Existing artificial intelligence models for image processing applied to industrial inspection are not efficient in building.

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

[0008] An image processing method for industrial detection comprises 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, 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 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: the preset data set includes a plurality of original images and a 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:

[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 according to an output result of the preset universal network based on the true label;

[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 back-propagation optimization on the initial preprocessing network based on the deviation amount.

[0020] As a further solution of the present invention: 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 indicate the probability that the input defect image is a defect type, and 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:

[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] Obtain a preset scaling factor, where the preset scaling factor is used to increase the normalized value difference of multiple original probability logic values;

[0023] Based on a preset scaling factor, a plurality of original probability logic values ​​are normalized through a normalization layer and an original output result is output;

[0024] According to the difference between the original output result and the true label, the first loss function is established.

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

[0026]

[0027] Where k and i represent the serial number of the defect type, 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, a theoretical correction value of each element in the original context vector is obtained;

[0033] Establishing a second loss function according to 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 preprocessing 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, used to obtain a preset general network, where 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, used to obtain an initial preprocessing network, the initial preprocessing network 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 general network;

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

[0042] Advanced network building module, used to connect the optimized preprocessing network and the preset general network to build the target defect recognition network:

[0043] Image processing 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 detection, which first obtains a preset general 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, then connects the optimized preprocessing network and the preset general network, establishes a target defect recognition network, and finally performs industrial detection image processing based on the target defect recognition network. Among them, the preset general network is used to identify the defect type of the defect image according to the defect image, and the initial preprocessing network is used to input the original image and output a context vector, and the length of the context vector is the same as the length of the input vector of the preset general network. Compared with the prior art, the preset general network in the present invention can be understood as a general model with good generalization ability, which is mainly used to analyze the common characteristics of defects in industrial detection, while the initial preprocessing network and the optimized preprocessing network can be understood as a preprocessing model that converts a specific original image into input data that can be used for the preset general network, and its main function is to analyze the specific characteristics of different scenes, which 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 commonality of defect types, and solve the problem of low efficiency in the construction of artificial intelligence models for image processing applied to industrial detection. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] Figure 1 It is a schematic flow chart of an image processing method applied to 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 A 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 be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are 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 detection, 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 an input vector of a preset general network;

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

[0056] S104, connecting 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 prior art, 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, while 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, making full use of the commonalities of defect types and solving the problem of low efficiency in building 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 differently on different product surfaces (such as glass, plastic housing, 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 after training and optimization. The data used to train the initial preprocessing network is the preset data set.

[0060] For the initial preprocessing network, it does not need to identify specific defect types. Compared with other complete defect recognition models, it only needs to perform the front-end preprocessing work, so its training process is simpler. For example, in a certain application scenario, the recognition of defects requires three processes: cropping, binarization, and defect recognition. Among them, 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 labels 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 preprocessed image. The present invention also provides a preferred embodiment, in which the context vector does not have a clear meaning, but can further improve the training efficiency and accuracy.

[0062] Combination 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, establishing 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, 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;

[0066] S204, calculating 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;

[0067] S205, performing 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 the back propagation optimization. It can be understood that by repeating the above behavior based on the preset data set, the optimized initial preprocessing network finally obtained is the optimized preprocessing network.

[0069] In this embodiment, because the context vector does not have a clear and interpretable meaning, the preset data set does not need to prepare preprocessed images, but instead needs to prepare the defect type of each original image. However, it can be understood that compared with the example in the previous article, for the work of preparing the data of the preset data set, the behavior of inputting the defect type of each original image is undoubtedly simpler and easier than the behavior of inputting the preprocessed image, which further simplifies the training.

[0070] On the basis that the context vector does not have a clear meaning, the present embodiment uses a preset universal network to indirectly train the initial preprocessing network. The principle is: if the original context vector output by the initial preprocessing network based on an original image is accurate and reasonable, then inputting it into the preset universal network should also yield an accurate result. The meaning of the output result of the preset universal network is known, so the deviation of the original context vector from the theoretically optimal original context vector can be inferred through the deviation of the output result of the preset universal network, thereby achieving the training of the initial preprocessing network.

[0071] Therefore, this embodiment first inputs the original context vector into the preset general network through step S203, and uses the first loss function to represent the degree of deviation between the actual output result of the preset general network and the ideal output result. Then, through step S204, the deviation of each element in the original context vector is obtained by calculating the partial derivative of the first loss function for each element in the context vector, so that the initial preprocessing network can be optimized by back propagation based on the deviation, that is, step S205.

[0072] It should be emphasized that in the prior art, when training a neural network, people analyze the deviation of the parameters (weights, biases, etc.) in the neural network based on accurate input data, in the hope of correcting these parameters. The specific process can be simply described as taking the input data as coefficients and the parameters in the network as variables, calculating the partial derivative of each parameter in the loss function by chain derivation to represent the error degree of each parameter, and then updating the parameter value based on the partial derivative to complete the gradient descent.

[0073] This embodiment is just the opposite. In this embodiment, the deviation of the input data (original context vector) is analyzed based on the accurate parameters in the preset general network, in the hope of correcting the original context vector. Then the specific calculation process in this embodiment is naturally to use the parameters in the preset general network as coefficients and the input data (original context vector) as variables, and calculate the partial derivative of each element of the original context vector in the first loss function by chain derivation to represent the error degree of the element, and then obtain the deviation of the original context vector from the theoretically optimal original context vector.

[0074] It can be seen that the above process is essentially equivalent to the knowledge transfer from the preset general network to the initial preprocessing network. The initial preprocessing network learns the knowledge related to the recognition of defects in the preset general network through the deviation of the context vector. Obviously, compared with training the initial preprocessing network only through the preset data set, the training process in this embodiment adds the preset general network as a reference, which greatly shortens the learning time and makes the learning and 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 makes improvements to the process of establishing the first loss function with reference to an existing knowledge transfer technology - knowledge distillation, so as 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 of each defect type, the probability logical value is used to indicate the probability that the input defect image is a certain 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. On this basis, the above step S203, inputting the original context vector into the preset universal network, and establishing a first loss function based on the true label and the output result of the preset universal network, includes:

[0077] S301, inputting the original context vector into a preset universal network to obtain a plurality of original probability logic values ​​output by a logic output layer;

[0078] S302, obtaining a preset scaling factor, where the preset scaling factor is used to increase the difference between the normalized values ​​of a plurality of 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 according to the difference between the original output result and the true label.

[0081] The existing knowledge distillation technology changes the smoothness of different probability distributions in the output results by increasing the distillation temperature in the normalization step in the teacher model, so that it contains more information, thereby controlling the learning effect of the student model. Similarly, in this embodiment, before establishing the first loss function, the calculation related to the preset scaling factor is added in the process of normalizing multiple probability logic values ​​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] Where, k and i represent the serial number of the defect type, 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. In the above formula, T can be compared to the distillation temperature in the existing knowledge distillation technology. When T is 1, the above formula is an ordinary softmax function. When T is less than 1, the gap between the values ​​corresponding to different defect types in the original output results will increase.

[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] Further, 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, a theoretical correction value of each element in the original context vector is obtained;

[0091] Establishing a second loss function according to 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 preprocessing 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, and the theoretical correction value is the theoretically optimal value of each element in the original up and down vectors, which can be understood as the "real 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 the conventional back-propagation optimization process is performed.

[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 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] Combination 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 building module 420 is used to obtain 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;

[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 preprocessing network and the preset general network to establish a target defect recognition network:

[0103] The image processing 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 detection, which first obtains a preset general 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, then connects the optimized preprocessing network and the preset general network, establishes a target defect recognition network, and finally performs industrial detection image processing based on the target defect recognition network. Among them, the preset general network is used to identify the defect type of the defect image according to the defect image, and the initial preprocessing network is used to input the original image and output a context vector, and the length of the context vector is the same as the length of the input vector of the preset general network. Compared with the prior art, the preset general network in the present invention can be understood as a general model with good generalization ability, which is mainly used to analyze the common characteristics of defects in industrial detection, while the initial preprocessing network and the optimized preprocessing network can be understood as a preprocessing model that converts a specific original image into input data that can be used for the preset general network, and its main function is to analyze the specific characteristics of different scenes, which 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 commonality of defect types, and solve the problem of low efficiency in the construction of artificial intelligence models for image processing applied to industrial detection.

[0106] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation 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, 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 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 the target defect recognition network: Industrial inspection image processing based on target defect recognition network.

2. The image processing method for industrial detection according to claim 1, characterized in that: 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 the 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 according to an output result of the preset universal network based on the true label; 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 back-propagation optimization on the initial preprocessing network based on the deviation amount.

3. The image processing method for industrial detection according to claim 2, 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 indicate the probability that the input defect image is a defect type, and the normalization layer is used to normalize multiple probability logic values ​​output by the logic output layer and output an 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; Obtain a preset scaling factor, where the preset scaling factor is used to increase the normalized value difference of multiple original probability logic values; Based on a preset scaling factor, a plurality of original probability logic values ​​are normalized through a normalization layer and an original output result is output; According to the difference between the original output result and the true label, the first loss function is established.

4. The image processing method for industrial detection according to claim 3, characterized in that: The expression corresponding to the normalization layer is: Where, k and i represent the serial number of the defect type, 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.

5. The image processing method for industrial detection according to claim 4, characterized in that: The first loss function is: L1=-∑ i (t i ×log(s i )); 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.

6. The image processing method for industrial detection according to claim 2, characterized in that: Perform a back propagation optimization on the initial preprocessing network based on the deviation, including: Based on the deviation, a theoretical correction value of each element in the original context vector is obtained; Establishing a second loss function according to 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 preprocessing network.

7. The image processing method for industrial detection according to claim 6, characterized in that: The theoretical correction value of each element in the original context vector is obtained by the following formula: v1=v0-a×d; 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.

8. An image processing system for industrial inspection, characterized in that: include: A general network preparation module, used to obtain a preset general network, where 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, used to obtain an initial preprocessing network, the initial preprocessing network 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 general network; A network training optimization module is used to train an initial preprocessing network based on a preset data set to obtain a trained optimized preprocessing network; Advanced network building module, used to connect the optimized preprocessing network and the preset general network to build the target defect recognition network: Image processing detection module, used for industrial inspection image processing based on target defect recognition network.

Citation Information

Patent Citations

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

    CN115239638A

  • Method, system, equipment and medium for industrial scene image defect detection

    CN116342494A

  • Content generation method and device, model training method and device, electronic equipment and medium

    CN117094367A