A quality detection method, device, equipment and storage medium based on basic large model

Through the quality detection method based on the basic large model, the feature extraction and comparison are used for pre-trained models, and the automatic detection is carried out in combination with specific quality inspection models, the problems of poor quality detection efficiency and low accuracy in the existing technology are solved, and more efficient and accurate quality detection is achieved.

CN119251190BActive Publication Date: 2025-05-23ZHONGGUANCUN ROBOT IND INNOVATION DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411359115.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-05-23
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

In the prior art, quality inspection efficiency is poor and accuracy is low, especially when product design changes, detection rules need to be reset, and it is difficult to identify defects in complex product surface features.

Method used

The quality detection method based on the basic large model is adopted, and the historical image data of the product to be detected is collected, the feature extraction is performed using the pre-trained basic large model, and compared it with the standard product feature library to determine the preliminary quality level. Then, based on historical image data with preliminary quality levels, a specific quality inspection model is trained to automatically detect the current product image data.

Benefits of technology

显著提升了质量检测的效率和准确性,降低了人工参与成本,提高了整体生产效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251190B_ABST
    Figure CN119251190B_ABST
Patent Text Reader

Abstract

The present application provides a quality inspection method, device, equipment and storage medium based on a basic large model. Among them, historical image data of the product to be inspected is collected; the pre-trained basic large model is used to extract features from the historical image data, and the extracted features are compared and analyzed with the features in the standard product feature library to determine the preliminary quality grade of the product to be inspected; based on the historical image data with the preliminary quality grade, a specific quality inspection model for the product to be inspected is trained; the specific quality inspection model is used to automatically inspect the quality of the collected current product image data, and the automatic quality inspection includes outputting a predicted quality grade. The technical solution provided by the present application can not only significantly improve the efficiency and accuracy of quality inspection, but also reduce labor costs and improve overall production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of product quality inspection, and in particular, to a quality inspection method, device, equipment and storage medium based on a basic large model. Background Art

[0002] In modern manufacturing, product quality control is one of the most important links. With the continuous improvement of production automation, traditional manual inspection methods can no longer meet the needs of high efficiency and high precision. Especially for standardized products produced on a large scale, how to quickly and accurately conduct quality inspection has become an urgent problem to be solved.

[0003] The common quality inspection methods on the market currently mainly rely on visual inspection systems, which usually use fixed rules or template matching to perform quality inspection.

[0004] However, these methods require resetting the inspection rules or templates when the product design changes, which often requires a lot of manual participation. Traditional methods are difficult to effectively identify new types of defects that have never been seen. They rely on fixed rules or templates and may not be able to accurately identify certain types of defects for complex product surface features, resulting in poor quality inspection efficiency and low quality inspection accuracy. Summary of the invention

[0005] The embodiments of the present application provide a quality detection method, device, equipment and storage medium based on a basic large model, so as to solve the problems of poor quality detection efficiency and low quality detection accuracy in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a quality detection method based on a basic large model, comprising:

[0007] Collect historical image data of the product to be inspected;

[0008] Extract features from the historical image data using a pre-trained basic large model, and compare and analyze the extracted features with features in a standard product feature library to determine a preliminary quality grade of the product to be inspected;

[0009] Training a specific quality inspection model for the product to be inspected based on historical image data with preliminary quality grades;

[0010] The specific quality inspection model is used to perform automatic quality inspection on the collected current product image data, and the automatic quality inspection includes outputting a predicted quality grade.

[0011] Optionally, the extracting features of the historical image data using a pre-trained basic large model includes:

[0012] Fine-tune the basic large model to meet the feature extraction requirements of the product to be tested;

[0013] The key feature vectors of the historical image data are extracted through the fine-tuned basic large model to achieve feature extraction of the historical image data.

[0014] Optionally, comparing and analyzing the extracted features with features in a standard product feature library to determine a preliminary quality grade of the product to be tested includes:

[0015] Calculate the target similarity between the feature vector corresponding to the extracted feature and the feature vector corresponding to each feature in the standard product feature library;

[0016] The target similarity is calculated according to the following formula group:

[0017] similarity improved =cos(θ)·exp(-α||AB i || 2 )

[0018]

[0019] Among them, similarity improved represents the intermediate similarity, θ is the angle between two feature vectors, α is a positive parameter used to control the degree of influence between feature vectors, A is the feature vector corresponding to the extracted feature, and B i is the i-th feature vector in the standard product feature library, similarity weighted represents the target similarity, w i is the weight of the ith feature vector, which is determined by the importance of the feature vector, and n is the number of feature vectors in the standard product feature library;

[0020] Determining a comprehensive similarity score based on the target similarity;

[0021] The comprehensive similarity score is compared with a preset quality grade threshold to determine the preliminary quality grade of the product to be tested.

[0022] Optionally, the training of a specific quality inspection model for the product to be inspected based on the historical image data with preliminary quality grades includes:

[0023] The target similarity is used as an input feature and combined with historical image data with preliminary quality levels for training to obtain a specific quality inspection model;

[0024] During the training process, the cross-validation method is used to optimize the parameters of the specific quality inspection model, a regularization term is introduced to avoid overfitting, and the loss function of the specific quality inspection model is defined as:

[0025] Where w and b are the parameters and bias terms of the specific quality inspection model, respectively, and x i and i They represent the feature vector and preliminary quality level of the i-th sample respectively, f(x;w,b) represents the model prediction output, and λ is the regularization coefficient.

[0026] Optionally, the loss function of the specific quality inspection model is also defined as:

[0027] L adv (w, b, x i ,y i )=max δ∈Δ L(w, b, x i +δ,y i );

[0028] Among them, Δ defines the range of the disturbance δ to ensure the rationality of the disturbance.

[0029] Optionally, determining a comprehensive similarity score according to the target similarity includes:

[0030] By formula: determining a composite similarity score;

[0031] Among them, S complex Expressed as a comprehensive similarity score; w i is the weight of the i-th eigenvector, which is determined by the importance of the eigenvector; similarity weighted,i Represented as the i-th standard product feature vector B i The target similarity with the feature vector A of the product to be detected; similarity weighted,j Represented as the jth standard product feature vector B i The target similarity with the feature vector A of the product to be detected; γ ij It is represented as the mutual influence coefficient between the i-th eigenvector and the j-th eigenvector; n is represented as the number of eigenvectors in the standard product feature library.

[0032] In a second aspect, an embodiment of the present application provides a quality detection device based on a basic large model, comprising:

[0033] An image acquisition module, used to acquire image data of the product to be inspected;

[0034] A feature analysis module is used to extract features from the preprocessed image data using a pre-trained basic large model, compare and analyze the extracted features with the features in the standard product feature library, and determine the preliminary quality grade of the product to be tested;

[0035] A model training module, used for training a specific quality inspection model for the product to be inspected based on historical image data with preliminary quality grades;

[0036] The quality inspection module is used to use the specific quality inspection model to perform automatic quality inspection on the collected current product image data, and the automatic quality inspection includes outputting a predicted quality grade.

[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the quality detection method based on the basic large model as described in any one of the first aspects above.

[0038] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the quality detection method based on the basic large model as described in any one of the first aspects.

[0039] In the embodiment of the present application, historical image data of the product to be inspected is collected; the pre-trained basic large model is used to extract features from the historical image data, and the extracted features are compared and analyzed with the features in the standard product feature library to determine the preliminary quality grade of the product to be inspected; based on the historical image data with the preliminary quality grade, a specific quality inspection model for the product to be inspected is trained; the specific quality inspection model is used to perform automatic quality inspection on the collected current product image data, and the automatic quality inspection includes outputting a predicted quality grade. This can significantly improve the efficiency and accuracy of quality inspection, and can also reduce labor costs and improve overall production efficiency.

[0040] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1A flow chart of a quality detection method based on a basic large model provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of the structure of a quality detection device based on a basic large model provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0046] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0048] Figure 1 A flowchart of a quality detection method based on a basic large model is provided for an embodiment of the present application, such as Figure 1 As shown, the method includes:

[0049] 101. Collect historical image data of the product to be tested;

[0050] This step mainly involves collecting historical image data of the product to be inspected. The historical image data here refers to the image data collected during or before the product production process, which can be used to train and verify the subsequent quality inspection model. The purpose of collecting this data is to enable the model to learn the normal appearance characteristics of the product and the characteristics of various quality problems that may occur, so as to perform effective quality inspection in the subsequent steps.

[0051] In the embodiment of the present application, it is assumed that we are developing a quality inspection method based on a basic large model to detect surface defects of automotive parts, such as scratches, cracks, etc.

[0052] Acquisition equipment: Use industrial cameras (IC) to photograph automotive parts on the production line to ensure that the acquired images are clear and high-resolution for subsequent feature extraction.

[0053] Collection environment: Ensure uniform lighting in the collection environment to reduce image quality differences caused by light changes. You can install special lighting equipment (LE), such as LED light panels, to ensure stable light conditions.

[0054] Image data types: Image data in various states are collected, including standard product images without defects and images of defective products of different types, such as slight scratches and severe cracks. At least 500 images are collected for each defect type, and a total of about 5,000 images are collected as historical image data sets.

[0055] Image data preprocessing: Perform necessary preprocessing operations on the collected images, such as size standardization, grayscale processing, denoising, etc., to improve the effect of subsequent feature extraction.

[0056] Annotate data: Annotate the collected image data to mark the location and type of defects. You can use the Image Annotation Tool (IAT) to assist in this task.

[0057] Dataset division: The historical image dataset is divided into a training set (TS), a validation set (VS), and a test set (TS). For example, the ratio can be 70%, 15%, and 15% to ensure that the model can perform well on different datasets.

[0058] Dataset statistics: In order to better understand the characteristics of the dataset, statistical analysis is performed on the dataset, such as calculating the distribution ratio of various defects, image size distribution, etc. For example, it is found that minor scratches account for 30% of all defects, severe cracks account for 10%, etc.

[0059] Example Calculation

[0060] Suppose we collected 5000 images, of which:

[0061] Defect-free standard product images: 2,500

[0062] Minor scratches: 1000 sheets;

[0063] Severe cracks: 500 sheets;

[0064] Other defects: 1000 sheets;

[0065] Dataset division:

[0066] Training set (TS): 3500 images;

[0067] Validation set (VS): 750 images;

[0068] Test set (TS): 750 images;

[0069] Assume that some image augmentation technique (IAT) is used to expand the size of the training set to improve the generalization ability of the model. For example, for each original image, a new image is generated by rotating, flipping, scaling, etc. Assume that for each original image, 4 enhanced images are generated, then the actual size of the training set is 14,000.

[0070] In this way, through data augmentation technology, the actual size of the training set increased from 3,500 to 14,000, greatly increasing the amount of data for model training and helping to improve the robustness and generalization ability of the model.

[0071] Through the above embodiments, we can see that collecting historical image data is an important foundation for constructing a quality inspection method based on a basic large model, which ensures the effective implementation of subsequent steps.

[0072] 102. Extract features from the historical image data using the pre-trained basic large model, and compare and analyze the extracted features with features in the standard product feature library to determine the preliminary quality grade of the product to be tested;

[0073] Optionally, in step 102, “using the pre-trained basic large model to extract features from the historical image data” further includes:

[0074] The basic large model is fine-tuned to adapt to the feature extraction requirements of the product to be detected; the key feature vectors of the historical image data are extracted through the fine-tuned basic large model to achieve feature extraction of the historical image data.

[0075] Optionally, step 102 of “comparing and analyzing the extracted features with the features in the standard product feature library to determine the preliminary quality grade of the product to be tested” includes:

[0076] Calculate the target similarity between the feature vector corresponding to the extracted feature and the feature vector corresponding to each feature in the standard product feature library;

[0077] The target similarity is calculated according to the following formula group:

[0078] similarity improved =cos(θ)·exp(-α||AB i || 2 )

[0079]

[0080] Among them, similarity improved represents the intermediate similarity, θ is the angle between two feature vectors, α is a positive parameter used to control the degree of influence between feature vectors, A is the feature vector corresponding to the extracted feature, and B i is the i-th feature vector in the standard product feature library, similarity weighted represents the target similarity, w i is the weight of the ith feature vector, which is determined by the importance of the feature vector, and n is the number of feature vectors in the standard product feature library;

[0081] Determining a comprehensive similarity score based on the target similarity;

[0082] The comprehensive similarity score is compared with a preset quality grade threshold to determine the preliminary quality grade of the product to be tested.

[0083] Wherein, determining a comprehensive similarity score according to the target similarity includes:

[0084] By formula: determining a composite similarity score;

[0085] Among them, S complex Expressed as a comprehensive similarity score; w i is the weight of the i-th eigenvector, which is determined by the importance of the eigenvector; similarity weighted,i Represented as the i-th standard product feature vector B i The target similarity with the feature vector A of the product to be detected; similarity weighted,j Represented as the jth standard product feature vector B i The target similarity with the feature vector A of the product to be detected; γ ij It is represented as the mutual influence coefficient between the i-th eigenvector and the j-th eigenvector; n is represented as the number of eigenvectors in the standard product feature library.

[0086] In this step, the pre-trained basic large model usually refers to a deep learning model that has been trained on a large dataset, such as a convolutional neural network (CNN). This type of model can learn general image feature representations and provide a good starting point for subsequent tasks.

[0087] Feature extraction: refers to the use of pre-trained models to extract key features in images. These features can be edges, textures, shapes, etc.

[0088] Fine-tuning: It means further training the model using data from a specific field based on the pre-trained model to make it better suited to specific task requirements.

[0089] Feature vector: a set of values ​​extracted by the model, representing the main features of the image.

[0090] Standard product feature library: It is a set of feature vectors of known qualified products, which are used for comparison and analysis with the feature vectors of the products to be tested.

[0091] Preliminary quality grade: Based on the results of feature vector comparison, the quality level of the product is preliminarily judged.

[0092] In the embodiment of the present application, continuing to take the above-mentioned automobile parts quality inspection as an example, we will introduce in detail how to use the pre-trained basic large model to extract features and determine the preliminary quality grade.

[0093] Selection and fine-tuning of pre-trained models: Selection of pre-trained models: Select the pre-trained ResNet-50 model (Residual Network, ResNet) as the basic large model. It has been pre-trained on the ImageNet dataset and has good image feature extraction capabilities.

[0094] Fine-tune the model: Use the training set portion (3,500 images) of the 5,000 image dataset collected in step 101 to fine-tune the ResNet-50 model to meet the feature extraction requirements of surface defects of automotive parts. The fine-tuning process can include freezing some layers of the model, training only the last few layers, or completely retraining all layers of the model.

[0095] Feature extraction: Use the fine-tuned ResNet-50 model to extract features from the 5,000 image datasets collected in step 101 to obtain the key feature vectors of each image. Assume that the dimension of each feature vector is 1024.

[0096] Standard product feature library: Based on defect-free standard product images (2,500 images), the same fine-tuning model is used to extract feature vectors and establish a standard product feature library. Feature vector comparison and preliminary quality grade determination:

[0097] Target similarity calculation: For each image of the product to be detected, calculate its feature vector A and each feature vector B in the standard product feature library i The intermediate similarity between improved , using cosine similarity combined with Gaussian kernel function:

[0098] similarity improved =cos(θ)·exp(-α||AB i || 2 )

[0099] Where θ is the angle between two eigenvectors, α is a positive parameter (for example, set to 0.01), which is used to control the degree of influence between eigenvectors, specifically, the degree of influence of the distance between eigenvectors, A is the eigenvector corresponding to the extracted feature, and B i is the i-th feature vector in the standard product feature library.

[0100] Furthermore, based on the intermediate similarity, the target similarity needs to be further calculated, wherein the calculation formula of the target similarity is as follows:

[0101]

[0102] Among them, A is the feature vector corresponding to the extracted feature, B i is the i-th feature vector in the standard product feature library, similarity weighted represents the target similarity, w i is the weight of the ith feature vector, which is determined by the importance of the feature vector and can be set according to the frequency of occurrence of the feature vector in the training set. n is the number of feature vectors in the standard product feature library.

[0103] Calculation of comprehensive similarity score: Finally determine the comprehensive similarity score S complex , considering the mutual influence between eigenvectors:

[0104]

[0105] Among them, S complex Expressed as a comprehensive similarity score; w i is the weight of the i-th eigenvector, which is determined by the importance of the eigenvector; similarity weighted,iRepresented as the i-th standard product feature vector B i The target similarity with the feature vector A of the product to be detected; similarity weighted,j Represented as the jth standard product feature vector B i The target similarity with the feature vector A of the product to be detected; γ ij It is represented as the mutual influence coefficient between the i-th eigenvector and the j-th eigenvector; n is represented as the number of eigenvectors in the standard product feature library.

[0106] Initial quality grade determination:

[0107] The comprehensive similarity score S complex is compared with the preset quality level threshold. For example, if S complex >0.9, it is judged as high quality level; 0.7 complex ≤0.9 is medium quality grade; S complex ≤0.7 is a low quality grade.

[0108] 103. Training a specific quality inspection model for the product to be inspected based on historical image data with preliminary quality grades;

[0109] Optionally, in step 103, “training a specific quality inspection model for the product to be inspected based on historical image data with preliminary quality grades” includes:

[0110] The target similarity is used as an input feature and combined with historical image data with preliminary quality levels for training to obtain a specific quality inspection model;

[0111] During the training process, the cross-validation method is used to optimize the parameters of the specific quality inspection model, a regularization term is introduced to avoid overfitting, and the loss function of the specific quality inspection model is defined as:

[0112] Where w and b are the parameters and bias terms of the specific quality inspection model, respectively, and x i and i They represent the feature vector and preliminary quality level of the i-th sample respectively, f(x;w,b) represents the model prediction output, and λ is the regularization coefficient.

[0113] The loss function of the specific quality inspection model is also defined as:

[0114] L adv (w, b, x i ,y i )=max δ∈Δ L(w, b, x i +δ,y i ​);

[0115] Among them, Δ defines the range of the disturbance δ to ensure the rationality of the disturbance.

[0116] In this step, a specific quality inspection model is developed: This is a machine learning model that is customized for the product to be inspected and aims to predict the quality level of the product based on its feature vector.

[0117] Target similarity: The similarity between the feature vectors calculated in the previous step is used to measure the similarity between the product to be tested and the standard product.

[0118] Cross-validation: A method for evaluating model performance by dividing the dataset into several subsets and using one of the subsets as the test set and the remaining subsets as the training set to evaluate the model's generalization ability.

[0119] Regularization term: A penalty term added to the loss function to prevent the model from overfitting, that is, the model performs too well on the training data and performs poorly on new data.

[0120] Loss function: A function that measures the difference between the model's predicted results and the actual results, used to guide the learning and optimization of model parameters.

[0121] Adversarial training: A method to improve the robustness of a model by adding small perturbations to the training data to train the model so that the model can resist small input changes.

[0122] In the embodiment of the present application, continuing to take the above-mentioned quality inspection of automobile parts as an example, we will introduce in detail how to train a specific quality inspection model based on historical image data with preliminary quality grades.

[0123] Feature vector comparison and preliminary quality level determination:

[0124] Target similarity calculation: For each image of the product to be detected, calculate its feature vector A and each feature vector B in the standard product feature library i Similarity between targets weighted ;

[0125] Training a specific QA model:

[0126] Model selection: Support Vector Machine (SVM) is selected as the basic model for the specific quality inspection model.

[0127] Cross-validation: A 5-fold cross-validation method was used to evaluate and optimize model parameters.

[0128] Loss function definition: The loss function is defined as:

[0129]

[0130] Among them, w and b are model parameters and bias terms respectively, x i and i They represent the feature vector and preliminary quality level of the i-th sample respectively, f(x;w,b) represents the model prediction output, and λ is the regularization coefficient.

[0131] Adversarial training: Furthermore, in order to improve the robustness of the model, an adversarial training method is adopted, and its loss function is defined as:

[0132]

[0133] Here, Δ defines the range of the perturbation δ to ensure that the perturbation is reasonable.

[0134] Model training:

[0135] Model training is performed using historical image data with preliminary quality levels (including training sets, validation sets, and test sets).

[0136] The regularization coefficient λ was set to 0.01 and grid search was used to find the optimal model parameters.

[0137] For adversarial training, the perturbation range Δ is set to 10% of the maximum value of the feature vector, that is, δ≤0.1×max(|A|,|B i |).

[0138] Model Evaluation:

[0139] Use the test set to evaluate the performance of the model, including indicators such as accuracy and recall.

[0140] The model performance is continuously optimized by adjusting the model parameters and regularization coefficients.

[0141] 104. Use the specific quality inspection model to perform automatic quality inspection on the collected current product image data, wherein the automatic quality inspection includes outputting a predicted quality grade.

[0142] In this step, a specific quality inspection model: the model trained in step 103 is used to predict the quality level of the product based on the feature vector of the product.

[0143] Current product image data: refers to the real-time image data of the product to be inspected, which will be used for real-time quality inspection.

[0144] Automatic quality inspection: refers to the process of automatically evaluating the quality of current product image data using a specific quality inspection model.

[0145] Predicted quality grade: The prediction result output by a specific quality inspection model, that is, the product quality grade predicted based on the current product image data.

[0146] In the embodiments of the present application, Embodiment: Continuing with the quality inspection of automobile parts mentioned above as an example, we will introduce in detail how to use a specific quality inspection model to perform automatic quality inspection on the collected current product image data and output the predicted quality grade.

[0147] Current product image data collection:

[0148] Use an industrial camera (IC) to take real-time photos of automotive parts on the production line to ensure that the captured images are clear and high-resolution.

[0149] Perform necessary preprocessing operations on the collected images, such as size standardization, grayscale processing, denoising, etc., to improve the effect of subsequent feature extraction.

[0150] Feature extraction:

[0151] The basic large model fine-tuned in step 102 is used to perform feature extraction on the preprocessed current product image data to obtain a key feature vector for each image.

[0152] Assume that the dimension of each feature vector is 1024.

[0153] Eigenvector comparison:

[0154] For each current product image, calculate its feature vector A and each feature vector B in the standard product feature library i Similarity between targets weighted .

[0155] Comprehensive similarity score calculation:

[0156] Finally determine the comprehensive similarity score S complex , considering the mutual influence between eigenvectors.

[0157] Quality grade prediction:

[0158] Use the specific quality inspection model trained in step 103 to score the comprehensive similarity S of the current product complex Make predictions and output the prediction quality level.

[0159] Assume that the specific quality inspection model is a support vector machine (SVM), which has been trained based on historical image data and has been cross-validated and regularized.

[0160] Here is a specific example:

[0161] Assume we have the following specific values:

[0162] Feature vector dimension: 1024;

[0163] Feature vector A of the current product image data;

[0164] Feature vector B in the standard product feature library 1 ,B 2 ,…,B n ;

[0165] a=0.01;

[0166] Weight w 1 =0.4,w 2 =0.3,w 3 =0.3 (assuming there are 3 feature vectors in the standard product feature library);

[0167] Mutual influence coefficient γ ij =0.1;

[0168] For a feature vector A of a current product image, suppose the calculated similarity y improved They are:

[0169] similarity weighted,1 =0.95;

[0170] similarity weighted,2 =0.85;

[0171] similarity weighted,3 =0.75;

[0172] Then calculate the comprehensive similarity score S complex as follows:

[0173]

[0174] Assume that the trained specific quality inspection model is a support vector machine model, and its prediction output is:

[0175] If S complex >0.9, it is judged as high quality grade;

[0176] If 0.7 complex ≤0.9, it is judged as medium quality grade;

[0177] If S complex ≤0.7, it is judged as low quality grade.

[0178] ​Based on this combined similarity score, we can determine that the predicted quality level of this current product is medium.

[0179] Through the above embodiments, we can see how to use a specific quality inspection model to automatically inspect the quality of the collected current product image data and output a predicted quality grade, thereby effectively assisting the quality inspection process.

[0180] Figure 2 A quality detection device based on a basic large model is provided for an embodiment of the present application, and is characterized by comprising:

[0181] An image acquisition module 21 is used to acquire image data of the product to be inspected;

[0182] The feature analysis module 22 is used to extract features from the preprocessed image data using a pre-trained basic large model, compare and analyze the extracted features with features in a standard product feature library, and determine the preliminary quality grade of the product to be tested;

[0183] A model training module 23, used for training a specific quality inspection model for the product to be inspected based on historical image data with preliminary quality grades;

[0184] The quality detection module 24 is used to perform automatic quality detection on the collected current product image data using the specific quality detection model, and the automatic quality detection includes outputting a predicted quality grade.

[0185] Figure 2 The quality detection device based on the basic large model can be performed Figure 1 The implementation principle and technical effect of the quality inspection method based on the basic large model described in the embodiment shown are not repeated here. The specific way in which each module and unit performs operations in the quality inspection device based on the basic large model in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0186] In one possible design, Figure 2 A quality detection device based on a basic large model in the embodiment shown can be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;

[0187] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .

[0188] The processing component 32 is used to: collect historical image data of the product to be inspected; use a pre-trained basic large model to extract features from the historical image data, and compare and analyze the extracted features with the features in the standard product feature library to determine the preliminary quality grade of the product to be inspected; train a specific quality inspection model for the product to be inspected based on the historical image data with the preliminary quality grade; use the specific quality inspection model to perform automatic quality inspection on the collected current product image data, and the automatic quality inspection includes outputting a predicted quality grade.

[0189] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0190] The storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0191] Of course, the computing device may also include other components, such as input / output interfaces, display components, communication components, etc.

[0192] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0193] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.

[0194] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0195] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 A quality inspection method based on a basic large model in the illustrated embodiment.

[0196] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0197] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0198] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0199] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A quality detection method based on a basic large model, characterized in that: include: Collect historical image data of the product to be inspected; Extract features from the historical image data using a pre-trained basic large model, and compare and analyze the extracted features with features in a standard product feature library to determine a preliminary quality grade of the product to be inspected; Training a specific quality inspection model for the product to be inspected based on historical image data with preliminary quality grades; Using the specific quality inspection model to automatically inspect the quality of the collected current product image data, the automatic quality inspection including outputting a predicted quality grade; The extracted features are compared and analyzed with the features in the standard product feature library to determine the preliminary quality grade of the product to be tested, including: Calculate the target similarity between the feature vector corresponding to the extracted feature and the feature vector corresponding to each feature in the standard product feature library; The target similarity is calculated according to the following formula group: similarity improved =cos(θ)·exp(-α∥A-B i ∥ 2 ) Among them, similarity improved represents the intermediate similarity, θ is the angle between two feature vectors, α is a positive parameter used to control the degree of influence between feature vectors, A is the feature vector corresponding to the extracted feature, and B i is the i-th feature vector in the standard product feature library, similarity weighted represents the target similarity, w i is the weight of the ith feature vector, which is determined by the importance of the feature vector, and n is the number of feature vectors in the standard product feature library; Determining a comprehensive similarity score based on the target similarity; Comparing the comprehensive similarity score with a preset quality grade threshold to determine the preliminary quality grade of the product to be tested; Determining a comprehensive similarity score according to the target similarity includes: By formula: determining a composite similarity score; Among them, S complex Expressed as a comprehensive similarity score; w i is the weight of the i-th eigenvector, which is determined by the importance of the eigenvector; similarity weighted,i Represented as the i-th standard product feature vector B i The target similarity with the feature vector A of the product to be detected; similarity weighted,j Represented as the jth standard product feature vector B j The target similarity with the feature vector A of the product to be detected; γ ij It is represented as the mutual influence coefficient between the i-th eigenvector and the j-th eigenvector; n is represented as the number of eigenvectors in the standard product feature library.

2. The method according to claim 1, characterized in that The method of extracting features from the historical image data using the pre-trained basic large model includes: Fine-tune the basic large model to meet the feature extraction requirements of the product to be tested; The key feature vectors of the historical image data are extracted through the fine-tuned basic large model to achieve feature extraction of the historical image data.

3. The method according to claim 1, characterized in that The step of training a specific quality inspection model for the product to be inspected based on the historical image data with preliminary quality grades includes: The target similarity is used as an input feature and combined with historical image data with preliminary quality levels for training to obtain a specific quality inspection model; During the training process, the cross-validation method is used to optimize the parameters of the specific quality inspection model, a regularization term is introduced to avoid overfitting, and the loss function of the specific quality inspection model is defined as: Where w and b are the parameters and bias terms of the specific quality inspection model, respectively, and x i and i They represent the feature vector and preliminary quality level of the i-th sample respectively, f(x;w,b) represents the model prediction output, and λ is the regularization coefficient.

4. The method according to claim 1, characterized in that: The loss function of the specific quality inspection model is also defined as: L adv (w,b,x i ,y i )=max δ∈Δ L(w,b,x i +δ,y i ); Where w and b are the parameters and bias terms of the specific quality inspection model, respectively, and x i and i They represent the feature vector and preliminary quality level of the i-th sample respectively. Δ defines the range of perturbation δ to ensure the rationality of the perturbation.

5. A quality inspection device based on a basic large model, characterized in that: include: An image acquisition module, used to acquire image data of the product to be inspected; A feature analysis module is used to extract features from the preprocessed image data using a pre-trained basic large model, compare and analyze the extracted features with the features in the standard product feature library, and determine the preliminary quality grade of the product to be tested; A model training module, used for training a specific quality inspection model for the product to be inspected based on historical image data with preliminary quality grades; A quality inspection module, used to perform automatic quality inspection on the collected current product image data using the specific quality inspection model, wherein the automatic quality inspection includes outputting a predicted quality grade; The extracted features are compared and analyzed with the features in the standard product feature library to determine the preliminary quality grade of the product to be tested, including: Calculate the target similarity between the feature vector corresponding to the extracted feature and the feature vector corresponding to each feature in the standard product feature library; The target similarity is calculated according to the following formula group: similarity improved =cos(θ)·exp(-α∥A-B i ∥ 2 ) Among them, similarity improved represents the intermediate similarity, θ is the angle between two feature vectors, α is a positive parameter used to control the degree of influence between feature vectors, A is the feature vector corresponding to the extracted feature, and B i is the i-th feature vector in the standard product feature library, similarity weighted represents the target similarity, w i is the weight of the ith feature vector, which is determined by the importance of the feature vector, and n is the number of feature vectors in the standard product feature library; Determining a comprehensive similarity score based on the target similarity; Comparing the comprehensive similarity score with a preset quality grade threshold to determine the preliminary quality grade of the product to be tested; Determining a comprehensive similarity score according to the target similarity includes: By formula: determining a composite similarity score; Among them, S complex Expressed as a comprehensive similarity score; w i is the weight of the i-th eigenvector, which is determined by the importance of the eigenvector; similarity weighted,i Represented as the i-th standard product feature vector B i The target similarity with the feature vector A of the product to be detected; similarity weighted,j Represented as the jth standard product feature vector B j The target similarity with the feature vector A of the product to be detected; γ ij It is represented as the mutual influence coefficient between the i-th eigenvector and the j-th eigenvector; n is represented as the number of eigenvectors in the standard product feature library.

6. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the quality detection method based on the basic large model according to any one of claims 1 to 4.

7. A computer storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the quality detection method based on the basic large model described in any one of claims 1 to 4 is implemented.