An AI visual inspection method based on supervised and unsupervised deep learning
By combining supervised and unsupervised deep learning in AI visual inspection methods, the problems of traditional methods being unable to identify microscopic defects and the scarcity of defect samples are solved, achieving high-precision and high-robustness industrial wire harness inspection.
Patent Information
- Application Number
- CN202511190642.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Traditional AI visual inspection methods struggle to capture microscopic defects in industrial wire harness defect detection, lack generalization ability, and the scarcity of defect samples makes high-precision detection difficult.
By combining supervised and unsupervised deep learning, the system can quickly locate target regions through unsupervised learning, refine defect identification through supervised learning, autonomously identify new defects using unsupervised modules, and reduce training data by combining virtual defect generation technology.
Achieving high-precision and robust visual inspection with limited labeled data improves the ability to identify novel defects and is suitable for complex and ever-changing industrial inspection scenarios.
Smart Images

Figure CN120689699B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of AI visual detection, in particular to an AI visual detection method based on supervised and unsupervised deep learning. BACKGROUND
[0002] At present, AI technology is increasingly applied in the field of industrial product detection, and intelligent detection of industrial wire harnesses is a difficult problem in the industry due to its particularity. AI detection of industrial wire harnesses faces three technical challenges: first, the defect features of industrial wire harnesses often present microcosmic characteristics (such as micron-level scratches and terminal deformation), which are difficult to capture by traditional visual algorithms; second, industry standards require defect detection rates to reach 99.9% or more, which is a stringent standard close to zero missed detection; third, the actual production has a qualified rate of 99.5% or more, resulting in extremely scarce defect samples (the ratio of positive and negative samples may exceed 1000:1).
[0003] Traditional supervised detection methods have obvious limitations: on the one hand, a large-scale labeled data set (usually tens of thousands of positive and negative sample images) is required, but it is difficult to obtain sufficient defect samples in actual production; on the other hand, the model can only recognize defects that have appeared in the training set, and lacks the ability to generalize to new defects (such as unknown defects caused by sudden process abnormalities on the production line). SUMMARY
[0004] In view of the deficiencies of the prior art, the present application provides an AI visual detection method based on supervised and unsupervised deep learning, which quickly locates the target area through unsupervised learning, combines supervised learning to identify defects in detail, and finally outputs reliable results through multi-level verification.
[0005] To achieve the above purpose, the present application provides an AI visual detection method based on supervised and unsupervised deep learning, comprising:
[0006] S1, establishing a sampling image visual feature using real-time sampling image data;
[0007] S2, establishing an AI visual feature analysis model based on supervised and unsupervised deep learning using the sampling image visual feature;
[0008] S3, obtaining an AI visual detection result according to the AI visual feature analysis model.
[0009] Preferably, the establishment of a sampling image visual feature using real-time sampling image data comprises:
[0010] S1-1, collecting real-time sampling image data;
[0011] S1-2, establishing a real-time sampling image data pixel matrix according to the real-time sampling image data;
[0012] S1-3, obtaining a target region and a non-target region according to color characteristics of the industrial line bundle respectively by using the real-time sampling image data pixel matrix;
[0013] S1-4, using the target region and the non-target region as sampling image visual features.
[0014] Further, the AI visual feature analysis model is established based on supervised and unsupervised deep learning using the sampling image visual features, and the method comprises the following steps:
[0015] S2-1, establishing a basic AI visual feature rough identification model based on unsupervised deep learning using the sampling image visual features;
[0016] S2-2, establishing a basic AI visual feature fine identification model based on supervised deep learning using the sampling image visual features;
[0017] S2-3, obtaining an AI visual feature analysis model by using the basic AI visual feature rough identification model and the basic AI visual feature fine identification model.
[0018] Further, the basic AI visual feature rough identification model is established based on unsupervised deep learning using the sampling image visual features, and the method comprises the following steps:
[0019] S2-1-1, establishing a first data set by using the target region of the sampling image visual features;
[0020] S2-1-2, establishing a second data set by using the non-target region of the sampling image visual features;
[0021] S2-1-3, using the first data set and the second data set as input, and using the corresponding region boundary of the first data set and the second data set as output, and establishing a basic AI visual feature rough identification model based on unsupervised deep learning;
[0022] Wherein, the region boundary is a boundary pixel line of the target region and the non-target region.
[0023] Further, the basic AI visual feature fine identification model is established based on supervised deep learning using the sampling image visual features, and the method comprises the following steps:
[0024] S2-2-1, establishing a third data set by using the target region of the sampling image visual features to obtain the corresponding sampling image visual features of the historical target region;
[0025] S2-2-2, establishing a fourth data set by using the non-target region of the sampling image visual features to obtain the corresponding sampling image visual features of the historical non-target region;
[0026] S2-2-3, establishing a target region boundary segmentation model based on supervised deep learning, using the third data set as input and corresponding boundary pixels as output;
[0027] S2-2-4, establishing a non-target region boundary segmentation model based on supervised deep learning, using the fourth data set as input and corresponding boundary pixels as output;
[0028] S2-2-5, using the target region boundary segmentation model and the non-target region boundary segmentation model as a basic AI visual feature fine recognition model;
[0029] Wherein, the third data set corresponding boundary pixels and fourth data set corresponding boundary pixels do not exist the same pixel point.
[0030] Further, using the basic AI visual feature rough recognition model and the basic AI visual feature fine recognition model to obtain an AI visual feature analysis model includes:
[0031] S2-3-1, using the real-time sampling image data corresponding to the sampling image visual feature to input the basic AI visual feature rough recognition model and the basic AI visual feature fine recognition model respectively to obtain the basic AI visual feature rough recognition result and the basic AI visual feature fine recognition result;
[0032] S2-3-2, judging whether the pixel connection of the basic AI visual feature rough recognition result and the basic AI visual feature fine recognition result is consistent, if yes, using the basic AI visual feature rough recognition model and the basic AI visual feature fine recognition model as the AI visual feature analysis model, otherwise, updating the resolution of the real-time sampling image data, and returning to S1-2.
[0033] Further, according to the AI visual feature analysis model, an AI visual detection result is obtained, which includes:
[0034] S3-1, using the AI visual feature analysis model to obtain an initial AI visual detection result;
[0035] S3-2, according to the initial AI visual detection result, a trend feedback verification is performed to obtain an AI visual detection result.
[0036] Further, using the AI visual feature analysis model to obtain an initial AI visual detection result includes:
[0037] S3-1-1, according to the real-time sampling image data, a historical risk sampling image visual feature corresponding to the real-time sampling image data is obtained;
[0038] S3-1-2, acquire a risk pixel matrix as a first comparison template according to the historical risk sampling image visual features;
[0039] S3-1-3, acquire adjacent pixels as a second comparison template according to the first comparison template;
[0040] S3-1-4, acquire an initial AI visual detection result according to the first comparison template and the second comparison template by using the AI visual feature analysis model;
[0041] The historical risk sampling image visual features include historical risk target regions and historical risk non-target regions.
[0042] Further, acquiring an initial AI visual detection result according to the first comparison template and the second comparison template by using the AI visual feature analysis model includes:
[0043] S3-1-4-1, input the corresponding sampling image visual features of the real-time sampling image data into the AI visual feature analysis model to obtain an industrial line bundle data comprehensive analysis result;
[0044] S3-1-4-2, determine whether the industrial line bundle data comprehensive analysis result and the first comparison template have corresponding same regions, if yes, acquire adjacent pixels of the corresponding same regions as auxiliary verification regions, and perform S3-1-4-3, otherwise, directly perform S3-1-4-3;
[0045] S3-1-4-3, determine whether the industrial line bundle data comprehensive analysis result and the second comparison template have corresponding same regions, if yes, acquire contained pixels of the corresponding same regions as auxiliary verification regions, and perform S3-1-4-4, otherwise, directly perform S3-1-4-4;
[0046] S3-1-4-4, when there is any auxiliary verification region, use the auxiliary verification region as the initial AI visual detection result; when there is no auxiliary verification region, the initial AI visual detection result is empty.
[0047] Further, acquiring an initial AI visual detection result according to the initial AI visual detection result includes:
[0048] S3-2-1, acquire a corresponding time of the real-time sampling image data as a trend feedback verification starting time t;
[0049] S3-2-2, acquire initial AI visual detection results of t+1 and t+2 times, respectively;
[0050] S3-2-3, judging whether the initial AI visual detection result at the t+1 moment is same with the initial AI visual detection result at the trend feedback verification starting moment t, if yes, executing S3-2-4, otherwise, outputting the initial AI visual detection result at the trend feedback verification starting moment t as the AI visual detection result;
[0051] S3-2-4, judging whether the initial AI visual detection result at the t+2 moment is same with the initial AI visual detection result at the trend feedback verification starting moment t, if yes, updating the real-time sampling image data and returning to S1-1, otherwise, outputting the initial AI visual detection result at the trend feedback verification starting moment t as the AI visual detection result.
[0052] Compared with the closest prior art, the present application has the beneficial effects of:
[0053] Through the supervised and unsupervised hybrid learning architecture, combining the discriminative ability of deep learning and the advantage of unsupervised learning in anomaly detection, high-precision and high-robustness visual detection is realized under a small amount of labeled data, wherein the supervised main model is trained based on labeled data to ensure accurate identification of known defects, and the unsupervised auxiliary model has autonomous identification capability for new defects not seen before through self-supervised learning and anomaly detection algorithm (such as GAN, contrastive learning), the unsupervised module only needs a small amount of normal samples to model, combined with virtual defect generation technology (such as data enhancement, synthetic anomaly), reduces the training data, breaks through the limitations of traditional supervised models, improves the generalization ability while ensuring high precision, and is suitable for complex and variable industrial detection scenes. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1 is a flowchart of an AI visual detection method based on supervised and unsupervised deep learning provided by the present application;
[0055] Figure 2 is a specific implementation flowchart of an AI visual detection method based on supervised and unsupervised deep learning provided by the present application. DETAILED DESCRIPTION
[0056] The specific embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0057] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application. EMBODIMENT
[0058] The application provides an AI visual detection method based on supervised and unsupervised deep learning, as shown in the formula: Figure 1 The application provides an AI visual detection method based on supervised and unsupervised deep learning, as shown in the formula:
[0059] S1, using real-time sampling image data to establish sampling image visual features;
[0060] S2, using the sampling image visual features to establish an AI visual feature analysis model based on supervised and unsupervised deep learning;
[0061] S3, obtaining an AI visual detection result according to the AI visual feature analysis model.
[0062] S1 specifically includes:
[0063] S1-1, collecting real-time sampling image data;
[0064] S1-2, establishing a real-time sampling image data pixel matrix according to the real-time sampling image data;
[0065] S1-3, using the real-time sampling image data pixel matrix to obtain target areas and non-target areas according to color features of industrial wire harnesses;
[0066] S1-4, using the target areas and non-target areas as sampling image visual features.
[0067] S2 specifically includes:
[0068] S2-1, using the sampling image visual features to establish a basic AI visual feature rough identification model based on unsupervised deep learning;
[0069] S2-2, using the sampling image visual features to establish a basic AI visual feature fine identification model based on supervised deep learning;
[0070] S2-3, using the basic AI visual feature rough identification model and the basic AI visual feature fine identification model to obtain an AI visual feature analysis model.
[0071] S2-1 specifically includes:
[0072] S2-1-1, using target areas of the sampling image visual features to establish a first data set;
[0073] S2-1-2, using non-target areas of the sampling image visual features to establish a second data set;
[0074] S2-1-3, using the first data set and the second data set as input, the first data set and the second data set corresponding to the region boundary as output, establishing a basic AI visual feature rough identification model based on unsupervised deep learning;
[0075] Wherein, the region boundary is the boundary pixel connection line of the target region and the non-target region.
[0076] S2-2 specifically includes:
[0077] S2-2-1, according to the target region of the sampling image visual feature, a third data set is established by acquiring the historical target region of the corresponding sampling image visual feature;
[0078] S2-2-2, according to the non-target region of the sampling image visual feature, a fourth data set is established by acquiring the historical non-target region of the corresponding sampling image visual feature;
[0079] S2-2-3, using the third data set as input, the third data set corresponding to the boundary pixel as output, establishing a target region boundary segmentation model based on supervised deep learning;
[0080] S2-2-4, using the fourth data set as input, the fourth data set corresponding to the boundary pixel as output, establishing a non-target region boundary segmentation model based on supervised deep learning;
[0081] S2-2-5, using the target region boundary segmentation model and the non-target region boundary segmentation model as a basic AI visual feature fine identification model;
[0082] Wherein, the third data set corresponding boundary pixel and the fourth data set corresponding boundary pixel do not exist the same pixel point.
[0083] S2-3 specifically includes:
[0084] S2-3-1, using the corresponding sampling image visual feature of the real-time sampling image data to input the basic AI visual feature rough identification model and the basic AI visual feature fine identification model respectively to obtain the basic AI visual feature rough identification result and the basic AI visual feature fine identification result;
[0085] S2-3-2, judging whether the pixel connection line of the basic AI visual feature rough identification result and the basic AI visual feature fine identification result is consistent, if yes, using the basic AI visual feature rough identification model and the basic AI visual feature fine identification model as the AI visual feature analysis model, otherwise, updating the resolution of the real-time sampling image data, and returning to S1-2.
[0086] S3 specifically includes:
[0087] S3-1, obtaining an initial AI visual detection result by using the AI visual feature analysis model;
[0088] S3-2, obtaining an AI visual detection result by trend feedback verification according to the initial AI visual detection result.
[0089] S3-1 specifically includes:
[0090] S3-1-1, obtaining a historical risk sampling image visual feature corresponding to the real-time sampling image data according to the real-time sampling image data;
[0091] S3-1-2, obtaining a risk pixel matrix as a first comparison template according to the historical risk sampling image visual feature;
[0092] S3-1-3, obtaining adjacent pixels as a second comparison template according to the first comparison template;
[0093] S3-1-4, obtaining an initial AI visual detection result according to the first comparison template and the second comparison template by using the AI visual feature analysis model;
[0094] The historical risk sampling image visual feature includes a historical risk target region and a historical risk non-target region.
[0095] S3-1-4 specifically includes:
[0096] S3-1-4-1, inputting the corresponding sampling image visual feature of the real-time sampling image data into the AI visual feature analysis model to obtain an industrial harness data comprehensive analysis result;
[0097] S3-1-4-2, determining whether the industrial harness data comprehensive analysis result and the first comparison template exist corresponding same regions, if yes, obtaining adjacent pixels of the corresponding same regions as auxiliary verification regions, and executing S3-1-4-3, otherwise, directly executing S3-1-4-3;
[0098] S3-1-4-3, determining whether the industrial harness data comprehensive analysis result and the second comparison template exist corresponding same regions, if yes, obtaining contained pixels of the corresponding same regions as auxiliary verification regions, and executing S3-1-4-4, otherwise, directly executing S3-1-4-4;
[0099] S3-1-4-4, when there is any auxiliary verification region, using the auxiliary verification region as the initial AI visual detection result; when there is no auxiliary verification region, the initial AI visual detection result is empty.
[0100] S3-2 specifically includes:
[0101] S3-2-1. Obtain the time corresponding to the real-time sampled image data as the starting time t for trend feedback verification;
[0102] S3-2-2, Obtain the initial AI visual detection results at time t+1 and time t+2 respectively;
[0103] S3-2-3. Determine whether the initial AI visual detection result at time t+1 is the same as the initial AI visual detection result at the start time t of the trend feedback verification. If so, execute S3-2-4. Otherwise, output the initial AI visual detection result at the start time t of the trend feedback verification as the AI visual detection result.
[0104] S3-2-4. Determine whether the initial AI visual detection result at time t+2 is the same as the initial AI visual detection result at the start time t of the trend feedback verification. If so, update the real-time sampled image data and return to S1-1. Otherwise, output the initial AI visual detection result at the start time t of the trend feedback verification as the AI visual detection result.
[0105] In this embodiment, an AI visual detection method based on supervised and unsupervised deep learning is described, such as... Figure 2 As shown, in the field of visual AI detection, the minimum training sample size (denoted as Smin) for deep learning algorithms depends on various factors, such as different visual detection scenarios, different types of visual defects, and different visual defect recognition levels. Once Smin is determined, the optimal actual sample size (denoted as Sact) for training, validating, and testing the deep learning model is further determined based on the actual image data acquisition conditions. The actual sample size for supervised learning AI models differs from that for unsupervised learning AI models. The specific steps are as follows:
[0106] S0-1: Determine the common Smin for supervised learning AI models and unsupervised learning AI models;
[0107] Based on the actual application scenario, determine the minimum learning sample size for the supervised learning AI model, denoted as S1min; then determine the minimum learning sample size for the unsupervised learning AI model, denoted as S2min.
[0108] Since supervised learning AI models and unsupervised learning AI models are used together for sample prediction in the same application scenario, it is necessary to determine the minimum number of learning samples that simultaneously satisfies the training of both models, denoted as Smin. The calculation method is: Smin=max{S1min, S2min}.
[0109] S0-2: Determine the actual sample size of the supervised learning AI model, denoted as S1act;
[0110] S0-2-1, assuming the number of folds of multi-fold cross-validation is n, and the minimum learning sample size Smin is used for both training and validation, then:
[0111] The number of samples required for training: Strain = ((n-1) / n) * Smin
[0112] The number of samples required for validation: Sval = (1 / n) * Smin
[0113] In addition, a sample set for independent testing is required:
[0114] The number of samples required for testing: Stest = (1 / n) * Smin
[0115] Therefore, the actual sample size Sact = Strain + Sval + Stest = ((n+1) / (n-1)) * Smin
[0116] S0-2-2, in this embodiment, the number of folds n of fold cross-validation is in the interval [3, 10], then:
[0117] When n = 3, Sact = ((3+1) / (3-1)) * Smin = 2 Smin
[0118] When n = 10, Sact = ((10+1) / (10-1)) * Smin = 1.222 Smin
[0119] Therefore, according to the actual imaging conditions, collect 1.222-2 times the minimum learning sample size;
[0120] S0-3: Determine the actual sample size of the unsupervised learning AI model, denoted as S2act
[0121] S0-3-1, unlike supervised learning AI models, unsupervised learning AI models mainly train models by learning features of positive samples and applying positive and negative samples for validation, so the number of folds of positive sample multi-fold cross-validation is n = 3, and the minimum learning sample size Smin includes 3 positive samples (denoted as Sp) and 1 negative sample (denoted as Sn): Smin = 3Sp + Sn, denoted as: Smin-p = 3Sp, Smin-n = Sn, Smin = Smin-p + Smin-n
[0122] S0-3-1, sample allocation method of unsupervised learning AI model:
[0123] Sample allocation in the training and validation phase:
[0124] The number of samples required for training: Strain = 2Sp
[0125] Validation required sample size: Sval = Sp + Sn
[0126] In addition, the sample set for independent testing is required:
[0127] Test required sample size: Stest = Sp + Sn
[0128] Therefore, the actual sample size Sact = Strain + Sval + Stest = 4Sp + 2Sn
[0129] Finally, the actual sample size Sact = (4 / 3) * Smin-p + 2 * Smin-n.
[0130] In this embodiment, an AI visual detection method based on supervised and unsupervised deep learning is provided, and the specific implementation is as follows:
[0131] Hardware preparation configuration:
[0132] Image acquisition module:
[0133] Industrial camera (20 million pixels, RGB + polarized light mode);
[0134] Ring LED light source (wavelength adjustable, suitable for different wire bundle colors);
[0135] Conveyer belt synchronous triggering device (ensure wire bundle positioning accuracy ±0.1mm);
[0136] Processing terminal:
[0137] NVIDIA Jetson AGX Orin edge computing unit;
[0138] 64GB memory, 2TB SSD storage;
[0139] Real-time sampling image feature establishment (S1)
[0140] Image acquisition (S1-1)
[0141] The camera collects the images of the moving wire bundle on the conveyer belt at 30fps, with a resolution of 4096x2160, and polarized light mode enhances surface reflection suppression.
[0142] Example: Collect contrast images of red power cord (target area) and black background (non-target area).
[0143] Pixel matrix construction (S1-2)
[0144] Convert the image to an HSV color space matrix and extract the saturation (S) and brightness (V) channels:
[0145] The deployment code includes:
[0146] import cv2
[0147] img_hsv = cv2.cvtColor(raw_img, cv2.COLOR_BGR2HSV)
[0148] saturation_matrix = img_hsv[:,:,1] # Saturation channel
[0149] Region segmentation (S1-3):
[0150] Target region: Extract the wire bundle body by threshold segmentation (e.g., red area saturation > 100 and brightness > 50).
[0151] Non-target region: Fill small holes in the background using morphological closing operation.
[0152] Output: Binary mask (target region = 1, non-target region = 0).
[0153] Visual feature generation (S1-4)
[0154] Merge target / non-target region coordinates and HSV statistical features (mean, variance) as visual feature vectors.
[0155] AI model training (S2)
[0156] Unsupervised rough recognition model (S2-1)
[0157] Dataset: 100,000 unlabeled wire bundle images, automatically divided into regions by K-means clustering (k=3).
[0158] Model output: Generate the approximate boundary of the target region.
[0159] Supervised fine recognition model (S2-2)
[0160] Dataset: 50,000 labeled images (Labelme annotation tool marks accurate boundary).
[0161] Model architecture:
[0162] Target region segmentation: U-Net model, input is HSV matrix, output is pixel-level boundary (IoU>0.95).
[0163] Non-target region segmentation: Same architecture, but exclude pixels overlapping with the target region during training.
[0164] Model fusion verification (S2-3)
[0165] Fitting decision: Calculate Hausdorff distance between the output boundaries of two models (threshold < 5 pixels).
[0166] Resolution adjustment: If not passed, reprocess the image after resolution is increased to 5120x2700.
[0167] Defect detection and verification (S3)
[0168] Initial detection (S3-1)
[0169] Risk template library:
[0170] Primary template: HSV feature of historical defects (e.g. local low saturation for insulation layer breakage).
[0171] Secondary template: Gradient change feature within 10 pixels around the defect.
[0172] Deployment comparison code as follows:
[0173] graph TD
[0174] A[Input real-time image] --> B{Match primary template?}
[0175] B -->|Yes| C[Mark defect core area]
[0176] B -->|No| D{Match secondary template?}
[0177] D -->|Yes| E[Mark suspected defect area]
[0178] D -->|No| F[Output "No defect"]
[0179] Trend feedback verification (S3-2)
[0180] Multi-period verification:
[0181] False alarm processing: Trigger alarm if the same defect is detected for two consecutive times, otherwise re-sample.
[0182] Those skilled in the art will appreciate that embodiments of the present application can be provided as methods, systems, or computer program products. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.
[0183] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in the flowchart block or blocks.
[0184] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in the flowchart block or blocks.
[0185] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in the flowchart block or blocks.
[0186] Finally, it should be noted that the above-mentioned embodiments are merely intended to illustrate the technical solutions of the present application, but not to limit the same. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that the technical solutions of the present application can still be modified or equivalent replaced without departing from the spirit and scope of the present application, and any modification or equivalent replacement should be covered within the scope of protection of the claims of the present application.
Claims
1. An AI visual inspection method based on supervised and unsupervised deep learning, characterized in that, The method comprises the following steps: S1, establishing a sampling image visual feature by using real-time sampling image data, wherein the sampling image visual feature comprises a target region and a non-target region, the target region is a region where an industrial wire harness body is located, and the non-target region is a background region other than the industrial wire harness body; S2, establishing an AI visual feature analysis model based on supervised and unsupervised deep learning by using the sampling image visual feature; S3-1-1, obtaining a historical risk sampling image visual feature corresponding to real-time sampling image data according to the real-time sampling image data; S3-1-2, obtaining a risk pixel matrix as a first comparison template according to the historical risk sampling image visual feature; S3-1-3, obtaining adjacent pixels as a second comparison template according to the first comparison template; S3-1-4-1, inputting the corresponding sampling image visual feature of the real-time sampling image data into the AI visual feature analysis model to obtain an industrial wire harness data comprehensive analysis result; S3-1-4-2, judging whether the industrial wire harness data comprehensive analysis result and the first comparison template exist in a corresponding same region, if yes, an initial AI visual detection result is a marked defect core region, otherwise, S3-1-4-3 is executed; S3-1-4-3, judging whether the industrial wire harness data comprehensive analysis result and the second comparison template exist in a corresponding same region, if yes, the initial AI visual detection result is a marked suspected defect region, otherwise, the initial AI visual detection result is output without defect; S3-2-1, obtaining a corresponding time of the real-time sampling image data as a trend feedback verification starting time t; S3-2-2, obtaining initial AI visual detection results at t+1 and t+2 respectively; S3-2-3, judging whether the initial AI visual detection result at t+1 and the initial AI visual detection result at the trend feedback verification starting time t are the same, if yes, S3-2-4 is executed, otherwise, the real-time sampling image data is updated and the process returns to S1-1; S3-2-4, judging whether the initial AI visual detection result at t+2 and the initial AI visual detection result at the trend feedback verification starting time t are the same, if yes, an alarm is triggered, otherwise, the real-time sampling image data is updated and the process returns to S1-1.
2. The AI vision detection method based on supervised and unsupervised deep learning according to claim 1, wherein, The method for establishing a sampling image visual feature by using real-time sampling image data comprises the following steps: S1-1, collecting real-time sampling image data; S1-2, establishing a real-time sampling image data pixel matrix according to the real-time sampling image data; S1-3, obtaining a target region and a non-target region according to color characteristics of an industrial wire harness by using the real-time sampling image data pixel matrix; S1-4, using the target region and the non-target region as a sampling image visual feature.
3. The AI vision detection method based on supervised and unsupervised deep learning according to claim 2, wherein, The method for establishing an AI visual feature analysis model based on supervised and unsupervised deep learning by using the sampling image visual feature comprises the following steps: S2-1, establishing a basic AI visual feature rough identification model based on unsupervised deep learning by using the sampling image visual feature; S2-2, establishing a basic AI visual feature fine identification model based on supervised deep learning by using the sampling image visual feature; S2-3, obtaining an AI visual feature analysis model by using the basic AI visual feature coarse recognition model and the basic AI visual feature fine recognition model.
4. The AI vision detection method based on supervised and unsupervised deep learning according to claim 3, wherein, The basic AI visual feature coarse recognition model is established based on unsupervised deep learning using the visual features of the sampling images, and includes the following steps: S2-1-1, establishing a first data set using the target region of the visual features of the sampling images; S2-1-2, establishing a second data set using the non-target region of the visual features of the sampling images; S2-1-3, establishing a basic AI visual feature coarse recognition model based on unsupervised deep learning using the first data set and the second data set as input, and using the corresponding region boundary of the first data set and the second data set as output; Wherein, the region boundary is the boundary pixel connection line of the target region and the non-target region.
5. The AI vision detection method based on supervised and unsupervised deep learning according to claim 4, wherein, The basic AI visual feature fine recognition model is established based on supervised deep learning using the visual features of the sampling images, and includes the following steps: S2-2-1, establishing a third data set using the historical target region of the corresponding sampling image visual features according to the target region of the sampling image visual features; S2-2-2, establishing a fourth data set using the historical non-target region of the corresponding sampling image visual features according to the non-target region of the sampling image visual features; S2-2-3, establishing a target region boundary segmentation model based on supervised deep learning using the third data set as input and the corresponding boundary pixels of the third data set as output; S2-2-4, establishing a non-target region boundary segmentation model based on supervised deep learning using the fourth data set as input and the corresponding boundary pixels of the fourth data set as output; S2-2-5, using the target region boundary segmentation model and the non-target region boundary segmentation model as the basic AI visual feature fine recognition model; wherein, the corresponding boundary pixels of the third data set and the corresponding boundary pixels of the fourth data set do not exist the same pixel points.
Citation Information
Patent Citations
Supervision and non-supervision combined industrial defect detection method
CN118505608A