Image deduplication method, device, equipment and storage medium

By using cosine similarity and deduplication quantity balance factor in the image deduplication method to optimize the hyperparameter set, the problem that the image deduplication method in the prior art requires manual tuning and automatic image deduplication is solved, and a high-performance image deduplication effect is achieved.

CN114463598BActive Publication Date: 2025-03-11SHENZHEN EXTREME VISION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210128958.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-11
Publication Date
2025-03-11
Estimated Expiration
2042-02-11

AI Technical Summary

Technical Problem

The existing image deduplication method requires cumbersome manual tuning, and automatic image deduplication faces the problem of difficult to formulate the objective function, which leads to a contradiction between the similarity and number of deduplication images, and is prone to falling into the local optimization of the hyperparameter set.

Method used

By deduplication processing of the deduplication image data set according to the preset image deduplication algorithm, the feature image set is extracted, the cosine similarity between the feature images is calculated, and the target metric score is obtained in combination with the deduplication quantity balance factor, and the hyperparameter set is optimized to obtain high-performance deduplication results.

Benefits of technology

The contradiction between similarity and number of deduplication images is overcome, the local optimization of the hyperparameter set is avoided, and the high-performance image deduplication effect is achieved. It is suitable for automatic deduplication tasks for multiple scene images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463598B_ABST
    Figure CN114463598B_ABST
Patent Text Reader

Abstract

The present application discloses an image deduplication method, device, equipment and storage medium, including: deduplicating a to-be-deduplicated image data set according to a preset image deduplication algorithm and based on an initial hyperparameter set to obtain a deduplicated image data set; extracting features from images in the deduplicated image data set to obtain a feature image set; calculating the cosine similarity of any two feature images in the feature image set to obtain a cosine similarity value, and dividing the mean of the sum of the cosine similarity values ​​by a preset deduplication quantity balance factor to obtain a target metric score; optimizing the initial hyperparameter set using the target metric score to obtain a target hyperparameter set, and deduplicating the to-be-deduplicated image data set using the target hyperparameter set to obtain a target deduplication image set. The present application calculates the cosine similarity between images, and obtains a target metric score in combination with a deduplication quantity balance factor, thereby obtaining a high-performance hyperparameter set, which can avoid falling into a local optimal situation of the hyperparameter set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine learning technology, and in particular to an image deduplication method, device, equipment and storage medium. Background Art

[0002] Image deduplication is an essential technology in data cleaning. Current image deduplication methods usually require tedious manual tuning to obtain an appropriate set of hyperparameters. The effect of image deduplication depends largely on the experience of engineers, and the manual parameter tuning process takes a lot of time and effort. Although automatic image deduplication can avoid the problem of laborious manual tuning, it faces another important challenge, which is how to formulate a feasible objective function.

[0003] The goal of automatic image deduplication is essentially to minimize the similarity between any pair of deduplication result images to a certain extent. However, if the objective function simply considers minimizing the similarity of the pair of deduplication result images, this will cause the hyperparameter set searched by the automatic image deduplication framework to fall into some local optimal situations, resulting in the actual deduplication images being less than the expected unreasonable deduplication images, that is, there is a contradiction between the pairwise image similarity and the number of deduplication images retained. Therefore, how to learn to retain a reasonable number of deduplication images has also become a key point that should be considered when designing the objective function. Summary of the invention

[0004] In view of this, the purpose of this application is to provide an image deduplication method, device, equipment and storage medium, which can overcome the contradiction between the similarity of paired deduplication images and the number of deduplication images retained, obtain a high-performance hyperparameter set, and avoid falling into the local optimum of the hyperparameter set. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses an image deduplication method, comprising:

[0006] Deduplication processing is performed on the image dataset to be deduplicated according to a preset image deduplication algorithm and based on an initial hyperparameter set to obtain a deduplication image dataset;

[0007] Extracting features from the images in the deduplicated image dataset to obtain a corresponding feature image set;

[0008] Calculate the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divide the mean of the sum of the cosine similarity values ​​by a preset deduplication quantity balance factor to obtain a target metric score;

[0009] The target metric score is used to optimize the initial hyperparameter set to obtain a target hyperparameter set, and the target hyperparameter set is used to perform deduplication processing on the image data set to be deduplicated to obtain a target deduplication image set.

[0010] Optionally, the initial hyperparameter set belongs to a predefined bounded hyperparameter search space.

[0011] Optionally, the deduplication quantity balancing factor is λ1n or λ2(n-1)?; wherein λ1 and λ2 are adjustable weight parameters, n is the total number of all images in the to-be-deduplicated image dataset, and ? is an order addition operator.

[0012] Optionally, the function expression corresponding to the process of obtaining the target metric score is:

[0013]

[0014] In the formula, f T1 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

[0015] Optionally, the function expression corresponding to the process of obtaining the target metric score is:

[0016]

[0017] In the formula, f T2 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

[0018] Optionally, the extracting features of the images in the deduplicated image data set to obtain a corresponding feature image set includes:

[0019] The images in the deduplication image data set are subjected to feature extraction by a preset feature extractor to obtain a corresponding feature image set; wherein the network of the feature extractor adopts any one of MobileNet, VGG or ResNet.

[0020] Optionally, optimizing the initial hyperparameter set by using the target metric score to obtain a target hyperparameter set includes:

[0021] Determine whether the target metric score reaches a preset threshold value. If not, feed back the target metric score as prior information to the automatic machine learning baseline so that the automatic machine learning baseline optimizes the initial hyperparameter set using the target metric score, and uses the optimized hyperparameter set to perform deduplication processing on the image data set to be deduplicated until the preset threshold value is reached. If the threshold value is reached, use the hyperparameter set corresponding to the target metric score as the target hyperparameter set;

[0022] Or, determine whether the current number of iterations reaches the maximum number of iterations. If not, feed back the target metric score to the automatic machine learning baseline so that the automatic machine learning baseline uses the target metric score to optimize the initial hyperparameter set, and uses the optimized hyperparameter set to deduplicate the image data set until the maximum number of iterations is reached. If reached, use the hyperparameter set corresponding to the target metric score as the target hyperparameter set.

[0023] In a second aspect, the present application discloses an image deduplication device, comprising:

[0024] A first image deduplication module is used to perform deduplication processing on the image dataset to be deduplicated according to a preset image deduplication algorithm and based on an initial hyperparameter set to obtain a deduplication image dataset;

[0025] A feature extraction module, used to extract features from the images in the deduplication image data set to obtain a corresponding feature image set;

[0026] A similarity calculation module is used to calculate the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divide the mean of the sum of the cosine similarity values ​​by a preset deduplication quantity balance factor to obtain a target metric score;

[0027] A hyperparameter set optimization module, configured to optimize the initial hyperparameter set using the target metric score to obtain a target hyperparameter set;

[0028] The second image deduplication module is used to perform deduplication processing on the to-be-deduplicated image data set using the target hyperparameter set to obtain a target deduplication image set.

[0029] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the processor implements the aforementioned image deduplication method when executing a computer program stored in the memory.

[0030] 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 aforementioned image deduplication method is implemented.

[0031] It can be seen that the present application first performs deduplication processing on the image data set to be deduplicated according to the preset image deduplication algorithm and based on the initial hyperparameter set to obtain a deduplication image data set, then performs feature extraction on the images in the deduplication image data set to obtain a corresponding feature image set, and then calculates the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divides the mean of the sum of the cosine similarity values ​​by the preset deduplication quantity balance factor to obtain a target metric score, and finally optimizes the initial hyperparameter set using the target metric score to obtain a target hyperparameter set, and uses the target hyperparameter set to perform deduplication processing on the image data set to be deduplicated to obtain a target deduplication image set. It can be seen that the present application calculates the cosine similarity between images, and obtains the target metric score in combination with the deduplication quantity balance factor, and then obtains a high-performance hyperparameter set, which can overcome the contradiction between the similarity and quantity of deduplication images, and avoid falling into the local optimal situation of the hyperparameter set, and is suitable for the automatic deduplication task of multi-class scene images. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0033] Figure 1 A flow chart of an image deduplication method disclosed in this application;

[0034] Figure 2 A flowchart of a specific image deduplication method disclosed in this application;

[0035] Figure 3 This is a schematic diagram of the structure of an image deduplication device disclosed in this application;

[0036] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] The present application discloses a method for image deduplication. Figure 1 As shown, the method includes:

[0039] Step S11: performing deduplication processing on the image dataset to be deduplicated according to a preset image deduplication algorithm and based on an initial hyperparameter set to obtain a deduplication image dataset.

[0040] In this embodiment, first, an initial hyperparameter set can be manually input or randomly generated, and then a deduplication image dataset is deduplicated according to a preset image deduplication algorithm and based on the initial hyperparameter set to obtain a deduplication image dataset. The initial hyperparameter set belongs to a predefined bounded hyperparameter search space, and the image deduplication algorithm includes but is not limited to a perceptual hash algorithm (PHA).

[0041] Step S12: extracting features from the images in the deduplicated image data set to obtain a corresponding feature image set.

[0042] In this embodiment, after deduplication processing is performed on the deduplication image dataset according to the preset image deduplication algorithm and based on the initial hyperparameter set to obtain the deduplication image dataset, feature extraction can be performed on the images in the above deduplication image dataset through a preset feature extractor to obtain an image set after feature extraction; wherein the feature extractor can be implemented based on networks including but not limited to MobileNet, VGG or ResNet.

[0043] Step S13: Calculate the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divide the mean of the sum of the cosine similarity values ​​by a preset deduplication quantity balance factor to obtain a target metric score.

[0044] In this embodiment, after feature extraction is performed on the images in the deduplicated image data set to obtain the corresponding feature image set, the cosine similarity between any two feature images in the above feature image set is calculated by using the cosine similarity calculation formula pre-created based on the cosine distance to obtain a preset number of cosine similarity values, and then all the above preset number of cosine similarity values ​​are added to obtain a total cosine similarity value, and the total cosine similarity value is divided by the preset number, that is, the mean calculation is performed, and then the result of the mean calculation is divided by the preset deduplication number balance factor to obtain the target metric score.

[0045] Specifically, in this embodiment, the deduplication quantity balance factor is λ1n or λ2(n-1)?; wherein λ1 and λ2 are adjustable weight parameters, and the default value is 1, n is the total number of all images in the image data set to be deduplicated, and ? is an order addition operator.

[0046] In a specific implementation, when the deduplication quantity balance factor is λ1n, the function expression corresponding to the process of obtaining the target metric score is:

[0047]

[0048] In the formula, f T1 represents the target metric score, represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, and θ∈Θ, Θ is a predefined bounded hyperparameter search space, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, represents the sum of the cosine similarities between any two feature images in the feature image set, ||Φ(x i )|| represents the feature map vector Φ(x i ) modulus, Φ(x i )·Φ(x j ) represents the dot product of two feature map vectors.

[0049] In another specific implementation, when the deduplication quantity balance factor is λ2(n-1)?, the function expression corresponding to the process of obtaining the target metric score is:

[0050]

[0051] In the formula, f T2 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

[0052] It should be noted that the above target metric score f T1 It is suitable for deduplication task optimization of general data sets, and the above target metric score f T2 It is suitable for deduplication scenarios where there are only a relatively small number of duplicate images in the dataset.

[0053] Step S14: optimizing the initial hyperparameter set using the target metric score to obtain a target hyperparameter set, and performing deduplication processing on the image data set to be deduplicated using the target hyperparameter set to obtain a target deduplication image set.

[0054] In this embodiment, the cosine similarity of any two feature images in the feature image set is calculated to obtain a preset number of cosine similarity values, and the mean of the sum of the cosine similarity values ​​is divided by a preset deduplication quantity balance factor to obtain a target metric score. The above-mentioned target metric score can be further used to adjust and optimize the initial hyperparameter set to obtain a target hyperparameter set, and then the above-mentioned target hyperparameter set is used to deduplicate the above-mentioned image data set to be deduplicated to obtain a target deduplicated image set.

[0055] In a specific implementation, the method of optimizing the initial hyperparameter set using the target metric score to obtain a target hyperparameter set may specifically include: determining whether the target metric score reaches a preset threshold; if not, feeding back the target metric score as prior information to the automatic machine learning baseline, so that the automatic machine learning baseline optimizes the initial hyperparameter set using the target metric score, and performs deduplication processing on the image data set to be deduplicated using the optimized hyperparameter set until the preset threshold is reached; if reached, using the hyperparameter set corresponding to the target metric score as the target hyperparameter set. It can be understood that in order to ensure that the final image deduplication result satisfies both the small similarity between paired images and the reasonable number of retained images, a preset threshold can be set to judge the target metric score. If the preset threshold is reached, the above target metric score is fed back to the automatic machine learning baseline as prior information. After receiving the target metric score, the automatic machine learning baseline uses the above target metric score to optimize and adjust the initial hyperparameter set, and then uses the optimized hyperparameter set to deduplicate the above image data set to be deduplicated again until the above preset threshold is reached, and after reaching the above preset threshold, the hyperparameter set corresponding to the above target metric score is used as the target hyperparameter set.

[0056] In another specific implementation, the method of optimizing the initial hyperparameter set using the target metric score to obtain a target hyperparameter set may specifically include: determining whether the current number of iterations reaches the maximum number of iterations, and if not, feeding back the target metric score to the automatic machine learning baseline so that the automatic machine learning baseline optimizes the initial hyperparameter set using the target metric score, and uses the optimized hyperparameter set to deduplicate the image data set to be deduplicated until the maximum number of iterations is reached, and if reached, using the hyperparameter set corresponding to the target metric score as the target hyperparameter set. It can be understood that in addition to the above-mentioned method of setting the threshold, the target metric score can also be obtained by determining whether the current number of iterations reaches the maximum number of iterations. Specifically, if the maximum number of iterations is not reached, the above-mentioned target metric score can be fed back to the automatic machine learning baseline. The automatic machine learning baseline uses the above-mentioned target metric score to optimize and adjust the hyperparameters in the initial hyperparameter set, and uses the optimized hyperparameter set to deduplicate the above-mentioned image data set to be deduplicated until the maximum number of iterations is reached. If the maximum number of iterations is reached, the current target metric score is used as the target metric score, and the hyperparameter set corresponding to the target metric score is used as the target hyperparameter set.

[0057] It can be seen that the embodiment of the present application first performs deduplication processing on the image data set to be deduplicated according to the preset image deduplication algorithm and based on the initial hyperparameter set to obtain a deduplication image data set, then performs feature extraction on the images in the deduplication image data set to obtain a corresponding feature image set, and then calculates the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divides the mean of the sum of the cosine similarity values ​​by the preset deduplication quantity balance factor to obtain a target metric score, and finally optimizes the initial hyperparameter set using the target metric score to obtain a target hyperparameter set, and uses the target hyperparameter set to perform deduplication processing on the image data set to be deduplicated to obtain a target deduplication image set. It can be seen that the embodiment of the present application calculates the cosine similarity between images, and obtains the target metric score in combination with the deduplication quantity balance factor, and then obtains a high-performance hyperparameter set, which can overcome the contradiction between the similarity and quantity of deduplication images, and avoid falling into the local optimal situation of the hyperparameter set, and is suitable for the automatic deduplication task of multiple types of scene images.

[0058] Also, see Figure 2 As shown, Figure 2A specific image deduplication method flow chart is shown. First, according to the preset image deduplication algorithm and based on the initial hyperparameter set, the deduplication image data set is deduplicated to obtain n deduplication image data. Then, feature extraction is performed on the n deduplication image data to obtain corresponding n feature maps. Then, the n feature maps are input into the objective function pre-created based on the cosine distance. The objective function first calculates the cosine similarity between any two feature maps in the n feature maps, and then the obtained (n-1)? cosine similarity values ​​are summed and divided by (n-1)? to obtain the average cosine similarity value, and finally divided by the deduplication quantity balance factor, that is, Figure 3 The balance control term λ1n or λ2(n-1) in is obtained, and the metric score, that is, the calculation result of the objective function, is obtained. Then, it is determined whether the metric score or the current number of iterations triggers a certain conditional mechanism. If it is triggered, the corresponding metric score is used as the target metric score, and the hyperparameter set corresponding to the target metric score is used to perform a deduplication operation on the image dataset to be deduplicated.

[0059] For more specific processing procedures of the above steps, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0060] It can be seen that the embodiment of the present application performs unsupervised learning with the trade-off between the similarity and quantity of paired deduplicated images as the optimization goal, guiding its search to obtain a hyperparameter set with good performance and avoiding falling into the local optimal situation of the hyperparameter set.

[0061] Correspondingly, the present application also discloses an image deduplication device, see Figure 3 As shown, the device comprises:

[0062] A first image deduplication module 11 is used to perform deduplication processing on the image dataset to be deduplicated according to a preset image deduplication algorithm and based on an initial hyperparameter set to obtain a deduplication image dataset;

[0063] A feature extraction module 12 is used to extract features from the images in the deduplication image data set to obtain a corresponding feature image set;

[0064] A similarity calculation module 13 is used to calculate the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divide the mean of the sum of the cosine similarity values ​​by a preset deduplication quantity balance factor to obtain a target metric score;

[0065] A hyperparameter set optimization module 14, configured to optimize the initial hyperparameter set using the target metric score to obtain a target hyperparameter set;

[0066] The second image deduplication module 15 is used to perform deduplication processing on the to-be-deduplicated image data set using the target hyperparameter set to obtain a target deduplication image set.

[0067] Among them, the specific working processes of the above-mentioned modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0068] It can be seen that in the embodiment of the present application, the image data set to be deduplicated is first deduplicated according to the preset image deduplication algorithm and based on the initial hyperparameter set to obtain a deduplicated image data set, and then the images in the deduplicated image data set are feature extracted to obtain a corresponding feature image set, and then the cosine similarity of any two feature images in the feature image set is calculated to obtain a preset number of cosine similarity values, and the mean of the sum of the cosine similarity values ​​is divided by the preset deduplication quantity balance factor to obtain a target metric score, and finally the initial hyperparameter set is optimized using the target metric score to obtain a target hyperparameter set, and the image data set to be deduplicated is deduplicated using the target hyperparameter set to obtain a target deduplication image set. It can be seen that the embodiment of the present application calculates the cosine similarity between images, and obtains the target metric score in combination with the deduplication quantity balance factor, and then obtains a high-performance hyperparameter set, which can overcome the contradiction between the similarity and quantity of deduplicated images, and avoid falling into the local optimal situation of the hyperparameter set, and is suitable for the automatic deduplication task of multiple types of scene images.

[0069] In some specific embodiments, the initial hyperparameter set belongs to a predefined bounded hyperparameter search space.

[0070] In some specific embodiments, the deduplication quantity balance factor is λ1n or λ2(n-1)?; wherein λ1 and λ2 are adjustable weight parameters, n is the total number of all images in the image data set to be deduplicated, and ? is an order addition operator.

[0071] In some specific embodiments, the function expression corresponding to the process of obtaining the target metric score is:

[0072]

[0073] In the formula, f T1 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

[0074] In some specific embodiments, the function expression corresponding to the process of obtaining the target metric score is:

[0075]

[0076] In the formula, f T2 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

[0077] In some specific embodiments, the feature extraction module 12 may specifically include:

[0078] A feature extraction unit is used to extract features from images in the deduplication image data set through a preset feature extractor to obtain a corresponding feature image set; wherein the network of the feature extractor adopts any one of MobileNet, VGG or ResNet.

[0079] In some specific embodiments, the hyperparameter set optimization module 14 may specifically include:

[0080] A first judgment unit, used to judge whether the target metric score reaches a preset threshold;

[0081] a first hyperparameter set optimization unit, configured to feed back the target metric score as prior information to the automatic machine learning baseline if the target metric score does not reach a preset threshold, so that the automatic machine learning baseline optimizes the initial hyperparameter set using the target metric score;

[0082] A first image deduplication unit is used to perform deduplication processing on the to-be-deduplicated image data set using the optimized hyperparameter set until the preset threshold is reached, and if the preset threshold is reached, the hyperparameter set corresponding to the target metric score is used as the target hyperparameter set;

[0083] Or, a second judgment unit, used to judge whether the current number of iterations reaches the maximum number of iterations;

[0084] a second hyperparameter set optimization unit, configured to feed back the target metric score to the automatic machine learning baseline if the target metric score does not reach a preset threshold, so that the automatic machine learning baseline optimizes the initial hyperparameter set using the target metric score;

[0085] The second image deduplication unit is used to perform deduplication processing on the image data set to be deduplicated using the optimized hyperparameter set until the maximum number of iterations is reached. If the maximum number of iterations is reached, the hyperparameter set corresponding to the target metric score is used as the target hyperparameter set.

[0086] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0087] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in 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. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the image deduplication method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0088] In this embodiment, the power supply 23 is used to provide working 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 the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

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

[0090] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and may be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the image deduplication method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks.

[0091] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed image deduplication method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0092] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0093] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0094] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0095] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0096] The above is a detailed introduction to an image deduplication method, device, equipment and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image deduplication method, characterized in that: include: Deduplication processing is performed on the image dataset to be deduplicated according to a preset image deduplication algorithm and based on an initial hyperparameter set to obtain a deduplication image dataset; Extracting features from the images in the deduplicated image dataset to obtain a corresponding feature image set; Calculate the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divide the mean of the sum of the cosine similarity values ​​by a preset deduplication quantity balance factor to obtain a target metric score; Optimizing the initial hyperparameter set using the target metric score to obtain a target hyperparameter set, and performing deduplication processing on the to-be-deduplicated image data set using the target hyperparameter set to obtain a target deduplication-free image set; The deduplication quantity balance factor is λ1n or λ2(n-1)~; wherein λ1 and λ2 are adjustable weight parameters, n is the total number of all images in the image data set to be deduplicated, and ~ is an order addition operator; The function expression corresponding to the process of obtaining the target metric score is: In the formula, f T1 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

2. The image deduplication method according to claim 1, characterized in that: The initial hyperparameter set belongs to a predefined bounded hyperparameter search space.

3. The image deduplication method according to claim 1, characterized in that: The function expression corresponding to the process of obtaining the target metric score is: In the formula, f T2 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

4. The image deduplication method according to claim 1, characterized in that: The step of extracting features from the images in the deduplicated image data set to obtain a corresponding feature image set includes: The images in the deduplication image data set are subjected to feature extraction by a preset feature extractor to obtain a corresponding feature image set; wherein the network of the feature extractor adopts any one of MobileNet, VGG or ResNet.

5. The image deduplication method according to any one of claims 1 to 4, characterized in that: The step of optimizing the initial hyperparameter set by using the target metric score to obtain a target hyperparameter set includes: Determine whether the target metric score reaches a preset threshold value. If not, feed back the target metric score as prior information to the automatic machine learning baseline so that the automatic machine learning baseline optimizes the initial hyperparameter set using the target metric score, and uses the optimized hyperparameter set to perform deduplication processing on the image data set to be deduplicated until the preset threshold value is reached. If the threshold value is reached, use the hyperparameter set corresponding to the target metric score as the target hyperparameter set; Or, determine whether the current number of iterations reaches the maximum number of iterations. If not, feed back the target metric score to the automatic machine learning baseline so that the automatic machine learning baseline uses the target metric score to optimize the initial hyperparameter set, and uses the optimized hyperparameter set to deduplicate the image data set until the maximum number of iterations is reached. If reached, use the hyperparameter set corresponding to the target metric score as the target hyperparameter set.

6. An image deduplication device, characterized in that: include: A first image deduplication module is used to perform deduplication processing on the image dataset to be deduplicated according to a preset image deduplication algorithm and based on an initial hyperparameter set to obtain a deduplication image dataset; A feature extraction module, used to extract features from the images in the deduplication image data set to obtain a corresponding feature image set; A similarity calculation module is used to calculate the cosine similarity of any two feature images in the feature image set to obtain a preset number of cosine similarity values, and divide the mean of the sum of the cosine similarity values ​​by a preset deduplication quantity balance factor to obtain a target metric score; A hyperparameter set optimization module, configured to optimize the initial hyperparameter set using the target metric score to obtain a target hyperparameter set; A second image deduplication module is used to perform deduplication processing on the to-be-deduplicated image data set using the target hyperparameter set to obtain a target deduplication image set; The deduplication quantity balance factor is λ1n or λ2(n-1)~; wherein λ1 and λ2 are adjustable weight parameters, n is the total number of all images in the image data set to be deduplicated, and ~ is an order addition operator; The function expression corresponding to the process of obtaining the target metric score is: In the formula, f T1 represents the target metric score, D θ represents the deduplicated image dataset obtained after deduplication using the initial hyperparameter set θ, Φ(x i ) and Φ(x j ) represents the feature map vector of any two images in the deduplication image set, Represents the sum of the cosine similarities between any two feature images in the feature image set.

7. An electronic device, characterized in that: The method comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the image deduplication method as claimed in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the image deduplication method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

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

    CN113688261A

  • Method and apparatus for training neural network model

    WO2021051987A1