Automobile injection molding part defect classification method based on database comparison

Through multi-scale decomposition and convolutional neural network combined with local anomaly factor algorithm to optimize the two-stage classification strategy of dynamic threshold, the accuracy and stability problems of defect detection of automotive injection molded parts are solved, and efficient recognition and classification of defects in complex backgrounds are achieved.

CN120747643AActive Publication Date: 2025-10-03XIAN WEIER PRECISION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511212908.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-10-03
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

Existing technologies for defect detection of automotive injection molded parts suffer from problems such as insensitivity and low classification accuracy. In particular, faint defect features are difficult to identify against a complex texture background, and the generalization capability for new types of defects is limited.

Method used

A two-stage classification strategy based on database comparison is adopted. First, deep features are extracted through multi-scale decomposition and convolutional neural network. The dynamic threshold is optimized with the local anomaly factor algorithm for preliminary screening. Then, the local anomaly factor is spliced ​​with the original features into an enhanced feature vector for neural network classification.

Benefits of technology

It significantly improves the accuracy and stability of defect detection for automotive injection molded parts, can adapt to changes in the production environment, and improves the ability to identify defects in complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120747643A_ABST
    Figure CN120747643A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and particularly relates to an automobile injection molding part defect classification method based on database comparison, and the method comprises the steps: extracting feature vectors fusing multi-scale manual information and deep learning information from normal, defect and to-be-detected regions; the method comprises the following steps: calculating a local abnormal factor of a to-be-detected region, and comparing the local abnormal factor with a judgment threshold dynamically generated based on defect data to realize efficient preliminary screening of abnormal regions; and splicing the original feature vectors and the quantized local abnormal factors into enhanced feature vectors, inputting the enhanced feature vectors into a neural network classification model, and performing accurate defect category judgment. According to the method, the accuracy and the stability of defect detection of the automobile injection molding part are improved through a two-stage strategy of dynamic threshold preliminary screening and enhanced feature fine separation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and more particularly to a method for classifying defects of automobile injection molded parts based on database comparison. Background Art

[0002] Automated surface quality inspection of industrial products, particularly automotive injection molded parts, is a key component in ensuring product quality and improving production efficiency. Currently, machine vision-based defect detection technology is widely used, aiming to replace manual visual inspection and achieve rapid and objective identification of surface defects. This technology often combines traditional image processing with machine learning models to achieve defect detection and classification.

[0003] In the related technology, for example, the Chinese patent document with authorization announcement number CN114926008B discloses an intelligent weaving defect image recognition and automatic classification method and system, which discloses feature analysis of classified weaving images, defect type identification of each classified weaving image in the classified weaving image group, using a defect type marking group to mark the image defect feature groups one by one, summarizing the marked image feature groups, and training a deep learning model based on the marked image feature group set to obtain a defect automatic recognition model, thereby improving the accuracy and efficiency of weaving defect recognition.

[0004] However, existing technologies still face numerous challenges in complex industrial production environments. First, the surfaces of automotive injection molded parts often exhibit complex textures. When defect features are subtle, atypical, or highly similar to normal background textures, traditional detection algorithms are prone to missed detections or false positives due to insufficient feature differentiation, resulting in insensitive detection and low classification accuracy. Furthermore, relying solely on neural networks can overlook specific, highly interpretable geometric or texture information and have limited generalization capabilities for new defect types. Summary of the Invention

[0005] To solve the above technical problems of insufficient defect detection accuracy and poor classification effect, the present invention provides a method for classifying automotive injection molded parts defects based on database comparison, comprising: Collect a large number of sample images and multiple images to be tested, and obtain several normal ROIs (Regions of Interest), defect ROIs, and ROIs to be tested through feature region extraction technology; obtain the feature vector of any ROI based on the morphological, grayscale, and texture features of the normal ROI, defect ROI, and ROI to be tested at different observation scales; record any ROI as the target ROI; obtain the preliminary k-distance and preliminary k-neighborhood based on the difference in feature vectors between the ROI to be tested and the normal ROI; obtain the improved k-neighborhood of the ROI to be tested and the local anomaly factor of the ROI to be tested based on the distance between the ROI to be tested and the normal ROI of the preliminary k-neighborhood; calculate the defect R The local anomaly factor of the OI is used to obtain a dynamic anomaly judgment threshold based on the difference in the local anomaly factors of the defect ROI; the local anomaly factor of the ROI to be tested is compared with the dynamic anomaly judgment threshold to obtain a preliminary classification of the ROI to be tested, which includes the categories of defect or normal; based on the feature vector of the ROI to be tested and the corresponding local anomaly factor, an enhanced feature vector of the ROI to be tested is constructed; based on neural network technology, a defect classification model for automotive injection molded parts is established; and the enhanced feature vector of the ROI to be tested is input into the automotive injection molded parts defect classification model to obtain the defect type of the ROI to be tested.

[0006] This paper proposes an innovative two-stage classification strategy. In the first stage, a dynamic anomaly determination threshold based on normal and defect samples is introduced to optimize the improved local anomaly factor (LOF) algorithm. This algorithm can efficiently and adaptively filter out a large number of normal background areas, effectively reducing the computational burden of subsequent fine classification. It can also adapt to normal texture drift caused by factors such as raw material batches and equipment aging during the production process, and is more robust. In the second stage, the local anomaly factor generated in the first stage is used as a new dimensional information, concatenated with the original feature vector to form an enhanced feature vector, which is then fed into a neural network for classification. This allows the classifier to determine the degree of anomaly, greatly improving the ability to identify fuzzy defects that are similar to normal background textures but are actually defects, thereby significantly improving the accuracy and reliability of detection.

[0007] Preferably, obtaining a feature vector of any ROI includes: Downsampling the target ROI using a multi-scale decomposition algorithm to generate a decomposition image set of the target ROI; obtaining the morphological features, grayscale features, and texture features of the decomposition image set of the target ROI; Using a pre-trained convolutional neural network as a deep feature extractor, inputting the target ROI into the deep feature extractor to obtain a deep feature vector of the target ROI; The morphological, grayscale, texture features and depth feature vectors of the decomposed image set of the target ROI are spliced ​​to obtain the feature vector of the target ROI.

[0008] This invention achieves complementary advantages by fusing traditional features such as morphology, grayscale, and texture extracted through multi-scale decomposition with the deeply abstract features extracted by CNN. This fusion strategy not only accurately captures defect information with clear physical meaning, but also leverages deep learning to automatically discover complex and abstract discriminative features that are difficult to design manually. The resulting feature vector information is more comprehensive and discriminative, laying a solid foundation for subsequent accurate anomaly detection and classification.

[0009] Preferably, the step of obtaining the morphological features of the decomposed image set of the target ROI includes: Use the Otsu method to binarize any decomposed image of the target ROI to obtain a binary matrix of the decomposed image, accumulate the elements with a value of 1 in the binary matrix of the decomposed image, and obtain the area of ​​the decomposed image of the target ROI; the morphological features can also include perimeter, circularity, and aspect ratio.

[0010] Preferably, the acquisition of the texture features includes: Obtaining a normalized gray-level co-occurrence matrix of any decomposed image of the target ROI; the texture feature may be contrast; The contrast of the kth decomposition image of the target ROI satisfies the expression: ; Where, Represents the contrast of the mth decomposition image of the target ROI; Indicates the maximum value of the grayscale range; 、 is the number of gray levels; The gray level in the gray level co-occurrence matrix of the mth decomposition image of the target ROI is The probability that the pixel pairs appear in a preset spatial relationship; represents a normalization function; the preset spatial relationship may be a horizontally adjacent spatial relationship.

[0011] Preferably, obtaining the preliminary k-distance and preliminary k-neighborhood includes: Any ROI to be measured is recorded as the target ROI to be measured, and the feature vectors of all normal ROIs form a normal feature space. The target ROI to be measured is placed in the normal feature space, and the Euclidean distance between the target ROI to be measured and all feature vectors in the normal feature space are calculated. The Euclidean distances are sorted from small to large, and the k-th smallest Euclidean distance value is found, which is the preliminary k-distance of the target ROI to be measured; all normal sample points whose distance to the target ROI is not greater than the k-distance constitute the preliminary k-neighborhood of the target ROI to be measured.

[0012] Preferably, obtaining the improved k-distance of the ROI to be measured includes: The improved k-distance of the target ROI satisfies the expression: ; Where, represents the improved k-distance from the neighborhood data point p to the target ROI to be measured, ; Indicates the preliminary k-distance of the target ROI to be measured; Represents the Euclidean distance between the target ROI to be measured and the neighborhood data point p; is the distance weight function; represents the maximum function; the distance weight function can be a Gaussian function.

[0013] This paper introduces a distance weighting function to calculate an improved k-distance, allowing neighboring data points closer to the target ROI to contribute more to the density estimate. This improvement better aligns with the physical intuition of local density and more accurately reflects the true density environment of the target area. This allows the subsequently calculated local anomaly factor score to more accurately quantify the degree of outliers, improving the sensitivity and accuracy of anomaly detection.

[0014] Preferably, the acquisition of the local abnormality factor of the ROI to be measured includes: Calculate the local reachability density of the target ROI to be measured; The local anomaly factor of the ROI to be tested satisfies the expression: ; Where, Represents the local abnormality factor of the target ROI to be measured; Represents the local reachability density of the neighborhood data point p of the target ROI to be measured; Represents the local reachability density of the target ROI to be measured; Represents the preliminary k-neighborhood of the target ROI to be tested.

[0015] This paper describes a method for calculating the local anomaly factor. Its core is to compare the local reachability density of the measured ROI with the average local reachability density of its neighboring points. This method can quantify the degree of isolation of a point relative to its surroundings. Therefore, it is very effective for processing data with uneven density, such as the complex texture on the surface of automotive injection molded parts. It can accurately identify real defects that are located in the normal texture area but have significantly low density.

[0016] Preferably, the local reachable density of the target ROI to be measured includes: The average improved reachable distance between the target ROI and all points in the preliminary k-neighborhood is normalized by negative correlation to obtain the local reachable density of the target ROI.

[0017] Preferably, obtaining the dynamic anomaly determination threshold includes: ; Where, Indicates the dynamic anomaly determination threshold; Indicates the average local anomaly factor of the defect ROI; represents the sensitivity coefficient; Indicates the standard deviation of the local anomaly factor of all defect ROIs.

[0018] The dynamic anomaly threshold designed in this invention is calculated based on the statistics of the local anomaly factors for all known defect ROIs. This approach allows the judgment criteria to automatically adapt to fluctuations in the production line environment and changes in defect severity. For example, as overall line quality improves and defects become less severe, the threshold can be adjusted accordingly. This ensures a high detection rate and low false alarm rate over the long term, far exceeding the robustness of fixed threshold methods.

[0019] Preferably, the constructing of the enhanced feature vector of the ROI to be measured includes: concatenating the feature vector of the ROI to be measured with the corresponding local anomaly factor to form an enhanced feature vector.

[0020] The beneficial effects of the present invention lie in the following: It proposes a two-stage defect detection method for automotive injection molded parts that combines dynamic threshold anomaly screening with enhanced feature-based precise classification. It first optimizes the improved local anomaly factor algorithm using a dynamic threshold adaptively adjusted based on defect data statistics, efficiently and robustly filtering out normal areas. Subsequently, the quantized "anomaly score" is fused with the original image features into an "enhanced feature vector," which is then fed into a neural network for refined classification. This method addresses the technical pain points of traditional methods, such as low recognition rates for fuzzy defects and inability to adapt to changes in production line environments, significantly improving detection accuracy and stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 The flowchart schematically illustrates the method for classifying defects of automobile injection molded parts based on database comparison in the present invention. DETAILED DESCRIPTION

[0022] The embodiment of the present invention discloses a method for classifying defects of automobile injection molded parts based on database comparison, referring to Figure 1 , including steps S1 to S4: S1: Collect a large number of sample images and multiple images to be tested, and obtain several normal ROIs (Regions of Interest), defect ROIs, and ROIs to be tested through feature region extraction technology.

[0023] It should be noted that the classification of automotive injection molded parts defects using a neural network requires a large amount of defect data as a database for training, so the present invention first needs to obtain a plurality of defect data. In addition, it is necessary to collect images of the automotive injection molded parts to be inspected.

[0024] Specifically, a large number of sample images and multiple images to be inspected are collected. The sample images fall into two categories: the first category is normal sample images that have been confirmed to be free of any visible defects; the second category is defect sample images that contain various typical defects. The images to be inspected are collected in real time using industrial cameras installed on the automotive injection molding production line. Using feature region extraction technology, several normal ROIs (Regions of Interest) are calibrated on the normal sample images, several ROIs to be inspected are calibrated on the images to be inspected, and defect ROIs are accurately calibrated on the defect sample images. Each defect ROI is also assigned an accurate category label. It should be noted that the number of sample images can be up to one thousand. The feature region extraction technology is existing technology and can be based on the OpenCV library. It performs edge detection, contour extraction, mask creation, and region of interest extraction on the image. Defect category labels include top white, black spots, flash, weld lines, and warpage.

[0025] So far, several normal ROIs, defect ROIs, and ROIs to be tested have been obtained.

[0026] S2: Based on the morphological, grayscale, and texture features of the normal ROI, defect ROI, and ROI to be tested at different observation scales, the feature vector of any ROI is obtained.

[0027] It should be noted that different types of defects present different significant features at different observation scales. For example, a tiny bubble or black spot has obvious features at a small scale, while a long and shallow weld mark or a large area of ​​warping deformation requires a large scale to effectively capture its morphology. The use of multi-scale analysis can provide more comprehensive defect information. On the other hand, CNN (Convolutional Neural Network) can automatically extract deep-level abstract features that are difficult to design manually and more discriminative from the original image through end-to-end learning. For example, CNN can learn to distinguish between subtle texture differences between divergent silver streaks caused by moisture in the raw material and directional scratches caused by external forces. Therefore, the present invention combines multi-scale feature extraction with CNN to obtain the features of ROI.

[0028] Specifically, any ROI is recorded as the target ROI, and the target ROI is downsampled using a multi-scale decomposition algorithm to generate a decomposition image set of the target ROI. , recorded as , where k is the number of scales, is the decomposed image of the target ROI at the kth scale.

[0029] It should be noted that morphological features are mainly used to describe the geometric shape and size of defects, which is crucial for distinguishing defects with significant appearance differences caused by different physical causes. For example, glue deficiency appears as a large area of ​​loss, while bubbles are usually small and round areas. Grayscale features describe the brightness and contrast information of the defect area. This is particularly effective for distinguishing color abnormality defects caused by material changes or thermal effects. For example, burns are usually manifested as a significant decrease in the average grayscale value of the local area, that is, blackening, while silver streaks are caused by light scattering, resulting in an increase in the local grayscale standard deviation. Texture features are used to quantify the microstructure and regularity of the surface, which is crucial for distinguishing defects with similar macroscopic shapes and grayscales but different surface textures. For example, flow marks appear as a regular, gentle wavy texture, while the surface of shrinkage marks is usually smoother and has a lower texture complexity. Therefore, the present invention combines the morphological features, grayscale features, and texture features of the ROI multi-scale image to perform comprehensive feature extraction on the ROI.

[0030] Preferably, the morphological, grayscale, and texture features of the decomposed image set of any ROI are extracted, including: Taking the target ROI as an example, the morphological features of the decomposed image set of the target ROI are obtained: any decomposed image of the target ROI is binarized using the Otsu method to obtain a binary matrix of the decomposed image. The elements of the binary matrix with a value of 1 are accumulated to obtain the area of ​​the decomposed image of the target ROI. It should be noted that morphological features can also include perimeter, circularity, aspect ratio, etc.

[0031] Obtain the grayscale features of the decomposed image set of the target ROI: Obtain the average grayscale value and grayscale standard deviation of any decomposed image of the target ROI. It should be noted that the average grayscale value reflects the overall brightness of the ROI, and the grayscale standard deviation reflects the grayscale contrast or degree of change within the ROI.

[0032] Get the texture features of the decomposed image set of the target ROI: Get the normalized gray-level co-occurrence matrix of any decomposed image of the target ROI, and record the normalized gray-level co-occurrence matrix of the mth decomposed image of the target ROI as It should be noted that the gray level co-occurrence matrix is ​​an existing technology. For example, , represents the probability that the pixel pairs with grayscale values ​​​​i and j appear in a specific spatial relationship. The specific spatial relationship can be horizontally adjacent. It means that when a pair of pixels that meet the horizontal adjacent spatial relationship is randomly selected, the probability that the grayscale value of the left pixel is 1 and the grayscale value of the right pixel is 2 is 2 / 9.

[0033] The contrast of the kth decomposition image of the target ROI satisfies the expression: ; Where, Represents the contrast of the mth decomposition image of the target ROI; Indicates the maximum value of the grayscale range; 、 is the number of gray levels; The gray level in the gray level co-occurrence matrix of the mth decomposition image of the target ROI is The probability that the pixel pairs appear in a preset spatial relationship; The preset spatial relationship may be a horizontally adjacent spatial relationship.

[0034] It should be noted that although manually designed features have clear physical meaning, their expressive power is limited and requires a large amount of prior knowledge. CNNs, on the other hand, can automatically extract more discriminative, deep-level abstract features from raw images through end-to-end learning, which are difficult to manually design. Therefore, this paper combines CNN technology to obtain deep features of the ROI.

[0035] Preferably, a pre-trained convolutional neural network is used as a deep feature extractor, and the target ROI is input into the deep feature extractor to obtain a deep feature vector of the target ROI. It should be noted that the convolutional neural network is an existing technology and can be a lightweight ResNet or MobileNet structure.

[0036] Preferably, the morphological, grayscale, texture features and depth feature vectors of the decomposed image set of the target ROI are spliced ​​to obtain a feature vector of the target ROI.

[0037] At this point, the feature vector of each ROI that integrates multi-scale information and deep learning information is obtained.

[0038] S3: Based on the difference in feature vectors between the ROI to be tested and the normal ROI, a preliminary k-distance and a preliminary k-neighborhood are obtained; based on the distance between the ROI to be tested and the normal ROI in the preliminary k-neighborhood, an improved k-neighborhood of the ROI to be tested and a local anomaly factor of the ROI to be tested are obtained; the local anomaly factor of the defective ROI is calculated, and based on the difference in the local anomaly factors of the defective ROI, a dynamic anomaly determination threshold is obtained; the local anomaly factor of the ROI to be tested is compared with the dynamic anomaly determination threshold to obtain a preliminary classification of the ROI to be tested, which may include defective or normal.

[0039] It should be noted that in injection molding production, not all areas that differ from normal samples are defects that need to be eliminated. For example, the surface of the injection molded part is allowed to have texture fluctuations within a certain range, or traces caused by slight wear of the mold but within the tolerance range. Directly sending all candidate areas into the classifier will cause a huge computational burden and a high false alarm rate, because the classifier may mistakenly judge these normal fluctuations as certain defects. Therefore, it is crucial to introduce an unsupervised anomaly detection link. The core idea of ​​the Local Outlier Factor (LOF) algorithm anomaly detection algorithm is not to judge anomalies based on a global, fixed standard, but to examine the relative density of a data point and its local environment. Therefore, it is suitable for processing industrial scenarios with uneven data distribution. The present invention further improves the standard LOF and introduces a dynamic threshold mechanism to optimize the defect detection effect.

[0040] It should be noted that in order to evaluate the local density of the ROI to be measured, it is first necessary to define a neighborhood for it, and the size of the neighborhood is determined by the parameter k.

[0041] Specifically, according to the difference in feature vectors between the ROI to be tested and the normal ROI, a preliminary k-distance and a preliminary k-neighborhood are obtained, including: Any ROI to be tested is recorded as the target ROI to be tested, and the feature vectors of all normal ROIs form a normal feature space. The target ROI to be tested is placed in the normal feature space, and the Euclidean distance between the target ROI to be tested and all the feature vectors in the normal feature space are calculated. The Euclidean distance is sorted from small to large, and the kth smallest Euclidean distance value is found, which is the initial k-distance of the target ROI to be tested, recorded as All normal sample points whose distance from the target ROI is not greater than the k-distance constitute the initial k-neighborhood of the target ROI, which is recorded as It should be noted that the data points in the k-neighborhood are direct reference objects for evaluating the sociability of the target ROI to be measured.

[0042] It should be noted that when calculating the effective distance between the target ROI and its neighboring data points, the standard LOF algorithm makes an assumption that all neighboring data points contribute equally. However, neighboring data points closer to the target ROI are more likely to reflect the actual density of the area. Therefore, the present invention introduces a weighting function to adjust the influence of near and far neighbors, making the density estimate more accurate and robust.

[0043] Preferably, based on the distance between the ROI to be measured and the normal ROI in the preliminary k-neighborhood, obtaining the improved k-distance of the ROI to be measured and the local abnormality factor of the ROI to be measured includes: The improved k-distance of the target ROI satisfies the expression: ; Where, represents the improved k-distance from the neighborhood data point p to the target ROI to be measured, ; Indicates the preliminary k-distance of the target ROI to be measured; Represents the Euclidean distance between the target ROI to be measured and the neighborhood data point p; is the distance weight function; It should be noted that the distance weight function may be a Gaussian function.

[0044] Where, Indicates that if the target ROI is in a dense area, its will be very small, and the reachable distance is mainly determined by the actual distance If the target ROI is in a sparse area, the reachable distance is more affected by the sparseness of the neighbors themselves. The influence of the neighbor Small effects will be weighted Zooming in, choosing the maximum of the two, makes the improved k-distance more accurate.

[0045] It should be noted that the local density of a data point can be intuitively understood as the inverse of the average distance from its surrounding points to it. The smaller the average distance, the denser the points.

[0046] The local reachability density of the target ROI to be measured satisfies the expression: ; Where, Represents the local reachability density of the target ROI to be measured; represents the improved k-distance from the neighborhood data point p to the target ROI; Represents the preliminary k-neighborhood of the target ROI to be measured; represents the natural exponential function.

[0047] Where, represents the sum of the improved k-distances between the target ROI and the data points in the preliminary k-neighborhood; It represents the average improved reachable distance between the target ROI and all points in the preliminary k-neighborhood. The smaller the average distance, the denser the points around the target ROI, and the larger the local reachable density value.

[0048] It should be noted that the abnormal performance of the ROI to be tested depends on how low its density is relative to the density of its neighboring data points. Based on this, the local abnormality factor of the ROI to be tested is calculated.

[0049] The local anomaly factor satisfies the expression: ; Where, Represents the local abnormality factor of the target ROI to be measured; Represents the local reachability density of the neighborhood data point p of the target ROI to be measured; Represents the local reachability density of the target ROI to be measured; Represents the preliminary k-neighborhood of the target ROI to be tested.

[0050] Where, The ratio of the local reachability density of the neighborhood data point p of the target ROI to the local reachability density of the target ROI to be measured. This value reflects the density of the neighborhood data point p relative to the target ROI to be measured. It represents the average ratio of the local reachability density of the neighborhood data points of the target ROI to the local reachability density of the target ROI. It reflects the average density of the neighborhood data points relative to the target ROI. The larger the value, the greater the local anomaly factor of the target ROI.

[0051] It should be noted that if , it means that the density of the target ROI to be measured is similar to its preliminary k-neighborhood data points. On the injection molded part, this may correspond to a normal surface texture fluctuation, which is closely clustered with a large number of normal points in the feature space and is therefore not considered an anomaly. ≫1, indicating that the density of the target ROI is significantly lower than the average density of the preliminary k-neighborhood data points. On injection molded parts, it is very likely to correspond to real defects. The feature vectors of these defects will be far away from the area composed of a large number of normal surface points in the feature space.

[0052] It should be noted that the fixed Thresholds work well in stable laboratory environments, but in real-world industrial production, fluctuations in raw material batches, equipment aging, process fine-tuning, and workshop temperature and humidity can cause the entire normal region to drift within the normal feature space. In these cases, fixed thresholds can become either too strict or too loose. A dynamic threshold mechanism can make the judgment criteria more accurate.

[0053] Preferably, obtaining a dynamic abnormality determination threshold based on the difference in local abnormality factors of the defect ROI includes: ; Where, Indicates the dynamic anomaly determination threshold; Indicates the average local anomaly factor of the defect ROI; represents the sensitivity coefficient; It represents the standard deviation of the local anomaly factor of all defect ROIs. It should be noted that the sensitivity coefficient is a configurable process parameter. For example, for key injection molded parts, a larger As shown in 5, it makes the judgment more strict; for general appearance parts, a smaller As in 2, to balance the detection rate and overkill rate.

[0054] Preferably, for any ROI to be tested, if its local abnormality factor If the dynamic abnormality judgment threshold is greater than the local abnormality factor, it is judged as a defect. If its local abnormality factor is less than the dynamic abnormality judgment threshold, it is judged as normal, and the data is integrated into the defect ROI or normal ROI to form a new local abnormality factor and a new dynamic abnormality judgment threshold.

[0055] At this point, the abnormality determination of the ROI to be tested is completed.

[0056] S4: Concatenate the feature vector of the ROI to be tested with the corresponding local anomaly factor to form an enhanced feature vector; and establish a defect classification model for automotive injection molded parts based on neural network technology.

[0057] It's important to note that traditional classifiers typically rely solely on raw features for classification. However, through S3's anomaly detection process, we've obtained local anomaly factors that indicate the degree of anomaly within the ROI being tested. Fusion of these local anomaly factors with raw features significantly improves the classifier's ability to distinguish complex, fuzzy-boundary defects, enabling the classifier to understand the specific anomaly of the defect. This is crucial for identifying defects that resemble normal background features but are inherently flawed, such as distinguishing a slight flow mark from a normal texture.

[0058] Specifically, the feature vector of the ROI to be tested is concatenated with the corresponding local anomaly factor to form an enhanced feature vector.

[0059] It's important to note that neural networks, particularly MLPs (Multilayer Perceptrons), possess powerful nonlinear mapping capabilities and can automatically learn complex decision boundaries in high-dimensional feature spaces. This is particularly important for distinguishing defects in automotive injection molded parts, which have complex features and fuzzy category boundaries. For example, distinguishing between warpage caused by uneven mold cooling and sink marks caused by insufficient holding pressure may share some similar characteristics, but neural networks can learn deeper discriminative patterns.

[0060] Preferably, a defect classification model for automobile injection molded parts is established, including: Establish a network structure consisting of an input layer, at least one hidden layer, and an output layer; use the ReLU function and the Softmax function as activation functions; use all defect ROIs to perform supervised learning training on the MLP network, where the input is the enhanced feature vector of all defect ROIs and the output is the corresponding defect type of the defect ROI; use the cross entropy loss function as the loss function, and perform iterative optimization through optimization algorithms such as Adam or SGD; complete the training to obtain a defect classification model for automotive injection molded parts.

[0061] The enhanced feature vector of the ROI to be tested is input into the automobile injection molded parts defect classification model to obtain the defect type of the ROI to be tested.

[0062] At this point, the classification of defects in automotive injection molded parts is completed.

[0063] Although this specification has shown and described several embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and substitutions without departing from the idea and spirit of the present invention.

Claims

1. A defect classification method for automobile injection molded parts based on database comparison, characterized in that: include: Collect a large number of sample images and multiple images to be tested, and obtain several normal ROIs, defect ROIs, and ROIs to be tested through feature region extraction technology; Based on the morphological, grayscale, and texture features of the normal ROI, defect ROI, and ROI to be measured at different observation scales, the feature vector of any ROI is obtained; and any ROI is recorded as the target ROI; Based on the difference in feature vectors between the ROI to be tested and the normal ROI, a preliminary k-distance and a preliminary k-neighborhood are obtained; based on the distance between the ROI to be tested and the normal ROI in the preliminary k-neighborhood, an improved k-neighborhood of the ROI to be tested and a local anomaly factor of the ROI to be tested are obtained; the local anomaly factor of the defective ROI is calculated, and based on the difference in the local anomaly factors of the defective ROI, a dynamic anomaly determination threshold is obtained; the local anomaly factor of the ROI to be tested is compared with the dynamic anomaly determination threshold to obtain a preliminary classification of the ROI to be tested, which may include defective or normal; Based on the feature vector of the ROI to be tested and the corresponding local anomaly factor, an enhanced feature vector of the ROI to be tested is constructed; based on neural network technology, a defect classification model for automotive injection molded parts is established; and the enhanced feature vector of the ROI to be tested is input into the automotive injection molded parts defect classification model to obtain the defect type of the ROI to be tested.

2. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 1, characterized in that: The step of obtaining a feature vector of any ROI includes: Downsampling the target ROI using a multi-scale decomposition algorithm to generate a decomposition image set of the target ROI; obtaining the morphological features, grayscale features, and texture features of the decomposition image set of the target ROI; Using a pre-trained convolutional neural network as a deep feature extractor, inputting the target ROI into the deep feature extractor to obtain a deep feature vector of the target ROI; The morphological, grayscale, texture features and depth feature vectors of the decomposed image set of the target ROI are spliced ​​to obtain the feature vector of the target ROI.

3. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 2, characterized in that: The step of obtaining the morphological features of the decomposed image set of the target ROI includes: Use the Otsu method to binarize any decomposed image of the target ROI to obtain a binary matrix of the decomposed image, accumulate the elements with a value of 1 in the binary matrix of the decomposed image, and obtain the area of ​​the decomposed image of the target ROI; the morphological features can also include perimeter, circularity, and aspect ratio.

4. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 2, characterized in that: The acquisition of the texture features includes: Obtaining a normalized gray-level co-occurrence matrix of any decomposed image of the target ROI; the texture feature may be contrast; The contrast of the kth decomposition image of the target ROI satisfies the expression: ; Where, Represents the contrast of the mth decomposition image of the target ROI; Indicates the maximum value of the grayscale range; 、 is the number of gray levels; The gray level in the gray level co-occurrence matrix of the mth decomposition image of the target ROI is The probability that the pixel pairs appear in a preset spatial relationship; represents a normalization function; the preset spatial relationship may be a horizontally adjacent spatial relationship.

5. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 1, characterized in that: The obtaining of the preliminary k-distance and the preliminary k-neighborhood includes: Any ROI to be measured is recorded as the target ROI to be measured, and the feature vectors of all normal ROIs form a normal feature space. The target ROI to be measured is placed in the normal feature space, and the Euclidean distance between the target ROI to be measured and all feature vectors in the normal feature space are calculated. The Euclidean distances are sorted from small to large, and the k-th smallest Euclidean distance value is found, which is the preliminary k-distance of the target ROI to be measured; all normal sample points whose distance to the target ROI is not greater than the k-distance constitute the preliminary k-neighborhood of the target ROI to be measured.

6. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 1, characterized in that: The step of obtaining the improved k-distance of the ROI to be measured includes: The improved k-distance of the target ROI satisfies the expression: ; Where, represents the improved k-distance from the neighborhood data point p to the target ROI to be measured, ; Indicates the preliminary k-distance of the target ROI to be measured; Represents the Euclidean distance between the target ROI to be measured and the neighborhood data point p; is the distance weight function; represents the maximum function; the distance weight function can be a Gaussian function.

7. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 1, characterized in that: The acquisition of the local abnormality factor of the ROI to be measured includes: Calculate the local reachability density of the target ROI to be measured; The local anomaly factor of the ROI to be tested satisfies the expression: ; Where, Represents the local abnormality factor of the target ROI to be measured; Represents the local reachability density of the neighborhood data point p of the target ROI to be measured; Represents the local reachability density of the target ROI to be measured; Represents the preliminary k-neighborhood of the target ROI to be tested.

8. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 7, characterized in that: The local reachable density of the target ROI to be measured includes: The average improved reachable distance between the target ROI and all points in the preliminary k-neighborhood is normalized by negative correlation to obtain the local reachable density of the target ROI.

9. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 1, characterized in that: The obtaining of the dynamic abnormality determination threshold comprises: ; Where, Indicates the dynamic anomaly determination threshold; Indicates the average local anomaly factor of the defect ROI; represents the sensitivity coefficient; Indicates the standard deviation of the local anomaly factor of all defect ROIs.

10. The method for classifying defects of automobile injection molded parts based on database comparison according to claim 1, characterized in that: The constructing of the enhanced feature vector of the ROI to be measured includes: concatenating the feature vector of the ROI to be measured with the corresponding local anomaly factor to form an enhanced feature vector.

Citation Information

Patent Citations

  • Data quality assessment method and system

    CN114926008B

  • Method for detecting global and local abnormal behaviors in crowd scene

    CN107491749A

  • Injection molding part defect detection method and device based on normal sample auxiliary feature extraction and medium

    CN115082386A

  • Abnormal information detection method and device, storage medium and electronic equipment

    CN118331822A

  • Welding implicit anomaly detection and identification method based on multi-source data

    CN118965216A