Method, device and automatic optical inspection apparatus for obtaining color extraction parameters
Patent Information
- Application Number
- CN202211509944.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-11-29
AI Technical Summary
[0003]本发明实施例提供了一种获取色彩抽取参数的方法、装置及自动光学检测设备,旨在解决现有技术中色彩抽取参数工作量大、且表达能力弱的技术问题
[0045]区别于相关技术的情况,本发明实施例提供一种获取色彩抽取参数的方法、装置及自动光学检测设备,主要通过获取当前图像,并基于所述当前图像,获取第一数据集和第二数据集,接着获取预设色彩空间,并将所述第一数据集和所述第二数据集转化至所述预设色彩空间中,以获取第一训练集和第二训练集,最后获取预设分类模型,并基于所述第一训练集和所述第二训练集对所述预设分类模型进行训练,以确定所述预设分类模型的参数,其中,所述参数为所述色彩抽取参数。通过上述方法,能够在减小获取色彩抽取参数时的工作量的同时,提升该色彩抽取参数的表达能力。
Smart Images

Figure CN115731209B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of color extraction, and more particularly to a method, apparatus, and automatic optical inspection equipment for obtaining color extraction parameters. Background Technology
[0002] In the process of building AOI (Automated Optical Inspection) algorithms, engineers need to perform color extraction operations on various regions of each component. However, due to the diversity of materials / forms of various components and the diversity of the same component for different inspection tasks, the workload of engineers in configuring color extraction parameters is greatly increased, thus consuming a lot of their time and energy. Furthermore, common AOI color extraction programs all specify a color space and perform color extraction within that color space by setting upper and lower limits for each dimension. The color extraction parameters determined by this method correspond to a pixel color range that is a linear combination of the dimensions of the color space, resulting in weak expressive power. Summary of the Invention
[0003] This invention provides a method, apparatus, and automatic optical inspection device for obtaining color extraction parameters, aiming to solve the technical problems of large workload and weak expressive ability in the prior art for color extraction parameters.
[0004] To solve the above-mentioned technical problems, one technical solution adopted in the embodiments of the present invention is: to provide a method for obtaining color extraction parameters, the method comprising:
[0005] Get the current image;
[0006] Based on the current image, obtain the first dataset and the second dataset;
[0007] Obtain a preset color space, and convert the first dataset and the second dataset into the preset color space to obtain a first training set and a second training set;
[0008] A preset classification model is obtained, and the preset classification model is trained based on the first training set and the second training set to determine the parameters of the preset classification model, wherein the parameters are the color extraction parameters.
[0009] Optionally, obtaining the first dataset and the second dataset based on the current image includes:
[0010] Based on the current image, obtain a first region set and a second region set;
[0011] Pixel data of the first region set and the second region set are obtained respectively;
[0012] A first dataset is generated based on the pixel data of the first region set, and a second dataset is generated based on the pixel data of the second region set.
[0013] Optionally, obtaining a preset classification model and training the preset classification model based on the first training set and the second training set to determine the parameters of the preset classification model includes:
[0014] Obtain the preset classification model;
[0015] The preset classification model is trained using the first training set and the second training set, and the loss value of the classification result output by the preset classification model is calculated.
[0016] Obtain the initial classification parameters of the preset classification model;
[0017] The initial classification parameters are updated based on the loss value, and the steps of training the preset classification model using the first training set and the second training set are repeated until the loss value is the minimum loss value or the loss value no longer decreases during iteration, at which point the parameters of the preset classification model are output.
[0018] Optionally, calculating the loss value of the classification result output by the preset classification model includes:
[0019] Obtain the loss function from the preset classifier, and add a regularization term to the loss function;
[0020] The classification result is input into the loss function after adding a regularization term to obtain the output value of the loss function, wherein the output value is the loss value.
[0021] Optionally, obtaining the initial classification parameters of the preset classification model includes:
[0022] Obtain the detection task corresponding to the current image;
[0023] Based on the detection task, obtain the same historical detection tasks as the detection task.
[0024] Obtain a preset classification model corresponding to the historical detection task, and use the classification parameters of the corresponding preset classification model as the initial classification parameters of the current preset classification model.
[0025] Optionally, the method further includes:
[0026] Obtain a confirmation signal to save the color extraction parameters.
[0027] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of the present invention is: providing a device for obtaining color extraction parameters, the device comprising:
[0028] The first acquisition module is used to acquire the current image;
[0029] The second acquisition module is used to acquire a first dataset and a second dataset based on the current image;
[0030] The third acquisition module is used to acquire a preset color space and convert the first dataset and the second dataset into the preset color space to acquire a first training set and a second training set;
[0031] The training module is used to obtain a preset classification model and train the preset classification model based on the first training set and the second training set to determine the parameters of the preset classification model, wherein the parameters are the color extraction parameters.
[0032] Optionally, the second acquisition module is specifically used for:
[0033] Based on the current image, obtain a first region set and a second region set;
[0034] Pixel data of the first region set and the second region set are obtained respectively;
[0035] A first dataset is generated based on the pixel data of the first region set, and a second dataset is generated based on the pixel data of the second region set.
[0036] Optionally, the training module is specifically used for:
[0037] Obtain the preset classification model;
[0038] The preset classification model is trained using the first training set and the second training set, and the loss value of the classification result output by the preset classification model is calculated.
[0039] Obtain the initial classification parameters of the preset classification model;
[0040] The initial classification parameters are updated based on the loss value, and the steps of training the preset classification model using the first training set and the second training set are repeated until the loss value is the minimum loss value or the loss value no longer decreases during iteration, at which point the parameters of the preset classification model are output.
[0041] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of the present invention is: to provide an automatic optical inspection device, the automatic optical inspection device comprising:
[0042] At least one processor; and,
[0043] A memory communicatively connected to the at least one processor; wherein,
[0044] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described above.
[0045] Unlike related technologies, this invention provides a method, apparatus, and automatic optical inspection device for obtaining color extraction parameters. The method primarily involves acquiring a current image, and based on the current image, acquiring a first dataset and a second dataset. Next, a preset color space is acquired, and the first and second datasets are converted into the preset color space to obtain a first training set and a second training set. Finally, a preset classification model is acquired, and the preset classification model is trained based on the first and second training sets to determine the parameters of the preset classification model, wherein the parameters are the color extraction parameters. This method reduces the workload of acquiring color extraction parameters while improving the expressive power of the color extraction parameters. Attached Figure Description
[0046] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0047] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present invention;
[0048] Figure 2 This is a flowchart of a method for obtaining color extraction parameters provided in an embodiment of the present invention;
[0049] Figure 3 This is a structural block diagram of a device for obtaining color extraction parameters provided in an embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of the hardware structure of an automatic optical inspection device that performs the above-described method, provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0052] It should be noted that, unless otherwise specified, the various features in the embodiments of the present invention can be combined with each other, and all are within the protection scope of the present invention. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different module division or in a different order than that shown in the device schematic diagram or the flowchart.
[0053] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0054] Please see Figure 1 , Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present invention, such as... Figure 1 As shown, application scenario 1 includes an automated optical inspection device 11 and a device under test (DUT) 12. The automated optical inspection device is a device that detects common defects encountered in welding production based on optical principles. The DUT 12 can be a PCB board, on which several components are soldered. The automated optical inspection device 11 is used to detect whether there are welding defects in each component of the DUT 12. When the automated optical inspection device 11 inspects the DUT 12, it first determines the current inspection task, then, based on the inspection task, acquires the current image of the component in the DUT 12 corresponding to the inspection task, then, based on the current image, collects the corresponding color extraction parameters, and finally, completes the color extraction of the DUT 12 according to the color extraction parameters.
[0055] Please see Figure 2 , Figure 2 This is a flowchart of a method for obtaining color extraction parameters provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes:
[0056] S01. Obtain the current image.
[0057] Specifically, before acquiring the current image of the device under test (DUT) using the automated optical inspection equipment, it is also necessary to acquire the current inspection task using the automated optical inspection equipment. The current inspection task may be color extraction of a specific component within the DUT. After acquiring the current inspection task, the automated optical inspection equipment will acquire the current image of the DUT based on the current inspection task.
[0058] S02. Obtain a first data set and a second data set based on the current image.
[0059] After the current image is acquired, the automatic optical inspection device acquires a first region set and a second region set based on the current image, wherein the first region set and the second region set are two disjoint sets. After the first region set and the second region set are acquired, the automatic optical inspection device further acquires color spaces corresponding to the first region set and the second region set and pixel data in the color spaces. Then, according to the pixel data, the first region set and the second region set are converted into a corresponding first data set and a corresponding second data set. For example, the first region set and the second region set are in the RGB color space, then based on the RGB color space, pixels of the first region set and the second region set are acquired, and the pixels are converted into digital form, for example, 0<R<255, and G and B take an empty set, based on which the first data set and the second data set can be obtained. It should be noted that the first region set and the second region set are used for determining the color extraction parameters. When the first region set and the second region set are extracted according to the color extraction parameters, the proportion of pixel data of the first region set falling within the color range will be far greater than that of the pixel data of the second region set falling within the color range. That is, during color extraction, most of the pixel data of the first region set will be selected, and only a small amount of the pixel data of the second region set will be selected.
[0060] S03. Acquire a preset color space, and convert the first data set and the second data set into the preset color space to acquire a first training set and a second training set.
[0061] After the first data set and the second data set are acquired, the automatic optical inspection device further acquires a preset color space, wherein the preset color space is determined according to a subsequent algorithm of the automatic optical inspection device. Specifically, when detecting defects on a device to be tested, the automatic optical inspection device performs image processing on the acquired current image, that is, in the image processing, the automatic optical inspection device corresponds to a color space. The color space is expressed based on vectors, and in different color spaces, the same color may correspond to different expression manners. Therefore, by acquiring the color space corresponding to the automatic optical inspection device and using the color space as the preset color space, the accuracy of the color extraction parameters can be improved. Optionally, the color space comprises RGB, BGR, HSV, HSL, CIE, CMYK, etc.
[0062] After obtaining the preset color space, the automatic optical inspection device acquires the color spaces corresponding to the first and second datasets, and obtains the colors corresponding to the first and second datasets in the current color space based on the color spaces. After obtaining the corresponding colors, the first and second datasets are converted to the current preset color space respectively, thereby obtaining the representation in the preset color space. Finally, the first training set and the second training set are obtained according to the representation. For example, the color space of the first and second datasets is RGB, and the representation of the first dataset in the RGB color space is (255, 0, 0), and the representation of the second dataset in the RGB color space is (0, 255, 0), while the preset color space is HSV. In this case, converting the first dataset from the RGB color space to the HSV color space yields the representation (0°, 100%, 100%), and converting the second dataset to the HSV color space yields the representation (120°, 100%, 100%). Based on this, the first training set and the second training set can be determined.
[0063] S04. Obtain a preset classification model, and train the preset classification model based on the first training set and the second training set to determine the parameters of the preset classification model, wherein the parameters are the color extraction parameters.
[0064] After obtaining the first training set and the second training set, a preset classification model needs to be obtained. This preset classification model can be a classification model such as a decision tree, decision forest, or neural network. After determining the preset classification model, it is trained using the first and second training sets. The loss value of the classification result output by the preset classification model is calculated, and the initial classification parameters of the preset classification model are obtained. These initial classification parameters are updated based on the loss value, and the steps of training the preset classification model using the first and second training sets are repeated until the loss value is minimized or the loss value no longer decreases during iteration. Finally, the parameters of the preset classification model are output.
[0065] Specifically, the first training set and the second training set are respectively input into the preset classification model to obtain output results. The preset classification model can be a decision tree, which calculates the probability that the expected net present value is greater than or equal to zero based on known probabilities of various scenarios. For example, after inputting the first training set and the second training set into the decision tree, if the output is 1, the corresponding pixel is considered to be within the preset color space; if the output is 0, the corresponding pixel is considered to be outside the preset color space. After obtaining the output results, a loss function needs to be obtained. The loss function is a computational function used to measure the difference between the model's predicted value f(x) and the true value Y. It is a non-negative real-valued function, usually represented by L(Y,f(x)). The smaller the loss function, the better the robustness of the model. The output results are input into the loss function to obtain a loss value, which can be used to determine whether the output results meet the output requirements. For example, if the output of the first training set after passing through the decision tree is 0, then when the output result is input into the loss function, the loss value is incremented by 1. That is, if the output results of the first and second training sets are input into the preset classification model and correspond, the loss value remains unchanged; if the output results do not correspond, the loss value is incremented by 1. Based on this, the loss value of the preset classification model can be obtained. Once the loss value is obtained, the parameters of the preset classification model can be adjusted accordingly. Specifically, if the loss value is too large, the parameters of the preset classification model are adjusted appropriately, and the adjusted preset classification model is obtained. The first and second training sets are then used to retrain the parameter-adjusted preset classification model to obtain a new loss value. This process is repeated until the loss value decreases to a certain level and no longer decreases during repeated calculations. Then, the parameters of the current preset classification model are obtained and used as color extraction parameters.
[0066] In some embodiments, the preset classification model further includes initial classification parameters, and the output classification parameters can be obtained based on the detection task. Specifically, firstly, the current detection task and historical detection tasks are obtained; then, based on the current detection task, the historical detection tasks are searched to obtain historical detection tasks identical to the current detection task. After obtaining the historical detection tasks, based on the historical detection tasks, a preset classification model corresponding to the historical detection tasks is obtained, and the classification parameters in the corresponding preset classification model are obtained. Finally, the classification parameters are used as the initial classification parameters of the preset classification model in the current detection task.
[0067] In some embodiments, when the preset classification model is too complex, to prevent overfitting, a regularization term can be added to the loss function to improve the accuracy of color parameter extraction while addressing overfitting caused by model complexity. For example, when the preset classification model is a neural network, the deep neural network includes an input layer, an output layer, and intermediate hidden layers. The deep neural network is mainly used for classifying nonlinear data. When the first training set and the second training set are input to the input layer of the neural network, the neural network begins to classify them. However, when there are too many hidden layers in the neural network, the preset classification model may overfit. In this case, adding a regularization term to the loss function solves the overfitting problem caused by too many hidden layers. In the neural network, the regularization term is typically the sum of squares of all parameters, and the loss function after adding the regularization term is the original loss function plus the regularization term multiplied by the weights. It should be noted that the weights in the loss function can be adjusted to adjust the ratio of the regularization term to the loss function.
[0068] In some embodiments, after obtaining the color extraction parameters of the preset classification model, it is also necessary to obtain confirmation parameters and save the color extraction parameters. Specifically, after obtaining the color extraction parameters, it is also necessary to display the color extraction parameters to the user. After the user confirms the color extraction parameters and presses the confirmation button, the automatic optical detection device obtains the confirmation signal and saves the color extraction parameters according to the confirmation signal.
[0069] In some embodiments, after confirming the color extraction parameters, the first training set and the second training set need to be input into the preset classification model to obtain the classification results of each pixel and display the classification results to the user.
[0070] This invention provides a method for obtaining color extraction parameters. The method primarily involves acquiring a current image, and based on the current image, acquiring a first dataset and a second dataset. Next, a preset color space is acquired, and the first and second datasets are converted into the preset color space to obtain a first training set and a second training set. Finally, a preset classification model is acquired, and the preset classification model is trained based on the first and second training sets to determine the parameters of the preset classification model, wherein the parameters are the color extraction parameters. This method reduces the workload of acquiring color extraction parameters while improving the expressive power of the color extraction parameters.
[0071] Please see Figure 3 , Figure 3 This is a structural block diagram of a device for obtaining color extraction parameters provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the device 40 for acquiring color extraction parameters includes a first acquisition module 41, a second acquisition module 42, a third acquisition module 43, and a training module 44.
[0072] The first acquisition module 41 is used to acquire the current image.
[0073] The second acquisition module 42 is used to acquire a first dataset and a second dataset based on the current image.
[0074] Specifically, the second acquisition module 42 is used for:
[0075] Based on the current image, obtain a first region set and a second region set;
[0076] Pixel data of the first region set and the second region set are obtained respectively;
[0077] A first dataset is generated based on the pixel data of the first region set, and a second dataset is generated based on the pixel data of the second region set.
[0078] The third acquisition module 43 is used to acquire a preset color space and convert the first dataset and the second dataset into the preset color space to acquire a first training set and a second training set.
[0079] The training module 44 is used to obtain a preset classification model and train the preset classification model based on the first training set and the second training set to determine the parameters of the preset classification model, wherein the parameters are the color extraction parameters.
[0080] Specifically, the training module 44 is used for:
[0081] Obtain the preset classification model;
[0082] The preset classification model is trained using the first training set and the second training set, and the loss value of the classification result output by the preset classification model is calculated.
[0083] Obtain the initial classification parameters of the preset classification model;
[0084] The initial classification parameters are updated based on the loss value, and the steps of training the preset classification model using the first training set and the second training set are repeated until the loss value is the minimum loss value or the loss value no longer decreases during iteration, at which point the parameters of the preset classification model are output.
[0085] It should be noted that the apparatus for obtaining color extraction parameters described above can execute the method for obtaining color extraction parameters provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the apparatus embodiments for obtaining color extraction parameters can be found in the method for obtaining color extraction parameters provided in the embodiments of the present invention.
[0086] Please see Figure 4 This invention provides an automated optical inspection device 11, which includes at least one processor 111. Figure 4 Taking a processor 111 as an example; the at least one processor 111 is communicatively connected to a memory 112. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0087] The memory 112 stores instructions that can be executed by the at least one processor 111, which are executed by the at least one processor 111 to enable the at least one processor 111 to perform the above-described method for obtaining color extraction parameters.
[0088] The memory 112, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for obtaining color extraction parameters in the embodiments of the present invention. The processor 111 executes various functional applications and data processing of the automatic optical inspection device 11 by running the non-volatile software programs, instructions, and modules stored in the memory 112, thereby implementing the method for obtaining color extraction parameters in the above-described method embodiments.
[0089] Memory 112 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and application programs required for at least one function. Furthermore, memory 112 may include high-speed random access memory and may also include non-volatile memory. For example, it may include at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 112 may optionally include memory remotely located relative to processor 111.
[0090] The one or more modules are stored in the memory 112. When executed by the one or more processors 111, they perform the method for obtaining color extraction parameters in any of the above method embodiments, for example, performing the above-described... Figure 1 The methods and steps in the text.
[0091] The automatic optical inspection device 11 is also connected to other devices to better perform the method provided in the embodiments of the present invention, such as being electrically connected to a display screen or other display, or being remotely connected to the communication device of the target user, etc., which will not be listed here.
[0092] The aforementioned automated optical inspection equipment can execute the method provided in the embodiments of the present invention and has corresponding functional modules for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.
[0093] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for obtaining color extraction parameters, characterized in that, The method includes: Obtain the current detection task, wherein the current detection task is for the automatic optical inspection equipment to extract color from a certain component in the device under test; The current image of the device under test is obtained based on the current detection task; Based on the current image, obtain the first dataset and the second dataset; A preset color space is obtained, and the first dataset and the second dataset are converted into the preset color space to obtain a first training set and a second training set, wherein the preset color space is determined according to the subsequent algorithm of the automatic optical detection device; Obtain a preset classification model, and train the preset classification model based on the first training set and the second training set to determine the parameters of the preset classification model, including: Obtain the preset classification model; The preset classification model is trained using the first training set and the second training set, and the loss value of the classification result output by the preset classification model is calculated. Obtain the detection task corresponding to the current image; Based on the detection task, obtain the same historical detection tasks as the detection task. Obtain a preset classification model corresponding to the historical detection task, and use the classification parameters of the corresponding preset classification model as the initial classification parameters of the current preset classification model; The initial classification parameters are updated based on the loss value, and the steps of training the preset classification model using the first training set and the second training set are repeated until the loss value is the minimum loss value or the loss value no longer decreases during iteration, at which point the parameters of the preset classification model are output. Wherein, the parameter is the color extraction parameter.
2. The method according to claim 1, characterized in that, The step of obtaining the first dataset and the second dataset based on the current image includes: Based on the current image, obtain a first region set and a second region set; Pixel data of the first region set and the second region set are obtained respectively; A first dataset is generated based on the pixel data of the first region set, and a second dataset is generated based on the pixel data of the second region set.
3. The method according to claim 1, characterized in that, The calculation of the loss value of the classification result output by the preset classification model includes: Obtain the loss function from the preset classification model, and add a regularization term to the loss function; The classification result is input into the loss function after adding a regularization term to obtain the output value of the loss function, wherein the output value is the loss value.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: Obtain a confirmation signal to save the color extraction parameters.
5. A device for acquiring color extraction parameters, characterized in that, The device includes: The first acquisition module is used to acquire the current detection task, wherein the current detection task is for an automatic optical inspection device to extract color from a certain component in the device under test; and to acquire the current image of the device under test based on the current detection task. The second acquisition module is used to acquire a first dataset and a second dataset based on the current image; The third acquisition module is used to acquire a preset color space and convert the first dataset and the second dataset into the preset color space to acquire a first training set and a second training set, wherein the preset color space is determined according to the subsequent algorithm of the automatic optical detection device; The training module is used to obtain a preset classification model and train the preset classification model based on the first training set and the second training set to determine the parameters of the preset classification model, wherein the parameters are the color extraction parameters; The training module is specifically used for: obtaining a preset classification model; training the preset classification model using the first training set and the second training set, and calculating the loss value of the classification result output by the preset classification model; obtaining a detection task corresponding to the current image; obtaining a historical detection task that is the same as the detection task based on the detection task; obtaining a preset classification model corresponding to the historical detection task, and using the classification parameters of the corresponding preset classification model as the initial classification parameters of the current preset classification model; updating the initial classification parameters according to the loss value, and repeatedly executing the step of training the preset classification model using the first training set and the second training set until the loss value is the minimum loss value or the loss value no longer decreases in the iteration, and then outputting the parameters of the preset classification model.
6. The apparatus according to claim 5, characterized in that, The second acquisition module is specifically used for: Based on the current image, obtain a first region set and a second region set; Pixel data of the first region set and the second region set are obtained respectively; A first dataset is generated based on the pixel data of the first region set, and a second dataset is generated based on the pixel data of the second region set.
7. An automatic optical inspection device, characterized in that, The automated optical inspection equipment includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-4.
Citation Information
Patent Citations
Method for detecting defected components of printed circuit boards (PCBs)
CN108982544A
White balance tuning method, device and equipment of image processor and storage medium
CN111818318A
Method and device for acquiring insulator identification model, and computer equipment
CN113065598A