Automobile parts defect detection method and system based on machine vision
Through the application of machine vision technology, including defective product sampling, defect distribution analysis and multi-level judgment networks, the problem of parts waste caused by fixed standards is solved and inspection accuracy and production efficiency are improved.
Patent Information
- Application Number
- CN202410949780.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-16
AI Technical Summary
Existing auto parts defect detection technology adopts fixed standards, resulting in frequent detection without inducing parts to be scrapped, resulting in waste, low efficiency and high cost.
Adopt the auto parts defect detection method based on machine vision, through defective product sampling, defect distribution analysis, light source detection matching and multi-level judgment network, accurately divide the detection surface, adjust the lighting, perform image collection and comprehensive judgment to improve detection precision and accuracy .
It improves detection precision and accuracy, reduces parts waste, and ensures product quality and production efficiency.
Smart Images

Figure CN118501159B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular to a method and system for detecting defects in automobile parts based on machine vision. Background Art
[0002] Existing technologies for automobile parts defect detection usually adopt fixed standards, resulting in frequent detection of defects that do not cause parts to be scrapped. Secondary manual screening is required to recover eliminated parts in order to reduce parts waste caused by overly strict standards. On the one hand, this leads to a decrease in the efficiency of automobile parts defect detection, and on the other hand, the cost of detection increases due to the addition of manual labor. Summary of the invention
[0003] The present application provides a method and system for automobile part defect detection based on machine vision, aiming to solve the technical problem that the existing technology for automobile part defect detection usually adopts fixed standards, resulting in frequent detection of defects that do not induce part scrapping, resulting in part waste.
[0004] The first aspect disclosed in the present application provides a method for defect detection of automobile parts based on machine vision, the method comprising: sampling defective products according to model information of target automobile parts to obtain a sample defective product set; performing defect distribution analysis based on the sample defective product set, and dividing the detection surface of the target automobile part based on the analysis result to obtain multiple defect detection surfaces; performing light source detection matching according to the analysis result to obtain multiple light source detection strategies; scheduling a light source controller and an image collector to perform lighting adjustment and image acquisition on the multiple defect detection surfaces based on the multiple light source detection strategies to obtain multiple light source detection atlases; pre-constructing a defective product judgment network, wherein the defective product judgment network includes multiple local defective product judgment branches and defective product judgment fusion branches, wherein the multiple local defective product judgment branches are connected in parallel, and the output ends of the multiple local defective product judgment branches are connected to the input ends of the defective product judgment fusion branches; synchronizing the multiple light source detection atlases to the defective product judgment network, performing multi-level judgment via the multiple local defective product judgment branches and the defective product judgment fusion branches to obtain a target defect judgment result; and performing production management on the target automobile part according to the target defect judgment result.
[0005] The second aspect disclosed in the present application provides an automobile part defect detection system based on machine vision, and the system is used for the above-mentioned automobile part defect detection method based on machine vision, and the system includes: a defective sampling module, the defective sampling module is used to perform defective sampling according to the model information of the target automobile part to obtain a sample defective set; a detection surface division module, the detection surface division module is used to perform defect distribution analysis based on the sample defective set, and divide the detection surface of the target automobile part based on the analysis result to obtain multiple defect detection surfaces; a light source detection matching module, the light source detection matching module is used to perform light source detection matching according to the analysis result to obtain multiple light source detection strategies; an image acquisition module, the image acquisition module is used to schedule the light source controller and the image acquisition based on the multiple light source detection strategies The device performs illumination adjustment and image acquisition on the multiple defect detection surfaces to obtain multiple light source detection atlases; a network construction module, the network construction module is used to pre-construct a defective judgment network, wherein the defective judgment network includes multiple local defective judgment branches and defective judgment fusion branches, wherein the multiple local defective judgment branches are connected in parallel, and the output ends of the multiple local defective judgment branches are connected to the input ends of the defective judgment fusion branches; a multi-level judgment module, the multi-level judgment module is used to synchronize the multiple light source detection atlases to the defective judgment network, perform multi-level judgment via the multiple local defective judgment branches and the defective judgment fusion branches, and obtain a target defect judgment result; a production management module, the production management module is used to perform production management on the target automotive part according to the target defect judgment result.
[0006] According to a third aspect disclosed in the present application, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, any step of the first aspect disclosed in the present application is implemented.
[0007] The fourth aspect disclosed in the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the first aspect disclosed in the present application.
[0008] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0009] By sampling defective products according to part model information, a representative set of sample defective products is obtained. By performing defect distribution analysis and light source detection matching on the sample defective product set, the detection surface of the target automotive parts can be divided more accurately, and light source detection matching is performed for different defect characteristics to obtain multiple light source detection strategies, which can improve the detection precision and accuracy, thereby better detecting defects; based on multiple light source detection strategies, multiple defect detection surfaces are illuminated and adjusted, so that different defect detection surfaces can obtain high-quality images under the corresponding optimal lighting conditions, thereby improving the effect of defect presentation, and the obtained multiple light source detection atlases can provide image data under multiple light source conditions, thereby enhancing the comprehensiveness of detection; by pre-building a defective judgment network, including multiple local defective judgment branches and defective judgment fusion branches for multi-level judgment, defects of different levels can be comprehensively judged, thereby improving the accuracy of judgment; by executing production management according to the defect judgment results, defective parts can be discovered and handled in a timely manner to ensure product quality and production efficiency.
[0010] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A schematic diagram of a process flow of a method for detecting defects in automobile parts based on machine vision provided in an embodiment of the present application;
[0012] Figure 2 A schematic diagram of the structure of an automobile parts defect detection system based on machine vision provided in an embodiment of the present application;
[0013] Figure 3 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application.
[0014] Explanation of the reference numerals: defective product sampling module 10 , detection surface division module 20 , light source detection and matching module 30 , image acquisition module 40 , network construction module 50 , multi-level judgment module 60 , production management module 70 . DETAILED DESCRIPTION
[0015] The embodiments of the present application provide a method for detecting defects in automobile parts based on machine vision, thereby solving the technical problem that the prior art usually adopts fixed standards for detecting defects in automobile parts, resulting in frequent detection of defects that do not cause parts to be scrapped, leading to parts waste.
[0016] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application will be specifically introduced below in conjunction with the accompanying drawings of the specification. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0017] like Figure 1 As shown, the embodiment of the present application provides a method for detecting defects in automobile parts based on machine vision, the method comprising:
[0018] Defective product sampling is performed based on the model information of the target automobile parts to obtain a sample defective product set.
[0019] Determine the model information of the target automotive parts, including the production batch, manufacturer, design specifications and technical parameters of the parts, which can be obtained from the production management system. According to the model information, filter out the defective records related to these models. These records contain information about the defect type, defect location, defect cause and defect quantity of the defective parts. Organize these data to form a preliminary defective data set.
[0020] Defective products are extracted from the preliminary defective product data set. For example, a certain number of defective products are randomly extracted from all defective products for analysis using a random sampling method, or defective products are stratified according to different defect types or production batches using a stratified sampling method, and then random sampling is performed within each layer. After sampling, a sample defective product set is obtained to provide a data basis for subsequent defect distribution analysis and detection surface division.
[0021] Defect distribution analysis is performed based on the sample defective product set, and the detection surface of the target automobile part is divided based on the analysis result to obtain multiple defect detection surfaces.
[0022] Furthermore, defect distribution analysis is performed based on the sample defective product set, and the detection surface of the target automobile part is divided based on the analysis result to obtain multiple defect detection surfaces. The method also includes:
[0023] Pre-constructing apparent gridding constraints, wherein the apparent gridding constraints include grid size, gridding starting point and gridding vector; using the apparent gridding constraints to process multiple sample defective entities in the sample defective set to obtain multiple apparent grid atlases, wherein each apparent grid atlas includes K sample apparent grid images, and the K sample apparent grid images have K spatial position identifiers; performing group update of multiple apparent grid atlases according to the K spatial position identifiers to obtain K groups of sample apparent grid images; performing defect reproduction analysis on the K groups of sample apparent grid images to obtain K defect composition features; performing apparent grid reorganization according to the K defect composition features to obtain the multiple defect detection surfaces.
[0024] Pre-constructed apparent gridding constraints ensure that multiple samples of the same model remain spatially consistent during the gridding process by uniformly planning parameters such as grid size, gridding starting point and gridding vector.
[0025] Specifically, the grid size is the basic unit in mesh division, which determines the size of each grid unit. The grid size is selected according to the complexity of the surface features of the part. A smaller grid size is selected for a more complex surface, and a larger grid size is selected for a simpler surface. While ensuring the precision, the grid size that can optimize the calculation efficiency is selected.
[0026] The meshing starting point is the starting position of meshing, ensuring that the meshing processing of all sample parts starts from the same reference point to ensure spatial consistency. A position on the part surface that is easy to determine and consistent in all samples is selected as the starting point, such as a fixed point or feature point of the part.
[0027] The meshing vector determines the direction of mesh division, which usually includes vectors in two directions to ensure that the mesh division direction is consistent on all sample parts. Select a vector that is consistent with the direction of the main features of the part to ensure that the mesh division direction is consistent with the feature direction of the part. Usually, two orthogonal vectors are selected to ensure complete coverage of the mesh division.
[0028] According to the pre-constructed apparent gridding constraints, each defective entity in the sample defective set is gridded, including using a predetermined grid size to divide each sample defective entity into a number of grid cells, starting from a unified gridding starting point, gridding each sample defective entity to ensure spatial consistency, and gridding according to a predetermined gridding vector direction to ensure consistent grid directions.
[0029] A plurality of apparent grid atlases are generated based on the processed plurality of sample defective entities, each atlas containing K sample apparent grid images, K being the number of sample apparent grid images in each apparent grid atlas, and the size of K being determined according to the grid size, and a spatial position mark is added to each sample apparent grid image to indicate its specific position in the entire sample entity.
[0030] For each sample apparent grid image in the apparent grid atlas, read its spatial position identifier, such as (i, j), and classify all sample apparent grid images according to the same spatial position according to the spatial position identifier. For example, put all sample apparent grid images at position (i, j) in one group to form a new image set. Repeat the above process until all images at K spatial positions have been classified, and obtain K groups of sample apparent grid images, each group of images corresponding to one position.
[0031] A defect recognition network is constructed based on the standard production defect set to identify defects in each image and extract features from the identified defects, such as the shape, size, location and type of the defects. The defect features in each group of images are aggregated to obtain the defect constituent features of the group, which are traversed in sequence to obtain K defect constituent features.
[0032] Analyze the distribution of K defect constituent features in the grid, identify defect-frequent areas and feature-concentrated areas, re-divide the inspection surface according to the distribution of defect features, and combine high-frequency defect areas into independent inspection surfaces. Each inspection surface includes one or more adjacent grid units for subsequent analysis. New defect inspection surfaces are formed through apparent grid reorganization, and each inspection surface has similar or related defect features.
[0033] Furthermore, performing defect reproduction analysis on the K groups of sample apparent grid images to obtain K defect composition features, the method further includes:
[0034] The method comprises the following steps: obtaining a standard production defect set through interactive production logs, and constructing a defect recognition network based on the standard production defect set; inputting a plurality of sample apparent grid images in a first group of sample apparent grid images that are mapped to the same position of the plurality of sample defective entities into the defect recognition network, performing defect recognition, and obtaining a plurality of defect recognition results, wherein the first group of sample apparent grid images is any one of the K groups of sample apparent grid images; aggregating the plurality of defect recognition results, and obtaining a plurality of occurrence frequency parameters of a plurality of grid aggregated defects; presetting a defect defect associated frequency threshold, and screening the plurality of grid aggregated defects with the defect defect associated frequency and the plurality of occurrence frequency parameters, and obtaining a first defect constituent feature; and by analogy, performing defect reproduction analysis on the K groups of sample apparent grid images, and obtaining the K defect constituent features.
[0035] By interacting with the production logs at the production site, we obtain records of various defects that occur during the production process. These records include image data sets for each defect. We organize the acquired image data sets, put similar defects together, and determine the characteristics, type, location and other information of each defect to form a standard production defect set.
[0036] Use machine learning technology to build a defect recognition network, use a standard production defect set to train and optimize the defect recognition network, and improve the accuracy and generalization ability of the defect recognition network by continuously adjusting model parameters, increasing training data, and performing data enhancement. Use a validation set to verify the trained defect recognition network and evaluate its performance on unknown data. Adjust and optimize the model based on the evaluation results until the preset recognition effect is achieved.
[0037] A group of K groups of sample apparent grid images is randomly selected as the first group of sample apparent grid images. From the first group of sample apparent grid images, multiple sample apparent grid images mapped to the same position of multiple sample defective entities are extracted, and these images have different defect conditions at the same position. The extracted multiple sample apparent grid images are input into the constructed defect recognition network, and the defect recognition network performs defect recognition on each image to identify various defect conditions in the image. For the multiple input images, the defect recognition network outputs multiple defect recognition results, which reflect the defect conditions existing in different sample images at the same position.
[0038] The multiple defect recognition results are aggregated, and the occurrence frequency parameters of each defect are counted, that is, for each defect, the number of times it appears in multiple sample images is recorded to form multiple occurrence frequency parameters.
[0039] For different types of defects, a defect defect association frequency threshold is preset. This threshold can be set according to actual conditions and needs to screen out defects with certain associations. For each grid aggregation defect, screening is performed based on the preset defect defect association frequency threshold and occurrence frequency parameters. If the occurrence frequency of a certain defect exceeds the preset threshold, the defect is considered important and relevant, and is retained as one of the first defect constituent features.
[0040] Repeat the above steps to perform defect reproduction analysis on K groups of sample apparent grid images to obtain K defect composition features. Each group of sample apparent grid images will obtain corresponding defect composition features for subsequent apparent grid reconstruction and defect detection surface generation.
[0041] Furthermore, performing apparent mesh reorganization according to the K defect constituent features to obtain the plurality of defect detection surfaces, the method further includes:
[0042] The target automobile part is modeled and restored, and the modeling result is processed by the apparent meshing constraint meshing to obtain an apparent meshing model; the K spatial position identifiers are used to fill the K defect constituent features into the apparent meshing model; a plurality of merged starting point grids are obtained, wherein the plurality of merged starting point grids are obtained by positioning the apparent meshing model with a preset adjacent grid comparison interval as a constraint; adjacent apparent mesh merging judgments are performed based on the plurality of merged starting point grids until all the apparent meshes of the apparent meshing model are traversed to obtain the plurality of defect detection surfaces, wherein the plurality of defect detection surfaces have a plurality of sets of associated defect features.
[0043] Modeling and restoring the target auto parts means obtaining the 3D model of the target auto parts through 3D scanning, CAD design and other methods. This 3D model contains information such as the geometric shape and surface features of the parts, and is a digital expression of the target parts. The 3D model is meshed according to the pre-built apparent meshing constraints, including the use of parameters such as grid size, meshing starting point and meshing vector, so that the meshing of multiple samples of the same model remains consistent in space, and the apparent meshing model is obtained after processing.
[0044] The K defect constituent features are filled into the corresponding positions in the apparent mesh model. Specifically, the position where each defect constituent feature should be filled is determined according to the K spatial position identifiers, and then filled into the apparent mesh model. In this way, the defect information is embedded in the apparent mesh model, so that the model can capture the defects of the target parts.
[0045] In the apparent gridding model, multiple merging starting grids are obtained according to the preset adjacent grid comparison interval as a constraint. These merging starting grids are starting grid points with a certain interval in the apparent gridding model and are used for subsequent apparent grid merging judgment.
[0046] Taking each merged starting point grid as the starting point, the adjacent apparent grid merge judgment is performed in turn. The judgment method is to judge whether the defect composition characteristics of the first merged starting point grid and the four first adjacent apparent grids are consistent. If they are consistent, the first merged starting point grid is merged with the four first adjacent table grids as the first updated starting point grid, wherein the first merged starting point grid is any one of the multiple merged starting point grids. The merge rule is to first judge whether the defect composition characteristics of the first updated starting point grid and the multiple second adjacent apparent grids are consistent. If they are consistent, the first updated starting point grid and the multiple second adjacent apparent grids are merged. If they are inconsistent, the consistent ones are merged, and the merged result is used as the merged starting point. The inconsistent ones are used as the new merged starting point for grid merge judgment update. The processing of each merged starting point grid is consistent until all grids are traversed, and the surface of the part is divided into multiple inspection surfaces. The appearance of a specific type of defect on each inspection surface causes the overall failure of the part.
[0047] Light source detection matching is performed according to the analysis results to obtain multiple light source detection strategies.
[0048] Collect all known standard production defects, such as surface scratches, dents, pores, etc., and record the best display effect of each defect under specific light source conditions, and determine the best light source conditions, including color and brightness. Based on the analysis results of standard production defects, design multiple light source detection strategies. These strategies include different combinations of light source colors and brightness. Each combination corresponds to one or more standard defects. Specifically, according to the display effect of different defects under different color light sources, select the appropriate light source color; according to the display effect of different defects under different brightness, select the appropriate light source brightness. Combine the appropriate light source color and brightness into different light source detection strategies, each strategy is used to detect one or more defects.
[0049] Based on the multiple light source detection strategies, the light source controller and the image collector are scheduled to perform lighting adjustment and image acquisition on the multiple defect detection surfaces to obtain multiple light source detection atlases.
[0050] According to the formulated light source detection strategy, the light source controller is scheduled to adjust the color and brightness of the light source according to different detection surfaces and corresponding light source detection strategies. The image collector is scheduled to perform image acquisition according to the different detection surfaces and light source adjustment results to capture images under the best lighting conditions. Under the scheduling of the light source controller and the image collector, each detection surface is imaged in turn, and the acquired images are classified according to the detection surface and light source strategy to generate multiple light source detection atlases.
[0051] Furthermore, based on the multiple light source detection strategies, the light source controller and the image collector are scheduled to perform light adjustment and image acquisition on the multiple defect detection surfaces to obtain multiple light source detection atlases, and the method further includes:
[0052] Interactively obtain a standard detection strategy set for the standard production defect set; use a first group of associated defect features of a first defect detection surface to traverse the standard detection strategy set to obtain a first light source detection strategy, wherein the first light source detection strategy includes multiple groups of brightness-color temperature parameters mapped to multiple associated defect features in the first group of associated defect features, and the first defect detection surface is any one of the multiple defect detection surfaces; use the first light source detection strategy to schedule the light source controller and the image collector to perform lighting adjustment and image acquisition on the first defect detection surface to obtain a first light source detection atlas; and so on, obtain the multiple light source detection strategies, and use the multiple light source detection strategies to schedule the light source controller and the image collector to perform lighting adjustment and image acquisition on the multiple defect detection surfaces to obtain the multiple light source detection atlases.
[0053] By interacting with the system, a set of standard detection strategies applicable to a standard production defect set is obtained. These strategies include different combinations of light source colors and light source brightness, which are used to detect various defects in the standard production defect set.
[0054] A first group of associated defect features of a first defect detection surface is selected, where the first defect detection surface is any one of multiple defect detection surfaces, and a set of standard detection strategies is traversed. For the first group of associated defect features, a first light source detection strategy applicable to the group of defect features is obtained, where the first light source detection strategy includes multiple groups of brightness-color temperature parameters, which are obtained by mapping multiple associated defect features in the first group of associated defect features.
[0055] According to the first light source detection strategy, the light source controller is scheduled to adjust the color and brightness of the light source according to different detection surfaces and corresponding light source detection strategies. The image collector is scheduled to collect images of the first defect detection surface according to the light source adjustment results, and images under optimal lighting conditions are captured to obtain the first light source detection atlas.
[0056] Under the scheduling of the light source controller and the image collector, images of multiple defect detection surfaces are collected in sequence, and the collected images are classified according to the detection surface and light source strategy to generate multiple light source detection atlases.
[0057] A defective product judgment network is pre-constructed, wherein the defective product judgment network includes multiple local defective product judgment branches and a defective product judgment fusion branch, wherein the multiple local defective product judgment branches are connected in parallel, and the output ends of the multiple local defective product judgment branches are connected to the input ends of the defective product judgment fusion branch.
[0058] The defective judgment network is a multi-level deep learning network used to judge defects in multiple light source inspection atlases of automotive parts. It includes multiple local defective judgment branches and defective judgment fusion branches. Each local defective judgment branch is used to judge a specific type of defect on a specific inspection surface, and the defective judgment fusion branch is used to summarize the outputs of each local defective judgment branch for final defect judgment.
[0059] Further, a defective product judgment network is pre-constructed, wherein the defective product judgment network includes a plurality of local defective product judgment branches and a defective product judgment fusion branch, wherein the plurality of local defective product judgment branches are connected in parallel, and the output ends of the plurality of local defective product judgment branches are connected to the input end of the defective product judgment fusion branch, and the method further includes:
[0060] Sample collection is performed with the first defect detection surface and the first group of associated defect features as constraints to obtain multiple first defect images; defect recognition marking is performed on the multiple first defect images using multiple associated defect features in the first group of associated defect features, and pre-constructed standard defect recognition branch training is performed based on the marking results to obtain multiple first defect recognition branches; the multiple first defect recognition branches are connected in parallel to obtain a first local defective judgment branch; and so on to obtain the multiple local defective judgment branches, and the construction of the defective judgment network is completed by connecting the multiple local defective judgment branches in parallel and connecting the output ends of the multiple local defective judgment branches to the input end of the defective judgment fusion branch.
[0061] In an actual production environment, samples are collected for the first defect detection surface and the first group of associated defect features, and corresponding image acquisition equipment, such as a camera, is used to photograph the corresponding area to obtain multiple first defect images.
[0062] Apply multiple associated defect features in the first group of associated defect features to the multiple acquired first defect images, mark the areas in each image related to the associated defect features, and mark the existing defects.
[0063] Multiple standard defect recognition branches are pre-built, each branch is for a specific associated defect feature or a group of associated defect features, and is used to identify the defect type associated therewith. The collected and marked image data is input into the corresponding standard defect recognition branch, and these branches are trained using supervised learning methods so that they can accurately identify specific defect types. After the training is completed, multiple first defect recognition branches are obtained, each branch is specifically used to identify the defect type represented by one of the associated defect features or a group of associated defect features.
[0064] The constructed multiple first defect recognition branches are connected in parallel to obtain a first local defective product judgment branch, which can combine multiple defect recognition results to judge the defects in the first local area.
[0065] A similar method is used to continue to construct multiple local defective judgment branches. Each local defective judgment branch judges defects in different local areas to form a local level defective judgment. Multiple local defective judgment branches are connected in parallel, and the output ends of the multiple local defective judgment branches are connected to the input end of the defective judgment fusion branch. The defective judgment fusion branch is used to integrate the defective judgment results of different local areas to make the final overall defective judgment.
[0066] Through the above steps, the construction of the defective judgment network is completed. The network is composed of multiple local defective judgment branches in parallel, and the comprehensive judgment of the target defects is completed by fusion branches, thereby realizing the defective judgment of the target automotive parts.
[0067] The multiple light source detection atlases are synchronized to the defective product judgment network, and multi-level judgments are performed through the multiple local defective product judgment branches and the defective product judgment fusion branches to obtain target defect judgment results; and production management is performed on the target automotive parts according to the target defect judgment results.
[0068] The collected multiple light source detection atlases are input into the defective product judgment network. Each local defective product judgment branch performs a primary judgment on the input detection atlas and identifies defects on a specific detection surface, including inputting images in the light source detection atlas into the corresponding local defective product judgment branch, extracting image features through a convolutional neural network, identifying potential defects, performing a preliminary judgment based on the extracted features, and outputting defect judgment results.
[0069] The defect judgment result output by each local defective judgment branch is synchronized to the defective judgment fusion branch, including: transmitting the output result of each local defective judgment branch to the defective judgment fusion branch, normalizing the results output by each branch to facilitate subsequent fusion, and the defective judgment fusion branch comprehensively analyzes the results of multiple local defective judgment branches to make a final defect judgment and determine the defect situation of the target part. For example, the target defect judgment result is qualified when and only when the multiple detection surface judgment results are not defective detection surfaces.
[0070] According to the output of the defective judgment network, the target defect judgment results are classified and processed. Specifically, if the target defect judgment result is qualified, the part is marked as a qualified product and enters the normal production process, such as putting the qualified product into storage for shipment or entering the next production link; if the target defect judgment result is defective, the part is marked as a defective product and enters the defective processing process, such as sending the defective product to the defective processing link for repair, rework or scrapping.
[0071] Furthermore, the plurality of light source detection atlases are synchronized to the defective product judgment network, and multi-level judgment is performed through the plurality of local defective product judgment branches and the defective product judgment fusion branch to obtain a target defect judgment result. The method further includes:
[0072] According to the mapping relationship between multiple groups of brightness-color temperature parameters in the first light source detection strategy and multiple associated defect features in the first group of associated defect features, the first light source detection atlas is mapped and synchronized to the multiple first defect recognition branches in the first local defective judgment branch to perform defect directional recognition to obtain a first detection surface judgment result, wherein, when the defect recognition result of any first defect recognition branch in the multiple first defect recognition branches is that a defect exists, the first detection surface judgment result is that the first detection surface is defective; by analogy, the multiple light source detection atlases are synchronized to the defective judgment network, and a primary judgment is performed through the multiple local defective judgment branches to obtain multiple detection surface judgment results; the multiple detection surface judgment results are synchronized to the defective judgment fusion branch for secondary judgment to obtain the target defect judgment result, wherein the target defect judgment result is qualified if and only if none of the multiple detection surface judgment results is a detection surface defective.
[0073] According to the mapping relationship between the multiple groups of brightness-color temperature parameters in the first light source detection strategy and the multiple associated defect features in the first group of associated defect features, the first light source detection atlas mapping is synchronized to the first local defective product judgment branch.
[0074] In the first local defective judgment branch, defect-oriented recognition is performed through multiple first defect recognition branches, that is, each first defect recognition branch recognizes a specific defect type and outputs a corresponding defect recognition result. The defect recognition result includes that when the defect recognition result of any of the multiple first defect recognition branches is that there is a defect, the first detection surface judgment result will also be judged as having a defect, that is, the first detection surface is defective. The logic here is that as long as any defect recognition branch detects the existence of a defect, the entire first detection surface is judged to be defective, which can ensure that the defect judgment of the target automotive parts is more accurate.
[0075] By analogy, for each light source detection strategy, the corresponding light source detection atlas mapping is synchronized to the defective judgment network. In the defective judgment network, a first-level judgment is performed on each detection surface through multiple local defective judgment branches. Each local defective judgment branch performs defect identification on a specific detection surface and its corresponding light source detection atlas. After the first-level judgment of multiple local defective judgment branches, multiple detection surface judgment results are obtained.
[0076] The multiple detection surface judgment results obtained after the first-level judgment of multiple local defective judgment branches are summarized and synchronized to the defective judgment fusion branch. In the defective judgment fusion branch, a second-level judgment is performed based on the summarized multiple detection surface judgment results. The judgment criterion is that the target defect judgment result is qualified if and only if the judgment results of all detection surfaces are not defective, that is, no defects are detected on all detection surfaces; if the judgment result of any detection surface is defective, indicating that there is a defect, then the target defect judgment result is unqualified.
[0077] In summary, the automobile parts defect detection method based on machine vision provided by the embodiment of the present application has the following technical effects:
[0078] 1. By sampling defective products according to part model information, a representative sample defective product set is obtained. By performing defect distribution analysis and light source detection matching on the sample defective product set, the detection surface of the target automotive parts can be divided more accurately, and light source detection matching is performed for different defect features. Multiple light source detection strategies are obtained, which can improve detection precision and accuracy, thereby better detecting defects;
[0079] 2. Based on multiple light source detection strategies, multiple defect detection surfaces are illuminated and adjusted, so that different defect detection surfaces can obtain high-quality images under the corresponding optimal lighting conditions, thereby improving the effect of defect presentation. The obtained multiple light source detection atlases can provide image data under multiple light source conditions, enhancing the comprehensiveness of detection;
[0080] 3. By pre-building a defective product judgment network, which includes multiple local defective product judgment branches and defective product judgment fusion branches for multi-level judgment, it is possible to make comprehensive judgments on defects of different levels, thereby improving the accuracy of judgment;
[0081] 4. By executing production management based on the defect judgment results, defective parts can be discovered and handled in a timely manner to ensure product quality and production efficiency.
[0082] Based on the same inventive concept as the automobile parts defect detection method based on machine vision in the aforementioned embodiment, Figure 2 As shown, the embodiment of the present application provides an automobile parts defect detection system based on machine vision, and the system includes:
[0083] The defective sampling module 10 is used to sample defective products according to the model information of the target automobile parts to obtain a sample defective product set; the detection surface division module 20 is used to perform defect distribution analysis based on the sample defective product set, and divide the detection surface of the target automobile parts based on the analysis results to obtain multiple defect detection surfaces; the light source detection matching module 30 is used to perform light source detection matching according to the analysis results to obtain multiple light source detection strategies; the image acquisition module 40 is used to schedule the light source controller and the image acquisition device to perform light adjustment and image acquisition on the multiple defect detection surfaces based on the multiple light source detection strategies to obtain multiple light source detection surfaces. atlas; a network construction module 50, the network construction module 50 is used to pre-construct a defective judgment network, wherein the defective judgment network includes multiple local defective judgment branches and defective judgment fusion branches, wherein the multiple local defective judgment branches are connected in parallel, and the output ends of the multiple local defective judgment branches are connected to the input ends of the defective judgment fusion branches; a multi-level judgment module 60, the multi-level judgment module 60 is used to synchronize the multiple light source detection atlases to the defective judgment network, perform multi-level judgment via the multiple local defective judgment branches and the defective judgment fusion branches, and obtain a target defect judgment result; a production management module 70, the production management module 70 is used to perform production management on the target automotive parts according to the target defect judgment result.
[0084] Furthermore, the system further includes a plurality of defect detection surface acquisition modules to perform the following operation steps:
[0085] Pre-constructing apparent gridding constraints, wherein the apparent gridding constraints include grid size, gridding starting point and gridding vector; using the apparent gridding constraints to process multiple sample defective entities in the sample defective set to obtain multiple apparent grid atlases, wherein each apparent grid atlas includes K sample apparent grid images, and the K sample apparent grid images have K spatial position identifiers; performing group update of multiple apparent grid atlases according to the K spatial position identifiers to obtain K groups of sample apparent grid images; performing defect reproduction analysis on the K groups of sample apparent grid images to obtain K defect composition features; performing apparent grid reorganization according to the K defect composition features to obtain the multiple defect detection surfaces.
[0086] Furthermore, the system further includes a defect composition feature acquisition module to perform the following operation steps:
[0087] Interactive production logs are used to obtain a standard production defect set, and a defect recognition network is constructed based on the standard production defect set; multiple sample apparent grid images in the first group of sample apparent grid images that are mapped to the same position of the multiple sample defective entities are input into the defect recognition network, defect recognition is performed, and multiple defect recognition results are obtained, wherein the first group of sample apparent grid images is any group of the K groups of sample apparent grid images; the multiple defect recognition results are aggregated to obtain multiple occurrence frequency parameters of multiple grid aggregated defects; a defect defect association frequency threshold is preset, and the multiple grid aggregated defects are screened with the defect defect association frequency and the multiple occurrence frequency parameters to obtain a first defect composition feature; and by analogy, defect reproduction analysis is performed on the K groups of sample apparent grid images to obtain the K defect composition features.
[0088] Furthermore, the system further includes an associated defect feature acquisition module to perform the following operation steps:
[0089] The target automobile part is modeled and restored, and the modeling result is processed by the apparent meshing constraint meshing to obtain an apparent meshing model; the K spatial position identifiers are used to fill the K defect constituent features into the apparent meshing model; a plurality of merged starting point grids are obtained, wherein the plurality of merged starting point grids are obtained by positioning the apparent meshing model with a preset adjacent grid comparison interval as a constraint; adjacent apparent mesh merging judgments are performed based on the plurality of merged starting point grids until all the apparent meshes of the apparent meshing model are traversed to obtain the plurality of defect detection surfaces, wherein the plurality of defect detection surfaces have a plurality of sets of associated defect features.
[0090] Furthermore, the system further includes a light source detection atlas acquisition module to perform the following operation steps:
[0091] Interactively obtain a standard detection strategy set for the standard production defect set; use a first group of associated defect features of a first defect detection surface to traverse the standard detection strategy set to obtain a first light source detection strategy, wherein the first light source detection strategy includes multiple groups of brightness-color temperature parameters mapped to multiple associated defect features in the first group of associated defect features, and the first defect detection surface is any one of the multiple defect detection surfaces; use the first light source detection strategy to schedule the light source controller and the image collector to perform lighting adjustment and image acquisition on the first defect detection surface to obtain a first light source detection atlas; and so on, obtain the multiple light source detection strategies, and use the multiple light source detection strategies to schedule the light source controller and the image collector to perform lighting adjustment and image acquisition on the multiple defect detection surfaces to obtain the multiple light source detection atlases.
[0092] Furthermore, the system also includes a defective product determination network construction module to perform the following operation steps:
[0093] Sample collection is performed with the first defect detection surface and the first group of associated defect features as constraints to obtain multiple first defect images; defect recognition marking is performed on the multiple first defect images using multiple associated defect features in the first group of associated defect features, and pre-constructed standard defect recognition branch training is performed based on the marking results to obtain multiple first defect recognition branches; the multiple first defect recognition branches are connected in parallel to obtain a first local defective judgment branch; and so on to obtain the multiple local defective judgment branches, and the construction of the defective judgment network is completed by connecting the multiple local defective judgment branches in parallel and connecting the output ends of the multiple local defective judgment branches to the input end of the defective judgment fusion branch.
[0094] Furthermore, the system further includes a target defect judgment result acquisition module to perform the following operation steps:
[0095] According to the mapping relationship between multiple groups of brightness-color temperature parameters in the first light source detection strategy and multiple associated defect features in the first group of associated defect features, the first light source detection atlas is mapped and synchronized to the multiple first defect recognition branches in the first local defective judgment branch to perform defect directional recognition to obtain a first detection surface judgment result, wherein, when the defect recognition result of any first defect recognition branch in the multiple first defect recognition branches is that a defect exists, the first detection surface judgment result is that the first detection surface is defective; by analogy, the multiple light source detection atlases are synchronized to the defective judgment network, and a primary judgment is performed through the multiple local defective judgment branches to obtain multiple detection surface judgment results; the multiple detection surface judgment results are synchronized to the defective judgment fusion branch for secondary judgment to obtain the target defect judgment result, wherein the target defect judgment result is qualified if and only if none of the multiple detection surface judgment results is a detection surface defective.
[0096] Through the aforementioned detailed description of the automobile parts defect detection method based on machine vision in this specification, those skilled in the art can clearly understand the automobile parts defect detection system based on machine vision in this embodiment. Since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0097] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the processor of the computer device is used to provide computing and control capabilities; the memory of the computer device includes a non-volatile storage medium and an internal memory, wherein the non-volatile storage medium stores an operating system, a computer program and a database, and the internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium; the network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement an automobile parts defect detection method based on machine vision.
[0098] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0099] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0100] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting defects in automobile parts based on machine vision, characterized in that: include: Defective product sampling is performed according to the model information of the target automobile parts to obtain a sample defective product set; Performing defect distribution analysis based on the sample defective product set, and dividing the detection surface of the target automobile part based on the analysis result to obtain multiple defect detection surfaces; Perform light source detection matching according to the analysis results to obtain multiple light source detection strategies; Based on the multiple light source detection strategies, the light source controller and the image collector are scheduled to perform light adjustment and image acquisition on the multiple defect detection surfaces to obtain multiple light source detection atlases; Pre-constructing a defective product judgment network, wherein the defective product judgment network includes a plurality of local defective product judgment branches and a defective product judgment fusion branch, wherein the plurality of local defective product judgment branches are connected in parallel, and the output ends of the plurality of local defective product judgment branches are connected to the input end of the defective product judgment fusion branch; Synchronizing the multiple light source detection atlases to the defective product judgment network, performing multi-level judgment via the multiple local defective product judgment branches and the defective product judgment fusion branches, and obtaining a target defect judgment result; Performing production management on the target automobile part according to the target defect judgment result; Wherein, defect distribution analysis is performed based on the sample defective product set, and the detection surface of the target automobile part is divided based on the analysis result to obtain multiple defect detection surfaces, and further includes: Pre-constructing apparent gridding constraints, wherein the apparent gridding constraints include grid size, gridding starting point and gridding vector; Processing a plurality of sample defective entities in the sample defective set using the apparent gridding constraint to obtain a plurality of apparent grid atlases, wherein each apparent grid atlas includes K sample apparent grid images, and the K sample apparent grid images have K spatial position identifiers; Update multiple apparent grid atlas groups according to the K spatial position identifiers to obtain K groups of sample apparent grid images; Performing defect reproduction analysis on the K groups of sample surface grid images to obtain K defect composition features; The defect reproduction analysis is performed on the K groups of sample apparent grid images to obtain K defect composition features, and further includes: Interacting production logs to obtain a standard production defect set, and building a defect recognition network based on the standard production defect set; Inputting a plurality of sample apparent grid images in the first group of sample apparent grid images mapped to the same position of the plurality of sample defective entities into the defect recognition network, performing defect recognition, and obtaining a plurality of defect recognition results, wherein the first group of sample apparent grid images is any one of the K groups of sample apparent grid images; Aggregating the plurality of defect identification results to obtain a plurality of occurrence frequency parameters of a plurality of mesh aggregation defects; Presetting a defect-associated frequency threshold, and screening the plurality of grid-aggregated defects by the defect-associated frequency and the plurality of occurrence frequency parameters, to obtain a first defect composition feature; Similarly, defect reproduction analysis is performed on the K groups of sample surface grid images to obtain the K defect composition features; Apparent mesh reorganization is performed according to the K defect constituent features to obtain the multiple defect detection surfaces.
2. The method for detecting defects in automobile parts based on machine vision according to claim 1, characterized in that: Performing apparent mesh reorganization according to the K defect constituent features to obtain the plurality of defect detection surfaces also includes: Modeling and restoring the target automobile part, and processing the modeling result by using the apparent meshing constraint meshing to obtain an apparent meshing model; Using the K spatial position identifiers to fill the K defect constituent features into the apparent grid model; Obtaining a plurality of merged starting point grids, wherein the plurality of merged starting point grids are obtained by positioning in the apparent grid model with a preset adjacent grid comparison interval as a constraint; Based on the multiple merging starting grids, adjacent apparent grid merging judgment is performed until all apparent grids of the apparent gridded model are traversed to obtain the multiple defect detection surfaces, wherein the multiple defect detection surfaces have multiple groups of associated defect features.
3. The method for detecting defects in automobile parts based on machine vision according to claim 2, characterized in that: The method further includes: scheduling a light source controller and an image collector to perform light adjustment and image acquisition on the multiple defect detection surfaces based on the multiple light source detection strategies to obtain multiple light source detection atlases; interactively obtaining a standard detection strategy set for the standard production defect set; Using a first group of associated defect features of a first defect detection surface to traverse the standard detection strategy set, to obtain a first light source detection strategy, wherein the first light source detection strategy includes multiple groups of brightness-color temperature parameters mapped to multiple associated defect features in the first group of associated defect features, and the first defect detection surface is any one of the multiple defect detection surfaces; The first light source detection strategy is used to schedule the light source controller and the image collector to perform light adjustment and image acquisition on the first defect detection surface to obtain a first light source detection atlas; By analogy, the multiple light source detection strategies are obtained, and the multiple light source detection strategies are used to schedule the light source controller and the image collector to perform lighting adjustment and image acquisition on the multiple defect detection surfaces, so as to obtain the multiple light source detection atlases.
4. The method for detecting defects in automobile parts based on machine vision according to claim 3, characterized in that: A defective product judgment network is pre-constructed, wherein the defective product judgment network includes a plurality of local defective product judgment branches and a defective product judgment fusion branch, wherein the plurality of local defective product judgment branches are connected in parallel, and the output ends of the plurality of local defective product judgment branches are connected to the input end of the defective product judgment fusion branch, and further comprising: Collect samples based on the first defect detection surface and the first group of associated defect features as constraints to obtain a plurality of first defect images; Using a plurality of associated defect features in the first group of associated defect features to mark the plurality of first defect images for defect recognition, and performing pre-constructed standard defect recognition branch training based on the marking results to obtain a plurality of first defect recognition branches; Connecting the plurality of first defect recognition branches in parallel to obtain a first local defective product judgment branch; By analogy, the multiple local defective product judgment branches are obtained, and the construction of the defective product judgment network is completed by connecting the multiple local defective product judgment branches in parallel and connecting the output ends of the multiple local defective product judgment branches to the input end of the defective product judgment fusion branch.
5. The method for detecting defects in automobile parts based on machine vision according to claim 4, characterized in that: The plurality of light source detection atlases are synchronized to the defective product judgment network, and multi-level judgments are performed through the plurality of local defective product judgment branches and the defective product judgment fusion branches to obtain a target defect judgment result, further comprising: According to the mapping relationship between the multiple groups of brightness-color temperature parameters in the first light source detection strategy and the multiple associated defect features in the first group of associated defect features, the first light source detection atlas is mapped and synchronized to the multiple first defect recognition branches in the first local defective judgment branch to perform defect directional recognition, and obtain a first detection surface judgment result, wherein when the defect recognition result of any first defect recognition branch in the multiple first defect recognition branches is that there is a defect, the first detection surface judgment result is that the first detection surface is defective; Similarly, the multiple light source detection atlases are synchronized to the defective product judgment network, and primary judgment is performed through the multiple local defective product judgment branches to obtain multiple detection surface judgment results; The multiple detection surface judgment results are synchronized to the defective judgment fusion branch for secondary judgment to obtain the target defect judgment result, wherein the target defect judgment result is qualified if and only if none of the multiple detection surface judgment results is a defective detection surface.
6. The automobile parts defect detection system based on machine vision is characterized by: The system is used to implement the method for detecting defects of automobile parts based on machine vision according to any one of claims 1 to 5, the system comprising: A defective product sampling module, wherein the defective product sampling module is used to perform defective product sampling according to the model information of the target automobile parts to obtain a sample defective product set; A detection surface division module, the detection surface division module is used to perform defect distribution analysis based on the sample defective product set, and divide the detection surface of the target automobile part based on the analysis result to obtain multiple defect detection surfaces; A light source detection and matching module, the light source detection and matching module is used to perform light source detection and matching according to the analysis result to obtain multiple light source detection strategies; An image acquisition module, the image acquisition module is used to schedule the light source controller and the image collector to perform light adjustment and image acquisition on the multiple defect detection surfaces based on the multiple light source detection strategies to obtain multiple light source detection atlases; A network construction module, wherein the network construction module is used to pre-construct a defective product judgment network, wherein the defective product judgment network includes a plurality of local defective product judgment branches and a defective product judgment fusion branch, wherein the plurality of local defective product judgment branches are connected in parallel, and the output ends of the plurality of local defective product judgment branches are connected to the input end of the defective product judgment fusion branch; A multi-level judgment module, the multi-level judgment module is used to synchronize the multiple light source detection atlases to the defective product judgment network, perform multi-level judgment via the multiple local defective product judgment branches and the defective product judgment fusion branches, and obtain a target defect judgment result; A production management module, the production management module is used to perform production management on the target automobile part according to the target defect judgment result; Wherein, defect distribution analysis is performed based on the sample defective product set, and the detection surface of the target automobile part is divided based on the analysis result to obtain multiple defect detection surfaces, and further includes: Pre-constructing apparent gridding constraints, wherein the apparent gridding constraints include grid size, gridding starting point and gridding vector; Processing a plurality of sample defective entities in the sample defective set using the apparent gridding constraint to obtain a plurality of apparent grid atlases, wherein each apparent grid atlas includes K sample apparent grid images, and the K sample apparent grid images have K spatial position identifiers; Update multiple apparent grid atlas groups according to the K spatial position identifiers to obtain K groups of sample apparent grid images; Performing defect reproduction analysis on the K groups of sample surface grid images to obtain K defect composition features; The defect reproduction analysis is performed on the K groups of sample apparent grid images to obtain K defect composition features, and further includes: Interacting production logs to obtain a standard production defect set, and building a defect recognition network based on the standard production defect set; Inputting a plurality of sample apparent grid images in the first group of sample apparent grid images mapped to the same position of the plurality of sample defective entities into the defect recognition network, performing defect recognition, and obtaining a plurality of defect recognition results, wherein the first group of sample apparent grid images is any one of the K groups of sample apparent grid images; Aggregating the plurality of defect identification results to obtain a plurality of occurrence frequency parameters of a plurality of mesh aggregation defects; Presetting a defect-associated frequency threshold, and screening the plurality of grid-aggregated defects by the defect-associated frequency and the plurality of occurrence frequency parameters, to obtain a first defect composition feature; Similarly, defect reproduction analysis is performed on the K groups of sample surface grid images to obtain the K defect composition features; Apparent mesh reorganization is performed according to the K defect constituent features to obtain the multiple defect detection surfaces.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method for detecting defects in automobile parts based on machine vision described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for detecting defects in automobile parts based on machine vision described in any one of claims 1 to 5 are implemented.
