An Image Duplicate Removal Hyperparameter Optimization Method, Device, Equipment and Storage Medium

By performing random sampling and target similarity function optimization on the image data set and automatically adjusting the hyperparameter set, the problem of inefficient hyperparameter optimization in the existing technology is solved, and an efficient and flexible image deduplication method is realized, which is suitable for independent and related hyperparameter distributions.

CN114241346BActive Publication Date: 2025-08-01SHENZHEN EXTREME VISION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210125524.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-10
Publication Date
2025-08-01
Estimated Expiration
2042-02-10

AI Technical Summary

Technical Problem

The existing image deduplication hyperparameter optimization methods are inefficient in high-dimensional search spaces, and the adjustment of relevant hyperparameter distributions depends on engineer experience, resulting in inefficiency and high cost.

Method used

By randomly sampling the deduplicated image dataset, the image similarity is calculated using the target similarity function, and the hyperparameter set is optimized under the automatic machine learning baseline, the hyperparameters are automatically adjusted to adapt to independent and related distributions, and manual intervention is reduced.

Benefits of technology

It realizes efficient and flexible hyperparameter spatial search, which is suitable for complex and changeable large-scale image scenarios, reduces dependence on engineer experience, and improves the efficiency and effect of image deduplication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241346B_ABST
    Figure CN114241346B_ABST
Patent Text Reader

Abstract

The present application discloses an image duplicate removal hyperparameter optimization method, apparatus, device, and medium, including: randomly sampling the image dataset to be de-duplicated to obtain sampled image data; performing de-duplication on the sampled image data based on an initial hyperparameter set and a preset image de-duplication algorithm to obtain a de-duplicated image dataset; calculating the similarity between any two images in the de-duplicated image dataset by using a target similarity function created based on a target distance calculation method to obtain a target similarity function value; determining whether the current iteration number has reached the maximum iteration number, if not, optimizing the current hyperparameter set by using the target similarity function value and entering the next iteration; if so, using the optimized hyperparameter set corresponding to the minimum similarity value among all the target similarity function values as the target hyperparameter set for image de-duplication by using the target hyperparameter set. The present application can automatically and efficiently tune the hyperparameters through the pre-created target similarity function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated machine learning technology, and in particular, to an image duplicate removal hyperparameter optimization method, apparatus, device, and storage medium. Background Art

[0002] Hyperparameter optimization is a necessary step in the image duplicate removal task. Currently, the mainstream image duplicate removal hyperparameter adjustment and optimization methods include grid search, random search, and experience-based search. Among them, grid search defines the search space as a grid containing all possible hyperparameter values, and then traverses each position in the grid and evaluates it. Therefore, grid search is not economical and practical in a high-dimensional search space. Random search defines the search space as a finite domain of hyperparameter values and evaluates the randomly sampled points in this domain. In random search, different hyperparameters are often randomly selected in parallel, that is, the internal relationship between hyperparameter distributions is not considered. Therefore, random search can generate a set of hyperparameters with good performance for image duplicate removal with independently distributed hyperparameters, but usually performs poorly in the case of correlated hyperparameters. Experience-based search largely depends on the previous experience of data engineers or algorithm engineers. Engineers usually directly determine the initial hyperparameter set based on empirical knowledge and fine-tune the determined initial hyperparameters until the result of image duplicate removal reaches a satisfactory effect. However, even for very experienced engineers, the fine-tuning process for a set of hyperparameters with good performance sometimes takes a lot of time and effort.

[0003] In summary, how to effectively optimize the hyperparameters in image duplicate removal is still an issue to be further solved at present. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide an image duplicate removal hyperparameter optimization method, apparatus, device, and storage medium, which can automatically optimize hyperparameters, has strong universality, flexible and efficient hyperparameter space search, is applicable to independent and correlated hyperparameter distributions, and does not require engineer experience and manual adjustment. The specific solutions are as follows:

[0005] In the first aspect, this application discloses an image duplicate removal hyperparameter optimization method, including:

[0006] Randomly sample the image dataset to be duplicate removed to obtain a preset number of sampled image data;

[0007] Based on the initial hyperparameter set and the preset image duplicate removal algorithm, perform duplicate removal processing on the sampled image data to obtain a duplicate-removed image dataset;

[0008] Calculate the similarity between any two images in the deduplicated image dataset using the target similarity function created based on the target distance calculation method to obtain the target similarity function value;

[0009] Determine whether the current iteration count has reached the maximum iteration count. If it has not reached the maximum iteration count, optimize the current hyperparameter set using the target similarity function value to obtain an optimized hyperparameter set, update the current hyperparameter set using the optimized hyperparameter set, and then enter the next iteration process using the updated hyperparameter set;

[0010] If the maximum iteration count is reached, use the optimized hyperparameter set corresponding to the minimum similarity value among the target similarity function values obtained in all iteration counts as the target hyperparameter set for image deduplication.

[0011] Optionally, randomly sampling the image dataset to be deduplicated to obtain a preset number of sampled image data includes:

[0012] Randomly sample the image dataset to be deduplicated according to a preset random sampling method to obtain a preset number of sampled image data; where the random sampling method includes any one of simple random sampling, equidistant random sampling, stratified random sampling, cluster random sampling, and multi-stage random sampling.

[0013] Optionally, calculating the similarity between any two images in the deduplicated image dataset using the target similarity function created based on the target distance calculation method to obtain the target similarity function value includes:

[0014] Calculate the similarity between any two images in the deduplicated image dataset using the target similarity function created based on the target distance calculation method to obtain multiple target similarity values, and calculate the mean of the sum of all the target similarity values to obtain the target similarity function value.

[0015] Optionally, calculating the similarity between any two images in the deduplicated image dataset using the target similarity function created based on the target distance calculation method to obtain multiple target similarity values includes:

[0016] Calculate the similarity between any two images in the deduplicated image dataset using the target similarity function created based on the cosine distance calculation method to obtain multiple target similarity values.

[0017] Optionally, optimizing the current hyperparameter set using the target similarity function value to obtain an optimized hyperparameter set includes:

[0018] Feed the target similarity function value back to the automated machine learning baseline so that the machine learning baseline can automatically optimize the current hyperparameter set using the target similarity function value to obtain an optimized hyperparameter set.

[0019] Optionally, the functional expression corresponding to the process of obtaining the target hyperparameter set is:

[0020] θ OPT = argmax|minf T (f D (θ HPS ; I S ));

[0021] In the formula, θ OPT represents the target hyperparameter set, I S represents the sampled image data, θ HPS represents the current hyperparameter set, f D represents the function of the preset image duplicate removal algorithm, and f T represents the target similarity function.

[0022] Optionally, using the target hyperparameter set for image duplicate removal includes:

[0023] Update the current hyperparameter set using the target hyperparameter set, and perform duplicate removal processing on the image dataset to be de-duplicated using the target hyperparameter set.

[0024] In a second aspect, the present application discloses an image duplicate removal hyperparameter optimization device, including:

[0025] A random sampling module for randomly sampling the image dataset to be de-duplicated to obtain a preset number of sampled image data;

[0026] A duplicate removal module for removing duplicates from the sampled image data based on an initial hyperparameter set and a preset image duplicate removal algorithm to obtain a de-duplicated image dataset;

[0027] A similarity calculation module for calculating the similarity between any two images in the de-duplicated image dataset using a target similarity function created based on a target distance calculation method to obtain a target similarity function value;

[0028] An iteration count judgment module for judging whether the current iteration count has reached the maximum iteration count;

[0029] A hyperparameter optimization module for, if the maximum iteration count has not been reached, optimizing the current hyperparameter set using the target similarity function value to obtain an optimized hyperparameter set, updating the current hyperparameter set using the optimized hyperparameter set, and then entering the next iteration process using the updated hyperparameter set;

[0030] A target hyperparameter set determination module, configured to, if the maximum number of iterations is reached, use the optimization hyperparameter set corresponding to the minimum similarity value among the target similarity function values obtained in all iterations as the target hyperparameter set, so as to perform image duplicate removal by using the target hyperparameter set.

[0031] In a third aspect, the present application discloses an electronic device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the image duplicate removal hyperparameter optimization method described above is implemented.

[0032] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the image duplicate removal hyperparameter optimization method described above is implemented.

[0033] It can be seen that the present application first randomly samples the image dataset to be de-duplicated to obtain a preset number of sampled image data, then performs de-duplication processing on the sampled image data based on the initial hyperparameter set and the preset image de-duplication algorithm to obtain a de-duplicated image dataset, and then calculates the similarity between any two images in the de-duplicated image dataset by using a target similarity function created based on a target distance calculation method to obtain a target similarity function value, and determines whether the current number of iterations reaches the maximum number of iterations. If the maximum number of iterations is not reached, the current hyperparameter set is optimized by using the target similarity function value to obtain an optimized hyperparameter set, and the current hyperparameter set is updated by using the optimized hyperparameter set, and then the updated hyperparameter set is used to enter the next iteration process. If the maximum number of iterations is reached, the optimized hyperparameter set corresponding to the minimum similarity value among the target similarity function values obtained in all iterations is used as the target hyperparameter set, so as to perform image duplicate removal by using the target hyperparameter set. It can be seen that the hyperparameter optimization framework of the target function created based on the target distance calculation method in the present application can automatically tune the hyperparameters, has strong universality, flexible and efficient hyperparameter space search, is applicable to independent and related hyperparameter distributions, does not require engineer experience and manual adjustment, and does not require the image dataset to carry manual annotations, and has low application costs, which is beneficial to the duplicate removal task in complex and changing large-scale image scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0035] Figure 1 Flow chart of an image duplicate removal hyperparameter optimization method disclosed in this application;

[0036] Figure 2 Flow chart of a specific image duplicate removal hyperparameter optimization method disclosed in this application;

[0037] Figure 3 Flow chart of a specific automatic optimization and duplicate removal of image duplicate removal hyperparameters disclosed in this application;

[0038] Figure 4 Schematic diagram of the structure of an image duplicate removal hyperparameter optimization device disclosed in this application;

[0039] Figure 5 Structure diagram of an electronic device disclosed in this application. Detailed implementation manners

[0040] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0041] The embodiments of the present application disclose an image duplicate removal hyperparameter optimization method. Refer to Figure 1 As shown, the method includes:

[0042] Step S11: Randomly sample the image dataset to be de-duplicated to obtain a preset number of sampled image data.

[0043] In this embodiment, first, the image dataset to be de-duplicated is randomly sampled according to a preset random sampling method to obtain a preset number of sampled image data. It should be noted that the random sampling method can be selected according to the actual situation, and the number of the image dataset to be de-duplicated should be reasonably considered and the distribution of the image dataset to be de-duplicated should be kept consistent as much as possible. Specifically, the random sampling method includes, but is not limited to, simple random sampling, equidistant random sampling, stratified random sampling, cluster random sampling, and multi-stage random sampling, etc.

[0044] Step S12: Perform de-duplication processing on the sampled image data based on the initial hyperparameter set and the preset image de-duplication algorithm to obtain a de-duplicated image dataset.

[0045] In this embodiment, after randomly sampling the duplicate-removing image dataset to obtain a preset number of sampled image data, the sampled image data can be processed for duplicate removal according to a preset image duplicate-removing algorithm and a randomly generated initial hyperparameter set, so as to obtain a duplicate-removing image dataset. Among them, the value ranges of the hyperparameters in the initial hyperparameter set are all bounded intervals, and the preset image duplicate-removing algorithm includes, but is not limited to, the Perceptual Hash Algorithm (PHA).

[0046] Step S13: Calculate the similarity between any two images in the duplicate-removing image dataset by using the target similarity function created based on the target distance calculation method, so as to obtain the target similarity function value.

[0047] In this embodiment, after processing the sampled image data for duplicate removal based on the initial hyperparameter set and the preset image duplicate-removing algorithm to obtain a duplicate-removing image dataset, further, a target similarity function is created by a preset target distance calculation method, and the similarity between any two images in the duplicate-removing image dataset is calculated by using the created target similarity function, so as to obtain a target similarity function value that can reflect the overall image similarity of the duplicate-removing image dataset. Among them, the target distance calculation method includes, but is not limited to, Euclidean Distance, Cosine, etc.

[0048] In a specific implementation manner, the calculating the similarity between any two images in the duplicate-removing image dataset by using the target similarity function created based on the target distance calculation method to obtain the target similarity function value may specifically include: calculating the similarity between any two images in the duplicate-removing image dataset by using the target similarity function created based on the target distance calculation method to obtain a plurality of target similarity values, and calculating the mean value of the sum of all the target similarity values to obtain the target similarity function value. It can be understood that after creating the target similarity function by the target distance calculation method, the similarity between any two paired images in the duplicate-removing image dataset can be calculated by using the created target similarity function to obtain corresponding a plurality of target similarity values, then calculate the sum of the plurality of target similarity values, and divide it by the total number of pairs of paired images, that is, perform a mean value calculation, to obtain the target similarity function value.

[0049] Step S14: Determine whether the current iteration number reaches the maximum iteration number. If it does not reach the maximum iteration number, optimize the current hyperparameter set by using the target similarity function value to obtain an optimized hyperparameter set, update the current hyperparameter set by using the optimized hyperparameter set, and then enter the next iteration process by using the updated hyperparameter set.

[0050] In this embodiment, the similarity between any two images in the deduplicated image data set is calculated using a target similarity function created based on a target distance calculation method. After obtaining the target similarity function value, it is determined whether the current number of iterations has reached a preset maximum number of iterations. If the maximum number of iterations has not been reached, the current hyperparameter set can be optimized and adjusted using the target similarity function value to obtain a corresponding optimized hyperparameter set, and the current hyperparameter set is configured using the optimized hyperparameter set, and the configured hyperparameter set is then used to enter the next iteration process.

[0051] Step S15: If the maximum number of iterations is reached, the optimized hyperparameter set corresponding to the target similarity function value with the minimum similarity among all iterations is used as the target hyperparameter set, so as to perform image deduplication using the target hyperparameter set.

[0052] In this embodiment, if the current number of iterations reaches the maximum number of iterations, the optimized hyperparameter set corresponding to the value with the smallest similarity among the target similarity function values obtained in all iterations will be used as the target hyperparameter set, that is, the target similarity function value will be used as a metric score to determine whether the currently used hyperparameter set is optimal, and then the above-mentioned target hyperparameter set can be used to perform image deduplication on the above-mentioned image data set to be deduplicated.

[0053] In this embodiment, the function expression corresponding to the process of obtaining the target hyperparameter set can be expressed as follows:

[0054] θ OPT =argmax|minf T (f D (θ HPS ;I S ));

[0055] θ HPS ={x1,x2,x3,...,x k}; and θ HPS ∈Θ;

[0056] Where θ OPT Represents the target hyperparameter set finally determined, I S Represents the sampled image data after random sampling, θ HPS Represents the hyperparameter set used in the current iteration, θ HPS Specifically including x1 to x k There are k hyperparameters, and they belong to a predefined bounded hyperparameter search space Θ, f D Represents the function corresponding to the preset image deduplication algorithm, f T Indicates that the image deduplication algorithm f DThe created target similarity function. It should be noted that the final selection of θ OPT is related to the design of f T . For example, if f T adopts the distance calculation method of cosine of the included angle, then θ OPT takes the maximum value.

[0057] In this embodiment, using the target hyperparameter set for image deduplication may specifically include: updating the current hyperparameter set using the target hyperparameter set, and performing deduplication processing on the image dataset to be deduplicated using the target hyperparameter set. In this embodiment, after obtaining the target hyperparameter set, the currently used hyperparameter set can be reconfigured, that is, updated, using the target hyperparameter set, and then using the above target hyperparameter set, that is, the hyperparameter set that can minimize the similarity between any two images in the image dataset to be deduplicated, to perform deduplication processing on the above image dataset to be deduplicated.

[0058] It can be seen that in the embodiment of the present application, the image dataset to be deduplicated is first randomly sampled to obtain a preset number of sampled image data, and then the sampled image data is deduplicated based on the initial hyperparameter set and the preset image deduplication algorithm to obtain a deduplicated image dataset. Then, the similarity between any two images in the deduplicated image dataset is calculated using the target similarity function created based on the target distance calculation method to obtain the target similarity function value, and it is determined whether the current iteration number reaches the maximum iteration number. If the maximum iteration number is not reached, the current hyperparameter set is optimized using the target similarity function value to obtain an optimized hyperparameter set, and the current hyperparameter set is updated using the optimized hyperparameter set, and then the updated hyperparameter set is used to enter the next iteration process. If the maximum iteration number is reached, the optimized hyperparameter set corresponding to the minimum similarity value among the target similarity function values obtained in all iteration numbers is used as the target hyperparameter set to facilitate image deduplication using the target hyperparameter set. It can be seen that the hyperparameter optimization framework of the target function created based on the target distance calculation method in the embodiment of the present application can automatically optimize the hyperparameters, has strong universality, flexible and efficient hyperparameter space search, is applicable to independent and related hyperparameter distributions, and does not require engineer experience and manual adjustment.

[0059] The embodiment of the present application discloses a specific method for optimizing image deduplication hyperparameters. Refer to Figure 2 as shown. The method includes:

[0060] Step S21: Randomly sample the image dataset to be deduplicated to obtain a preset number of sampled image data.

[0061] Step S22: Perform duplicate removal processing on the sampled image data based on the initial hyperparameter set and the preset image duplicate removal algorithm to obtain a duplicate-removed image data set.

[0062] Step S23: Calculate the similarity between any two images in the duplicate-removed image data set using the target similarity function created based on the cosine distance calculation method to obtain multiple target similarity values, and calculate the mean of the sum of all the target similarity values to obtain the target similarity function value.

[0063] In this embodiment, after performing duplicate removal processing on the sampled image data based on the initial hyperparameter set and the preset image duplicate removal algorithm to obtain a duplicate-removed image data set, a target similarity function is created based on the cosine distance calculation method. Then, the similarity between any two images in the duplicate-removed image data set is calculated using the created target similarity function to obtain corresponding multiple target similarity values. Next, the sum of all the target similarity values is calculated and divided by the total number of the target similarity values to obtain the target similarity function value.

[0064] Step S24: Determine whether the current iteration number has reached the maximum iteration number. If it has not reached the maximum iteration number, feedback the target similarity function value to the automated machine learning baseline so that the machine learning baseline can automatically optimize the current hyperparameter set using the target similarity function value to obtain an optimized hyperparameter set, update the current hyperparameter set using the optimized hyperparameter set, and then enter the next iteration process using the updated hyperparameter set.

[0065] In this embodiment, after calculating the similarity between any two images in the duplicate-removed image data set using the target similarity function created based on the cosine distance calculation method to obtain multiple target similarity values and calculating the mean of the sum of all the target similarity values to obtain the target similarity function value, it is determined whether the current iteration number has reached the preset maximum iteration number. If it has not reached the maximum iteration number, the above target similarity function value is fed back as prior knowledge to the automated machine learning baseline (Baseline). After receiving the above target similarity function value, the machine learning baseline can automatically optimize the current hyperparameter set using the above target similarity function value to obtain an optimized hyperparameter set, reconfigure the current hyperparameter set using the optimized hyperparameter set, and then enter the next iteration process using the configured hyperparameter set.

[0066] Step S25: If the maximum iteration number is reached, use the optimized hyperparameter set corresponding to the value with the smallest similarity among the target similarity function values obtained in all iteration numbers as the target hyperparameter set for image duplicate removal.

[0067] In this embodiment, if the maximum number of iterations is reached, the set of optimized hyperparameters corresponding to the minimum similarity value among the target similarity function values obtained in all iterations is taken as the target hyperparameter set, and then the above target hyperparameter set can be used to perform image deduplication on the image dataset to be deduplicated. It should be noted that since the target similarity function is created based on the cosine distance calculation method, according to the properties of the cosine function graph, the value that can represent the minimum similarity between paired images among the target similarity function values obtained in all iterations should be the maximum value among all values. Therefore, the target hyperparameter set is the hyperparameter set corresponding to the maximum value among the target similarity function values.

[0068] In a specific implementation manner, the process of obtaining the target hyperparameter set and the specific process of performing image deduplication using the target hyperparameter set can be referred to Figure 3 as shown. First, randomly sample the image dataset to be deduplicated, that is, Figure 3 the original dataset in it, to obtain sampled data. Then load the sampled data and perform deduplication using a preset image deduplication algorithm and the original hyperparameter set to obtain deduplicated data. Then input the above deduplicated data into the target function created based on the target distance calculation method, and calculate the target function value, that is, Figure 3 the metric score in it. Then judge whether the current number of iterations has reached the preset maximum number of iterations. If not, feedback the metric score to the automated machine learning baseline, and automatically optimize the current hyperparameter set through the automated learning baseline, and use the optimized hyperparameter set to perform image deduplication on the sampled data again until the maximum number of iterations is reached. When the maximum number of iterations is reached, the hyperparameter set corresponding to the maximum or minimum value among the metric scores generated in all iterations is taken as the target hyperparameter set for image deduplication. Among them, the selection of the maximum or minimum value is related to the distance calculation method used by the target function.

[0069] Among them, the more specific processing processes of the above steps S21 and S22 can refer to the corresponding content disclosed in the foregoing embodiments, and will not be elaborated here.

[0070] It can be seen that when the current iteration count in the embodiments of the present application does not reach the maximum iteration count, the target similarity function value is fed back to the automated machine learning baseline, and the current hyperparameter set is automatically optimized by the machine learning baseline to obtain an optimized hyperparameter set. Then, the current hyperparameter set is updated using the optimized hyperparameter set, and the updated hyperparameter set is used to enter the next iteration process. If the maximum iteration count is reached, the hyperparameter set corresponding to the value with the smallest similarity among the target similarity function values obtained in all iteration counts is used as the target hyperparameter set. It can be seen that by feeding back the target similarity function value as prior knowledge to the automated machine learning baseline, the embodiments of the present application can effectively guide the automated machine learning baseline to timely update the optimization direction and pace of the hyperparameter space, reduce redundant search time, and enable a high search efficiency for the hyperparameter space, and have quite high flexibility even in a high-dimensional space.

[0071] Correspondingly, the embodiments of the present application also disclose an image duplicate removal hyperparameter optimization device. Refer to Figure 4 as shown. The device includes:

[0072] A random sampling module 11 for randomly sampling the image dataset to be de-duplicated to obtain a preset number of sampled image data;

[0073] A de-duplication module 12 for de-duplicating the sampled image data based on the initial hyperparameter set and a preset image de-duplication algorithm to obtain a de-duplicated image dataset;

[0074] A similarity calculation module 13 for calculating the similarity between any two images in the de-duplicated image dataset using a target similarity function created based on a target distance calculation method to obtain a target similarity function value;

[0075] An iteration count judgment module 14 for judging whether the current iteration count reaches the maximum iteration count;

[0076] A hyperparameter optimization module 15 for, if the maximum iteration count is not reached, optimizing the current hyperparameter set using the target similarity function value to obtain an optimized hyperparameter set, updating the current hyperparameter set using the optimized hyperparameter set, and then using the updated hyperparameter set to enter the next iteration process;

[0077] A target hyperparameter set determination module 16 for, if the maximum iteration count is reached, using the optimized hyperparameter set corresponding to the value with the smallest similarity among the target similarity function values obtained in all iteration counts as the target hyperparameter set for image de-duplication using the target hyperparameter set.

[0078] Among them, the specific working processes of the above-mentioned various modules can refer to the corresponding content disclosed in the foregoing embodiments, and will not be elaborated herein.

[0079] It can be seen that in the embodiment of the present application, first, the image dataset to be deduplicated is randomly sampled to obtain a preset number of sampled image data, and then the sampled image data is deduplicated based on the initial hyperparameter set and the preset image deduplication algorithm to obtain a deduplicated image dataset. Then, the similarity between any two images in the deduplicated image dataset is calculated by using the target similarity function created based on the target distance calculation method to obtain the target similarity function value. It is judged whether the current iteration number reaches the maximum iteration number. If it does not reach the maximum iteration number, the current hyperparameter set is optimized by using the target similarity function value to obtain an optimized hyperparameter set, and the current hyperparameter set is updated by using the optimized hyperparameter set, and then the updated hyperparameter set is used to enter the next iteration process. If the maximum iteration number is reached, the optimized hyperparameter set corresponding to the minimum similarity value among the target similarity function values obtained in all iteration numbers is used as the target hyperparameter set for image deduplication. It can be seen that the hyperparameter optimization framework of the objective function created based on the target distance calculation method in the embodiment of the present application can automatically optimize the hyperparameters, has strong universality, flexible and efficient hyperparameter space search, is applicable to independent and related hyperparameter distributions, and does not require engineer experience and manual adjustment.

[0080] In some specific embodiments, the random sampling module 11 may specifically include:

[0081] A random sampling unit, configured to randomly sample the image dataset to be deduplicated according to a preset random sampling method to obtain a preset number of sampled image data; wherein, the random sampling method includes any one of simple random sampling, equidistant random sampling, stratified random sampling, cluster random sampling, and multi-stage random sampling.

[0082] In some specific embodiments, the similarity calculation module 13 may specifically include:

[0083] A first similarity calculation unit, configured to calculate the similarity between any two images in the deduplicated image dataset by using the target similarity function created based on the target distance calculation method to obtain a plurality of target similarity values;

[0084] A summation calculation unit, configured to calculate the mean value of the sum of all the target similarity values to obtain the target similarity function value.

[0085] In some specific embodiments, calculating the similarity between any two images in the deduplicated image dataset by using the target similarity function created based on the target distance calculation method, and obtaining a plurality of target similarity values, may specifically include:

[0086] A second similarity calculation unit, configured to calculate the similarity between any two images in the deduplicated image dataset by using the target similarity function created based on the cosine distance calculation method, and obtain a plurality of target similarity values.

[0087] In some specific embodiments, optimizing the current hyperparameter set by using the target similarity function value to obtain an optimized hyperparameter set may specifically include:

[0088] A hyperparameter set optimization unit, configured to feedback the target similarity function value to an automatic machine learning baseline, so that the machine learning baseline automatically optimizes the current hyperparameter set by using the target similarity function value to obtain an optimized hyperparameter set.

[0089] In some specific embodiments, the function expression corresponding to the process of obtaining the target hyperparameter set is:

[0090] θ OPT = argmax|minf T (f D (θ HPS ; I S ));

[0091] In the formula, θ OPT represents the target hyperparameter set, I S represents the sampled image data, θ HPS represents the current hyperparameter set, f D represents the function of the preset image deduplication algorithm, and f T represents the target similarity function.

[0092] In some specific embodiments, performing image deduplication by using the target hyperparameter set may specifically include:

[0093] An image deduplication unit, configured to update the current hyperparameter set by using the target hyperparameter set, and perform deduplication processing on the image dataset to be deduplicated by using the target hyperparameter set.

[0094] Furthermore, an embodiment of the present application also discloses an electronic device, Figure 5 which is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be considered as any limitation to the scope of use of the present application.

[0095] Figure 5Schematic diagram of the structure of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the image deduplication hyperparameter optimization method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0096] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and specific limitations are not imposed herein; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitations are imposed herein.

[0097] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0098] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the image deduplication hyperparameter optimization method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.

[0099] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the image deduplication hyperparameter optimization method disclosed above is implemented. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.

[0100] In the present specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments may be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts may be referred to the description of the method part.

[0101] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0102] The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0103] Finally, it should also be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0104] The above has introduced in detail a method, apparatus, device and storage medium for optimizing image deduplication hyperparameters provided by this application. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. An image duplicate removal hyperparameter optimization method, characterized in that Including: Randomly sample the duplicate-removed image dataset to obtain a preset number of sampled image data; Based on the initial hyperparameter set and the preset image duplicate-removal algorithm, perform duplicate-removal processing on the sampled image data to obtain a duplicate-removed image dataset; Use the target similarity function created based on the target distance calculation method to calculate the similarity between any two images in the duplicate-removed image dataset to obtain the target similarity function value; Determine whether the current iteration number has reached the maximum iteration number. If it has not reached the maximum iteration number, use the target similarity function value to optimize the current hyperparameter set to obtain an optimized hyperparameter set, use the optimized hyperparameter set to update the current hyperparameter set, and then use the updated hyperparameter set to enter the next iteration process; If the maximum iteration number is reached, use the optimized hyperparameter set corresponding to the minimum similarity value among the target similarity function values obtained in all iteration numbers as the target hyperparameter set for image duplicate-removal; The function expression corresponding to the acquisition process of the target hyperparameter set is: θ OPT = arg max|min f T (f D (θ HPS ; I S )); where θ OPT represents the target hyperparameter set, I S represents the sampled image data, θ HPS represents the current hyperparameter set, f D represents the function of the preset image deduplication algorithm, f T represents the target similarity function; where, θ HPS ={x1, x2, x3, …, x k} and θ HPS ∈ Θ; where θ HPS includes x1 to x k, k hyperparameters and belongs to a predefined bounded hyperparameter search space Θ.

2. The image duplicate removal hyperparameter optimization method according to claim 1, wherein The step of randomly sampling the duplicate-removed image dataset to obtain a preset number of sampled image data includes: Randomly sample the duplicate-removed image dataset according to a preset random sampling method to obtain a preset number of sampled image data; wherein, the random sampling method includes any one of simple random sampling, equidistant random sampling, stratified random sampling, cluster random sampling, and multi-stage random sampling.

3. The image duplicate removal hyperparameter optimization method according to claim 1, wherein The step of using the target similarity function created based on the target distance calculation method to calculate the similarity between any two images in the duplicate-removed image dataset to obtain the target similarity function value includes: Use the target similarity function created based on the target distance calculation method to calculate the similarity between any two images in the duplicate-removed image dataset to obtain multiple target similarity values, and calculate the mean of the sum of all the target similarity values to obtain the target similarity function value.

4. The image duplicate removal hyperparameter optimization method according to claim 3, wherein The step of using the target similarity function created based on the target distance calculation method to calculate the similarity between any two images in the duplicate-removed image dataset to obtain multiple target similarity values includes: Use the target similarity function created based on the cosine distance calculation method to calculate the similarity between any two images in the duplicate-removed image dataset to obtain multiple target similarity values.

5. The image duplicate removal hyperparameter optimization method according to claim 1, wherein The step of using the target similarity function value to optimize the current hyperparameter set to obtain an optimized hyperparameter set includes: Feed the target similarity function value back to the automated machine learning baseline so that the machine learning baseline uses the target similarity function value to automatically optimize the current hyperparameter set to obtain an optimized hyperparameter set.

6. The method for optimizing image deduplication hyperparameters according to any one of claims 1 to 5, characterized in that The step of using the target hyperparameter set for image duplicate-removal includes: Use the target hyperparameter set to update the current hyperparameter set and perform duplicate-removal processing on the duplicate-removed image dataset using the target hyperparameter set.

7. An image duplicate removal hyperparameter optimization device, characterized in that, Including: A random sampling module for randomly sampling the duplicate-removed image dataset to obtain a preset number of sampled image data; A duplicate removal module, configured to perform duplicate removal processing on the sampled image data based on an initial hyperparameter set and a preset image duplicate removal algorithm, so as to obtain a duplicate-removed image data set; A similarity calculation module, configured to calculate the similarity between any two images in the duplicate-removed image data set by using a target similarity function created based on a target distance calculation method, so as to obtain a target similarity function value; An iteration number judgment module, configured to judge whether the current iteration number reaches the maximum iteration number; A hyperparameter optimization module, configured to, if the maximum iteration number is not reached, optimize the current hyperparameter set by using the target similarity function value to obtain an optimized hyperparameter set, update the current hyperparameter set by using the optimized hyperparameter set, and then enter the next iteration process by using the updated hyperparameter set; A target hyperparameter set determination module, configured to, if the maximum iteration number is reached, use the optimized hyperparameter set corresponding to the minimum similarity value among the target similarity function values obtained in all iteration numbers as the target hyperparameter set, so as to perform image duplicate removal by using the target hyperparameter set; The function expression corresponding to the obtaining process of the target hyperparameter set is: θ OPT = arg max|min f T (f D (θ HPS ; I S ); where θ OPT represents the set of target hyperparameters, I S represents the sampled image data, θ HPS represents the current set of hyperparameters, f D represents the function of the preset image deduplication algorithm, f T represents the target similarity function; where, θ HPS = {x1, x2, x3, …, x k}; and θ HPS ∈ Θ; where θ HPS includes x1 to x k, k hyperparameters and belongs to a predefined bounded hyperparameter search space Θ.

8. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the image duplicate removal hyperparameter optimization method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that, It is used to store a computer program; wherein, when the computer program is executed by a processor, the image duplicate removal hyperparameter optimization method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Image data cleaning method and device, electronic equipment and readable storage medium

    CN113688261A

  • Hyperparameter Optimization Algorithm Recommendation Method and Optimization Algorithm Recommendation System

    KR102251807B1