De-duplication method for similar images
By extracting image feature vectors and calculating quality scores, the target image collection is constructed and high-quality images are selected for storage, which solves the problem that the image deduplication system cannot effectively deduplicate similar images, and improves the deduplication accuracy and image quality.
Patent Information
- Application Number
- CN202510495505.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The image deduplication system cannot effectively deduplicate similar images, resulting in insufficient deduplication accuracy.
By extracting the feature vectors of the image to be processed, the quality score of the image is calculated, and the feature vectors and mass scores are saved to the vector library. Based on the target feature vector whose vector distance between the feature vectors is smaller than the distance threshold, a target image set is constructed, and the target image with the highest quality score is selected from the target image set for saving.
It realizes filtering similar images through feature vector comparison, improves the deduplication accuracy of similar images, and retains images with high image quality after deduplication.
Smart Images

Figure CN120011583A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image processing, and in particular to a method for removing duplicate images from similar images. Background Art
[0002] Image deduplication can remove duplicated data in storage space and save storage space. In related technologies, image deduplication systems use hash algorithms to filter image data with the same information digest in storage space, and then perform deduplication operations to retain unique image data among duplicate image data.
[0003] However, image deduplication will only determine that image data is duplicated when the information digests are exactly the same. When the information contained in two images is similar, resulting in different information digests, or when the information digests are different due to factors such as different compression algorithms, image format conversion, image cropping or rotation, the image deduplication system will determine the two images as different images and will not be able to deduplicate similar images. This results in insufficient accuracy in image deduplication.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present application is to provide a method for deduplicating similar images, aiming to solve the technical problem that an image deduplication system is unable to deduplicate similar images, resulting in insufficient accuracy of image deduplication.
[0006] To achieve the above object, the present application provides a method for deduplicating similar images, the method comprising the following steps: Extracting feature vectors of the image to be processed; Based on the feature vector, calculating the quality score of the image to be processed; The feature vector and the quality score are associated and saved in a vector library of the image to be processed; According to the target feature vectors whose vector distance between the feature vectors is less than a distance threshold, constructing a target image set corresponding to the image to be processed by the target feature vector; The target image with the highest quality score in the target image set is saved in an image folder.
[0007] In one embodiment, the step of extracting the feature vector of the image to be processed includes: Loading the image to be processed, and converting the image to be processed into a target image to be processed of a preset size; Cropping the edge area of the target image to be processed to generate a feature image of the target image to be processed; The feature image is subjected to feature extraction through a deep residual ResNet network to generate the feature vector.
[0008] In one embodiment, the step of extracting features from the feature image through a deep residual ResNet network to generate the feature vector includes: Downsampling the feature image through the initial convolution layer and the initial convolution layer to obtain a target feature image; Based on a multi-level residual block, the target feature image is convolved through the convolution kernels in the residual block in sequence to generate a feature tensor; The feature vector is subjected to dimension reduction processing through global average pooling to obtain the feature vector of the feature tensor.
[0009] In one embodiment, the step of calculating the quality score of the image to be processed based on the feature vector includes: Through the first fully connected layer, the feature vector is linearly transformed to generate global feature information; The global feature information is input into a second fully connected layer, and the quality score is obtained based on an output result of the second fully connected layer.
[0010] In one embodiment, before the step of extracting the feature vector of the image to be processed, the method further includes: Determine image data in an image deduplication process, and obtain a reference image corresponding to the image data; Subtracting the reference image from the image to be processed to obtain a difference image; Based on channel dimension stacking, connecting the difference image and the image data to generate the image to be processed; Alternatively, when the reference image does not exist, the image data is used as the image to be processed.
[0011] In one embodiment, the step of saving the target image with the highest quality score in the target image set to an image folder includes: In the vector library, obtaining the quality score corresponding to the image to be processed in the similar image set; Selecting the image to be processed with the highest quality score as the target image, and saving the target image to the image folder; And, clear and remove the target image set.
[0012] In one embodiment, the step of constructing a target image set corresponding to the image to be processed by the target feature vector whose vector distance between the feature vectors is less than a distance threshold comprises: Traversing the feature vectors in the vector library, and calculating the vector distance between the feature vector and other vectors in the vector library; When there is another target vector whose vector distance with the feature vector is less than the distance threshold, selecting the other target vector and / or the feature vector as the target feature vector; The to-be-processed images corresponding to the target feature vectors are added to the same set to generate the target image set.
[0013] In one embodiment, the step of associating the feature vector and the quality score and saving them in a vector library of the image to be processed comprises: In a vector library, construct the vector library set of the image to be processed; Based on the image number of the image to be processed, the feature vector and the quality score are associated and saved in the vector library set; A vector index for the feature vector distance measurement is created in the vector library set.
[0014] One or more technical solutions proposed in this application have at least the following technical effects: This application extracts the feature vector of the image to be processed, saves the feature vector in the vector library, and determines the image to be processed whose vector distance between feature vectors is less than the distance threshold through the vector index in the vector library, that is, similar images, and constructs a target image set, selects the target image retained after image deduplication in the target image set, thereby screening similar images by feature vector comparison to achieve deduplication of similar images. At the same time, this application calculates the quality score of the image to be processed through the feature vector, thereby selecting the image to be processed with the highest quality score from the similar images and retaining it, thereby improving the image quality of similar images after deduplication. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 This is a flow chart of a first embodiment of a method for deduplicating similar images of the present application; Figure 2 This is a flow chart of a second embodiment of a method for deduplicating similar images of the present application; Figure 3 A schematic diagram of the flow chart of the third embodiment of the method for deduplicating similar images of the present application; Figure 4 A brief flowchart of the method for deduplicating similar images in this application; Figure 5 It is a structural schematic diagram of a deduplication device for similar images in a hardware operating environment involved in an embodiment of the present application.
[0018] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0019] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0020] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0021] The main solution of the embodiment of the present application is: extracting the feature vector of the image to be processed; calculating the quality score of the image to be processed based on the feature vector; saving the feature vector and the quality score in a vector library of the image to be processed in association with each other; constructing a target image set corresponding to the target feature vector of the image to be processed based on the target feature vector whose vector distance between the feature vectors is less than a distance threshold; and saving the target image with the highest quality score in the target image set to an image folder.
[0022] Image deduplication will only determine that image data is duplicated when the information digests are exactly the same. When the information contained in two images is similar but the information digests are different, or when the information digests are different due to different compression algorithms, image format conversion, image cropping or rotation, etc., the image deduplication system will determine the two images as different images and will not be able to deduplicate similar images. This results in insufficient accuracy of image deduplication.
[0023] This application extracts the feature vector of the image to be processed, saves the feature vector in the vector library, and determines the image to be processed whose vector distance between feature vectors is less than the distance threshold through the vector index in the vector library, that is, similar images, and constructs a target image set, selects the target image retained after image deduplication in the target image set, thereby screening similar images by feature vector comparison to achieve deduplication of similar images. At the same time, this application calculates the quality score of the image to be processed through the feature vector, thereby selecting the image to be processed with the highest quality score from the similar images and retaining it, thereby improving the image quality of similar images after deduplication.
[0024] In order to better understand the above technical solution, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0025] It should be noted that the execution subject of this embodiment can be an image deduplication system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a deduplication device for similar images, etc., and this embodiment does not specifically limit this. The following takes the image deduplication system as an example to illustrate this embodiment and the following embodiments.
[0026] Based on this, the present application embodiment provides a method for deduplicating similar images, referring to Figure 1 , Figure 1 Schematic diagram of the flow chart of the first embodiment of the method for deduplicating similar images of the present application.
[0027] In this embodiment, the method for removing duplicate similar images includes steps S10 to S50: Step S10: extracting the feature vector of the image to be processed; In this embodiment, the image deduplication system includes a feature vector extraction module for the image to be processed, and uses the convolutional neural network (CNN) in deep learning as a feature extraction tool to map the image into a vector of fixed dimension, namely, a feature vector. The feature vector is the representation of the image in a high-dimensional space, and a numerical vector that can reflect its content and structure is extracted from the image through a certain feature extraction method.
[0028] As an optional implementation, step S10 includes steps S11 to S13: Step S11: loading the image to be processed, and converting the image to be processed into a target image to be processed of a preset size; Step S12: cropping the edge area of the target image to be processed to generate a feature image of the target image to be processed; In this embodiment, the image deduplication system first loads the image to be processed, and then uses the image preprocessing module to standardize the image, including adjusting the image size, cropping, and other operations, so as to convert the image to be processed into a feature image that meets the requirements of subsequent neural network processing.
[0029] For example, after loading the image, the image deduplication system uses the transforms module of pytorch to transform the image and resizes the image to 256*256 size through bilinear interpolation. After resizing the image, the image deduplication system crops the central 224*224 pixel area from the resized image.
[0030] Step S13: extracting features from the feature image through a deep residual ResNet network to generate the feature vector.
[0031] It should be noted that the deep residual network (ResNet) is a neural network model used to extract image feature information and generate feature vectors. It introduces residual learning and implements skip connections through residual blocks to solve the gradient vanishing and gradient exploding problems in deep network training, thereby allowing the construction of deep network structures without losing performance. Among them, the residual block is a key component of ResNet. Each residual block contains two 3x3 convolutional layers and a skip connection. The skip connection adds the input directly to the output of the residual block to form the basic structure of residual learning. This structure allows the gradient to propagate directly in the network, effectively alleviating the gradient vanishing problem.
[0032] In this embodiment, after the image deduplication system obtains the preprocessed feature image of the image to be processed, it inputs the feature image into the ResNet network. The ResNet network first downsamples the feature image through the initial convolution layer and the initial convolution layer, and obtains the target feature image after further scaling and feature processing of the image. Furthermore, the ResNet network is based on a multi-level residual block, and sequentially convolutions the target feature image through the convolution kernel in the residual block to generate a 2048-dimensional feature tensor, and reduces the dimension of the feature vector through global average pooling to obtain the feature vector of the feature tensor.
[0033] Specifically, the network structure of the deep residual ResNet network ResNet is divided into multiple versions based on different numbers of layers, such as ResNet-18, ResNet-34, ResNet-50, ResNet-101 and ResNet-152. The number of residual blocks and the total number of layers in different versions are not exactly the same. Among them, the ResNet50 network can extract high-level semantic features of the image through its multi-layer convolution and residual connection.
[0034] Exemplarily, ResNet50 includes an initial convolution layer, multiple residual blocks, a global average pooling layer, and / or a fully connected layer. Among them, the initial convolution layer includes a 7*7 convolution layer and a 3*3 maximum pooling layer. ResNet50 uses a bottleneck structure (Bottleneck) residual block, each residual block contains three convolution layers (1*1, 3*3 and 1*1), which are used for dimensionality reduction, feature extraction and dimensionality increase, respectively. The entire network is composed of multiple residual blocks stacked together and is divided into 4 stages (Layer1-Layer4), which contain 3, 4, 6 and 3 residual blocks respectively. Among them, after completing the convolution processing of the four-level residual block, the ResNet50 network outputs a 2048-dimensional feature tensor. The global average pooling layer is used to use global average pooling to reduce the dimension of the feature map and generate a feature vector after all residual blocks have output feature tensors. The fully connected layer outputs the classification result through 1000 dimensional channels. Among them, based on the image deduplication process, the image deduplication system completes the feature extraction of the residual block, or the feature vector after the global average pooling layer dimensionality reduction processing, and uses the feature vector or feature tensor as the processing result of ResNet50 to obtain the feature vector, and completes the quality score calculation and vector distance calculation based on the feature vector.
[0035] Step S20: Calculating the quality score of the image to be processed based on the feature vector; In this embodiment, the quality score is a numerical indicator used to measure the image quality, which reflects the visual quality characteristics of the image, such as the clarity, noise level, and contrast. The image deduplication system calculates the quality score through the Image Quality Assessment (IQA) model. The model is based on a lightweight convolutional neural network as the backbone network, such as ResNet, etc., which extracts image features and uses global average pooling and / or fully connected layers to predict the quality score of the image.
[0036] As an optional implementation method for calculating the quality score, step S20 includes S21-S22: Step S21: performing a linear transformation on the feature vector through the first fully connected layer to generate global feature information; Step S22: inputting the global feature information into a second fully connected layer, and obtaining the quality score based on an output result of the second fully connected layer.
[0037] In this embodiment, the image quality assessment model uses the feature vector extraction module as the backbone network to obtain the flattened feature vector after the feature vector is processed by global flat pooling dimensionality reduction. After receiving the feature vector, the fully connected layer calculates the quality score of the feature vector through at least two linear transformations.
[0038] Exemplarily, in the global average pooling layer, the output feature map C×H×W of the last convolutional layer is compressed into C×1×1 through the GAP module, and then flattened into a one-dimensional vector of length C. The input feature vector of length 512 is converted into a feature vector of length 1024 through the linear transformation W1x+b1, and the activation function is used for nonlinear processing to increase the nonlinear expression ability of the model, and the second fully connected layer uses the processing result output by the first fully connected layer as input data, and converts it into the final quality score through the linear transformation W2y+b2. Among them, W1 and W2 are weight matrices, and b1 and b2 are bias vectors.
[0039] As another optional implementation for calculating the quality score, the output features of the last convolutional layer in the backbone network are fed into the global average pooling module in the image quality assessment model. Two fully connected layers with 1024 hidden nodes take the flattened features obtained by global average pooling as input and predict the final quality score.
[0040] Exemplarily, the image deduplication system inputs the extracted feature vector into the IQA model. The IQA model first performs a global average pooling operation on the feature vector to compress the high-dimensional feature vector into a vector of fixed length. Then, the pooled features are processed through two fully connected layers, and finally a quality score is output. The score is usually a value between 0 and 1, and the higher the value, the better the image quality.
[0041] Step S30: associate the feature vector and the quality score and save them in a vector library of the image to be processed; In this embodiment, the vector library is a database for storing and managing image feature vectors, as well as quality scores of feature vectors, associated image numbers and other related information. The vector database supports vector detection and similarity calculation, and can implement similarity query on feature vectors.
[0042] Specifically, the image deduplication system stores the extracted feature vector and the calculated quality score as a record in the vector library in the format of (image ID, feature vector, quality score). The vector library assigns a unique image ID to each record for subsequent query and management. At the same time, the vector library constructs a vector index based on the feature vector so that similarity queries can be quickly performed later.
[0043] Optionally, the image deduplication system will construct a vector library set of the processed images in the vector library, and based on the image number of the image to be processed, construct a data structure in the format of (image ID, feature vector, quality score) for each image to be processed, associate the feature vector and the quality score and save them in the vector library set, and create a vector index in the vector library set for feature vector distance measurement.
[0044] For example, the Milvus vector library can quickly perform similarity queries on stored feature vectors by constructing vector indexes. For the above landscape image, the image deduplication system stores its 2048-dimensional feature vector and quality score 0.85 in the Milvus vector library in the format of (image ID: 12345, feature vector: […], quality score: 0.85). Milvus assigns a unique image ID to the record and constructs a vector index based on the feature vector so that similarity queries can be quickly performed on the image later.
[0045] Step S40: constructing a target image set corresponding to the image to be processed by the target feature vector whose vector distance between the feature vectors is less than a distance threshold; In this embodiment, the vector distance is a measure of the similarity between two feature vectors, and the L2 Euclidean distance is usually used. At the same time, a distance threshold is preset in the image deduplication system. When the vector distance between the feature vectors of two images to be processed is less than the distance threshold, the two images to be processed are judged to be similar images. The target image set is a set of images that meet the similarity condition, that is, a set of images whose vector distance between feature vectors is less than the distance threshold.
[0046] Specifically, step S40 includes steps S41 to S43: Step S41: traversing the feature vectors in the vector library, and calculating the vector distance between the feature vector and other vectors in the vector library; Step S42: when there is another target vector whose vector distance with the feature vector is less than the distance threshold, the other target vector and / or the feature vector is selected as the target feature vector; Step S43: adding the to-be-processed images corresponding to the target feature vectors to the same set to generate the target image set.
[0047] In this embodiment, the image deduplication system uses the vector index in the vector library to perform similarity query. The vector library will calculate based on the vector distance between the feature vectors, determine the feature vectors that are similar to each other based on the feature vectors whose distance is less than the threshold, and construct the corresponding target image set. Multiple groups of different target image sets are constructed in the image deduplication system, and the feature vectors that are similar to each other are classified into the same group.
[0048] As an optional implementation, when performing vector indexing, the image deduplication system marks two feature vectors whose vector distance is less than the calculated vector distance with the same similar vector identifier. When similar vector identifiers do not exist for both feature vectors, similar vector identifiers are created and the two feature vectors are marked. Alternatively, when a similar vector identifier exists for one of the two feature vectors, the other feature vector is marked based on the similar vector identifier. After completing the traversal of all feature vectors in sequence, the image deduplication system divides the feature vectors marked with the same similar vector into the same set as target feature vectors to complete the construction of the target image set.
[0049] As another optional implementation, when traversing the feature vectors, the image deduplication system will construct a target image set based on the feature vector of the current calculated vector distance, and select the feature vector and the corresponding similar vector, i.e., the target other vector, as the target feature vector and save it to the target image set. Furthermore, based on the target feature vector in the target image set, the image deduplication system will further calculate the feature vector in other vectors whose vector distance with the target feature vector is less than the distance threshold, determine the target other vector, and save it to the target image set until there is no feature vector in the other vectors in the vector library whose vector distance with the target feature vector is less than the distance threshold, and traverse the next feature vector in the remaining vectors in the vector library.
[0050] Step S50: saving the target image with the highest quality score in the target image set to an image folder.
[0051] In this embodiment, the image folder is a storage location for storing the final selected image, which can be a directory in the local file system or a storage space in a certain cloud storage service. The image deduplication system obtains the quality scores of all images from the target image set, selects the image to be processed with the highest quality score by comparing the scores, and saves the target image to the specified image folder. The saving process includes storing the file path of the image or the image data itself in the folder for subsequent use and viewing.
[0052] In one embodiment, the image deduplication system obtains the quality scores corresponding to the to-be-processed images in the similar image set in the vector library, selects the to-be-processed image with the highest quality score as the target image, and saves the target image to a designated image folder. Based on multiple target image sets, the image deduplication system can retain the image with the highest quality score in multiple groups of similar images to complete the deduplication of similar images. Furthermore, the image deduplication system will clear and remove the target image set.
[0053] The embodiment of the present application extracts the feature vector of the image to be processed, saves the feature vector in a vector library, and determines the image to be processed whose vector distance between feature vectors is less than a distance threshold through the vector index in the vector library, i.e., similar images, and constructs a target image set, selects the target image retained after image deduplication from the target image set, thereby screening similar images by feature vector comparison to achieve deduplication of similar images. At the same time, the present application calculates the quality score of the image to be processed through the feature vector, thereby selecting the image to be processed with the highest quality score from the similar images and retaining it, thereby improving the image quality of the similar images after deduplication.
[0054] Based on the same inventive concept, the present application also provides a second embodiment, referring to Figure 2 , Figure 2 Schematic diagram of the flow chart of the second embodiment of the method for deduplicating similar images of the present application.
[0055] In this embodiment, the method for removing duplicate similar images includes steps S01 to S10: Step S01: determining image data in an image deduplication process, and obtaining a reference image corresponding to the image data; Step S02: subtracting the reference image from the image to be processed to obtain a difference image; Step S03: Based on channel dimension stacking, the difference image and the image data are connected to generate the image to be processed; Step S10: extracting the feature vector of the image to be processed.
[0056] In this embodiment, the image deduplication system is provided with different reference images based on different quality assessment standards of the images to be processed. The reference images can be input into the image deduplication system by the user when the image deduplication process is triggered, or can be pre-stored in the image deduplication system.
[0057] Specifically, after receiving the image data that triggers the image deduplication process, the image deduplication system verifies whether there is a reference image in the system, and obtains the reference image if it exists. The image deduplication system can subtract the reference image from each image in the image data in turn to obtain a difference image, and based on the channel dimension, stack the difference image and the corresponding image in the channel dimension to achieve the connection between the difference image and the corresponding image to form an image to be processed. The quality score calculation based on the feature vector of the image to be processed after the connection can improve the accuracy of the quality score calculation of the image to be processed.
[0058] Optionally, for image quality assessment, the image deduplication system can directly process the acquired image as image data to be evaluated. For video quality assessment, the image deduplication system can also first extract each frame of the video, feed each frame into the model, and then average the scores of all frames to obtain the final quality score.
[0059] Optionally, based on the changes in the image channels of the image to be processed after the connection, the image deduplication system needs to adaptively adjust the dimensions of the convolutional layer during the deep learning training process. For example, the dimension of the first convolutional layer should be changed from 3 to 6 to adapt to the connection.
[0060] Since the system introduced in the second embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of this application.
[0061] Based on the same inventive concept, the present application also provides a third embodiment, referring to Figure 3 , Figure 3 Schematic diagram of the flow chart of the third embodiment of the method for deduplicating similar images of the present application.
[0062] In this embodiment, the method for removing duplicate similar images includes steps S04 to S10: Step S04: when the reference image does not exist, taking the image data as the image to be processed; Step S10: extracting the feature vector of the image to be processed.
[0063] In this embodiment, when the image data received by the image deduplication system does not have a corresponding reference image, the image deduplication system will directly use the image in the image data as the image to be processed to extract feature vectors and calculate quality scores.
[0064] Specifically, based on the extraction of feature vectors and the calculation of quality scores of the fully connected layers in the image to be processed, the image deduplication system can select the image with the highest quality from similar images of the image to be processed based on factors such as clarity and noise.
[0065] Since the system introduced in the third embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of the present application.
[0066] For example, to help understand the implementation process of the method for deduplication of similar images obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 4 , Figure 4 A brief flowchart of a method for deduplicating similar images is provided, specifically: In this embodiment, the image deduplication system extracts the feature vector of the image to be processed through the ResNet50 network, and replaces the single fully connected layer in the output layer of the ResNet50 network with two fully connected layers to calculate the quality score of the feature vector. At the same time, ResNet50 associates the last convolution result in the residual block, that is, the 2048-dimensional vector, with the quality score and saves it in the vector library. The vector library calculates the vector distance through the vector index, and constructs a similar vector set, that is, the target vector set, based on similar vectors whose vector distance is less than the distance threshold. The image deduplication system selects the target image with the highest quality score in the similar vector set and saves it to the corresponding image folder.
[0067] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for deduplicating similar images of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.
[0068] The present application provides a device for deduplicating similar images, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for deduplicating similar images in the above-mentioned embodiment one.
[0069] Reference below Figure 5 , which shows a schematic diagram of the structure of a device for deduplicating similar images suitable for implementing the embodiment of the present application. The device for deduplicating similar images in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The similar image deduplication device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0070] like Figure 5As shown, the deduplication device for similar images may include a processing device 1001 (e.g., a core processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the deduplication device for similar images are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the deduplication device of similar images to communicate with other devices wirelessly or by wire to exchange data. Although the deduplication device of similar images with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0071] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0072] The deduplication device for similar images provided by the present application adopts the deduplication method for similar images in the above-mentioned embodiment, which can solve the technical problem that the image deduplication system cannot deduplicate similar images, resulting in insufficient accuracy of image deduplication. Compared with the prior art, the beneficial effects of the deduplication device for similar images provided by the present application are the same as the beneficial effects of the deduplication method for similar images provided by the above-mentioned embodiment, and the other technical features of the deduplication device for similar images are the same as the features disclosed in the method of the previous embodiment, which will not be described in detail here.
[0073] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0074] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0075] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for deduplicating similar images in the above-mentioned embodiment.
[0076] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0077] The computer-readable storage medium may be included in the device for deduplicating similar images; or may exist independently without being assembled into the device for deduplicating similar images.
[0078] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the deduplication device for similar images, the deduplication device for similar images enables the following: extracting feature vectors of the image to be processed; calculating the quality score of the image to be processed based on the feature vectors; associating the feature vectors and the quality score and saving them in a vector library of the image to be processed; constructing a target image set corresponding to the image to be processed by the target feature vectors whose vector distances between the feature vectors are less than a distance threshold; and saving the target image with the highest quality score in the target image set to an image folder.
[0079] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0080] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0081] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0082] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for deduplicating similar images, and can solve the technical problem that the image deduplication system cannot deduplicate similar images, resulting in insufficient accuracy of image deduplication. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for deduplicating similar images provided by the above-mentioned embodiment, and will not be elaborated here.
[0083] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for removing duplicate images of similar images, characterized in that: The method comprises the following steps: Extracting feature vectors of the image to be processed; Based on the feature vector, calculating the quality score of the image to be processed; The feature vector and the quality score are associated and saved in a vector library of the image to be processed; According to the target feature vectors whose vector distance between the feature vectors is less than a distance threshold, constructing a target image set corresponding to the image to be processed by the target feature vector; The target image with the highest quality score in the target image set is saved in an image folder.
2. The method according to claim 1, characterized in that The step of extracting the feature vector of the image to be processed comprises: Loading the image to be processed, and converting the image to be processed into a target image to be processed of a preset size; Cropping the edge area of the target image to be processed to generate a feature image of the target image to be processed; The feature image is subjected to feature extraction through a deep residual ResNet network to generate the feature vector.
3. The method according to claim 2, characterized in that The step of extracting features from the feature image through a deep residual ResNet network to generate the feature vector comprises: Downsampling the feature image through the initial convolution layer and the initial convolution layer to obtain a target feature image; Based on a multi-level residual block, the target feature image is convolved through the convolution kernels in the residual block in sequence to generate a feature tensor; The feature vector is subjected to dimension reduction processing through global average pooling to obtain the feature vector of the feature tensor.
4. The method according to claim 1, characterized in that The step of calculating the quality score of the image to be processed based on the feature vector comprises: Through the first fully connected layer, the feature vector is linearly transformed to generate global feature information; The global feature information is input into a second fully connected layer, and the quality score is obtained based on an output result of the second fully connected layer.
5. The method according to claim 1, characterized in that: Before the step of extracting the feature vector of the image to be processed, the method further includes: Determine image data in an image deduplication process, and obtain a reference image corresponding to the image data; Subtracting the reference image from the image to be processed to obtain a difference image; Based on channel dimension stacking, connecting the difference image and the image data to generate the image to be processed; Alternatively, when the reference image does not exist, the image data is used as the image to be processed.
6. The method according to claim 1, characterized in that The step of saving the target image with the highest quality score in the target image set to an image folder comprises: In the vector library, obtaining the quality score corresponding to the image to be processed in the similar image set; Selecting the image to be processed with the highest quality score as the target image, and saving the target image to the image folder; And, clear and remove the target image set.
7. The method according to claim 1, characterized in that The step of constructing a target image set corresponding to the image to be processed by the target feature vector whose vector distance between the feature vectors is less than a distance threshold comprises: Traversing the feature vectors in the vector library, and calculating the vector distance between the feature vector and other vectors in the vector library; When there is another target vector whose vector distance with the feature vector is less than the distance threshold, selecting the other target vector and / or the feature vector as the target feature vector; The to-be-processed images corresponding to the target feature vectors are added to the same set to generate the target image set.
8. The method according to claim 1, characterized in that The step of associating the feature vector and the quality score and saving them in the vector library of the image to be processed comprises: In a vector library, construct the vector library set of the image to be processed; Based on the image number of the image to be processed, the feature vector and the quality score are associated and saved in the vector library set; A vector index for the feature vector distance measurement is created in the vector library set.
Citation Information
Patent Citations
Image quality evaluation method and device, storage medium and electronic device
CN113420871A
Video quality evaluation method and device for simulating human eye characteristics based on Transform
CN115713708A
Face moistening image quality evaluation method and device based on texture analysis, equipment and medium
CN116245829A
Real scene image quality evaluation method based on multi-scale spatial pyramid pooling
CN116777811A
Image processing method and device, electronic equipment and storage medium
CN117095176A