WO2023236038A1 - Update method and system for circuit board detection model, and electronic device and storage medium - Google Patents

Update method and system for circuit board detection model, and electronic device and storage medium Download PDF

Info

Publication number
WO2023236038A1
WO2023236038A1 PCT/CN2022/097383 CN2022097383W WO2023236038A1 WO 2023236038 A1 WO2023236038 A1 WO 2023236038A1 CN 2022097383 W CN2022097383 W CN 2022097383W WO 2023236038 A1 WO2023236038 A1 WO 2023236038A1
Authority
WO
WIPO (PCT)
Prior art keywords
circuit board
detection model
board image
information
server
Prior art date
Application number
PCT/CN2022/097383
Other languages
French (fr)
Chinese (zh)
Inventor
李岩
刘宁
Original Assignee
西门子股份公司
西门子(中国)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西门子股份公司, 西门子(中国)有限公司 filed Critical 西门子股份公司
Priority to PCT/CN2022/097383 priority Critical patent/WO2023236038A1/en
Publication of WO2023236038A1 publication Critical patent/WO2023236038A1/en

Links

Images

Definitions

  • This application relates to artificial intelligence, and in particular to a method, system, electronic device and storage medium for updating a circuit board detection model.
  • one method is to collect and manually annotate all data samples in the current installation environment, and then update the basic detection model based on the annotations derived from the annotation to obtain a new detection model to improve the accuracy of anomaly detection. Effect.
  • annotating all data samples within the installation scenario to update the basic detection model will consume a lot of labor.
  • embodiments of the present invention provide a method, system, electronic device and storage medium for updating a circuit board detection model, so as to at least solve or alleviate the above problems.
  • a method for updating a circuit board detection model is provided, which is applied to edge devices.
  • the method includes: inputting at least one circuit board image into the first detection model, and obtaining each circuit board image.
  • a method for updating a circuit board detection model is provided, which is applied to a server.
  • the method includes: receiving update information from an edge device, wherein the update information is based on at least one difficult sample The feature vectors and labels of the difficult samples are determined, and the feature vectors of the difficult samples are obtained by inputting the circuit board image into the first detection model; the first detection model is updated according to the update information to obtain the second detection model; the The second detection model is delivered to the edge device, so that the edge device performs anomaly detection on the circuit board through the second detection model.
  • a system for updating a circuit board detection model including: an edge device and a server, the edge device being configured to execute the above-mentioned updating method of the circuit board detection model of the first aspect;
  • the server is used to execute the updating method of the circuit board inspection model of the second aspect.
  • an electronic device including: a processor, a communication interface, a memory and a communication bus.
  • the processor, the memory and the communication interface complete communication with each other through the communication bus;
  • the memory is used to store At least one executable instruction, the executable instruction causes the processor to perform an operation corresponding to the above-mentioned updating method of the circuit board inspection model in the first aspect or the above-mentioned updating method of the circuit board inspection model in the second aspect.
  • a computer storage medium on which a computer program is stored.
  • the program is executed by a processor, the updating method of the circuit board inspection model as described in the first aspect or the above-mentioned third aspect is implemented.
  • Two aspects of circuit board inspection model update methods Two aspects of circuit board inspection model update methods.
  • a computer program product including computer instructions.
  • the computer instructions instruct the computing device to perform the updating method of the circuit board detection model as described in the first aspect or the circuit board detection model as described in the second aspect. Detect the operations corresponding to the update method of the model.
  • the edge device after the edge device obtains the first detection model, it can obtain difficult samples by mining at least one input circuit board image for difficult samples.
  • all input circuits can be Annotating plate images can reduce a large amount of labor costs and man-hours used to annotate samples.
  • the server By updating the first detection model through the server, the server automatically completes the update action of the first detection model, and the server automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding working hours.
  • the server uses the updated information to update the first detection model to a second detection model that is more suitable for the current environment, which can improve the effect of anomaly detection.
  • Figure 1 is a schematic diagram of a method for updating a circuit board detection model according to an embodiment of the present application
  • Figure 2 is a schematic diagram of a method for updating a circuit board detection model according to another embodiment of the present application.
  • Figure 3 is a schematic diagram of a circuit board detection model system according to an embodiment of the present application.
  • Figure 4 is a schematic diagram of a method for updating a circuit board detection model according to another embodiment of the present application.
  • Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • the server obtains the first detection model
  • the server delivers the first detection model to the edge device
  • Edge device obtains at least one circuit board image
  • the edge device inputs at least one circuit board image into the first detection model
  • Edge device performs difficult sample mining on at least one circuit board image
  • the edge device obtains the label of each difficult sample separately
  • the edge device obtains the gradient based on the feature vector and label of each difficult sample, and uses the gradient as update information
  • the edge device sends updated information to the server
  • the server receives the update information sent by the edge device and performs data cleaning on the update information.
  • the server updates the first detection model based on the updated information after data cleaning.
  • the server delivers the second detection model to the edge device
  • FIG. 1 is a circuit board detection model updating method 100 according to an embodiment of the present application, which is applied to edge devices. As shown in Figure 1, the circuit board inspection model updating method 100 includes the following steps:
  • Step 101 Input at least one circuit board image into the first detection model to obtain the feature vector of each circuit board image.
  • a first detection model is deployed on the edge device.
  • the first detection model is used to detect abnormality of the circuit board based on the circuit board image.
  • the circuit board image may be an image of the circuit board to be detected during the actual production process of the circuit board.
  • the edge device obtains the circuit board image
  • the obtained circuit board image can be input into the deployed first detection model.
  • the first detection model performs anomaly detection on the circuit board based on the input circuit board image.
  • the first detection model A feature vector corresponding to the circuit board image will be generated, and the feature vector may indicate the abnormality detection result of the circuit board by the corresponding first detection model.
  • Step 102 Perform difficult sample mining on at least one circuit board image to obtain at least one difficult sample.
  • the first detection model After inputting each circuit board image into the first detection model respectively, the first detection model performs abnormality detection on the corresponding circuit board based on the input circuit board image. According to the intermediate information obtained during the abnormality detection process of the first detection model, it can be Perform difficult sample mining on each circuit board image to obtain at least one difficult sample. Difficult samples refer to circuit board images where there is a large error between the prediction result and the actual abnormality of the circuit board. The number of difficult samples is less than or equal to the number of circuit board images input to the first detection model.
  • Step 103 Obtain the label of each difficult sample respectively.
  • each difficult sample is labeled separately, and the label corresponding to each difficult sample is obtained.
  • the label is used to indicate whether there is an abnormality in the corresponding difficult sample (circuit board image).
  • the labeling of difficult samples can be completed through manual annotation, or it can be obtained by averaging multiple prediction results of the first detection model on the enhanced data.
  • the method of using the average of multiple prediction results as the label of a difficult sample for each difficult sample, multiple new samples are formed by adding random perturbations to the difficult sample, and then the first detection model is used to detect the generated multiple new samples.
  • the samples are predicted separately, and the average of the prediction results of the first detection model for multiple new samples is used as the label of the difficult sample. For example, by adding random perturbation to a difficult sample, 20 new samples are generated. When predicting these 20 new samples through the first detection model, the prediction results of 18 new samples are that the circuit board has no abnormality, and 2 new samples The prediction result is that there is an abnormality in the circuit board, then the label of the difficult sample is determined to be no abnormality.
  • Step 104 Obtain update information based on the feature vector and label of each difficult sample.
  • the feature vector of each difficult sample is obtained based on the feature vector of each circuit board image that has been obtained.
  • the update information includes the feature vector and label of each difficult sample.
  • the update information is used to A detection model is updated.
  • Step 105 Send the update information to the server.
  • the edge device After the edge device obtains the update information, it sends the update information to the server, and the server updates the first detection model according to the update information, obtains the second detection model, and sends the second detection model to the edge device 10 .
  • the first detection model is stored on the server. After the edge device sends the update information to the server, the server can automatically update the first detection model based on the update information to obtain the second detection model. The process of the server updating the first detection model does not require Human involvement.
  • the server can connect to multiple edge devices and update the detection model deployed on each edge device separately. After obtaining the second detection model, the server will deliver the second detection model to the corresponding edge device.
  • Step 106 Obtain the second detection model issued by the server, and perform anomaly detection on the circuit board through the second detection model.
  • the edge device After the edge device receives the second detection model issued by the server, the edge device uses the second detection model to detect abnormalities on the circuit board, that is, inputs the circuit board image of the circuit board to be detected into the second detection model, and detects it through the second detection model. Is there any abnormality in the corresponding circuit board?
  • the edge device can input the circuit board image into the first detection model to obtain the feature vector of each circuit board image, and can also perform difficult sample mining on multiple circuit board images input into the first detection model to obtain difficult samples.
  • the samples are manually annotated to obtain labels, and then the feature vectors and labels of the difficult samples can be obtained.
  • Update information is obtained based on the feature vectors and labels of the difficult samples.
  • the server updates the first detection model based on the update information. , and delivers the obtained second detection model to the edge device, and then the edge device can use the second detection model to perform anomaly detection on the circuit board.
  • the update information is sent to the server, and the server updates the first detection model according to the update information.
  • the server can automatically complete the update action of the first detection model, and automatically deliver the updated second detection model to the edge device. The process of updating the first detection model based on the updated information does not require manual participation, thereby reducing manual costs.
  • the server uses the updated information to update the first detection model to a second detection model that is more suitable for the current environment, which can improve the effect of anomaly detection.
  • the update information includes the feature vectors and labels of each difficult sample, that is, after obtaining the feature vectors and labels of the difficult samples, the feature vectors and labels of the difficult samples are directly sent to the server as update information, by The server updates the first detection model according to the feature vector and label of the difficult sample to obtain the second detection model.
  • the feature vector of the difficult sample can indicate the abnormality detection result of the corresponding circuit board by the first detection model, and the label of the difficult sample can indicate whether the corresponding circuit board actually has an abnormality
  • the feature vector of the difficult sample is and labels as update information, so that the update information can reflect the accuracy of the first detection model in detecting anomalies on the circuit board on the edge device, and then updating the first detection model through the update information can improve the accuracy of the detection model in detecting anomalies on the circuit board. accuracy.
  • the gradient corresponding to the difficult sample can be calculated based on the feature vector and label of each difficult sample, and then the gradient of each difficult sample is determined as Update information.
  • the edge device can calculate the gradient of the difficult sample through the back propagation algorithm based on the feature vector and label of the difficult sample.
  • the edge device can also use other methods to calculate gradients based on the feature vectors and labels of difficult samples, which is not limited in the embodiments of the present application.
  • the edge device calculates the gradient based on the feature vector and label of the difficult sample, and transmits the gradient of each difficult sample to the server as update information, so that the server updates the first detection model based on the gradient of each difficult sample. Since the feature vectors and labels of difficult samples cannot be inferred based on the gradient of difficult samples, the edge device sends the gradient of difficult samples to the server as update information, ensuring the data security of the circuit board image and thus protecting the user's privacy. In addition, the edge device calculates the gradient based on the feature vectors and labels of difficult samples, and the server can directly update the first detection model based on the gradient, so that the edge device can share part of the server's calculations, thereby reducing the load on the server.
  • the center offset information f c (x), width offset information f w (x) and width offset information f w (x) output by the first detection model for each circuit board image can be obtained Height offset information f h (x), according to the center offset information f c (x), width offset information f w (x) and height offset information f h (x), the corresponding position of each circuit board image can be determined respectively.
  • Uncertainty score U, and then several circuit board images with corresponding larger uncertainty scores U can be determined as difficult samples.
  • the center offset information f c (x) can indicate the center offset of the target object in the circuit board image
  • the width offset information f w (x) can indicate the width offset and height offset information of the target object in the circuit board image.
  • f h (x) can indicate the height offset of the target object in the circuit board image.
  • the target objects include images of various components on the circuit board.
  • the first detection model can integrate the center offset, width offset and height offset of each circuit board image into center offset information f c (x) , width offset information f w (x) and height offset information f h (x), center offset information f c (x), width offset information f w (x) and height offset information f h (x)
  • the uncertainty score U corresponding to each circuit board image can be calculated as basic information.
  • the uncertainty score U can indicate the accuracy of the first detection model in abnormal detection of the corresponding circuit board.
  • the higher the uncertainty score U the lower the accuracy of the first detection model in abnormal detection of the corresponding circuit board, so that the first detection model can detect the abnormality of the corresponding circuit board.
  • Several circuit board images with large uncertainty scores U are determined to be difficult samples. Specifically, at least one circuit board image with a corresponding uncertainty score U greater than a preset threshold may be determined as a difficult sample, or at least one circuit board image with a corresponding uncertainty score U greater than a preset threshold may be determined as a difficult sample.
  • the center offset information f c (x) of each circuit board image includes the center offset mean ⁇ c and the center offset variance ⁇ c
  • the width offset information f w (x) includes the width
  • the height offset information f h (x) includes the height offset mean ⁇ h and the height offset variance ⁇ h .
  • the width uncertainty score U w of the circuit board image can be determined based on the moving mean ⁇ w and the width offset variance ⁇ w .
  • the width uncertainty score U w can be determined.
  • the high uncertainty score U h of the circuit board image is determined.
  • the center offset mean ⁇ c , center offset variance ⁇ c , width offset mean ⁇ w , width offset variance ⁇ w , corresponding to the circuit board image can be obtained.
  • the height offset mean ⁇ h and the height offset variance ⁇ h By inputting the center offset mean ⁇ c and the center offset variance ⁇ c into the Bayesian active learning by disagreement (BALD) acquisition function, the center uncertainty score U c can be obtained, and the width offset mean ⁇ w And the width offset variance ⁇ w is input into the BALD acquisition function, and the width uncertainty score U w can be obtained.
  • the height offset mean ⁇ h and the height offset variance ⁇ h are input into the BALD acquisition function, and the height uncertainty score U h can be obtained. .
  • the mean center offset ⁇ c , center offset variance ⁇ c , width offset mean ⁇ w , width offset variance ⁇ w , and height offset mean of the circuit board image are determined through variational reasoning.
  • ⁇ h and height offset variance ⁇ h are determined through these data.
  • the center uncertainty score U c , width uncertainty score U w and height uncertainty score U h of the circuit board image can be determined through the BALD acquisition function, and then the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h can be determined.
  • the uncertainty score corresponding to the circuit board image is determined based on the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h corresponding to the circuit board image.
  • U the average or maximum value of the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h corresponding to the circuit board image can be determined as the uncertainty corresponding to the circuit board image.
  • Sex rating U the average or maximum value of the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h corresponding to the circuit board image can be determined as the uncertainty corresponding to the circuit board image.
  • the average or maximum value of the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h is determined as the uncertainty score U of the circuit board image, It is guaranteed that the determined uncertainty score U can accurately indicate the accuracy of abnormality detection of the corresponding circuit board by the first detection model, thereby ensuring the accuracy of the determined difficult sample.
  • FIG. 2 is a flow chart of a method for updating a circuit board detection model according to another embodiment of the present application.
  • the method 200 for updating a circuit board detection model can be applied to a server.
  • the circuit board inspection model updating method 200 includes the following steps:
  • Step 201 Receive update information.
  • the server can receive updated information from edge devices.
  • the updated information is determined by the edge device based on the feature vector and label of at least one difficult sample, and the feature vector of the difficult sample is obtained by inputting the circuit board image into the first detection model.
  • the update information is used to update the first detection model.
  • Step 202 Update the first detection model.
  • the first detection model used by the edge device is stored on the server. After the server obtains the update information, the server can update the first detection model according to the update information to obtain the second detection model.
  • Step 203 Send the second detection model to the edge device.
  • the server can deliver the second detection model to the edge device, so that the edge device can perform anomaly detection on the circuit board through the second detection device.
  • the server updates the first detection model based on the update information.
  • the server can automatically complete the update action of the first detection model and automatically deliver the updated second detection model to the edge device.
  • the model update and delivery process does not require manual labor. Participation can further reduce labor costs and corresponding working hours.
  • the server can perform data cleaning on the updated information, and then update the first detection model based on the updated information after data cleaning.
  • the prediction results of multiple edge devices for the difficult sample through their respective detection models are obtained. If the consistency of the prediction results of each edge device for the difficult sample meets the preset conditions, the prediction results in the update information are retained. Information corresponding to the difficult sample. If the consistency of the prediction results of the difficult sample by each edge device does not meet the preset conditions, the information corresponding to the difficult sample will be deleted from the updated information.
  • the preset condition may be that the ratio of the number of edge devices with consistent prediction results to the total number of edge devices is greater than a preset threshold, such as greater than 80%.
  • update information can be the feature vectors and labels of difficult samples, or the gradient of difficult samples
  • data cleaning of the update information is to clean out the feature vectors and labels of wrongly labeled samples, or clean out the gradients of wrongly labeled samples.
  • the update information includes the feature vector and label of at least one difficult sample, or the update information includes the gradient of at least one difficult sample, wherein the gradient of a difficult sample is based on the feature vector and label of the difficult sample Sure.
  • the server when the update information includes the feature vectors and labels of difficult samples, the server can accurately update the first detection model based on the feature vectors and labels of difficult samples to ensure the model update effect.
  • the update information includes the gradient of a difficult sample
  • the server can update the first detection model based on the difficult sample. There is no need to preprocess the difficult sample before updating the model, which can reduce the load on the server.
  • FIG. 3 is a schematic diagram of a circuit board detection model update system according to an embodiment of the present application.
  • a circuit board detection model update system 300 includes an edge device 10 and a server 20 .
  • the edge device 10 is configured to execute the above-mentioned updating method 100 of a circuit board detection model applied to an edge device.
  • the server 20 is configured to execute the above updating method 200 for the circuit board detection model applied to the server.
  • the edge device 10 is configured to generate update information for updating the first detection model through the input at least one circuit board image and the deployed first detection model, and send the update information to the server 20 .
  • the server 20 is configured to receive the update information sent by the edge device 10 , update the first detection model according to the update information, obtain the second detection model, and send the updated second detection model to the edge device 10
  • the difficult sample can be obtained by mining at least one input circuit board image for difficult samples.
  • the server automatically completes the update action of the first detection model, and the server 20 automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding man-hours.
  • the server uses the updated information to update the first detection model to a second detection model that is more suitable for the current environment, which can improve the effect of anomaly detection.
  • the server 20 is a cloud server.
  • the cloud server and multiple edge devices 10 can transmit information through the network.
  • the cloud server updates the first detection model by obtaining the update information uploaded by each edge device 10, and updates each edge device 10.
  • the second detection model corresponding to the edge device 10 is delivered to each edge device 10 to complete the update of the first detection model, which reduces the amount of settings on the server 20 and can support the first detection model deployed on large-scale edge devices 10 Make an update.
  • FIG. 4 is a circuit board detection model update method 400 according to an embodiment of the present application.
  • the circuit board detection model update method 400 can be executed by the edge device 10 and the server 20 in the previous embodiment. Unless otherwise stated, the following method is implemented.
  • the edge device in the example may be the edge device 10 in the previous embodiment
  • the server in the following method embodiment may be the server 20 in the previous embodiment.
  • the circuit board detection model update method 400 includes the following steps:
  • Step 401 The server obtains the first detection model.
  • a first detection model is obtained, and the first detection model is used to detect abnormalities on the circuit board based on the circuit board images.
  • the server can deliver the first detection model to at least one edge device.
  • Step 402 The server delivers the first detection model to the edge device.
  • the server After the server obtains the first detection model, it delivers the first detection model to at least one edge device respectively, so that the edge device can detect anomalies on the circuit board through the first detection model.
  • Step 403 The edge device obtains at least one circuit board image.
  • the circuit board image can be an image of the circuit board to be inspected during the actual production process of the circuit board.
  • the circuit board after installation can be captured by a camera or other image capturing device to obtain at least one circuit board image, and the at least one circuit board image can be Sent to edge device.
  • Step 404 The edge device inputs at least one circuit board image into the first detection model.
  • the edge device After the edge device obtains at least one circuit board image, the obtained at least one circuit board image is input into the deployed first detection model, the input at least one circuit board image can be processed, and the information of each circuit board is obtained. Feature vector.
  • Step 405 The edge device performs difficult sample mining on at least one circuit board image.
  • each circuit board image is input into the first detection model, each circuit board image is processed through the first detection model. After completing the processing, difficult samples are mined for all samples to obtain at least one difficult sample and the number of difficult samples. Less than or equal to the number of board images entered.
  • Step 406 The edge device obtains the label of each difficult sample respectively.
  • each difficult sample is labeled separately, and the label corresponding to each difficult sample is obtained.
  • the label is used to indicate whether there is an abnormality in the corresponding difficult sample (circuit board image).
  • labeling difficult samples can be completed through manual annotation. Difficult samples obtain the label of each labeled difficult sample separately.
  • Step 407 The edge device obtains the gradient according to the feature vector and label of each difficult sample, and uses the gradient as update information.
  • the edge device obtains the feature vector of each difficult sample based on the feature vector of each circuit board image that has been obtained. According to the feature vector and label of each difficult sample, the gradient corresponding to the difficult sample is calculated, and the gradient of each difficult sample is determined as the update information. The calculation of the gradient is implemented in the edge device through the back propagation algorithm (Back propagation).
  • Step 408 The edge device sends the update information to the server.
  • the edge device After the edge device obtains the update information, it sends the update information to the server, so that the server updates the first detection model through the update information and obtains the second detection model.
  • Step 409 The server receives the update information sent by the edge device and performs data cleaning on the update information.
  • the server After the server receives the update information from the edge device, the server performs data cleaning on the update information and filters out the information gradients of difficult samples with incorrect labels in the update information.
  • Step 410 The server updates the first detection model according to the updated information after data cleaning.
  • the server After the server performs data cleaning on the updated information, the server updates the first detection model based on the updated information after data cleaning to obtain a second detection model.
  • Step 411 The server delivers the second detection model to the edge device.
  • the server After the server completes updating the first detection model and obtains the second detection model, the server delivers the second detection model to the edge device, so that the edge device performs anomaly detection on the circuit board through the second detection device.
  • the difficult sample can be obtained by mining at least one input circuit board image for difficult samples.
  • all input Annotating circuit board images can reduce a large amount of labor costs and man-hours used to annotate samples.
  • the server automatically completes the update action of the first detection model, and the server automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding working hours.
  • the gradient is obtained through the feature vector and label of the difficult sample, and the updated information is obtained based on the gradient.
  • the data obtained by the server is the gradient, which ensures the security of the updated information and protects the user's privacy.
  • the process of calculating the gradient is implemented in the edge device, which can reduce the workload of the server and improve the operating efficiency of the server.
  • the server updates the first detection model to a second detection model that is more suitable for the current environment by updating the information, which can improve the effect of anomaly detection.
  • FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • the electronic device 50 may include: a processor (processor) 51, a communications interface (Communications Interface) 52, a memory (memory) 53, and a communication bus 54.
  • processor processor
  • communications interface Communication Interface
  • memory memory
  • communication bus 54 a communication bus
  • the processor 51, the communication interface 52, and the memory 53 complete communication with each other through the communication bus 54.
  • Communication interface 52 is used to communicate with other electronic devices or servers.
  • the processor 51 is configured to execute the program 55. Specifically, the processor 51 can execute the relevant steps in the foregoing embodiment of the method for updating the circuit board detection model.
  • program 55 may include program code including computer operating instructions.
  • the processor 51 may be a CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present application.
  • the one or more processors included in the smart device can be the same type of processor, such as one or more CPUs; or they can be different types of processors, such as one or more CPUs and one or more ASICs.
  • Memory 53 is used to store programs 55.
  • the memory 53 may include high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the program 55 can be specifically used to cause the processor 51 to execute the updating method of the circuit board detection model in the previous embodiment.
  • each step in the program 55 please refer to the corresponding steps and corresponding descriptions in the units in the foregoing embodiment of the method for updating the circuit board detection model, which will not be described again here.
  • Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described devices and modules can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be described again here.
  • the difficult sample can be obtained by mining at least one input circuit board image for difficult samples.
  • the server automatically completes the update action of the first detection model, and the server automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding working hours.
  • the present application also provides a computer-readable storage medium that stores instructions for causing a machine to execute the updating method of a circuit board inspection model as described herein.
  • a system or device equipped with a storage medium may be provided, on which the software program code that implements the functions of any of the above embodiments is stored, and the computer (or CPU or MPU) of the system or device ) reads and executes the program code stored in the storage medium.
  • the program code itself read from the storage medium can implement the functions of any one of the above embodiments, and therefore the program code and the storage medium storing the program code form part of this application.
  • Examples of storage media for providing program codes include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), Tapes, non-volatile memory cards and ROM.
  • the program code can be downloaded from the server computer via the communications network.
  • Embodiments of the present application also provide a computer program product, including computer instructions, which instruct the computing device to perform any corresponding operation in the multiple method embodiments mentioned above.
  • each component/step described in the embodiments of this application can be split into more components/steps, or two or more components/steps or partial operations of components/steps can be combined into New components/steps to achieve the purpose of the embodiments of this application.
  • the above-mentioned methods according to the embodiments of the present application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or by The computer code downloaded by the network is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium, so that the method described here can be stored using a general-purpose computer, a special-purpose processor or a programmable computer. or such software processing on a recording medium of dedicated hardware such as ASIC or FPGA.
  • a recording medium such as CD ROM, RAM, floppy disk, hard disk or magneto-optical disk
  • the computer code downloaded by the network is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium, so that the method described here can be stored using a general-purpose computer, a special-purpose processor or a programmable
  • a computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code when the software or computer code is used by the computer, When accessed and executed by a processor or hardware, the methods described herein are implemented. Furthermore, when a general-purpose computer accesses code for implementing the methods illustrated herein, execution of the code converts the general-purpose computer into a special-purpose computer for performing the methods illustrated herein.
  • the execution order of each step is not fixed and can be adjusted as needed.
  • the system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented by multiple Some components in separate devices are implemented together.
  • the hardware module can be implemented mechanically or electrically.
  • a hardware module may include permanently dedicated circuitry or logic (such as a specialized processor, FPGA, or ASIC) to complete the corresponding operation.
  • Hardware modules may also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which can be temporarily set by software to complete corresponding operations.
  • the specific implementation method mechanical method, or dedicated permanent circuit, or temporarily installed circuit

Abstract

An update method and system for a circuit board detection model, and an electronic device and a storage medium. When applied to an edge device, the update method comprises: inputting at least one circuit board image into a first detection model, so as to obtain a feature vector of each circuit board image (101); performing difficult sample mining on the at least one circuit board image (102); respectively acquiring a label of each difficult sample (103); obtaining update information according to the feature vector and the label of each difficult sample (104); sending the update information to a server, such that the server updates the first detection model according to the update information, so as to obtain a second detection model (105); and the edge device performing anomaly detection on a circuit board by means of the second detection model (106). The problem of massive labor costs being consumed due to it being necessary to label all samples when detection is performed on a circuit board is solved; and update information is generated for a feature vector and a label of a difficult sample, such that the accuracy and high efficiency of update of a detection model can be ensured.

Description

电路板检测模型的更新方法、系统、电子设备和存储介质Update method, system, electronic device and storage medium for circuit board inspection model 技术领域Technical field
本申请涉及人工智能,尤其涉及一种电路板检测模型的更新方法、系统、电子设备和存储介质。This application relates to artificial intelligence, and in particular to a method, system, electronic device and storage medium for updating a circuit board detection model.
背景技术Background technique
当在自动电路板安装过程中,为了降低开发成本,需要在安装场景上部署深度学习模型,对电路板进行异常检测。在这些场景中,虽然有共性的要求,但实际上在不同的安装场景下都存在着差异,例如,不同的照明环境、不同的组件、不同的摄像机位置等。如果在不同的安装场景上直接部署基础检测模型将导致异常检测的效果变差,不能很好的反映当前安装场景中的电路板异常情况。During the automatic circuit board installation process, in order to reduce development costs, it is necessary to deploy a deep learning model on the installation scenario to detect abnormalities on the circuit board. Although there are common requirements in these scenarios, there are actually differences in different installation scenarios, such as different lighting environments, different components, different camera positions, etc. If the basic detection model is directly deployed on different installation scenarios, the effect of anomaly detection will be poor, and it will not be able to well reflect the abnormal conditions of the circuit board in the current installation scenario.
目前,为了处理上述差异,一种方法是在当前安装环境下收集和人工标注所有的数据样本,然后根据标注得出的注释,对基础检测模型进行更新,获得新检测模型,以提高异常检测的效果。然而,对于安装场景内的所有数据样本都进行标注以更新基础检测模型会耗费大量的人工。Currently, in order to deal with the above differences, one method is to collect and manually annotate all data samples in the current installation environment, and then update the basic detection model based on the annotations derived from the annotation to obtain a new detection model to improve the accuracy of anomaly detection. Effect. However, annotating all data samples within the installation scenario to update the basic detection model will consume a lot of labor.
发明内容Contents of the invention
为了解决上述技术问题,本发明实施例提供了一种电路板检测模型的更新方法、系统、电子设备和存储介质,以至少解决或缓解上述问题。In order to solve the above technical problems, embodiments of the present invention provide a method, system, electronic device and storage medium for updating a circuit board detection model, so as to at least solve or alleviate the above problems.
根据本申请实施例的第一方面,提供了一种电路板检测模型的更新方法,应用于边缘设备,所述方法包括:将至少一张电路板图像输入第一检测模型,获得每张电路板图像的特征向量,其中,所述第一检测模型用于基于电路板图像对电路板进行异常检测;对所述至少一张电路板图像进行困难样本挖掘,获得至少一个困难样本;分别获取每个所述困难样本的标签;根据各所述困难样本的特征向量和标签,获得更新信息;将所述更新信息发送给服务器,以使所述服务器根据所述更新信息对所述第一检测模型进行更新,获得第二检测模型;获取所述服务器下发的所述第二检测模型,并通过所述第二检测模型对电路板进行异常检测。According to a first aspect of the embodiment of the present application, a method for updating a circuit board detection model is provided, which is applied to edge devices. The method includes: inputting at least one circuit board image into the first detection model, and obtaining each circuit board image. The feature vector of the image, wherein the first detection model is used to detect abnormality of the circuit board based on the circuit board image; perform difficult sample mining on the at least one circuit board image to obtain at least one difficult sample; obtain each Labels of the difficult samples; obtain update information based on the feature vectors and labels of each difficult sample; send the update information to the server, so that the server performs on the first detection model based on the update information Update to obtain a second detection model; obtain the second detection model issued by the server, and perform anomaly detection on the circuit board through the second detection model.
根据本申请实施例的第二方面,提供了一种电路板检测模型的更新方法,应用于服务器,所述方法包括:接收来自边缘设备的更新信息,其中,所述更新信息根据至少一个困难样本的特征向量和标签确定,所述困难样本的特征向量通过将电路板图像输入第一检测模型获得; 根据所述更新信息对所述第一检测模型进行更新,获得第二检测模型;将所述第二检测模型下发至所述边缘设备,以使所述边缘设备通过所述第二检测模型对电路板进行异常检测。According to a second aspect of the embodiment of the present application, a method for updating a circuit board detection model is provided, which is applied to a server. The method includes: receiving update information from an edge device, wherein the update information is based on at least one difficult sample The feature vectors and labels of the difficult samples are determined, and the feature vectors of the difficult samples are obtained by inputting the circuit board image into the first detection model; the first detection model is updated according to the update information to obtain the second detection model; the The second detection model is delivered to the edge device, so that the edge device performs anomaly detection on the circuit board through the second detection model.
根据本申请实施例的第三方面,提供了一种电路板检测模型的更新系统,包括:边缘设备和服务器,所述边缘设备用于执行上述第一方面的电路板检测模型的更新方法;所述服务器用于执行上述第二方面的电路板检测模型的更新方法。According to a third aspect of the embodiment of the present application, a system for updating a circuit board detection model is provided, including: an edge device and a server, the edge device being configured to execute the above-mentioned updating method of the circuit board detection model of the first aspect; The server is used to execute the updating method of the circuit board inspection model of the second aspect.
根据本申请实施例的第四方面,提供了一种电子设备,包括:处理器、通信接口、存储器和通信总线,处理器、存储器和通信接口通过通信总线完成相互间的通信;存储器用于存放至少一可执行指令,可执行指令使处理器执行如上述第一方面的电路板检测模型的更新方法或如上述第二方面的电路板检测模型的更新方法对应的操作。According to a fourth aspect of the embodiment of the present application, an electronic device is provided, including: a processor, a communication interface, a memory and a communication bus. The processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is used to store At least one executable instruction, the executable instruction causes the processor to perform an operation corresponding to the above-mentioned updating method of the circuit board inspection model in the first aspect or the above-mentioned updating method of the circuit board inspection model in the second aspect.
根据本申请实施例的第五方面,提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面的电路板检测模型的更新方法或如上述第二方面的电路板检测模型的更新方法。According to a fifth aspect of the embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the updating method of the circuit board inspection model as described in the first aspect or the above-mentioned third aspect is implemented. Two aspects of circuit board inspection model update methods.
根据本申请实施例的第六方面,提供了一种计算机程序产品,包括计算机指令,计算机指令指示计算设备执行如上述第一方面的电路板检测模型的更新方法或如上述第二方面的电路板检测模型的更新方法对应的操作。According to a sixth aspect of the embodiment of the present application, a computer program product is provided, including computer instructions. The computer instructions instruct the computing device to perform the updating method of the circuit board detection model as described in the first aspect or the circuit board detection model as described in the second aspect. Detect the operations corresponding to the update method of the model.
由上述技术方案可知,在边缘设备获得第一检测模型后,可以通过对输入的至少一张电路板图像进行困难样本挖掘,获得困难样本,通过对困难样本进行人工标注,可以不对所有输入的电路板图像进行标注,可以减少大量的用于对样本进行标注的人工成本和工时。通过服务器更新第一检测模型,服务器自动完成了对第一检测模型的更新动作,并且服务器自动将更新后的第二检测模型下发至服务器,也减少了人工成本及相应的工时。It can be seen from the above technical solution that after the edge device obtains the first detection model, it can obtain difficult samples by mining at least one input circuit board image for difficult samples. By manually annotating the difficult samples, all input circuits can be Annotating plate images can reduce a large amount of labor costs and man-hours used to annotate samples. By updating the first detection model through the server, the server automatically completes the update action of the first detection model, and the server automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding working hours.
通过困难样本的特征向量和标签,获得更新信息,可以提高更新信息的精确性,服务器通过更新信息将第一检测模型更新为更适合当前环境下的第二检测模型,可以提高异常检测的效果。Obtaining updated information through the feature vectors and labels of difficult samples can improve the accuracy of the updated information. The server uses the updated information to update the first detection model to a second detection model that is more suitable for the current environment, which can improve the effect of anomaly detection.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅是本申请实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some of the embodiments recorded in the embodiments of this application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
图1是本申请一个实施例的电路板检测模型的更新方法的示意图;Figure 1 is a schematic diagram of a method for updating a circuit board detection model according to an embodiment of the present application;
图2是本申请另一个实施例的电路板检测模型的更新方法的示意图;Figure 2 is a schematic diagram of a method for updating a circuit board detection model according to another embodiment of the present application;
图3是本申请一个实施例的电路板检测模型的系统的示意图;Figure 3 is a schematic diagram of a circuit board detection model system according to an embodiment of the present application;
图4是本申请又一个实施例的电路板检测模型的更新方法的示意图;Figure 4 is a schematic diagram of a method for updating a circuit board detection model according to another embodiment of the present application;
图5是本申请一个实施例的电子设备的示意图。Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
附图标记列表:List of reference signs:
100:电路板检测模型的更新方法 10:边缘设备                   20:服务器100: Update method for circuit board detection model 10: Edge device 20: Server
200:电路板检测模型的更新方法 300:电路板检测模型的更新系统  50:电子设备200: Update method for circuit board inspection model 300: Update system for circuit board inspection model 50: Electronic equipment
400:电路板检测模型的更新方法 51:处理器                     52:通信接口400: Update method of circuit board inspection model 51: Processor 52: Communication interface
53:储存器                    54:通信总线                   55:程序53: Storage 54: Communication bus 55: Program
101:将至少一张电路板图像输入第一检测模型,获得每张电路板图像的特征向量101: Input at least one circuit board image into the first detection model to obtain the feature vector of each circuit board image
102:对至少一张电路板图像进行困难样本挖掘,获得至少一个困难样本102: Mining difficult samples on at least one circuit board image and obtaining at least one difficult sample
103:分别获取每个困难样本的标签103: Obtain the label of each difficult sample separately
104:根据各困难样本的特征向量和标签,获得更新信息104: Obtain updated information based on the feature vectors and labels of each difficult sample
105:将更新信息发送给服务器105: Send update information to the server
106:获取服务器下发的第二检测模型,并通过第二检测模型对电路板进行异常检测106: Obtain the second detection model issued by the server, and perform anomaly detection on the circuit board through the second detection model
201:接收更新信息201: Receive update information
202:更新第一检测模型202: Update the first detection model
203:将第二检测模型下发至边缘设备203: Deliver the second detection model to the edge device
401:服务器获取第一检测模型401: The server obtains the first detection model
402:服务器将第一检测模型下发至边缘设备402: The server delivers the first detection model to the edge device
403:边缘设备获取至少一张电路板图像403: Edge device obtains at least one circuit board image
404:边缘设备将至少一张电路板图像输入第一检测模型404: The edge device inputs at least one circuit board image into the first detection model
405:边缘设备对至少一张电路板图像进行困难样本挖掘405: Edge device performs difficult sample mining on at least one circuit board image
406:边缘设备分别获取每个困难样本的标签406: The edge device obtains the label of each difficult sample separately
407:边缘设备根据各困难样本的特征向量和标签获得梯度,将梯度作为更新信息407: The edge device obtains the gradient based on the feature vector and label of each difficult sample, and uses the gradient as update information
408:边缘设备将更新信息发送至服务器408: The edge device sends updated information to the server
409:服务器接收边缘设备发送的更新信息,并对更新信息进行数据清洗409: The server receives the update information sent by the edge device and performs data cleaning on the update information.
410:服务器根据进行数据清洗后的更新信息对第一检测模型进行更新410: The server updates the first detection model based on the updated information after data cleaning.
411:服务器将第二检测模型下发至边缘设备411: The server delivers the second detection model to the edge device
具体实施方式Detailed ways
为了使本领域的人员更好地理解本申请实施例中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅 是本申请实施例一部分实施例,而不是全部的实施例。基于本申请实施例中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于本申请实施例保护的范围。In order to enable those in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the description The embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the examples in the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art should fall within the scope of protection of the embodiments of this application.
应用于边缘设备的电路板检测模型的更新方法An updated method for circuit board inspection models applied to edge devices
图1是本申请一个实施例的电路板检测模型的更新方法100,应用于边缘设备。如图1所示,该电路板检测模型的更新方法100包括如下步骤:Figure 1 is a circuit board detection model updating method 100 according to an embodiment of the present application, which is applied to edge devices. As shown in Figure 1, the circuit board inspection model updating method 100 includes the following steps:
步骤101、将至少一张电路板图像输入第一检测模型,获得每张电路板图像的特征向量。Step 101: Input at least one circuit board image into the first detection model to obtain the feature vector of each circuit board image.
边缘设备上部署有第一检测模型,第一检测模型用于基于电路板图像对电路板进行异常检测,电路板图像可以是电路板实际生产过程中,待检测的电路板图像。在边缘设备获得电路板图像后,可以将获得的电路板图像输入已部署的第一检测模型,第一检测模型基于输入的电路板图像对电路板进行异常检测,在检测过程中第一检测模型会生成电路板图像对应的特征向量,特征向量可以指示相应第一检测模型对电路板进行异常检测的结果。A first detection model is deployed on the edge device. The first detection model is used to detect abnormality of the circuit board based on the circuit board image. The circuit board image may be an image of the circuit board to be detected during the actual production process of the circuit board. After the edge device obtains the circuit board image, the obtained circuit board image can be input into the deployed first detection model. The first detection model performs anomaly detection on the circuit board based on the input circuit board image. During the detection process, the first detection model A feature vector corresponding to the circuit board image will be generated, and the feature vector may indicate the abnormality detection result of the circuit board by the corresponding first detection model.
步骤102、对至少一张电路板图像进行困难样本挖掘,获得至少一个困难样本。Step 102: Perform difficult sample mining on at least one circuit board image to obtain at least one difficult sample.
在分别将每张电路板图像输入第一检测模型后,第一检测模型基于输入的电路板图像对相应的电路板进行异常检测,根据第一检测模型进行异常检测过程中获得的中间信息,可以对各电路板图像进行困难样本挖掘,获得至少一个困难样本。困难样本是指预测结果与电路板实际异常情况存在较大误差的电路板图像,困难样本的数量小于或等于输入第一检测模型的电路板图像的数量。After inputting each circuit board image into the first detection model respectively, the first detection model performs abnormality detection on the corresponding circuit board based on the input circuit board image. According to the intermediate information obtained during the abnormality detection process of the first detection model, it can be Perform difficult sample mining on each circuit board image to obtain at least one difficult sample. Difficult samples refer to circuit board images where there is a large error between the prediction result and the actual abnormality of the circuit board. The number of difficult samples is less than or equal to the number of circuit board images input to the first detection model.
步骤103、分别获取每个困难样本的标签。Step 103: Obtain the label of each difficult sample respectively.
针对挖掘出的每个困难样本,对每个困难样本分别进行标注,获得各困难样本对应的标签,标签用于指示相应困难样本(电路板图像)是否存在异常。其中,对困难样本进行标注可以通过人工注释的方式完成,也可以由第一检测模型在经过增强的数据上的多次预测结果的平均得到。For each difficult sample excavated, each difficult sample is labeled separately, and the label corresponding to each difficult sample is obtained. The label is used to indicate whether there is an abnormality in the corresponding difficult sample (circuit board image). Among them, the labeling of difficult samples can be completed through manual annotation, or it can be obtained by averaging multiple prediction results of the first detection model on the enhanced data.
对于将多次预测结果的平均作为困难样本的标签的方式,针对每个困难样本,通过对该困难样本增加随机扰动,形成多个新样本,然后通过第一检测模型对所生成的多个新样本分别进行预测,进而将第一检测模型对多个新样本的预测结果的平均作为该困难样本的标签。比如,通过对一个困难样本增加随机扰动,生成20个新样本,通过第一检测模型对这20个新样本进行预测中,其中18个新样本的预测结果为电路板无异常,2个新样本的预测结果为电路板存在异常,则确定该困难样本的标签为无异常。For the method of using the average of multiple prediction results as the label of a difficult sample, for each difficult sample, multiple new samples are formed by adding random perturbations to the difficult sample, and then the first detection model is used to detect the generated multiple new samples. The samples are predicted separately, and the average of the prediction results of the first detection model for multiple new samples is used as the label of the difficult sample. For example, by adding random perturbation to a difficult sample, 20 new samples are generated. When predicting these 20 new samples through the first detection model, the prediction results of 18 new samples are that the circuit board has no abnormality, and 2 new samples The prediction result is that there is an abnormality in the circuit board, then the label of the difficult sample is determined to be no abnormality.
步骤104、根据各困难样本的特征向量和标签,获得更新信息。Step 104: Obtain update information based on the feature vector and label of each difficult sample.
根据挖掘出的每个困难样本,基于已获取到的各电路板图像的特征向量,分别获取每个困难样本的特征向量,更新信息包括各困难样本的特征向量和标签,更新信息用于对第一检 测模型进行更新。According to each difficult sample mined, the feature vector of each difficult sample is obtained based on the feature vector of each circuit board image that has been obtained. The update information includes the feature vector and label of each difficult sample. The update information is used to A detection model is updated.
步骤105、将更新信息发送给服务器。Step 105: Send the update information to the server.
在边缘设备获得更新信息后,将更新信息发送给服务器,由服务器根据更新信息对第一检测模型进行更新,获得第二检测模型,并将第二检测模型下发至边缘设备10。After the edge device obtains the update information, it sends the update information to the server, and the server updates the first detection model according to the update information, obtains the second detection model, and sends the second detection model to the edge device 10 .
服务器上存储有第一检测模型,边缘设备将更新信息发送给服务器后,服务器可以根据更新信息自动对第一检测模型进行更新,获得第二检测模型,服务器对第一检测模型进行更新的过程无需人工参与。服务器可以连接多个边缘设备,进而可以分别对每个边缘设备上部署的检测模型进行更新。服务器在获得第二检测模型后,会将第二检测模型下发给相对应的边缘设备。The first detection model is stored on the server. After the edge device sends the update information to the server, the server can automatically update the first detection model based on the update information to obtain the second detection model. The process of the server updating the first detection model does not require Human involvement. The server can connect to multiple edge devices and update the detection model deployed on each edge device separately. After obtaining the second detection model, the server will deliver the second detection model to the corresponding edge device.
步骤106、获取服务器下发的第二检测模型,并通过第二检测模型对电路板进行异常检测。Step 106: Obtain the second detection model issued by the server, and perform anomaly detection on the circuit board through the second detection model.
边缘设备在接收到服务器下发的第二检测模型后,边缘设备使用第二检测模型对电路板进行异常检测,即将待检测电路板的电路板图像输入第二检测模型,通过第二检测模型检测相应电路板是否存在异常。After the edge device receives the second detection model issued by the server, the edge device uses the second detection model to detect abnormalities on the circuit board, that is, inputs the circuit board image of the circuit board to be detected into the second detection model, and detects it through the second detection model. Is there any abnormality in the corresponding circuit board?
边缘设备可以将电路板图像输入第一检测模型,以获得每张电路板图像的特征向量,还可以对输入第一检测模型的多张电路板图像进行困难样本挖掘,获得困难样本,通过对困难样本进行人工标注获得标签,进而可以获得困难样本的特征向量和标签,根据困难样本的特征向量和标签获得更新信息,将更新信息发送给服务器后,由服务器根据更新信息对第一检测模型进行更新,并将获得的第二检测模型下发至边缘设备,进而边缘设备可以使用第二检测模型对电路板进行异常检测。通过困难样本挖掘获得较少数量的困难样本,进而仅需对困难样本进行标注以对第一检测模型进行更新,而无需对全部输入第一检测模型的电路板图像进行标注,从而可以减少大量的用于对样本进行标注的人工成本和工时。另外,将更新信息发送给服务器,由服务器根据更新信息对第一检测模型进行更新,服务器可以自动完成第一检测模型的更新动作,并自动将更新获得的第二检测模型下发至边缘设备,基于更新信息对第一检测模型进行更新的过程无需人工参与,从而可以减少了人工成本。The edge device can input the circuit board image into the first detection model to obtain the feature vector of each circuit board image, and can also perform difficult sample mining on multiple circuit board images input into the first detection model to obtain difficult samples. The samples are manually annotated to obtain labels, and then the feature vectors and labels of the difficult samples can be obtained. Update information is obtained based on the feature vectors and labels of the difficult samples. After the update information is sent to the server, the server updates the first detection model based on the update information. , and delivers the obtained second detection model to the edge device, and then the edge device can use the second detection model to perform anomaly detection on the circuit board. A smaller number of difficult samples are obtained through difficult sample mining, and then only the difficult samples need to be annotated to update the first detection model, without the need to annotate all the circuit board images input to the first detection model, thereby reducing a large amount of Labor costs and hours used to label the samples. In addition, the update information is sent to the server, and the server updates the first detection model according to the update information. The server can automatically complete the update action of the first detection model, and automatically deliver the updated second detection model to the edge device. The process of updating the first detection model based on the updated information does not require manual participation, thereby reducing manual costs.
通过困难样本的特征向量和标签,获得更新信息,可以提高更新信息的精确性,服务器通过更新信息将第一检测模型更新为更适合当前环境下的第二检测模型,可以提高异常检测的效果。Obtaining updated information through the feature vectors and labels of difficult samples can improve the accuracy of the updated information. The server uses the updated information to update the first detection model to a second detection model that is more suitable for the current environment, which can improve the effect of anomaly detection.
在一种可能实现的方式中,更新信息包括各困难样本的特征向量和标签,即在获得困难样本的特征向量和标签后,直接将困难样本的特征向量和标签作为更新信息发送给服务器,由服务器根据困难样本的特征向量和标签对第一检测模型进行更新,以获得第二检测模型。In one possible implementation, the update information includes the feature vectors and labels of each difficult sample, that is, after obtaining the feature vectors and labels of the difficult samples, the feature vectors and labels of the difficult samples are directly sent to the server as update information, by The server updates the first detection model according to the feature vector and label of the difficult sample to obtain the second detection model.
在本申请实施例中,由于困难样本的特征向量可以指示第一检测模型对相应电路板进行异常检测的结果,而困难样本的标签可以指示相应电路板实际是否存在异常,将困难样本的特征向量和标签作为更新信息,使得更新信息能够反应第一检测模型在边缘设备上对电路板进行异常检测的准确性,进而通过更新信息更新第一检测模型,能够提高检测模型对电路板进行异常检测的准确性。In the embodiment of the present application, since the feature vector of the difficult sample can indicate the abnormality detection result of the corresponding circuit board by the first detection model, and the label of the difficult sample can indicate whether the corresponding circuit board actually has an abnormality, the feature vector of the difficult sample is and labels as update information, so that the update information can reflect the accuracy of the first detection model in detecting anomalies on the circuit board on the edge device, and then updating the first detection model through the update information can improve the accuracy of the detection model in detecting anomalies on the circuit board. accuracy.
在一种可能实现的方式中,在获得各困难样本的特征向量和标签后,可以根据每个困难样本的特征向量和标签,计算该困难样本对应的梯度,进而将各困难样本的梯度确定为更新信息。In one possible implementation, after obtaining the feature vector and label of each difficult sample, the gradient corresponding to the difficult sample can be calculated based on the feature vector and label of each difficult sample, and then the gradient of each difficult sample is determined as Update information.
可选地,针对每个困难样本,边缘设备可以根据该困难样本的特征向量和标签,通过反向传播算法(back propagation)计算该困难样本的梯度。当然,边缘设备也可以通过其它方法,根据困难样本的特征向量和标签计算梯度,对此本申请实施例不作限定。Optionally, for each difficult sample, the edge device can calculate the gradient of the difficult sample through the back propagation algorithm based on the feature vector and label of the difficult sample. Of course, the edge device can also use other methods to calculate gradients based on the feature vectors and labels of difficult samples, which is not limited in the embodiments of the present application.
在本申请实施例中,边缘设备根据困难样本的特征向量和标签计算梯度,将各困难样本的梯度作为更新信息传输给服务器,使服务器根据各困难样本的梯度对第一检测模型进行更新。由于根据困难样本的梯度无法反推困难样本的特征向量和标签,边缘设备将困难样本的梯度作为更新信息发送给服务器,保证了电路板图像的数据安全,从而可以保护用户的隐私。另外,由边缘设备根据困难样本的特征向量和标签计算梯度,服务器可以直接根据梯度对第一检测模型进行更新,从而边缘设备可以分担服务器的一部分计算,从而降低服务器的负载。In this embodiment of the present application, the edge device calculates the gradient based on the feature vector and label of the difficult sample, and transmits the gradient of each difficult sample to the server as update information, so that the server updates the first detection model based on the gradient of each difficult sample. Since the feature vectors and labels of difficult samples cannot be inferred based on the gradient of difficult samples, the edge device sends the gradient of difficult samples to the server as update information, ensuring the data security of the circuit board image and thus protecting the user's privacy. In addition, the edge device calculates the gradient based on the feature vectors and labels of difficult samples, and the server can directly update the first detection model based on the gradient, so that the edge device can share part of the server's calculations, thereby reducing the load on the server.
在一种可能实现的方式中,在进行困难样本挖掘时,可以获得第一检测模型针对每张电路板图像输出的中心偏移信息f c(x)、宽度偏移信息f w(x)和高度偏移信息f h(x),根据中心偏移信息f c(x)、宽度偏移信息f w(x)和高度偏移信息f h(x)可以分别确定每张电路板图像对应的不确定性评分U,进而可以将对应的不确定性评分U较大的若干电路板图像确定为困难样本。 In a possible implementation manner, when mining difficult samples, the center offset information f c (x), width offset information f w (x) and width offset information f w (x) output by the first detection model for each circuit board image can be obtained Height offset information f h (x), according to the center offset information f c (x), width offset information f w (x) and height offset information f h (x), the corresponding position of each circuit board image can be determined respectively. Uncertainty score U, and then several circuit board images with corresponding larger uncertainty scores U can be determined as difficult samples.
中心偏移信息f c(x)可以指示电路板图像中目标对象的中心偏移量,宽度偏移信息f w(x)可以指示电路板图像汇总目标对象的宽度偏移量,高度偏移信息f h(x)可以指示电路板图像中目标对象的高度偏移量。其中,目标对象包括电路板上各类元器件的图像。 The center offset information f c (x) can indicate the center offset of the target object in the circuit board image, and the width offset information f w (x) can indicate the width offset and height offset information of the target object in the circuit board image. f h (x) can indicate the height offset of the target object in the circuit board image. Among them, the target objects include images of various components on the circuit board.
将线路板图像输入第一检测模型后,第一检测模型可以将每张电路板图像的中心偏移情况、宽度偏移情况和高度偏移情况,分别整合成中心偏移信息f c(x)、宽度偏移信息f w(x)和高度偏移信息f h(x),中心偏移信息f c(x)、宽度偏移信息f w(x)和高度偏移信息f h(x)可以作为基础信息计算每张电路板图像对应的不确定性评分U。 After inputting the circuit board image into the first detection model, the first detection model can integrate the center offset, width offset and height offset of each circuit board image into center offset information f c (x) , width offset information f w (x) and height offset information f h (x), center offset information f c (x), width offset information f w (x) and height offset information f h (x) The uncertainty score U corresponding to each circuit board image can be calculated as basic information.
不确定评分U可以指示第一检测模型对相应电路板进行异常检测的准确性,不确定性评分U越高,则第一检测模型对相应电路板进行异常检测的准确性越低,从而可以将不确定评 分U较大的若干电路板图像确定为困难样本。具体地,可以将对应不确定评分U较大的至少一个电路板图像确定为困难样本,或者,可以将对应不确定评分U大于预设阈值的至少一个电路板图像确定为困难样本。The uncertainty score U can indicate the accuracy of the first detection model in abnormal detection of the corresponding circuit board. The higher the uncertainty score U, the lower the accuracy of the first detection model in abnormal detection of the corresponding circuit board, so that the first detection model can detect the abnormality of the corresponding circuit board. Several circuit board images with large uncertainty scores U are determined to be difficult samples. Specifically, at least one circuit board image with a corresponding uncertainty score U greater than a preset threshold may be determined as a difficult sample, or at least one circuit board image with a corresponding uncertainty score U greater than a preset threshold may be determined as a difficult sample.
在本申请实施例中,获得每张电路板图像的中心偏移信息f c(x)、宽度偏移信息f w(x)和高度偏移信息f h(x)后,根据对应的中心偏移信息f c(x)、宽度偏移信息f w(x)和高度偏移信息f h(x),分别确定每张电路板图像的不确定性评分U,保证所确定出的不确定性评分U可以准确指示第一检测模型对相应电路板进行异常检测的准确性,进而根据不确定性评分U确定困难样本时,可以保证所确定出困难样本的准确性,从而保证对第一检测模型进行更新的有效性。 In the embodiment of the present application, after obtaining the center offset information f c (x), width offset information f w (x) and height offset information f h (x) of each circuit board image, according to the corresponding center offset Shift information f c (x), width offset information f w (x) and height offset information f h (x) are used to determine the uncertainty score U of each circuit board image respectively, ensuring the determined uncertainty The score U can accurately indicate the accuracy of the first detection model in detecting anomalies on the corresponding circuit board, and then when determining difficult samples based on the uncertainty score U, the accuracy of the determined difficult samples can be guaranteed, thereby ensuring that the first detection model Validity of making updates.
在一种可能实现的方式中,每张电路板图像的中心偏移信息f c(x)包括中心偏移均值μ c和中心偏移方差σ c,宽度偏移信息f w(x)包括宽度偏移均值μ w和宽度偏移方差σ w,高度偏移信息f h(x)包括高度偏移均值μ h和高度偏移方差σ h。针对每张电路板图像,根据该电路板图像的中心偏移均值μ c和中心偏移方差σ c,可以确定该电路板图像的中心不确定性评分U c,根据该电路板图像的宽度偏移均值μ w和宽度偏移方差σ w,可以确定该电路板图像的宽度不确定性评分U w,根据该电路板图像的高度偏移均值μ h和高度偏移方差σ h,可以确定该电路板图像的高度不确定性评分U h。进而根据每张电路板图像对应的中心不确定性评分U c、宽度不确定性评分U w和高度不确定性评分U h,可以确定该电路板图像的不确定评分U。 In a possible implementation manner, the center offset information f c (x) of each circuit board image includes the center offset mean μ c and the center offset variance σ c , and the width offset information f w (x) includes the width The offset mean μ w and the width offset variance σ w , and the height offset information f h (x) includes the height offset mean μ h and the height offset variance σ h . For each circuit board image, according to the center offset mean μ c and center offset variance σ c of the circuit board image, the center uncertainty score U c of the circuit board image can be determined. According to the width deviation of the circuit board image, The width uncertainty score U w of the circuit board image can be determined based on the moving mean μ w and the width offset variance σ w . According to the height offset mean μ h and height offset variance σ h of the circuit board image, the width uncertainty score U w can be determined. The high uncertainty score U h of the circuit board image. Then, based on the center uncertainty score U c , width uncertainty score U w and height uncertainty score U h corresponding to each circuit board image, the uncertainty score U of the circuit board image can be determined.
针对每张电路板图像,通过变分推理的方式,可以获得该电路板图像对应的中心偏移均值μ c、中心偏移方差σ c、宽度偏移均值μ w、宽度偏移方差σ w、高度偏移均值μ h和高度偏移方差σ h。将中心偏移均值μ c和中心偏移方差σ c输入贝叶斯不一致主动学习(Bayesian active learning by disagreement,BALD)采集函数,可以获得中心不确定性评分U c,将宽度偏移均值μ w和宽度偏移方差σ w输入BALD采集函数,可以获得宽度不确定性评分U w,将高度偏移均值μ h和高度偏移方差σ h输入BALD采集函数,可以获得高度不确定性评分U hFor each circuit board image, through variational reasoning, the center offset mean μ c , center offset variance σ c , width offset mean μ w , width offset variance σ w , corresponding to the circuit board image can be obtained. The height offset mean μ h and the height offset variance σ h . By inputting the center offset mean μ c and the center offset variance σ c into the Bayesian active learning by disagreement (BALD) acquisition function, the center uncertainty score U c can be obtained, and the width offset mean μ w And the width offset variance σ w is input into the BALD acquisition function, and the width uncertainty score U w can be obtained. The height offset mean μ h and the height offset variance σ h are input into the BALD acquisition function, and the height uncertainty score U h can be obtained. .
在本申请实施例中,通过变分推理的方式确定电路板图像的中心偏移均值μ c、中心偏移方差σ c、宽度偏移均值μ w、宽度偏移方差σ w、高度偏移均值μ h和高度偏移方差σ h,根据这些数据,通过BALD采集函数可以确定电路板图像的中心不确定性评分U c、宽度不确定性评分U w和高度不确定性评分U h,进而可以根据中心不确定性评分U c、宽度不确定性评分U w和高度不确定性评分U h确定电路板图像对应的不确定评分U,保证所计算出的不确定评分U可以 准确指示第一检测模型对相应电路板进行异常检测的准确性,进而保证所确定困难样本的准确性。 In the embodiment of the present application, the mean center offset μ c , center offset variance σ c , width offset mean μ w , width offset variance σ w , and height offset mean of the circuit board image are determined through variational reasoning. μ h and height offset variance σ h . Based on these data, the center uncertainty score U c , width uncertainty score U w and height uncertainty score U h of the circuit board image can be determined through the BALD acquisition function, and then the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h can be determined. Determine the uncertainty score U corresponding to the circuit board image based on the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h , ensuring that the calculated uncertainty score U can accurately indicate the first detection The accuracy of the model's anomaly detection on the corresponding circuit board, thereby ensuring the accuracy of the identified difficult samples.
在一种可能实现的方式中,在根据电路板图像对应的中心不确定性评分U c、宽度不确定性评分U w和高度不确定性评分U h,确定电路板图像对应的不确定性评分U时,可以将电路板图像所对应的中心不确定性评分U c、宽度不确定性评分U w和高度不确定性评分U h的平均值或最大值,确定为电路板图像对应的不确定性评分U。 In one possible implementation method, the uncertainty score corresponding to the circuit board image is determined based on the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h corresponding to the circuit board image. When U, the average or maximum value of the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h corresponding to the circuit board image can be determined as the uncertainty corresponding to the circuit board image. Sex rating U.
在本申请实施例中,将中心不确定性评分U c、宽度不确定性评分U w和高度不确定性评分U h的平均值或最大值,确定为电路板图像的不确定性评分U,保证所确定出的不确定评分U可以准确指示第一检测模型对相应电路板进行异常检测的准确性,进而保证所确定困难样本的准确性。 In the embodiment of this application, the average or maximum value of the center uncertainty score U c , the width uncertainty score U w and the height uncertainty score U h is determined as the uncertainty score U of the circuit board image, It is guaranteed that the determined uncertainty score U can accurately indicate the accuracy of abnormality detection of the corresponding circuit board by the first detection model, thereby ensuring the accuracy of the determined difficult sample.
应用于服务器的电路板检测模型的更新方法An update method for circuit board inspection models applied to servers
图2是本申请另一个实施例电路板检测模型的更新方法的流程图,该电路板检测模型的更新方法200可以应用于服务器。如图2所示,该电路板检测模型的更新方法200包括如下步骤:FIG. 2 is a flow chart of a method for updating a circuit board detection model according to another embodiment of the present application. The method 200 for updating a circuit board detection model can be applied to a server. As shown in Figure 2, the circuit board inspection model updating method 200 includes the following steps:
步骤201、接收更新信息。Step 201: Receive update information.
服务器可以接收来自边缘设备的更新信息。更新信息由边缘设备根据至少一个困难样本的特征向量和标签确定,困难样本的特征向量通过将电路板图像输入第一检测模型获得。更新信息用于对第一检测模型进行更新。The server can receive updated information from edge devices. The updated information is determined by the edge device based on the feature vector and label of at least one difficult sample, and the feature vector of the difficult sample is obtained by inputting the circuit board image into the first detection model. The update information is used to update the first detection model.
步骤202、更新第一检测模型。Step 202: Update the first detection model.
服务器上存储有边缘设备所使用的第一检测模型。在服务器获得更新信息后,服务器可以根据更新信息对第一检测模型进行更新,获得第二检测模型。The first detection model used by the edge device is stored on the server. After the server obtains the update information, the server can update the first detection model according to the update information to obtain the second detection model.
步骤203、将第二检测模型下发至边缘设备。Step 203: Send the second detection model to the edge device.
在服务器对第一检测模型更新完成,获得第二检测模型后,服务器可以将第二检测模型下发至边缘设备,使得边缘设备可以通过第二检测设备对电路板进行异常检测。After the server completes updating the first detection model and obtains the second detection model, the server can deliver the second detection model to the edge device, so that the edge device can perform anomaly detection on the circuit board through the second detection device.
在本申请实施例中,由于更新信息根据困难样本的特征向量和标签确定,困难样本仅是输入第一检测模型中全部电路板图像中的一部分,从而仅需要对困难样本的进行标注,以获得困难样本的标签,而无需对全部输入第一检测模型的电路板图像进行标注,从而可以减少大量的用于对样本进行标注的人工成本和工时。另外,服务器根据更新信息对第一检测模型进行更新,服务器可以自动完成第一检测模型的更新动作,并自动将更新获得的第二检测模型下发至边缘设备,模型更新和下发过程无需人工参与,可以进一步减少了人工成本及相应的工时。In the embodiment of the present application, since the update information is determined based on the feature vectors and labels of difficult samples, the difficult samples are only a part of all the circuit board images input into the first detection model, so only the difficult samples need to be annotated to obtain Labeling of difficult samples without the need to label all circuit board images input to the first detection model, thereby reducing a large amount of labor costs and man-hours for labeling samples. In addition, the server updates the first detection model based on the update information. The server can automatically complete the update action of the first detection model and automatically deliver the updated second detection model to the edge device. The model update and delivery process does not require manual labor. Participation can further reduce labor costs and corresponding working hours.
在一种可能实现的方式中,在服务器接收来自边缘设备的更新信息后,服务器可以对更新信息进行数据清洗,进而根据进行数据清洗后的更新信息对第一检测模型进行更新。In one possible implementation manner, after the server receives the updated information from the edge device, the server can perform data cleaning on the updated information, and then update the first detection model based on the updated information after data cleaning.
通过对更新信息进行数据清洗,可以去除更新信息中的部分无效数据。在对更新信息进行数据清洗时,可以根据多个边缘设备对同一样本的预测结果,将错误标签样本滤除。具体地,针对同一困难样本,获得多个边缘设备通过各自检测模型对该困难样本的预测结果,如果各边缘设备对该困难样本的预测结果的一致性满足预设条件,则保留更新信息中该困难样本对应的信息,如果各边缘设备对该困难样本的预测结果的一致性不满足预设条件,则从更新信息中将该困难样本对应的信息删除。预设条件可以是预测结果一致的边缘设备的数量与边缘设备总数量的比值大于预设阈值,比如大于80%。By performing data cleaning on the update information, some invalid data in the update information can be removed. When performing data cleaning on updated information, incorrectly labeled samples can be filtered out based on the prediction results of multiple edge devices for the same sample. Specifically, for the same difficult sample, the prediction results of multiple edge devices for the difficult sample through their respective detection models are obtained. If the consistency of the prediction results of each edge device for the difficult sample meets the preset conditions, the prediction results in the update information are retained. Information corresponding to the difficult sample. If the consistency of the prediction results of the difficult sample by each edge device does not meet the preset conditions, the information corresponding to the difficult sample will be deleted from the updated information. The preset condition may be that the ratio of the number of edge devices with consistent prediction results to the total number of edge devices is greater than a preset threshold, such as greater than 80%.
由于更新信息可以是困难样本的特征向量和标签,或者是困难样本的梯度,所以对更新信息进行数据清洗,是清洗掉错误标签样本的特征向量和标签,或者清洗掉错误标签样本的梯度。Since the update information can be the feature vectors and labels of difficult samples, or the gradient of difficult samples, data cleaning of the update information is to clean out the feature vectors and labels of wrongly labeled samples, or clean out the gradients of wrongly labeled samples.
在本申请实施例中,在获取困难样本的标签时,可能存在部分困难样本的标签错误,通过数据清洗,能够去除更新信息中标签错误的困难样本的信息,进而保证服务器更新第一检测模型的效率和准确性。In the embodiment of the present application, when obtaining the labels of difficult samples, there may be label errors for some difficult samples. Through data cleaning, the information of difficult samples with incorrect labels in the update information can be removed, thereby ensuring that the server updates the first detection model. efficiency and accuracy.
在一种可能的实现方式中,更新信息包括至少一个困难样本的特征向量和标签,或者,更新信息包括至少一个困难样本的梯度,其中,一个困难样本的梯度根据该困难样本的特征向量和标签确定。In a possible implementation, the update information includes the feature vector and label of at least one difficult sample, or the update information includes the gradient of at least one difficult sample, wherein the gradient of a difficult sample is based on the feature vector and label of the difficult sample Sure.
在本申请实施例中,在更新信息包括困难样本的特征向量和标签时,服务器根据困难样本的特征向量和标签可以准确地对第一检测模型进行更新,保证模型更新效果。在更新信息包括困难样本的梯度时,服务器可以根据困难样本对第一检测模型进行更新,无需在模型更新前对困难样本进行预处理,可以减小服务器的负载。In this embodiment of the present application, when the update information includes the feature vectors and labels of difficult samples, the server can accurately update the first detection model based on the feature vectors and labels of difficult samples to ensure the model update effect. When the update information includes the gradient of a difficult sample, the server can update the first detection model based on the difficult sample. There is no need to preprocess the difficult sample before updating the model, which can reduce the load on the server.
电路板检测模型的更新系统Update system for circuit board inspection models
图3是本申请一个实施例的电路板检测模型的更新系统的示意图。如图3所示,电路板检测模型的更新系统300包括边缘设备10和服务器20。边缘设备10用于执行上述应用于边缘设备的电路板检测模型的更新方法100。服务器20用于执行上述应用于服务器的电路板检测模型的更新方法200。Figure 3 is a schematic diagram of a circuit board detection model update system according to an embodiment of the present application. As shown in FIG. 3 , a circuit board detection model update system 300 includes an edge device 10 and a server 20 . The edge device 10 is configured to execute the above-mentioned updating method 100 of a circuit board detection model applied to an edge device. The server 20 is configured to execute the above updating method 200 for the circuit board detection model applied to the server.
边缘设备10用于通过输入的至少一张电路板图像与部署的第一检测模型,生成用于第一检测模型更新的更新信息,并将更新信息发送给服务器20。服务器20用于接收边缘设备10发送的更新信息,并根据更新信息对第一检测模型进行更新,获得第二检测模型,并将更新后的第二检测模型下发至边缘设备10The edge device 10 is configured to generate update information for updating the first detection model through the input at least one circuit board image and the deployed first detection model, and send the update information to the server 20 . The server 20 is configured to receive the update information sent by the edge device 10 , update the first detection model according to the update information, obtain the second detection model, and send the updated second detection model to the edge device 10
在本申请实施例中,在边缘设备10获得第一检测模型后,可以通过对输入的至少一张电路板图像进行困难样本挖掘,获得困难样本,通过对困难样本进行人工标注,可以不对所有输入的电路板图像进行标注,可以减少大量的用于对样本进行标注的人工成本和工时。通过服务器20更新第一检测模型,服务器自动完成了对第一检测模型的更新动作,并且服务器20自动将更新后的第二检测模型下发至服务器,也减少了人工成本及相应的工时。In the embodiment of the present application, after the edge device 10 obtains the first detection model, the difficult sample can be obtained by mining at least one input circuit board image for difficult samples. By manually annotating the difficult samples, all inputs can be eliminated. Annotating circuit board images can reduce a large amount of labor costs and man-hours used to annotate samples. By updating the first detection model through the server 20, the server automatically completes the update action of the first detection model, and the server 20 automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding man-hours.
通过困难样本的特征向量和标签,获得更新信息,可以提高更新信息的精确性,服务器通过更新信息将第一检测模型更新为更适合当前环境下的第二检测模型,可以提高异常检测的效果。Obtaining updated information through the feature vectors and labels of difficult samples can improve the accuracy of the updated information. The server uses the updated information to update the first detection model to a second detection model that is more suitable for the current environment, which can improve the effect of anomaly detection.
在一种可能实现的方式中,服务器20为云服务器。In one possible implementation, the server 20 is a cloud server.
在本申请实施例中,通过使用云服务器,可以使云服务器与多个边缘设备10通过网络传输信息,云服务器通过获取各边缘设备10上传的更新信息对第一检测模型进行更新,并将各边缘设备10对应的第二检测模型下发至每个边缘设备10,完成第一检测模型的更新,减少了服务器20的设置量,并且能够支持对大规模边缘设备10上部署的第一检测模型进行更新。In the embodiment of the present application, by using a cloud server, the cloud server and multiple edge devices 10 can transmit information through the network. The cloud server updates the first detection model by obtaining the update information uploaded by each edge device 10, and updates each edge device 10. The second detection model corresponding to the edge device 10 is delivered to each edge device 10 to complete the update of the first detection model, which reduces the amount of settings on the server 20 and can support the first detection model deployed on large-scale edge devices 10 Make an update.
应用于更新系统电路板检测模型的更新方法An update method applied to update system circuit board inspection models
基于上述实施例中的电路板检测模型的更新系统300,本申请实施例提供了一种电路板检测模型的更新方法。图4是本申请一个实施例的电路板检测模型的更新方法400,该电路板检测模型的更新方法400可由前述实施例中的边缘设备10和服务器20执行,如无特别声明,下述方法实施例中的边缘设备可为前述实施例中的边缘设备10,下述方法实施例中的服务器可为前述实施例中的服务器20。如图4所示,该电路板检测模型的更新方法400包括如下步骤:Based on the circuit board detection model update system 300 in the above embodiment, embodiments of the present application provide a circuit board detection model update method. Figure 4 is a circuit board detection model update method 400 according to an embodiment of the present application. The circuit board detection model update method 400 can be executed by the edge device 10 and the server 20 in the previous embodiment. Unless otherwise stated, the following method is implemented. The edge device in the example may be the edge device 10 in the previous embodiment, and the server in the following method embodiment may be the server 20 in the previous embodiment. As shown in Figure 4, the circuit board detection model update method 400 includes the following steps:
步骤401、服务器获取第一检测模型。Step 401: The server obtains the first detection model.
通过对一定量的电路板图像进行深度学习,获得第一检测模型,第一检测模型用于基于电路板图像对电路板进行异常检测。服务器通过获取第一检测模型,可以向至少一个边缘设备下发第一检测模型。By performing deep learning on a certain amount of circuit board images, a first detection model is obtained, and the first detection model is used to detect abnormalities on the circuit board based on the circuit board images. By acquiring the first detection model, the server can deliver the first detection model to at least one edge device.
步骤402、服务器将第一检测模型下发至边缘设备。Step 402: The server delivers the first detection model to the edge device.
在服务器获取第一检测模型后,将第一检测模型分别下发给至少一个边缘设备,以供边缘设备通过第一检测模型对电路板进行异常检测。After the server obtains the first detection model, it delivers the first detection model to at least one edge device respectively, so that the edge device can detect anomalies on the circuit board through the first detection model.
步骤403、边缘设备获取至少一张电路板图像。Step 403: The edge device obtains at least one circuit board image.
电路板图像可以是电路板实际生产过程中,待检测的电路板图像,可以通过摄像头等图像拍摄装置拍摄安装完成后的电路板,获得至少一张电路板图像,并将至少一张电路板图像发送给边缘设备。The circuit board image can be an image of the circuit board to be inspected during the actual production process of the circuit board. The circuit board after installation can be captured by a camera or other image capturing device to obtain at least one circuit board image, and the at least one circuit board image can be Sent to edge device.
步骤404、边缘设备将至少一张电路板图像输入第一检测模型。Step 404: The edge device inputs at least one circuit board image into the first detection model.
在边缘设备获得至少一张电路板图像后,将获得的至少一张电路板图像输入已部署的第一检测模型,可以对输入的至少一张电路板图像进行处理,并获得每张电路板的特征向量。After the edge device obtains at least one circuit board image, the obtained at least one circuit board image is input into the deployed first detection model, the input at least one circuit board image can be processed, and the information of each circuit board is obtained. Feature vector.
步骤405、边缘设备对至少一张电路板图像进行困难样本挖掘。Step 405: The edge device performs difficult sample mining on at least one circuit board image.
在分别将每张电路板图像输入第一检测模型后,通过第一检测模型对各电路板图像进行处理,在完成处理,对所有样本进行困难样本挖掘,获得至少一个困难样本,困难样本的数量小于或等于输入的电路板图像数量。After each circuit board image is input into the first detection model, each circuit board image is processed through the first detection model. After completing the processing, difficult samples are mined for all samples to obtain at least one difficult sample and the number of difficult samples. Less than or equal to the number of board images entered.
步骤406、边缘设备分别获取每个困难样本的标签。Step 406: The edge device obtains the label of each difficult sample respectively.
针对挖掘出的每个困难样本,对每个困难样本分别进行标注,获得各困难样本对应的标签,标签用于指示相应困难样本(电路板图像)是否存在异常。其中,对困难样本进行标注可以通过人工注释的方式完成。困难样本分别获取每个被标注后的困难样本的标签。For each difficult sample excavated, each difficult sample is labeled separately, and the label corresponding to each difficult sample is obtained. The label is used to indicate whether there is an abnormality in the corresponding difficult sample (circuit board image). Among them, labeling difficult samples can be completed through manual annotation. Difficult samples obtain the label of each labeled difficult sample separately.
步骤407、边缘设备根据各困难样本的特征向量和标签获得梯度,将梯度作为更新信息。Step 407: The edge device obtains the gradient according to the feature vector and label of each difficult sample, and uses the gradient as update information.
边缘设备根据挖掘出的每个困难样本,基于已获取到的各电路板图像的特征向量,分别获取每个困难样本的特征向量。根据每个困难样本的特征向量和标签,计算该困难样本对应的梯度,将各困难样本的梯度确定为更新信息,其中,梯度的计算通过反向传播算法(Back propagation)在边缘设备中实现。According to each difficult sample that is mined, the edge device obtains the feature vector of each difficult sample based on the feature vector of each circuit board image that has been obtained. According to the feature vector and label of each difficult sample, the gradient corresponding to the difficult sample is calculated, and the gradient of each difficult sample is determined as the update information. The calculation of the gradient is implemented in the edge device through the back propagation algorithm (Back propagation).
步骤408、边缘设备将更新信息发送至服务器。Step 408: The edge device sends the update information to the server.
在边缘设备获得更新信息后,将更新信息发送给服务器,以使服务器通过更新信息对第一检测模型进行更新,获得第二检测模型。After the edge device obtains the update information, it sends the update information to the server, so that the server updates the first detection model through the update information and obtains the second detection model.
步骤409、服务器接收边缘设备发送的更新信息,并对更新信息进行数据清洗。Step 409: The server receives the update information sent by the edge device and performs data cleaning on the update information.
在服务器接收来自边缘设备的更新信息后,服务器对更新信息进行数据清洗,滤除更新信息中标签错误的困难样本的信息梯度。After the server receives the update information from the edge device, the server performs data cleaning on the update information and filters out the information gradients of difficult samples with incorrect labels in the update information.
步骤410、服务器根据进行数据清洗后的更新信息对第一检测模型进行更新。Step 410: The server updates the first detection model according to the updated information after data cleaning.
在服务器对更新信息进行数据清洗后,服务器根据进行数据清洗后的更新信息对第一检测模型进行更新,获得第二检测模型。After the server performs data cleaning on the updated information, the server updates the first detection model based on the updated information after data cleaning to obtain a second detection model.
步骤411、服务器将第二检测模型下发至边缘设备。Step 411: The server delivers the second detection model to the edge device.
在服务器对第一检测模型更新完成,获得第二检测模型后,服务器将第二检测模型下发至边缘设备,使边缘设备通过第二检测设备对电路板进行异常检测。After the server completes updating the first detection model and obtains the second detection model, the server delivers the second detection model to the edge device, so that the edge device performs anomaly detection on the circuit board through the second detection device.
在本申请实施例中,在边缘设备获得第一检测模型后,可以通过对输入的至少一张电路板图像进行困难样本挖掘,获得困难样本,通过对困难样本进行人工标注,可以不对所有输入的电路板图像进行标注,可以减少大量的用于对样本进行标注的人工成本和工时。通过服 务器更新第一检测模型,服务器自动完成了对第一检测模型的更新动作,并且服务器自动将更新后的第二检测模型下发至服务器,也减少了人工成本及相应的工时。In the embodiment of the present application, after the edge device obtains the first detection model, the difficult sample can be obtained by mining at least one input circuit board image for difficult samples. By manually labeling the difficult samples, all input Annotating circuit board images can reduce a large amount of labor costs and man-hours used to annotate samples. By updating the first detection model through the server, the server automatically completes the update action of the first detection model, and the server automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding working hours.
通过困难样本的特征向量和标签,获得梯度,根据梯度,获得更新信息,通过将每个困难样本的特征向量和标签计算为梯度并传输给服务器的方式,代替了向服务器传输每个困难样本的特征向量和标签。此时服务器获取的数据是梯度,保证了更新信息的安全性,同时保护了用户的隐私,同时,计算梯度的过程在边缘设备中实现,可以减少服务器的工作量,提高服务器的运行效率。服务器通过更新信息将第一检测模型更新为更适合当前环境下的第二检测模型,可以提高异常检测的效果。The gradient is obtained through the feature vector and label of the difficult sample, and the updated information is obtained based on the gradient. By calculating the feature vector and label of each difficult sample as a gradient and transmitting it to the server, it replaces the transmission of each difficult sample to the server. Feature vectors and labels. At this time, the data obtained by the server is the gradient, which ensures the security of the updated information and protects the user's privacy. At the same time, the process of calculating the gradient is implemented in the edge device, which can reduce the workload of the server and improve the operating efficiency of the server. The server updates the first detection model to a second detection model that is more suitable for the current environment by updating the information, which can improve the effect of anomaly detection.
电子设备Electronic equipment
图5是本申请一个实施例的电子设备的示意图,本申请具体实施例并不对电子设备的具体实现做限定。如图5所示,该电子设备50可以包括:处理器(processor)51、通信接口(Communications Interface)52、存储器(memory)53、以及通信总线54。其中:FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device. As shown in Figure 5, the electronic device 50 may include: a processor (processor) 51, a communications interface (Communications Interface) 52, a memory (memory) 53, and a communication bus 54. in:
处理器51、通信接口52、以及存储器53通过通信总线54完成相互间的通信。The processor 51, the communication interface 52, and the memory 53 complete communication with each other through the communication bus 54.
通信接口52,用于与其它电子设备或服务器进行通信。 Communication interface 52 is used to communicate with other electronic devices or servers.
处理器51,用于执行程序55,具体可以执行前述电路板检测模型的更新方法实施例中的相关步骤。The processor 51 is configured to execute the program 55. Specifically, the processor 51 can execute the relevant steps in the foregoing embodiment of the method for updating the circuit board detection model.
具体地,程序55可以包括程序代码,该程序代码包括计算机操作指令。Specifically, program 55 may include program code including computer operating instructions.
处理器51可能是CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。智能设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。The processor 51 may be a CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors included in the smart device can be the same type of processor, such as one or more CPUs; or they can be different types of processors, such as one or more CPUs and one or more ASICs.
存储器53,用于存放程序55。存储器53可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。 Memory 53 is used to store programs 55. The memory 53 may include high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
程序55具体可以用于使得处理器51执行前述实施例中的电路板检测模型的更新方法。The program 55 can be specifically used to cause the processor 51 to execute the updating method of the circuit board detection model in the previous embodiment.
程序55中各步骤的具体实现可以参见前述电路板检测模型的更新方法实施例中的相应步骤和单元中对应的描述,在此不赘述。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。For the specific implementation of each step in the program 55, please refer to the corresponding steps and corresponding descriptions in the units in the foregoing embodiment of the method for updating the circuit board detection model, which will not be described again here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described devices and modules can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be described again here.
通过本申请实施例的电子设备,在边缘设备获得第一检测模型后,可以通过对输入的至少一张电路板图像进行困难样本挖掘,获得困难样本,通过对困难样本进行人工标注,可以不对所有输入的电路板图像进行标注,可以减少大量的用于对样本进行标注的人工成本和工 时。通过服务器更新第一检测模型,服务器自动完成了对第一检测模型的更新动作,并且服务器自动将更新后的第二检测模型下发至服务器,也减少了人工成本及相应的工时。Through the electronic device of the embodiment of the present application, after the edge device obtains the first detection model, the difficult sample can be obtained by mining at least one input circuit board image for difficult samples. By manually annotating the difficult samples, all the difficult samples can be obtained. Labeling the input circuit board images can reduce a lot of labor costs and man-hours for labeling samples. By updating the first detection model through the server, the server automatically completes the update action of the first detection model, and the server automatically delivers the updated second detection model to the server, which also reduces labor costs and corresponding working hours.
计算机存储介质computer storage media
本申请还提供了一种计算机可读存储介质,存储用于使一机器执行如本文所述的电路板检测模型的更新方法的指令。具体地,可以提供配有存储介质的系统或者装置,在该存储介质上存储着实现上述实施例中任一实施例的功能的软件程序代码,且使该系统或者装置的计算机(或CPU或MPU)读出并执行存储在存储介质中的程序代码。The present application also provides a computer-readable storage medium that stores instructions for causing a machine to execute the updating method of a circuit board inspection model as described herein. Specifically, a system or device equipped with a storage medium may be provided, on which the software program code that implements the functions of any of the above embodiments is stored, and the computer (or CPU or MPU) of the system or device ) reads and executes the program code stored in the storage medium.
在这种情况下,从存储介质读取的程序代码本身可实现上述实施例中任何一项实施例的功能,因此程序代码和存储程序代码的存储介质构成了本申请的一部分。In this case, the program code itself read from the storage medium can implement the functions of any one of the above embodiments, and therefore the program code and the storage medium storing the program code form part of this application.
用于提供程序代码的存储介质实施例包括软盘、硬盘、磁光盘、光盘(如CD-ROM、CD-R、CD-RW、DVD-ROM、DVD-RAM、DVD-RW、DVD+RW)、磁带、非易失性存储卡和ROM。可选择地,可以由通信网络从服务器计算机上下载程序代码。Examples of storage media for providing program codes include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), Tapes, non-volatile memory cards and ROM. Alternatively, the program code can be downloaded from the server computer via the communications network.
计算机程序产品computer program product
本申请实施例还提供了一种计算机程序产品,包括计算机指令,该计算机指令指示计算设备执行上述多个方法实施例中的任一对应的操作。Embodiments of the present application also provide a computer program product, including computer instructions, which instruct the computing device to perform any corresponding operation in the multiple method embodiments mentioned above.
需要指出,根据实施的需要,可将本申请实施例中描述的各个部件/步骤拆分为更多部件/步骤,也可将两个或多个部件/步骤或者部件/步骤的部分操作组合成新的部件/步骤,以实现本申请实施例的目的。It should be pointed out that according to the needs of implementation, each component/step described in the embodiments of this application can be split into more components/steps, or two or more components/steps or partial operations of components/steps can be combined into New components/steps to achieve the purpose of the embodiments of this application.
上述根据本申请实施例的方法可在硬件、固件中实现,或者被实现为可存储在记录介质(诸如CD ROM、RAM、软盘、硬盘或磁光盘)中的软件或计算机代码,或者被实现通过网络下载的原始存储在远程记录介质或非暂时机器可读介质中并将被存储在本地记录介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件(诸如ASIC或FPGA)的记录介质上的这样的软件处理。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件(例如,RAM、ROM、闪存等),当所述软件或计算机代码被计算机、处理器或硬件访问且执行时,实现在此描述的方法。此外,当通用计算机访问用于实现在此示出的方法的代码时,代码的执行将通用计算机转换为用于执行在此示出的方法的专用计算机。The above-mentioned methods according to the embodiments of the present application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or by The computer code downloaded by the network is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium, so that the method described here can be stored using a general-purpose computer, a special-purpose processor or a programmable computer. or such software processing on a recording medium of dedicated hardware such as ASIC or FPGA. It will be understood that a computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code when the software or computer code is used by the computer, When accessed and executed by a processor or hardware, the methods described herein are implemented. Furthermore, when a general-purpose computer accesses code for implementing the methods illustrated herein, execution of the code converts the general-purpose computer into a special-purpose computer for performing the methods illustrated herein.
需要说明的是,上述各流程和各系统结构图中不是所有的步骤和模块都是必须的,可以根据实际的需要忽略某些步骤或模块。各步骤的执行顺序不是固定的,可以根据需要进行调整。上述各实施例中描述的系统结构可以是物理结构,也可以是逻辑结构,即,有些模块可能由同一物理实体实现,或者,有些模块可能分由多个物理实体实现,或者,可以由多个独 立设备中的某些部件共同实现。It should be noted that not all steps and modules in the above-mentioned processes and system structure diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented by multiple Some components in separate devices are implemented together.
以上各实施例中,硬件模块可以通过机械方式或电气方式实现。例如,一个硬件模块可以包括永久性专用的电路或逻辑(如专门的处理器,FPGA或ASIC)来完成相应操作。硬件模块还可以包括可编程逻辑或电路(如通用处理器或其它可编程处理器),可以由软件进行临时的设置以完成相应操作。具体的实现方式(机械方式、或专用的永久性电路、或者临时设置的电路)可以基于成本和时间上的考虑来确定。In the above embodiments, the hardware module can be implemented mechanically or electrically. For example, a hardware module may include permanently dedicated circuitry or logic (such as a specialized processor, FPGA, or ASIC) to complete the corresponding operation. Hardware modules may also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which can be temporarily set by software to complete corresponding operations. The specific implementation method (mechanical method, or dedicated permanent circuit, or temporarily installed circuit) can be determined based on cost and time considerations.
上文通过附图和优选实施例对本发明进行了详细展示和说明,然而本发明不限于这些已揭示的实施例,基与上述多个实施例本领域技术人员可以知晓,可以组合上述不同实施例中的代码审核手段得到本发明更多的实施例,这些实施例也在本发明的保护范围之内。The present invention has been shown and described in detail through the drawings and preferred embodiments above. However, the present invention is not limited to these disclosed embodiments. Based on the above-mentioned multiple embodiments, those skilled in the art will know that the above-mentioned different embodiments can be combined. The code review means in the method can lead to more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims (14)

  1. 一种电路板检测模型的更新方法(100),应用于边缘设备(10),所述方法包括:A circuit board detection model updating method (100), applied to edge devices (10), the method includes:
    将至少一张电路板图像输入第一检测模型,获得每张电路板图像的特征向量,其中,所述第一检测模型用于基于所述电路板图像对电路板进行异常检测;Input at least one circuit board image into a first detection model to obtain a feature vector of each circuit board image, wherein the first detection model is used to detect abnormalities on the circuit board based on the circuit board image;
    对所述至少一张电路板图像进行困难样本挖掘,获得至少一个困难样本;Perform difficult sample mining on the at least one circuit board image to obtain at least one difficult sample;
    分别获取每个所述困难样本的标签;Obtain the label of each difficult sample separately;
    根据各所述困难样本的特征向量和标签,获得更新信息;Obtain updated information based on the feature vectors and labels of each difficult sample;
    将所述更新信息发送给服务器(20),以使所述服务器根据所述更新信息对所述第一检测模型进行更新,获得第二检测模型;Send the update information to the server (20), so that the server updates the first detection model according to the update information to obtain a second detection model;
    获取所述服务器(20)下发的所述第二检测模型,并通过所述第二检测模型对所述电路板进行异常检测。Obtain the second detection model issued by the server (20), and perform anomaly detection on the circuit board through the second detection model.
  2. 根据权利要求1所述的方法,其中,所述更新信息包括各所述困难样本的特征向量和标签。The method according to claim 1, wherein the update information includes feature vectors and labels of each of the difficult samples.
  3. 根据权利要求1所述的方法,其中,所述根据各所述困难样本的特征向量和标签获得更新信息,包括:The method according to claim 1, wherein said obtaining update information according to the feature vector and label of each difficult sample includes:
    针对每个困难样本,根据该困难样本的特征向量和标签,计算该困难样本对应的梯度;For each difficult sample, calculate the gradient corresponding to the difficult sample based on the feature vector and label of the difficult sample;
    将各困难样本对应的梯度确定为所述更新信息。The gradient corresponding to each difficult sample is determined as the update information.
  4. 根据权利要求1所述的方法,其中,所述对所述至少一张电路板图像进行困难样本挖掘获得至少一个困难样本,包括:The method according to claim 1, wherein said performing difficult sample mining on the at least one circuit board image to obtain at least one difficult sample includes:
    针对每张所述电路板图像,获得所述第一检测模型针对该电路板图像输出的中心偏移信息、宽度偏移信息和高度偏移信息,其中,所述中心偏移信息用于指示电路板图像中目标对象的中心偏移量,所述宽度偏差信息用于指示电路板图像中目标对象的宽度偏移量,所述高度偏差信息用于指示电路板图像中目标对象的高度偏移量;For each circuit board image, obtain the center offset information, width offset information and height offset information output by the first detection model for the circuit board image, where the center offset information is used to indicate the circuit The center offset of the target object in the board image. The width deviation information is used to indicate the width offset of the target object in the circuit board image. The height deviation information is used to indicate the height offset of the target object in the circuit board image. ;
    针对每个所述电路板图像,根据该电路板图像对应的中心偏移信息、宽度偏移信息和高度偏移信息,确定该电路板图像对应的不确定性评分;For each circuit board image, determine the uncertainty score corresponding to the circuit board image based on the center offset information, width offset information and height offset information corresponding to the circuit board image;
    将对应的不确定性评分较大的至少一个所述电路板图像确定为困难样本,或者,将对应的不确定性评分大于预设阈值的所述电路板图像确定为困难样本。At least one of the circuit board images with a corresponding uncertainty score greater than a preset threshold is determined as a difficult sample, or the circuit board image with a corresponding uncertainty score greater than a preset threshold is determined as a difficult sample.
  5. 根据权利要求4所述的方法,其中,所述针对每个所述电路板图像,根据该电路板图像对应的中心偏移信息、宽度偏移信息和高度偏移信息,确定该电路板图像对应的不确定性评分,包括:The method according to claim 4, wherein, for each circuit board image, determining the corresponding center offset information, width offset information and height offset information of the circuit board image corresponding to the circuit board image. uncertainty scores, including:
    针对每个所述电路板图像,均执行:For each of the board images described, do:
    根据该电路板图像所对应中心偏移信息包括的中心偏移均值和中心偏移方差,确定该电 路板图像对应的中心不确定性评分;Based on the center offset mean and center offset variance included in the center offset information corresponding to the circuit board image, determine the center uncertainty score corresponding to the circuit board image;
    根据该电路板图像所对应宽度偏移信息包括的宽度偏移均值和宽度偏移方差,确定该电路板图像对应的宽度不确定性评分;Determine the width uncertainty score corresponding to the circuit board image based on the width offset mean and width offset variance included in the width offset information corresponding to the circuit board image;
    根据该电路板图像所对应高度偏移信息包括的高度偏移均值和高度偏移方差,确定该电路板图像对应的高度不确定性评分;Determine the height uncertainty score corresponding to the circuit board image based on the height offset mean value and height offset variance included in the height offset information corresponding to the circuit board image;
    根据该电路板图像对应的中心不确定性评分、宽度不确定性评分和高度不确定性评分,确定该电路板图像对应的不确定性评分。The uncertainty score corresponding to the circuit board image is determined based on the center uncertainty score, width uncertainty score and height uncertainty score corresponding to the circuit board image.
  6. 根据权利要求5所述的方法,其中,所述根据该电路板图像对应的中心不确定性评分、宽度不确定性评分和高度不确定性评分,确定该电路板图像对应的不确定性评分,包括:The method according to claim 5, wherein the uncertainty score corresponding to the circuit board image is determined based on the center uncertainty score, width uncertainty score and height uncertainty score corresponding to the circuit board image, include:
    针对每个所述电路板图像,将该电路板图像所对应的中心不确定性评分、宽度不确定性评分和高度不确定性评分的平均值或最大值,确定为该电路板图像对应的不确定性评分。For each circuit board image, the average or maximum value of the center uncertainty score, width uncertainty score, and height uncertainty score corresponding to the circuit board image is determined to be the different values corresponding to the circuit board image. Certainty score.
  7. 一种电路板检测模型的更新方法(200),应用于服务器(20),所述方法包括:A circuit board detection model updating method (200), applied to the server (20), the method includes:
    接收来自边缘设备(10)的更新信息,其中,所述更新信息根据至少一个困难样本的特征向量和标签确定,所述困难样本的特征向量通过将电路板图像输入第一检测模型获得;Receive updated information from the edge device (10), wherein the updated information is determined based on a feature vector and a label of at least one difficult sample, the feature vector of the difficult sample being obtained by inputting the circuit board image into the first detection model;
    根据所述更新信息对所述第一检测模型进行更新,获得第二检测模型;Update the first detection model according to the update information to obtain a second detection model;
    将所述第二检测模型下发至所述边缘设备(10),以使所述边缘设备通过所述第二检测模型对电路板进行异常检测。The second detection model is delivered to the edge device (10), so that the edge device performs anomaly detection on the circuit board through the second detection model.
  8. 根据权利要求7所述的方法,其中,所述根据所述更新信息对所述第一检测模型进行更新,获得第二检测模型,包括:The method according to claim 7, wherein updating the first detection model according to the update information to obtain a second detection model includes:
    对所述更新信息进行数据清洗;Perform data cleaning on the updated information;
    根据数据清洗后的所述更新信息对所述第一检测模型进行更新,获得所述第二检测模型。The first detection model is updated according to the updated information after data cleaning to obtain the second detection model.
  9. 根据权利要求7所述的方法,其中,所述更新信息包括所述至少一个困难样本的特征向量和标签,或者,所述更新信息包括至少一个困难样本的梯度,其中,一个所述困难样本的梯度根据该困难样本的特征向量和标签确定。The method according to claim 7, wherein the update information includes a feature vector and a label of the at least one difficult sample, or the update information includes a gradient of at least one difficult sample, wherein one of the difficult samples The gradient is determined based on the feature vector and label of this difficult sample.
  10. 一种电路板检测模型的更新系统(300),包括:边缘设备(10)和服务器(20);A circuit board inspection model updating system (300), including: an edge device (10) and a server (20);
    所述边缘设备(10)用于执行上述权利要求1-6中任一项所述的电路板检测模型的更新方法;The edge device (10) is used to execute the updating method of the circuit board detection model described in any one of the above claims 1-6;
    所述服务器(20)用于执行上述权利要求7-9中任一项所述的电路板检测模型的更新方法。The server (20) is configured to execute the updating method of the circuit board detection model described in any one of claims 7-9.
  11. 根据权利要求10所述的系统,其中,所述服务器(20)为云服务器。The system according to claim 10, wherein the server (20) is a cloud server.
  12. 一种电子设备,包括:处理器(51)、通信接口(52)、存储器(53)和通信总线(54),所述处理器(51)、所述存储器(53)和所述通信接口(52)通过所述通信总线(54)完成相互间的通信;An electronic device, including: a processor (51), a communication interface (52), a memory (53) and a communication bus (54), the processor (51), the memory (53) and the communication interface (53) 52) Complete mutual communication through the communication bus (54);
    所述存储器(53)用于存放至少一可执行指令,可执行指令使处理器(51)执行如权利要求1-6中任一项所述的电路板检测模型的更新方法或如权利要求7-9中任一项所述的电路板检测模型的更新方法对应的操作。The memory (53) is used to store at least one executable instruction. The executable instruction causes the processor (51) to execute the updating method of the circuit board detection model as claimed in any one of claims 1-6 or as claimed in claim 7. -Operations corresponding to the update method of the circuit board detection model described in any one of -9.
  13. 一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-6中任一项所述的电路板检测模型的更新方法或如权利要求7-9中任一项所述的电路板检测模型的更新方法。A computer storage medium on which a computer program is stored. When the program is executed by a processor, the updating method of a circuit board detection model as described in any one of claims 1-6 or any of claims 7-9 is implemented. A method for updating a circuit board inspection model.
  14. 一种计算机程序产品,包括计算机指令,所述计算机指令指示计算设备执行如权利要求1-6中任一项所述的电路板检测模型的更新方法或如权利要求7-9中任一项所述的电路板检测模型的更新方法对应的操作。A computer program product, including computer instructions, the computer instructions instruct a computing device to perform the updating method of a circuit board inspection model as claimed in any one of claims 1-6 or as claimed in any one of claims 7-9. The operations corresponding to the update method of the circuit board inspection model described above.
PCT/CN2022/097383 2022-06-07 2022-06-07 Update method and system for circuit board detection model, and electronic device and storage medium WO2023236038A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/097383 WO2023236038A1 (en) 2022-06-07 2022-06-07 Update method and system for circuit board detection model, and electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/097383 WO2023236038A1 (en) 2022-06-07 2022-06-07 Update method and system for circuit board detection model, and electronic device and storage medium

Publications (1)

Publication Number Publication Date
WO2023236038A1 true WO2023236038A1 (en) 2023-12-14

Family

ID=89117366

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/097383 WO2023236038A1 (en) 2022-06-07 2022-06-07 Update method and system for circuit board detection model, and electronic device and storage medium

Country Status (1)

Country Link
WO (1) WO2023236038A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1440543A (en) * 2000-06-28 2003-09-03 泰拉丁公司 Image processing system for use with inspection systems
CN109738782A (en) * 2018-12-07 2019-05-10 上海交通大学 Board failure detection method and system based on measurement data machine learning
CN109919925A (en) * 2019-03-04 2019-06-21 联觉(深圳)科技有限公司 Printed circuit board intelligent detecting method, system, electronic device and storage medium
CN114444705A (en) * 2020-10-16 2022-05-06 华为技术有限公司 Model updating method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1440543A (en) * 2000-06-28 2003-09-03 泰拉丁公司 Image processing system for use with inspection systems
CN109738782A (en) * 2018-12-07 2019-05-10 上海交通大学 Board failure detection method and system based on measurement data machine learning
CN109919925A (en) * 2019-03-04 2019-06-21 联觉(深圳)科技有限公司 Printed circuit board intelligent detecting method, system, electronic device and storage medium
CN114444705A (en) * 2020-10-16 2022-05-06 华为技术有限公司 Model updating method and device

Similar Documents

Publication Publication Date Title
EP3937128A2 (en) Image defect detection method and apparatus, electronic device, storage medium and product
WO2017032311A1 (en) Detection method and apparatus
JP2018063236A (en) Method and apparatus for annotating point cloud data
US11468261B2 (en) Information processing apparatus, image processing method, and computer-readable recording medium recording image processing program
CN105022694B (en) Method for generating test case and system for mobile terminal test
EP4231229A1 (en) Industrial defect recognition method and system, and computing device and storage medium
WO2019087803A1 (en) Image processing device, image processing method, and recording medium
KR20200018411A (en) Method and apparatus for detecting burr of electrode piece
CN111208140A (en) Defect rechecking system and method
KR20200001455A (en) Method, device and system for processing image tagging information
US10417569B2 (en) Detecting deviations between event log and process model
JP2019193019A (en) Work analysis device and work analysis method
US11386538B2 (en) Image processing apparatus, image processing method, and storage medium
WO2023236038A1 (en) Update method and system for circuit board detection model, and electronic device and storage medium
JP2015087940A (en) Information processing device, information processing method and program
CN108512675B (en) Network diagnosis method and device, control node and network node
JP2021131831A (en) Information processing device, information processing method and program
CN116415851A (en) Intelligent identification and evaluation method for facility operation and maintenance performance indexes based on deep learning
CN116002480A (en) Automatic detection method and system for accidental falling of passengers in elevator car
CN114359670A (en) Unstructured data labeling method and device, computer equipment and storage medium
CN108875638B (en) Face matching test method, device and system
JP2022019334A (en) Indicated value reading program, indicated value reading device, and indicated value reading method
WO2020114585A1 (en) Object location determination in frames of a video stream
CN114679402B (en) Method and device for testing communication protocol between upper computer and lower computer of medical robot
CN110688997B (en) Image processing method and device