Component identification model training method and device
By obtaining the labeling attribute information and specifications of electronic components, high-quality labeling and correcting errors, combined with multi-spectral imaging and deep learning, the accuracy and adaptability of the electronic component recognition model are solved, and more efficient recognition effects are achieved.
Patent Information
- Application Number
- CN202510303572.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the identification accuracy of the electronic component recognition model is low and cannot adapt to the characteristics of rapid update of electronic components. There are problems such as inconsistent labeling, single enhancement strategy, risk of model overfitting and difficulty in adjusting hyperparameters.
By obtaining the annotation attribute information of component images, determining the annotation specification information, performing high-quality annotation and correcting error information, combining multi-spectral imaging and deep learning technology, the component recognition model is trained.
It improves the identification accuracy and robustness of component recognition models, and can more accurately identify electronic components in complex environments, reducing the need for manual intervention and feature engineering.
Smart Images

Figure CN120259810A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and particularly to a method and device for training a component recognition model. Background Art
[0002] With the continuous development of the electronics industry, the types of electronic components are increasing day by day, and the complexity is also continuously improving. The recognition of electronic components is crucial in the detection, maintenance, and fault troubleshooting of returned electricity meters.
[0003] Accurately identifying electronic components can greatly improve the calibration efficiency of returned electricity meters and the quality of components. In related technologies, the training of component recognition models is usually based on traditional machine learning methods. For example, geometric features, texture features, color features, etc. are manually extracted from the images of electronic components first, and then a suitable classifier is selected according to the type of features and the requirements of the recognition task. After that, the training set and the test set are divided to train the classifier.
[0004] However, the component recognition models in related technologies have the technical problem of low recognition accuracy. Summary of the Invention
[0005] Based on this, it is necessary to provide a method and device for training a component recognition model to improve the recognition accuracy of electronic components for the above technical problems.
[0006] In a first aspect, an embodiment of this application provides a method for training a component recognition model, including:
[0007] Obtain the images of components installed on various types of circuit boards, and obtain the labeled attribute information of each component in each component image; the labeled attribute information represents the attribute information related to the component labeling in the training of the component recognition model;
[0008] Determine the labeled specification information corresponding to each component according to the labeled attribute information of each component;
[0009] Based on the labeled specification information corresponding to each component, label each component in each component image to obtain the labeled data of each component;
[0010] Conduct a labeled quality review on the labeled data of each component, and correct the error information in the labeled data of each component;
[0011] Train a model according to the corrected labeled data and each component image to obtain a component recognition model.
[0012] In one of the embodiments, obtaining the images of components installed on various types of circuit boards includes:
[0013] Scan each circuit board through a multispectral imaging device to obtain multispectral fusion images of the electronic components on each circuit board; the circuit board includes a printed circuit board and a flexible circuit board; the multispectral fusion images include images collected under different lighting conditions, shooting angles, and background environments;
[0014] Determine the multispectral fusion images of the electronic components on each circuit board as the component images installed on various types of circuit boards.
[0015] In one embodiment, obtain the labeled attribute information of each component in each component image, including:
[0016] According to the identification information of each component, obtain the labeled attribute information matching each identification information in the pre-maintained labeled attribute file;
[0017] Determine the labeled attribute information matching each identification information in the labeled attribute file as the labeled attribute information of each component in each component image.
[0018] In one embodiment, according to the labeled attribute information of each component, determine the labeled specification information corresponding to each component, including:
[0019] Obtain the mapping relationship between different labeled attribute information and different labeled specification information;
[0020] According to each labeled attribute information, obtain the labeled specification information matching each labeled attribute information from the mapping relationship, and determine the labeled specification information matching each labeled attribute information as the dedicated labeled specification information of each component;
[0021] Determine the general labeled specification information of component labeling and the dedicated labeled specification information of each component as the labeled specification information corresponding to each component.
[0022] In one embodiment, correct the error information in the labeled data of each component, including:
[0023] Obtain multiple candidate labeled data pre-labeled by multiple users for each component;
[0024] According to the multiple candidate labeled data, determine the labeling consistency coefficient among users;
[0025] Based on the labeling consistency coefficient, instruct each user to correct the error information in each labeled data to obtain the corrected labeled data.
[0026] In one embodiment, according to the multiple candidate labeled data, determine the labeling consistency coefficient among users, including:
[0027] Determine the actual consistency ratio and the random consistency ratio according to each candidate annotation data and the quantity of each component;
[0028] Determine the annotation consistency coefficient according to the actual consistency ratio and the random consistency ratio.
[0029] In one embodiment, model training is performed according to the corrected annotation data and each component image to obtain a component recognition model, including:
[0030] Obtain a training data set, a validation data set, and a test data set according to the corrected annotation data and each component image;
[0031] Perform model training on a preset neural network according to the training data set to obtain an initial component recognition model;
[0032] Adjust the model parameters of the initial component recognition model according to the validation data set to obtain an adjusted initial component recognition model;
[0033] Test the adjusted initial component recognition model according to the test data set to obtain a component recognition model.
[0034] In one embodiment, performing model training on a preset neural network according to the training data set to obtain an initial component recognition model, including:
[0035] Perform data augmentation processing on the training data set to obtain a processed training data set; the data augmentation processing includes at least one of geometric transformation, color transformation, and adding noise; the processed training data set includes training component images and training annotation data corresponding to the training component images;
[0036] Input the training component images into the neural network to obtain the predicted component categories output by the neural network;
[0037] Determine the prediction loss value of the neural network according to the predicted component categories, the training annotation data, and a preset loss function;
[0038] Adjust the model parameters of the neural network based on the prediction loss value until the training is completed to obtain an initial component recognition model.
[0039] In one embodiment, before annotating each component in each component image based on the annotation specification information corresponding to each component to obtain the annotation data of each component, the method further includes:
[0040] Perform data preprocessing on each component image to obtain a processed component image; the data preprocessing includes at least one of size normalization, grayscale conversion, color standardization, and data cleaning.
[0041] In a second aspect, an apparatus for training a component recognition model provided by an embodiment of the present application includes:
[0042] An image acquisition module, configured to acquire images of components installed on various types of circuit boards, and acquire the labeled attribute information of each component in each component image; the labeled attribute information represents the attribute information related to component labeling in component recognition model training;
[0043] A specification information determination module, configured to determine the labeled specification information corresponding to each component according to the labeled attribute information of each component;
[0044] A component labeling module, configured to label each component in each component image based on the labeled specification information corresponding to each component, to obtain the labeled data of each component;
[0045] An error information correction module, configured to perform a labeling quality review on the labeled data of each component, and correct the error information in the labeled data of each component;
[0046] A model training module, configured to perform model training according to the corrected labeled data and each component image, to obtain a component recognition model.
[0047] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the embodiments in the first aspect or the second aspect are implemented.
[0048] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments in the first aspect or the second aspect are implemented.
[0049] In a fifth aspect, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments in the first aspect or the second aspect are implemented.
[0050] The method and device for training a component recognition model provided by the embodiments of the present application first obtain component images installed on various types of circuit boards, and obtain the labeled attribute information of each component in each component image. Then, according to the labeled attribute information of each component, the labeled specification information corresponding to each component is determined, and based on the labeled specification information corresponding to each component, each component in each component image is labeled to obtain the labeled data of each component. After that, the quality of the labeled data of each component is audited, and the error information in the labeled data of each component is corrected. Finally, model training is performed according to the corrected labeled data and each component image to obtain a component recognition model, where the labeled attribute information represents the attribute information related to component labeling in component recognition model training. In this method, after obtaining the component images, based on the labeled attribute information of each component in the component images, the labeled specification information of each component is obtained, and each component is labeled based on this labeled specification information, so that the data quality of the labeled data in the model training data is higher, and further the recognition accuracy of the component recognition model trained based on the high-quality labeled data is higher; and after labeling each component, the quality of the labeled data is also audited, and the error information therein is corrected, which further improves the data quality of the labeled data, and thus also further improves the recognition accuracy of the component recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0052] Figure 1 It is the internal structure diagram of a computer device in an embodiment;
[0053] Figure 2 It is the flowchart of the method for training a component recognition model in an embodiment;
[0054] Figure 3 It is the flowchart of obtaining component images in an embodiment;
[0055] Figure 4 It is the flowchart of obtaining the labeled attribute information of components in an embodiment;
[0056] Figure 5 It is the flowchart of determining the labeled specification information in an embodiment;
[0057] Figure 6Schematic diagram of the process for correcting error information in labeled data in an embodiment;
[0058] Figure 7 Schematic diagram of the process for determining the labeling consistency coefficient in an embodiment;
[0059] Figure 8 Schematic diagram of the process for training a component recognition model in an embodiment;
[0060] Figure 9 Schematic diagram of the structure of a component recognition model training device in an embodiment. Detailed implementation manners
[0061] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
[0062] The technical background of the embodiments of the present application will be described below.
[0063] With the continuous development of the electronics industry, the types of electronic components are increasing day by day, and the complexity is also continuously increasing. The recognition of electronic components is crucial in the process of detecting, repairing and troubleshooting returned electricity meters. Accurately recognizing electronic components can greatly improve the verification efficiency of returned electricity meters and the quality of components, and save the costs of verification and repair. However, traditional rule-based and traditional machine learning methods perform poorly in dealing with complex environments and uncertainties, require a large amount of manual intervention and feature engineering, and cannot adapt to the characteristics of the rapid update of electronic components. Therefore, introducing the powerful artificial intelligence technology of deep learning has become a powerful tool for solving the problem of electronic component recognition.
[0064] The following deficiencies still exist in the current related technologies: ① Data update problem: As the technology of electronic components continues to develop, new components are constantly introduced. If the data cannot be updated in a timely manner, the model may have a low recognition rate for newly emerged components. ② Inconsistent annotation: Even if professionals perform the annotation, there may be differences in the understanding of certain features of electronic components among different personnel, resulting in inconsistent annotation. ③ Single enhancement strategy: If only a limited number of data enhancement methods are adopted, the potential features in the data may not be fully explored, and the model's ability to handle various complex situations cannot be effectively improved. ④ Risk of model overfitting: When optimizing the model structure, such as adding too many parameters or complex modules, the model may overfit to the training data and perform poorly in the test set and actual applications. ⑤ Difficulty in hyperparameter tuning: The adjustment of hyperparameters is a complex process. Different hyperparameters may interact with each other, making it difficult to determine an optimal combination of hyperparameters, and a large amount of experimentation and experience accumulation is required. ⑥ Applicability problem of pre-trained models: Although pre-trained models can accelerate the training speed and improve the recognition rate, if the dataset of the pre-trained model is too different from the electronic component dataset, the model may not be able to effectively learn the specific features of the components and may even introduce some features unrelated to the task.
[0065] Based on this, the embodiment of the present application provides a method for training a component recognition model. After obtaining a component image, based on the annotation attribute information of each component in the component image, the annotation specification information of each component is obtained, and each component is annotated based on the annotation specification information, so that the data quality of the annotated data in the model training data is higher, and further the recognition accuracy of the component recognition model trained based on the high-quality annotated data is higher; and after the annotation of each component is completed, the quality of the annotated data is also audited, and the error information therein is corrected, which further improves the data quality of the annotated data, and thus also further improves the recognition accuracy of the component recognition model. Of course, the technical solution provided in the embodiment of the present application is not limited to only solving the above problems, and there are other technical effects, which can be specifically seen in the following embodiments.
[0066] It should be noted that the beneficial effects or technical problems solved by the embodiment of the present application are not limited to this one, and there may be other implicit or related problems, which can be specifically seen in the description of the following embodiments.
[0067] The method for training a component recognition model provided by the embodiment of the present application will be described below. It can be applied to a computer device. The computer device can be a server, and its internal structure diagram can be as Figure 1As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it realizes a method for training a component recognition model. Those skilled in the art can understand that Figure 1 The structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0068] The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0069] In an exemplary embodiment, as Figure 2 shown, a method for training a component recognition model is provided. Taking the method applied to the Figure 1 computer device in the figure as an example, it includes the following steps 201 to step 205. Among them:
[0070] S201, obtain component images installed on various types of circuit boards, and obtain the labeled attribute information of each component in each component image.
[0071] In the embodiment of the present application, the labeled attribute information represents the attribute information related to component labeling in component recognition model training. The labeled attribute information includes component category, component category hierarchy, whether it is a partially occluded component, whether it is a blurred component, whether it is a densely arranged component, etc. The various types of circuit boards include printed circuit boards, flexible circuit boards, etc.
[0072] Exemplarily, images of components installed on different types of circuit boards are collected in advance by an image acquisition device, and images of different lighting conditions, shooting angles, and background environments are covered. Among them, lighting conditions include strong direct light, weak light environment, backlit scenes, etc.; shooting angles include vertical shooting from the top, side oblique shooting, etc.; background environments include clean desktop backgrounds, messy desktop backgrounds, etc. When it is necessary to obtain component images, they can be obtained from the image acquisition device, for example, a component image acquisition request is sent to the image acquisition device, and when the image acquisition device receives the image acquisition request, the component image collected therein is sent to the computer device, so that the computer device can obtain component images installed on various types of circuit boards.
[0073] Exemplarily, the method of obtaining the annotation attribute information of each component in each component image may be to obtain all attribute information of each component from a database, and then filter attribute information related to component annotation from all attribute information as the annotation attribute information of each component.
[0074] S202, determining the marking specification information corresponding to each component according to the marking attribute information of each component.
[0075] Annotation specification information refers to a series of standards and rules followed when annotating relevant data to enable the model to accurately identify and understand electronic components. Annotation specification information includes general annotation specification information and specific annotation specification information. Among them, general annotation specification information refers to the standards and rules that should be followed when annotating all components, including being close to the edge of the component, using a specific coordinate format, overlapping annotation boxes, and using a unified annotation tool, etc. Being close to the edge of the component: The annotation box must be close to the edge of the component, not too large or too small. For components with irregular shapes, the minimum bounding rectangle is used for annotation. Using a specific coordinate format: The coordinates of the annotation box adopt the format (x_min, y_min, x_max, y_max), representing the coordinates of the upper left corner and the lower right corner. The coordinate values are in pixels and are calculated starting from the upper left corner (0, 0) of the image. Overlapping annotation boxes: If two components partially overlap, the annotation boxes can overlap, but it must be ensured that the annotation box of each component completely contains its main part. Unified annotation tools such as labelme, labelimg, etc., and the annotation files are saved in the standard coco format. Specific annotation specification information refers to the specific standards and rules set based on the annotation attributes of the components. Among them, each component category should have a unique name, such as resistor_10k, capacitor_100uF; components of the same type but different models or specifications should be distinguished in annotation, such as resistor_1k and resistor_10k. The component category hierarchy includes first-level categories and second-level categories, etc. Among them, the first-level category: such as resistor (resistor), the second-level category: such as resistor_1k, resistor_10k. Partially occluded components: If a component is partially occluded, the annotation box should include the visible part and indicate "partially occluded" in the remarks. Blurry components: For blurry components, the annotation box should cover the visible part as much as possible and indicate "image blurry" in the remarks. Densely arranged components: For densely arranged components, ensure that the annotation boxes do not overlap too much, and adjust the size of the annotation boxes if necessary.
[0076] Exemplarily, a standard rule manual is formulated in advance, and an annotation specification file is generated and stored in the database. The computer device can obtain the annotation specification file from the database, and then, based on the annotation attribute information of each component, obtain the annotation specification content corresponding to the annotation attribute information of each component from the annotation specification file, and use the annotation specification content corresponding to the annotation attribute information of each component and the general annotation specification information in the annotation specification file as the annotation specification information corresponding to each component.
[0077] S203, based on the annotation specification information corresponding to each component, annotate each component in the image of each component to obtain the annotation data of each component.
[0078] After obtaining the annotation specification information corresponding to each component, use an annotation tool to annotate each component in the images of each component in combination with the annotation specification information corresponding to each component, so as to obtain the annotation data of each component.
[0079] In the embodiment of the present application, before annotating each component, perform data preprocessing on the images of each component to obtain the processed component images; the data preprocessing includes at least one of size normalization, grayscale conversion, color standardization, and data cleaning. Among them, size normalization is to adjust the sizes of all images to a fixed size. For example, uniformly adjust the images to 608×608 pixels. This can facilitate the model to process the images and ensure the consistency of the input data. Grayscale conversion or color standardization is to determine whether to convert a color image to a grayscale image according to the characteristics of the electronic components; if the color information of the components is not a key factor for recognition, grayscale conversion can reduce the data volume and calculation amount; if color is an important feature, color standardization processing is required to eliminate the influence of factors such as illumination on color. For example, for resistors that distinguish different resistance values through color coding, color standardization is very important. Data cleaning is to remove image data that is blurred or has excessive noise.
[0080] S204, perform annotation quality review on the annotation data of each component, and correct error information in the annotation data of each component.
[0081] After completing the annotation of each component, instruct the reviewer to perform annotation quality review on the annotation data of each component. Exemplarily, establish an annotation quality review process in advance, and perform annotation quality review on the annotation data of each component based on the review process. Among them, the review process includes single-person preliminary review and multi-person cross review. The single-person preliminary review is that after the annotation is completed, the annotator conducts self-check to ensure that the annotation box and category are correct. The multi-person cross review is to arrange two or more reviewers to conduct cross review on the annotation data, and the reviewers work independently to avoid mutual influence. The review focus is to determine whether the annotation box is close to the edge of the component, whether the category definition is correct, and whether the processing of special situations (partial occlusion, blurred components, densely arranged components) complies with the specifications.
[0082] After completing the annotation quality review of the annotation data of each component, the incorrect information in the annotation is corrected. Exemplarily, after the reviewer discovers an error, the type of error is recorded, such as inaccurate annotation boxes, incorrect categories, etc., and then the error is feedback to the annotator, specifying the modification requirements. The annotator modifies the annotation data according to the feedback, and submits it for review again after the modification is completed. The reviewer rechecks the modified data to ensure that the problem has been solved. The built-in review function of the annotation tool can be used for review. If the tool does not support the review function, the annotation data can be exported and checked through scripts or manually. And record the results of each review, including the type of error, the number of errors, the modification situation, etc. Regularly count the accuracy rate of the annotation data, analyze the common error types, and optimize the annotation process.
[0083] S205, perform model training based on the corrected annotation data and the images of each component to obtain a component recognition model.
[0084] After obtaining the corrected annotation data, use the corrected annotation data and the images of each component to perform model training on a preset neural network until the training is completed to obtain a component recognition model.
[0085] In the component recognition model training method provided by the embodiments of the present application, first, obtain the images of components installed on various types of circuit boards, and obtain the annotation attribute information of each component in each component image. Then, according to the annotation attribute information of each component, determine the corresponding annotation specification information of each component, and based on the corresponding annotation specification information of each component, annotate each component in each component image to obtain the annotation data of each component. After that, perform an annotation quality review on the annotation data of each component, and correct the incorrect information in the annotation data of each component. Finally, perform model training based on the corrected annotation data and the images of each component to obtain a component recognition model, where the annotation attribute information represents the attribute information related to component annotation in component recognition model training. In this method, after obtaining the component images, based on the annotation attribute information of each component in the component images, obtain the annotation specification information of each component, and annotate each component based on this annotation specification information, so that the data quality of the annotation data in the model training data is higher, and thus the recognition accuracy of the component recognition model trained based on the high-quality annotation data is higher; and after completing the annotation of each component, a quality review is also performed on the annotation data, and the incorrect information in it is corrected, which further improves the data quality of the annotation data, and thus also further improves the recognition accuracy of the component recognition model.
[0086] Based on the above embodiments, an embodiment is provided to illustrate the process of obtaining the component images.
[0087] In an exemplary embodiment, such asFigure 3 As shown, obtain the images of components installed on various types of circuit boards, including:
[0088] S301, use a multispectral imaging device to scan each circuit board and obtain the multispectral fusion images of the electronic components on each circuit board.
[0089] Among them, the circuit boards include printed circuit boards and flexible circuit boards; the multispectral fusion images include images collected under different lighting conditions, shooting angles, and background environments.
[0090] Use a multispectral imaging device to scan multiple printed circuit boards and flexible circuit boards to obtain the multispectral fusion images of the electronic components on each circuit board. Among them, the image acquisition can be in multiple scenarios, including different lighting conditions, different shooting angles, and different background environments.
[0091] The multispectral image contains information in multiple bands, and different bands can reflect different physical characteristics of the electronic components. For example, in the visible light band, the appearance characteristics such as the color, shape, and surface texture of the components can be presented, while in the non-visible light bands such as infrared, the thermal characteristics of the components and the spectral response characteristics of the materials can be reflected. These rich information provides more feature dimensions for the recognition model, which helps the model to more accurately distinguish different types of electronic components and improve the accuracy and robustness of recognition. At the same time, the multispectral imaging device can capture the subtle differences and unique features of the electronic components under different spectra. Even for components with similar appearances, obvious spectral feature differences may be shown under different spectral bands. These differences can be used as important bases for model recognition, enabling the model to learn more detailed and unique features, and thus better classify and identify various electronic components.
[0092] In practical applications, electronic components may be in various different lighting conditions, temperature environments, etc. The images collected by the multispectral imaging device can cover the spectral information changes under different environments. By using these images for training, the recognition model can learn the characteristic change laws of electronic components under the influence of different environmental factors, thereby improving the generalization ability of the model in the actual complex environment and enabling it to more accurately identify electronic components in the face of various actual scenarios. Moreover, since the multispectral image contains information in multiple bands, when a certain band is affected by certain interference or noise, the information in other bands can still be used as a supplement to help the model accurately identify the components. This makes the recognition model trained based on the multispectral image have stronger anti-interference ability and can maintain good recognition performance in some cases with interference.
[0093] S302, determine the multispectral fusion images of the electronic components on each circuit board as the images of the components installed on various types of circuit boards.
[0094] After the multispectral imaging device acquires the multispectral fusion images of the electronic components on each circuit board, it sends the acquired multispectral fusion images of the electronic components on each circuit board to a computer device. The computer device stores these multispectral fusion images in a database. When in use, these multispectral fusion images of the electronic components can be retrieved from the database and used as the component images installed on various types of circuit boards.
[0095] In the method for training a component recognition model provided by an embodiment of the present application, a multispectral imaging device is used to scan each circuit board to obtain the multispectral fusion images of the electronic components on each circuit board. Then, the multispectral fusion images of the electronic components on each circuit board are determined as the component images installed on various types of circuit boards. Among them, the circuit boards include printed circuit boards and flexible circuit boards, and the multispectral fusion images include images acquired under different lighting conditions, shooting angles, and background environments. In this method, by using the multispectral imaging device to acquire component images, richer features and details of the electronic components can be captured, providing rich component information for the training of the component recognition model. This rich information provides more feature dimensions for the component recognition model, helping the model to more accurately distinguish different types of electronic components and improving the recognition accuracy.
[0096] Based on the above embodiments, an embodiment is provided to illustrate the process of obtaining the labeled attribute information of the components.
[0097] In an exemplary embodiment, as Figure 4 shown, obtaining the labeled attribute information of each component in each component image includes:
[0098] S401, according to the identification information of each component, obtain the labeled attribute information matching each identification information in the pre-maintained labeled attribute file.
[0099] In an embodiment of the present application, after the component images are acquired, the user analyzes each component in each component image, obtains the labeled attribute information of each component, stores the labeled attribute information of each component in the labeled attribute file, sets unique identification information for each component, and establishes a corresponding relationship between the identification information of each component and the labeled attribute information of each component.
[0100] Exemplarily, the identification information of each component is obtained, and based on the identification information of each component, the labeled attribute information corresponding to the identification information of each component is matched from the labeled attribute file.
[0101] S402. Determine the annotation attribute information of each component in each component image as the annotation attribute information that matches each identification information in the annotation attribute file.
[0102] After obtaining the annotation attribute information that matches each identification information in the annotation attribute file, determine the annotation attribute information that matches each identification information in the annotation attribute file as the annotation attribute information of each component in each component image.
[0103] In the component recognition model training method provided by the embodiments of the present application, by obtaining, according to the identification information of each component, the annotation attribute information that matches each identification information in the pre-maintained annotation attribute file, and then determining the annotation attribute information that matches each identification information in the annotation attribute file as the annotation attribute information of each component in each component image. In this method, by pre-maintaining the annotation attribute file, when obtaining the annotation attribute information of each component, it is possible to quickly and accurately obtain the annotation attribute information of each component from the pre-maintained annotation attribute file based on the identification information of each component, improving the acquisition efficiency and accuracy of the annotation attribute information.
[0104] Based on the above embodiments, an embodiment is provided to illustrate the process of determining the annotation specification information.
[0105] In an exemplary embodiment, as Figure 5 shown, determine the annotation specification information corresponding to each component according to the annotation attribute information of each component, including:
[0106] S501. Obtain the mapping relationship between different annotation attribute information and different annotation specification information.
[0107] In the embodiments of the present application, a mapping relationship between different annotation attribute information and different annotation specification information is established in advance and stored in the database. The computer device can obtain this mapping relationship from the database.
[0108] S502. According to each annotation attribute information, obtain the annotation specification information that matches each annotation attribute information from the mapping relationship, and determine the annotation specification information that matches each annotation attribute information as the dedicated annotation specification information of each component.
[0109] After obtaining the mapping relationship between different annotation attribute information and different annotation specification information, based on the annotation attribute information of each component, obtain the annotation specification information that matches the annotation attribute information of each component from the mapping relationship, and use it as the dedicated annotation specification information of each component.
[0110] S503. Determine the general annotation specification information marked on the components and the special annotation specification information of each component as the annotation specification information corresponding to each component.
[0111] After obtaining the special annotation specification information of each component, obtain the general annotation specification information of component annotation, and determine the general annotation specification information of component annotation and the special annotation specification information of each component as the annotation specification information corresponding to each component.
[0112] In the component recognition model training method provided by the embodiments of the present application, first obtain the mapping relationship between different annotation attribute information and different annotation specification information, and then according to each annotation attribute information, obtain the annotation specification information matching each annotation attribute information from the mapping relationship, and determine the annotation specification information matching each annotation attribute information as the special annotation specification information of each component. After that, determine the general annotation specification information of component annotation and the special annotation specification information of each component as the annotation specification information corresponding to each component. In this method, by pre - establishing the mapping relationship between different annotation attribute information and different annotation specification information, it is possible to quickly obtain the annotation specification information of each component based on this mapping relationship, so as to label each component based on this annotation specification information, improving the annotation consistency and annotation quality of the annotation data.
[0113] Based on the above - mentioned embodiments, an embodiment is provided to illustrate the process of correcting error information in the above - mentioned annotation data.
[0114] In an exemplary embodiment, as Figure 6 shown, correcting error information in the annotation data of each component includes:
[0115] S601. Obtain multiple candidate annotation data pre - annotated by multiple users for each component.
[0116] In the embodiments of the present application, before formally correcting the error information in the annotation data of each component, multiple annotators first pre - annotate each component in the image of each component, so as to balance the annotation consistency of multiple annotators based on the pre - annotation situation of multiple annotators, thereby improving the annotation quality.
[0117] In practical applications, each user annotates each component in the image of each component to obtain multiple candidate annotation data pre - annotated by multiple users for each component.
[0118] S602. Determine the annotation consistency coefficient between users according to the multiple candidate annotation data.
[0119] Among them, the annotation consistency system is an index to measure the consistency when multiple annotators annotate the same data.
[0120] In one embodiment, as Figure 7 shown, according to multiple candidate annotation data, determining the annotation consistency coefficient among users includes:
[0121] S701. According to each candidate annotation data and the quantity of each component, determining the actual consistency ratio and the random consistency ratio.
[0122] Among them, the actual consistency ratio refers to the percentage of samples with consistent annotations among all annotation samples. The random consistency ratio refers to the percentage of samples with annotation consistency caused by random factors among all annotation samples.
[0123] Exemplarily, taking two annotators as an example, the following formulas (1) and (2) are used to determine the actual consistency ratio and the random consistency ratio.
[0124] (1)
[0125] (2)
[0126] Among them, is the actual consistency ratio; is the random consistency ratio; n is the number of samples with consistent annotations, which is determined based on each candidate annotation data (for example, for any component, determine the number of samples annotated as the same category from each candidate annotation data); N is the quantity of each component; is the proportion of category i in all annotations; is the proportion of another annotator annotating category i, and k is the total number of categories.
[0127] S702. According to the actual consistency ratio and the random consistency ratio, determining the annotation consistency coefficient.
[0128] In one implementation manner, based on the following formula (3), combining the actual consistency ratio and the random consistency ratio, the annotation consistency coefficient can be determined.
[0129] (3)
[0130] Among them, K is the annotation consistency coefficient.
[0131] S603. Based on the annotation consistency coefficient, instructing each user to correct the error information in each annotation data to obtain the corrected annotation data.
[0132] After obtaining the annotation consistency coefficient, compare the annotation consistency coefficient with a preset consistency threshold. If the annotation consistency coefficient does not meet the consistency threshold, it indicates that the annotators have not reached annotation consistency. Each annotator continues to re-pre-annotate each component and recalculate the annotation consistency coefficient among the annotators until the annotation consistency coefficient meets the consistency threshold. Then, stop the pre-annotation and instruct each annotator to correct the error information in the annotation data of each component. At this time, the data can be batched to multiple annotators for correction because the pre-annotation has made the understanding of knowledge concepts in the field consistent among the annotators.
[0133] In the method for training a component recognition model provided by an embodiment of the present application, first, obtain multiple candidate annotation data pre-annotated by multiple users for each component. Then, based on the multiple candidate annotation data, determine the annotation consistency coefficient among the users. After that, based on the annotation consistency coefficient, instruct each user to correct the error information in each annotation data to obtain the corrected annotation data. In this method, before correcting the error information in the annotation data of each component, first balance the annotation consistency of multiple annotators based on the pre-annotation results of multiple annotators for each component, that is, ensure that the understanding of relevant knowledge of components by each annotator is consistent. On this basis, multiple annotators correct the error information in the annotation data of each component to improve the correction performance, improve the accuracy of the annotation data, and thus improve the data quality of the annotation data.
[0134] Based on the above embodiments, an embodiment is provided to illustrate the process of training the component recognition model.
[0135] In an exemplary embodiment, as Figure 8 shown, perform model training on the preset neural network according to the corrected annotation data and each component image to obtain a component recognition model, including:
[0136] S801, according to the corrected annotation data and each component image, obtain a training data set, a validation data set, and a test data set.
[0137] Before training the component recognition model, first divide the corrected annotation data and each component image into data sets to divide them into a training data set, a validation data set, and a test data set. For example, the corrected annotation data and each component image can be divided into a 70% training data set, a 15% validation data set, and a 15% test data set.
[0138] S802, according to the training data set, perform model training on the preset neural network to obtain an initial component recognition model.
[0139] After obtaining the training dataset, validation dataset, and test dataset through partitioning, the computer device uses the training dataset to train a preset neural network model.
[0140] Exemplarily, perform data augmentation on the training dataset to obtain the processed training dataset; input the training component images into the neural network to obtain the predicted component categories output by the neural network; determine the prediction loss value of the neural network based on the predicted component categories, training annotation data, and a preset loss function; based on the prediction loss value, adjust the model parameters of the neural network until the training is completed to obtain the initial component recognition model; wherein, the data augmentation processing includes at least one of geometric transformation, color transformation, and adding noise; the processed training dataset includes the training component images and the training annotation data corresponding to the training component images.
[0141] Among them, geometric transformation includes rotating, flipping, scaling, and translating the image, etc. For example, randomly rotate the electronic component image by a certain angle (such as -45° to 45°) or perform horizontal / vertical flipping, which can increase the diversity of the data and enable the model to learn the characteristics of the components at different angles and positions. Color transformation includes performing color-related transformations such as brightness, contrast, and saturation on the image. For electronic components where color features are relatively important (such as colored light-emitting diodes), by changing the color parameters, the adaptability of the model to color changes can be enhanced. Adding noise includes adding a small amount of Gaussian noise, salt-and-pepper noise, etc. to the image. This can simulate the noise situation in the actual shooting environment and improve the robustness of the model.
[0142] In the embodiments of the present application, first perform data augmentation on the training dataset to obtain the processed training dataset for input to the neural network, wherein the processed training dataset includes the training component images and the training annotation data corresponding to the training component images. Input the training component images into the neural network, and the neural network outputs its own predicted results, that is, the predicted component categories. Then, input the predicted component categories and the training annotation data into the preset loss function to calculate the prediction loss value, and based on this prediction loss value, adjust the model parameters of the neural network until the number of iterations reaches the threshold to obtain the initial component recognition model. Exemplarily, the neural network model can adopt the YOLO series model.
[0143] S803. According to the validation dataset, adjust the model parameters of the initial component recognition model to obtain the adjusted initial component recognition model.
[0144] Input the validation data set into the initial component recognition model to obtain the prediction results output by the initial component recognition model. Then, calculate the loss value based on the prediction results, and adjust the model parameters of the initial component recognition model according to the loss value until the loss value is less than the preset loss threshold, and then obtain the adjusted initial component recognition model.
[0145] S804. According to the test data set, test the adjusted initial component recognition model to obtain the component recognition model.
[0146] After validating the initial component recognition model, use the test data set to test the adjusted initial component recognition model to obtain the component recognition model.
[0147] Exemplarily, the computer device can pre-select a suitable evaluation metric according to the specific task, input the test data set into the adjusted initial component recognition model to obtain the prediction results output by the adjusted initial component recognition model, and then calculate the previously selected evaluation metric based on the prediction results and the target results to evaluate the performance of the model. If the initial model performs poorly in some predictions, the model needs to be further adjusted until the adjusted initial component recognition model passes the test to obtain the component recognition model.
[0148] In the component recognition model training method provided in the embodiments of the present application, first, according to the corrected annotation data and each component image, obtain the training data set, validation data set, and test data set. Then, based on the training data set, perform model training on the preset neural network to obtain the initial component recognition model. After that, according to the validation data set, adjust the model parameters of the initial component recognition model to obtain the adjusted initial component recognition model. Finally, according to the test data set, test the adjusted initial component recognition model to obtain the component recognition model. In this method, an optional way to train the component recognition model is provided; by first dividing the training data set, validation data set, and test data set according to the sample data, then using the training data set for model training, using the validation data set for model validation, and finally using the test data set for testing to obtain the finally trained component recognition model. In this way, it helps to timely discover problems and make corresponding adjustments, thereby improving the final performance of the model.
[0149] In addition, in an exemplary embodiment, an embodiment of the model training method in the embodiments of the present application is described.
[0150] S1. Picture collection: Collect images installed on different types of circuit boards.
[0151] It mainly collects images installed on different types of circuit boards (such as printed circuit boards, flexible circuit boards), and includes different circuit layouts and wiring situations, covering images of different lighting conditions (such as direct strong light, weak light environment, backlit scenes), shooting angles (vertical shooting from the top, side oblique viewing, etc.), and background environments (on a circuit board, placed alone, cluttered desktop background, etc.).
[0152] S2. Image preprocessing: preprocessing the collected images, including size normalization, grayscale or color standardization, data cleaning, etc.
[0153] Size normalization: resize all images to a fixed size. For example, resize the images to 608×608 pixels (this is the common input size for YOLO series models). This makes it easier for the model to process the images and ensures the consistency of the input data. Grayscale or color standardization: decide whether to convert color images to grayscale images based on the characteristics of the electronic components. If the color information of the component is not a key factor for recognition, grayscale can reduce the amount of data and calculations. If color is an important feature, it is necessary to standardize the color to eliminate the influence of factors such as lighting on the color. For example, color standardization is very important for resistors that use color coding to distinguish different resistance values. Data cleaning: remove image data that is blurred, noisy, or incorrectly labeled. For example, for electronic component images whose labeled information is obviously inconsistent with the image content (such as labeling capacitors as inductors), they should be corrected or deleted.
[0154] S3. Image annotation: Establish unified annotation standards, annotate each electronic component, establish an annotation quality review process, determine whether there are omissions in component markings, ensure high annotation accuracy, and provide a reliable foundation for model training.
[0155] For each electronic component, use a bounding box to accurately mark its position. The coordinates of the annotation box are in the form of the coordinates of the upper left corner and the lower right corner. The specific process is as follows: Unified annotation specifications: Develop a detailed annotation rule manual to clarify the drawing standards of the annotation box (such as close to the edge of the component, using a specific coordinate format), component category definition (distinguishing between similar components of different models and specifications), and special case handling (annotation criteria for partially obscured and blurred components). Review and error correction: Establish a annotation quality review process, arrange for a dedicated person or use a multi-person cross-review method to review the annotation data. Once an annotation error is found, correct it in a timely manner to ensure high accuracy of the annotation and provide a reliable foundation for model training.
[0156] S4. Optimize the algorithm model and use hyperparameter adjustment, data enhancement technology, etc. to enhance the model recognition rate and improve the component recognition rate.
[0157] Adjust and optimize the algorithm model to improve the recognition rate of components. The specific process is as follows:
[0158] Hyperparameter adjustment: (1) Learning rate strategy: Adopt a suitable learning rate adjustment strategy. For example, a relatively large learning rate can be used at the initial stage of training to enable the model to quickly learn the general features. As the training progresses, gradually reduce the learning rate so that the model can more finely adjust the weights. Learning rate decay (such as multiplying the learning rate by a decay factor less than 1 every certain number of training epochs) or adaptive learning rate algorithms (such as Adagrad, Adam, etc.) can be used. (2) Batch size and number of training epochs: Determine an appropriate batch size according to the hardware resources and data volume. A larger batch size can accelerate the training speed but may require more memory. For electronic component recognition, since the dataset may be relatively small, the batch size can be set to a moderate value. At the same time, determine a reasonable number of training epochs and avoid overfitting by observing the performance of the model on the validation set. Generally, start with a relatively small number of epochs (such as 10 - 50 epochs) and then adjust according to the convergence and performance of the model.
[0159] Data augmentation techniques: (1) Geometric transformation: Perform geometric transformations such as rotation, flipping, scaling, and translation on the images. For example, randomly rotate the electronic component images by a certain angle (such as -45° to 45°) or perform horizontal / vertical flipping, which can increase the diversity of the data and enable the model to learn the features of components under different angles and positions. (2) Color transformation: Perform color-related transformations such as brightness, contrast, and saturation on the images. For electronic components where color features are relatively important (such as colored light-emitting diodes), enhance the model's adaptability to color changes by changing the color parameters. (3) Adding noise: Add a small amount of Gaussian noise, salt-and-pepper noise, etc. to the images. This can simulate the noise situation in the actual shooting environment and improve the robustness of the model.
[0160] In this embodiment, by diversifying the data collection and obtaining data from multiple sources, the model can be exposed to various forms of electronic components, so that the model has better recognition ability for components with different appearances and models after training, improving the generality and generalization ability of the model. Appropriate data augmentation can effectively increase the diversity of the data, enabling the model to learn the features of components under different conditions, improving the robustness of the model to factors such as illumination, angle, and noise, and thus enhancing the recognition rate. The optimization strategy can enable the model to better extract the features of electronic components, improving the accuracy and efficiency of recognition.
[0161] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this document, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0162] Based on the same inventive concept, an embodiment of the present application further provides a component recognition model training device for implementing the above-mentioned component recognition model training method. The implementation solution provided by this device for solving problems is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the component recognition model training device provided below can refer to the limitations on the component recognition model training method in the above text, and will not be repeated here.
[0163] In an exemplary embodiment, as Figure 9 shown, a component recognition model training device 1 is provided, including: an image acquisition module 10, a specification information determination module 20, a component annotation module 30, an error information correction module 40, and a model training module 50, where:
[0164] The image acquisition module 10 is configured to acquire component images installed on various types of circuit boards, and acquire the annotation attribute information of each component in each component image; the annotation attribute information represents the attribute information related to component annotation in component recognition model training;
[0165] The specification information determination module 20 is configured to determine the annotation specification information corresponding to each component according to the annotation attribute information of each component;
[0166] The component annotation module 30 is configured to annotate each component in each component image based on the annotation specification information corresponding to each component to obtain the annotation data of each component;
[0167] The error information correction module 40 is configured to perform annotation quality review on the annotation data of each component and correct the error information in the annotation data of each component;
[0168] The model training module 50 is configured to perform model training based on the corrected annotation data and each component image to obtain a component recognition model.
[0169] In one embodiment, the above image acquisition module 10 is further configured to:
[0170] Scan each circuit board through a multispectral imaging device to obtain multispectral fusion images of electronic components on each circuit board; the circuit board includes a printed circuit board and a flexible circuit board; the multispectral fusion images include images collected under different lighting conditions, shooting angles, and background environments; determine the multispectral fusion images of electronic components on each circuit board as component images installed on various types of circuit boards.
[0171] In one embodiment, the above image acquisition module 10 is further configured to:
[0172] Obtain the annotation attribute information matching each identification information from the pre-maintained annotation attribute file according to the identification information of each component; determine the annotation attribute information matching each identification information in the annotation attribute file as the annotation attribute information of each component in each component image.
[0173] In one embodiment, the above specification information determination module 20 is further configured to:
[0174] Obtain the mapping relationship between different annotation attribute information and different annotation specification information; according to each annotation attribute information, obtain the annotation specification information matching each annotation attribute information from the mapping relationship, and determine the annotation specification information matching each annotation attribute information as the dedicated annotation specification information of each component; determine the general annotation specification information of component annotation and the dedicated annotation specification information of each component as the annotation specification information corresponding to each component.
[0175] In one embodiment, the above error information correction module 40 is further configured to:
[0176] Obtain multiple candidate annotation data pre-annotated by multiple users for each component; determine the annotation consistency coefficient among users according to the multiple candidate annotation data; based on the annotation consistency coefficient, instruct each user to correct the error information in each annotation data to obtain the corrected annotation data.
[0177] In one embodiment, the above error information correction module 40 is further configured to:
[0178] Determine the actual consistency ratio and the random consistency ratio according to each candidate annotation data and the number of each component; determine the annotation consistency coefficient according to the actual consistency ratio and the random consistency ratio.
[0179] In one embodiment, the above model training module 50 is further configured to:
[0180] Obtain a training data set, a validation data set, and a test data set according to the corrected labeled data and the images of each component; according to the training data set, train a preset neural network to obtain an initial component recognition model; according to the validation data set, adjust the model parameters of the initial component recognition model to obtain an adjusted initial component recognition model; according to the test data set, test the adjusted initial component recognition model to obtain a component recognition model.
[0181] In one embodiment, the above model training module 50 is further configured to:
[0182] Perform data augmentation processing on the training data set to obtain a processed training data set; the data augmentation processing includes at least one of geometric transformation, color transformation, and adding noise; the processed training data set includes training component images and training labeled data corresponding to the training component images; input the training component images into the neural network to obtain the predicted component categories output by the neural network; according to the predicted component categories, the training labeled data, and a preset loss function, determine the prediction loss value of the neural network; based on the prediction loss value, adjust the model parameters of the neural network until the training is completed to obtain an initial component recognition model.
[0183] In one embodiment, the above component recognition model training device 1 further includes:
[0184] A data preprocessing module, configured to perform data preprocessing on each component image to obtain a processed component image; the data preprocessing includes at least one of size normalization, grayscale conversion, color standardization, and data cleaning.
[0185] Each module in the above component recognition model training device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0186] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0187] Obtain the images of components installed on various types of circuit boards, and obtain the labeled attribute information of each component in each component image; the labeled attribute information represents the attribute information related to component labeling in component recognition model training;
[0188] According to the labeled attribute information of each component, determine the corresponding labeled specification information of each component;
[0189] Based on the annotation specification information corresponding to each component, each component in the component images is annotated to obtain the annotation data of each component;
[0190] The annotation data of each component is audited for annotation quality, and the error information in the annotation data of each component is corrected;
[0191] Based on the corrected annotation data and the component images, model training is performed to obtain a component recognition model.
[0192] For each step implemented by the processor in the embodiments of this application, the implementation principle and technical effect are similar to those of the above-mentioned component recognition model training method, and will not be elaborated here.
[0193] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0194] Obtain the component images installed on various types of circuit boards, and obtain the annotation attribute information of each component in each component image; the annotation attribute information represents the attribute information related to the component annotation in the component recognition model training;
[0195] Based on the annotation attribute information of each component, determine the annotation specification information corresponding to each component;
[0196] Based on the annotation specification information corresponding to each component, each component in the component images is annotated to obtain the annotation data of each component;
[0197] The annotation data of each component is audited for annotation quality, and the error information in the annotation data of each component is corrected;
[0198] Based on the corrected annotation data and the component images, model training is performed to obtain a component recognition model.
[0199] For each step implemented when the computer program in the embodiments of this application is executed by a processor, the implementation principle and technical effect are similar to those of the above-mentioned component recognition model training method, and will not be elaborated here.
[0200] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0201] Obtain the component images installed on various types of circuit boards, and obtain the annotation attribute information of each component in each component image; the annotation attribute information represents the attribute information related to the component annotation in the component recognition model training;
[0202] Determine the marking specification information corresponding to each component according to the marked attribute information of each component;
[0203] Based on the marking specification information corresponding to each component, mark each component in the image of each component to obtain the marking data of each component;
[0204] Conduct a marking quality review on the marking data of each component, and correct the error information in the marking data of each component;
[0205] According to the corrected marking data and the images of each component, perform model training to obtain a component recognition model.
[0206] The implementation principles and technical effects of the steps implemented when the computer program in the embodiments of this application is executed by the processor are similar to those of the above-mentioned component recognition model training method, and will not be elaborated here.
[0207] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0208] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.
[0209] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0210] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for training a component recognition model, characterized in that, The method includes: Obtaining component images installed on various types of circuit boards, and obtaining the labeled attribute information of each component in each of the component images; the labeled attribute information represents the attribute information related to component labeling in component recognition model training; Determining the labeling specification information corresponding to each component according to the labeled attribute information of each component; Based on the labeling specification information corresponding to each component, labeling each component in each of the component images to obtain the labeled data of each component; Conducting a labeling quality review on the labeled data of each component, and correcting error information in the labeled data of each component; Performing model training according to the corrected labeled data and each of the component images to obtain a component recognition model.
2. The method according to claim 1, wherein The obtaining of component images installed on various types of circuit boards includes: Scanning each of the circuit boards through a multispectral imaging device to obtain multispectral fusion images of the electronic components on each of the circuit boards; the circuit boards include printed circuit boards and flexible circuit boards; the multispectral fusion images include images collected under different lighting conditions, shooting angles, and background environments; Determining the multispectral fusion images of the electronic components on each of the circuit boards as the component images installed on various types of circuit boards.
3. The method according to claim 1 or 2, characterized in that, The obtaining of the labeled attribute information of each component in each of the component images includes: Obtaining the labeled attribute information matching each of the identification information in a pre-maintained labeled attribute file according to the identification information of each component; Determining the labeled attribute information matching each of the identification information in the labeled attribute file as the labeled attribute information of each component in each of the component images.
4. The method according to claim 1 or 2, characterized in that, The determining of the labeling specification information corresponding to each component according to the labeled attribute information of each component includes: Obtaining the mapping relationship between different labeled attribute information and different labeling specification information; According to each of the labeled attribute information, obtaining the labeling specification information matching each of the labeled attribute information from the mapping relationship, and determining the special labeling specification information corresponding to each component as the labeling specification information matching each of the labeled attribute information; Determining the general labeling specification information for component labeling and the special labeling specification information corresponding to each component as the labeling specification information corresponding to each component.
5. The method according to claim 1 or 2, characterized in that, The correcting of error information in the labeled data of each component includes: Obtaining multiple candidate labeled data pre-labeled by multiple users for each of the components; Determining the labeling consistency coefficient among the users according to the multiple candidate labeled data; Based on the labeling consistency coefficient, instructing each user to correct the error information in each of the labeled data to obtain the corrected labeled data.
6. The method according to claim 5, wherein The determining of the labeling consistency coefficient among the users according to the multiple candidate labeled data includes: Determining the actual consistency ratio and the random consistency ratio according to each of the candidate labeled data and the number of each component; Determining the labeling consistency coefficient according to the actual consistency ratio and the random consistency ratio.
7. The method according to claim 1 or 2, characterized in that Performing model training based on the corrected annotation data and each component image to obtain a component recognition model, including: Obtaining a training data set, a validation data set, and a test data set according to the corrected annotation data and each component image; Performing model training on a preset neural network according to the training data set to obtain an initial component recognition model; Adjusting the model parameters of the initial component recognition model according to the validation data set to obtain an adjusted initial component recognition model; Testing the adjusted initial component recognition model according to the test data set to obtain the component recognition model.
8. The method according to claim 7, characterized in that, The performing model training on a preset neural network according to the training data set to obtain an initial component recognition model includes: Performing data augmentation processing on the training data set to obtain a processed training data set; the data augmentation processing includes at least one of geometric transformation, color transformation, and adding noise; the processed training data set includes training component images and training annotation data corresponding to the training component images; Inputting the training component images into the neural network to obtain predicted component categories output by the neural network; Determining a prediction loss value of the neural network according to the predicted component categories, the training annotation data, and a preset loss function; Adjusting the model parameters of the neural network based on the prediction loss value until the training is completed to obtain the initial component recognition model.
9. The method according to claim 1 or 2, characterized in that, Before performing annotation on each component in each component image based on the annotation specification information corresponding to each component to obtain the annotation data of each component, the method further includes: Performing data preprocessing on each component image to obtain a processed component image; the data preprocessing includes at least one of size normalization, grayscale conversion, color standardization, and data cleaning.
10. A device for training a component recognition model, characterized in that, The device includes: An image acquisition module, configured to acquire component images installed on various types of circuit boards and acquire annotation attribute information of each component in each component image; the annotation attribute information represents attribute information related to component annotation in component recognition model training; A specification information determination module, configured to determine the annotation specification information corresponding to each component according to the annotation attribute information of each component; A component annotation module, configured to perform annotation on each component in each component image based on the annotation specification information corresponding to each component to obtain the annotation data of each component; An error information correction module, configured to perform annotation quality review on the annotation data of each component and correct error information in the annotation data of each component; A model training module, configured to perform model training according to the corrected annotation data and each component image to obtain a component recognition model.