Component angle-based classification method and system using classification model

Through the component angle classification method based on the classification model, and using deep learning technology, the problem that the automatic defect classification system cannot detect the polar components angle of the printed circuit board is solved, and the accurate identification and detection of the polar components angle on the printed circuit board is achieved to ensure that the component pins are installed correctly.

WO2025124568A1PCT designated stage expired Publication Date: 2025-06-19CHENGDU UNION BIG DATA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/139317
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-14
Filing Date
2024-12-13
Publication Date
2025-06-19

AI Technical Summary

Technical Problem

In the field of printed circuit board component detection, the automatic defect classification system cannot effectively detect the angle of polar components, resulting in the inability to determine whether the pin installation of the components is correct.

Method used

The component angle classification method based on the classification model is adopted, and the printed circuit board template information is collected, the data set is constructed, and the polar component information is cropped and marked. The angle detection model is obtained by deep learning, and component angle detection is performed.

Benefits of technology

It realizes accurate identification of the angles of polar components on the printed circuit board, ensures that the pins of components are installed correctly, improves detection accuracy, and reduces the complexity of the automatic defect classification system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024139317_19062025_PF_FP_ABST
    Figure CN2024139317_19062025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of component inspection of printed circuit boards, and discloses a component angle-based classification method and system using a classification model. The system comprises a first construction unit, a second construction unit, a third construction unit, a generation unit, an obtaining unit and a detection unit. The method is applied to the system, and the method comprises: acquiring printed circuit board template information, wherein the information comprises a first data set, a second data set, a third data set and a label data set; obtaining an angle detection model by means of deep learning by using the first data set, the second data set, the third data set and the label data set; and by means of the angle detection model, performing component angle detection on a polar component of a printed circuit board to be inspected on a production line. By means of the above method, angle detection of polar components on printed circuit boards can be implemented, and it can be determined whether there is a situation where pins of the polar components are connected incorrectly, and the deficiencies of an automatic defect classification system can be addressed.
Need to check novelty before this filing date? Find Prior Art

Description

A component angle classification method and system based on classification model

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This disclosure claims priority to Chinese patent application number 202311713521.7 filed with the Chinese Patent Office on December 14, 2023, entitled “A method and system for component angle classification based on classification model,” the entire contents of which are incorporated by reference into this disclosure. Technical Field

[0003] The present disclosure relates to the technical field of printed circuit board component detection, and in particular to a component angle classification method based on a classification model. Background Art

[0004] Industrial manufacturing processes can produce a variety of defects due to process fluctuations, machine differences, and other factors, requiring industrial manufacturers to utilize significant manpower to identify and classify product defects. In the Industry 2.0 era, a growing number of electronics manufacturers are adopting automated defect classification systems to replace manual defect classification. These systems, based on artificial intelligence algorithms like machine vision and image recognition, provide automated defect detection and classification services. They can quickly identify and classify numerous types of product defects, such as missing or damaged components. However, in the field of printed circuit board (PCB) inspection, many plug-in components have polarity issues. Inserting them backwards or at 90 / 270 degrees can cause PCB anomalies. Using only automated defect classification systems to inspect components can detect missing or broken components, but it cannot meet the requirements for detecting angles of components of varying polarity.

[0005] Application Contents

[0006] The purpose of the present disclosure is to provide a component angle classification method based on a classification model to solve the problem in the field of printed circuit board component detection technology that only using an automatic defect classification system cannot meet the requirements for polarity component angle detection.

[0007] To achieve the above objectives, the present disclosure adopts the following technical solutions:

[0008] A component angle classification method based on a classification model, the method comprising the following steps:

[0009] S1. Collecting printed circuit board template information, wherein the printed circuit board template information includes component coordinate position information and component information corresponding to the coordinates, and constructing a first data set based on the printed circuit board template information;

[0010] S2. Determine whether a component has polarity based on the component information in the printed circuit board template information, divide the component information of the printed circuit board template into polar component information and non-polar component information based on the determination result, and construct a second data set based on the polar component information, wherein the polar component information includes component polarity identification information containing angle information, and the printed circuit board template information includes angle information of the polar components, and the angle information includes angles of 0°, 90°, 120°, 180°, 240°, and 270°.

[0011] S3. Based on the second data set, the polar component information is trimmed into a plurality of individual polar component information including only complete information of one polar component, and a third data set is constructed based on all the individual polar component information, where the angle in the individual polar component information is one of the angle information in S2;

[0012] S4. Based on the third data set, use the angle information in the polarity identifier as a characteristic value, label the components of the same polarity category with the same angle information characteristic value, and generate a corresponding label data set;

[0013] S5. Based on a deep learning approach, obtain an angle detection model using the first data set, the second data set, the third data set, and the label data set;

[0014] S6. Based on the angle detection model, perform component angle detection on the polarity components of the printed circuit board to be inspected on the production line.

[0015] The automatic defect classification system can detect production defects such as missing or damaged components on printed circuit boards. Compared with manual detection, it is more efficient. However, the automatic defect classification system cannot detect whether there are any errors in the insertion of polar components on the printed circuit board. The present disclosure distinguishes the insertion method of components by angle, and detects whether the pins of the components are installed correctly by judging the angle of the polar components. By adopting the above method, the angle information of each polar component is cut out from the printed circuit board template, and each polar component is classified according to the same type and the same angle. Using the various collected data sets, based on the deep learning method, an angle detection model is obtained. The detection model is used to detect the printed circuit boards on the production line, thereby realizing the recognition of the angles of each polar component on the printed circuit board and determining whether each polar component is installed correctly. At the same time, the method can also directly utilize the artificial intelligence algorithm technology such as machine vision and image recognition of the automatic defect classification system itself to reduce the complexity of the automatic defect classification system itself and improve coupling.

[0016] Optionally, before performing the component angle detection in step S6, the following steps are further included:

[0017] Detect whether any polarity components on the printed circuit board to be inspected are missing or damaged.

[0018] The prerequisite for component angle detection is that the polarity components to be detected are present and complete. Therefore, before performing component angle detection on polarity components, the components should be inspected for missing or damaged conditions to ensure that the polarity component information obtained from the printed circuit board to be detected is complete, so as to avoid affecting the subsequent test results.

[0019] Optionally, the printed circuit board template information in step S1 also includes the substrate coordinate position information of the printed circuit board template. Obtaining the substrate information of the printed circuit board template is used to position the printed circuit board and provide necessary data for subsequent information correction of the printed circuit board.

[0020] Optionally, the method further includes collecting missing information of the printed circuit board template, specifically comprising the following steps:

[0021] A1. Collect polarity identification information of each polar component in an independent state in a printed circuit board template and construct a first comparison data set, where the first comparison data set includes angle information of each polar component;

[0022] A2. Obtain polarity identification information in the printed circuit board template information and construct a second comparison data set;

[0023] A3. Compare the second comparison data set with the first comparison data set to obtain a comparison result. When the comparison result indicates that the angle information of the second comparison data set is missing information, assign an information-missing label to the corresponding polarity components with missing information in the comparison result, and generate a labeling file for the polarity components with the information-missing label in the printed circuit board template information.

[0024] When collecting information on a printed circuit board (PCB), the device used to collect information is usually a camera with a camera function. This type of device is generally fixed in a certain position. Due to the fixed shooting angle, some small polar components may be blocked by larger components, resulting in missing information on the collected polar components, affecting the integrity of the acquired data set. Through the above steps, based on the PCB template, it is determined whether there are some polar components on the template that are blocked due to component height or size, resulting in the information collection device being unable to obtain complete information. If so, the coordinate information of the blocked polar components is obtained and marked as missing information to facilitate subsequent information completion processing.

[0025] Optionally, before performing the component angle detection in step S6, the following steps are further included:

[0026] Acquire information of a printed circuit board to be inspected, construct first information of the printed circuit board to be inspected based on the information of the printed circuit board to be inspected, wherein the information of the printed circuit board to be inspected is information required for component angle detection, perform positioning correction based on substrate coordinate information of the printed circuit board to be inspected to obtain information of a second printed circuit board to be inspected, wherein the second information of the printed circuit board to be inspected is actual information to be inspected of the printed circuit board to be inspected, and the positioning correction includes correction of the first information of the printed circuit board to be inspected and correction of information of each polarity component in the first information of the printed circuit board to be inspected.

[0027] Through the above steps, before the angle information of the printed circuit board to be tested is detected, the information of the printed circuit board to be tested is first corrected to ensure that the information obtained from the printed circuit board to be tested can be used normally for detection and the detection results will not be affected by the placement of the printed circuit board or the obstruction of polarity components.

[0028] Optionally, the positioning correction includes the following steps:

[0029] B1. Acquire coordinate information of a first printed circuit board to be inspected to construct a first coordinate information set, wherein the coordinate information includes substrate coordinate information of the first printed circuit board to be inspected and coordinate information of polar components on the substrate;

[0030] B2. Acquire the printed circuit board template coordinate information corresponding to the first printed circuit board information to be detected to construct a second coordinate information set, wherein the coordinate information includes the substrate coordinate information of the printed circuit board template and the coordinate information of polar components on the substrate;

[0031] B3. Verify and compare the first coordinate information set and the second coordinate information set to obtain a verification result, determine a coordinate deviation between the first circuit board to be inspected and the corresponding printed circuit board template based on the verification result, and perform repair and correction on the first printed circuit board information to be inspected based on the coordinate deviation, wherein the repair and correction is used to adjust the coordinate information of the first circuit board to be inspected to be consistent with the coordinate information of the corresponding printed circuit board template, and replace the first printed circuit board information to be inspected with the repaired and corrected information;

[0032] B4. Upon completion of step B3, when it is detected that a marking file exists for the printed circuit board template information corresponding to the first printed circuit board information to be inspected, an information completion operation is performed on the polarity components with missing information markings in the marking file. Based on the information completion operation, a second printed circuit board to be inspected is obtained. The information completion operation is used to complete the polarity component information that cannot be fully collected due to occlusion.

[0033] Before performing component angle detection, image positioning and error correction are performed to ensure that the acquired image of the circuit board to be detected is consistent with the angle, direction, and size of the template, and then the detection is carried out. Based on the coordinate information of the printed circuit board to be detected and the coordinate information of the printed circuit board template to which it corresponds, the substrate information of the printed circuit board to be detected and the information of each polar component on the substrate are corrected. The substrate information correction is to adjust the acquired image of the printed circuit board to be detected so that the coordinates coincide with those of its template and the direction is consistent. The information correction of each polar component is to correct the information of each polar component on the adjusted printed circuit board to ensure that its angle and shape are consistent with the angle and shape of the polar component on its corresponding template, and finally obtain the polar component information that meets the component angle detection conditions.

[0034] Optionally, the information completion operation in step B4 includes the following steps:

[0035] B401. Obtaining coordinate position information of polar components with information missing annotations through the annotation file, and transmitting the coordinate position information to an information collection device;

[0036] B402. The information collection device moves to a position directly above the polar component with the information missing mark, collects information of the polar component with the information missing mark under the viewing angle state and marks it as polarity identification correction information, and constructs a polarity identification correction data set based on the polarity identification correction information;

[0037] B403. Use the polarity identification correction data set to replace the polarity identification information of the first polarity component information to be detected, complete the information completion, and obtain the second printed circuit board information to be detected after the information completion.

[0038] When the printed circuit board to be inspected has missing information markings after inspection, it is necessary to complete the missing information. The coordinate information of the polarity component is used to determine the coordinate position of the polarity component with the missing information marking, and the information acquisition device is moved to the top of the polarity component according to the coordinate position of the polarity component. By adjusting the viewing angle of the data acquisition device to obtain the polarity component information, the complete information of the obscured polarity component is obtained to ensure the accuracy of the polarity component information used for angle detection.

[0039] Optionally, the first, second, third, and label datasets do not contain information about the non-polar components. When training a model and using the model for detection, the more data collected, the lower the efficiency of model training and detection, provided the execution logic remains unchanged. The purpose of not acquiring information about non-polar components is to reduce data dimensionality, streamline the data structure used for detection model training, avoid unnecessary data redundancy, and improve detection model training efficiency.

[0040] Optionally, when the polarity identification information obtained in step B402 is still missing, step B402 further includes the following steps:

[0041] C1. Obtain the missing polarity identification information, crop the occlusion area information and obtain the occlusion area coordinate information, and construct a third comparison data set based on the occlusion area information and the occlusion area coordinate position information;

[0042] C2. Obtain printed circuit board template information corresponding to the second printed circuit board to be inspected, obtain polarity identification information and coordinate information of the printed circuit board template information, and construct a fourth comparison data set based on the polarity identification information and coordinate information of the printed circuit board template information;

[0043] C3. Compare the third comparison data set with the fourth comparison data set, locate an information region in the fourth comparison data set whose coordinates are consistent with the coordinates of the occlusion region in the third comparison data set, overwrite the information of the information region with the occlusion region information, and construct second angle information based on the fourth comparison data set after the information overlay is completed;

[0044] C4. When performing angle detection on the polarity identification information that is missing, the angle information used is the second angle information.

[0045] When performing component angle detection, if the polarity components on the printed circuit board still cannot obtain complete information after the information completion operation, the above steps are used to directly discard the occlusion area information and use local features to perform angle detection on the printed circuit board.

[0046] Optionally, the method further includes:

[0047] S7. Obtain the test results after the angle detection, and return the test results to the production and manufacturing system. The test results include qualified test result information and unqualified test result information. The unqualified test result information includes the angle detection status of each component of the printed circuit board and rework suggestions.

[0048] Through the above step S7, the production module is associated with the detection module, and the production system can be adjusted in time according to the detection feedback.

[0049] To achieve the above-mentioned object of the invention, the present disclosure further provides a component angle classification system based on a classification model, the system comprising:

[0050] A first constructing unit is configured to collect printed circuit board template information, wherein the printed circuit board template information includes component coordinate position information and component information corresponding to the coordinates, and construct a first data set based on the printed circuit board template information;

[0051] a second constructing unit configured to determine whether a component has polarity based on component information in the printed circuit board template information, divide the component information of the printed circuit board template into polar component information and non-polar component information based on the determination result, and construct a second data set based on the polar component information, wherein the polar component information includes component polarity identification information including angle information, the printed circuit board template information includes angle information of the polar component, and the angle information includes angles of 0°, 90°, 120°, 180°, 240°, and 270°;

[0052] a third constructing unit configured to, based on the second data set, trim the polar component information into a plurality of individual polar component information pieces each containing complete information of only one polar component, and construct a third data set based on all the individual polar component information pieces, wherein the angle in the individual polar component information piece is one of the angle information pieces in S2;

[0053] a generating unit configured to, based on the third data set, use the angle information in the polarity identifier as a characteristic value, label components of the same polarity category with the same angle information characteristic value, and generate a corresponding label data set;

[0054] An obtaining unit is configured to obtain an angle detection model using the first data set, the second data set, the third data set, and the label data set in a deep learning-based manner;

[0055] The detection unit is configured to perform component angle detection on polarity components of a printed circuit board to be detected on a production line based on an angle detection model.

[0056] One or more technical solutions provided by the present disclosure have at least the following technical effects or advantages:

[0057] Based on the angle detection model obtained through deep learning, the angle detection of polarity components on the printed circuit boards produced on the production line can be performed. It can be determined whether the polarity components on the printed circuit boards being tested have pin connection errors during installation. At the same time, when used in conjunction with the automatic defect classification system, it can make up for the problem that the automatic defect classification system cannot meet the angle detection requirements of various polarity components.

[0058] In a component angle classification method based on a classification model provided by the present disclosure, information correction is first performed before angle detection of a printed circuit board to be detected. The information correction includes information correction of the substrate of the printed circuit board to be detected and information correction of polarity components on the printed circuit board to be detected. By performing information correction, information collection errors caused by incorrect placement angle of the substrate of the printed circuit board to be detected or obstruction of polarity components can be avoided, thereby improving detection accuracy. At the same time, in the case where complete information cannot be obtained by changing the viewing angle of the information collection device, detection is directly performed by directly obtaining local information of the obscured components, thereby ensuring normal angle detection.

[0059] By feeding back the test information to the production system after the test is completed and providing rework suggestions for problematic test results, we can achieve an effective combination of testing and production, forming a closed production loop. Providing rework suggestions allows production personnel to quickly locate problem points and take timely correction measures, thereby improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The drawings described herein are used to provide a further understanding of the embodiments of the present disclosure, constitute a part of the present disclosure, and do not constitute a limitation of the embodiments of the present disclosure;

[0061] FIG1 is a flow chart of a component angle classification method based on a classification model in the present disclosure;

[0062] FIG2 is a schematic diagram of a process for collecting missing information of a printed circuit board template in the present disclosure;

[0063] FIG3 is a schematic diagram of a process for correcting information of a circuit board to be inspected in the present disclosure;

[0064] FIG4 is a schematic diagram of a process for completing missing information of a printed circuit board template in the present disclosure;

[0065] FIG5 is a flow chart of a supplementary operation for completing missing information of a printed circuit board template in the present disclosure;

[0066] FIG6 is a schematic diagram of a process for returning test results to a production and manufacturing system in the present disclosure;

[0067] FIG7 is a schematic diagram of the component angle classification system based on the classification model in the present disclosure. DETAILED DESCRIPTION

[0068] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the present disclosure is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other without conflict.

[0069] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure. However, the present disclosure may also be implemented in other ways different from those within the scope of this description. Therefore, the scope of protection of the present disclosure is not limited to the specific embodiments disclosed below.

[0070] Please refer to Figure 1, which is a flow chart of a component angle classification method based on a classification model provided by an embodiment of the present disclosure. The angle classification method of this embodiment is used in conjunction with an automatic defect classification system. After the printed circuit board to be inspected is produced and the components are assembled, the automatic defect classification system is used to detect the missing and damaged components. After confirming that the components are not missing or damaged, the component angle detection of the printed circuit board to be inspected is performed. For example: after the components such as light-emitting diodes, electrolytic capacitors and resistors are installed on the circuit board substrate on the production line, it enters the detection area and is detected by the detection equipment to obtain information. The detection equipment can be an industrial camera or a high-definition camera. After the automatic defect classification system detects that a component is not installed, the printed circuit board is directly judged as a defective product and subsequent component angle detection is not performed. Only when the automatic defect classification system detects that there are no components that are not installed and all components are intact and not damaged, the component angle detection is performed. The method is divided into two aspects: detection model training and detection model use. The various information in the embodiment can be image information or text information after data conversion. The method includes the following steps:

[0071] S1. Collect printed circuit board template information and construct a first data set.

[0072] A printed circuit board template is used to provide various data required for training the collection and detection model. There are no vacancies in the positions where components can be installed on the printed circuit board template. The printed circuit board template information contains all angle information of all polar components that can be installed on the printed circuit board. The angle information refers to the possible connection methods of the polar component pins. The angle information of the polar component corresponding to the connection method is an incorrect connection method except 0°. For example, if the diode pin is connected normally, it is 0°, and if the pin is connected abnormally, it is 180°; if the three-pin capacitor is connected normally, it is 0°, and if the pin is connected abnormally, it is 120° or 240°. Among them, the template information of the printed circuit board includes component coordinate information and component information corresponding to the coordinates, the component coordinate information is used to indicate the position of the component on the printed circuit board, the component information includes the type of the component, whether the component is a polar component and the angle information of the component, etc. The types of components include electrolytic capacitors, resistors and light-emitting diodes, etc. The polar components include electrolytic capacitors, light-emitting diodes and Zener diodes, etc. The non-polar components include resistors, ceramic capacitors and crystal oscillators, etc. The angle information of the components includes errors according to the existence of the components. The angle information of the two-pin crystal diode is 0° and 180°, the angle information of the three-pin electrolytic capacitor is 0°, 120° and 240°, the angle information of the four-pin electrolytic capacitor is 0°, 90°, 180° and 270°, the angle information of the rectangular integrated circuit is 0° and 180°, and the angle information of the cube integrated circuit is 0°, 90°, 180° and 270°. The angles are obtained by rotating the polar components clockwise based on the correct pin insertion method. The program used for information collection and data set construction can be written in Python or C++.

[0073] S2. Based on the first data set, obtain polarity component information of the printed circuit board template and construct a second data set.

[0074] Using the information in the first dataset, whether the component is a polar component is determined based on the component type, and information about the polar components on the printed circuit board template is obtained to construct a second dataset. Specifically, based on image recognition, whether the components on the printed circuit board template have polarity is determined, polar components such as electrolytic capacitors, light-emitting diodes, and Zener diodes are grouped together, and the second dataset is constructed using the program or software described in step S1. The second dataset contains the overall image information of all polar components on the printed circuit board template.

[0075] S3. Based on the second data set, obtain information of all monomer polarity components and construct a third data set.

[0076] Using an image processing tool, the polarity component information in the second data set is cropped into several pieces of single polarity component information containing only complete information of one polarity component. The single polarity component information includes the category information, angle information, and polarity identification information of the polarity component. The angle in the single polarity component information is one of the angle information in S1. For example, in the single polarity component information of a light-emitting diode, the angle can only be 0° or 180°. The polarity identification information is a mark on the polarity component used to express the correct connection angle of the component. For example, the top graphic of the aluminum electrolytic capacitor shell is divided into two large and small color bands. The large color band corresponds to the positive direction on the printed circuit board. The image processing tool can be SimpleCV or OpenCV. Based on the obtained information of all single polarity components on the printed circuit board template, a third data set is constructed.

[0077] S4. Based on the third data set, label the polarity components of the same category with the same angle information characteristic values ​​to generate a corresponding label data set.

[0078] All single polar component information in the third data set is classified according to type and angle. For components of the same category, the angle information is used as the characteristic value, and the single polar component is classified into one category according to the condition of the same angle information. For example: for polar components of the category of light-emitting diodes, since their angle information is 0° and 180 degrees, the light-emitting diodes with angle information of 0° are classified into the same category, and the light-emitting diodes with angle information of 180° are classified into the same category. The polar component information classified into one category is labeled, and the information is stored in the form of key-value pairs. The label corresponds to the key of the key-value pair, and the specific content of the polar component information corresponding to the label is the value. A label data set is constructed based on all the classified information.

[0079] S5. Based on a deep learning approach, obtain an angle detection model using the first data set, the second data set, the third data set, and the label data set.

[0080] The first, second, third, and label datasets do not contain information about non-polar components. Non-polar component information is non-essential for model training and testing. Not acquiring this information can reduce data dimensionality, streamline the data structure used for detection model training, avoid unnecessary data redundancy, and improve model training and testing efficiency. The deep learning approach can utilize the TensorFlow deep learning framework or the PyTorch deep learning framework.

[0081] Based on the angle detection model, S6 performs component angle detection on the polarity components of the printed circuit boards to be inspected on the production line.

[0082] An angle detection model is obtained through deep learning. When used, the angle detection model can be embedded in an automatic defect recognition system or simply exist in an independent device. The device can be an industrial computer or an embedded computer. The execution of the angle detection model is located at the end of the automatic defect classification system. Through component angle detection, it can make up for the deficiency of using the automatic defect classification system in not being able to determine whether the angles of components of each polarity are correct after installation.

[0083] Referring to FIG. 2 , the present disclosure provides a component angle classification method based on a classification model on the basis of the first embodiment. The method further includes collecting missing information of a printed circuit board template and correcting the positioning of the printed circuit board information to be detected. The missing information of the printed circuit board template refers to the situation in which some polar components are obscured due to inconsistent heights or sizes of components during the information collection process. In this case, the obscured polar components need to be processed to facilitate information acquisition. The various information in the embodiment can be image information or text information after data conversion. The collection and marking of missing information of the printed circuit board template specifically includes the following steps:

[0084] A1. Collect polarity identification information of each polarity component in an independent state in a printed circuit board template and construct a first comparison data set.

[0085] The polarity identification information of each polar component in an independent state refers to the information obtained by the information collection device when the polar component is not obstructed. A first comparison data set is constructed based on this information. The information collection device can be a high-definition camera or an industrial camera. The polarity identification information in the independent state includes the complete polarity identification information of the polar component.

[0086] A2. Obtain polarity identification information in the printed circuit board template information and construct a second comparison data set.

[0087] The polarity identification information collected in this step refers to information obtained by collecting an image of the printed circuit board template at the same position using the same information collection device as in step A1.

[0088] A3. Compare the second comparison data set with the first comparison data set to obtain a comparison result.

[0089] When the comparison result indicates that the angle information of the second comparison data set is missing, the information missing refers to the situation where the information acquisition device in A1 cannot obtain complete polarity component information due to occlusion in the image of the printed circuit board template after collecting it. For example, when an industrial camera is used to collect information on a printed circuit board template, the industrial camera is located directly above the printed circuit board template. Due to the shooting angle of the industrial camera, in the acquired image, there is a light-emitting diode near the edge of the printed circuit board that is blocked by an electrolytic capacitor larger than the light-emitting diode, and the image information of the light-emitting diode is not obtained. This situation is information missing. The corresponding polarity components with missing information in the comparison result are given information missing labels, and a labeling file of the polarity components with information missing labels is generated in the printed circuit board template information. The labeling file can be image information or text information.

[0090] Please refer to Figure 3. The present disclosure provides a component angle classification method based on a classification model on the basis of the second embodiment. Step S6 of the method further includes positioning correction of the circuit board to be detected before performing component angle detection. The positioning correction includes information correction of the substrate of the circuit board to be detected and information correction of the components of each polarity on the circuit board to be detected. When the printed circuit board with component assembly enters the detection area, the image obtained when the information of the printed circuit board to be detected is collected may not match the corresponding printed circuit board template due to human placement or insufficient conveyance of the conveyor belt. The mismatch is specifically manifested as image rotation or a difference between the image acquisition angle and the template. When the above-mentioned mismatch problem occurs, information correction is required. The various information in the embodiment can be image information or text information after data conversion. The information correction includes the following steps:

[0091] B1. Acquire coordinate information of a first printed circuit board to be inspected to construct a first coordinate information set, wherein the coordinate information includes substrate coordinate information of the first printed circuit board to be inspected and coordinate information of polar components on the substrate.

[0092] To perform information correction, it is necessary to first obtain the coordinate information of the circuit board to be tested. The coordinate information includes the substrate coordinate information of the circuit board to be tested and the coordinate information of each polar component on the substrate. The substrate coordinate information is some customized marks on the printed circuit board for positioning and identification when no components are installed. The marks include vias, pads or copper foil conductors. With the intersection of adjacent edges of the printed circuit board as the origin, a plane rectangular coordinate system is established and the corresponding coordinates are assigned to the marks. The coordinate information of the polar components on the substrate is the coordinate of the polar components on the printed circuit board. The polar component coordinates and the substrate coordinates share the same plane rectangular coordinate system.

[0093] B2. Acquire the printed circuit board template coordinate information corresponding to the first printed circuit board information to be detected to construct a second coordinate information set, wherein the coordinate information includes the substrate coordinate information of the printed circuit board template and the coordinate information of polar components on the substrate.

[0094] While obtaining the coordinate information of the printed circuit board to be inspected, the coordinate information of the printed circuit board template corresponding to the printed circuit board to be inspected is obtained for subsequent information comparison.

[0095] B3. Verify and compare the first coordinate information set and the second coordinate information set to obtain a verification result, determine the coordinate deviation between the first circuit board to be inspected and the corresponding printed circuit board template based on the verification result, and perform repair and correction on the information of the first printed circuit board to be inspected based on the coordinate deviation, wherein the repair and correction is used to adjust the coordinate information of the first circuit board to be inspected to be consistent with the coordinate information of the corresponding printed circuit board template, and replace the first printed circuit board information to be inspected with the repaired and corrected information.

[0096] Compare the coordinate information of the printed circuit board substrate to be inspected with the coordinate information of the corresponding printed circuit board template substrate. When there is an inconsistency, use an image processing tool to translate, rotate, or mirror the obtained printed circuit board image to achieve coordinate coincidence based on the coordinate information of the printed circuit board template. The image processing tool is SimpleCV or OpenCV. After completing the information correction of the substrate, the image processing tool uses the perspective principle and cropping and splicing methods to correct the information of the polar components to ensure that the shape and size of the obtained polar components are consistent with the shape and size of the polar components on the template.

[0097] B4. Upon completion of step B3, when it is detected that a marking file exists for the printed circuit board template information corresponding to the first printed circuit board information to be inspected, an information completion operation is performed on the polarity components with missing information markings in the marking file. Based on the information completion operation, a second printed circuit board to be inspected is obtained. The information completion operation is used to complete the polarity component information that cannot be fully collected due to occlusion.

[0098] This step is used to ensure that the polarity components on the printed circuit board to be inspected are not blocked, thereby not affecting the angle information detection result.

[0099] Referring to Figures 4 and 5, the present disclosure provides a component angle classification method based on a classification model based on the third embodiment. After completing the collection of missing information of the printed circuit board template, the method adds the annotation file to the angle information detection model. When performing angle information detection, if the information collection device finds that the printed circuit board template corresponding to the printed circuit board to be detected contains polarity components with annotation files, it performs an information completion operation, which includes the following steps:

[0100] B401. Obtain coordinate position information of polar components with information missing annotations through the annotation file, and transmit the coordinate position information to an information collection device.

[0101] When the printed circuit board to be inspected is subjected to angle inspection, the specific model of the printed circuit board to be inspected is obtained according to the production arrangement pre-set on the production line, the template information of the corresponding printed circuit board is obtained through the model, and the coordinate position information of the polar components with missing information marks is obtained. Finally, the coordinate position information is transmitted to the information collection device, which can be an industrial camera installed on a six-degree-of-freedom movable robotic arm or an industrial camera located above the printed circuit board to be inspected and installed in a parallel slide rail.

[0102] B402. The information collection device moves to the top of the polar component with the information missing mark, collects the information of the polar component with the information missing mark under the viewing angle state and marks it as polarity identification correction information, and constructs a polarity identification correction data set based on the polarity identification correction information.

[0103] After receiving the coordinate position information, the information collection device described in B401 moves to the position directly above the polar component with the missing information mark, obtains the complete polarity identification information of the polar component, and constructs a data set of the complete polarity identification information of all polar components with missing information marks. Alternatively, the information collection device can be an array of multiple industrial cameras, which collects information of polar components with missing information marks on the printed circuit board to be inspected from multiple angles and uses SimpleCV or OpenCV to stitch multiple images recording the same polar component to obtain the complete polarity identification information of the polar component.

[0104] B403: Use the polarity identification correction data set to replace the polarity identification information of the first polarity component information to be detected to complete information completion.

[0105] The data set obtained by B402 is used as the actual detected information of the polar components with missing information marks in the printed circuit board to be detected, and replaces the initial information to be detected of the printed circuit board to be detected obtained by the information acquisition device. The initial information to be detected refers to the information used for angle information detection of the printed circuit board to be detected without performing information completion operations on the obscured printed circuit board.

[0106] When the polarity identification information obtained in step B402 is still missing, that is, when the complete information of the polarity components on the circuit board to be inspected cannot be obtained by changing the shooting angle of the information acquisition device, step B402 further includes the following steps:

[0107] C1. Obtain the polarity identification information of the missing information, crop the occlusion area information and obtain the occlusion area coordinate information, and construct a third comparison data set based on the occlusion area information and the occlusion area coordinate position information.

[0108] The image information of the obscured parts of the polar components whose polarity identification information cannot be obtained through the information completion step is cropped out using OpenCV or SimpleCV, and together with the coordinate information of the obscured parts, a data set is formed.

[0109] C2. Obtain printed circuit board template information corresponding to the second printed circuit board to be detected, obtain polarity identification information and coordinate information of the printed circuit board template information, and construct a fourth comparison data set based on the polarity identification information and coordinate information of the printed circuit board template information.

[0110] The data set obtained in this step is the complete polarity component information contained in the printed circuit board template corresponding to the printed circuit board to be inspected.

[0111] C3. Compare the third comparison data set with the fourth comparison data set, locate an information area in the fourth comparison data set whose coordinate information is consistent with the coordinate information of the occlusion area in the third comparison data set, overwrite the information of the information area with the occlusion area information, and construct the second angle information based on the fourth comparison data set after the information overlay is completed.

[0112] The data sets obtained by C1 and C2 are compared, and the image at the same position on the printed circuit board template used for detection and the blocked area on the printed circuit board to be detected is replaced with the image cropped out in C1, so that when performing angle information detection, the polarity identification information on the printed circuit board to be detected and its corresponding template is divided into blocked area and non-blocked area.

[0113] C4. When performing angle detection on the polarity identification information that is missing, the angle information used is the second angle information.

[0114] For the printed circuit board to be inspected that executes steps C1 to C3, when inspecting, the grayscale of the occluded area in the printed circuit board template information that provides comparison data and the printed circuit board template to be inspected is directly adjusted to 0, and only the non-occluded area is inspected, thereby changing the overall feature comparison method to a local feature comparison method.

[0115] Referring to FIG. 6 , the present disclosure provides a component classification method based on a classification model on the basis of the first embodiment, the method further comprising step S7:

[0116] Obtain the test results after the angle detection and return the test results to the production and manufacturing system. The test results include qualified test result information and unqualified test result information. The unqualified test result information includes the angle detection status of each component of the printed circuit board and rework suggestions.

[0117] The detection system and the production system can be controlled by the same device and by two devices connected by wire or wirelessly. The terminal can be an ordinary industrial computer or an ordinary desktop computer. The detection result will only be returned as qualified when there are no missing components, no broken components and the angle information detection is 0° on the printed circuit board to be detected. When the detection result is qualified, no feedback is given by default. When the detection result is missing or damaged, the position of the missing component is displayed on the display screen of the above-mentioned device. When the detection result is that the angle information is unqualified, the position of the unqualified component and the modification method are displayed. For example: for a three-pin electrolytic capacitor, if the angle information detection result is 120°, it will be displayed: Please reconnect the pins, and the capacitor needs to be rotated 120° counterclockwise; when the angle information detection result is 240°, it will be displayed: Please reconnect the pins, and the capacitor needs to be rotated 120° clockwise.

[0118] Referring to FIG7 , a sixth embodiment of the present disclosure provides a component angle classification system based on a classification model, the system comprising a first construction unit, a second construction unit, a third construction unit, a generation unit, an acquisition unit, and a detection unit. Embodiments 1 to 5 are all applied to the system. The first construction unit is configured to construct a first data set, the first data set being constructed based on printed circuit board template information; the second construction unit is configured to construct a second data set, the second data set being constructed based on polarity component information on the printed circuit board template, the polarity component information including component polarity identification information containing angle information; the printed circuit board template information including angle information of the polarity components, the angle information including angles of 0°, 90°, 120°, 180°, 240°, and 270°; the third construction unit is configured to construct a third data set, the third data set being constructed based on all individual polarity component information on the printed circuit board template, wherein the angle in the individual polarity component information is one of the angle information; and the generation unit is configured to construct a label data set, the label data set being constructed based on information on polarity components of the same type having the same angle information feature value. The acquisition unit is configured to store the first data set, the second data set, the third data set, and the label data set, and to perform model training using the above data sets based on a deep learning approach to obtain an angle detection model. The device configured to store the acquisition unit may be a read-only memory, random access memory, flash memory, hard disk, or optical disk, etc. The deep learning approach may utilize the TensorFlow deep learning framework or the PyTorch deep learning framework. The detection unit is configured to perform angle detection on a printed circuit board to be inspected after component installation on a production line. The detection unit may be an industrial computer or a standard desktop computer that stores the angle detection model and is capable of operating the model normally.

[0119] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present disclosure.

[0120] Obviously, those skilled in the art may make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is intended to include these modifications and variations. Industrial Applicability:

[0121] The disclosed embodiments provide a component angle classification method and system based on a classification model, which can compensate for the problem that the automatic defect classification system cannot meet the angle detection requirements of components of various polarities. In addition, it can also avoid information collection errors caused by incorrect placement angles of printed circuit board substrates to be inspected or obstruction of polarity components, thereby improving detection accuracy and ensuring the normal progress of angle detection.

Claims

1. A component angle classification method based on a classification model, characterized in that: The method comprises the following steps: S1. Collecting printed circuit board template information, wherein the printed circuit board template information includes component coordinate position information and component information corresponding to the coordinates, and constructing a first data set based on the printed circuit board template information; S2. judging whether components have polarity according to the component information in the printed circuit board template information, dividing the component information of the printed circuit board template into polar component information and non-polar component information according to the judgment result, and constructing a second data set based on the polar component information, wherein the polar component information includes component polarity identification information containing angle information, and the printed circuit board template information includes angle information of the polar components, and the angle information includes angles of 0°, 90°, 120°, 180°, 240° and 270°; S3. According to the second data set, the polar component information is cut into a plurality of monomer polar component information containing only complete information of one polar component, and a third data set is constructed based on all monomer polar component information, wherein the angle in the monomer polar component information is one of the angles in the angle information in S2; S4. According to the third data set, the angle information in the polarity identifier is used as a characteristic value, and the polarity components of the same category with the same angle information characteristic value are marked to generate a corresponding label data set; S5. Based on deep learning, using the first data set, the second data set, the third data set and the label data set, obtain an angle detection model; S6. Based on the angle detection model, the component angle detection is performed on the polarity components of the printed circuit board to be detected on the production line.

2. The component angle classification method based on the classification model according to claim 1 is characterized in that: Before the component angle detection is performed in step S6, the following steps are also included: Detect whether there are any missing or damaged polarity components on the printed circuit board to be detected.

3. The component angle classification method based on the classification model according to claim 1 is characterized in that: The printed circuit board template information in step S1 also includes the substrate coordinate position information of the printed circuit board template.

4. The component angle classification method based on the classification model according to claim 3 is characterized in that: The method further includes collecting missing information of the printed circuit board template, specifically including the following steps: A1. Collect polarity identification information of each polar component in an independent state in a printed circuit board template and construct a first comparison data set, wherein the first comparison data set includes angle information of each polar component; A2, obtaining polarity identification information in the printed circuit board template information and constructing a second comparison data set; A3. Compare the second comparison data set with the first comparison data set to obtain a comparison result. When the comparison result indicates that the angle information of the second comparison data set is missing, assign missing information labels to the corresponding polar components with missing information in the comparison result, and generate a labeling file of the polar components with missing information labels in the printed circuit board template information.

5. The component angle classification method based on the classification model according to claim 4 is characterized in that: Before the step S6 performs the component angle detection, the following steps are also included: The information of the printed circuit board to be detected is obtained, and the first information of the printed circuit board to be detected is constructed based on the information of the printed circuit board to be detected, wherein the information of the printed circuit board to be detected is the information required for component angle detection, and the second information of the printed circuit board to be detected is obtained by performing positioning correction based on the substrate coordinate information of the printed circuit board, wherein the second information of the printed circuit board to be detected is the actual information to be detected of the printed circuit board to be detected, and the positioning correction includes correction of the first information of the printed circuit board to be detected and correction of information of each polarity component in the first information of the printed circuit board to be detected.

6. The component angle classification method based on the classification model according to claim 5 is characterized in that: The positioning correction comprises the following steps: B1. Acquire coordinate information of a first printed circuit board to be detected to construct a first coordinate information set, wherein the coordinate information includes substrate coordinate information of the first printed circuit board to be detected and coordinate information of polar components on the substrate; B2. Acquire the printed circuit board template coordinate information corresponding to the first printed circuit board information to be detected to construct a second coordinate information set, wherein the coordinate information includes the substrate coordinate information of the printed circuit board template and the coordinate information of the polar components on the substrate; B3. Verify and compare the first coordinate information set and the second coordinate information set to obtain a verification result, determine the coordinate deviation between the first circuit board to be detected and the corresponding printed circuit board template based on the verification result, and perform repair and correction on the first printed circuit board information to be detected based on the coordinate deviation, wherein the repair and correction is used to adjust the coordinate information of the first circuit board to be detected to be consistent with the coordinate information of the corresponding printed circuit board template, and replace the first printed circuit board information to be detected with the repaired and corrected information; B4. On the basis of completing step B3, when it is detected that the printed circuit board template information corresponding to the first printed circuit board information to be detected exists in a marking file, an information completion operation of the polar components with missing information markings in the marking file is performed, and the second printed circuit board to be detected is obtained based on the information completion operation. The information completion operation is used to complete the polar component information that cannot be fully collected due to occlusion.

7. The component angle classification method based on the classification model according to claim 6 is characterized in that: The information completion operation in step B4 includes the following steps: B401. Obtaining coordinate position information of polar components with information missing annotations through the annotation file, and transmitting the coordinate position information to an information collection device; B402, the information collection device moves to the top of the polar component with the information missing mark, collects the information of the polar component with the information missing mark under the viewing angle state and marks it as polarity identification correction information, and constructs a polarity identification correction data set based on the polarity identification correction information; B403. Use the polarity identification correction data set to replace the polarity identification information of the first polarity component information to be detected, complete the information completion, and obtain the second printed circuit board information to be detected after the information completion.

8. The component angle classification method based on the classification model according to claim 1 is characterized in that: The first data set, the second data set, the third data set and the label data set do not contain the information of the non-polar component.

9. The component angle classification method based on the classification model according to claim 7 is characterized in that: When the polarity identification information obtained in step B402 is still missing, step B402 further includes the following steps: C1. Obtaining polarity identification information of missing information, cropping the occlusion area information and obtaining the occlusion area coordinate information, and constructing a third comparison data set based on the occlusion area information and the occlusion area coordinate position information; C2. Obtain printed circuit board template information corresponding to the second printed circuit board to be detected, obtain polarity identification information and coordinate information of the printed circuit board template information, and construct a fourth comparison data set based on the polarity identification information and coordinate information of the printed circuit board template information; C3, comparing the third comparison data set with the fourth comparison data set, locating an information area in the fourth comparison data set whose coordinate information is consistent with the coordinate information of the occlusion area of ​​the third comparison data set, overwriting the information of the information area with the occlusion area information, and constructing the second angle information based on the fourth comparison data set after the information coverage is completed; C4. When performing angle detection on the polarity identification information that is missing, the angle information used is the second angle information.

10. The component angle classification method based on the classification model according to claim 1, characterized in that: The method further comprises: S7, obtaining the test results after the angle detection, and returning the test results to the production and manufacturing system, the test results include qualified test result information and unqualified test result information, and the unqualified test result information includes the angle detection status of each component of the printed circuit board and rework suggestions.

11. A component angle classification system based on a classification model, characterized in that: The system comprises: A first construction unit is configured to collect printed circuit board template information, wherein the printed circuit board template information includes component coordinate position information and component information corresponding to the coordinates, and construct a first data set based on the printed circuit board template information; a second construction unit, configured to determine whether a component has polarity according to the component information in the printed circuit board template information, divide the component information of the printed circuit board template into polar component information and non-polar component information according to the determination result, and construct a second data set based on the polar component information, wherein the polar component information includes component polarity identification information including angle information, the printed circuit board template information includes angle information of the polar component, and the angle information includes angles of 0°, 90°, 120°, 180°, 240° and 270°; a third construction unit configured to, according to the second data set, cut the polar component information into a plurality of monomer polar component information containing only complete information of one polar component, and construct a third data set based on all monomer polar component information, wherein the angle in the monomer polar component information is one of the angles in the angle information in S2; A generating unit is configured to, according to the third data set, use the angle information in the polarity identifier as a characteristic value, mark the same category of polarity components with the same angle information characteristic value, and generate a corresponding label data set; An obtaining unit is configured to obtain an angle detection model by using the first data set, the second data set, the third data set and the label data set in a deep learning manner; The detection unit is configured to perform component angle detection on polarity components of a printed circuit board to be detected on a production line based on an angle detection model.

Citation Information

Patent Citations

  • PCB defect detection and identification method based on MAIRNet

    CN114429445A

  • Improved Faster-RCNN polar component detection method based on rotating frame positioning

    CN114494203A

  • Classification model-based element angle classification method and system

    CN117409261A

  • Labeling an unlabeled dataset

    US20220058440A1