An industrial appearance quality inspection method, system, device and storage medium
Patent Information
- Application Number
- CN202510216641.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2026-08-28
AI Technical Summary
[0004]针对上述相关技术,传统的神经网络模型虽然能够识别产品外观的部分缺陷,但是在外观质量检验的时候,通常还需要对组装产品的每个部件的安装位置以及安装方向进行检验,确保组装的成品是正常安装的,但是传统的神经网络模型无法识别产品的安装位置以及安装方向
[0055]Different training image sets are obtained based on the different types of equipment to be inspected. For the first type of equipment, positive sample images are first acquired indicating correct installation sequence, correct installation direction, and correct identification of appearance defect categories. Then, negative sample images are labeled. The positive and negative sample images are input into a neural network model for training, resulting in a trained model. The model training results are evaluated using precision and recall. If the model training is substandard, the model parameters are modified or the training images are optimized for retraining, resulting in an optimized training model. The industrial appearance quality inspection images of the actual equipment to be inspected are then input into the optimized training model to obtain the inspection results. Compared to traditional appearance defect quality inspection, this application can also identify whether the installation sequence and installation direction of each component of the equipment are correct. Moreover, compared to manual identification of installation sequence and installation direction, this application has higher efficiency and higher accuracy.
Smart Images

Figure CN122656955A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of appearance quality inspection, and specifically relates to an industrial appearance quality inspection method, system, equipment and storage medium. Background Technology
[0002] With the rapid development of next-generation digital intelligence technologies such as big data and artificial intelligence, intelligent manufacturing has become a new track for enterprises to pursue development. Intelligent factories have placed higher demands on industrial appearance quality inspection. Industrial appearance quality inspection is a preliminary inspection of the appearance of manufactured products to ensure that the surface of the product is free of obvious scratches and stains.
[0003] In related technologies, the main method for inspecting the appearance quality of products is to train a neural network model. This involves taking training images in advance, labeling the images, and then training the neural network model to obtain the trained model. The trained neural network model is then used to inspect whether there are any defects in the appearance of the product.
[0004] Regarding the aforementioned technologies, while traditional neural network models can identify some defects in the appearance of a product, during appearance quality inspection, it is usually necessary to inspect the installation position and direction of each component of the assembled product to ensure that the assembled product is installed correctly. However, traditional neural network models cannot identify the installation position and direction of the product. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide an industrial appearance quality inspection method, system, equipment and storage medium that can not only identify appearance defects, but also identify whether the installation position and installation direction are accurate.
[0006] An industrial appearance quality inspection method, comprising:
[0007] Obtain the type of equipment to be inspected;
[0008] When the device type is a first inspection device type with an installation sequence and an installation direction, the first training data image set is obtained;
[0009] The first training data image set is preprocessed to obtain a processed image set. Positive sample images with correct installation order, correct installation direction, and correct identification of appearance defect categories are obtained from the processed image set.
[0010] Obtain negative sample images of the equipment to be inspected that have incorrect installation sequence, incorrect installation direction, or incorrect identification of appearance defect category, and label the negative sample images with errors;
[0011] The neural network model is trained using positive and negative sample images to obtain the trained model;
[0012] The trained model is evaluated using a test set to obtain true positive parameters, false negative parameters, false positive parameters, and true negative parameters. Precision and recall are then calculated based on these parameters.
[0013] When the accuracy rate is lower than a first threshold, the model parameters of the training model are adjusted to optimize the training model until the accuracy rate is higher than the first threshold, thus obtaining an optimized training model.
[0014] Alternatively, if the recall rate is lower than the second threshold, the positive samples are optimized and the training model is retrained until the recall rate is higher than the second threshold, thus obtaining an optimized training model.
[0015] Obtain images of the industrial appearance quality of the equipment to be inspected;
[0016] The industrial appearance quality inspection image is input into the optimized training model to obtain the inspection results, which include whether the installation sequence is incorrect, whether the installation direction is incorrect, and whether the appearance defect category is correctly identified.
[0017] Optionally, the preprocessing of the first training data image set to obtain a processed image set, and the acquisition of positive sample images from the processed image set that show correct installation order, correct installation direction, and correct identification of appearance defect categories, includes:
[0018] Based on the equipment to be tested, the correct installation sequence and installation direction are determined;
[0019] Obtain the identification codes for the installation order and installation direction;
[0020] The processed image set is labeled according to the identification code and the correct appearance defect category, and used as positive sample images.
[0021] Optionally, the identification code for obtaining the installation order and installation direction includes:
[0022] Based on the installation sequence, the relative positions, connection directions, and number of components of the equipment to be inspected are obtained;
[0023] Based on the number of components and their relative positions, a position identifier is set;
[0024] Set a direction identifier based on the connection direction;
[0025] The location identifier and direction identifier are used as identification codes.
[0026] Optionally, the preprocessing of the first training data image set to obtain the processed image set includes:
[0027] Obtain the image name of each image in the first training data image set;
[0028] Duplicate images are filtered out based on their names to obtain the processed image set.
[0029] Optionally, the position identifier includes a separator, a stop symbol, and an arrangement order symbol, and the direction identifier includes a front-back identifier, a left-right identifier, and an up-down identifier.
[0030] Optionally, obtaining the first training data image set includes:
[0031] Adjust the camera pointing direction according to the type of equipment to be inspected;
[0032] According to the direction indicated by the camera, a number of training data images are taken to form the first training data image set.
[0033] Optionally, when the device type is a second inspection device type with no installation order and no installation direction, a second training set is obtained;
[0034] The second training set is labeled with appearance defect categories to obtain the standard set;
[0035] The standard set is input into the neural network model for training to obtain the defect training model;
[0036] The trained model is evaluated using an appearance test set to obtain true positive parameters, false negative parameters, false positive parameters, and true negative parameters. Precision and recall are then calculated based on these parameters.
[0037] When the accuracy rate is lower than the first threshold, the model parameters of the defective training model are adjusted to optimize the training model until the accuracy rate is higher than the first threshold, thus obtaining an optimized training model.
[0038] Alternatively, if the recall rate is lower than the second threshold, the defect training model is retrained after optimizing the standard set until the recall rate is higher than the second threshold, thus obtaining the optimized defect training model.
[0039] Obtain images of the industrial appearance quality of the equipment to be inspected;
[0040] The industrial appearance quality inspection image is input into the optimized defect training model to obtain the appearance defect category.
[0041] An industrial appearance quality inspection system, comprising:
[0042] The first acquisition module is used to acquire the type of equipment to be inspected;
[0043] The second acquisition module is used to acquire the first training data image set when the device type is a first inspection device type with an installation sequence and an installation direction.
[0044] The preprocessing module is used to preprocess the first training data image set to obtain a processed image set, and to perform installation order, installation direction and defect identification on the processed image set to obtain labeled images, which are used as positive samples.
[0045] The third acquisition module is used to acquire negative sample images of equipment under inspection with incorrect installation sequence and installation direction, and to label the negative sample images with errors.
[0046] The training module is used to train the neural network model using positive and negative sample images to obtain the trained model;
[0047] The evaluation module is used to evaluate the trained model using a test set, obtain true positive parameters, false negative parameters, false positive parameters and true negative parameters, and calculate precision and recall based on the true positive parameters, false negative parameters, false positive parameters and true negative parameters;
[0048] The optimization module is used to adjust the model parameters of the training model to optimize the training model when the accuracy is lower than a first threshold, until the accuracy is higher than the first threshold, thereby obtaining an optimized training model.
[0049] Alternatively, if the recall rate is lower than the second threshold, the neural network model is retrained after optimizing the positive samples until the recall rate is higher than the second threshold, thus obtaining an optimized training model.
[0050] The fourth acquisition module is used to acquire images of the industrial appearance quality of the equipment to be inspected.
[0051] The inspection module is used to input the industrial appearance quality inspection image into the optimized training model to obtain the inspection results. The inspection results include whether the installation sequence is incorrect, whether the installation direction is incorrect, and whether there are appearance defects.
[0052] A terminal device includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor loads and executes the computer program, it employs an industrial appearance quality inspection method.
[0053] A computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, employs an industrial appearance quality inspection method.
[0054] The beneficial effects of this invention are:
[0055] Different training image sets are obtained based on the different types of equipment to be inspected. For the first type of equipment, positive sample images are first acquired indicating correct installation sequence, correct installation direction, and correct identification of appearance defect categories. Then, negative sample images are labeled. The positive and negative sample images are input into a neural network model for training, resulting in a trained model. The model training results are evaluated using precision and recall. If the model training is substandard, the model parameters are modified or the training images are optimized for retraining, resulting in an optimized training model. The industrial appearance quality inspection images of the actual equipment to be inspected are then input into the optimized training model to obtain the inspection results. Compared to traditional appearance defect quality inspection, this application can also identify whether the installation sequence and installation direction of each component of the equipment are correct. Moreover, compared to manual identification of installation sequence and installation direction, this application has higher efficiency and higher accuracy. Attached Figure Description
[0056] Figure 1 This is a flowchart illustrating an industrial appearance quality inspection method according to the present invention.
[0057] Figure 2 This is a schematic diagram showing the direction indicated when the camera of this invention is taking pictures;
[0058] Figure 3 This is a schematic diagram illustrating the practical application of the installation sequence and installation location identification of the present invention;
[0059] Figure 4 This is a schematic diagram illustrating the installation direction identification of the present invention.
[0060] Explanation of reference numerals in the attached diagram: 1. First anti-mistake pin; 2. Second anti-mistake pin; 3. Third anti-mistake pin. Detailed Implementation
[0061] An industrial appearance quality inspection method, such as Figure 1 As shown, the present invention includes:
[0062] S1. Obtain the type of equipment to be inspected.
[0063] Specifically, a piece of equipment to be inspected may be assembled from multiple different components, and these components may be very similar or simply misaligned. Relying solely on manual identification is not only inefficient but also inaccurate. The installation sequence refers to the order in which the components of the equipment are installed. For example, if a piece of equipment consists of three components, A, B, and C, the installation sequence from left to right is A, B, and C. The installation direction refers to the orientation of a particular side of a component. For example, if component A has one curved side and one straight side, the curved side should face upwards during installation.
[0064] S2. When the device type is a first inspection device type with an installation sequence and an installation direction, obtain the first training data image set.
[0065] The first training data image set includes:
[0066] Adjust the camera pointing direction according to the type of equipment to be inspected.
[0067] According to the direction indicated by the camera, a number of training data images are taken to form the first training data image set.
[0068] Specifically, such as Figure 2 As shown, when shooting training images, especially those with directional requirements, it's impossible to guarantee that all photos will face the same orientation (they might be flipped, causing a change in orientation). Therefore, the camera has a preset camera pointer direction. By adjusting the pointer direction, the camera can identify the orientation of the captured image at the time of shooting, ensuring the image won't be flipped, which is convenient for computer recognition. For example, when the arrow points upwards, it indicates a positive orientation and won't be flipped.
[0069] S3. Preprocess the first training data image set to obtain a processed image set, and obtain positive sample images from the processed image set that show correct installation order, correct installation direction, and correct identification of appearance defect categories.
[0070] The first training data image set is preprocessed to obtain a processed image set. Positive sample images with correct installation order, correct installation direction, and correct identification of appearance defect categories are obtained from the processed image set, including:
[0071] Based on the equipment to be tested, the correct installation sequence and installation direction are obtained.
[0072] Specifically, for a particular product, the installation sequence and orientation of its components are fixed. Therefore, based on the equipment to be inspected, the installation sequence and orientation can be obtained by matching the name of the equipment to be inspected against a pre-designed database.
[0073] Obtain the identification codes for the installation order and installation direction.
[0074] Specifically, the identification code includes an identification code for the installation order and an identification code for the installation direction. For the identification code for the installation order, each component needs to be numbered, and the numbers need to increase progressively in the same way as the installation order. The installation direction is determined by matching the direction indicated by the photograph with the corresponding identification code.
[0075] The processed image set is labeled according to the identification code and the correct appearance defect category, and used as positive sample images.
[0076] The identification codes for obtaining the installation order and installation direction include:
[0077] Based on the installation sequence, the relative positions, connection directions, and number of components of the equipment to be inspected are obtained.
[0078] Specifically, the number of components refers to the number of parts that make up the device; each component can be the same or different. The relative position of the components is the position of each individual component relative to other components, and the connection direction is the assembly direction between adjacent components.
[0079] A location identifier is set according to the number of components and their relative positions.
[0080] Specifically, the location identifier includes the relative position of the components and the number of components. For example, a device includes three connectors, connector X1, connector X2, and connector X3, and adds a separator $ and a stop symbol &. The separator is used to separate different components, and the stop symbol indicates the end of all components, represented as connector X1$connector X1$connector X3&.
[0081] Set a direction identifier based on the connection direction.
[0082] Specifically, the equipment is three-dimensional, so the installation directions (left-right and up-down) are represented by H (horizontal from left to right) and V (vertical from top to bottom). HV represents the number of rows from left to right horizontally and then vertically from top to bottom, and VH represents the number of columns from top to bottom horizontally and then horizontally from left to right. For example, the position identifier is: Connector X1$Connector X2$Connector X3&Connector X1$Connector X2$Connector X3&Connector X1$Connector X2$Connector X3&, and the direction identifier is HV. This means that in the image, the first row from left to right is assembled with Connector X1, Connector X2, and Connector X3, arranged in three rows from top to bottom.
[0083] Practical application is as follows: Two connectors, X1 and X2, are extremely similar in appearance. First, identify the quantity: two connectors. Second, during production and installation, the two connectors are very easily installed backwards, causing batch rework or even defective products, resulting in quality issues. The key to distinguishing the two types of connectors lies in the anti-misalignment pin. This is achieved by marking the anti-misalignment pin, as shown in the actual operation. Figure 3 The three types of anti-misalignment pins shown are the first anti-misalignment pin 1, the second anti-misalignment pin 2, and the third anti-misalignment pin 3. The position identifier is anti-misalignment pin 1$anti-misalignment pin 2&anti-misalignment pin 3$anti-misalignment pin 2&, and the direction identifier is HV. This method uses the relative positions of the anti-misalignment pins to prevent the plug from being installed backwards. It has proven very effective in practical applications.
[0084] The position identifier includes a separator, a stop symbol, and an order symbol; the direction identifier includes a left-right identifier and an up-down identifier.
[0085] The location identifier and direction identifier are used as identification codes.
[0086] The preprocessing of the first training data image set to obtain the processed image set includes:
[0087] Obtain the image name of each image in the first training data image set.
[0088] Duplicate images are filtered out based on their names to obtain the processed image set.
[0089] Specifically, after taking pictures, each picture will be named. In order to reduce the amount of data, the pictures will be filtered according to their names and duplicate names will be removed. Duplicate names also include suffixes that are automatically added due to duplication, such as A(1), where (1) indicates that there is a picture with the name A, and A(1) is automatically generated.
[0090] S4. Obtain negative sample images with incorrect equipment installation order and installation direction, and label the negative sample images with errors.
[0091] Specifically, to address potential issues like inverted or reversed component assembly in appearance quality testing, we disabled the augmented rotation parameter during model training and implemented angle requirements during model inference. We also added annotations for negative sample images of inverted components, labeling them with "NG" (Not Given). The program will report an error if it detects such labels. Furthermore, to prevent false positives due to image flipping during photography, we added an arrow on the camera component indicating the camera's orientation. An upward-pointing arrow signifies that the captured image is upright and not flipped.
[0092] Example case:
[0093] like Figure 4 As shown, during diode module installation, the installation orientation may be rotated 180 degrees. Orientation identification relies solely on the arc of the shim on the screw hole, making it very easy for inspectors to miss the correct orientation during actual inspection. By disabling the rotation parameter and labeling correctly oriented modules as positive samples and incorrectly oriented modules as negative samples, a much better identification result can be achieved in practical applications.
[0094] S5. Use positive and negative sample images to train the neural network model to obtain the trained model.
[0095] S6. Evaluate the trained model using the test set to obtain the true positive parameter, false negative parameter, false positive parameter, and true negative parameter, and calculate the precision and recall based on the true positive parameter, false negative parameter, false positive parameter, and true negative parameter.
[0096] Specifically, in multi-object detection, model performance is typically evaluated using precision and recall. Calculating these metrics requires first calculating true positives (TP), false negatives (FN), false positives (FP), and true negatives (TN). Neural network models can be multi-object detection models or YOLOv models. TP indicates the model correctly detected the target, FN indicates the model failed to detect the actual target, FP indicates the model incorrectly detected a non-existent target, and TN indicates the model correctly failed to detect a non-existent target. The images in the test set must be different from those used during training.
[0097] Calculating TP, FN, FP, and TN requires comparing the model's predictions with the ground truth annotations on the test set. Suppose we have a test set containing multiple images, each labeled with the location and category of a target object. The model makes predictions for each image, also providing the location and category of the target object. Then, we compare the model's predictions one-to-one with the ground truth annotations: the comparison method typically uses IoU (Intersection over Union) to measure the degree of overlap between the predicted and ground truth bounding boxes. IoU is the ratio of the intersection area to the union area of the predicted and ground truth bounding boxes. An IoU threshold is set (e.g., 0.5); if the IoU between the predicted and ground truth bounding boxes is greater than the threshold, the model is considered to have detected the target.
[0098] S7. When the precision is lower than the first threshold, the model parameters of the training model are adjusted to optimize the training model until the precision is higher than the first threshold, thus obtaining an optimized training model. Alternatively, when the recall is lower than the second threshold, the positive samples are optimized and the neural network model is retrained until the recall is higher than the second threshold, thus obtaining an optimized training model.
[0099] Specifically, if the accuracy is low, it means that the model has a high false alarm rate, and the model parameters need to be adjusted or the algorithm improved to reduce false alarms.
[0100] If the recall rate is low, it indicates that the model has a high false negative rate. It is necessary to optimize the dataset (e.g., add more data or improve the labeling quality) or adjust the model parameters to reduce false negatives.
[0101] S8. Obtain images of the industrial appearance quality of the equipment to be inspected.
[0102] S9. Input the industrial appearance quality inspection image into the optimized training model to obtain the inspection results. The inspection results include whether the installation sequence is incorrect, whether the installation direction is incorrect, and whether there are appearance defects.
[0103] Specifically, the categories of appearance defects correspond to the categories used when identifying defects.
[0104] When the device type is a second inspection device type with no installation order and no installation direction, a second training set is obtained.
[0105] The second training set is labeled with appearance defect categories to obtain the standard set;
[0106] The standard set is input into the neural network model for training to obtain the defect training model;
[0107] The trained model is evaluated using an appearance test set to obtain true positive parameters, false negative parameters, false positive parameters, and true negative parameters. Precision and recall are then calculated based on these parameters.
[0108] When the accuracy rate is lower than the first threshold, the model parameters of the defective training model are adjusted to optimize the training model until the accuracy rate is higher than the first threshold, thus obtaining an optimized training model.
[0109] Alternatively, if the recall rate is lower than the second threshold, the defect training model is retrained after optimizing the standard set until the recall rate is higher than the second threshold, thus obtaining the optimized defect training model.
[0110] Obtain images of the industrial appearance quality of the equipment to be inspected;
[0111] The industrial appearance quality inspection image is input into the optimized defect training model to obtain the defect category.
[0112] The device to be inspected is input into the optimized defect training model to obtain the appearance defect category.
[0113] Specifically, the training method for the optimization defect training model is the same as that for the optimization training model. The difference is that the images used to train the optimization defect training model only have labels for the appearance defect categories. Compared to the test set, the appearance test set also only has labels for the appearance defect categories, without labels for the installation order and installation direction.
[0114] An industrial appearance quality inspection system, comprising:
[0115] The first acquisition module is used to acquire the type of equipment to be inspected;
[0116] The second acquisition module is used to acquire the first training data image set when the device type is a first inspection device type with an installation sequence and an installation direction.
[0117] The preprocessing module is used to preprocess the first training data image set to obtain a processed image set, and to obtain positive sample images from the processed image set that are correctly installed in the correct order, correctly installed in the correct direction, and correctly identified in terms of appearance defect category.
[0118] The third acquisition module is used to acquire negative sample images of equipment under inspection that have incorrect installation sequence, incorrect installation direction, or incorrect identification of appearance defect category, and to label the negative sample images with error tags.
[0119] The training module is used to train the training model using positive and negative sample images to obtain the training model;
[0120] The evaluation module is used to evaluate the trained model using a test set, obtain true positive parameters, false negative parameters, false positive parameters and true negative parameters, and calculate precision and recall based on the true positive parameters, false negative parameters, false positive parameters and true negative parameters;
[0121] The optimization module is used to adjust the model parameters of the training model to optimize the training model when the accuracy is lower than a first threshold, until the accuracy is higher than the first threshold, thereby obtaining an optimized training model.
[0122] Alternatively, if the recall rate is lower than the second threshold, the neural network model is retrained after optimizing the positive samples until the recall rate is higher than the second threshold, thus obtaining an optimized training model.
[0123] The fourth acquisition module is used to acquire images of the industrial appearance quality of the equipment to be inspected.
[0124] The inspection module is used to input the industrial appearance quality inspection image into the optimized training model to obtain the inspection results. The inspection results include whether the installation sequence is incorrect, whether the installation direction is incorrect, and whether the appearance defect category is correctly identified.
[0125] This application also discloses a terminal device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor loads and executes the computer program, an industrial appearance quality inspection method is used.
[0126] The terminal device can be a computer device such as a desktop computer, a laptop computer, or a cloud server. The terminal device includes, but is not limited to, a processor and a memory. For example, the terminal device may also include input / output devices, network access devices, and buses.
[0127] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it in this regard.
[0128] The memory can be an internal storage unit of the terminal device, such as a hard disk or RAM of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) equipped on the terminal device. Furthermore, the memory can be a combination of internal storage units and external storage devices of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.
[0129] In this terminal device, an industrial appearance quality inspection method from the above embodiments is stored in the terminal device's memory and loaded and executed on the terminal device's processor for convenient use.
[0130] This application also discloses a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, it employs an industrial appearance quality inspection method as described in the above embodiments.
[0131] The computer program can be stored in a computer-readable medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or certain middleware. The computer-readable medium includes any entity or device capable of carrying computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the computer-readable medium includes, but is not limited to, the above-mentioned components.
[0132] The above-described industrial appearance quality inspection method is stored in the computer-readable storage medium and loaded and executed on the processor to facilitate the storage and application of the method.
[0133] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.
[0134] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.
Claims
1. A method for inspecting the appearance quality of industrial products, characterized in that, include: Obtain the type of equipment to be inspected; When the device type is a first inspection device type with an installation sequence and an installation direction, the first training data image set is obtained; The first training data image set is preprocessed to obtain a processed image set. Positive sample images with correct installation order, correct installation direction, and correct identification of appearance defect categories are obtained from the processed image set. Obtain negative sample images of the equipment to be inspected that have incorrect installation sequence, incorrect installation direction, or incorrect identification of appearance defect category, and label the negative sample images with errors; The neural network model is trained using positive and negative sample images to obtain the trained model; The trained model is evaluated using a test set to obtain true positive parameters, false negative parameters, false positive parameters, and true negative parameters. Precision and recall are then calculated based on these parameters. When the accuracy rate is lower than a first threshold, the model parameters of the training model are adjusted to optimize the training model until the accuracy rate is higher than the first threshold, thus obtaining an optimized training model. Alternatively, if the recall rate is lower than the second threshold, the training model is retrained after optimizing the positive samples until the recall rate is higher than the second threshold, thus obtaining an optimized training model. Obtain images of the industrial appearance quality of the equipment to be inspected; The industrial appearance quality inspection image is input into the optimized training model to obtain the inspection results, which include whether the installation sequence is incorrect, whether the installation direction is incorrect, and whether the appearance defect category is correctly identified.
2. The industrial appearance quality inspection method as described in claim 1, characterized in that, The preprocessing of the first training data image set to obtain a processed image set, and the extraction of positive sample images from the processed image set that show correct installation order, correct installation direction, and correct identification of appearance defect categories, include: Based on the equipment to be tested, the correct installation sequence and installation direction are determined; Obtain the identification codes for the installation order and installation direction; The processed image set is labeled according to the identification code and the correct appearance defect category, and used as positive sample images.
3. The industrial appearance quality inspection method as described in claim 2, characterized in that, The identification codes for obtaining the installation order and installation direction include: Based on the installation sequence, the relative positions, connection directions, and number of components of the equipment to be inspected are obtained; Based on the number of components and their relative positions, a position identifier is set; Set a direction identifier based on the connection direction; The location identifier and direction identifier are used as identification codes.
4. The industrial appearance quality inspection method as described in claim 1, characterized in that, The preprocessing of the first training data image set to obtain the processed image set includes: Obtain the image name of each image in the first training data image set; Duplicate images are filtered out based on their names to obtain the processed image set.
5. The industrial appearance quality inspection method as described in claim 3, characterized in that, The position identifier includes a separator, a stop symbol, and an order symbol; the direction identifier includes a left-right identifier and an up-down identifier.
6. The industrial appearance quality inspection method as described in claim 1, characterized in that, The first training data image set includes: Adjust the camera pointing direction according to the type of equipment to be inspected; According to the direction indicated by the camera, a number of training data images are taken to form the first training data image set.
7. The industrial appearance quality inspection method as described in claim 1, characterized in that, When the device type is a second inspection device type with no installation sequence and no installation direction, obtain the second training set; The second training set is labeled with appearance defect categories to obtain the standard set; The standard set is input into the neural network model for training to obtain the defect training model; The trained model is evaluated using an appearance test set to obtain true positive parameters, false negative parameters, false positive parameters, and true negative parameters. Precision and recall are then calculated based on these parameters. When the accuracy rate is lower than the first threshold, the model parameters of the defective training model are adjusted to optimize the training model until the accuracy rate is higher than the first threshold, thus obtaining an optimized training model. Alternatively, if the recall rate is lower than the second threshold, the defect training model is retrained after optimizing the standard set until the recall rate is higher than the second threshold, thus obtaining the optimized defect training model. Obtain images of the industrial appearance quality of the equipment to be inspected; The industrial appearance quality inspection image is input into the optimized defect training model to obtain the appearance defect category.
8. An industrial appearance quality inspection system, characterized in that, include: The first acquisition module is used to acquire the type of equipment to be inspected; The second acquisition module is used to acquire the first training data image set when the device type is a first inspection device type with an installation sequence and an installation direction. The preprocessing module is used to preprocess the first training data image set to obtain a processed image set, and to obtain positive sample images from the processed image set that are correctly installed in the correct order, correctly installed in the correct direction, and correctly identified in terms of appearance defect category. The third acquisition module is used to acquire negative sample images of equipment under inspection that have incorrect installation sequence, incorrect installation direction, or incorrect identification of appearance defect category, and to label the negative sample images with error tags. The training module is used to train the training model using positive and negative sample images to obtain the training model; The evaluation module is used to evaluate the trained model using a test set, obtain true positive parameters, false negative parameters, false positive parameters and true negative parameters, and calculate precision and recall based on the true positive parameters, false negative parameters, false positive parameters and true negative parameters; The optimization module is used to adjust the model parameters of the training model to optimize the training model when the accuracy is lower than a first threshold, until the accuracy is higher than the first threshold, thereby obtaining an optimized training model. Alternatively, if the recall rate is lower than the second threshold, the neural network model is retrained after optimizing the positive samples until the recall rate is higher than the second threshold, thus obtaining an optimized training model. The fourth acquisition module is used to acquire images of the industrial appearance quality of the equipment to be inspected. The inspection module is used to input the industrial appearance quality inspection image into the optimized training model to obtain the inspection results. The inspection results include whether the installation sequence is incorrect, whether the installation direction is incorrect, and whether the appearance defect category is correctly identified.
9. A terminal device, comprising a memory and a processor, characterized in that, The memory stores a computer program that can run on a processor, and when the processor loads and executes the computer program, it employs the verification method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is loaded and executed by the processor, the verification method as described in any one of claims 1 to 7 is employed.