A training set generation method, a network model training method, and related devices
By generating reference images and selecting images to be added to the training set based on the output results, the problem of deep learning network model recognition performance relying on large-scale datasets is solved, achieving efficient optimization of network models and reducing manual annotation costs.
Patent Information
- Application Number
- CN202210651942.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-09
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-06-09
AI Technical Summary
In existing technologies, the recognition performance of deep learning network models depends on large-scale datasets. Simply increasing the amount of datasets cannot improve the recognition performance, and manual annotation is costly and cannot efficiently and accurately identify images with poor model recognition performance.
By acquiring the network model to be optimized and the image database, adjustments are made based on the non-interested regions of the original images to generate reference images. The first and second output results are then used to select images that meet the preset conditions and add them to the training set to optimize the network model.
The system automatically selects images that are valuable for model optimization as the training set, reducing the cost of manual annotation and improving the optimization effect and performance of the network model.
Smart Images

Figure CN115205620B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a training set generation method, a network model training method, and related apparatus. Background Technology
[0002] The recognition performance of deep learning network models depends on the training set. For complex tasks, to achieve better recognition performance and generalization ability, it is often necessary to train with a large-scale dataset. However, simply increasing the amount of data cannot improve the recognition performance. Currently, the only way to optimize the network model is to manually identify images and then add manually identified images with poor model recognition performance to the training set. This method cannot efficiently and accurately determine which type of image the model is poor at recognizing, and the human and material costs of data collection and manual annotation are also high. Summary of the Invention
[0003] This application provides a training set generation method, a network model training method, and related apparatus, which can improve the optimization effect of the network model to be optimized.
[0004] To address the aforementioned technical problems, the technical solution adopted in this application is as follows: a training set generation method is provided, comprising: acquiring a network model to be optimized and an image database, wherein the image database includes multiple original images; adjusting the original images based on non-interested regions in the original images to obtain a reference image; inputting the original images into the network model to be optimized to obtain a first output result; inputting the reference image into the network model to be optimized to obtain a second output result; and, in response to determining that the original images meet preset screening conditions based on the first and second output results, adding the original images to the training set so as to train the network model to be optimized using the training set.
[0005] To solve the above-mentioned technical problems, the technical solution adopted in this application is: to provide a network model training method, which includes: obtaining a training set, wherein the training set is obtained by using the training set generation method in the above-mentioned technical solution; inputting the training set into the network model to be optimized, so as to train the network model to be optimized, and obtaining the optimized network model.
[0006] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an image processing apparatus, the image processing apparatus including a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the training set generation method in the above-mentioned technical solution.
[0007] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing a computer program, which, when executed by a processor, is used to implement the training set generation method or network model training method in the above-mentioned technical solution.
[0008] The beneficial effects of this application through the above scheme are as follows: First, the network model to be optimized and the image database are obtained; then, the original image is adjusted according to the non-interested regions in the original image to obtain a reference image; then, based on the first output result and the second output result, it is determined whether the original image meets the preset screening conditions, and the original images that meet the preset screening conditions are added to the training set so that the network model to be optimized can be trained in the subsequent training set, thereby optimizing the network model to be optimized; by adopting this scheme, images with great value for optimizing the network model to be optimized can be automatically selected from large-scale data as the training set, improving the optimization effect of the network model to be optimized, making the performance of the network model to be optimized better, saving the manual analysis process, and greatly reducing the cost of manual annotation. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0010] Figure 1 This is a flowchart illustrating an embodiment of the training set generation method provided in this application;
[0011] Figure 2 This is a flowchart illustrating another embodiment of the training set generation method provided in this application;
[0012] Figure 3 This is a schematic diagram of the detection of the region of interest provided in this application;
[0013] Figure 4 This is a flowchart illustrating the process of determining whether an original image meets the preset filtering conditions provided in this application.
[0014] Figure 5 This is a flowchart illustrating another scheme provided in this application for determining whether the original image meets the preset filtering conditions;
[0015] Figure 6 This is a flowchart illustrating an embodiment of the network model training method provided in this application;
[0016] Figure 7 This is a schematic diagram of the structure of an embodiment of the image processing apparatus provided in this application;
[0017] Figure 8 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0018] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the application. Similarly, the following embodiments are only some, not all, embodiments of the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.
[0019] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0020] It should be noted that the terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0021] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the training set generation method provided in this application. The method includes:
[0022] Step 11: Obtain the network model to be optimized and the image database.
[0023] The image database includes multiple original images. The network model to be optimized can be a model trained on the existing training set. The network model to be optimized can be a human recognition model or a vehicle attribute recognition model, etc. There are no restrictions on the type or function of the network model to be optimized.
[0024] Furthermore, the original image can be an image containing the detected object of the network model to be optimized. For example, if the network model to be optimized is a human recognition model, then the original image is an image containing human targets. The scene information of the original image can also be the same as the scene information of the network model to be optimized. For example, if the network model to be optimized is a staff recognition model used to identify people in a shopping mall, then the original image can be a shopping mall surveillance image containing human targets. Understandably, the image database can be established according to the actual situation, and is not limited here.
[0025] Step 12: Adjust the original image based on the non-interested regions in the original image to obtain a reference image.
[0026] Non-interested regions are regions other than the regions of interest in the original image. The original image can be adjusted based on the non-interested regions to obtain a reference image. Specifically, the non-interested regions of the original image can be subjected to interference or other processing to achieve the adjustment of the original image, which is not limited here.
[0027] Furthermore, in the process of recognizing the original image, the network model to be optimized can first identify the region of interest in the original image, and then perform feature analysis on the target to be detected in the region of interest to obtain the recognition result. Understandably, the region of interest can be the region where the target to be detected in the network model to be optimized is located. For example, for a human body recognition model, the region of interest can be the region where the human body target is located in the original image.
[0028] Step 13: Input the original image into the network model to be optimized to obtain the first output result.
[0029] The original image is input into the network model to be optimized to obtain the first output result. The first output result may include the attribute recognition result of the detected target in the original image. For example, if the network model to be optimized is a vehicle model recognition model, the original image is input into the vehicle model recognition model, and the first output result may include the vehicle model category.
[0030] Step 14: Input the reference image into the network model to be optimized to obtain the second output result.
[0031] The reference image is input into the network model to be optimized to obtain a second output result, which may include the attribute recognition result of the detected target in the reference image.
[0032] Step 15: In response to the determination that the original image meets the preset screening conditions based on the first output result and the second output result, the original image is added to the training set so as to train the network model to be optimized using the training set.
[0033] After obtaining the first output result and the second output result, it can be determined whether the original image meets the preset screening conditions based on the first output result and the second output result. If the original image meets the preset screening conditions, the original image is added to the training set so as to train the network model to be optimized using the training set, thereby achieving the purpose of optimizing the recognition effect of the network model to be optimized.
[0034] In a specific embodiment, images that meet the preset screening conditions can be those from all original images where the recognition performance of the network model to be optimized is poor. The recognition performance of the network model to be optimized is largely affected by its detection accuracy of the region of interest. If the network model to be optimized identifies the wrong region of interest during the image recognition process, it is easy to output incorrect recognition results, thereby affecting the recognition accuracy. By comparing the first output result and the second output result, the detection accuracy of the network model to be optimized in the region of interest can be judged, thereby filtering out the original images where the recognition performance of the network model to be optimized is poor. Then, the original images where the recognition performance of the network model to be optimized is poor are added to the training set, which can generate a training set that improves the optimization performance of the network model to be optimized. Using the training set to train the network model to be optimized can specifically improve the recognition performance of the network model to be optimized.
[0035] This embodiment adjusts the original image based on the non-interested regions in the original image to obtain a reference image. Then, based on the first and second output results, it is determined whether the original image meets the preset screening conditions. Original images that meet the preset screening conditions are added to the training set so that the network model to be optimized can be trained using the training set, thereby optimizing the network model. By adopting this scheme, images with great value for optimizing the network model can be automatically selected from large-scale data as the training set, improving the optimization effect of the network model and making the performance of the network model better. It also saves the manual analysis process and greatly reduces the cost of manual annotation.
[0036] Please see Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of the training set generation method provided in this application. The method includes:
[0037] Step 21: Obtain the network model to be optimized and the image database.
[0038] Step 21 is the same as step 11 in the above embodiments, and will not be repeated here.
[0039] Step 22: Perform target detection processing on the original image to obtain the region of interest where the detected target is located in the original image.
[0040] The original image can be processed by object detection to obtain the region of interest (ROI) containing the detected target. This ROI is the same as described in the previous embodiments and will not be elaborated further. Specifically, an object detection model can be used to obtain the ROI. For example, if the network model to be optimized is a face recognition model, and the target detected by the face recognition model is the head region of the human body, then a human body part detection model can be used to obtain the head region in the original image, thus obtaining the ROI. Figure 3 As shown, Figure 3 This is a schematic diagram of detecting the head region of a human target, where A represents the head region.
[0041] Step 23: Perturb the non-interested regions in the original image to obtain the reference image.
[0042] A reference image can be obtained by perturbing non-interested regions in the original image. Specifically, this can be achieved by randomly cropping the non-interested regions, adding Gaussian noise to the non-interested regions, filling the non-interested regions, or erasing the non-interested regions. Understandably, perturbation can also include other methods besides those listed above, and the specific location and amount of perturbation can be randomly set and are not limited here.
[0043] The recognition performance of the network model to be optimized is related to its detection accuracy of the region of interest. If the network model to be optimized can detect the correct region of interest, it can still obtain an accurate output result even if the non-region of interest is perturbed. In other words, the output result obtained by recognizing the reference image is not much different from the output result obtained by recognizing the original image. Conversely, if the recognition performance of the network model to be optimized is poor and it cannot detect the accurate region of interest, the output result obtained by the network model to be optimized can produce a large difference when the non-region of interest is perturbed.
[0044] For example, taking the head as the target to be detected, the region of interest is the head region. If perturbation is added to the parts outside the head region, and the region of interest identified by the network model to be optimized is the head region, the output result of the network model to be optimized will not change much even if perturbation is added to the parts outside the head region. However, if the region of interest identified by the network model to be optimized is a region outside the head region, the features in the region of interest obtained by the network model to be optimized will change because perturbation is added to the parts outside the head region, and the output result will also change significantly.
[0045] Step 24: Input the original image into the network model to be optimized to obtain the first output result.
[0046] Step 24 above is the same as step 13 in the above embodiment, and is not limited here.
[0047] Step 25: Input the reference image into the network model to be optimized to obtain the second output result.
[0048] Step 25 is the same as step 14 in the above embodiment, and is not limited here.
[0049] The first output result may include the first attribute recognition result and the corresponding first confidence information, and the second output result may include the second attribute recognition result and the corresponding second confidence information. Based on the first and second output results, it can be determined whether the original image meets the preset screening conditions, thereby selecting the original images to be added to the training set. Specifically, by comparing the degree of difference between the output results obtained by the network model to be optimized in recognizing the reference image and the original image, it can be determined whether the network model to be optimized accurately detects the region of interest, and thus whether the recognition effect of the network model to be optimized on the original image is poor, so as to select the original images that meet the preset screening conditions as images in the training set. See steps 26-28 for details.
[0050] Step 26: Determine whether the first attribute recognition result is consistent with the second attribute recognition result.
[0051] The first attribute recognition result and the second attribute recognition result can include the attribute type of the detected target. For example, if the network model to be optimized is used to detect whether a person in the original image is wearing a hat, then the first attribute recognition result and the second attribute recognition result can include whether the person is wearing a hat or not. Specifically, it can be determined whether the first attribute recognition result and the second attribute recognition result are consistent. If the first attribute recognition result and the second attribute recognition result are inconsistent, it is determined that the original image meets the preset screening conditions, indicating that the recognition effect of the network model to be optimized on the original image is not good. The original image can be added to the training set so that the network model to be optimized can be trained and optimized using the training set.
[0052] Step 27: In response to the consistency between the first attribute recognition result and the second attribute recognition result, determine whether the original image meets the preset screening conditions based on the first confidence information and the second confidence information.
[0053] If the first attribute recognition result is consistent with the second attribute recognition result, it means that the network model to be optimized recognizes the original image and the reference image and obtains the same attribute recognition result. However, it is possible that a random event or unstable recognition result may occur. At this time, based on the first confidence information and the second confidence information, it can be further determined whether the original image meets the preset screening conditions.
[0054] In a specific embodiment, the absolute value of the difference between the first confidence information and the second confidence information can be calculated to obtain the confidence difference; then it is determined whether the confidence difference is greater than a preset threshold; if the confidence difference is greater than the preset threshold, it indicates that the recognition result of the network model to be optimized on the original image is unstable, and the original image is determined to meet the preset screening conditions; if the confidence difference is less than or equal to the preset threshold, it indicates that the recognition result of the network model to be optimized on the original image is stable, and the original image is determined not to meet the preset screening conditions; it is understood that the preset threshold can be set according to the actual situation, and is not limited here.
[0055] Understandably, the first attribute recognition result and the second attribute recognition result may include the recognition result of at least one attribute. That is, the network model to be optimized can identify the type of at least one attribute of the target in the original image. The target attribute is the attribute that the network model to be optimized does not recognize well among multiple attributes. In a specific implementation, the consistency judgment of the recognition results corresponding to the target attribute in the first attribute recognition result and the second attribute recognition result can be performed to filter out the original images that meet the preset filtering conditions. The following is a detailed introduction.
[0056] In one implementation, such as Figure 4 As shown, the scheme includes:
[0057] Step 41: Obtain preset attribute information.
[0058] The preset attribute information may include the type of the target attribute in at least one attribute. The following embodiment takes the head recognition model as an example to illustrate the network model to be optimized. The head recognition model can identify whether a person is wearing a hat, the color of the hat, and the type of hat. The first attribute recognition result and the second attribute recognition result may include the recognition results of the above three attributes. The preset attribute information can be customized according to the actual situation, so as to improve the recognition effect of the target attribute of the network model to be optimized in a targeted manner. It is not limited here.
[0059] Step 42: Determine whether the identification results of the first attribute to be compared are consistent with the identification results of the second attribute to be compared.
[0060] First, select the first attribute identification result and the second attribute identification result from the first attribute identification result and the second attribute identification result respectively, and then determine whether the first attribute identification result and the second attribute identification result are consistent. Specifically, the first attribute identification result is the identification result of the attribute that is the same as the preset attribute information in the first attribute identification result; the second attribute identification result is the identification result of the attribute that is the same as the preset attribute information in the second attribute identification result. Taking the target attribute as hat color as an example, the first attribute identification result and the second attribute identification result can be the identification results corresponding to the hat color.
[0061] If the recognition results of the first attribute to be compared and the second attribute to be compared are inconsistent, it indicates that the network model to be optimized has a poor recognition effect on the target attribute of the original image, and the original image is determined to meet the preset screening conditions.
[0062] In response to the consistency between the identification results of the first attribute to be compared and the identification results of the second attribute to be compared, the original image is further determined based on the confidence level corresponding to the target attribute to determine whether it meets the preset screening conditions, as shown in steps 43 to 46.
[0063] Step 43: In response to the consistency between the identification results of the first attribute to be compared and the identification results of the second attribute to be compared, calculate the absolute value of the difference between the confidence level of the target attribute in the first confidence information and the confidence level of the target attribute in the second confidence information to obtain the first confidence difference.
[0064] Step 44: Determine whether the first confidence difference is greater than the preset threshold.
[0065] The preset threshold can be set according to the actual situation, and is not limited here.
[0066] Step 45: If the first confidence difference is greater than the preset threshold, then the original image is determined to meet the preset screening conditions.
[0067] Step 46: If the first confidence difference is less than or equal to the preset threshold, then the original image is determined not to meet the preset screening conditions.
[0068] The first confidence information and the second confidence information may include the confidence of at least one attribute. First, the absolute value of the difference between the confidence of the target attribute in the first confidence information and the confidence of the target attribute in the second confidence information can be calculated to obtain the first confidence difference. Then, it is determined whether the first confidence difference is greater than a preset threshold. If the first confidence difference is greater than the preset threshold, it indicates that the recognition effect of the target attribute of the network model to be optimized on the original image is unstable, and the original image is determined to meet the preset screening conditions. If the first confidence difference is less than or equal to the preset threshold, it indicates that the recognition effect of the target attribute of the network model to be optimized on the original image is relatively stable, and the original image is determined not to meet the preset screening conditions.
[0069] In another implementation, target attributes do not need to be pre-defined. Instead, the recognition performance of the network model to be optimized on each image attribute is assessed. Then, based on the comparison results during the screening process, all target attributes corresponding to the network model to be optimized are determined, and the recognition performance of the network model to be optimized on each target attribute is improved, thereby enhancing the optimization effect of the network model to be optimized. This solution is as follows: Figure 5 As shown, it specifically includes:
[0070] Step 51: Determine whether the recognition result of each attribute in the first attribute recognition result is consistent with the recognition result of the corresponding attribute in the second attribute recognition result.
[0071] Compare the identification results of each attribute in the first attribute identification result with the identification results of the corresponding attribute in the second attribute identification result, and determine whether the identification results of each attribute in the first attribute identification result are consistent with the identification results of the corresponding attribute in the second attribute identification result.
[0072] Step 52: In response to the inconsistency between the recognition result of the attribute in the first attribute recognition result and the recognition result of the corresponding attribute in the second attribute recognition result, the attribute is determined as the target attribute, and the original image is determined to meet the preset screening conditions.
[0073] If the recognition result of an attribute in the first attribute recognition result is inconsistent with the recognition result of the corresponding attribute in the second attribute recognition result, it indicates that the network model to be optimized does not perform well in recognizing that attribute of the image. In this case, the attribute can be identified as the target attribute, and the original image can be determined to meet the preset screening conditions.
[0074] Step 53: In response to the fact that the identification result of the attribute in the first attribute identification result is consistent with the identification result of the corresponding attribute in the second attribute identification result, determine whether the attribute is the target attribute based on the first comparison confidence level and the second comparison confidence level corresponding to the attribute.
[0075] If the recognition result of the attribute in the first attribute recognition result is consistent with the recognition result of the corresponding attribute in the second attribute recognition result, then based on the first confidence level to be compared and the second confidence level to be compared corresponding to the attribute, it is further determined whether the attribute is the target attribute, and whether the recognition effect of the network model to be optimized on the attribute of the original image is stable.
[0076] Furthermore, the first confidence level to be compared is the confidence level of the attribute in the first attribute identification result, and the second confidence level to be compared is the confidence level of the attribute in the second attribute identification result. The absolute value of the difference between the first confidence level to be compared and the second confidence level to be compared can be calculated first to obtain the second confidence level difference. Then, it is determined whether the second confidence level difference is greater than a preset threshold. In response to the second confidence level difference being greater than the preset threshold, the attribute is determined as the target attribute. Understandably, the preset threshold can be set according to the actual situation and is not limited here.
[0077] Step 54: In response to the attribute being the target attribute, the original image is determined to meet the preset filtering conditions.
[0078] If the attribute is the target attribute, it indicates that the recognition effect of the network model to be optimized on this attribute of the image is unstable, and the original image is determined to meet the preset screening conditions.
[0079] Step 55: In response to the attribute not being the target attribute, determine that the original image does not meet the preset filtering conditions.
[0080] If the response is that the attribute is not the target attribute, it means that the network model to be optimized has a stable recognition effect on that attribute of the image, and the original image is determined not to meet the preset screening conditions.
[0081] Step 28: If the original image meets the preset screening conditions, add the original image to the training set so that the network model to be optimized can be trained using the training set.
[0082] If the original image meets the preset screening conditions, the original image is added to the training set so that the network model to be optimized can be trained using the training set. Specifically, before adding the original image to the training set, the target attributes in the original image can be manually labeled, and the labeled original image is added to the training set.
[0083] This embodiment adds perturbations to non-interested regions and then judges the reliability of the recognition results of the network model to be optimized based on the consistency between the recognition results of the first attribute and the second attribute. This can easily and effectively automatically filter out the original images with poor recognition performance of the network model to be optimized. Furthermore, it can further filter through the first confidence information and the second confidence information, which can improve the filtering accuracy. Compared with the method of relying on manual analysis of the model, identification of error causes and collection of corresponding data for model optimization, this embodiment can use images with poor recognition performance of the network model to be optimized as model optimization materials to generate a training set that can optimize the network model to be optimized. Moreover, it can use fewer and more valuable images to optimize the model performance, which can greatly reduce the cost of manual annotation and model training. In addition, the attributes with poor recognition performance of the network model to be optimized can be used as target attributes to optimize the recognition performance of the network model to be optimized for the target attributes, which can improve the optimization efficiency and effect.
[0084] Please see Figure 6 , Figure 6 This is a flowchart illustrating an embodiment of the network model training method provided in this application. The method includes:
[0085] Step 61: Obtain the training set.
[0086] The training set was obtained using the training set generation method described in the above embodiments, and will not be repeated here.
[0087] Step 62: Input the training set into the network model to be optimized to train the network model and obtain the optimized network model.
[0088] This embodiment inputs the training set into the network model to be optimized to train the network model and obtain the optimized network model, thereby optimizing the network model and improving its generalization ability.
[0089] Please see Figure 7 , Figure 7 This is a schematic diagram of an embodiment of the image processing apparatus provided in this application. The image processing apparatus 70 includes a memory 71 and a processor 72 connected to each other. The memory 71 is used to store a computer program. When the computer program is executed by the processor 72, it is used to implement the training set generation method in the above embodiment.
[0090] Please see Figure 8 , Figure 8 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this application. The computer-readable storage medium 80 is used to store a computer program 81. When the computer program 81 is executed by a processor, it is used to implement the training set generation method or network model training method in the above embodiment.
[0091] The computer-readable storage medium 80 can be any medium capable of storing program code, such as a server, USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0092] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0093] 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 units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0094] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0095] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
[0096] The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A training set generation method characterized by, The method comprises the following steps: obtaining a network model to be optimized and an image database, wherein the image database comprises a plurality of original images; adjusting the original images based on non-focus areas in the original images to obtain reference images; inputting the original images into the network model to be optimized to obtain first output results; inputting the reference images into the network model to be optimized to obtain second output results; in response to determining that the original images meet a preset screening condition based on the first output results and the second output results, adding the original images to a training set to train the network model to be optimized using the training set; wherein the first output results comprise first attribute recognition results of detection targets in the original images, and the second output results comprise second attribute recognition results of detection targets in the reference images; the step of determining that the original images meet the preset screening condition based on the first output results and the second output results comprises: determining whether the first attribute recognition results are consistent with the second attribute recognition results; if not, determining that the original images meet the preset screening condition.
2. The training set generation method of claim 1, wherein, The first output results further comprise first confidence information corresponding to the first attribute recognition results, and the second output results further comprise second confidence information corresponding to the second attribute recognition results, and the method further comprises: in response to the first attribute recognition results being consistent with the second attribute recognition results, determining whether the original images meet the preset screening condition based on the first confidence information and the second confidence information.
3. The training set generation method of claim 2, wherein, The first attribute recognition results and the second attribute recognition results comprise recognition results of at least one attribute, and before the step of determining whether the first attribute recognition results are consistent with the second attribute recognition results, the method comprises: obtaining preset attribute information, wherein the preset attribute information comprises a type of a target attribute in the at least one attribute; the step of determining whether the first attribute recognition results are consistent with the second attribute recognition results comprises: determining whether first attribute recognition results to be compared and second attribute recognition results to be compared are consistent; wherein the first attribute recognition results to be compared are recognition results of attributes identical to the preset attribute information in the first attribute recognition results, and the second attribute recognition results to be compared are recognition results of attributes identical to the preset attribute information in the second attribute recognition results; the step of determining whether the original images meet the preset screening condition based on the first confidence information and the second confidence information comprises: determining whether the original images meet the preset screening condition based on a confidence degree corresponding to the target attribute.
4. The training set generation method of claim 3, wherein, The first confidence information and the second confidence information comprise confidence degrees of at least one attribute, and the step of determining whether the original images meet the preset screening condition based on the confidence degree corresponding to the target attribute comprises: calculating an absolute value of a difference between a confidence degree of the target attribute in the first confidence information and a confidence degree of the target attribute in the second confidence information to obtain a first confidence difference; determining whether the first confidence difference is greater than a preset threshold value; if yes, determining that the original image satisfies the preset screening condition; if no, determining that the original image does not satisfy the preset screening condition.
5. The training set generation method of claim 2, wherein, The first attribute recognition result and the second attribute recognition result include at least one attribute recognition result, and the step of determining whether the first attribute recognition result and the second attribute recognition result are consistent further includes: determining whether each attribute recognition result in the first attribute recognition result is consistent with a corresponding attribute recognition result in the second attribute recognition result; in response to an attribute recognition result in the first attribute recognition result being inconsistent with a corresponding attribute recognition result in the second attribute recognition result, determining the attribute as a target attribute and determining that the original image satisfies the preset screening condition.
6. The training set generation method of claim 5, wherein, The method further includes: in response to an attribute recognition result in the first attribute recognition result being consistent with a corresponding attribute recognition result in the second attribute recognition result, determining whether the attribute is the target attribute based on a first to-be-compared confidence corresponding to the attribute and a second to-be-compared confidence corresponding to the attribute; the first to-be-compared confidence is the confidence of the attribute in the first attribute recognition result, and the second to-be-compared confidence is the confidence of the attribute in the second attribute recognition result; in response to the attribute being the target attribute, determining that the original image satisfies the preset screening condition; in response to the attribute not being the target attribute, determining that the original image does not satisfy the preset screening condition.
7. The training set generation method of claim 6, wherein, The step of determining whether the attribute is the target attribute based on the first to-be-compared confidence corresponding to the attribute and the second to-be-compared confidence corresponding to the attribute includes: calculating an absolute value of a difference between the first to-be-compared confidence and the second to-be-compared confidence to obtain a second confidence difference; determining whether the second confidence difference is greater than a preset threshold value; in response to the second confidence difference being greater than the preset threshold value, determining the attribute as the target attribute.
8. The training set generation method of claim 1, wherein, The step of adjusting the original image based on the non-focus region in the original image to obtain a reference image includes: performing target detection processing on the original image to obtain a focus region in which a detection target in the original image is located; performing perturbation processing on the non-focus region in the original image to obtain the reference image.
9. A network model training method, comprising: The method includes: obtaining a training set, the training set being obtained by using the training set generation method in any one of claims 1-8; inputting the training set into a to-be-optimized network model to train the to-be-optimized network model and obtain an optimized network model.
10. An image processing apparatus characterized by comprising: The computer program, when executed by the processor, is configured to implement the training set generation method in any one of claims 1-8 or the network model training method in claim 9.
11. A computer readable storage medium for storing a computer program, characterized in that, The computer program, when executed by the processor, is configured to implement the training set generation method in any one of claims 1-8 or the network model training method in claim 9.
Citation Information
Patent Citations
Model training method and device, face screening method and electronic equipment
CN111753793A