A method, apparatus and storage medium for storing an image

By generating feature vectors and calculating similarity, the problem of wasted storage space caused by storing similar images in computing devices is solved, and automated image management and storage optimization are achieved.

CN120029539BActive Publication Date: 2025-11-18CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510063595.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-11-18
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

In the existing technology, the photo albums or application software of computing devices store a large number of similar or identical pictures. When users clean up memory, they cannot determine when these pictures will be stored, resulting in wasted storage space and a lack of proactive cleanup mechanisms.

Method used

By generating a first target feature vector and a second target feature vector of the image to be stored, features are extracted using multi-layer convolution and a preset algorithm. The similarity between the image to be stored and historical images is calculated. When the similarity exceeds a threshold, the user is prompted whether to store the image. The storage strategy is determined based on the user's response.

Benefits of technology

It improves the efficiency of image storage, saves storage space on computing devices, and automatically cleans up duplicate or similar images through similarity comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029539B_ABST
    Figure CN120029539B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of big data, and discloses a method and device for storing images and a storage medium, the method comprising the following steps: in response to a picture storage request triggered by a user end, generating a first target feature vector and a second target feature vector based on a to-be-stored image; determining the similarity between the to-be-stored image and each historical image that has been stored in a computing device in advance based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and a first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and a second historical feature vector corresponding to the historical image; sending prompt information to the user end when the similarity is greater than a preset similarity threshold; and determining whether to store the to-be-stored image in the computing device based on reply information of the user end to the prompt information, thereby saving the storage space of the computing device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data, and provides a method and device for storing images and a storage medium. BACKGROUND

[0002] At present, a large number of pictures are usually stored in the photo album or application software of a computing device (for example, a mobile phone, a tablet computer, etc.), and when the user end selects to clean up the memory, the user end is prompted whether the similar or identical pictures need to be deleted. However, because the storage time of the pictures is relatively long, the user end cannot determine under what circumstances the similar or identical pictures are stored, so the user end needs to consider more when deleting, and the user end is prompted whether the pictures need to be deleted only when the user end initiates to clean up the memory, otherwise the pictures will always occupy the storage space in the memory. SUMMARY

[0003] The method and device for storing images and the storage medium provided by the present application determine whether to store the image to be stored after comparing the similarity between the image to be stored and the historical image, thereby saving the storage space of the computing device.

[0004] The specific technical solutions provided by the present application are as follows:

[0005] In a first aspect, the present application provides a method for storing images, applied to a computing device, and the method comprises the following steps.

[0006] In response to a picture storage request triggered by the user end, a first target feature vector and a second target feature vector are generated based on the image to be stored, wherein the picture storage request is generated based on the image to be stored, the first target feature vector is obtained by performing feature extraction on the image to be stored by using a multi-layer convolution, and the second target feature vector is obtained by performing feature point extraction on the image to be stored by using a preset algorithm;

[0007] The similarity between the image to be stored and each historical image that has been stored in the computing device in advance is determined based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and a first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and a second historical feature vector corresponding to the historical image;

[0008] When the similarity is greater than a preset similarity threshold, a prompt information is sent to the user end, and whether to store the image to be stored in the computing device is determined based on the reply information of the user end to the prompt information.

[0009] Optionally, the first target feature vector is generated in the following manner:

[0010] obtaining a generation position and a creation time of the to-be-stored image, wherein the generation position represents application software in the computing device that generates the to-be-stored image;

[0011] performing feature extraction on the to-be-stored image by using multi-layer convolution to obtain a first pre-selected feature vector;

[0012] generating a first target feature vector based on the generation position, the creation time, and the first pre-selected feature vector;

[0013] generating a second target feature vector by the following manner:

[0014] performing feature point extraction on the to-be-stored image by using a preset algorithm to obtain a plurality of feature points;

[0015] generating the second target feature vector based on each feature point.

[0016] Optionally, each first similarity is determined by the following manner:

[0017] performing feature extraction on each historical image that has been stored in the computing device in advance by using multi-layer convolution respectively to obtain a first pre-selected historical feature vector corresponding to each historical image;

[0018] generating a first historical feature vector based on a storage position, a storage time, and the first pre-selected historical feature vector of each historical image;

[0019] calculating a similarity between the first target feature vector and each first historical feature vector by using cosine similarity respectively, and determining each obtained similarity as the first similarity respectively;

[0020] determining each second similarity by the following manner:

[0021] performing feature point extraction on each historical image that has been stored in the computing device in advance by using the preset algorithm respectively to obtain a second historical feature vector corresponding to each historical image;

[0022] calculating a similarity between the second target feature vector and each second historical feature vector by using cosine similarity respectively, and determining each obtained similarity as the second similarity respectively.

[0023] Optionally, determining a similarity between the to-be-stored image and each historical image that has been stored in the computing device in advance based on each first similarity and each second similarity, comprising:

[0024] performing the following operation for each historical image that has been stored in the computing device in advance:

[0025] The first similarity and the second similarity corresponding to the to-be-stored image and the historical image are calculated, and a result value obtained after the calculation is determined as the similarity between the to-be-stored image and the historical image.

[0026] Optionally, determining whether to store the to-be-stored image in the computing device based on the reply information of the user terminal to the prompt information comprises:

[0027] receiving the reply information of the user terminal to the prompt information, and analyzing the reply information;

[0028] if the reply information indicates that the to-be-stored image needs to be saved, storing the to-be-stored image in the computing device;

[0029] if the reply information indicates that the to-be-stored image does not need to be saved, not storing the to-be-stored image in the computing device.

[0030] Optionally, before determining the similarity between the to-be-stored image and each historical image that has been stored in the computing device based on each first similarity and each second similarity, the method further comprises:

[0031] comparing whether any two historical images that have been stored in the computing device are identical;

[0032] if the comparison result is identical, deleting one of the any two historical images.

[0033] Optionally, the method further comprises:

[0034] when the similarity is not greater than a preset similarity threshold, storing the to-be-stored image in the computing device.

[0035] In a second aspect, an embodiment of the present application further provides an apparatus for storing an image, comprising:

[0036] a response unit configured to generate a first target feature vector and a second target feature vector based on a to-be-stored image in response to a picture storage request triggered by a user terminal, wherein the picture storage request is generated based on the to-be-stored image, the first target feature vector is obtained by performing feature extraction on the to-be-stored image using a multi-layer convolution, and the second target feature vector is obtained by performing feature point extraction on the to-be-stored image using a preset algorithm;

[0037] a determination unit configured to determine a similarity between the to-be-stored image and each historical image that has been stored in the computing device based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and a first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and a second historical feature vector corresponding to the historical image;

[0038] The storage unit is configured to send a prompt to the user terminal when the similarity is greater than a preset similarity threshold, and determine whether to store the to-be-stored image in the computing device based on reply information of the user terminal to the prompt.

[0039] Optionally, the first target feature vector is generated by:

[0040] The generation position and the creation time of the to-be-stored image are obtained, wherein the generation position represents an application software in the computing device that generates the to-be-stored image.

[0041] The to-be-stored image is subjected to feature extraction by using multi-layer convolution to obtain a first preselected feature vector.

[0042] The first target feature vector is generated based on the generation position, the creation time, and the first preselected feature vector.

[0043] The second target feature vector is generated by:

[0044] The to-be-stored image is subjected to feature point extraction by using a preset algorithm to obtain a plurality of feature points.

[0045] The second target feature vector is generated based on each feature point.

[0046] Optionally, each first similarity is determined by:

[0047] Each historical image that has been stored in the computing device in advance is subjected to feature extraction by using multi-layer convolution respectively to obtain a first preselected historical feature vector corresponding to each historical image.

[0048] A first historical feature vector is generated based on a storage position, a storage time, and the first preselected historical feature vector of each historical image.

[0049] A cosine similarity is used to calculate a similarity between the first target feature vector and each first historical feature vector respectively, and each obtained similarity is determined as a first similarity respectively.

[0050] Each second similarity is determined by:

[0051] Each historical image that has been stored in the computing device in advance is subjected to feature point extraction by using a preset algorithm respectively to obtain a second historical feature vector corresponding to each historical image.

[0052] A cosine similarity is used to calculate a similarity between the second target feature vector and each second historical feature vector respectively, and each obtained similarity is determined as a second similarity respectively.

[0053] Optionally, the determining unit is configured to determine the similarity between the to-be-stored image and each historical image that has been stored in the computing device in advance based on the respective first similarity and the respective second similarity.

[0054] For each historical image that has been stored in the computing device in advance, the following operations are performed:

[0055] The first similarity and the second similarity corresponding to the to-be-stored image and the historical image are operated, and a result value obtained after the operation is determined as the similarity between the to-be-stored image and the historical image.

[0056] Optionally, the storage unit is configured to determine whether to store the to-be-stored image in the computing device based on the reply information of the user terminal to the prompt information.

[0057] The reply information of the user terminal to the prompt information is received, and the reply information is parsed.

[0058] If the reply information indicates that the to-be-stored image needs to be saved, the to-be-stored image is stored in the computing device.

[0059] If the reply information indicates that the to-be-stored image does not need to be saved, the to-be-stored image is not stored in the computing device.

[0060] Optionally, before the determining the similarity between the to-be-stored image and each historical image that has been stored in the computing device in advance based on the respective first similarity and the respective second similarity, the method further includes:

[0061] Comparing whether any two historical images that have been stored in the computing device in advance are identical.

[0062] If the comparison result is identical, one of the any two historical images is deleted.

[0063] Optionally, the method further includes:

[0064] When the similarity is not greater than a preset similarity threshold, the to-be-stored image is stored in the computing device.

[0065] In a third aspect, a computing device includes:

[0066] A memory configured to store executable instructions.

[0067] A processor configured to read and execute the executable instructions stored in the memory to implement the method of any one of the first aspect.

[0068] In a fourth aspect, a computer-readable storage medium, when instructions in the storage medium are executed by a processor, enable the processor to execute the method of any one of the first aspect.

[0069] The present application has the following advantages:

[0070] To sum up, in the embodiment of the present application, a method, device and storage medium for storing images are provided. The method is applied to a computing device and includes: in response to a picture storage request triggered by a user end, generating a first target feature vector and a second target feature vector based on a to-be-stored image, wherein the picture storage request is generated based on the to-be-stored image, the first target feature vector is obtained by performing feature extraction on the to-be-stored image using a multi-layer convolution, and the second target feature vector is obtained by performing feature point extraction on the to-be-stored image using a preset algorithm; determining a similarity between the to-be-stored image and each historical image that has been stored in the computing device in advance based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and a first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and a second historical feature vector corresponding to the historical image; sending prompt information to the user end when the similarity is greater than a preset similarity threshold; and determining whether to store the to-be-stored image in the computing device based on reply information of the user end to the prompt information. The above scheme of determining whether to store the to-be-stored image in the computing device after comparing the similarity with the historical image effectively improves the efficiency of the picture storage process and saves the storage space of the computing device.

[0071] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application can be achieved and obtained by means of the structures particularly pointed out in the written description, claims, and accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0072] The accompanying drawings, which are included to provide a further understanding of the present application, illustrate embodiments of the present application and together with the description, serve to explain the present application. The present application is not intended to be unduly limited by the drawings, which are depicted by way of illustration and example. In the drawings:

[0073] Figure 1 A system architecture for storing images in the embodiment of the present application is shown in the figure;

[0074] Figure 2 A flowchart of a method for storing images in the embodiment of the present application is shown in the figure;

[0075] Figure 3 A flowchart of a method for determining whether to store a to-be-stored image in a computing device based on reply information of a user end to prompt information in the embodiment of the present application is shown in the figure;

[0076] Figure 4 A flowchart of another method for storing images in the embodiment of the present application is shown in the figure;

[0077] Figure 5 Fig. 1 is a schematic diagram of a logical architecture of a device for storing images according to an embodiment of the present application;

[0078] Figure 6 Fig. 2 is a schematic diagram of a physical architecture of a computing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0079] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments described in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0080] The terms "first", "second", and the like in the description, claims, and drawings of the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0081] The preferred embodiments of the present application will be described in detail below with reference to the drawings.

[0082] Referring to Figure 1 Fig. 1, in an embodiment of the present application, the system includes at least one user terminal and a computing device, and in Figure 1 the computing device can be any one of a mobile phone, a tablet computer, a computer, etc., and generally, a plurality of application software (such as a photo album or other communication software, etc.) is installed in the computing device, and a large number of historical images are stored in each application software. In an embodiment of the present application, the implementation of a method for storing images is mainly performed on the computing device side, which will be described in detail below.

[0083] Referring to Figure 2 Fig. 2, in an embodiment of the present application, the specific flow of the method for storing images is as follows:

[0084] Step 201: in response to a picture storage request triggered by the user terminal, a first target feature vector and a second target feature vector are respectively generated based on a to-be-stored image, wherein the picture storage request is generated based on the to-be-stored image, the first target feature vector is obtained by performing feature extraction on the to-be-stored image using a multi-layer convolution, and the second target feature vector is obtained by performing feature point extraction on the to-be-stored image using a preset algorithm.

[0085] In the process of using the computing device by the user, for example, the user uses the camera of the computing device to take a picture, the user downloads a picture in an application of the computing device, or the user obtains a picture by using an instant messaging application of the computing device, which triggers the generation of a picture storage request. The picture storage request is a request for determining whether the picture needs to be saved on the computing device, which is generated according to the picture obtained by taking a picture, downloading, or communication transmission.

[0086] After responding to the picture storage request, the computing device analyzes the picture storage request, and then generates a first target feature vector and a second target feature vector according to the picture to be stored. First, the generation process of the first target feature vector and the second target feature vector is introduced.

[0087] First, the first target feature vector is generated by the following method:

[0088] (1) Obtain the generation position and creation time of the picture to be stored, wherein the generation position represents the application in the computing device that generates the picture to be stored.

[0089] Considering that the application for storing the picture is uncertain, in the embodiment of the present application, in order to comprehensively and uniformly process the pictures in the computing device, the generation position a of the picture to be stored is obtained first. The generation position a can be a specific storage path. For example, the generation position a is specifically a photo album where the picture to be stored is stored after being generated by taking a picture, or an application where the picture to be stored is stored after being obtained by downloading in a chat message. It should be noted that the generation position a can also be a storage position represented by an encoding method. In order to mark each application, different encodings can be used to mark each application in advance. Correspondingly, the generation position a can be any one of the encodings.

[0090] In order to more accurately describe the picture to be stored, in the implementation process, after obtaining the generation position of the picture to be stored, the creation time t of the picture to be stored is further obtained. For example, the taking time in the case of taking a picture to generate the picture to be stored, or the downloading time in the case of downloading the picture to be stored in a chat message.

[0091] (2) Feature extraction of the picture to be stored is performed by using multi-layer convolution to obtain a first pre-selected feature vector.

[0092] In order to avoid the phenomenon of overfitting caused by the fact that the deep convolutional neural network (usually including more than 3 convolutional layers and other layers) causes the image features to be concentrated in a too small area, in the embodiments of the present application, only the multi-layer convolution is used for feature extraction of the to-be-stored image, and other layers in the neural network are not used for processing.

[0093] Preferably, the above multi-layer convolution is usually three layers, and in the implementation process, the multi-layer convolution is used for feature extraction of the to-be-stored image, and a plurality of feature generation vectors are obtained after the extraction, that is, a first pre-selected feature vector b is generated according to the to-be-stored image.

[0094] (3) generating a first target feature vector based on the generated position, the creation time and the first pre-selected feature vector.

[0095] In the implementation process, after obtaining the first pre-selected feature vector b, the first target feature vector is further generated in combination with the generated position a and the creation time t, that is, the first target feature vector k1=(a, t, b).

[0096] Secondly, the second target feature vector is generated in the following way:

[0097] 1) using a preset algorithm to extract feature points of the to-be-stored image to obtain a plurality of feature points.

[0098] In order to accurately extract the features of the to-be-stored image, while using the multi-layer convolution to extract the features of the to-be-stored image, in the embodiments of the present application, a preset algorithm (for example, the sift algorithm) is also used to extract the feature points of the to-be-stored image, that is, the to-be-stored image is converted into a plurality of feature points.

[0099] 2) generating a second target feature vector based on each feature point.

[0100] In the implementation process, after obtaining the plurality of feature points, the second target feature vector p1 is further generated according to each feature point.

[0101] Step 202: determining the similarity between the to-be-stored image and each historical image previously stored in the computing device based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and the first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and the second historical feature vector corresponding to the historical image.

[0102] It should be first pointed out that before determining the similarity between the to-be-stored image and each historical image previously stored in the computing device based on each first similarity and each second similarity, it further includes:

[0103] [1] Compare whether any two historical images stored in advance in the computing device are the same.

[0104] Considering that the number of each historical image stored in the computing device is large, and the historical image may be stored in any application software in the computing device, in order to reduce the amount of calculation, before determining the similarity between the to-be-stored image and the historical image, each historical image stored in advance in the computing device is screened, so as to achieve the purpose of retaining only different historical images in the computing device.

[0105] In the implementation process, each historical image stored in each application software of the computing device is obtained, and then whether any two historical images in all the historical images are the same is compared, that is, any two historical images are compared as a group to check whether there is a same historical image.

[0106] [2] If the comparison result is the same, one of the two historical images is deleted.

[0107] In the implementation process, if it is found that the two historical images are the same after comparison, one of the two historical images is deleted, that is, only one historical image is retained, so as to achieve the purpose of deleting the repeatedly stored historical image. After comparing each historical image, the purpose that each historical image stored in the computing device is different is achieved.

[0108] After determining that each historical image stored in the computing device is different, a first historical feature vector and a second historical feature vector are further generated according to the historical image, and on this basis, each first similarity is determined by the following way:

[0109] 1. Each historical image stored in advance in the computing device is feature-extracted by using a multi-layer convolution, to obtain a first preselected historical feature vector corresponding to each historical image.

[0110] In the embodiment of the application, in order to better compare the historical image with the to-be-stored image, the same way as generating the first target feature vector of the to-be-stored image is used to generate the first historical feature vector of each historical image.

[0111] In the implementation process, in order to avoid that using a deep convolutional neural network (usually including more than 3 convolutional layers and other layers) will cause the image features to be concentrated in a too small area and cause overfitting phenomenon, only a multi-layer convolution is used to feature-extract each historical image stored in advance in the computing device, and other layers in the neural network are not used for processing.

[0112] Preferably, the multi-layer convolution is usually three layers, and in the implementation process, for each historical image, the multi-layer convolution is used to extract features of the historical image, and a plurality of feature vectors are generated after the extraction, i.e., a first pre-selected historical feature vector B corresponding to the historical image is generated according to the historical image.

[0113] 2. Generating a first historical feature vector based on the storage location, storage time and the first pre-selected historical feature vector of each historical image.

[0114] In addition, in the implementation process, the storage location A of the historical image also needs to be obtained, and exemplarily, the storage location A is a storage path or a storage code of the historical image. In addition, the storage time T of the historical image also needs to be obtained, and exemplarily, the storage time T is a storage time when the historical image is saved into the application software, a download time when the historical image is downloaded from a certain chat message, etc.

[0115] In the implementation process, after obtaining the first pre-selected historical feature vector B, the first historical feature vector is generated by combining the storage location A and the storage time T, i.e., the first historical feature vector K1=(A, T, B).

[0116] 3. Calculating the similarity between the first target feature vector and each first historical feature vector by using cosine similarity, and determining each similarity as a first similarity.

[0117] In the implementation process, after obtaining the first target feature vector k1 of the to-be-stored image and the first historical feature vector K1 of one of the historical images, the similarity between the first target feature vector k1 and the first historical feature vector K1 is calculated by using cosine similarity for one first target feature vector k1 and the first historical feature vector K1. For other historical images in each historical image, the same cosine similarity is used to calculate the similarity between the first target feature vector and the first historical feature vector, until the corresponding first similarity between the to-be-stored image and each historical image is calculated.

[0118] In addition, each second similarity is determined by the following method:

[0119] <1> Extracting feature points of each historical image stored in the computing device in advance by using a preset algorithm to obtain a second historical feature vector corresponding to each historical image.

[0120] Similarly, in order to accurately extract the features of the historical image as a comparison object, in the process of extracting the features of the historical image by using the multi-layer convolution, the preset algorithm (for example, the sift algorithm) is also used to extract the feature points of each historical image stored in the computing device, that is, to convert the historical image into a plurality of feature points, and then to obtain the second historical feature vector P1 corresponding to each historical image according to the plurality of feature points.

[0121] <2> The similarity between the second target feature vector and each second historical feature vector is calculated by using the cosine similarity, and each obtained similarity is determined as a second similarity.

[0122] In the implementation process, after obtaining the second target feature vector p1 of the to-be-stored image and the second historical feature vector P1 of one of the historical images, the similarity between the second target feature vector p1 and the second historical feature vector P1 is calculated by using the cosine similarity. For other historical images, the same cosine similarity is used to calculate the similarity between the second target feature vector and the second historical feature vector, until the corresponding second similarity between the to-be-stored image and each historical image is calculated.

[0123] It should be further pointed out that, in order to ensure that the first similarity and the second similarity are obtained by comparing the to-be-stored image with the same historical image, the storage location and the storage time of the historical image can be used to mark the first historical feature vector and the second historical feature vector, that is, the storage location and the storage time are used to uniquely determine the historical image, and then to determine the first historical feature vector and the second historical feature vector of the historical image.

[0124] After obtaining the plurality of first similarities and the plurality of second similarities, the similarity between the to-be-stored image and each historical image stored in the computing device is determined based on the first similarities and the second similarities, including:

[0125] For each historical image stored in the computing device, the following operations are performed:

[0126] The first similarity and the second similarity corresponding to the to-be-stored image and the historical image are operated, and the result value obtained after the operation is determined as the similarity between the to-be-stored image and the historical image.

[0127] In the embodiment, in order to effectively save storage space, when the picture storage request is triggered by the user terminal and the similarity between the to-be-stored image and each historical image is calculated, the prompt information is generated according to the to-be-stored image with the same or higher similarity, that is, the prompt information is sent to the user terminal when the similarity is greater than the preset similarity threshold, and whether the to-be-stored image is stored in the computing device is determined according to the reply information of the user terminal to the prompt information.

[0128] Step 203: sending prompt information to the user terminal when the similarity is greater than the preset similarity threshold, and determining whether to store the to-be-stored image in the computing device based on the reply information of the user terminal to the prompt information.

[0129] In the embodiment, in order to effectively save storage space, when the picture storage request is triggered by the user terminal and the similarity between the to-be-stored image and each historical image is calculated, the prompt information is generated according to the to-be-stored image with the same or higher similarity, that is, the prompt information is sent to the user terminal when the similarity is greater than the preset similarity threshold, and whether the to-be-stored image is stored in the computing device is determined according to the reply information of the user terminal to the prompt information.

[0130] The prompt information can be a prompt information pop-up window. In one embodiment, the to-be-stored image with the same or higher similarity that has been stored is presented in the prompt information pop-up window. In another embodiment, the comparison photos between the to-be-stored image and the historical image are presented in the prompt information pop-up window.

[0131] In the specific implementation process, whether the to-be-stored image is stored in the computing device is determined based on the reply information of the user terminal to the prompt information, as shown in FIG. 8, which includes the following steps. Figure 3

[0132] Step 2031: receiving the reply information of the user terminal to the prompt information and analyzing the reply information.

[0133] When the computing device sends the prompt information to the user terminal, the user terminal can generate the reply information according to the prompt information and return the reply information to the computing device. Thus, the computing device can determine whether to store the to-be-stored image according to the specific content of the reply information after receiving the reply information.

[0134] In the implementation process, the computing device first analyzes the reply information, that is, analyzes the information whether to save the to-be-stored image from the reply information.​

[0135] Step 2032: If the reply information represents that the to-be-stored image needs to be saved, storing the to-be-stored image in the computing device.

[0136] It should be noted that the specific content of the reply information can be flexibly set according to a preset, for example, in the case that the preset information 1 is that the to-be-stored image needs to be saved and the information 0 is that the to-be-stored image does not need to be saved, when the information obtained by the computing device after analyzing the reply information is 1, it is determined that the to-be-stored image needs to be saved, and in this case, the to-be-stored image is stored in the computing device. Illustratively, in the process of storing the to-be-stored image, the original image of the to-be-stored image can be directly stored to a specified storage location (for example, any application software, etc.), or the first target feature vector and the second target feature vector corresponding to the to-be-stored image can be respectively stored into the first vector library and the second vector library, which is not limited here.

[0137] Step 2033: If the reply information represents that the to-be-stored image does not need to be saved, the to-be-stored image is not stored in the computing device.

[0138] In the implementation process, when it is determined that the to-be-stored image does not need to be saved after analyzing the reply information, for example, in the case that the preset information 1 is that the to-be-stored image needs to be saved and the information 0 is that the to-be-stored image does not need to be saved, when the information obtained by the computing device after analyzing the reply information is 0, it is determined that the to-be-stored image does not need to be saved, and in this case, the to-be-stored image is abandoned.

[0139] In addition, referring to FIG. 2, Figure 4 the method further includes:

[0140] Step 204: When the similarity is not greater than the preset similarity threshold, storing the to-be-stored image in the computing device.

[0141] In order to completely save the image in the computing device, in the implementation process, when it is determined that the similarity between the to-be-stored image and the historical image is not greater than the preset similarity threshold through similarity calculation, it means that the correlation between the to-be-stored image and the historical image is small, and in this case, the to-be-stored image is stored in the computing device.

[0142] It needs to be explained that, in order to facilitate the user terminal to issue a picture storage request again, the to-be-stored image is compared with the image to be stored as a new historical image, and in the implementation process, the to-be-stored image is stored in the computing device, and the first target feature vector and the second target feature vector corresponding to the to-be-stored image are usually stored, so that the calculation amount in the similarity comparison process can be effectively saved. It needs to be explained that the specific storage location of the to-be-stored image in the computing device can be flexibly set according to the specific scene, which is not limited here.

[0143] Based on the same inventive concept, refer to Figure 5 The embodiment of the application provides a device for storing images, which comprises:

[0144] The response unit 501 is configured to generate a first target feature vector and a second target feature vector based on the to-be-stored image in response to a picture storage request triggered by the user terminal, wherein the picture storage request is generated based on the to-be-stored image, the first target feature vector is obtained by performing feature extraction on the to-be-stored image by using a multi-layer convolution, and the second target feature vector is obtained by performing feature point extraction on the to-be-stored image by using a preset algorithm;

[0145] The determination unit 502 is configured to determine the similarity between the to-be-stored image and each historical image that has been stored in the computing device in advance based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and a first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and a second historical feature vector corresponding to the historical image;

[0146] The storage unit 503 is configured to send prompt information to the user terminal when the similarity is greater than a preset similarity threshold, and determine whether to store the to-be-stored image in the computing device based on the reply information of the user terminal to the prompt information.

[0147] Optionally, the first target feature vector is generated in the following manner:

[0148] The generation position and the creation time of the to-be-stored image are obtained, wherein the generation position represents an application software in the computing device that generates the to-be-stored image;

[0149] The multi-layer convolution is used to perform feature extraction on the to-be-stored image to obtain a first preselected feature vector;

[0150] The first target feature vector is generated based on the generation position, the creation time and the first preselected feature vector;

[0151] The second target feature vector is generated in the following manner:

[0152] A preset algorithm is used to extract feature points from the image to be stored, resulting in multiple feature points.

[0153] Generate a second target feature vector based on each feature point.

[0154] Optionally, each first similarity score can be determined in the following way:

[0155] Multi-layer convolution is used to extract features from each historical image that has been stored in the computing device in advance, so as to obtain the first pre-selected historical feature vector corresponding to each historical image.

[0156] The first historical feature vector is generated based on the storage location, storage time, and first pre-selected historical feature vector of each historical image;

[0157] The similarity between the first target feature vector and each first historical feature vector is calculated using cosine similarity, and each obtained similarity is determined as the first similarity.

[0158] Each second similarity is determined in the following way:

[0159] Each historical image stored in the computing device is processed by a preset algorithm to extract feature points, and the second historical feature vector corresponding to each historical image is obtained.

[0160] The similarity between the second target feature vector and each second historical feature vector is calculated using cosine similarity, and each obtained similarity is determined as the second similarity.

[0161] Optionally, the similarity between the image to be stored and each historical image pre-stored in the computing device is determined based on each first similarity and each second similarity. The determining unit 502 is used to:

[0162] Perform the following operations for each historical image that has been pre-stored in the computing device:

[0163] The first similarity and the second similarity between the image to be stored and the historical images are calculated, and the result is determined as the similarity between the image to be stored and the historical images.

[0164] Optionally, based on the user's response to the prompt message, it is determined whether to store the image to be stored in the computing device. The storage unit 503 is used for:

[0165] Receive user responses to prompts and parse those responses.

[0166] If the response information indicates that the image to be stored needs to be saved, then the image to be stored is stored in the computing device;

[0167] If the response information indicates that the image to be stored does not need to be saved, then the image to be stored will not be stored in the computing device.

[0168] Optionally, before determining the similarity between the image to be stored and each historical image pre-stored in the computing device based on each first similarity and each second similarity, the method further includes:

[0169] Compare whether any two historical images that have been stored in the computing device beforehand are the same;

[0170] If the comparison results are the same, then delete one of the two historical images.

[0171] Optionally, it also includes:

[0172] When the similarity is not greater than the preset similarity threshold, the image to be stored is stored in the computing device.

[0173] Based on the same inventive concept, see [reference] Figure 6 As shown, this application embodiment provides a computing device, including: a memory 601 for storing executable instructions; and a processor 602 for reading and executing the executable instructions stored in the memory, and executing any of the methods described in the first aspect above.

[0174] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium that, when the instructions in the storage medium are executed by a processor, enables the processor to perform the method described in any of the first aspects above.

[0175] In summary, the embodiments of this application provide a method, apparatus, and storage medium for storing images. The method, applied to a computing device, includes: responding to an image storage request triggered by a user terminal; generating a first target feature vector and a second target feature vector based on the image to be stored; wherein the image storage request is generated based on the image to be stored; the first target feature vector is obtained by feature extraction of the image to be stored using multi-layer convolution; the second target feature vector is obtained by feature point extraction of the image to be stored using a preset algorithm; determining the similarity between the image to be stored and each historical image pre-stored in the computing device based on each first similarity and each second similarity; wherein the first similarity is determined based on the first target feature vector and the first historical feature vector corresponding to the historical image; the second similarity is determined based on the second target feature vector and the second historical feature vector corresponding to the historical image; sending a prompt message to the user terminal when the similarity is greater than a preset similarity threshold; and determining whether to store the image to be stored in the computing device based on the user terminal's response to the prompt message. This scheme, which determines whether to store the image to be stored in the computing device after comparing its similarity with historical images, effectively improves the efficiency of the image storage process and saves storage space in the computing device.

[0176] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program product systems. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product system implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0177] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program product systems according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0178] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0179] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0180] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for storing images, characterized in that, Applied to a computing device, the method includes: In response to an image storage request triggered by a user, a first target feature vector and a second target feature vector are generated based on the image to be stored. The image storage request is generated based on the image to be stored. The first target feature vector is obtained by extracting features from the image to be stored using multi-layer convolution. The second target feature vector is obtained by extracting feature points from the image to be stored using a preset algorithm. The similarity between the image to be stored and each historical image pre-stored in the computing device is determined based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and the first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and the second historical feature vector corresponding to the historical image; When the similarity is greater than a preset similarity threshold, a prompt message is sent to the user terminal, and the user terminal's response to the prompt message determines whether to store the image to be stored in the computing device.

2. The method as described in claim 1, characterized in that, The first target feature vector is generated in the following manner: Obtain the generation location and creation time of the image to be stored, wherein the generation location represents the application software in the computing device that generates the image to be stored; The image to be stored is subjected to feature extraction using the multi-layer convolution to obtain a first pre-selected feature vector; The first target feature vector is generated based on the generation location, the creation time, and the first pre-selected feature vector. The second target feature vector is generated in the following manner: The preset algorithm is used to extract feature points from the image to be stored, resulting in multiple feature points; The second target feature vector is generated based on each of the aforementioned feature points.

3. The method as described in claim 1, characterized in that, Each of the first similarities is determined in the following manner: The multi-layer convolution is used to extract features from each historical image that has been stored in the computing device in advance, so as to obtain the first pre-selected historical feature vector corresponding to each historical image. The first historical feature vector is generated based on the storage location, storage time, and first pre-selected historical feature vector of each historical image; The similarity between the first target feature vector and each of the first historical feature vectors is calculated using cosine similarity, and each of the obtained similarities is determined as the first similarity. Each of the second similarities is determined in the following manner: The preset algorithm is used to extract feature points from each historical image that has been stored in the computing device in advance, so as to obtain the second historical feature vector corresponding to each historical image. The similarity between the second target feature vector and each of the second historical feature vectors is calculated using cosine similarity, and each of the obtained similarities is determined as the second similarity.

4. The method as described in claim 1, characterized in that, Determining the similarity between the image to be stored and historical images pre-stored in the computing device based on each first similarity and each second similarity includes: For each of the historical images that have been pre-stored in the computing device, perform the following operations: The first similarity and the second similarity between the image to be stored and the historical image are calculated, and the result value is determined as the similarity between the image to be stored and the historical image.

5. The method as described in claim 1, characterized in that, The step of determining whether to store the image to be stored in the computing device based on the user's response to the prompt information includes: Receive the user's response to the prompt message and parse the response message; If the response information indicates that the image to be stored needs to be saved, then the image to be stored is stored in the computing device; If the response information indicates that the image to be stored does not need to be saved, then the image to be stored will not be stored in the computing device.

6. The method as described in claim 1, characterized in that, Before determining the similarity between the image to be stored and each historical image pre-stored in the computing device based on each first similarity and each second similarity, the method further includes: Compare whether any two of the historical images that have been pre-stored in the computing device are the same; If the comparison results are the same, then delete one of the two historical images.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: When the similarity is not greater than a preset similarity threshold, the image to be stored is stored in the computing device.

8. An apparatus for storing images, characterized in that, include: A response unit is used to respond to an image storage request triggered by a user terminal, and to generate a first target feature vector and a second target feature vector based on the image to be stored. The image storage request is generated based on the image to be stored. The first target feature vector is obtained by performing feature extraction on the image to be stored using multi-layer convolution, and the second target feature vector is obtained by performing feature point extraction on the image to be stored using a preset algorithm. A determining unit is configured to determine the similarity between the image to be stored and each historical image pre-stored in a computing device based on each first similarity and each second similarity, wherein the first similarity is determined based on the first target feature vector and the first historical feature vector corresponding to the historical image, and the second similarity is determined based on the second target feature vector and the second historical feature vector corresponding to the historical image; The storage unit is used to send a prompt message to the user terminal when the similarity is greater than a preset similarity threshold, and to determine whether to store the image to be stored in the computing device based on the user terminal's response to the prompt message.

9. A computing device, characterized in that, include: Memory, used to store executable instructions; A processor for reading and executing executable instructions stored in the memory to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor, the processor is able to perform the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Picture duplicate removal method and device and electronic equipment

    CN114529741A

  • Deep learning-based repeated picture detection method and device, equipment and medium

    CN116304141A