PCB detection method and device, model training method, electronic equipment and storage medium
By using deep learning-based PCB inspection methods and OCR technology, indicator lights and codes in PCB images can be automatically identified, solving the problems of low efficiency and low accuracy of manual inspection and achieving efficient and accurate PCB quality inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2022-08-29
- Publication Date
- 2026-04-14
AI Technical Summary
Current PCB inspection relies on manual methods, which are inefficient and inaccurate, especially when dealing with small-font PCB coding, which is prone to errors.
A deep learning-based PCB inspection method is used to acquire PCB images through an image acquisition device, identify indicator lights and coding areas using a PCB inspection model, automatically identify the status of indicator lights and output the inspection results, and combine OCR model to identify PCB coding.
It automates PCB inspection, saves labor costs, and improves inspection efficiency and accuracy, especially in the accuracy of recognizing small font codes.
Smart Images

Figure CN115496714B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of PCB (Printed Circuit Board) inspection technology, and in particular to PCB inspection methods, devices, model training methods, electronic devices and media based on deep learning. Background Technology
[0002] PCBs are core components in electronic products, and the testing and monitoring of PCB board quality is an essential part of the production process. In some scenarios, PCB quality problems can be identified by the combination of indicator light colors and text. Currently, existing technologies mainly rely on manual methods for PCB defect detection. On the one hand, with social development, labor costs are high; on the other hand, manual inspection is inefficient and lacks accuracy. Summary of the Invention
[0003] This disclosure provides a method, apparatus, electronic device, storage medium, and training method for PCB inspection quality.
[0004] According to a first aspect of this disclosure, a PCB inspection method is provided, comprising:
[0005] Obtain the target image of the PCB;
[0006] The PCB inspection model is used to identify the area where the indicator lights are located in the target image.
[0007] The status of the indicator light is identified based on the area where the indicator light is located, and the PCB is detected based on the status of the indicator light, and a detection result indicating whether the PCB is abnormal is output.
[0008] According to a second aspect of this disclosure, a training method for a PCB inspection model is provided, for training a PCB inspection model, wherein the PCB inspection model is applied to the PCB inspection method described in the above technical solution, and the training method includes:
[0009] Acquire image data of the PCB;
[0010] The image data is labeled to form training samples;
[0011] A PCB detection model is trained based on the training samples.
[0012] According to a third aspect of this disclosure, a PCB inspection apparatus is provided, comprising:
[0013] The acquisition module is configured to acquire the target image of the PCB.
[0014] The first position detection module is configured to identify the area where the indicator light is located in the target image through a PCB detection model;
[0015] The PCB inspection module is configured to identify the state of the indicator light based on the area where the indicator light is located, and to inspect the PCB based on the state of the indicator light, and output an inspection result indicating whether the PCB is abnormal.
[0016] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the PCB inspection methods or model training methods described above.
[0017] According to a fifth aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the PCB inspection method or model training method according to any one of the above technical solutions.
[0018] According to a sixth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the PCB inspection method or model training method according to any one of the above technical solutions.
[0019] This disclosure provides a method, apparatus, electronic device, storage medium, and training method for PCB inspection models. It can automatically identify the status of indicator lights in PCB images and detect whether there are quality problems on the PCB based on the status of the indicator lights, replacing manual inspection methods, saving labor costs, and improving inspection efficiency and accuracy.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0021] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0022] Figure 1 This is a schematic diagram of the steps of the first PCB inspection method in the embodiments of this disclosure;
[0023] Figure 2 This is a schematic flowchart of the PCB inspection method in the embodiments of this disclosure;
[0024] Figure 3This is a schematic diagram of the steps of the second PCB inspection method in the embodiments of this disclosure;
[0025] Figure 4 This is a PCB encoding where the text direction is horizontal in this embodiment of the disclosure;
[0026] Figure 5 This is a PCB encoding where the text direction is vertical in this embodiment of the disclosure;
[0027] Figure 6 This is a schematic diagram of the steps of the PCB detection model training method in the embodiments of this disclosure;
[0028] Figure 7 This is a schematic block diagram of the first type of PCB inspection device in the embodiments of this disclosure;
[0029] Figure 8 This is a schematic block diagram of the second type of PCB inspection device in the embodiments of this disclosure;
[0030] Figure 9 This is a block diagram illustrating the principle of the encoding and recognition module in this embodiment of the disclosure;
[0031] Figure 10 This is a schematic block diagram of an example electronic device in an embodiment of this disclosure. Detailed Implementation
[0032] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0033] The surface of a PCB board includes indicator lights and PCB coding, which are usually located in the same area. During manual inspection, workers need to use the color of the indicator lights to determine if there are quality problems with the PCB. For example, if there is a problem with a component or connection on the PCB, the indicator light will turn red, while a normal PCB will turn green. After workers identify any abnormal PCBs, they also need to record the abnormal PCB coding. However, because human working conditions are not constantly stable, this manual method is often inefficient and prone to errors, especially when the font of the PCB coding is small, making it easy to record incorrectly and affecting the accuracy of PCB inspection.
[0034] To address the aforementioned technical problems, this disclosure provides a PCB inspection method, such as... Figure 1 The following are included:
[0035] Step S101: Obtain the target image of the PCB, such as... Figure 2 As shown, the target image can be an image obtained by using an image acquisition device (such as a camera) to capture an image of the side of the PCB with indicator lights, and the target image includes the indicator lights of the PCB.
[0036] Step S102: Identify the area where the indicator light is located in the target image using the PCB inspection model. After acquiring the target image, which includes a complete image of the PCB surface, this disclosure only requires identification of the area where the indicator light is located on the PCB. The position of the indicator light can be determined first in the target image, and the area where the indicator light is located can be cropped out to eliminate interference from other pixels, so as to accurately identify the status of the indicator light.
[0037] Step S103: Identify the state of the indicator light based on its location, and perform PCB inspection based on the indicator light's state, outputting a detection result indicating whether the PCB is abnormal. For example, an indicator light typically has two states: when the PCB is normal, the indicator light displays a first color, which could be green; when the PCB is abnormal, the indicator light displays a second color, which could be red. Identifying the indicator light's state can be done by identifying its color, detecting whether the PCB is abnormal based on the indicator light's color, and outputting the corresponding detection result.
[0038] For example, in this embodiment, the PCB image captured by the camera is first acquired, the position of the indicator light in the PCB image is determined, the PCB image is cropped to obtain the image of the area where the indicator light is located, and then the color of the indicator light is identified by the image of the area where the indicator light is located. If the indicator light is red, the detection result of PCB anomaly is output. Through the above technical solution, the PCB detection model can realize automatic PCB detection, replacing the manual inspection method, saving labor costs, and improving detection efficiency and accuracy.
[0039] As another alternative implementation method, such as Figure 3 As shown, PCB inspection methods include:
[0040] Step S301: Obtain the target image of the PCB, such as... Figure 2 As shown, the target image can be an image obtained by using an image acquisition device to capture an image of the side of the PCB with indicator lights and PCB codes. The target image includes the indicator lights and PCB codes of the PCB.
[0041] Step S302: Identify the area where the indicator light is located in the target image using the PCB inspection model, and identify the area where the PCB code is located in the target image. After acquiring the target image, the target image includes a complete image of the PCB surface, but this disclosure mainly identifies the areas where the indicator light and PCB code are located. The positions of the indicator light and PCB code can be identified first in the target image, and then the areas where the indicator light and PCB code are located can be cropped out. Figure 2 The image obtained after target detection (shown) eliminates interference from other pixels, enabling accurate identification of the indicator light's status and PCB code. In step S302, identifying the area where the indicator light is located and identifying the area where the PCB code is located can be performed simultaneously, for example... Figure 2 The indicator light and PCB code are located in the same area. If the indicator light and PCB code are not in the same area, they can be identified separately. The order of identification is not important; you can identify the indicator light first or the PCB code first.
[0042] Step S303: Identify the state of the indicator light based on its location, and inspect the PCB based on the indicator light's state, outputting a detection result indicating whether the PCB is abnormal. For example, indicator lights typically have two states: green when the PCB is normal, and red when the PCB is abnormal. Identifying the indicator light's state can be done by identifying its color, and determining whether the PCB is abnormal based on the color of the indicator light.
[0043] Step S304: In response to the PCB anomaly detected in step S303, the PCB code is identified and output based on the area where the PCB code is located. For example, if the indicator light is red in step S303, indicating a PCB anomaly, then the PCB code will continue to be identified. If the PCB is detected as normal, the PCB code will no longer be identified, thus improving the efficiency of the detection.
[0044] In this embodiment, the PCB detection model not only detects the position of the indicator light, but also the position of the PCB code. When the indicator light indicates a PCB abnormality, the PCB detection model further identifies the PCB code and outputs it. The detection system can automatically record the abnormal PCB code.
[0045] As an optional implementation, the PCB is inspected based on the status of the indicator lights, and the output of the inspection result indicating whether the PCB is abnormal includes: determining that the PCB is abnormal in response to the indicator light displaying a first color; and determining that the PCB is not abnormal in response to the indicator light displaying a second color. This disclosure primarily uses the color displayed by the indicator lights to detect the quality of the PCB. The color of the indicator lights is not limited to red or green and can be set according to actual needs.
[0046] As an optional implementation, before identifying the PCB code based on the area where the PCB code is located in step S304, the method further includes: pixel filling of the area where the PCB code is located. In this embodiment, an OCR (optical character recognition) model can be used to identify the PCB code. Figure 2 As shown, because the target image was cropped after object detection, the resulting cropped image is too small for the OCR model to recognize. Scaling the area containing the PCB coding might distort the text, affecting the accuracy of text recognition. Therefore, black pixels can be added around the PCB coding area to increase the image size. For example, if the original image is 30*70 pixels, it can be padded to 300*300 pixels to ensure the OCR model can recognize the image without text distortion.
[0047] As an optional implementation, in step S304, identifying the PCB code based on the area where the PCB code is located includes:
[0048] The text arrangement direction of the PCB code is detected based on the area where the PCB code is located, such as Figure 4 and Figure 5 As shown, the PCB coding can be arranged horizontally or vertically. Before recognizing the text content, the text direction is recognized first, and then the content is recognized after the text direction is determined.
[0049] This method identifies the text information corresponding to PCB codes based on the text arrangement direction. Because PCB designs vary greatly, the arrangement of codes can differ, being either horizontal or vertical. If the identified text is... Figure 4 The text content is then identified based on the horizontal direction shown; if the identified text is... Figure 5 As shown in the vertical direction, text content is recognized based on the vertical direction, thereby achieving multi-directional text detection.
[0050] This disclosure also provides a training method for a PCB inspection model, used to train the PCB inspection model, which is applied to the PCB inspection method described in any of the above embodiments, such as... Figure 6 As shown, the training methods include:
[0051] Step S601: Obtain image data of the PCB. Image data of the PCB surface can be acquired by an image acquisition device.
[0052] Step S602 involves labeling the image data to form training samples. Data labeling involves processing the acquired raw data to make it usable by machine learning. The specific content of the data labeling needs to be set based on the application scenario of the model. For example, if the model needs to identify the location of text, the corresponding locations of the text need to be labeled so that the machine can learn based on the image data and the labels.
[0053] Step S603: Train the PCB detection model based on the training samples. In the above steps, the training samples were obtained through data annotation, and then the training samples were input into the initial model to train the final PCB detection model.
[0054] As an optional implementation, data annotation of image data to form training samples includes: annotating the positions of indicator lights and PCB codes in the image data to form first annotation information, such as... Figure 2 As shown, the areas where the indicator lights and PCB codes are located can be marked with rectangles. The first annotation information can be the coordinates of the four vertices of the rectangle. The status of the indicator lights in the image data is then labeled to form the second annotation information: red is labeled as red, and green is labeled as green. The machine learns how to classify indicator lights during subsequent training. The position and text information of the PCB codes in the image data are then labeled to form the third annotation information, which can include the coordinates of the PCB codes and the corresponding text content, such as... Figure 2 If the PCB code is "YZ80", then the text information "YZ80" is displayed. Training samples are formed based on the first annotation information, the second annotation information, the third annotation information, and the image data.
[0055] As an optional implementation, the PCB inspection model may include a first sub-model, a second sub-model, and a third sub-model. The PCB inspection model trained based on training samples includes:
[0056] The first sub-model is trained based on the first annotation information and image data. The first sub-model can be a target detection model, which is used to identify the area where the indicator light is located and the area where the PCB code is located. After finding the location of the indicator light and the PCB code, the state of the indicator light is classified and the PCB code is identified.
[0057] The second sub-model is trained based on the second annotation information and image data. The second sub-model can be a classification model used to identify the status of the indicator light. It can classify the color of the indicator light and detect whether the PCB is abnormal by the color of the indicator light.
[0058] A third sub-model is trained based on the third annotation information and image data. This third sub-model can be a text recognition model; in this embodiment, an OCR model is used for recognition, specifically to identify the area where the PCB coding is located and the corresponding text information. During the training process of the PCB detection model, padding can be used. That is, before the OCR model recognizes the data, the image processed by the target detection model is padded with black pixels around the area where the PCB coding is located to facilitate OCR model recognition and improve detection accuracy.
[0059] This disclosure also provides a PCB inspection device, such as Figure 7 As shown, it includes:
[0060] The acquisition module 701 is configured to acquire a target image of the PCB. The target image can be an image obtained by using an image acquisition device (e.g., a camera) to capture an image of the side of the PCB with indicator lights. The target image includes the indicator lights of the PCB.
[0061] The first position detection module 702 is configured to identify the area where the indicator light is located in the target image using a PCB inspection model. After acquiring the target image, which includes a complete image of the PCB surface, this disclosure only requires identification of the area where the indicator light is located on the PCB. Therefore, the position of the indicator light can be determined first in the target image, and the area where the indicator light is located can be cropped out. Figure 2 As shown in the image, interference from other pixels is eliminated to accurately identify the status of the indicator light.
[0062] The PCB inspection module 703 is configured to identify the state of an indicator light based on its location, and to inspect the PCB based on the indicator light's state, outputting a detection result indicating whether the PCB is abnormal. For example, an indicator light typically has two states: when the PCB is normal, the indicator light displays a first color, which could be green; when the PCB is abnormal, the indicator light displays a second color, which could be red. Identifying the indicator light's state can be done by identifying its color, detecting whether the PCB is abnormal based on the indicator light's color, and outputting the corresponding detection result.
[0063] For example, in this embodiment, the PCB image captured by the camera is first acquired, the position of the indicator light in the PCB image is determined, the PCB image is cropped to obtain the image of the area where the indicator light is located, and then the color of the indicator light is identified by the image of the area where the indicator light is located. If the indicator light is red, the detection result of PCB abnormality is output. Through the above technical solution, the PCB inspection device can realize automatic PCB inspection, replacing the manual inspection method, saving labor costs, and improving inspection efficiency and accuracy.
[0064] As an optional implementation method, such as Figure 8 As shown, the device also includes:
[0065] The second position detection module 704 is configured to identify the area where the PCB code is located in the target image through a PCB detection model. Since the acquired target image includes a complete image of the PCB surface, but this disclosure mainly identifies the area where the indicator light and PCB code are located, the positions of the indicator light and PCB code can be detected in the target image first, the area where the indicator light and PCB code are located can be cropped out, and interference from other pixels can be eliminated, so as to accurately identify the status of the indicator light and the PCB code.
[0066] The code recognition module 705 is configured to, after the PCB detection module outputs a detection result indicating whether the PCB is abnormal, recognize and output the PCB code based on the area where the PCB code is located, in response to the detection result indicating a PCB abnormality. For example, PCB code recognition will only continue if the indicator light is detected to be red.
[0067] As an optional implementation, the PCB inspection device further includes a pixel filling module, configured to fill the area containing the PCB code with pixels before the code recognition module 705 recognizes the PCB code based on the area where the PCB code is located. Specifically, an OCR model can be used to recognize the PCB code. Figure 2 As shown, because the target image is cropped after object detection, the resulting cropped image is small, and the OCR model may not be able to recognize the text. Scaling the image may distort the text, thus affecting the accuracy of text recognition. Therefore, black pixels can be filled around the area containing the PCB coding to increase the image size, ensuring the OCR model can recognize the image without text distortion.
[0068] As an optional implementation method, such as Figure 9 As shown, the encoding and recognition module 705 includes:
[0069] The text direction detection unit 7051 is configured to detect the text arrangement direction of the PCB code based on the area where the PCB code is located, such as... Figure 4 and Figure 5 As shown, the PCB coding can be arranged horizontally or vertically. Before recognizing the text content, the text direction is recognized first, and then the content is recognized after the text direction is determined.
[0070] The text information recognition unit 7052 is configured to recognize the text information corresponding to PCB codes based on the text arrangement direction. Because PCB designs vary widely, the arrangement of codes may differ, being either horizontal or vertical. If the recognized text is... Figure 4 The text content is then identified based on the horizontal direction shown; if the identified text is... Figure 5 As shown in the vertical direction, text content is recognized based on the vertical direction, thereby achieving multi-directional text detection.
[0071] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0072] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0073] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0074] like Figure 10 As shown, device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1002 or a computer program loaded into random access memory (RAM) 1003 from storage unit 1008. The RAM 1003 may also store various programs and data required for the operation of device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.
[0075] Multiple components in device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, etc.; output unit 1007, such as various types of monitors, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0076] The computing unit 1001 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning objective function algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as PCB inspection methods or model training methods. For example, in some embodiments, the PCB inspection method or model training method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the PCB inspection method or model training method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform a PCB inspection method or a model training method by any other suitable means (e.g., by means of firmware).
[0077] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0078] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0079] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0080] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0081] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0082] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0083] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0084] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for inspecting printed circuit boards (PCBs), comprising: Acquire a target image of the PCB. The target image is an image obtained by using an image acquisition device to capture an image of the side of the PCB with indicator lights and PCB coding. The target image includes the indicator lights and PCB coding of the PCB. The PCB inspection model identifies the area where the indicator light is located in the target image and the area where the PCB code is located in the target image. Cut out the area where the indicator light is located and the area where the PCB code is located; The status of the indicator light is identified based on the area where the indicator light is located, and the PCB is detected based on the status of the indicator light, and a detection result indicating whether the PCB is abnormal is output; In response to the detection result indicating that the PCB is abnormal, the area where the PCB code is located is filled with pixels, and the PCB code is identified and output based on the area where the PCB code is located using an optical character model.
2. The method according to claim 1, wherein, The step of detecting the PCB based on the status of the indicator light and outputting a detection result indicating whether the PCB is abnormal includes: In response to the indicator light displaying a first color, a PCB malfunction is determined; In response to the indicator light displaying a second color, it is determined that the PCB is not abnormal.
3. The method according to claim 1, wherein, The step of identifying the PCB code based on the region where the PCB code is located includes: Based on the area where the PCB code is located, the text arrangement direction of the PCB code is detected; Based on the text arrangement direction, the text information corresponding to the PCB code is identified.
4. A training method for a PCB inspection model, used to train a PCB inspection model, wherein the PCB inspection model is applied to the PCB inspection method according to any one of claims 1-3, the training method comprising: Acquire image data of the PCB; The image data is labeled to form training samples; The PCB detection model is trained based on the training samples.
5. The training method according to claim 4, wherein, The step of annotating the image data to form training samples includes: The positions of the indicator lights and PCB codes in the image data are marked to form the first annotation information; The status of the indicator lights in the image data is annotated to form second annotation information; The text information of the PCB code in the image data is annotated to form third annotation information; The training samples are formed based on the first annotation information, the second annotation information, the third annotation information, and the image data.
6. The training method according to claim 5, wherein, The PCB detection model includes a first sub-model, a second sub-model, and a third sub-model; the PCB detection model trained based on the training samples includes: The first sub-model is trained based on the first annotation information and the image data. The first sub-model is used to identify the area where the indicator light is located and the area where the PCB code is located. The second sub-model is trained based on the second annotation information and the image data, and the second sub-model is used to identify the state of the indicator light. The third sub-model is trained based on the third annotation information and the image data, and the third sub-model is used to recognize the corresponding text information.
7. A PCB inspection device, comprising: The acquisition module is configured to acquire a target image of the PCB. The target image is an image obtained by using an image acquisition device to capture an image of the side of the PCB with indicator lights and PCB codes. The target image includes the indicator lights and PCB codes of the PCB. The first position detection module is configured to identify the area where the indicator light is located in the target image through a PCB detection model; The second position detection module is configured to identify the PCB code area in the target image through the PCB detection model, and to crop out the area where the indicator light is located and the area where the PCB code is located. The PCB inspection module is configured to identify the state of the indicator light based on the area where the indicator light is located, and to inspect the PCB based on the state of the indicator light, and output an inspection result indicating whether the PCB is abnormal; The encoding recognition module is configured to, in response to the detection result indicating that the PCB is abnormal, fill the area where the PCB encoding is located with pixels, and recognize the PCB encoding based on the area where the PCB encoding is located using an optical character model and output it.
8. The apparatus according to claim 7, wherein, The PCB inspection module inspects the PCB based on the status of the indicator lights and outputs inspection results indicating whether the PCB is abnormal, including: In response to the indicator light displaying a first color, a PCB malfunction is determined; In response to the indicator light displaying a second color, it is determined that the PCB is not abnormal.
9. The apparatus according to claim 7, wherein, The encoding and recognition module includes: The text direction detection unit is configured to detect the text arrangement direction of the PCB code based on the area where the PCB code is located; The text information recognition unit is configured to recognize the text information corresponding to the PCB code based on the text arrangement direction.
10. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3 or 4-6.
11. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-3 or 4-6.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-3 or 4-6.
Citation Information
Patent Citations
Fault equipment monitoring method, device and apparatus and computer storage medium
CN112073682A
Method for automatically detecting equipment state operation
CN112395928A