Machine vision-based automobile part assembly on-line detection platform

Through data enhancement and prior knowledge-guided prior frame design, the problem of component defect identification in the auto parts assembly process is solved, the identification efficiency and accuracy are improved, and the model performance is enhanced.

CN118587202AInactive Publication Date: 2024-09-03GUANGDONG SHUNDE ZHONGMING TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410877057.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the assembly process of automobile parts, existing machine vision inspection technology is difficult to effectively identify defects in parts, especially due to the different shapes and sizes of parts, various types of defects, small amount of data, and high noise, which makes feature extraction difficult and excessive. Problems with complex fitting and image structures.

Method used

The data enhancement method is used to expand the auto parts defect data set by adding trace noise and feature loss measures, and uses prior knowledge to guide the prior frame design, improve the efficiency and accuracy of the recognition model, establish an auto parts defect image database, and mine Prior knowledge to improve recognition models.

Benefits of technology

It effectively expands the automobile parts defect data set, ensures the restoration of image details, improves the efficiency and accuracy of a priori frame generation, and enhances the performance of the parts defect identification model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587202A
    Figure CN118587202A
Patent Text Reader

Abstract

The invention relates to an automobile part assembly online detection platform based on machine vision, and belongs to the technical field of image recognition. Comprising a detection and identification module which loads a data set through a defect image database and randomly divides the data set into a training set and a test set; key features are extracted through data table information of the data set; carrying out feature extraction on the image data of the training set through a VGG16 type convolutional neural network; then introducing prior frame design and prior knowledge transfer learning into the RPN to generate a group of regional proposals; and finally, the output of the model is obtained through classification and regression. And repeating the model training step, and continuously iterating to obtain an optimal hyper-parameter. According to the method, a data enhancement method of adding trace noise and feature loss measurement is adopted, so that the reduction degree of image details is ensured while an automobile part defect data set is expanded; meanwhile, the extracted priori knowledge is used for guiding the design of a priori frame in a recognition model, so that the generation efficiency and accuracy of the priori frame are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image recognition, and in particular relates to an online detection platform for automobile parts assembly based on machine vision. Background Art

[0002] In the actual production process of automobile parts, various uncertain factors such as grinding and polishing will leave defects on the surface of the parts, which will seriously affect the assembly and manufacturing of the vehicle and pose a huge safety hazard. Therefore, online detection is also required during the assembly of automobile parts. Image classification based on machine vision is to use algorithms to identify images based on their features, which is similar to the process of human eye recognition. Defect detection of vehicle parts is an application of image classification.

[0003] At present, machine vision is widely used to detect defects in the vehicle assembly process. First, the camera collects the image of the parts to be inspected, performs image preprocessing, and then trains the processed image to build an information template. Then, the target image is collected, features are extracted, and matching is completed. However, there are still many problems in detecting defects in vehicle parts, including the different shapes and sizes of parts, the types of defects, and the areas of defects; the lack of model training data can easily cause overfitting problems; the structure of the acquired automotive parts images is complex, and there may be many irrelevant factors, such as large noise, which makes it difficult to extract features, etc. Summary of the invention

[0004] In order to solve the above-mentioned problems existing in the prior art, the present invention provides an online inspection platform for automobile parts assembly based on machine vision. By adopting a data enhancement method of adding trace noise and feature loss measurement, the restoration of image details is guaranteed while expanding the automobile parts defect data set. At the same time, the extracted prior knowledge is used to guide the design of the prior frame in the recognition model, further improving the efficiency and accuracy of the generation of the prior frame.

[0005] The purpose of the present invention can be achieved by the following technical solutions: The present disclosure provides an online detection platform for automobile parts assembly based on machine vision, including a detection and recognition module, wherein the detection and recognition module is used to process the collected automobile parts images and input them into a trained prior knowledge defect recognition model to obtain a recognition result; The establishment of the prior knowledge defect recognition model includes the following steps: Dataset division: Load the dataset through the defect image database, and randomly divide the dataset into training set and test set; Correlation feature extraction: extract key features through the data table information of the data set, and use feature vectorization to convert the extracted features into digital quantities as prior knowledge; Model training: The image data of the training set is first subjected to feature extraction by a VGG16 convolutional neural network; then a priori box design and prior knowledge transfer learning are introduced into the RPN to generate a set of region proposals; finally, the output of the model is obtained through classification and regression; Iterative optimization: Repeat the model training steps and continuously iterate to obtain the optimal hyperparameters; input the optimal hyperparameter combination into the model to obtain the trained prior knowledge Faster R-CNN image recognition model; then input the test set into the trained model for verification.

[0006] As a preferred technical solution of the present invention, it also includes a data storage module, which is used to build a defect image database of automobile parts and store and manage automobile parts defect data.

[0007] As a preferred technical solution of the present invention, the construction of the defect image database of automobile parts comprises the following steps: Constructing a data set: Collecting component images containing target detection defects, standardizing the defect image data format, and forming a component defect image data set; Defect image annotation: First, the images of mobile phone components are processed through the image processing module; then, the defect images of components are annotated using expert knowledge, and the annotated images are saved in the dataset; Dataset enhancement: Data enhancement is performed on small sample automotive parts data by adding Gaussian noise to simulate random disturbances caused by illumination changes to achieve image data enhancement; Establish database: Use relational database to build defect image database of automobile parts; realize data storage and database logical structure construction by establishing corresponding data tables; Among them, the defect image database includes a defect image information table and a defect type table; the defect image information table is used to store the category name, defect location, shooting equipment, lighting conditions, manufacturing batches, environmental conditions, storage path and defect type code of defect images of various types of components, and the defect type table is used to store the defect type corresponding to the defect type code.

[0008] As a preferred technical solution of the present invention, the standard defect image data format includes image segmentation and size adjustment, specifically: Determine the uniform size of the component defect image data set, and cut the component images into small square blocks in sequence based on the height pixel unit of the component images; ; ; ; In the formula, L ,H Indicates the length pixel value and height pixel value of the component image. N Indicates the number of divisible blocks, l ( i ) indicates the i The length pixel value range corresponding to the block image, l ( N +1) represents the length pixel value range of the cut block with insufficient height pixel value after the component image is cut; Adjust the image size to L × H The original image A is reduced or enlarged K times to obtain a size of l × h The target image B is assumed to have a pixel value at (X, Y) of the target image B corresponding to the pixel value of point P in the original image A. The pixel point with the shortest distance to point P is a(i, j). The bicubic interpolation algorithm is used to form the corresponding relationship, and then: ; in Indicate point The horizontal weight value, express The vertical weight of the point; The pixel value of point P is calculated to correspond to the target image B, thereby achieving the size adjustment of the component image.

[0009] As a preferred technical solution of the present invention, the data set enhancement comprises the following steps: The original input image F1 is input into the content encoder to extract content features related to image recognition. f x1 , the input scene encoder extracts scene features that are not related to image recognition f w1 ; Randomly selected images are fed into the scene encoder to extract scene features. f wR , the scene features of the original input image F1 f w1 Scene characteristics with FR f wR Mix to get mixed scene features f wR1 , the calculation formula is: f wR1 = αf w1 +(1- α ) f wR ; in, α is the image mixing rate; Mixing scene features f wR1 and content features f x1 Input the decoder D to generate an image with mixed scene features, and then add Gaussian noise perturbation to the mixed scene feature image to generate the final image FM, which is expressed as: FM=D( f wR1 , f x1 )+ noise ; The generated FM is input into the content encoder to obtain its content features, and the mean square error loss function is used to measure and constrain its content features to be consistent with the content features of image F1.

[0010] As a preferred technical solution of the present invention, it also includes an image acquisition module, which is used to capture images of automobile parts in real time through an industrial camera and transmit the acquired images to the image processing module; The image acquisition module is connected to at least one module having the following functions: A light source module for providing shooting lighting; Lens modules for adjusting and controlling the focus, field of view, and aperture of an image; Communication modules for data transfer and communication.

[0011] As a preferred technical solution of the present invention, it also includes an image processing module, which is used to remove image noise generated during image acquisition and transmission, and to process uneven illumination and high reflectivity on the image surface.

[0012] As a preferred technical solution of the present invention, the image processing module processes the image including the following steps: A second-order Butterworth low-pass filter is selected to process the image, the cutoff frequency is set to 40, and the transfer function is: ; ; In the formula, H ( u , v ) is the transfer function, D ( u , v ) is the distance from any pixel on the image to the center of the frequency domain, u , v is a discrete variable, M is the maximum horizontal coordinate of the image,N is the maximum vertical coordinate of the image; Read the grayscale image and calculate its average grayscale, then divide the image into 108×108 sub-blocks and calculate the average brightness of each sub-block to form an average brightness matrix; The brightness interpolation matrix and the brightness distribution matrix are calculated by two-dimensional interpolation through the average brightness matrix, and the original image is subtracted from the brightness distribution matrix to obtain an image with uniform lighting after processing.

[0013] As a preferred technical solution of the present invention, the associated feature extraction comprises the following steps: Convert the raw data table data in the defect image database into a format suitable for association rule mining, usually a transaction data set, where each transaction corresponds to a set of items; Define the minimum support threshold and minimum confidence, where the minimum support threshold is used to filter out frequently occurring item sets, and the minimum confidence is used to filter out association rules with higher credibility; Adopt association rule mining algorithm, scan the database, calculate the support of each item, filter out items that meet the minimum support threshold, and repeat this process until no new frequent item sets can be generated; Generate all possible association rules from the frequent item set, calculate the confidence of each rule, and filter out the rules that meet the minimum confidence threshold; Use evaluation indicators to assess the effectiveness and practicality of association rules, and verify the accuracy and practicality of association rules in actual data; The extracted association rules are summarized, the prior knowledge for defect image recognition is refined, and these rules are converted into matrix representations suitable for embedding models.

[0014] As a preferred technical solution of the present invention, in the model training, the prior frame design and prior knowledge transfer learning are specifically as follows: The prior frame design adopts the method of integrating the candidate network of the guiding frame area. The guiding frame is used to predict the shape and position characteristics of the defect, and only the prediction probability value greater than the preset minimum confidence is retained during the network training process, specifically including: Adopt the association rules mined in the defect image database, transform all the mined association rules into logical judgment conditions, perform logical judgment on the defect image, and check whether there is an area in the image that meets the rule conditions; The defect areas determined by multiple association rules applicable to the same image are prioritized to infer the shape and location of the defect in the image; A set of offset adjustments is obtained through the shape prediction structure to guide the adjustment of the prior box size; The expression of the prior box is: ; ; ; In the formula, w k , h k Respectively k The width and height of the prior box; d w , d h Respectively k The width and height offset of the prior box; q is the number of prior boxes in the same image; f min , f max are the minimum and maximum values ​​of the scale factor, respectively; f k , a k Respectively k The scale factor and aspect ratio factor of the prior box; The prior knowledge transfer learning uses a cross entropy function to measure the loss of the classification task, and uses a smooth loss function to measure the loss of the bounding box regression task, and on this basis incorporates a prior knowledge penalty term.

[0015] The beneficial effects of the present invention are: The present invention firstly aims at the problems of small data volume and unclear defect location of component surface defect data set, and adopts a data enhancement method of adding trace noise and feature loss measurement to expand the automobile component defect data set while ensuring the restoration of image details. Secondly, in order to facilitate the later training of component defect image recognition model, an automobile component defect image database is established, and an information-rich defect image information table is constructed, which provides data support for mining and extracting prior knowledge from the defect image database. At the same time, the association rules obtained by the association rule mining algorithm are converted into prior knowledge to guide the design of the prior frame in the recognition model, which further improves the efficiency and accuracy of the generation of the prior frame, and makes enhancements and improvements from two aspects: data and model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0017] Figure 1 A schematic diagram of the structure of an online inspection platform for automobile parts assembly based on machine vision provided in the first embodiment of the present invention; Figure 2A schematic diagram of the steps of establishing a priori knowledge defect recognition model in the detection and recognition module provided in the first embodiment of the present invention; Figure 3 A schematic diagram of the steps of constructing a defect image database of automobile parts in a data storage module provided in the first embodiment of the present invention; Figure 4 A schematic diagram of the steps of designing a priori frame provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0018] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0019] Machine vision is a non-contact, non-destructive automatic detection technology. It is an effective means to achieve equipment automation, intelligence and precision control. It has outstanding advantages such as safety and reliability, wide spectral response range, long-term operation in harsh environments and high production efficiency. The machine vision inspection system obtains the surface image of the product through appropriate light sources and image sensors (CCD cameras), extracts the feature information of the image using corresponding image processing algorithms, and then locates, identifies, and classifies surface defects and performs operations such as statistics, storage, and query based on the feature information.

[0020] Embodiment 1 This embodiment provides an online inspection platform for automobile parts assembly based on machine vision. Figure 1 As shown, it includes an image acquisition module, an image processing module, a detection and recognition module and a data storage module; The image acquisition module is used to capture the image of the automobile parts in real time through the industrial camera and transmit the acquired image to the image processing module; The image acquisition module is connected to at least one module having the following functions: A light source module for providing shooting lighting; Lens modules for adjusting and controlling the focus, field of view, and aperture of an image; Communication modules for data transfer and communication.

[0021] The image processing module is used to remove the image noise generated during image acquisition and transmission, and to process the uneven illumination and high reflectivity of the image surface, and specifically includes the following steps: S01. Select the second-order Butterworth low-pass filter to process the image, set the cutoff frequency to 40, and the transfer function is: ; (1) ; (2) In the formula, H ( u , v ) is the transfer function, D ( u , v ) is the distance from any pixel on the image to the center of the frequency domain, u , v is a discrete variable, M is the maximum horizontal coordinate of the image, N is the maximum vertical coordinate of the image.

[0022] It should be noted that the process of image acquisition by the camera is essentially the corresponding process of the photoelectric sensor converting the light signal into an electrical signal with a regular waveform, so the essence of image filtering is to eliminate and reduce the useless signals collected by the photoelectric sensor to ensure the collection and application of key signals. In this embodiment, the order of the Butterworth low-pass filter is adjusted to approach the processing characteristics of the ideal low-pass filter and the Gaussian low-pass filter. In order to maintain the overall structure and image details of the image to a greater extent, the order is selected as the second order; at the same time, in the filter processing results under different termination frequencies, when the cutoff frequency is set to 40, the Butterworth low-pass filter filters out most of the background image noise while ensuring the image details, and basically eliminates the ringing effect.

[0023] S02, read the grayscale image and calculate its average grayscale, then divide the image into 108×108 sub-blocks, and calculate the average brightness of each sub-block to form an average brightness matrix; S03. Using the average brightness matrix, a brightness interpolation matrix and a brightness distribution matrix are calculated by two-dimensional interpolation, and the original image is subtracted from the brightness distribution matrix to obtain a processed image with uniform illumination.

[0024] It can be understood that after the above processing method, the image illumination distribution is made uniform, and the influence of reflection on the image recognition of metal workpiece surface defects is reduced. The image processing in this embodiment mainly aims at the problem of reflection of the image collected on the smooth surface of automobile parts. In the process of image processing, the background noise of the image is first removed by image filtering of digital signals to improve the overall contrast of the image, and then the light intensity in the image is homogenized through illumination compensation, which improves the accuracy and stability of subsequent image segmentation.

[0025] The detection and recognition module is used to perform defect detection and recognition on the collected automobile parts images, and specifically includes the following steps: The sensor triggers the camera to take pictures and obtain real-time images of parts; the collected original images are processed, including denoising, filtering, grayscale transformation, image enhancement and other operations; the processed images are input into the trained prior knowledge defect recognition model to obtain the recognition results.

[0026] Among them, Figure 2 As shown, establishing a priori knowledge defect recognition model includes the following steps: S11, data set division: load the data set through the defect image database, and randomly divide the data set into a training set and a test set; S12, associated feature extraction: extract key features through the data table information of the data set, and use feature vectorization to convert the extracted features into digital quantities as prior knowledge; In this embodiment, the extracted associated features are used as prior knowledge. The prior knowledge here refers to the relevant features extracted from the defect image database about the defective component type, defect location, shooting equipment, lighting conditions, manufacturing batch, environmental conditions and defect type.

[0027] S13, model training: The image data of the training set is first subjected to feature extraction by the VGG16 convolutional neural network; then the prior frame design and prior knowledge transfer learning are introduced into the RPN to generate a set of region proposals; finally, the output of the model is obtained through classification and regression; S14, iterative optimization: repeat the model training steps and iterate to get the optimal hyperparameters. Input the optimal hyperparameter combination into the model to get the trained prior knowledge Faster R-CNN image recognition model; then input the test set into the trained model to verify the effectiveness of the model.

[0028] It should be noted that FasterR-CNN, as an improved model of R-CNN and FastR-CNN, achieves real-time target recognition with higher accuracy, using Region Proposal Networks (RPN) to replace the traditional region proposal method. The core structure of FasterR-CNN mainly includes image feature extraction, RPN network, candidate regions, RoI pooling layer, classification layer and regression layer. In this embodiment, the defect features of parts extracted based on association rules are used as prior knowledge through the design of prior boxes and prior knowledge transfer learning, which improves the accuracy and efficiency of the FasterR-CNN algorithm in the recognition of defective images of automotive parts.

[0029] The data storage module is used to construct a defect image database of automobile parts, store and manage the defect data of automobile parts, and facilitate operations such as adding, deleting, changing and querying the image data.

[0030] Among them, Figure 3 As shown in FIG. 1 , constructing a defect image database of automobile parts includes the following steps: S21. Build a data set: collect component images containing target detection defects, standardize the defect image data format, and form a component defect image data set.

[0031] Among them, the standard defect image data format includes image segmentation and size adjustment, specifically: Determine the uniform size of the component defect image data set, and cut the component images into small square blocks in sequence based on the height pixel unit of the component images; ; (3) ; (4) ; (5) In the formula, L , H Indicates the length pixel value and height pixel value of the component image. N Indicates the number of divisible blocks, l ( i ) indicates the i The length pixel value range corresponding to the block image, l ( N +1) represents the length pixel value range of the cut blocks with insufficient height pixel value remaining after the component image is cut.

[0032] Adjust the image size to L × H The original image A is reduced or enlarged K times to obtain a size of l × h The target image B is assumed to have a pixel value at (X, Y) in the target image B corresponding to the pixel value at point P in the original image A. The pixel point closest to point P is a(i, j). The bicubic interpolation algorithm is used to form a corresponding relationship. Then, we have: ; (6) in Indicate point The horizontal weight value, express The vertical weight of the point.

[0033] The pixel value of point P is calculated to correspond to the target image B, thereby achieving the size adjustment of the component image.

[0034] S22. Defect image annotation: First, the image of the mobile phone components is processed by the image processing module to make the defect features of the components more prominent; then, the defect images of the components are annotated using expert knowledge, and the annotated images are saved in the data set.

[0035] S23. Dataset enhancement: Data enhancement is performed on small sample automotive parts data. Image data enhancement is achieved by adding Gaussian noise to simulate random perturbations caused by illumination changes.

[0036] It should be noted that since the number of real automobile parts defect samples obtained is small, first of all, the small sample automobile parts data needs to be enhanced to expand the originally small number of parts defect data; secondly, since the surface of automobile parts is relatively smooth and has extremely high sensitivity and reflectivity to light, the irradiated light will produce high-brightness strips and apertures in some areas of the part surface. Therefore, in this embodiment, Gaussian noise is added to simulate the random disturbance of light changes to achieve image data enhancement.

[0037] S24, establish database: considering that the automobile parts defect image database has business requirements such as data addition, data retrieval, data modification, data download, and the stored data is structured data. Therefore, the automobile parts defect image database adopts a relational database; The data storage and database logical structure are realized by establishing corresponding data tables. The defect image database is mainly composed of two data tables, including the defect image information table and the defect type table; the defect image information table is used to store the category name, defect location, shooting equipment, lighting conditions, manufacturing batches, environmental conditions, storage path and defect type code of defect images of various parts, and the defect type table is used to store the defect type corresponding to the defect type code.

[0038] Therefore, the functions of the established defect image database include defect image display, new defect image upload, defect type screening, defect image download, etc.

[0039] In this embodiment, by constructing a defect image database of automobile parts, standardized management and sharing of defect images are achieved, providing data support for subsequent automobile parts defect detection and identification, and ensuring identification accuracy and application effect.

[0040] Embodiment 2 In some embodiments, the extraction of associated features in establishing a priori knowledge defect recognition model is specifically as follows: The association rules are used to mine and extract prior knowledge in the defect image database, including the following steps: S31, converting the original data table data in the defect image database into a format suitable for association rule mining, usually a transaction data set, where each transaction corresponds to a group of items; S32, defining a minimum support threshold and a minimum confidence, wherein the minimum support threshold is used to filter out frequently occurring item sets, and the minimum confidence is used to filter out association rules with higher credibility; S33, using association rule mining algorithms (such as Apriori algorithm or FP-growth algorithm), scanning the database, calculating the support of each item, screening out items that meet the minimum support threshold, and repeating this process until no new frequent item sets can be generated; S34, generating all possible association rules from the frequent item set, calculating the confidence of each rule, and screening out the rules that meet the minimum confidence threshold; S35. Use evaluation indicators (such as lift, coverage, etc.) to evaluate the effectiveness and practicality of association rules, and verify the accuracy and practicality of association rules in actual data; S36. Summarize the extracted association rules, refine the prior knowledge for defect image recognition, and convert these rules into a matrix representation suitable for embedding model.

[0041] Association rules are of the form X The implied form of Y, where X={x1, x2, …, x m} I,Y={y1,y2,…,y n} I, X and Y are different itemsets and are non-empty. Y means that in a transaction, if the antecedent X appears, then the consequent Y will appear with a certain probability. Suppose there is an association rule X Y, then the support Support(X Y) = P (X, Y) represents the possibility of a certain item set X∪Y appearing in the transaction database; Confidence (X Y)=P(Y|X)=P(X,Y) / P(X) represents the probability of the occurrence of the consequent under the condition that the antecedent occurs, which is the possibility of the occurrence of a conditional probability.

[0042] In this embodiment, association rules are used to mine and extract prior knowledge in the defect image database, identify the association rules and patterns between different defects, and reveal the potential dependencies between defects. The mined association rules are used to guide the generation of prior frames and predict the shape and position of defects, effectively improving the generation efficiency and accuracy of prior frames.

[0043] Embodiment 3 In some embodiments, the prior frame design and prior knowledge transfer learning are specifically as follows: The prior frame design adopts the method of integrating the guidance frame region candidate network, using the extracted prior knowledge to guide the center position and aspect ratio of the anchor frame, so that the model can generate candidate anchor frames of any size while improving the efficiency of generating suggestion frames; The guidance frame is used to predict the shape and location characteristics of the defect, and only the predicted probability values ​​greater than the pre-set minimum confidence level are retained during the network training process, further filtering out the anchor frame areas that are not related to the target defect, such as Figure 4 As shown, specifically: S41, using the association rules mined in the defect image database, converting all the mined association rules into conditions for logical judgment, performing logical judgment on the defect image, and checking whether there is an area in the image that meets the rule conditions; S42, setting priorities for defect areas determined by multiple association rules applicable to the same image, and inferring the shape and position of the defect in the image; S43. Obtain a set of offset adjustment values ​​through the shape prediction structure. The role of the offset vector is to make the predicted anchor box as close to the real anchor box as possible, so as to guide the adjustment of the size of the prior box.

[0044] The expression of the prior box is: ; (7) ; (8) ; (9) In the formula, wk , hk Respectively k The width and height of the prior box; dw , dh Respectively k The width and height offset of the prior box; q is the number of prior boxes in the same image; f min, f max are the minimum and maximum values ​​of the scale factor respectively; fk , ak Respectively k The scale factor and aspect ratio factor of the prior box.

[0045] In order to further improve the problem of imbalance between positive and negative samples in the candidate box generation of the target detection network, a focused loss function is added during training to reduce the impact of negative sample candidate boxes in the generated candidate boxes on the model detection results.

[0046] Prior knowledge transfer learning achieves feature transfer by fixing the feature extraction layers in the trained model and replacing the remaining layers with the layers required for the new task.

[0047] The cross entropy function is used to measure the loss of the classification task, and the smooth loss function is used to measure the loss of the bounding box regression task, and the prior knowledge penalty term is incorporated on this basis.

[0048] It should be noted that the transfer learning method using prior knowledge can better utilize existing knowledge and improve the generalization ability of the model. By introducing prior knowledge penalty terms, the model's ability to learn and utilize prior knowledge can be increased, thereby improving the model's performance in identifying defective images of parts.

[0049] Embodiment 4 In some embodiments, the specific steps of data set enhancement are: The original input image F1 is input into the content encoder to extract content features related to image recognition. f x1 , such as the boundary information of the image, etc., and input the scene encoder to extract scene features that are not related to image recognition f w1 , such as reflection, background information, etc.; Randomly selected images are fed into the scene encoder to extract scene features. f wR , the scene features of the original input image F1 f w1 Scene characteristics with FR f wR Mix to get mixed scene features f wR1 , the calculation formula is: f wR1 = αf w1 +(1- α ) f wR ; (10) in, α is the image mixing rate.

[0050] Mixing scene features f wR1 and content features f x1 Input the decoder D to generate an image with mixed scene features, and then add Gaussian noise perturbation to the mixed scene feature image to generate the final image FM, which is expressed as: FM=D( f wR1 , f x1 )+ noise ; (11) The generated FM is input into the content encoder to obtain its content features. Its content features are constrained to be consistent with the content features of image F1 to ensure that the boundaries of the generated image are clear, which is measured by the mean square error loss function.

[0051] In this embodiment, the purpose of image data enhancement is achieved by adding Gaussian noise to simulate the lighting changes of the image captured by the component. At the same time, during the processing, by introducing the content feature loss measure while adding Gaussian noise, the image's restoration of details is improved, and Gaussian noise disturbance is added to the image to make the data more diverse.

[0052] The present invention firstly aims at the problems of small data volume and unclear defect location of component surface defect data set, and adopts a data enhancement method of adding trace noise and feature loss measurement to expand the automobile component defect data set while ensuring the restoration of image details. Secondly, in order to facilitate the later training of component defect image recognition model, an automobile component defect image database is established, and an information-rich defect image information table is constructed, which provides data support for mining and extracting prior knowledge from the defect image database. At the same time, the association rules obtained by the association rule mining algorithm are converted into prior knowledge to guide the design of the prior frame in the recognition model, which further improves the efficiency and accuracy of the generation of the prior frame, and makes enhancements and improvements from two aspects: data and model.

[0053] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. An online inspection platform for automobile parts assembly based on machine vision, characterized by: It includes a detection and recognition module, which is used to process the collected images of automobile parts and input them into a trained prior knowledge defect recognition model to obtain recognition results; The establishment of the prior knowledge defect recognition model includes the following steps: Dataset division: Load the dataset through the defect image database, and randomly divide the dataset into training set and test set; Correlation feature extraction: extract key features through the data table information of the data set, and use feature vectorization to convert the extracted features into digital quantities as prior knowledge; Model training: The image data of the training set is first subjected to feature extraction by a VGG16 convolutional neural network; then a priori box design and prior knowledge transfer learning are introduced into the RPN to generate a set of region proposals; finally, the output of the model is obtained through classification and regression; Iterative optimization: Repeat the model training steps and continuously iterate to obtain the optimal hyperparameters; input the optimal hyperparameter combination into the model to obtain the trained prior knowledge Faster R-CNN image recognition model; then input the test set into the trained model for verification.

2. The online detection platform for automobile parts assembly based on machine vision according to claim 1, characterized in that: It also includes a data storage module, which is used to build a defect image database of automobile parts and store and manage automobile parts defect data.

3. The online detection platform for automobile parts assembly based on machine vision according to claim 2 is characterized by: The construction of the defect image database of automobile parts comprises the following steps: Constructing a data set: Collecting component images containing target detection defects, standardizing the defect image data format, and forming a component defect image data set; Defect image annotation: First, the images of mobile phone components are processed through the image processing module; then, the defect images of components are annotated using expert knowledge, and the annotated images are saved in the dataset; Dataset enhancement: Data enhancement is performed on small sample automotive parts data by adding Gaussian noise to simulate random disturbances caused by illumination changes to achieve image data enhancement; Establish database: Use relational database to build defect image database of automobile parts; realize data storage and database logical structure construction by establishing corresponding data tables; Among them, the defect image database includes a defect image information table and a defect type table; the defect image information table is used to store the category name, defect location, shooting equipment, lighting conditions, manufacturing batches, environmental conditions, storage path and defect type code of defect images of various types of components, and the defect type table is used to store the defect type corresponding to the defect type code.

4. The online detection platform for automobile parts assembly based on machine vision according to claim 3 is characterized by: The standard defect image data format includes image segmentation and size adjustment, specifically: Determine the uniform size of the component defect image data set, and cut the component images into small square blocks in sequence based on the height pixel unit of the component images; ; ; ; In the formula, L , H Indicates the length pixel value and height pixel value of the component image. N Indicates the number of divisible blocks, l ( i ) indicates the i The length pixel value range corresponding to the block image, l ( N +1) represents the length pixel value range of the cut block with insufficient height pixel value after the component image is cut; Adjust the image size to L × H The original image A is reduced or enlarged K times to obtain a size of l × h The target image B is assumed to have a pixel value at (X, Y) of the target image B corresponding to the pixel value of point P in the original image A. The pixel point with the shortest distance to point P is a(i, j). The bicubic interpolation algorithm is used to form the corresponding relationship, and then: ; in W ( i ) represents point a( i , j ) horizontal weight value, W ( j ) means a( i , j )The weight value of the point in the vertical direction; The pixel value of point P is calculated to correspond to the target image B, thereby achieving the size adjustment of the component image.

5. The online inspection platform for automobile parts assembly based on machine vision according to claim 4 is characterized by: The data set enhancement comprises the following steps: The original input image F1 is input into the content encoder to extract content features related to image recognition. f x1 , the input scene encoder extracts scene features that are not related to image recognition f w1 ; Randomly selected images are fed into the scene encoder to extract scene features. f wR , the scene features of the original input image F1 f w1 Scene characteristics with FR f wR Mix to get mixed scene features f wR1 , the calculation formula is: f wR1 = αf w1 +(1- α ) f wR ; in, α is the image mixing rate; Mixing scene features f wR1 and content features f x1 Input the decoder D to generate an image with mixed scene features, and then add Gaussian noise perturbation to the mixed scene feature image to generate the final image FM, which is expressed as: FM=D( f wR1 , f x1 )+ noise ; The generated FM is input into the content encoder to obtain its content features, and the mean square error loss function is used to measure and constrain its content features to be consistent with the content features of image F1.

6. The online detection platform for automobile parts assembly based on machine vision according to claim 1, characterized in that: It also includes an image acquisition module, which is used to capture images of automobile parts in real time through an industrial camera and transmit the acquired images to the image processing module; The image acquisition module is connected to at least one module having the following functions: A light source module for providing shooting lighting; Lens modules for adjusting and controlling the focus, field of view, and aperture of an image; Communication modules for data transfer and communication.

7. The online inspection platform for automobile parts assembly based on machine vision according to claim 1, characterized in that: It also includes an image processing module, which is used to remove image noise generated during image acquisition and transmission, and to process uneven illumination and high reflectivity on the image surface.

8. The online inspection platform for automobile parts assembly based on machine vision according to claim 7, characterized in that: The image processing module processes the image including the following steps: A second-order Butterworth low-pass filter is selected to process the image, the cutoff frequency is set to 40, and the transfer function is: ; ; In the formula, H ( u , v ) is the transfer function, D ( u , v ) is the distance from any pixel on the image to the center of the frequency domain, u , v is a discrete variable, M is the maximum horizontal coordinate of the image, N is the maximum vertical coordinate of the image; Read the grayscale image and calculate its average grayscale, then divide the image into 108×108 sub-blocks and calculate the average brightness of each sub-block to form an average brightness matrix; The brightness interpolation matrix and the brightness distribution matrix are calculated by two-dimensional interpolation through the average brightness matrix, and the original image is subtracted from the brightness distribution matrix to obtain an image with uniform lighting after processing.

9. The online inspection platform for automobile parts assembly based on machine vision according to claim 1, characterized in that: The associated feature extraction comprises the following steps: Convert the raw data table data in the defect image database into a format suitable for association rule mining, usually a transaction data set, where each transaction corresponds to a set of items; Define the minimum support threshold and minimum confidence, where the minimum support threshold is used to filter out frequently occurring item sets, and the minimum confidence is used to filter out association rules with higher credibility; Adopt association rule mining algorithm, scan the database, calculate the support of each item, filter out items that meet the minimum support threshold, and repeat this process until no new frequent item sets can be generated; Generate all possible association rules from the frequent item set, calculate the confidence of each rule, and filter out the rules that meet the minimum confidence threshold; Use evaluation indicators to assess the effectiveness and practicality of association rules, and verify the accuracy and practicality of association rules in actual data; The extracted association rules are summarized, the prior knowledge for defect image recognition is refined, and these rules are converted into matrix representations suitable for embedding models.

10. The online inspection platform for automobile parts assembly based on machine vision according to claim 1, characterized in that: In the model training, the prior frame design and prior knowledge transfer learning are specifically as follows: The prior frame design adopts the method of integrating the candidate network of the guiding frame area. The guiding frame is used to predict the shape and position characteristics of the defect, and only the prediction probability value greater than the preset minimum confidence is retained during the network training process, specifically including: Adopt the association rules mined in the defect image database, transform all the mined association rules into logical judgment conditions, perform logical judgment on the defect image, and check whether there is an area in the image that meets the rule conditions; The defect areas determined by multiple association rules applicable to the same image are prioritized to infer the shape and location of the defect in the image; A set of offset adjustments is obtained through the shape prediction structure to guide the adjustment of the prior box size; The expression of the prior box is: ; ; ; In the formula, w k , h k Respectively k The width and height of the prior box; d w , d h Respectively k The width and height offset of the prior box; q is the number of prior boxes in the same image; f min , f max are the minimum and maximum values ​​of the scale factor, respectively; f k , a k Respectively k The scale factor and aspect ratio factor of the prior box; The prior knowledge transfer learning uses a cross entropy function to measure the loss of the classification task, and uses a smooth loss function to measure the loss of the bounding box regression task, and on this basis incorporates a prior knowledge penalty term.

Citation Information

Cited By

  • Defect detection method and device for metal shaft parts

    CN120009404A

  • Visual detection method and system for assembly standardization of parts

    CN120510137A

  • A method and system for visual inspection of component assembly standards

    CN120510137B