Product appearance inspection method and device, electronic equipment and readable storage medium
By obtaining appearance images when the product moves and using the target tracking algorithm and deep learning model for defect detection, the problem of low detection efficiency in the prior art is solved, and product appearance inspection is efficiently carried out in the production line.
Patent Information
- Application Number
- CN202411191647.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-20
AI Technical Summary
In the prior art, the product appearance inspection efficiency is low, and it requires manual placement of the product in a specific shooting area, which takes a long time and reduces the detection efficiency.
When the target product continues to move, the defect detection model built on the target tracking algorithm is obtained and the defect feature is extracted and classified using the convolutional neural network and support vector machine model to achieve defect features. Test.
It improves the inspection efficiency of product appearance inspection, can complete appearance inspection when the product moves in the production line, and will not suspend production and inspection processes, which enhances the accuracy and efficiency of inspection.
Smart Images

Figure CN119168956A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of product inspection, and in particular to a product appearance inspection method, device, electronic equipment and readable storage medium. Background Art
[0002] In order to solve the problem of high labor consumption when inspecting the product appearance, the prior art usually obtains a product image by photographing the product appearance, and then performs defect detection on the product appearance based on the product image; however, in the prior art, when photographing the product appearance, relevant personnel are required to place the product in a specific photographing area, which is time-consuming and reduces the detection efficiency. Summary of the invention
[0003] The main purpose of the present invention is to propose a product appearance inspection method, device, electronic device and readable storage medium, aiming to solve the problem of low efficiency in product appearance inspection in the prior art.
[0004] To achieve the above object, the present invention provides a product appearance inspection method, the method comprising the steps of:
[0005] When the target product continues to move, acquiring an appearance image of the target product;
[0006] Inputting the appearance image into a trained defect detection model, wherein the defect detection model is a model constructed based on a target tracking algorithm, and the target tracking algorithm is used to track the target product in motion;
[0007] The defect detection model is run to obtain a defect detection result corresponding to the appearance image.
[0008] Optionally, acquiring the appearance image of the target product includes:
[0009] If the target product enters the detection area, obtaining the current product posture of the target product;
[0010] Determining a target shooting angle corresponding to the current product posture;
[0011] After adjusting the shooting angle of the image acquisition device to the target shooting angle, the target product is photographed to obtain the appearance image.
[0012] Optionally, inputting the appearance image into a trained defect detection model includes:
[0013] Extracting the contour of the defect on the target product in the appearance image by using an edge detection algorithm to determine the defect information in the appearance image;
[0014] The defect information is input into the trained defect detection model.
[0015] Optionally, the defect detection module includes a convolutional neural network and a support vector machine model; the defect detection result includes a defect classification result, and the defect detection result corresponding to the appearance image obtained by running the defect detection model includes:
[0016] Running the convolutional neural network to perform feature extraction to obtain defect feature information corresponding to the defect information, wherein the convolution layer of the convolutional neural network adopts the target tracking algorithm;
[0017] Inputting the defect feature information into the support vector machine model;
[0018] The support vector machine model is run to perform defect classification to obtain the defect classification result corresponding to the defect feature information.
[0019] Optionally, after running the defect detection model to obtain the defect detection result corresponding to the appearance image, the step further includes:
[0020] receiving a manual review result, and determining the defect detection result of the target product corresponding to the manual review result;
[0021] Determining whether the manual review result is consistent with the corresponding defect detection result;
[0022] If the manual review result is inconsistent with the defect detection result, the defect detection model is iterated through the appearance image and the manual review result to update the model parameters of the defect detection model.
[0023] Optionally, after running the defect detection model to obtain the defect detection result corresponding to the appearance image, the method further includes:
[0024] If the defect detection result indicates that the target product is a defective product, monitoring the position of the target product;
[0025] If the position of the target product reaches the target position, the target product is moved to the corresponding output area.
[0026] Optionally, the target position is a jetting position of a high-pressure air nozzle, and if the position of the target product reaches the target position, moving the target product to a corresponding output area comprises:
[0027] If the position of the target product reaches the jetting position of the high-pressure air nozzle, the high-pressure air nozzle is controlled to jet so as to move the target product to the defect conveyor belt and then move the target product to the defect area through the defect conveyor belt.
[0028] To achieve the above object, the present invention further provides a product appearance inspection device, the product appearance inspection device comprising:
[0029] A first acquisition module, used for acquiring an appearance image of the target product when the target product continues to move;
[0030] A first input module, used to input the appearance image into a trained defect detection model, wherein the defect detection model is a model constructed based on a target tracking algorithm, and the target tracking algorithm is used to track the target product in motion;
[0031] The first operation module is used to operate the defect detection model to obtain a defect detection result corresponding to the appearance image.
[0032] To achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program, when executed by the processor, implements the steps of the product appearance inspection method as described above.
[0033] To achieve the above objectives, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the product appearance inspection method described above are implemented.
[0034] The present invention proposes a product appearance inspection method, device, electronic device and readable storage medium, which obtains the appearance image of the target product when the target product is continuously moving; inputs the appearance image into a trained defect detection model, wherein the defect detection model is a model constructed based on a target tracking algorithm, and the target tracking algorithm is used to track the target product in motion; and runs the defect detection model to obtain a defect detection result corresponding to the appearance image. By setting the defect detection model, the detection of defects in the appearance image is achieved. At the same time, the defect detection model is set based on the target tracking algorithm, so that the defect detection model can detect defects in the appearance image of the moving target product, thereby completing the appearance inspection of the target product while it is moving in the production line, without suspending the original production and inspection process of the target product, thereby improving the inspection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 It is a flow chart of the first embodiment of the product appearance inspection method of the present invention;
[0038] Figure 2 A schematic diagram of an application scenario of the product appearance inspection method of the present invention;
[0039] Figure 3 It is a schematic diagram of the overall principle of the product appearance inspection method of the present invention;
[0040] Figure 4 It is a schematic diagram of the module structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present application.
[0042] The present invention provides a product appearance inspection method, referring to Figure 1 , Figure 1 This is a flow chart of a first embodiment of a method for inspecting product appearance according to the present invention, wherein the method comprises the following steps:
[0043] Step S10, when the target product continues to move, acquiring an appearance image of the target product;
[0044] The target products are products that require appearance inspection; the products may be, but are not limited to, electronic devices with screens such as mobile phones and tablets.
[0045] The target product can be placed on a driving device such as a conveyor belt, and the movement of the conveyor belt drives the target product to move.
[0046] The appearance image is an image containing the appearance of the target product; the appearance image can be collected by an image acquisition device such as a camera; it can be understood that when acquiring the appearance image, multiple image acquisition devices with different perspectives can be set, or the perspective can be converted by a single image acquisition device to capture an appearance image containing the complete appearance of the target product; the number of appearance images can be multiple images, or it can be a single image synthesized from multiple images taken by multiple image acquisition devices or multiple perspectives of an image acquisition device.
[0047] Step S20, inputting the appearance image into a trained defect detection model, wherein the defect detection model is a model constructed based on a target tracking algorithm, and the target tracking algorithm is used to track the target product in motion;
[0048] The defect detection model is used to detect defects on the appearance of the target product based on the appearance image.
[0049] RTT (Recurrently Target-attending Tracking) can better handle occlusion and changes in the appearance of the target product; therefore, when the target product moves, the RTT-based defect detection model can effectively locate the target product, thereby eliminating the impact of movement on the target product detection and realizing appearance inspection during the movement of the target product.
[0050] It is understandable that the defect detection model needs to be trained. Before training the defect detection model, it is necessary to obtain training samples, such as obtaining product images with defects in appearance, and classifying the product images according to the defect types, such as color, bumps, integrity, etc. At the same time, determine the location, direction, size, defect form under different product states, whether it is a defective product, and other related information in the product image, and associate the product image, defect type, and related information to generate training samples; it is understandable that in addition to samples with defects, the training samples also need to set samples corresponding to normal products.
[0051] It should be noted that the environment will have an impact on the image. Therefore, in order to improve the accuracy of detection, when obtaining training samples, product images with the same or similar shooting environment as the detection environment of the target product can be obtained; thereby, the training samples and the appearance images of the target product are obtained based on the same shooting environment; in addition, the number and position of the image acquisition equipment can be set based on the shooting angle of the image in the training sample, so as to further improve the consistency of the acquisition methods between the training samples and the appearance images of the target product.
[0052] After the training samples are obtained, the defect detection model can be trained based on the training samples; the training completion conditions, loss function, etc. of the specific defect detection module can be set based on actual needs and are not limited here. After the training is completed, a trained defect detection model is obtained.
[0053] Step S30, running the defect detection model to obtain a defect detection result corresponding to the appearance image.
[0054] After the appearance image is input into the defect detection model, the appearance image is detected by the defect detection model to obtain the defect detection result; the defect monitoring result may include but is not limited to whether the target product has defects, whether it is a normal product or a defective product, the defect type, the defect size, and the defect location.
[0055] This embodiment realizes the detection of defects in the appearance image by setting a defect detection model. At the same time, the defect detection model is set based on the target tracking algorithm, so that the defect detection model can realize defect detection for the appearance image of the target product in motion, thereby completing the appearance inspection of the target product while it is moving in the production line, and will not suspend the original production and inspection process of the target product, thereby improving the detection efficiency.
[0056] Further, in the second embodiment of the product appearance inspection method of the present invention proposed based on the first embodiment of the present invention, the step S10 includes the steps of:
[0057] Step S11, if the target product enters the detection area, obtaining the current product posture of the target product;
[0058] Step S12, determining a target shooting angle corresponding to the current product posture;
[0059] Step S13, adjusting the shooting angle of the image acquisition device to the target shooting angle and shooting the target product to obtain the appearance image.
[0060] The detection area is a pre-set area for inspecting the appearance of the target product. If the target product needs to be moved from station A to station B in addition to the appearance inspection, relevant devices for appearance inspection can be set on the conveyor belt between stations A and B. Specifically, the image acquisition range of the image acquisition state can be used as the detection area. When the target product is transmitted to the detection area with the conveyor belt, subsequent operations are triggered. In actual applications, sensors can be set to detect the position of the target product, and real-time images of the image acquisition device can also be detected. If the complete appearance of the target product is detected, it is considered that the target product has entered the detection area.
[0061] The current product posture is the current actual posture of the target product; when the target product moves on the conveyor belt, the postures of different target products may be different due to previous placement or other reasons; and in order to improve the accuracy of defect detection, the shooting angle of the appearance image is kept consistent in this embodiment, so as to obtain an appearance image with a consistent angle; it can be understood that when obtaining training samples, images with an angle consistent with the shooting angle can also be selected, so that the training samples of the defect detection model are consistent with the shooting angle of the appearance image of the target product, thereby further improving the detection accuracy.
[0062] After determining the current product posture, determine the target shooting angle corresponding to the current product posture; it can be understood that the target shooting angle varies based on different product postures; the relative shooting angle between the image acquisition device and the target product can be set in advance, and after the current product posture is determined, the target shooting angle of the image acquisition device can be determined through the relative shooting angle based on the current product posture.
[0063] After the target shooting angle is determined, the shooting angle of the image acquisition device is set to the target shooting angle, and the target product is photographed at the target shooting angle to obtain an appearance image.
[0064] It can be understood that when there are multiple image acquisition devices, the relative shooting angles between different image acquisition devices and the target product can be set respectively. After determining the current product posture, the target shooting angles of different image acquisition devices are determined respectively, and each image acquisition device is set to the target shooting angle respectively.
[0065] In this embodiment, the shooting angle of the image acquisition device is adjusted based on the current product posture, so that the obtained appearance image has consistency in shooting angle, thereby improving the accuracy of detection.
[0066] Further, in a third embodiment of the product appearance inspection method of the present invention proposed based on the first embodiment of the present invention, step S20 includes the steps of:
[0067] Step S21, extracting the contour of the defect on the target product in the appearance image by an edge detection algorithm to determine the defect information in the appearance image;
[0068] Step S22: inputting the defect information into the trained defect detection model.
[0069] The edge detection algorithm is used to detect points on the appearance image where significant changes occur. It is understandable that when the appearance of the target product has defects, the defects will be reflected in the appearance image as significant changes relative to the surrounding normal parts. Therefore, the edge detection algorithm can be used to perform preliminary detection of defects on the appearance image to extract the contour of the defect, thereby determining the defect information on the target product, and related information such as the defect location and defect type. After determining the defect information, the defect detection model is further used to obtain specific defect detection results to improve detection efficiency and accuracy. The specific type of edge detection algorithm can be selected based on actual needs, such as Canny. It should be noted that when training the defect detection model, the defect information of the training sample can be determined by the edge detection algorithm first, and then the defect information can be input into the defect detection model for training.
[0070] Furthermore, the defect detection module includes a convolutional neural network and a support vector machine model; the defect detection result includes a defect classification result, and the step S30 includes the steps of:
[0071] Step S31, running the convolutional neural network to perform feature extraction to obtain defect feature information corresponding to the defect information, wherein the convolution layer of the convolutional neural network adopts the target tracking algorithm;
[0072] Step S32, inputting the defect feature information into the support vector machine model;
[0073] Step S33, running the support vector machine model to perform defect classification, and obtaining a defect classification result corresponding to the defect feature information.
[0074] In this embodiment, the defect detection model is composed of CNN (Convolutional Neural Networks) and SVM (Support Vector Machine) models; the convolutional neural network is used to obtain defect feature information, and the support vector machine model is used for classification.
[0075] The specific structure of the convolutional neural network can be set based on actual needs, but the convolution layer in the convolutional neural network adopts a target tracking algorithm to achieve detection of moving target products.
[0076] The specific structure of the support vector machine model can be set based on actual needs.
[0077] The defect characteristic information is used to indicate the characteristics of the defects on the target product; the defect characteristic information includes but is not limited to the defect type, size, quantity, color, integrity, and concave-convex.
[0078] The defect classification result is the final result of the defect detection; the defect classification result may include defect information, defect feature information, and detection type; the detection type may indicate that the target product is a normal product or a defective product; it is understandable that due to process, material and other issues, there will be some defects on the target product, but some defects will not affect the use of the target product and can meet the production requirements. Therefore, it is necessary to classify the target product into normal products and defective products based on the specific circumstances of the defects on the target product; normal products are target products that meet the production requirements; and defective products are target products that do not meet the production requirements; after the defect feature information is determined, the support vector machine model determines the target product as a normal product or a defective product through the defect feature information.
[0079] This embodiment can accurately obtain defect detection results.
[0080] Furthermore, in a fourth embodiment of the product appearance inspection method of the present invention proposed based on the first embodiment of the present invention, the following steps are included after step S30:
[0081] Step S40, receiving a manual review result, and determining the defect detection result of the target product corresponding to the manual review result;
[0082] Step S50, determining whether the manual review result is consistent with the corresponding defect detection result;
[0083] Step S60: if the manual review result is inconsistent with the defect detection result, iterating the defect detection model through the appearance image and the manual review result to update the model parameters of the defect detection model.
[0084] The manual review results are the results obtained by manual inspection of the target product; the manual review results can be determined before the defect detection model is detected, or can be determined after the defect detection model is detected; it is understandable that the defect detection results obtained by the defect detection model may have detection errors; therefore, it is necessary to continuously update the model parameters of the defect detection model to improve the accuracy of the defect detection model.
[0085] The manual review result is considered to be the correct result; when the defect detection result is inconsistent with the manual review result, it means that there is a problem with the defect detection result, and the defect detection model needs to be corrected for this case; therefore, the appearance image and manual review result corresponding to this case are obtained, and they are used as new training samples to train the defect detection module to achieve the update of the defect detection model; through continuous updates based on actual cases, the accuracy of the defect detection model will continue to improve.
[0086] Furthermore, in a fifth embodiment of the product appearance inspection method of the present invention proposed based on the first embodiment of the present invention, the following steps are included after step S30:
[0087] Step S70, if the defect detection result indicates that the target product is a defective product, monitoring the position of the target product;
[0088] Step S80: if the position of the target product reaches the target position, the target product is moved to a corresponding output area.
[0089] It is understandable that if the target product is a normal product, the target product can enter the subsequent process or output. If the target product is a defective product, the target product needs to be processed for defects; therefore, the target product needs to be output to the corresponding position based on the detection type; it is understandable that the target product is transmitted through a conveyor belt, therefore, corresponding conveyor belts can be set for different detection types, and different conveyor belts correspond to different output areas; such as a defective conveyor belt is used to transmit defective products to a defective area, and a normal conveyor belt is used to transmit normal products to a normal area.
[0090] Furthermore, the step S80 includes:
[0091] Step S81, if the position of the target product reaches the jetting position of the high-pressure air nozzle, the high-pressure air nozzle is controlled to jet so as to move the target product to the defect conveyor belt.
[0092] The specific method of controlling the movement of the target product can be set based on actual needs; in this embodiment, a high-pressure jet nozzle is set to blow the target product onto the defective conveyor belt by jetting; and the conveyor belt where the target product was originally located serves as a normal conveyor belt, thereby achieving the distinction between normal products and defective products.
[0093] The following is a description of the overall implementation process of this application:
[0094] See also Figure 2 , Figure 2 A schematic diagram of an application scenario of the product appearance inspection method of the present invention;
[0095] The scene includes a normal conveyor belt 1, a defective conveyor belt 2, a conveyor belt support 3, a high-pressure jet nozzle 4, an air pipeline 5, an air compressor 6, an image acquisition device 7, and a target product 8;
[0096] The normal conveyor belt 1 and the defective conveyor belt 2 are supported by a conveyor belt bracket 3; the normal conveyor belt 1 and the defective conveyor belt 2 are partially connected, and a high-pressure spray nozzle 4 is arranged relative to the connected part, and the high-pressure spray nozzle 4 is connected to an air compressor 6 through an air pipeline 5;
[0097] The target product 8 is placed on the normal conveyor belt and moves with the movement of the conveyor belt, and the image acquisition device 7 is arranged around the normal conveyor belt 1.
[0098] See also Figure 3 , Figure 3 It is a schematic diagram of the overall principle of the product appearance inspection method of the present invention;
[0099] 1. Collect enough products with appearance defects, mainly mobile phones, tablets or other electronic products with screens on one side, and use image acquisition equipment with a pixel of no less than 50 million to take pictures of the products to obtain product images;
[0100] 2. Classify defect types according to certain rules. The classification rules are mainly based on the location and direction of defects on the product appearance, as well as the shape of defects in different product forms, etc., to provide data support for the later arrangement of the number and orientation of image acquisition equipment and the shape of products when passing through the production line;
[0101] 3. Build a defect detection model and use training samples consisting of images of defective products and normal products to train the defect detection model;
[0102] 4. Install image acquisition devices around the conveyor belt. According to the trained defect detection model, adjust the number, direction, position and product form of image acquisition devices by connecting with the micro PLC machine to ensure that the positions where defects are prone to occur on the target product can be fully covered;
[0103] 5. A defect detection model is set in the micro PLC machine, and the appearance image collected by the image acquisition device is read to determine whether the target product is a normal product;
[0104] 6. When the micro PLC machine determines that the target product is a defective product, it controls the high-pressure jet nozzle to blow the target product onto the defective conveyor belt on one side to achieve automatic sorting of defective products;
[0105] 7. Use manual review and random sampling to check whether there are any missed or misjudged products, and input the misjudged / missed product information into the trained defect detection model to continuously correct the model.
[0106] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0108] The present application also provides a product appearance inspection device for implementing the above-mentioned product appearance inspection method, the product appearance inspection device comprising:
[0109] A first acquisition module, used for acquiring an appearance image of the target product when the target product continues to move;
[0110] A first input module, used to input the appearance image into a trained defect detection model, wherein the defect detection model is a model constructed based on a target tracking algorithm, and the target tracking algorithm is used to track the target product in motion;
[0111] The first operation module is used to operate the defect detection model to obtain a defect detection result corresponding to the appearance image.
[0112] The appearance inspection device of this product realizes the detection of defects in the appearance image by setting a defect detection model. At the same time, the defect detection model is set based on the target tracking algorithm, so that the defect detection model can realize defect detection for the appearance image of the moving target product, thereby completing the appearance inspection while the target product is moving in the production line, and will not suspend the original production and inspection process of the target product, thereby improving the inspection efficiency.
[0113] It should be noted that the first acquisition module in this embodiment can be used to execute step S10 in the embodiment of the present application, the first input module in this embodiment can be used to execute step S20 in the embodiment of the present application, and the first operation module in this embodiment can be used to execute step S30 in the embodiment of the present application.
[0114] Furthermore, the first acquisition module includes:
[0115] A first acquisition unit, configured to acquire a current product posture of the target product if the target product enters a detection area;
[0116] A first determining unit, configured to determine a target shooting angle corresponding to the current product posture;
[0117] The first adjustment unit is used to adjust the shooting angle of the image acquisition device to the target shooting angle and then shoot the target product to obtain the appearance image.
[0118] Furthermore, the first input module includes:
[0119] A second determining unit is used to extract the contour of the defect on the target product in the appearance image by an edge detection algorithm to determine the defect information in the appearance image;
[0120] The first input unit is used to input the defect information into the trained defect detection model.
[0121] Furthermore, the defect detection module includes a convolutional neural network and a support vector machine model; the defect detection result includes a defect classification result, and the first operation module includes:
[0122] A first operation unit is used to operate the convolutional neural network to perform feature extraction to obtain defect feature information corresponding to the defect information, wherein the convolution layer of the convolutional neural network adopts the target tracking algorithm;
[0123] A second input unit, used to input the defect feature information into the support vector machine model;
[0124] The second operation unit is used to operate the support vector machine model to perform defect classification and obtain the defect classification result corresponding to the defect feature information.
[0125] Furthermore, the device also includes:
[0126] A first receiving module, configured to receive a manual review result and determine the defect detection result of the target product corresponding to the manual review result;
[0127] A first judgment module, used to judge whether the manual review result is consistent with the corresponding defect detection result;
[0128] The first updating module is used to iterate the defect detection model through the appearance image and the manual review result to update the model parameters of the defect detection model if the manual review result is inconsistent with the defect detection result.
[0129] Furthermore, the device also includes:
[0130] A first monitoring module, configured to monitor the position of the target product if the defect detection result indicates that the target product is a defective product;
[0131] The first control module is used to move the target product to a corresponding output area if the target product reaches the target position.
[0132] The first control module comprises:
[0133] The first control unit is used for controlling the high-pressure air nozzle to spray air if the position of the target product reaches the spraying position of the high-pressure air nozzle, so as to move the target product to the defective conveyor belt.
[0134] Reference Figure 4 In terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is connected to the memory 20 and the communication module 10 respectively, and a computer program is stored in the memory 20. The computer program is executed by the processor 30 at the same time, and the steps of the above method embodiment are implemented when the computer program is executed.
[0135] The communication module 10 can be connected to an external communication device through a network. The communication module 10 can receive requests from an external communication device, and can also send requests, instructions and information to the external communication device, which can be other electronic devices, servers or Internet of Things devices, such as televisions, etc.
[0136] The memory 20 can be used to store software programs and various data. The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as obtaining the appearance image of the target product), etc.; the data storage area can include a database, and the data storage area can store data or information created according to the use of the system, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0137] The processor 30 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 20, and calling data stored in the memory 20, so as to monitor the electronic device as a whole. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 30.
[0138] although Figure 4Although not shown, the electronic device may further include a circuit control module, which is used to connect to a power source to ensure the normal operation of other components. Figure 4 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0139] The present invention also provides a computer-readable storage medium on which a computer program is stored. The computer-readable storage medium may be Figure 4 The memory 20 in the electronic device may also be at least one of a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, and an optical disk. The computer-readable storage medium includes a number of instructions for enabling a terminal device with a processor (which may be a television, a car, a mobile phone, a computer, a server, a terminal, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0140] In the present invention, the terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0141] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0142] Although the embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art can change, modify and replace the above embodiments within the scope of the present invention, and these changes, modifications and replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A product appearance inspection method, characterized in that: The product appearance inspection method comprises: When the target product continues to move, acquiring an appearance image of the target product; Inputting the appearance image into a trained defect detection model, wherein the defect detection model is a model constructed based on a target tracking algorithm, and the target tracking algorithm is used to track the target product in motion; The defect detection model is run to obtain a defect detection result corresponding to the appearance image.
2. The product appearance inspection method according to claim 1, characterized in that: The obtaining of the appearance image of the target product comprises: If the target product enters the detection area, obtaining the current product posture of the target product; Determining a target shooting angle corresponding to the current product posture; After adjusting the shooting angle of the image acquisition device to the target shooting angle, the target product is photographed to obtain the appearance image.
3. The product appearance inspection method according to claim 1, characterized in that: The step of inputting the appearance image into the trained defect detection model comprises: Extracting the contour of the defect on the target product in the appearance image by using an edge detection algorithm to determine the defect information in the appearance image; The defect information is input into the trained defect detection model.
4. The product appearance inspection method according to claim 3, characterized in that: The defect detection module includes a convolutional neural network and a support vector machine model; the defect detection result includes a defect classification result, and the defect detection result corresponding to the appearance image obtained by running the defect detection model includes: Running the convolutional neural network to perform feature extraction to obtain defect feature information corresponding to the defect information, wherein the convolution layer of the convolutional neural network adopts the target tracking algorithm; Inputting the defect feature information into the support vector machine model; The support vector machine model is run to perform defect classification to obtain the defect classification result corresponding to the defect feature information.
5. The product appearance inspection method according to claim 1, characterized in that: After the defect detection model is run to obtain the defect detection result corresponding to the appearance image, the method further includes: receiving a manual review result, and determining the defect detection result of the target product corresponding to the manual review result; Determining whether the manual review result is consistent with the corresponding defect detection result; If the manual review result is inconsistent with the defect detection result, the defect detection model is iterated through the appearance image and the manual review result to update the model parameters of the defect detection model.
6. The product appearance inspection method according to claim 1, characterized in that: After running the defect detection model to obtain the defect detection result corresponding to the appearance image, the method further includes: If the defect detection result indicates that the target product is a defective product, monitoring the position of the target product; If the position of the target product reaches the target position, the target product is moved to the corresponding output area.
7. The product appearance inspection method according to claim 6, characterized in that: The target position is the jet position of the high-pressure air nozzle, and if the position of the target product reaches the target position, moving the target product to the corresponding output area includes: If the position of the target product reaches the jetting position of the high-pressure air nozzle, the high-pressure air nozzle is controlled to jet so as to move the target product to the defect conveyor belt and then move the target product to the defect area through the defect conveyor belt.
8. A product appearance inspection device, characterized in that: The product appearance inspection device comprises: A first acquisition module, used for acquiring an appearance image of the target product when the target product continues to move; A first input module, used to input the appearance image into a trained defect detection model, wherein the defect detection model is a model constructed based on a target tracking algorithm, and the target tracking algorithm is used to track the target product in motion; The first operation module is used to operate the defect detection model to obtain a defect detection result corresponding to the appearance image.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the product appearance inspection method according to any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the product appearance inspection method according to any one of claims 1 to 7 are implemented.
