Image deduplication method and device, electronic equipment and storage medium

After extracting image features and performing preliminary clustering, hierarchical adjustments are performed based on cluster quality evaluation indicators and dynamically optimized the cluster structure, solving the problem of robustness and efficiency in the existing image deduplication method, and achieving efficient and robust image deduplication, adapting to data distribution changes, and supporting the automated process of deep learning model training.

CN120431355AActive Publication Date: 2025-08-05HEFEI IFLYTEK TOYCLOUD TECH

Patent Information

Application Number
CN202510948357.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-08-05
Estimated Expiration
2045-07-10

AI Technical Summary

Technical Problem

The existing image deduplication methods have shortcomings in terms of robustness, efficiency and adaptability, and it is difficult to effectively solve the redundancy problem in massive image data, especially in deep learning model training, which is difficult to take into account both the deduplication efficiency and semantic consistency.

Method used

After extracting image features and performing preliminary clustering, hierarchical clustering adjustment is performed based on cluster quality evaluation indicators, and the cluster structure is dynamically optimized. Combining the in-cluster compactness, inter-cluster separation and cluster profile coefficient, the cluster structure is automatically adjusted to achieve high robustness and high efficiency deduplication.

Benefits of technology

It realizes high robust and efficient image deduplication, reduces manual intervention, adapts to data distribution changes, solves the balance of deduplication accuracy and efficiency in traditional methods, and supports the automated process of deep learning model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431355A_ABST
    Figure CN120431355A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and provides an image deduplication method and device, electronic equipment and a storage medium, and the method comprises the steps: extracting the image features of each image in a to-be-deduplicated image set; based on the image features of the images, clustering the image set to obtain a plurality of initial clusters; performing hierarchical clustering adjustment on each initial cluster based on a clustering quality evaluation index to obtain a de-weighting result corresponding to the image set; the clustering quality evaluation index is used for reflecting the cluster quality of each initial clustering cluster, the defects of low efficiency, high calculation complexity and poor robustness of a traditional deduplication mode are overcome, initial clustering is carried out firstly, then the cluster quality is evaluated, hierarchical clustering adjustment is automatically triggered, the buckle process of the cluster structure is dynamically optimized, and the clustering quality of the cluster structure is improved. According to the method, the problems of over-fitting and under-fitting are well solved, unbalance of a cluster structure is avoided, manual intervention is reduced, high-robustness and high-efficiency image de-duplication is realized, and the redundancy problem of massive image data can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image deduplication method, device, electronic device and storage medium. Background Art

[0002] With the widespread adoption of image acquisition devices, massive amounts of image data have accumulated on internet platforms, social media, enterprise databases, and various smart devices. This data contains a large number of duplicate or highly similar images, such as the same object captured from different angles or the same content uploaded multiple times. This duplicate data not only consumes significant storage resources during image annotation, model training, and data storage and management, but also increases data processing costs.

[0003] To address these issues, researchers have proposed image deduplication methods. Current methods fall into two main categories: hash comparison and feature matching. Hash comparison uses hash values to quickly match similar images, but its robustness is poor. When the image undergoes slight geometric deformations, such as rotation or cropping, the hash value may change significantly, causing semantically similar images to be misclassified as dissimilar, resulting in a high rate of missed detections. Feature matching relies on manual feature similarity calculations. This method is computationally complex and inefficient, making it difficult to meet real-time requirements. Furthermore, manual features cannot fully represent the deep semantic information of an image, and performance degrades significantly in cross-domain data (such as the same scene under different lighting conditions). Summary of the Invention

[0004] The present invention provides an image deduplication method, device, electronic device and storage medium to solve the problems of poor robustness, high computational complexity and low efficiency in existing image deduplication methods, achieve highly robust and efficient image deduplication, dynamically optimize cluster structure, and balance computational complexity and deduplication accuracy to solve the redundancy problem in massive image data.

[0005] The present invention provides an image deduplication method, comprising: Determining an image set to be deduplicated, and extracting image features of each image in the image set; Clustering the image set based on the image features of each image to obtain a plurality of initial clusters; Based on the clustering quality evaluation index, hierarchical clustering adjustment is performed on each initial cluster to obtain a deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial cluster.

[0006] According to an image deduplication method provided by the present invention, hierarchical clustering adjustment is performed on each initial cluster based on a clustering quality evaluation index to obtain a deduplication result corresponding to the image set, including: Determining an adjustment strategy based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient in the clustering quality evaluation indicators; Based on the adjustment strategy, hierarchical clustering adjustment is performed on each of the initial clusters to obtain a deduplication result corresponding to the image set.

[0007] According to an image deduplication method provided by the present invention, the adjustment strategy includes splitting and merging; the intra-cluster compactness is characterized by the cluster diameter, and the inter-cluster separation is characterized by the inter-cluster distance; the adjustment strategy is determined based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient in the clustering quality evaluation indicators, including: When the cluster silhouette coefficient of any initial cluster is less than the loose threshold and the cluster diameter of any initial cluster is greater than the diameter threshold, determining that the adjustment strategy for any initial cluster is split; When the inter-cluster distance between any initial clustering cluster and any adjacent initial clustering cluster is less than the compact threshold, and the difference between the cluster silhouette coefficient of any initial clustering cluster and the cluster silhouette coefficient of any adjacent initial clustering cluster is less than the difference threshold, it is determined that the adjustment strategy for any initial clustering cluster and any adjacent initial clustering cluster is merging.

[0008] According to an image deduplication method provided by the present invention, hierarchical clustering adjustment is performed on each of the initial clusters based on the adjustment strategy to obtain a deduplication result corresponding to the image set, including: Splitting each initial cluster whose adjustment strategy is splitting, and merging two adjacent initial clusters whose adjustment strategy is merging, to obtain multiple candidate clusters; Updating the multiple candidate clusters to the multiple initial clusters, and performing hierarchical clustering adjustment on the updated multiple initial clusters until an optimization termination condition is met; the optimization termination condition includes that the cluster silhouette coefficients of the multiple initial clusters are all greater than or equal to the loose threshold and less than or equal to the compact threshold; The multiple initial clustering clusters that meet the optimization termination condition are used as target clustering clusters, and a deduplication result corresponding to the image set is determined based on the multiple target clustering clusters.

[0009] According to an image deduplication method provided by the present invention, hierarchical clustering adjustment is performed on each initial cluster based on a clustering quality evaluation index to obtain a deduplication result corresponding to the image set, including: Based on the clustering quality evaluation index, hierarchical clustering adjustment is performed on the initial clusters to obtain multiple target clusters; Determining target images in each target cluster based on the distance between each image in each target cluster and the cluster center; Based on the target images in each target cluster and the cluster labels of the target images, a deduplication result corresponding to the image set is determined.

[0010] According to an image deduplication method provided by the present invention, extracting image features of each image in the image set includes: Inputting each image in the image set into a feature extraction model, performing feature extraction on each image by the feature extraction model, and obtaining image features of each image output by the feature extraction model; The feature extraction model is trained based on the feature similarity between sample image features in positive samples and the similarity between sample image features in negative samples; the positive samples include different sample enhanced images of the same sample image, and the negative samples include sample enhanced images of different sample images.

[0011] According to an image deduplication method provided by the present invention, clustering the image set based on the image features of each image to obtain multiple initial clusters includes: Determine the initial cluster value range; Determining a candidate cluster value range from the initial cluster value range based on an elbow algorithm; Determining the optimal initial cluster value from the candidate cluster value range based on the silhouette coefficient method; Based on the image features of each image, the image set is clustered according to the optimal initial cluster value to obtain a plurality of initial clusters.

[0012] The present invention also provides an image deduplication device, comprising: an extraction unit, configured to determine an image set to be deduplicated and extract image features of each image in the image set; A clustering unit, configured to cluster the image set based on image features of each image to obtain a plurality of initial clusters; The deduplication unit is used to perform hierarchical clustering adjustment on each initial cluster based on a clustering quality evaluation index to obtain a deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial cluster.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements any of the above-described image deduplication methods when executing the computer program.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements any of the above-mentioned image deduplication methods when executed by a processor.

[0015] The image deduplication method, device, electronic device and storage medium provided by the present invention extract the image features of each image in the image set to be deduplicated; based on the image features of each image, the image set is clustered to obtain multiple initial clustering clusters; based on the clustering quality evaluation index, each initial clustering cluster is hierarchically clustered and adjusted to obtain the deduplication results corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial clustering cluster, which overcomes the defects of low efficiency, high computational complexity and poor robustness of traditional deduplication methods, and through first performing preliminary clustering, then evaluating the cluster quality, and automatically triggering hierarchical clustering adjustment to dynamically optimize the cluster structure, the loop process solves the overfitting and underfitting problems well, avoids the imbalance of the cluster structure, reduces manual intervention, and achieves highly robust and efficient image deduplication, which can effectively solve the redundancy problem of massive image data. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 1 is a flow chart of the image deduplication method provided by the present invention; Figure 2 It is a node flow chart of the hierarchical clustering adjustment process provided by the present invention; Figure 3 It is a structural schematic diagram of the image deduplication device provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0018] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0019] With the widespread adoption of image acquisition devices, massive amounts of image data have accumulated on internet platforms, social media, enterprise databases, and various smart terminals. This data contains a large number of duplicate or highly similar images, such as the same object photographed from different angles, the same content uploaded multiple times, and copies of slightly edited or compressed images. This type of duplicate data not only consumes a large amount of storage resources during image annotation, model training, and data storage management, but also significantly increases data processing costs. For example, in deep learning model training, duplicate images can lead to a bias in the distribution of training samples, reducing the model's generalization ability. In data storage systems, redundant data directly leads to wasted storage space and increased operational costs. However, traditional manual screening methods for image deduplication are inefficient and cannot effectively address the redundancy problem in massive image data.

[0020] Based on this, automated image deduplication methods have emerged. Currently, there are mainly the following types of automated image deduplication technologies: First, hash matching: This method, represented by methods such as the Perceptual Hash Algorithm (PHA) and the Average Hash Algorithm (AHA), achieves rapid similarity matching by converting images into fixed-length hash values. This method has low computational complexity and is suitable for preliminary screening of large-scale data. However, its core flaw lies in its lack of robustness to image transformations: when an image is rotated, cropped, brightness adjusted, or slightly geometrically deformed, the hash value may change significantly, causing images with semantic similarity but pixel-level differences to be misclassified as dissimilar, resulting in a high rate of missed detections.

[0021] Second, feature matching methods extract handcrafted features such as SIFT (Scale-invariant feature transform) and SURF (Speeded Up Robust Features), and calculate image similarity by matching feature points. This method relies on high-dimensional feature extraction and complex distance calculations, resulting in high computational complexity and low efficiency, making it difficult to meet real-time requirements. Furthermore, handcrafted features cannot fully represent the deep semantic information of an image, and performance degrades significantly with cross-domain data (such as the same scene under different lighting conditions).

[0022] Third, fixed clustering method: This method uses traditional clustering algorithms such as K-means to divide the cluster structure with a fixed K value, and achieves deduplication by reducing the similarity within the cluster. However, this method has two major drawbacks: on the one hand, manual intervention is required to set the number of clusters K in advance, and it lacks the ability to dynamically adapt to data distribution; on the other hand, the fixed K value cannot cope with the growth of data scale or changes in category distribution, which can easily lead to an imbalance in the cluster structure. For example, similar images may be over-merged or the same category may be over-split, making it difficult to balance deduplication accuracy and recall rate.

[0023] Therefore, there is an urgent need for a highly robust, efficient and adaptive image deduplication technology that can dynamically optimize the cluster structure without human intervention, while balancing computational complexity and deduplication accuracy to solve the redundancy problem in massive image data.

[0024] To this end, the present invention provides an image deduplication method, which aims to overcome the defects of existing solutions and achieve highly robust and efficient image deduplication. At the same time, it dynamically optimizes the cluster structure through an adaptive clustering mechanism, reduces manual intervention, and achieves a balance between deduplication accuracy and deduplication efficiency. Figure 1 It is a flowchart of the image deduplication method provided by the present invention, such as Figure 1 As shown, the method includes: Step 110, determining an image set to be deduplicated, and extracting image features of each image in the image set; Step 120 , clustering the image set based on the image features of each image to obtain a plurality of initial clusters; Step 130 : Based on the clustering quality evaluation index, hierarchical clustering adjustment is performed on each initial cluster to obtain a deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial cluster.

[0025] Specifically, considering the shortcomings of current image deduplication methods in terms of efficiency, robustness, and adaptability, namely, hash comparison methods sacrifice robustness for speed, feature matching methods trade computational overhead for accuracy, and fixed clustering methods are unable to adapt to dynamic data environments due to static parameter limitations. Especially in deep learning model training scenarios, during the pre-processing image annotation and deep learning training set cleaning, current image deduplication methods struggle to balance deduplication efficiency and semantic consistency. This results in a significant amount of manual verification required during the data preprocessing stage, severely restricting the implementation of automated processes.

[0026] In view of this, in an embodiment of the present invention, it is proposed to perform preliminary clustering first, and then evaluate the quality of the cluster structure according to the data distribution. Based on this, hierarchical clustering adjustment is automatically triggered to dynamically optimize the cluster structure, while solving the problems of overfitting and underfitting, avoiding imbalance in the cluster structure, and making the clustering results adapt to the data distribution, breaking through the limitation of traditional clustering algorithms that require a fixed number of clusters, and achieving a balance between deduplication accuracy and efficiency.

[0027] In detail, in the actual application process, before image deduplication is performed, it is necessary to first determine the image set that needs to be deduplicated, that is, the image set to be deduplicated. Here, the image set to be deduplicated can be one or more, which can be a set composed of images under the same device / the same platform / the same enterprise database / the same social media account, or a set of images obtained by combining images under different devices / different platforms / different enterprise databases / different social media accounts. The embodiment of the present invention does not make specific limitations on this. The images therein can be images under a single field or category, or images under multiple fields and multiple categories. The embodiment of the present invention does not make specific limitations on this.

[0028] After determining the image set to be deduplicated, in embodiments of the present invention, feature extraction can be performed on this image set to extract the image features of each image therein, pending subsequent clustering to achieve deduplication processing. Specifically, feature extraction can be performed on each image in the image set to extract information that can represent image characteristics, such as uniqueness (distinguishing different images), semantic similarity (identifying repeated content), and visual invariance (anti-interference), thereby obtaining image features for each image.

[0029] Here, feature extraction based on image characteristics can improve the robustness and discriminability of the extracted image features. Improved robustness helps strengthen anti-interference capabilities and ensures the stability of image features to image transformations (such as rotation, scaling, and cropping). Improved discriminability helps improve recognition, enabling image features to distinguish between images with similar semantics but different pixel levels (such as the same object photographed from different angles), thereby avoiding missed detections.

[0030] The above feature extraction process can be implemented based on deep learning feature extraction, that is, the global features of the image are extracted through a pre-trained feature extraction model, such as ResNet (Residual Network) 50; then, the last classification layer of the model is removed, and the output of the second-to-last layer is taken as the feature vector; the feature vector is then normalized to obtain the image features of each image. The image features obtained in this way have strong semantic distinctiveness and are suitable for cross-domain images. When subsequent clustering processing is performed based on this image feature, the computational complexity is low and the efficiency is high.

[0031] The feature extraction process can also be implemented through local and global feature extraction methods, that is, first use SIFT or ORB (Oriented FAST and Rotated BRIEF) to extract local key points and descriptors, and then aggregate local features into a global vector through BoVW (Bag of Visual Words) or VLAD (Vector of Locally Aggregated Descriptors); then, perform PCA (Principal Components Analysis) on the global vector to reduce the dimension and obtain image features. The image features obtained in this way have strong robustness and interpretability, are insensitive to geometric transformations, and local features are visualized.

[0032] The feature extraction process can also be implemented through feature extraction based on self-supervised learning. That is, a self-supervised model, such as SimCLR (Simple Framework for Contrastive Learning of Visual Representations), is first pre-trained on large-scale unlabeled data. The trained model is then used to extract features from each image in the image collection to extract intermediate-layer features as image representations. The image features obtained in this way have strong adaptability and generalization capabilities.

[0033] The feature extraction process can also be implemented in other ways, such as hybrid feature fusion, to combine deep learning features with manual features (such as color histogram, LBP texture) to achieve a balance between semantics and low-level information and improve deduplication accuracy; for example, high-level semantic feature extraction based on residual network, which is not specifically limited in the embodiments of the present invention.

[0034] After that, after obtaining the image features of each image in the image set, the embodiment of the present invention can cluster the image set according to the image features, so as to divide the images in the image set into multiple clusters through preliminary clustering, thereby obtaining multiple initial cluster clusters. The clustering algorithm adopted in the preliminary clustering process here can be a traditional K-means clustering algorithm, wherein the K value in the preliminary clustering process can be predetermined based on the elbow algorithm, the silhouette coefficient method, etc., that is, the optimal preliminary clustering K value is determined, and preliminary clustering based on this can improve the clustering quality, balance the intra-class compactness and inter-class separation, while reducing subjectivity, optimizing computational efficiency, avoiding unnecessary clustering calculations, and reducing computational overhead. Moreover, the determination of the optimal K value can significantly improve the performance and reliability of the clustering algorithm in the image deduplication task, thereby helping to optimize the deduplication accuracy and deduplication efficiency of subsequent image deduplication tasks.

[0035] Furthermore, considering that a clustering based on the optimal K value in the preliminary clustering may not ensure the cluster structure, there may be overfitting and underfitting problems, resulting in an imbalance in the cluster structure, in an embodiment of the present invention, it is proposed that the cluster clusters obtained by the preliminary clustering can be quality evaluated to determine the cluster quality of each initial cluster cluster, and based on this, the results of the preliminary clustering, that is, each initial cluster cluster, are optimized and adjusted to obtain the final deduplication result.

[0036] Specifically, here we can first determine the clustering quality evaluation index of the preliminary clustering, which can reflect the cluster quality of each initial cluster cluster; the clustering quality evaluation index here can include the intra-cluster compactness, inter-cluster separation, cluster silhouette coefficient, Davidson-Botting index (used to measure the ratio of intra-cluster distance to inter-cluster distance, the smaller the value, the better the clustering effect), Calinski-Harabasz index (used to measure the ratio of inter-cluster dispersion to intra-cluster dispersion, the larger the value, the better the clustering effect), Dunn index (used to measure the ratio of the minimum inter-cluster distance to the maximum intra-cluster diameter, the larger the value, the better the clustering effect), etc. of each initial cluster cluster; then, based on this clustering quality evaluation index, hierarchical clustering adjustment can be performed on each initial cluster cluster, and the cluster structure can be adjusted by simulating the splitting and merging process of hierarchical clustering, such as splitting clusters with low intra-cluster compactness or merging clusters with small inter-cluster separation, so as to obtain the optimized and adjusted clustering result, and the final deduplication result can be determined based on this clustering result. The deduplication result here may include the deduplicated image set and the clustering label of each image in the image set. The clustering label may be the cluster number, the number of splits or merges, etc. of the corresponding image.

[0037] It is worth noting that the hierarchical clustering adjustment process in the embodiment of the present invention can be executed once, that is, in one step, to improve the deduplication efficiency while saving computing overhead, or it can be repeatedly executed multiple times, that is, after the first step of adjustment, the cluster cluster obtained by adjustment is used as the initial cluster cluster, and the hierarchical clustering adjustment process is executed again to further optimize the cluster structure in a way of simulating hierarchical clustering to ensure deduplication accuracy. The number of executions can also be automatically matched according to the specific situation, that is, the optimization termination condition is set, and the optimization is automatically stopped when the condition is met to balance efficiency and deduplication accuracy. The embodiment of the present invention does not make specific limitations on this.

[0038] In an embodiment of the present invention, based on preliminary clustering, the cluster structure quality is quantitatively evaluated, and a cluster structure optimization mechanism is automatically triggered. The underfitting and overfitting problems that may exist in the preliminary clustering are solved through hierarchical clustering adjustment, so that the final clustering result adapts to the data distribution. This breaks through the dilemma of the traditional K-means clustering algorithm with a fixed number of clusters, which cannot cope with the growth of data scale or changes in category distribution and easily leads to an imbalance in the cluster structure, and achieves a balance between deduplication efficiency and accuracy.

[0039] The image deduplication method provided by the present invention extracts the image features of each image in the image set to be deduplicated; based on the image features of each image, the image set is clustered to obtain multiple initial clustering clusters; based on the clustering quality evaluation index, each initial clustering cluster is hierarchically clustered and adjusted to obtain the deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial clustering cluster, which overcomes the defects of low efficiency, high computational complexity and poor robustness of the traditional deduplication method, and through first performing preliminary clustering, then evaluating the cluster quality, and automatically triggering the hierarchical clustering adjustment to dynamically optimize the cluster structure, the overfitting and underfitting problems are well solved, the imbalance of the cluster structure is avoided, manual intervention is reduced, and highly robust and efficient image deduplication is achieved, which can effectively solve the redundancy problem of massive image data.

[0040] In addition, it should be noted that in the embodiments of the present invention, there is no need to sacrifice robustness for speed, nor is there any need to trade computational overhead for accuracy, and efficient and robust image deduplication can be achieved. In deep learning model training scenarios, such as in the pre-image annotation process and the deep learning training set cleaning process, it can better balance deduplication efficiency and semantic consistency, thereby facilitating the implementation of the automated process of deep learning model training.

[0041] Based on the above embodiment, step 130 includes: Determine the adjustment strategy based on the clustering quality evaluation indicators of intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient; Based on the adjustment strategy, hierarchical clustering adjustment is performed on each initial cluster to obtain the deduplication result corresponding to the image set.

[0042] Specifically, the process of performing hierarchical clustering adjustment on each initial cluster according to the clustering quality evaluation index to obtain the deduplication result corresponding to the image set may include the following steps: First, a clustering quality evaluation index for evaluating the cluster quality of the initial clustering cluster can be determined. Preferably, in the embodiment of the present invention, intra-cluster compactness, inter-cluster separation and cluster silhouette coefficient are used as evaluation indicators to evaluate the cluster quality of the corresponding initial clustering cluster, thereby facilitating the subsequent adjustment of its cluster structure.

[0043] Here, intra-cluster compactness can be represented by the cluster diameter of the corresponding initial cluster. The cluster diameter is the maximum distance between all data points (images) within the cluster and is used to measure the dispersion of the data points within the cluster. The smaller the cluster diameter, the more compact the data points within the cluster; conversely, the larger the cluster diameter, the more sparse the data points within the cluster. Intra-cluster compactness can also be represented by the cluster average distance, that is, the average distance between the data points within the cluster and the cluster center; it can also be represented by the intra-cluster variance, that is, the mean of the squared distances between the data points within the cluster and the cluster center; or it can be represented by other indicators, which are not specifically limited in this embodiment of the present invention.

[0044] Inter-cluster separation can be represented by the inter-cluster distance, which is the distance between the cluster centers of two adjacent clusters and is used to measure the degree of separation between clusters. The larger the inter-cluster distance, the more obvious the differences between clusters and the higher the separation. Inter-cluster separation can also be represented by the average inter-cluster distance (Average Inter-Cluster Distance), which is the average distance between all data points in one initial cluster and other initial clusters. It can also be represented by the Dunn index, which is not specifically limited in this embodiment of the present invention.

[0045] The Cluster Silhouette Coefficient (CSC) is a comprehensive indicator that combines intra-cluster cohesion and inter-cluster separation. It is used to evaluate the rationality of a single data point or the entire clustering result. The closer the CSC is to 1, the better the clustering effect.

[0046] Next, we can determine the adjustment strategy for the initial clusters based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient. That is, based on these indicators, we can assess whether the cluster structure of the initial clusters needs to be adjusted and how to adjust it.

[0047] For example, when it is determined based on the intra-cluster compactness that the data points in a certain initial cluster are dispersed, and / or it is determined based on the cluster silhouette coefficient that the data point distribution of the initial cluster is not reasonable, then it can be determined that the cluster structure of the initial cluster needs to be adjusted, that is, the initial cluster can be split to split the initial cluster into two sub-clusters.

[0048] For another example, when it is determined based on the inter-cluster separation that the distance between the cluster center of a certain initial cluster and its adjacent initial cluster is small, the degree of separation of the adjacent clusters is low, and / or, based on the cluster silhouette coefficients of the two adjacent initial clusters, it is determined that the data point distribution of the two adjacent initial clusters is not reasonable, then it can be determined that the cluster structure of the two adjacent initial clusters needs to be adjusted, that is, the two adjacent initial clusters can be merged to merge them into one cluster.

[0049] Afterwards, hierarchical clustering adjustments can be performed on each initial cluster according to the adjustment strategy. By simulating the splitting and merging process of hierarchical clustering, the cluster structure is adjusted to obtain an optimized and adjusted clustering result. The final deduplication result can be determined based on this clustering result. The deduplication result here can include the deduplicated image set and the cluster label of each image in the image set. The cluster label can be the cluster number of the corresponding image, the number of splits or merges, etc.

[0050] Based on the above embodiment, the compactness within a cluster is characterized by the cluster diameter, and the separation between clusters is characterized by the inter-cluster distance; the adjustment strategy includes splitting and merging; Based on the clustering quality evaluation indicators of intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient, the adjustment strategy is determined, including: When the cluster silhouette coefficient of any initial cluster is less than the loose threshold, and the cluster diameter of any initial cluster is greater than the diameter threshold, the adjustment strategy for any initial cluster is determined to be splitting; When the inter-cluster distance between any initial cluster and any other adjacent initial cluster is less than the compact threshold, and the difference between the cluster silhouette coefficient of any initial cluster and the cluster silhouette coefficient of any adjacent initial cluster is less than the difference threshold, the adjustment strategy for any initial cluster and any adjacent initial cluster is determined to be merging.

[0051] Specifically, the process of determining the adjustment strategy based on the clustering quality evaluation indicators of intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient can include the following two situations: First, when the cluster silhouette coefficient of any initial cluster is less than the loose threshold, and the intra-cluster compactness of the initial cluster, that is, the cluster diameter is greater than the diameter threshold, that is, the data points in the initial cluster are scattered and not reasonable, then it can be determined that the cluster structure of the initial cluster needs to be adjusted, and the adjustment strategy is splitting.

[0052] Secondly, when any initial clustering cluster and any initial clustering cluster adjacent to the initial clustering cluster, that is, the inter-cluster distance of any adjacent initial clustering clusters is less than the compact threshold, and the difference in cluster silhouette coefficients of the two initial clustering clusters is less than the difference threshold, that is, the distance between the cluster centers of the two initial clustering clusters is too close, the degree of separation of the two clusters is low, and the distribution of data points within the clusters is not reasonable enough, at this time, it can be determined that the cluster structure of the two adjacent initial clustering clusters needs to be adjusted, and the adjustment strategy is merging.

[0053] Among them, the loose threshold, diameter threshold, compact threshold and difference threshold can all be set according to actual conditions and actual needs. For example, the loose threshold can be 0.2, the compact threshold can be 0.7, and the diameter threshold can be determined based on the global average distance (the average of the cluster average distances of all clusters), such as twice the global average distance.

[0054] The following uses specific values as an example to illustrate the process of determining the adjustment strategy: For the initial cluster , calculate its cluster silhouette coefficient and inter-cluster distance , ,in for The average distance between each data point and other data points in for The average distance between each data point in and all data points in the nearest other initial clusters. ,in for The cluster center, for Adjacent initial clusters The cluster center.

[0055] like , and the cluster diameter , is the diameter threshold, then determine The adjustment strategy is to split into two sub-clusters. For example, (cluster "animals") splits into cluster "cats" and cluster "dogs".

[0056] like ,and , Is the difference threshold, then determine and The adjustment strategy is to merge the two clusters. ("Husky" cluster) and (the "Alaska" cluster) merged.

[0057] Based on the above embodiment, hierarchical clustering adjustment is performed on each initial cluster based on the adjustment strategy to obtain a deduplication result corresponding to the image set, including: Splitting each initial cluster whose adjustment strategy is splitting, and merging two adjacent initial clusters whose adjustment strategy is merging, to obtain multiple candidate clusters; Updating multiple candidate clusters into multiple initial clusters, and performing hierarchical clustering adjustment on the updated multiple initial clusters until the optimization termination condition is met; the optimization termination condition includes that the cluster silhouette coefficients of the multiple initial clusters are greater than or equal to the loose threshold and less than or equal to the compact threshold; A plurality of initial clustering clusters that meet the optimization termination condition are used as target clustering clusters, and a deduplication result corresponding to the image set is determined based on the plurality of target clustering clusters.

[0058] Specifically, after determining the adjustment strategy corresponding to each initial cluster, hierarchical clustering adjustment can be performed on each initial cluster according to the adjustment strategy to obtain a deduplication result. This process can specifically include: First, the cluster structure of the corresponding initial cluster can be adjusted according to the adjustment strategy, that is, the initial cluster whose adjustment strategy is splitting is split, and the two adjacent initial clusters whose adjustment strategy is merging are merged, so that multiple clusters after preliminary optimization, that is, multiple candidate clusters, can be obtained.

[0059] Then, these multiple candidate clusters can be used as multiple initial clusters, and hierarchical clustering adjustments can be performed again to further optimize the cluster structure of the multiple clusters after preliminary optimization. The specific optimization process is to determine the adjustment strategy of each updated initial cluster, and perform hierarchical clustering adjustments according to the adjustment strategy. The determination of the adjustment strategy here is the same as the determination of the adjustment strategy of the initial cluster before the update. It has been explained in detail above and will not be repeated here. Repeat the above cluster structure optimization process until the optimization termination condition is met and stop the optimization adjustment. The optimization termination condition here includes that the cluster silhouette coefficients of multiple initial clusters are greater than or equal to the loose threshold and less than or equal to the compact threshold; that is, the cluster silhouette coefficients of all initial clusters meet .

[0060] Then, the final deduplication result can be determined based on the multiple initial clustering clusters that meet the optimization termination conditions. Here, specifically, the multiple initial clustering clusters that meet the optimization termination conditions can be used as target clustering clusters, and the target clustering clusters are the final clustering results. Each target clustering cluster is a set of repeated images, which contains at least one image. Therefore, the most representative image can be selected from them as the image representative of this repeated image set, that is, the target image. At the same time, the other images in this cluster are marked as repeated images. Based on the target image of each target clustering cluster, the deduplication image set can be determined.

[0061] Furthermore, the final deduplication result can be determined based on the deduplicated image set and the cluster label of each target image therein. The cluster label here is the cluster number of the cluster to which the target image belongs.

[0062] Based on the above embodiment, step 130 includes: Based on the clustering quality evaluation index, hierarchical clustering adjustment is performed on each initial cluster to obtain multiple target clusters; Determine the target image in each target cluster based on the distance between each image in each target cluster and the cluster center; Based on the target images in each target cluster and the cluster labels of the target images, the deduplication results corresponding to the image set are determined.

[0063] Specifically, the process of performing hierarchical clustering adjustment on each initial cluster based on the clustering quality evaluation index to obtain the deduplication result corresponding to the image set specifically includes: After hierarchical clustering adjustment, multiple adjusted cluster clusters can be obtained, which are referred to as target cluster clusters here; the hierarchical clustering adjustment process for each initial cluster cluster has been introduced in detail above and will not be repeated here. Then, a most representative image can be selected from each target cluster cluster as the target image; here, specifically, since the target cluster cluster is the final clustering result, each target cluster cluster is a set of repeated images, which contains at least one image. Therefore, in each target cluster cluster, the distance between each image and the cluster center (cluster center) can be used to determine its distance from the cluster center. The closer to the cluster center, the stronger the representativeness. Therefore, the image closest to the cluster center can be selected as the target image, and the other images are marked as repeated images.

[0064] After this, the deduplication set of images can be determined based on the target images in each target cluster. Furthermore, the final deduplication result can be determined based on the deduplication set of images and the cluster label of each target image in the set. The cluster label here is the cluster number of the cluster to which the target image belongs.

[0065] Figure 2 This is a node flow chart of the hierarchical clustering adjustment process provided by the present invention, such as Figure 2 As shown in the figure, after a plurality of initial clusters are obtained through preliminary clustering, the cluster quality of each initial cluster can be evaluated before the hierarchical clustering adjustment is performed. Specifically, the cluster quality can be reflected based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient of each initial cluster, i.e., the cluster quality evaluation index. The adjustment strategy can be determined based on this cluster quality evaluation index. The adjustment strategy includes splitting and merging. The intra-cluster compactness is characterized by the cluster diameter, and the inter-cluster separation is characterized by the inter-cluster distance. That is, if the cluster silhouette coefficient of any initial cluster is less than the loose threshold, and the cluster diameter of any initial cluster is greater than the diameter threshold , then the adjustment strategy for any initial clustering cluster is determined to be split, which can also be understood as the initial clustering cluster meets the splitting condition at this time and can be split; correspondingly, if the inter-cluster distance between any initial clustering cluster and any other adjacent initial clustering cluster is less than the compact threshold, and the difference between the cluster silhouette coefficient of any initial clustering cluster and the cluster silhouette coefficient of any adjacent initial clustering cluster is less than the difference threshold, then the adjustment strategy for any initial clustering cluster and any adjacent initial clustering cluster is determined to be merge, which can also be understood as the initial clustering cluster and any adjacent initial clustering cluster meet the merge condition at this time and can be merged.

[0066] After splitting and merging, multiple candidate clusters are obtained. Further optimization and adjustment of the cluster structure of these clusters is required. Specifically, the multiple candidate clusters are updated to multiple initial clusters, and the updated initial clusters are hierarchically clustered until the optimization termination condition is met. The optimization termination condition includes that the cluster silhouette coefficients of the multiple initial clusters are all greater than or equal to the loose threshold and less than or equal to the compact threshold. Finally, the multiple initial clusters that meet the optimization termination condition can be used as target clusters. Based on the distance between each image in each target cluster and the cluster center, the image closest to the cluster center is selected from each target cluster as the target image. Based on the target images of each target cluster, the deduplicated image set can be determined. Furthermore, the final deduplication result can be determined based on the deduplicated image set and the cluster label of each target image in the image set. The cluster label here is the cluster number of the cluster to which the target image belongs.

[0067] Based on the above embodiment, in step 110, extracting image features of each image in the image set includes: Input each image in the image set into the feature extraction model, and the feature extraction model extracts features from each image to obtain image features output by the feature extraction model; The feature extraction model is trained based on the feature similarity between sample image features in positive samples and the similarity between sample image features in negative samples; the positive samples include different sample enhanced images of the same sample image, and the negative samples include sample enhanced images of different sample images.

[0068] Specifically, in step 110, the feature extraction process for the image set can be implemented by a feature extraction model. Specifically, each image in the image set can be input into the feature extraction model to perform feature extraction on the input image through the feature extraction model, extract information in each image that can represent image characteristics, such as uniqueness (distinguishing different images), semantic similarity (identifying repeated content), and visual invariance (anti-interference), and encode it into features to obtain low-dimensional (2048 dimensions) image features with high semantic discriminability output by the feature extraction model.

[0069] It is worth noting that before extracting features through the feature extraction model, in order to ensure the accuracy of feature extraction, the feature extraction model can be pre-trained. Different from traditional supervised learning and unsupervised learning, the embodiment of the present invention takes into account that the features in the image deduplication task require strong anti-interference and resolution capabilities, that is, they can resist image transformations and recognize images with similar semantics but different pixel levels. Therefore, the similarity of the semantic information represented by different sample images is used to train the model to obtain a trained feature extraction model.

[0070] Specifically, when training the model, a large number of sample images must first be collected. These sample images can then be enhanced to apply different enhancement methods to the same sample image, such as rotation, cropping, scaling, and color jittering, thereby obtaining multiple sample-enhanced images. Subsequently, positive and negative samples can be constructed from each sample-enhanced image. Positive samples are sample-enhanced images with the same corresponding sample image, while negative samples are sample-enhanced images with different corresponding sample images. Based on this principle, the positive and negative samples required for training can be constructed based on the enhanced sample images obtained. Subsequently, the initial model can be used to determine the sample image features of the sample-enhanced images in both the positive and negative samples.

[0071] The sample image features are obtained by extracting features from the corresponding sample enhanced images by the initial model; the initial model here can be constructed based on a deep convolutional neural network model, such as ResNet50.

[0072] Furthermore, after determining the sample image features of the sample-enhanced images in the positive samples and the sample image features of the sample-enhanced images in the negative samples, in embodiments of the present invention, a contrast loss is determined based on the feature similarity between the sample image features in the positive samples and the similarity between the sample image features in the negative samples. The initial model is trained based on this contrast loss to obtain a trained model, i.e., a feature extraction model. The contrast loss here can be measured using InfoNCE (Information Noise-Contrastive Estimation).

[0073] Compared with the traditional solution of extracting image features from different sample images and performing repeated image detection based on this, and using the error between the predicted value and the labeled value to drive the model for parameter update, the embodiment of the present invention selects the semantic similarity represented by different sample images for model training, and trains the initial model through the feature similarity between the sample image features in the positive samples and the similarity between the sample image features in the negative samples. This enables the initial model to fully learn the distance relationship between the sample image features corresponding to different sample enhanced images, thereby providing key assistance for subsequent clustering and deduplication processing.

[0074] Specifically, since the training goal of the initial model is to make the feature similarity between the sample image features of different sample enhanced images as high as possible when different sample enhanced images constitute positive samples, that is, when the sample images corresponding to different sample enhanced images are the same; correspondingly, to make the feature similarity between the sample image features of different sample enhanced images as low as possible when different sample enhanced images constitute negative samples, that is, when the sample images corresponding to different sample enhanced images are different. Therefore, when the feature similarity between the sample image features of each sample enhanced image in the positive sample is high, and when the feature similarity between the sample image features of each sample enhanced image in the negative sample is low, it can be determined that the contrast loss is small; correspondingly, when the feature similarity between the sample image features of each sample enhanced image in the positive sample is low, and / or when the feature similarity between the sample image features of each sample enhanced image in the negative sample is high, it can be determined that the contrast loss is large.

[0075] In the embodiment of the present invention, the semantic similarity of the same image on different enhanced images is used to train the model, which not only improves the generalization ability of the model, but also improves the clustering accuracy and the credibility of the deduplication results.

[0076] Based on the above embodiment, step 120 includes: Determine the initial cluster value range; Based on the elbow algorithm, the candidate cluster value range is determined from the initial cluster value range; Based on the silhouette coefficient method, the optimal initial cluster value is determined from the candidate cluster value range; Based on the image features of each image, the image set is clustered according to the optimal initial cluster value to obtain multiple initial clusters.

[0077] Specifically, the process of clustering the image set according to the image features of each image to obtain multiple initial clusters may include: First, determine the initial The value search range, that is, the initial cluster value range, can be [2, 100] or [2, 50], and can be set according to the number of images in the image set to be deduplicated, deduplication accuracy, etc.

[0078] Then, for each value, perform K-means clustering, and calculate each Clustering error of values , that is, the sum of squared errors within the cluster, which represents the sum of the squares of the Euclidean distances of all data points in the cluster to the center of the cluster.

[0079] Here, the clustering error is calculated as: Where, is the clustering error, For the clusters, is the number of clusters, for The data points / images in for The cluster center, for arrive The Euclidean distance of .

[0080] Afterwards, you can The value is the horizontal axis, and the corresponding clustering error is the vertical axis. curve, find the "elbow point", i.e. The point where the rate of decline slows down significantly, based on this point, the The range of values ​​in order to determine the optimal cluster value range from the initial cluster value range That is, the initial cluster value range can be narrowed according to the “elbow point” to obtain a smaller candidate cluster value range.

[0081] Here, the range is narrowed based on the elbow algorithm, which can quickly and accurately screen out candidates. value, avoid subjective assumptions, and reduce trial and error costs.

[0082] Furthermore, based on the candidate cluster value range, the silhouette coefficient method can be used for further screening to select the best cluster. Here, specifically, for each candidate cluster value within the range The values are clustered and the average silhouette coefficient of each cluster is calculated. The average silhouette coefficient of all data points in the cluster can be averaged. Furthermore, the average silhouette coefficient of all clusters can be averaged again to obtain the average silhouette coefficient of each cluster. The overall silhouette score of the value. The higher the overall silhouette score (the closer to 1), the better the clustering effect (tight clusters within the cluster and scattered clusters between clusters). Measuring clustering effect by the overall silhouette score can avoid subjective judgment, reduce human bias, and adapt to complex data. In other words, it can still provide an effective evaluation of non-convex distribution or noisy data.

[0083] After this, the candidate cluster values can be directly compared to each other. The overall silhouette score of the value is selected, and the largest overall silhouette score is selected value, as the optimal value, that is, the optimal initial clustering cluster value; thereafter, the image set can be clustered according to the image features of each image to divide the images in the image set into the optimal initial clustering cluster value clusters, thereby obtaining multiple initial clustering clusters.

[0084] In the embodiment of the present invention, the elbow algorithm is combined with the silhouette coefficient method to determine the optimal initial cluster value, and preliminary clustering is performed based on this, which can significantly improve the reliability and efficiency of the clustering results of the preliminary clustering. Specifically, the elbow algorithm analyzes the clustering error with the The downward trend of the value change can quickly locate the candidate cluster value range, which is especially suitable for preliminary exploration of data distribution and capturing possible "elbow points", thus providing reasonable The value interval; on this basis, the silhouette coefficient rule quantifies the intra-cluster compactness and inter-cluster separation of each data point, and The value is carefully evaluated to ensure the optimal The value can both maximize intra-cluster similarity and minimize inter-cluster overlap, ultimately compensating for the objectivity and accuracy of the elbow algorithm's misjudgments due to ambiguous "elbow points" or data noise. This combined strategy not only avoids the limitations of a single method (such as the subjectivity of the elbow rule or the high computational overhead of the silhouette coefficient method), but also optimizes the allocation of computing resources through a "coarse screening followed by fine tuning" process. Especially for large-scale image data, combining it with sampling or approximate algorithms such as Mini-Batch K-Means can further reduce computational costs, ultimately achieving a dual improvement in clustering quality and efficiency. It can also help optimize the accuracy and efficiency of image deduplication tasks.

[0085] The image deduplication device provided by the present invention is described below. The image deduplication device described below and the image deduplication method described above can be referenced to each other.

[0086] Figure 3 Schematic diagram of the structure of the image deduplication device provided by the present invention. Figure 3 As shown, the device includes: An extraction unit 310 is configured to determine a set of images to be deduplicated and extract image features of each image in the set of images; A clustering unit 320 is configured to cluster the image set based on image features of each image to obtain a plurality of initial clusters; The deduplication unit 330 is configured to perform hierarchical clustering adjustment on each initial cluster based on a clustering quality evaluation index to obtain a deduplication result corresponding to the image set; the clustering quality evaluation index is configured to reflect the cluster quality of each initial cluster.

[0087] The image deduplication device provided by the present invention extracts the image features of each image in the image set to be deduplicated; based on the image features of each image, the image set is clustered to obtain multiple initial clustering clusters; based on the clustering quality evaluation index, each initial clustering cluster is hierarchically clustered and adjusted to obtain the deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial clustering cluster, which overcomes the defects of low efficiency, high computational complexity and poor robustness of traditional deduplication methods, and through first performing preliminary clustering, then evaluating the cluster quality, and automatically triggering hierarchical clustering adjustment to dynamically optimize the cluster structure, the loop process solves the overfitting and underfitting problems well, avoids the imbalance of the cluster structure, reduces manual intervention, realizes highly robust and efficient image deduplication, and can effectively solve the redundancy problem of massive image data.

[0088] Based on the above embodiment, the deduplication unit 330 is used to: Determining an adjustment strategy based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient in the clustering quality evaluation indicators; Based on the adjustment strategy, hierarchical clustering adjustment is performed on each of the initial clusters to obtain a deduplication result corresponding to the image set.

[0089] Based on the above embodiment, the adjustment strategy includes splitting and merging; the intra-cluster compactness is characterized by the cluster diameter, and the inter-cluster separation is characterized by the inter-cluster distance; The deduplication unit 330 is used to: When the cluster silhouette coefficient of any initial cluster is less than the loose threshold and the cluster diameter of any initial cluster is greater than the diameter threshold, determining that the adjustment strategy for any initial cluster is split; When the inter-cluster distance between any initial clustering cluster and any adjacent initial clustering cluster is less than the compact threshold, and the difference between the cluster silhouette coefficient of any initial clustering cluster and the cluster silhouette coefficient of any adjacent initial clustering cluster is less than the difference threshold, it is determined that the adjustment strategy for any initial clustering cluster and any adjacent initial clustering cluster is merging.

[0090] Based on the above embodiment, the deduplication unit 330 is used to: Splitting each initial cluster whose adjustment strategy is splitting, and merging two adjacent initial clusters whose adjustment strategy is merging, to obtain multiple candidate clusters; Updating the multiple candidate clusters to the multiple initial clusters, and performing hierarchical clustering adjustment on the updated multiple initial clusters until an optimization termination condition is met; the optimization termination condition includes that the cluster silhouette coefficients of the multiple initial clusters are all greater than or equal to the loose threshold and less than or equal to the compact threshold; The multiple initial clustering clusters that meet the optimization termination condition are used as target clustering clusters, and a deduplication result corresponding to the image set is determined based on the multiple target clustering clusters.

[0091] Based on the above embodiment, the deduplication unit 330 is used to: Based on the clustering quality evaluation index, hierarchical clustering adjustment is performed on the initial clusters to obtain multiple target clusters; Determining target images in each target cluster based on the distance between each image in each target cluster and the cluster center; Based on the target images in each target cluster and the cluster labels of the target images, a deduplication result corresponding to the image set is determined.

[0092] Based on the above embodiment, the extraction unit 310 is used to: Inputting each image in the image set into a feature extraction model, performing feature extraction on each image by the feature extraction model, and obtaining image features of each image output by the feature extraction model; The feature extraction model is trained based on the feature similarity between sample image features in positive samples and the similarity between sample image features in negative samples; the positive samples include different sample enhanced images of the same sample image, and the negative samples include sample enhanced images of different sample images.

[0093] Based on the above embodiment, the clustering unit 320 is used to: Determine the initial cluster value range; Determining a candidate cluster value range from the initial cluster value range based on an elbow algorithm; Determining the optimal initial cluster value from the candidate cluster value range based on the silhouette coefficient method; Based on the image features of each image, the image set is clustered according to the optimal initial cluster value to obtain a plurality of initial clusters.

[0094] Figure 4 An example of a physical structure diagram of an electronic device is shown below. Figure 4As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other via the communications bus 440. The processor 410 may call logic instructions in the memory 430 to execute an image deduplication method, which includes: determining an image set to be deduplicated and extracting image features of each image in the image set; clustering the image set based on the image features of each image to obtain a plurality of initial clusters; performing hierarchical clustering adjustment on each initial cluster based on a clustering quality assessment index to obtain a deduplication result corresponding to the image set; the clustering quality assessment index is used to reflect the cluster quality of each initial cluster.

[0095] Furthermore, the logic instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0096] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the image deduplication method provided by the above methods, which method includes: determining a set of images to be deduplicated, and extracting image features of each image in the image set; clustering the image set based on the image features of each image to obtain multiple initial clustering clusters; based on a clustering quality evaluation index, hierarchical clustering adjustment is performed on each initial clustering cluster to obtain a deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial clustering cluster.

[0097] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the image deduplication method provided by the above-mentioned methods, the method comprising: determining a set of images to be deduplicated, and extracting image features of each image in the image set; clustering the image set based on the image features of each image to obtain multiple initial clustering clusters; performing hierarchical clustering adjustment on each initial clustering cluster based on a clustering quality evaluation index to obtain a deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial clustering cluster.

[0098] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0099] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for deduplication of an image, characterized in that: include: Determining an image set to be deduplicated, and extracting image features of each image in the image set; Clustering the image set based on the image features of each image to obtain a plurality of initial clusters; Based on the clustering quality evaluation index, hierarchical clustering adjustment is performed on each initial cluster to obtain a deduplication result corresponding to the image set; The clustering quality evaluation index is used to reflect the cluster quality of each initial cluster; The hierarchical clustering adjustment is performed on each initial cluster based on the clustering quality evaluation index to obtain the deduplication result corresponding to the image set, including: Determining an adjustment strategy based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient in the clustering quality evaluation indicators; Based on the adjustment strategy, hierarchical clustering adjustment is performed on each of the initial clusters to obtain a deduplication result corresponding to the image set.

2. The image deduplication method according to claim 1, wherein: The adjustment strategy includes splitting and merging; the intra-cluster compactness is characterized by cluster diameter, and the inter-cluster separation is characterized by inter-cluster distance; the adjustment strategy is determined based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient in the clustering quality evaluation indicators, including: When the cluster silhouette coefficient of any initial cluster is less than the loose threshold and the cluster diameter of any initial cluster is greater than the diameter threshold, determining that the adjustment strategy for any initial cluster is split; When the inter-cluster distance between any initial clustering cluster and any adjacent initial clustering cluster is less than the compact threshold, and the difference between the cluster silhouette coefficient of any initial clustering cluster and the cluster silhouette coefficient of any adjacent initial clustering cluster is less than the difference threshold, it is determined that the adjustment strategy for any initial clustering cluster and any adjacent initial clustering cluster is merging.

3. The image deduplication method according to claim 2, wherein: The step of performing hierarchical clustering adjustment on each of the initial clusters based on the adjustment strategy to obtain a deduplication result corresponding to the image set includes: Splitting each initial cluster whose adjustment strategy is splitting, and merging two adjacent initial clusters whose adjustment strategy is merging, to obtain multiple candidate clusters; Updating the multiple candidate clusters to the multiple initial clusters, and performing hierarchical clustering adjustment on the updated multiple initial clusters until an optimization termination condition is met; the optimization termination condition includes that the cluster silhouette coefficients of the multiple initial clusters are all greater than or equal to the loose threshold and less than or equal to the compact threshold; The multiple initial clustering clusters that meet the optimization termination condition are used as target clustering clusters, and a deduplication result corresponding to the image set is determined based on the multiple target clustering clusters.

4. The image deduplication method according to any one of claims 1 to 3, characterized in that: The hierarchical clustering adjustment is performed on each initial cluster based on the clustering quality evaluation index to obtain the deduplication result corresponding to the image set, including: Based on the clustering quality evaluation index, hierarchical clustering adjustment is performed on the initial clusters to obtain multiple target clusters; Determining target images in each target cluster based on the distance between each image in each target cluster and the cluster center; Based on the target images in each target cluster and the cluster labels of the target images, a deduplication result corresponding to the image set is determined.

5. The image deduplication method according to any one of claims 1 to 3, characterized in that: The extracting image features of each image in the image set includes: Inputting each image in the image set into a feature extraction model, performing feature extraction on each image by the feature extraction model, and obtaining image features of each image output by the feature extraction model; The feature extraction model is trained based on the feature similarity between sample image features in positive samples and the similarity between sample image features in negative samples; the positive samples include different sample enhanced images of the same sample image, and the negative samples include sample enhanced images of different sample images.

6. The image deduplication method according to any one of claims 1 to 3, characterized in that: The clustering of the image set based on the image features of each image to obtain a plurality of initial clusters includes: Determine the initial cluster value range; Determining a candidate cluster value range from the initial cluster value range based on an elbow algorithm; Determining the optimal initial cluster value from the candidate cluster value range based on the silhouette coefficient method; Based on the image features of each image, the image set is clustered according to the optimal initial cluster value to obtain a plurality of initial clusters.

7. An image deduplication device, characterized in that: include: an extraction unit, configured to determine an image set to be deduplicated and extract image features of each image in the image set; A clustering unit, configured to cluster the image set based on image features of each image to obtain a plurality of initial clusters; a deduplication unit, configured to perform hierarchical clustering adjustment on each initial cluster based on a clustering quality evaluation index to obtain a deduplication result corresponding to the image set; the clustering quality evaluation index is used to reflect the cluster quality of each initial cluster; The hierarchical clustering adjustment is performed on each initial cluster based on the clustering quality evaluation index to obtain the deduplication result corresponding to the image set, including: Determining an adjustment strategy based on the intra-cluster compactness, inter-cluster separation, and cluster silhouette coefficient in the clustering quality evaluation indicators; Based on the adjustment strategy, hierarchical clustering adjustment is performed on each of the initial clusters to obtain a deduplication result corresponding to the image set.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the image deduplication method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image deduplication method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Facial image de-weighting method and device, electronic equipment, storage medium and program

    CN108228872A

  • Face image recognition method and device, electronic equipment and storage medium

    CN109829433A

  • Picture deduplication method and device, storage medium and electronic device

    CN110442738A

  • Method for removing duplicate of similar image in pipeline, computer device and storage medium

    CN116433550A

  • Image deduplication method and device, equipment and storage medium

    CN116597176A

Cited By

  • Target deduplication method and device, equipment and medium

    CN121259308A

  • Image deduplication method and device, electronic equipment and storage medium

    CN121388212A

  • Question answering method based on intention recognition, electronic equipment and storage medium

    CN121542398A