Part appearance detection method and system, server and medium

Through the deep learning model and self-attention mechanism, combined with the classification and object detection model, the problem of low tolerance to manual detection is solved, and high-precision detection of appearance defects of die-cast parts is achieved, which improves the stability and generalization ability of detection.

CN119130933APending Publication Date: 2024-12-13CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411145648.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the field of integrated die-casting, there is a problem of low fault tolerance in manual detection of die-casting parts, especially in the detection of holes and processing surfaces after machine addition, due to the threshold setting of traditional image processing algorithms, the detection Accuracy and stability.

Method used

Deep learning model is used to detect the appearance of parts, select the appropriate model according to the type of features to be detected, combine the classification model and the object detection model, and improve the detection accuracy and generalization ability through the self-attention mechanism and bottleneck attention module, and reduce the detection accuracy and generalization ability. Reliance on threshold settings.

Benefits of technology

Improve the accuracy and stability of part appearance inspection, reduce equipment maintenance complexity, enhance the generalization ability of inspection, and more accurately identify features such as threaded holes, precast holes, waist holes, etc., to meet the inspection of multiple vehicle models. need.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119130933A_ABST
    Figure CN119130933A_ABST
Patent Text Reader

Abstract

The invention provides a part appearance detection method and system, a server and a medium. The method comprises the following steps: receiving an input image; obtaining a region of interest of the input image, wherein the region of interest has features to be detected; and selecting a corresponding deep learning model to detect the appearance of the to-be-detected feature according to the type of the to-be-detected feature. According to the method, the appearance of the to-be-detected feature is detected based on the deep learning model, compared with a manual mode, the detection precision is improved, the limitation of threshold setting of a conventional algorithm is avoided, equipment maintenance is simpler, and meanwhile the generalization ability of the method is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection technology, and in particular to a method, system, server and medium for detecting the appearance of a part. Background Art

[0002] With the rapid implementation of the concepts of lightweight, intelligent and electrified vehicles, the automotive industry has ushered in revolutionary changes. Along with this, many new processes and technologies have emerged. Integrated die-casting, as a new process technology, has greatly helped the development of lightweight and electrified vehicles. At the same time, it is also a mainstream lightweight method.

[0003] A large die-casting machine is used to cast aluminum liquid into large parts such as the front cabin and rear floor of the car body. The production cycle of a large die-casting is about 90-120s, which can significantly reduce production time and labor costs. At the same time, it can also significantly improve the recycling rate of raw materials. Product quality inspection, as the last link in product production, is a re-inspection and final guarantee of the processing quality of all previous processes. The production of parts will always be ensured by means of inspection. Machine vision technology obtains digital image data of parts through industrial cameras, uses corresponding algorithms to extract ROI areas, and determines the corresponding test results, so that industrial applications have "perception" functions, gradually become automated and intelligent, and greatly improve production efficiency.

[0004] In the field of integrated die-casting, the main die-cast parts of the car body are the front cabin and the rear floor. The appearance quality of die-cast parts mainly needs to be inspected in two ways: the appearance defects of the casting body before machining and the appearance defects of the machining area after machining. Among them, the appearance defect detection after machining is mainly completed manually, and the inspection object is the appearance of the holes and the machined surface after machining. The manual inspection method has a low fault tolerance rate. Summary of the invention

[0005] In view of this, one of the purposes of the embodiments of the present application is to provide a method for inspecting the appearance of a part, which can improve the problem of low error tolerance in manual inspection.

[0006] In order to achieve the above technical objectives, the technical solutions adopted in this application are as follows:

[0007] In a first aspect, an embodiment of the present application provides a method for detecting the appearance of a part, the method comprising:

[0008] receiving an input image;

[0009] Acquire a region of interest of the input image, where the region of interest has features to be detected;

[0010] According to the type of the feature to be detected, a corresponding deep learning model is selected to detect the appearance of the feature to be detected, and a detection result characterizing whether there is a defect in the appearance is obtained.

[0011] According to the above technical means, after obtaining the area of ​​interest, a deep learning model is used to detect the appearance of the features to be detected. The deep learning model has growth potential and improves the detection accuracy compared to the manual method. At the same time, the deep learning model avoids the limitations of conventional algorithm threshold settings, making equipment maintenance simpler and more accurate.

[0012] Since the corresponding deep learning model is selected in the technical solution to detect the appearance of the feature to be detected, the appropriate deep learning model is matched according to the type of the feature to be detected, so that the selected deep learning model is more focused on the appropriate type of feature to be detected, thereby improving the generalization ability of the method and further improving the detection accuracy.

[0013] Further, selecting a corresponding deep learning model to detect the appearance of the feature to be detected according to the type of the feature to be detected includes:

[0014] When the feature to be detected includes at least one of a threaded hole, a precast hole, a waist-shaped hole, and a machined surface, detecting the appearance of the feature to be detected based on the classification model;

[0015] Detecting the appearance of the feature to be detected based on the classification model includes:

[0016] The classification model outputs a classification result after receiving the feature to be detected;

[0017] Based on the classification results, determine whether the appearance of the feature to be detected meets the requirements.

[0018] According to the above technical means, the number of surfaces with the above-mentioned features to be detected is relatively small. There are multiple features of processing features such as threaded holes, precast holes, waist holes, and machined surfaces. Different feature combinations represent different detection results. Classification detection can be accurately achieved through the classification detection model, reducing the complexity of detection.

[0019] Further, determining whether the appearance of the feature to be detected meets the requirements based on the classification result includes:

[0020] When the classification result represents that the region of interest is an image before machining, it is determined that there is a defect in the appearance of the feature to be detected; when the classification result represents that the region of interest is an image after machining, it is determined that there is no defect in the appearance of the feature to be detected.

[0021] Furthermore, before receiving the input image, the method further includes:

[0022] Collecting training samples, the training samples include a first training image and a second training image, the first training image represents a part surface image before machining, the second training image represents a part surface image after machining, the second training image has a machining area, wherein the first training image is obtained by cutting out the machining area;

[0023] The classification model is trained based on the training samples.

[0024] According to the above technical means, since the first training image is obtained by cutting out the processed area, the cost of obtaining the number of training samples is reduced while ensuring the number of training samples.

[0025] Furthermore, the classification model is based on a Resnets-50 classification network, and a self-attention mechanism is introduced into the convolutional layer of the Resnets-50 classification network.

[0026] Further, selecting a corresponding deep learning model to detect the appearance of the feature to be detected according to the type of the feature to be detected includes:

[0027] When the feature to be detected includes a through hole, the appearance of the through hole is detected based on the target detection model.

[0028] Furthermore, the target detection model is based on the YOLO architecture, and the target detection model adds a bottleneck attention module between each stage in the Resnet network of the YOLO architecture.

[0029] Further, the obtaining the region of interest of the input image includes:

[0030] Get the salient features of the input image;

[0031] Obtain matching templates based on the outlines of obvious features;

[0032] Correcting the position of the input image according to the relative positions of the matching template reference points and the input image reference points;

[0033] The position where the detection frame overlaps with the corrected input image is defined as the region of interest.

[0034] In the second aspect, the present application proposes a parts appearance inspection system, comprising:

[0035] A receiving module configured to receive an input image;

[0036] An acquisition module, configured to acquire a region of interest of the surface to be detected, wherein the region of interest has features to be detected;

[0037] The detection module is configured to select a corresponding deep learning model to detect the appearance of the feature to be detected according to the type of the feature to be detected, and obtain a detection result characterizing whether there is a defect in the appearance.

[0038] In a third aspect, the present application proposes a server, comprising a processor and a memory coupled to each other, wherein the memory stores a computer program, and when the computer program is executed by the processor, the server executes the above-mentioned part appearance inspection method.

[0039] In a fourth aspect, the present application proposes a computer-readable storage medium, in which a computer program is stored. When the computer program is run on a computer, the computer executes the above-mentioned part appearance inspection method.

[0040] The invention adopting the above technical solution has the following advantages:

[0041] In the technical solution provided in this application,

[0042] This application implements the detection of the appearance of the feature to be detected based on a deep learning model. Compared with the manual method, it improves the detection accuracy and avoids the limitations of conventional algorithm threshold settings, making equipment maintenance simpler and improving the generalization ability of the method. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The present application may be further described by the non-limiting embodiments given in the accompanying drawings. It should be understood that the following drawings only illustrate certain embodiments of the present application and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings may be obtained based on these drawings without creative effort.

[0044] Figure 1 A flowchart provided for an embodiment of the present application.

[0045] Figure 2 A flowchart of S120 provided in an embodiment of the present application;

[0046] Figure 3 This is a structural diagram of the part appearance detection provided in an embodiment of the present application.

[0047] Icons: 1-receiving module; 2-acquisition module; 3-detection module. DETAILED DESCRIPTION

[0048] The present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that in the drawings or descriptions, similar or identical parts use the same figure numbers, and the implementation methods not shown or described in the drawings are forms known to ordinary technicians in the relevant technical field. In the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0049] In this embodiment, since the aluminum alloy parts are formed by die casting, and the detection target is the processed hole or the processed surface, the prior art patent CN 110969357 A "A visual detection method for holes in aluminum alloy machined parts" discloses a traditional image processing visual detection method, which pre-processes the image by graying and Gaussian filtering, filters interference factors, and then detects the circle by Hough transform, and uses high gray gradient edges to achieve hole detection after enhancing image contrast. This detection method requires setting a detection threshold, and the detection stability is not high due to the gray threshold. Patent CN 117537706 A "Sheet metal hole positioning size detection method based on three-axis coordinate transformation and monocular vision fusion" discloses a sheet metal hole positioning size detection method. Although the invention mainly discloses a size positioning detection method, the invention also describes a method for hole feature extraction, which uses graying, binarization, and morphological corrosion and expansion image processing algorithms for pre-processing, and then uses hole contour information to obtain hole features. Traditional image processing methods will be affected by threshold setting, thereby affecting detection efficiency. Analysis shows that both inventions use different image processing algorithms to achieve the recognition of features such as holes, but do not solve the inherent limiting factors of the algorithm. The accuracy of detection will be affected by parameter settings.

[0050] The technical solution proposed in this embodiment belongs to the field of image detection. When receiving the input image of the part and obtaining the region of interest, this embodiment selects the corresponding deep learning model to detect the appearance of the feature to be detected according to the type of the feature to be detected in the region of interest, and realizes the classification detection of different processing holes and processing surfaces, thereby realizing the post-machining and appearance defect detection of large-scale integrated die-cast parts. This method can not only meet the detection requirements of compatible parts of multiple models, but also avoid the problem that the traditional image processing algorithm is constrained by the threshold setting, making the detection more stable and simpler.

[0051] Based on the above description, this embodiment proposes a method for detecting the appearance of a part, such as Figure 1 As shown, the detection method specifically includes: S110: receiving an input image, wherein the input image includes a surface to be detected.

[0052] S120: Acquire a region of interest of the surface to be detected, where the region of interest has features to be detected.

[0053] S130: According to the type of the feature to be detected, select a corresponding deep learning model to detect the appearance of the feature to be detected, and obtain a detection result characterizing whether there is a defect in the appearance.

[0054] The following is a detailed description of each step:

[0055] In S110, the input image is an image of a certain surface to be detected of the part taken by the camera. What needs to be detected is the appearance of each processed surface on the surface and the appearance of the holes on the surface. The part in this embodiment is a die-casting. The machined appearance of the die-casting is mainly the processed holes and processed surfaces. The holes and surfaces are distributed in each surface area of ​​the part. In order to meet the post-machining detection requirements of large integrated die-castings of the vehicle body, the acquisition system is composed of a matrix industrial camera + a large-surface visible light source, wherein the number of cameras and the light source area are determined by the area of ​​the part detection area and the detection accuracy. Due to the large size of the vehicle body die-casting, the acquisition system of this embodiment needs to cover a field of view of 1600*800. The camera uses a 20 million array camera, the number of cameras is 6, and the lens focal length is selected according to the working distance and the acquisition accuracy requirements. 25mm, wherein the surface light uses 2 large 800*800 surface lights. The acquisition system is located at the end of the robot. By controlling the robot trajectory, flexible multi-directional and multi-angle acquisition can be achieved, ensuring the diversity of the collected data.

[0056] In S120, after the camera captures each surface input image, the input image is transferred to an interface with a detection frame. Generally, the area enclosed by the detection frame on the input image is the region of interest. Whether the region of interest is accurate has a certain impact on subsequent detection. The region of interest determined in the above manner is related to the initial posture of the input image. Therefore, the posture of the input image needs to be adjusted in S120 to make the selection of the region of interest more reasonable. Figure 2 As shown, S120 includes the following steps:

[0057] S121: Obtain the obvious features of the surface to be detected.

[0058] S122: Acquire a matching template according to the outline of the obvious features.

[0059] S123: Correcting the position of the surface to be detected according to the relative positions of the matching template reference points and the matching points of the surface to be detected.

[0060] S124: The position where the detection frame and the corrected surface to be detected overlap is defined as the region of interest.

[0061] In S121, the obvious feature represents the feature of a certain surface of the die casting, such as a hole or an obvious feature line of the die casting on the input image. The feature line represents a line or curve of a unique property or characteristic of a part. It can be a straight line, a curve, an acute angle, an obtuse angle, etc. It can be a line on a plane or a boundary line of a three-dimensional part. The feature line can represent the requirements of the size, geometry, assembly relationship, surface quality, etc. of the part.

[0062] The method of establishing a standard template is as follows: first, a standard image is selected as the template for modeling, and the area with stable features in the template image is selected as the modeling ROI area; the feature edge contour points are extracted by adjusting the feature scale, and the gray value difference between the feature points and the surrounding background is changed by adjusting the contrast, so that the features are separated from the background, thereby realizing the establishment of a standard template.

[0063] In S122, this embodiment obtains the contour of the obvious feature by grayscale contrast. After obtaining the contour of the obvious feature, the standard image is traversed to perform similarity matching with the contour, thereby obtaining the reference point and reference angle of template matching.

[0064] In S123, after the new input image matches the template, the matching points and matching angles after the matching template are obtained. The affine transformation matrix can be calculated through the reference points, reference angles, matching points and matching angles. The input image obtains the corrected position information through the affine transformation, thereby realizing the positioning correction of the input image.

[0065] In S130, the features to be detected are the parts of the input image that require appearance inspection. The features to be detected in this embodiment are seven categories: holes, through holes with chamfers, threaded holes with countersunk steps, waist-shaped holes with chamfers, pre-cast holes with chamfers, polished surfaces with countersunk steps, and arc surfaces with chamfers.

[0066] Among the machined appearance features of integrated die-cast parts, through holes account for the largest proportion and have consistent features, followed by threaded holes, and other categories account for a relatively small proportion. In addition to through holes, there are multiple other detection categories, all of which are significantly different from before processing. Based on the detection features, through hole detection uses a target detection model to quickly and stably implement the detection function, and other categories can achieve stable and efficient detection functions through image classification models.

[0067] Therefore, in this embodiment, when the feature to be detected includes a through hole, the target detection algorithm is used to detect whether the appearance of the through hole has defects; when the feature to be detected includes at least one of a threaded hole, a precast hole, a waist hole, and a machined surface, the classification model is used to detect whether the appearance of the feature to be detected has defects. In this embodiment, the machined surface is mainly the surface of the relevant area of ​​the part, and the original casting blank surface is processed into the designed surface through feed processing.

[0068] On the surface, since through holes are the most numerous, the object detection model is used to detect the appearance of through holes. The task of object detection is to find all the targets (objects) of interest in the image and determine their categories and positions. The number of other holes is relatively small, and there are large differences between the processed surfaces before and after processing. Therefore, it is only necessary to use the classification model to determine whether the processed surface has been processed. If it has been processed, the appearance of the feature to be detected meets the requirements, otherwise it does not meet the requirements.

[0069] Based on the differences in the appearance features of parts after machining, they can be classified for inspection. Through holes account for a large proportion, and the differences in the features of different processing positions are small within a single category. The target detection model can be used to quickly locate the inspection target. There are many features of processing features such as threaded holes, precast holes, waist holes, and machined surfaces. Different feature combinations represent different inspection results. Classification inspection can be accurately achieved through the classification inspection model.

[0070] In this embodiment, the classification model body adopts the Resnets-50 classification network. Due to the identity mapping in the network structure, it can be ensured that the feature extraction ability of the network will not degrade with the depth of the network. In the original network architecture, the self-attention mechanism (Multi-Head Self Attention) is added to replace the last three BottleNeck Layers (3*3 convolutional layers) of the original network. While maintaining the network depth, the model can improve the ability to recognize and utilize task-related features, as well as the ability to capture key information. The feature map is analyzed through the self-attention mechanism, and different weights are assigned to different features or feature channels, thereby highlighting important information and suppressing unimportant information. The introduction of the self-attention mechanism can not only improve the performance of the model, but also allow the model to focus more on the key parts of the data, thereby improving the interpretability and generalization of the model.

[0071] Before S110, it also includes S100, which is: collecting training samples, the training samples include a first training image and a second training image, the first training image represents an image of a machined surface of a part before machining, the second training image represents an image of the machined surface of the part after machining, the second training image has a machining area, wherein the first training image is obtained after the machining area is cut out; and training a classification model based on the training samples.

[0072] After the processed area of ​​the second training image is cut out, the first training image can be obtained, which increases the number of training samples, reduces the time for collecting training sets, and improves the efficiency of training classification models.

[0073] The classification model training adopts the feature clipping method to copy the image features of different categories, and the classification features after machining are defined as positive samples, and the image classification features before machining are defined as negative samples. Among them, the positive samples need to be refined and classified due to the presence of multiple features after machining. Since the number of negative sample parts is limited, which is only 1 / 10 of the number of original parts, the number of negative sample images adopts the method of data generation to expand the sample size. The classification data set is constructed, and the ratio of positive and negative image samples is 2:1, among which the ratio of training set to validation set is maintained at 8:2. The threaded hole data set is 15,000, the waist hole data set is 6,000, the precast hole data set is 3,000, and the machined surface data set is 6,000. The classification model training process also adopts the data enhancement method to enhance the generalization of the model. The model verifies the validation set, and the threaded hole classification detection rate can reach 99.9%, the waist hole classification detection rate is 99%, the precast hole classification detection rate is 99%, and the machined surface classification detection rate is 99%. The model application effect meets the requirements of on-site inspection.

[0074] In order to collect the initial state of the parts, the castings need to be machined with positioning holes (the positioning holes are shared by multiple parts) to meet the positioning requirements of the flexible fixture. However, due to the high-precision machining characteristics of machining, the parts cannot be repeatedly processed in the machining center after the positioning holes are machined and can only be scrapped. The initial state parts collected in this implementation are limited (30), but in order to meet the model sample balance, GAN can also be used to generate negative sample data against the generative model.

[0075] When training the classification model, the image Blob and copy-fill methods are used to segment and preprocess the features of threaded holes, waist-shaped holes, precast holes, and machined surfaces in the input image, and different classification image data sets are constructed. The training set and the validation set are kept at 8:2, and the amount of data for each classification is greater than 3000. The data is preprocessed before model training, and the data distribution is unified by normalization to facilitate model training. Each image classification model training uses data enhancement methods (translation, flipping, rotation, scaling, CutMix, Cutout, etc.) to enrich the diversity of samples and improve the robustness and generalization of the model. According to different categories of detection renewal, different detection ROIs are drawn in the input image. The classification models of different categories obtained by training are introduced into the ROI for detection and recognition to obtain different categories of detection results, thereby realizing the detection function of feature types such as threaded holes, waist-shaped holes, and machined surfaces.

[0076] In this embodiment, the target detection model uses the classic open source algorithm YOLO as the framework, adds a bottleneck attention module (BAM) to the backbone network, and places BAM between each stage in the Resnet network. Multi-layer BAMs form a hierarchical attention mechanism that can eliminate low-level features such as background semantic features and gradually focus on high-level semantics (detection targets). By improving the backbone feature extraction network, the feature extraction of the detection target can be strengthened, further ensuring the detection of the target.

[0077] Construct target detection datasets and classification model datasets, and apply the models to achieve detection. Construct a through-hole target detection dataset with a training set and a validation set ratio of 8:2. Obtain a detection model through labeling, cleaning, and training. The optimal total amount of data should be greater than 5,000. Use the trained model to traverse the input image for detection. The model can quickly identify all through-hole features in the input image. Compare the model detection results with the drawn through-hole ROI to achieve through-hole detection.

[0078] In this embodiment, 330 actual parts were collected on site (30 parts were not machined), 21,000 examples of through-hole image data were obtained, and a through-hole target detection data set was constructed, wherein the ratio of training set to validation set was 8:2. The data set was labeled, cleaned, and trained. The model training process improved sample diversity through data enhancement methods (translation, rotation, contour mapping, noise, etc.). The validation set was verified by generating a training model after training. The through-hole detection was stable, and the detection rate could reach 99.9%.

[0079] In this embodiment, after the input image is detected, the detection results are stored in a database as a test set to further improve the detection accuracy of the classification model and the target detection model.

[0080] Please refer to Figure 3 The present application also provides a parts appearance inspection system, which includes at least one software function module that can be stored in a storage module or fixed in an operating system (OS) in the form of software or firmware. The processing module is used to execute the executable module stored in the storage module, such as the software function module and computer program included in the voice message device.

[0081] The part appearance inspection system includes a receiving module 1, an acquisition module 2 and a detection module 3, and the functions of each unit can be as follows: the receiving module 1 is configured to receive an input image; the acquisition module 2 is configured to acquire a region of interest of the input image, where the region of interest has features to be detected; the detection module 3 is configured to select a corresponding deep learning model to detect the appearance of the features to be detected according to the type of the features to be detected.

[0082] The acquisition module 2 is further configured to obtain the region of interest according to the following method, specifically:

[0083] S121: Obtain the obvious features of the input image.

[0084] S122: Acquire a matching template according to the outline of the obvious features.

[0085] S123: Correct the position of the input image according to the relative positions of the template matching reference points and the matching points of the input image.

[0086] S124: The position where the detection frame overlaps with the corrected input image is defined as the region of interest.

[0087] The detection module 3 is configured to detect the appearance of the feature to be detected based on the classification model when the feature to be detected includes a first type of specified feature, and the first type of specified feature includes at least one of a threaded hole, a precast hole, a waist-shaped hole, and a machined surface;

[0088] Detecting the appearance of features to be detected based on the classification model includes:

[0089] The classification model receives the features to be detected and outputs the classification results;

[0090] Based on the classification results, determine whether there are defects in the appearance of the feature to be detected.

[0091] Wherein, determining whether there is a defect in the appearance of the feature to be detected based on the classification result includes:

[0092] When the classification result indicates that the surface to be inspected is an image before machining, it is determined that there is a defect in the appearance of the feature to be inspected;

[0093] When the classification result indicates that the profile to be inspected is a machined image, it is determined that there is no defect in the appearance of the feature to be inspected.

[0094] Among them, the classification model is based on the Resnets-50 classification network, and the convolutional layer of the Resnets-50 classification network introduces the self-attention mechanism.

[0095] The detection module 3 is further configured to detect the appearance of the second type of designated features based on the target detection model when the features to be detected include the second type of designated features, and the second type of designated features include through holes.

[0096] Among them, the target detection model is based on the YOLO architecture. The target detection model adds a bottleneck attention module between each stage in the Resnet network of the YOLO architecture.

[0097] The present embodiment further includes a training module, the training module is configured to collect training samples, the training samples include a first training image and a second training image, the first training image represents a part profile image before machining, the second training image represents a part profile image after machining, the second training image has a machining area, wherein the first training image is obtained after the machining area is cut out;

[0098] Train the classification model based on the training samples.

[0099] The receiving module 1 is electrically connected to the camera and is used to receive images taken by the camera.

[0100] The embodiment of the present application provides a server including a processing module and a storage module coupled to each other. The storage module stores a computer program, and when the computer program is executed by the processing module, the server can execute the corresponding steps in the above-mentioned part appearance detection method.

[0101] In this embodiment, the processing module may be an integrated circuit chip having the ability to process signals. The above-mentioned processing module may be a general-purpose processor. For example, the processor may be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and may implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0102] The storage module may be, but is not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, and the like.

[0103] The embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is run on a computer, the computer executes the part appearance detection method described in the above embodiment.

[0104] Through the description of the above implementation methods, technical personnel in this field can clearly understand that the present application can be implemented by hardware, and can also be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0105] In the embodiments provided in the present application, it should be understood that the disclosed system and method can also be implemented in other ways. The system and method embodiments described above are merely schematic, for example, the flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or a code, and a part of the module, program segment or code includes one or more executable instructions for implementing the specified logical function. It should also be noted that each box in the block diagram and / or the flow chart, and the combination of the boxes in the block diagram and / or the flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0106] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for detecting the appearance of a part, It is characterized in that The method comprises: receiving an input image; Acquire a region of interest of the input image, where the region of interest has features to be detected; According to the type of the feature to be detected, a corresponding deep learning model is selected to detect the appearance of the feature to be detected, and a detection result characterizing whether there is a defect in the appearance is obtained.

2. The method according to claim 1, Features: The selecting, according to the type of the feature to be detected, a corresponding deep learning model to detect the appearance of the feature to be detected comprises: When the feature to be detected includes a first type of specified feature, the appearance of the feature to be detected is detected based on the classification model, and the first type of specified feature includes at least one of a threaded hole, a precast hole, a waist hole, and a machined surface; Detecting the appearance of the feature to be detected based on the classification model includes: The classification model outputs a classification result after receiving the feature to be detected; Based on the classification results, determine whether there are defects in the appearance of the feature to be detected.

3. The method according to claim 2, Features: Determining whether the appearance of the feature to be detected has defects based on the classification result includes: When the classification result indicates that the region of interest is an image before machining, determining that there is a defect in the appearance of the feature to be detected; When the classification result indicates that the region of interest is a machined image, it is determined that there is no defect in the appearance of the feature to be detected.

4. The method according to claim 2 or 3, Features: Before receiving the input image, the method further includes: Collecting training samples, the training samples include a first training image and a second training image, the first training image represents a part surface image before machining, the second training image represents a part surface image after machining, the second training image has a machining area, wherein the first training image is obtained by cutting out the machining area; The classification model is trained based on the training samples.

5. The method according to claim 2, Features: The classification model is based on the Resnets-50 classification network, and the convolutional layer of the Resnets-50 classification network introduces a self-attention mechanism.

6. The method according to claim 1, Features: The selecting, according to the type of the feature to be detected, a corresponding deep learning model to detect the appearance of the feature to be detected comprises: When the features to be detected include second-type designated features, the appearance of the second-type designated features is detected based on the target detection model, and the second-type designated features include through holes.

7. The method according to claim 6, Features: The target detection model is based on the YOLO architecture, and the target detection model adds a bottleneck attention module between each stage in the Resnet network of the YOLO architecture.

8. The method according to claim 1, Features: The acquiring the region of interest of the input image comprises: Get the salient features of the input image; Obtain matching templates based on the outlines of obvious features; Correcting the position of the input image according to the relative positions of the matching template reference points and the input image reference points; The position where the detection frame overlaps with the corrected input image is defined as the region of interest.

9. A parts appearance inspection system, Features: include: A receiving module configured to receive an input image; An acquisition module, configured to acquire a region of interest of the surface to be detected, wherein the region of interest has features to be detected; The detection module is configured to select a corresponding deep learning model to detect the appearance of the feature to be detected according to the type of the feature to be detected, and obtain a detection result characterizing whether there is a defect in the appearance.

10. A server, It is characterized in that The server includes a processor and a memory coupled to each other, wherein the memory stores a computer program. When the computer program is executed by the processor, the server executes the part appearance detection method according to any one of claims 1 to 8.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer executes the part appearance detection method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Visual inspection method for hole of aluminum alloy machining part

    CN110969357A

  • Metal plate hole positioning size detection method based on three-axis coordinate conversion and monocular vision fusion

    CN117537706A

  • Multi-target crack defect detection method and device based on AI intelligent camera

    CN115018846A

  • Vehicle defect detection method, device, system and medium

    CN115984207A

  • Method and system for detecting tiny defects of machined surface of mechanical part based on target recognition

    CN118333995A