Workpiece surface defect detection method and device, electronic equipment and storage medium
By automatically detecting and marking surface defects on workpieces using image recognition technology, the problems of low efficiency and safety hazards associated with manual visual judgment are solved, achieving efficient and accurate defect detection.
Patent Information
- Application Number
- CN202111498173.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2041-12-09
AI Technical Summary
In existing technologies, the detection of surface defects in workpieces relies on manual visual judgment, which has problems such as low detection efficiency, false positives and false negatives, and safety hazards.
Image recognition technology is used to acquire images of the workpiece surface. Defects are identified and automatically marked by the image recognition module, thereby improving detection efficiency and accuracy.
It reduces false positives and false negatives in manual visual inspection, improves the inspection efficiency and safety of the production line, and reduces the labor intensity of workers.
Smart Images

Figure CN114418939B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of workpiece inspection technology, specifically to a method, apparatus, electronic device, and storage medium for detecting surface defects in workpieces. Background Technology
[0002] Surface defect detection is a critical aspect of factory production lines. These lines primarily rely on workers' visual judgment to identify and mark workpieces with flaws or obvious deformations. However, human vision is prone to fatigue, and some workpieces may have subtle surface defects. Visual judgment has limitations in these cases. Furthermore, manual inspection is inefficient, and human oversight can lead to missed defects, necessitating a production line shutdown. Summary of the Invention
[0003] In view of the above problems, this application provides a method, apparatus, electronic device and storage medium for detecting surface defects of workpieces, which uses image recognition to detect surface defects of workpieces and adds defect labels to the workpieces for inspection, so as to improve the detection efficiency of workpieces on the production line.
[0004] In a first aspect, embodiments of this application provide a method for detecting surface defects in a workpiece, comprising: acquiring a surface image of the workpiece; and, if the workpiece is confirmed to be defective based on the surface image, adding a defect identifier to the workpiece, so as to inspect the workpiece based on the defect identifier.
[0005] Secondly, embodiments of this application provide a vehicle fault detection device, including: a data acquisition module for acquiring surface images of a workpiece; and a detection module for adding a defect identifier to the workpiece if the workpiece is confirmed to be defective based on the surface image, so as to inspect the workpiece based on the defect identifier.
[0006] Thirdly, embodiments of this application provide an electronic device comprising: at least one processor and a memory; the processor is configured to execute a computer program stored in the memory to implement a method for detecting workpiece surface defects as described in any embodiment of the first aspect.
[0007] Fourthly, embodiments of this application provide a computer storage medium storing one or more programs, which can be executed by an electronic device as described in the third aspect to implement the workpiece surface defect detection method as described in any embodiment of the first aspect.
[0008] This application provides a method, apparatus, electronic device, and storage medium for detecting surface defects in a workpiece. It can acquire surface images of the workpiece; if the workpiece is confirmed to be defective based on the surface image, a defect marker is added to the workpiece for inspection based on the defect marker. By automatically marking workpieces with surface defects, it reduces missed detections caused by manual visual inspection and marking errors, thereby improving workpiece production efficiency.
[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0010] The present application will be described in more detail below based on embodiments and with reference to the accompanying drawings.
[0011] Figure 1 This illustration shows an application scenario of a method for inspecting surface defects of a workpiece according to an embodiment of this application.
[0012] Figure 2 A schematic flowchart of a method for detecting surface defects of a workpiece according to an embodiment of this application is shown;
[0013] Figure 3 This paper illustrates a flowchart of step S120 of a method for detecting surface defects of a workpiece according to an embodiment of this application.
[0014] Figure 4 This illustration shows another flowchart of a method for detecting surface defects in a workpiece according to an embodiment of this application;
[0015] Figure 5 This paper illustrates a flowchart of step S310 of a method for detecting surface defects of a workpiece according to an embodiment of this application.
[0016] Figure 6 This paper illustrates a flowchart of step S430 of a method for detecting surface defects of a workpiece according to an embodiment of this application.
[0017] Figure 7 This illustration shows a workflow diagram of a workpiece surface defect detection method proposed in one embodiment of this application in an application scenario;
[0018] Figure 8 A structural block diagram of a workpiece surface defect detection device according to an embodiment of this application is shown;
[0019] Figure 9A structural block diagram of an electronic device for performing a workpiece surface defect detection method according to an embodiment of this application is shown.
[0020] Figure 10 A computer-readable storage medium for storing or carrying a method for detecting workpiece surface defects according to an embodiment of this application is shown. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0022] Currently, the detection of surface defects on workpieces relies on the visual judgment and marking of workers. When workers make visual judgments, if they do not have time to check a certain workpiece, they need to go below the production line, which poses certain safety hazards. At the same time, manual inspection is slow, inefficient, labor-intensive, and has low work efficiency. Sometimes, due to human negligence, missed inspections may occur, requiring the production line to be stopped.
[0023] To address the aforementioned issues, the applicant has proposed a method, apparatus, electronic device, and storage medium for detecting surface defects in workpieces, as provided in the embodiments of this application. By acquiring surface images of the workpiece, and confirming that the workpiece is defective based on the surface images, a defect identifier is automatically added to the workpiece. The workpiece is then inspected based on this defect identifier to obtain the specific details of the surface defects, thereby improving production efficiency and quality on the production line and reducing potential safety hazards for workers. The method for detecting surface defects in workpieces will be described in detail in subsequent embodiments.
[0024] The following describes the application scenarios of the workpiece surface defect detection method provided in the embodiments of this application. In this embodiment, a sprayed part is used as the workpiece to illustrate the specific process of this application. Of course, it can be understood that the workpiece used in this embodiment can be replaced with other types of workpieces as needed, and no limitation is made here.
[0025] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of a method for detecting surface defects on a workpiece provided in this application embodiment. In this embodiment, the method for detecting surface defects on a painted part can be applied to, for example... Figure 1The surface defect detection system 100 for painted parts shown may include: an image acquisition module 10, an image recognition module 20, a processing module 40, and an automatic labeling module 50. The image acquisition module 10 can acquire image information of painted parts from the workshop production line in real time. The image information acquired by the image acquisition module 10 is transmitted to the image recognition module 20 through the processing module 40. The image recognition module 20 performs surface defect detection on the image information to determine whether the painted part is defective. When the image recognition module 20 confirms that the painted part is defective based on the image information, it transmits the defect information to the processing module 40. The processing module 40 generates a control signal based on the defect information and transmits it to the automatic labeling module 50 to label the corresponding painted part. In the surface defect detection system 100 for sprayed parts, the image acquisition module 10, image recognition module 20, processing module 40 and automatic labeling module 50 can exchange information wirelessly or via wired network. The image acquisition module 10, image recognition module 20, processing module 40 and automatic labeling module 50 can be electronic devices set at corresponding positions on the sprayed parts conveyor chain of the production line. They can be composed of one or more components, or they can be integrated or set up separately to detect surface defects of sprayed parts. In addition, the electronic devices can be terminal devices such as cameras, smartphones, tablets, desktop computers, and laptops.
[0026] Please see Figure 2 , Figure 2 This is a schematic flowchart of a method for detecting surface defects of a workpiece provided in an embodiment of this application. The method is applied to electronic devices and may include steps S110 to S120.
[0027] Step S110: Acquire a surface image of the sprayed part.
[0028] In this embodiment, the image acquisition module 10 can be a camera device that can acquire image information of the sprayed parts at corresponding positions. In some embodiments, there can be multiple camera devices, which can be installed at corresponding positions on the production line to acquire images of the spraying status of the sprayed parts at the corresponding positions. The acquired image information can be single or multiple, and this application does not limit it.
[0029] Step S120: If the painted part is confirmed to be a defective part based on the surface image, a defect mark is added to the painted part so as to inspect the painted part based on the defect mark.
[0030] In this embodiment, the acquired image information is transmitted to the processing module 40, which is connected to it. The processing module 40 transmits the image information to the image recognition module 20. The image recognition module 20 can recognize the image information. If the painted part is identified as a defective part, the image recognition module 20 can transmit the recognition information to the automatic marking module 50. For example, the automatic marking module 50 can be an electronic switch, which can be set at the corresponding position of the production line conveyor chain. When the automatic marking module 50 responds to the recognition information that the painted part is a defective part, it can use the electronic switch to control the color nozzle or other marking methods to mark the corresponding painted part, so as to remind the worker that the painted part is a defective part and to inspect the painted part.
[0031] In this embodiment, the electronic device can obtain surface image information of the sprayed part and identify the spraying condition of the sprayed part through the image recognition module. When the image recognition module identifies the sprayed part as a defective part, the processing module issues a control command to the automatic marking module to mark the defective sprayed part. The control command can be determined based on actual use, and the data is processed by the electronic device and / or the backend server to promptly detect the spraying condition of the sprayed parts on the production line in the workshop. This improves the detection efficiency of surface defects of the sprayed parts and reduces the potential safety hazards caused by workers having to enter the production line to inspect the sprayed parts due to insufficient time to check them.
[0032] Given that surface defects of painted parts can include defects in multiple directions, it is necessary to determine the information of defects at corresponding locations for different processing. Step S120 is further explained.
[0033] Please see Figure 3 , Figure 3 This is a flowchart illustrating step S120 of the workpiece surface defect detection method provided in this application embodiment, applied to electronic devices. The surface image may include a front image and a back image, and the defect mark may include a front mark and a back mark. If the sprayed part is confirmed to be a defective part based on the surface image, a defect mark is added to the sprayed part. The method may include steps S210 to S220.
[0034] Step S210: If the painted part is confirmed to be a defective part based on the front image, add a front marking to the painted part.
[0035] In this embodiment of the application, the image of the sprayed part acquired by the image acquisition module 10 can be a frontal image. The image recognition module 20 acquires the frontal image information of the sprayed part transmitted by the processing module 40 and recognizes the frontal image information. When a defect is detected in the frontal image, the processing module 40 can generate a frontal marking control signal to control the automatic marking module 50 to add a frontal defect mark to the sprayed part.
[0036] Step S220: If the painted part is confirmed to be a defective part based on the back image, add a back mark to the painted part.
[0037] In this embodiment of the application, the image of the sprayed part acquired by the image acquisition module 10 can be a back image. The image recognition module 20 acquires the back image information of the sprayed part transmitted by the processing module 40 and recognizes the back image information. When a defect is detected in the back image, the processing module 40 can generate a back marking control signal to control the automatic marking module 50 to add a back defect mark to the sprayed part.
[0038] It should be noted that when the image acquisition module 10 simultaneously acquires images of the painted part and the image recognition module 20 identifies defects on both sides of the image, the painted part can be marked on both sides by the processing module 40 and the automatic marking module 50. The two sides can be marked with different marks, for example, red and blue. Furthermore, if no defects are identified in the painted part, it is processed as a qualified part, the automatic marking module 50 is not triggered, and the remaining painted parts are continuously inspected one by one according to the production line.
[0039] In this embodiment, an automatic marking module is set up according to the defect surface of the sprayed part to mark the sprayed part. The surface image can include multiple orientations. The presence of defects in the sprayed part is confirmed based on the defect marking status in different orientations. Specifically, the judgment can be made according to the corresponding spraying requirements of the sprayed part. For more complex sprayed parts, human eye recognition may have errors, and the presence of multiple defect surfaces makes it inconvenient for workers to mark the sprayed part. After the defects in different locations are identified by multiple image recognition modules, multiple automatic marking modules mark the defective parts at the corresponding locations to improve the detection speed and marking efficiency of surface defects in the sprayed part, and further avoid the occurrence of missed detections and false detections.
[0040] Please see Figure 4 This application provides another schematic flowchart of a method for detecting surface defects in a workpiece. Applied to electronic devices, the method may include step S310.
[0041] Step S310: Input the surface image into the pre-established defect recognition model to determine whether the painted part is a defective part.
[0042] In this embodiment of the application, a defect recognition model is pre-established in the image recognition module 20. In the defect recognition model, the defect information of the sprayed parts with defects in the pre-processed image can be used as the training set for training. The difference between the sprayed part information of the actual input surface image and the information in the model is used to confirm whether there is a defect in the sprayed part corresponding to the image information collected by the image acquisition module 10.
[0043] Please see Figure 5 This application provides a schematic flowchart of step S310 in a method for detecting surface defects on a workpiece. Applied to electronic devices, the defect identification model includes a defect generation network and a feature prediction network. The surface image is input into the pre-established defect identification model to determine whether the coated part is a defective part. This method may include steps S410 to S430.
[0044] Step S410: Input the surface image into the defect generation network to determine the color depth map corresponding to the surface image. The color depth map is marked with the severity of the defect.
[0045] In this embodiment of the application, a defect generation network is trained in the defect recognition model, which can mark the color depth map of the defect severity on the front and back images of the sprayed part. The marked image performs color depth scaling on the defect area. The severity of the defect can be represented by the colors red, orange, yellow, green, blue, indigo and violet. From red to violet, the severity of the defect damage can be represented. Red can represent a minor defect and violet can represent the most severe defect.
[0046] Step S420: Input the color depth map into the feature prediction network to determine the defect feature information of the painted part.
[0047] In this embodiment, a color depth map is input into the feature prediction network. The color depth map of defect severity can be used as a training set for predicting defect generation. The color depth map of defect severity is labeled and used as the training dataset for the feature prediction network. After the defect generation network and the feature prediction network are trained, the front and back images of the actual painted part are captured and input into the defect generation network, which outputs a color depth map of defect severity.
[0048] Step S430: Based on the defect feature information, determine whether the painted part is a defective part.
[0049] In this embodiment, when the color depth map is input into the feature prediction network, the network outputs a two-dimensional matrix. If the area of each defect in the feature data of the matrix is greater than a set unqualified threshold or the damage degree of a defect is greater than the set unqualified threshold, then the workpiece surface is determined to be a defective surface.
[0050] Furthermore, in this embodiment, the results of identifying defective surfaces are scored. If the score is lower than a set threshold, the image of the workpiece surface is saved. Using the gradient backpropagation principle, the images of workpiece surfaces with low scores are re-labeled as a dataset. Feedback optimization and training are then applied to the parameters of the defect generation network and the defect feature prediction network, improving both networks. Ultimately, this allows for accurate determination of whether a workpiece surface is defective, achieving accurate and automated identification.
[0051] Please see Figure 6 This application provides a method for detecting surface defects in a workpiece, with a schematic flowchart of step S430. Applied to electronic devices, the defect feature information includes defect area and defect severity values. Based on the defect feature information, it is determined whether the coated part is a defective part. This method may include steps S510 to S520.
[0052] Step S510: Determine whether the painted part is a defective part based on the defect area and area threshold.
[0053] In this embodiment of the application, in the feature prediction network, for the pre-processed front and back images of the defective part, the area of the defect and the corresponding area threshold are marked as the training set for predicting the defect features. Based on the actual imported defective part, it is determined whether the corresponding area and area threshold of the sprayed part meet the requirements, and it is confirmed whether the sprayed part is a defective part.
[0054] Step S520: Based on the defect severity value and the non-conformance threshold, determine whether the sprayed part is a defective part; wherein, if the defect area is greater than the area threshold, the sprayed part is determined to be a defective part, or if the defect severity value is greater than the non-conformance threshold, the sprayed part is determined to be a defective part.
[0055] In this embodiment of the application, the defect severity value can be data such as defect depth and material characteristic data. If the defect area is greater than the area threshold or the defect severity value meets the threshold, the sprayed part can be identified as a defective part. Otherwise, if the defective part meets all the above conditions at the same time, the defective part is regarded as a normal part.
[0056] In this embodiment, defective parts can be identified by data such as defect area, defect depth, and material characteristic data. Multiple indicators are used to determine the defect information of the sprayed parts. When the requirements for the indicators of the sprayed parts are high, the efficiency and accuracy of the detection can be further improved.
[0057] In some possible implementations, the sprayed parts after automatic identification can be manually scored. If the accuracy of the sprayed parts after automatic identification is found to be unsatisfactory, the image corresponding to the labeled sprayed parts can be saved and then trained according to the scoring requirements.
[0058] In some possible implementations, the defect identification model includes: a defect generation network and a feature prediction network. A flowchart illustrating step S310 of the method for detecting surface defects on a painted part may also include:
[0059] Step S402: Obtain the first training sample set. Each sample data in the first training sample set includes: a first sample surface image labeled with the degree of defect;
[0060] Step S404: Determine the defect generation network based on the first training sample set.
[0061] In this embodiment, the CycleGAN defect generation network identifies defects in the painted parts. The annotation method for the training set images of the defect generation network is to add severity depth annotations to the defect areas of the painted part images, while leaving normal areas unchanged. The network takes an image of the workpiece with defects to be detected as input and outputs a defect severity image. The training process of the CycleGAN defect generation network can be a conventional one-way training of CycleGAN. The CycleGAN network takes an image of the surface defects of the workpiece to be detected as input and generates a defect depth map after passing through the generator.
[0062] In some possible implementations, a flowchart of step S310 of the method for detecting surface defects on a coated part may further include:
[0063] Step S406: Obtain the second sample dataset, where each sample data in the second sample dataset includes: a second sample surface image labeled with defect features;
[0064] Step S408: Determine the feature prediction network based on the second sample dataset.
[0065] In this embodiment, the MobileNet defect feature prediction network takes a severely defective image as input and outputs a two-dimensional matrix containing the center coordinates, area, and maximum damage value of the defect.
[0066] In the above embodiment, the generated defect severity image and the labeled defect severity image are simultaneously input into the discriminator network. Then, the discriminator and generator networks are trained separately using backpropagation. Finally, the generator network is trained to learn the method for labeling defect severity. Then, using the trained generator network, accurate defect severity images can be generated.
[0067] In some possible implementations, if the painted part is confirmed to be defective based on a surface image, the method further includes:
[0068] Based on defects on the front and / or back of the painted part, identify the spraying personnel information corresponding to the defective part.
[0069] Please see Figure 7 , Figure 7 This application provides a schematic diagram of the workflow of a method for detecting surface defects on a workpiece in an application scenario. The method can detect surface defects on a painted part through the following steps.
[0070] Preliminary identification stage of defective parts:
[0071] Step S1: The image acquisition module 10 (camera) is fixed on both sides of the production line conveyor chain. The front camera is responsible for acquiring the front image of the painted part, and the rear camera is responsible for acquiring the back image of the painted part.
[0072] Step S2: The front and back images of the sprayed parts are collected and transmitted in real time to the image recognition module 20 for surface defect detection under the control of the processing module 40.
[0073] Step S3: The image recognition module 20 uses a surface defect recognition algorithm to determine whether there are defects on the surface of the sprayed part.
[0074] Once the image recognition module 20 confirms that there are no defects on the surface of the painted part, it returns to step S1 to inspect other painted parts on the production line conveyor chain.
[0075] When the image recognition module 20 confirms that there is a defect on the surface of the painted part, the following steps are taken:
[0076] Defect location identification stage (taking defects on both sides as an example):
[0077] Step S4: Processing module 40 determines whether the sprayed part transmitted by image recognition module 20 has a double-sided defect or a single-sided defect.
[0078] One-sided defects:
[0079] Step S41: When the processing module 40 receives the front defect information, it only triggers the electronic switch on the front of the automatic identification module.
[0080] Step S42: When the processing module 40 receives the back defect information, it only triggers the electronic switch on the back of the automatic identification module.
[0081] Step S43: When the processing module 40 receives defect information from both sides, the front and back electronic switches of the automatic identification module are triggered.
[0082] Marking phase:
[0083] Step S51: The automatic identification module adds a front identification to the painted part corresponding to the front defect information.
[0084] Step S52: The automatic identification module adds a negative identification to the painted part corresponding to the defect information on the back side.
[0085] Step S53: The automatic identification module adds two-sided identification to the painted parts corresponding to the defect information on the front and back sides.
[0086] Please see Figure 8 , Figure 8 This application provides a structural block diagram of a workpiece surface defect detection device 600, which includes: a data acquisition module 610 and a detection module 620, wherein:
[0087] The acquisition module 610 is used to acquire surface images of the workpiece.
[0088] The detection module 620 is used to add a defect mark to the workpiece when the workpiece is confirmed to be a defective part based on the surface image, so as to inspect the workpiece based on the defect mark.
[0089] Further, the detection module 620 includes: a first detection module and a second detection module, wherein the surface image includes: a front image and a back image, and the defect identifier includes: a front identifier and a back identifier, wherein:
[0090] The first detection module is used to add a front-facing mark to the workpiece if it is confirmed to be a defective workpiece based on a front-facing image.
[0091] The second detection module is used to add a back-side mark to the workpiece if it is confirmed to be a defective part based on the back-side image.
[0092] Furthermore, the detection module 620 also includes: a confirmation module, wherein:
[0093] The confirmation module is used to input the surface image into a pre-established defect recognition model to determine whether the workpiece is a defective part.
[0094] Furthermore, the confirmation module includes: a first confirmation module, a second confirmation module, and a third confirmation module, wherein the defect identification model includes: a defect generation network and a feature prediction network.
[0095] The first confirmation module is used to input the surface image into the defect generation network and determine the color depth map corresponding to the surface image, wherein the color depth map is marked with the severity of the defect.
[0096] The second confirmation module is used to input the color depth map into the feature prediction network to determine the defect feature information of the workpiece.
[0097] The third confirmation module is used to determine whether the workpiece is a defective part based on the defect feature information.
[0098] Furthermore, the third confirmation module includes a fourth confirmation module and a fifth confirmation module, wherein the defect feature information includes the defect area and defect severity values, wherein:
[0099] The fourth confirmation module is used to determine whether the workpiece is a defective part based on the defect area and the area threshold.
[0100] The fifth confirmation module is used to determine whether the workpiece is a defective part based on the defect severity value and the non-conformance threshold; wherein, if the defect area is greater than the area threshold, the workpiece is determined to be a defective part, or if the defect severity value is greater than the non-conformance threshold, the workpiece is determined to be a defective part.
[0101] Furthermore, the confirmation module also includes: a first training module and a defect generation module, wherein:
[0102] The first training module is used to acquire a first training sample set, wherein each sample data in the first training sample set includes: a first sample surface image labeled with the degree of defect.
[0103] A defect generation module is used to determine the defect generation network based on the first training sample set.
[0104] Furthermore, the confirmation module also includes: a second training module and a feature prediction module, wherein:
[0105] The second training module is used to obtain the second sample dataset, in which each sample data includes: a second sample surface image labeled with defect features.
[0106] The feature prediction module is used to determine the feature prediction network based on the second sample dataset.
[0107] It should be noted that the device embodiments in this application correspond to the aforementioned method embodiments. The specific principles in the device embodiments can be found in the content of the aforementioned method embodiments, and will not be repeated here.
[0108] In the several embodiments provided in this example, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0109] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0110] Please see Figure 9 , Figure 9This is a structural block diagram of an electronic device 200 that can perform the above-described method for detecting surface defects of a workpiece, as provided in an embodiment of this application. The electronic device 200 may be a smartphone, tablet computer, computer, or portable computer.
[0111] The electronic device 200 also includes a processor 202 and a memory 204. The memory 204 stores programs that can execute the contents of the foregoing embodiments, and the processor 202 can execute the programs stored in the memory 204.
[0112] The processor 202 may include one or more cores for data processing and message matrix units. The processor 202 connects to various parts of the electronic device 200 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 204, and by calling data stored in the memory 204. Optionally, the processor 202 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 202 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem / decoder. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem is used for wireless communication. It is understood that the modem / decoder may also not be integrated into the processor and may be implemented separately through a communication chip.
[0113] Memory 204 may include random access memory (RAM) or read-only memory (ROM). Memory 204 can be used to store instructions, programs, code, code sets, or instruction sets. Memory 204 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., instructions for a user to obtain random numbers), instructions for implementing the various method embodiments described below, etc. The data storage area may also store data (e.g., random numbers) created by the terminal during use.
[0114] Electronic device 200 may also include a network module and a screen. The network module is used to receive and transmit electromagnetic waves, converting electromagnetic waves into electrical signals, thereby enabling communication with communication networks or other devices, such as audio playback devices. The network module may include various existing circuit elements used to perform these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, SIM cards, memory, etc. The network module can communicate with various networks such as the Internet, corporate intranets, and wireless networks, or communicate with other devices via wireless networks. The aforementioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The screen can display interface content and facilitate data interaction.
[0115] Please refer to Figure 10 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 700 stores program code 710, which can be called by a processor to execute the methods described in the above method embodiments.
[0116] Computer-readable storage media can be electronic storage devices such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, computer-readable storage media includes non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in a suitable form.
[0117] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the workpiece surface defect detection method described in the various optional implementations above.
[0118] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for detecting surface defects in a workpiece, characterized in that, The method includes: Acquire surface images of the workpiece; If the workpiece is confirmed to be defective based on the surface image, a defect mark is added to the workpiece so that the workpiece can be inspected based on the defect mark. The method further includes: inputting the surface image into a pre-established defect recognition model to determine whether the workpiece is a defective part; The defect identification model includes a defect generation network and a feature prediction network. The step of inputting the surface image into the pre-established defect identification model to determine whether the workpiece is a defective part includes: The surface image is input into a defect generation network to determine a color depth map corresponding to the surface image. The color depth map is an image that uses different colors to represent different defect degrees in different areas of the workpiece surface. The color depth map is input into a feature prediction network to determine the defect feature information of the workpiece; Based on the defect feature information, it is determined whether the workpiece is a defective part.
2. The method according to claim 1, characterized in that, The surface image includes a front image and a back image; the defect identifier includes a front identifier and a back identifier; and when the workpiece is confirmed to be defective based on the surface image, adding a defect identifier to the workpiece includes: If the workpiece is confirmed to be defective based on a frontal image, a frontal marking is added to the workpiece. If the workpiece is confirmed to be defective based on the back image, a back label is added to the workpiece.
3. The method according to claim 1, characterized in that, The defect feature information includes: defect area and defect severity values. Determining whether the workpiece is a defective part based on the defect feature information includes: Based on the defect area and area threshold, determine whether the workpiece is a defective part; and / or, Based on the defect severity value and the non-conformance threshold, it is determined whether the workpiece is a defective part; wherein, if the defect area is greater than the area threshold, the workpiece is determined to be a defective part, or if the defect severity value is greater than the non-conformance threshold, the workpiece is determined to be a defective part.
4. The method according to claim 1, characterized in that, The method further includes: Obtain a first training sample set, wherein each sample data in the first training sample set includes: a first sample surface image labeled with the degree of defect; The defect generation network is determined based on the first training sample set.
5. The method according to claim 1, characterized in that, The method further includes: Obtain a second sample dataset, wherein each sample in the second sample dataset includes: a second sample surface image labeled with defect features; The feature prediction network is determined based on the second sample dataset.
6. A device for detecting surface defects in a workpiece, characterized in that, The device includes: The acquisition module is used to acquire surface images of the workpiece; The detection module is used to add a defect mark to the workpiece when the workpiece is confirmed to be a defective part based on the surface image, so as to inspect the workpiece based on the defect mark; The detection module further includes a confirmation module, used to input the surface image into a pre-established defect recognition model to determine whether the workpiece is a defective part; The confirmation module includes: a first confirmation module, a second confirmation module, and a third confirmation module, wherein the defect identification model includes: a defect generation network and a feature prediction network; The first confirmation module is used to input the surface image into the defect generation network and determine the color depth map corresponding to the surface image. The color depth map is an image that uses different colors to represent different defect degrees in different areas of the workpiece surface. The second confirmation module is used to input the color depth map into the feature prediction network to determine the defect feature information of the workpiece; The third confirmation module is used to determine whether the workpiece is a defective part based on the defect feature information.
7. An electronic device, characterized in that, include: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the workpiece surface defect detection method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be called by one or more processors to execute the workpiece surface defect detection method as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and device for detecting surface defects of object
CN111696095A