Picture search processing method and device based on vectorization and terminal

Through the application of vectorized processing and deep learning models, the problem of inefficient image search in the existing technology is solved, and fast and accurate image search is achieved, which is suitable for the search needs of different types of images.

CN120086403APending Publication Date: 2025-06-03SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510140343.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The prior art is inefficient in processing large-scale image data and is difficult to adapt to the search needs of different types of images.

Method used

A vectorized image search processing method is used to extract and store images in a vectorized manner by pre-using deep learning models, and a similarity calculation algorithm is used to quickly find similar images.

Benefits of technology

It improves image search efficiency, can adapt to the search needs of different types of images, and provides fast and accurate image search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086403A_ABST
    Figure CN120086403A_ABST
Patent Text Reader

Abstract

The invention discloses a vectorization-based picture search processing method and device and a terminal, and the method comprises the steps: inputting a to-be-queried picture, and converting the to-be-queried picture into a query vector; calculating the similarity between the query vector and a vector of each picture pre-stored in a preset vector database by using a similarity calculation algorithm; and sorting the query results according to the similarity scores, and returning and outputting the pictures of which the similarity with the to-be-queried picture reaches a preset value. According to the method, the picture searching efficiency can be improved, the searching requirements of different types of pictures can be met, and convenience is provided for use of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent terminals, and particularly to a vector-based picture search processing method, device, intelligent terminal and storage medium. Background Art

[0002] With the development of terminal technology and the continuous improvement of people's living standards, the use of various intelligent terminals has become more and more popular.

[0003] With the development of Internet technology, the amount of picture data has increased sharply. The traditional picture search method based on feature extraction in the prior art is inefficient in processing large-scale data and difficult to meet the search requirements for different types of pictures.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a vector-based picture search processing method, device, intelligent terminal and storage medium in view of the problems and defects of the above-mentioned prior art. The present invention can improve the picture search efficiency, meet the search requirements for different types of pictures, and provide convenience for users.

[0006] The technical solution adopted by the present invention to solve the problem is as follows:

[0007] A vector-based picture search processing method, including:

[0008] Input a picture to be queried, and convert the picture to be queried into a query vector;

[0009] Use a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each picture pre-stored in a preset vector database;

[0010] Sort the query results according to the similarity scores, and return and output the pictures whose similarity to the picture to be queried reaches a predetermined value.

[0011] In the above-mentioned vector-based picture search processing method, before the step of inputting a picture to be queried and converting the picture to be queried into a query vector, it includes:

[0012] Previously use a pre-trained deep learning model to extract features from each picture;

[0013] Convert the features extracted from each picture into a vector representation with a fixed length, and store the vectors of each picture in the vector database.

[0014] In the above-mentioned vector-based picture search processing method, before the step of inputting a picture to be queried and converting the picture to be queried into a query vector, it includes:

[0015] Input the image to be searched and preprocess the image to be searched;

[0016] Use a pre-trained deep learning model to extract features from the preprocessed image to be searched;

[0017] Convert the features extracted from each image into query vectors of a fixed length;

[0018] And store the query vectors of each image in a vector database.

[0019] The vector-based image search processing method described above, wherein the step of inputting the image to be queried and converting the image to be queried into a query vector includes;

[0020] Input the image to be queried and preprocess the image to be queried;

[0021] Use a pre-trained deep learning model to extract features from the preprocessed image to be queried, and convert the features extracted from the image to be queried into a query vector.

[0022] The vector-based image search processing method described above, wherein the query efficiency of the database is optimized by controlling the use of a data structure of a KD tree or a ball tree.

[0023] The vector-based image search processing method described above, wherein the step of using a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each image pre-stored in a preset vector database includes:

[0024] Use the cosine similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each image pre-stored in a preset vector database.

[0025] The vector-based image search processing method described above, wherein the step of sorting the query results according to the similarity score, returning and outputting the images whose similarity to the image to be queried reaches a predetermined value includes:

[0026] Sort the query results according to the similarity score;

[0027] Return and output the top N results with the highest similarity to the image to be queried.

[0028] A vector-based image search processing device, wherein the device includes:

[0029] An image input module to be searched, configured to control the input of the image to be searched and preprocess the image to be searched;

[0030] A feature extraction module, configured to use a pre-trained deep learning model to extract features from the preprocessed image to be searched.

[0031] A query vector conversion and storage module, configured to convert the features extracted from each image into query vectors of a fixed length, and store the query vectors of each image in a vector database.

[0032] An input and conversion module for the image to be queried, configured to input the image to be queried and convert the image to be queried into a query vector.

[0033] A similarity calculation module, configured to use a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each image pre-stored in a preset vector database.

[0034] A query result output module, configured to sort the query results according to the similarity scores, and return and output the images whose similarity to the image to be queried reaches a predetermined value.

[0035] An intelligent terminal, including a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs include those for executing the method described in any one of the above.

[0036] A computer-readable storage medium, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in any one of the above.

[0037] Advantages of the present invention: The present invention provides a vector-based image search processing method, device, intelligent terminal and storage medium. The present invention provides a general method for vector-based image search. This method converts images into vector representations and uses machine learning techniques to calculate the similarity of vectors, realizing fast and accurate image search. This method is applicable to various types of image search tasks, including but not limited to image recognition, similar image search, copyright detection, etc., providing convenience for users. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0039] Figure 1 It is a schematic flowchart of a vector-based image search processing method provided in Embodiment 1 of the present invention.

[0040] Figure 2 It is a schematic flowchart of the vector-based image search processing method provided in Embodiment 2 of the present invention.

[0041] Figure 3 The principle block diagram of the vector-based image search processing device embodiment provided by the present invention.

[0042] Figure 4 It is the internal structure principle block diagram of the intelligent terminal provided by the embodiment of the present invention. Detailed implementation manners

[0043] To make the objectives, technical solutions and advantages of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.

[0044] It should be noted that if there are directional indications (such as up, down, left, right, front, back,...) involved in the embodiments of the present invention, the directional indications are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the drawings). If the specific posture changes, the directional indications will also change accordingly.

[0045] To implement vector-based image search, it is necessary to convert the images into high-dimensional vector representations through a deep learning model, and then use machine learning algorithms, such as cosine similarity, to calculate the similarity between different image vectors. Finally, according to the similarity scores, return the image results that are most similar to the query image. The present invention provides a vector-based image search processing method.

[0046] As Figure 1 shown, a vector-based image search processing method according to Embodiment 1 of the present invention includes the following steps:

[0047] Step S100: Pre-use a pre-trained deep learning model to extract features from each image; convert the features extracted from each image into a vector representation with a fixed length, and store the vectors of each image in a vector database;

[0048] In the embodiments of the present invention, before specific implementation, a deep learning model can be used to extract features from each image, so as to convert it into a vector representation with a fixed length, and finally store these vectors in a vector database.

[0049] Specifically, the pre-trained deep learning model in the present invention refers to a deep learning model trained on a large-scale dataset (such as ImageNet). These models have learned a lot of general feature representations and are very suitable for feature extraction.

[0050] The pre-trained models in the embodiments of the present invention include CNN, VGG, ResNet, Inception, etc.

[0051] Among them, CNN is a convolutional neural network: CNN is a deep learning model mainly used for image processing and vision tasks. It extracts image features through convolutional layers and is suitable for processing data with a grid structure. VGG is the Visual Geometry Group network, and ResNet is the Residual network.

[0052] In the embodiments of the present invention, for each picture, the first few layers (usually convolutional layers) of these pre-trained models are used to extract features. The result of feature extraction usually forms a high-dimensional feature vector, such as a 2048-dimensional vector.

[0053] Among them, regarding the conversion to a fixed-length vector representation, since pictures of different sizes and proportions will result in different dimensions of the extracted features, the present invention can convert the extracted features into vectors of the same length through techniques such as fully connected layers or pooling layers, which is convenient for subsequent processing.

[0054] In the embodiments of the present invention, these fixed-length feature vectors will be stored in a vector database, making subsequent retrieval and similarity calculation tasks more efficient.

[0055] For example, taking a series of pictures of cats and dogs as an example, first, the present invention applies the pre-trained ResNet model to extract the features of each picture.

[0056] For a picture of a cat, the extracted features may be a 2048-dimensional vector: [0.12, -0.34, 0.56,...].

[0057] Then, these feature vectors are stored in a vector database (such as Faiss or Milvus) for subsequent retrieval.

[0058] The advantages of doing so are that using pre-trained models can quickly extract features without having to train the model from scratch, saving time and computing resources. The knowledge obtained by the pre-trained models of the present invention on large datasets can be applied to different image recognition tasks, enhancing the generalization ability of the models. And storing the feature vectors in the database by the present invention can quickly achieve similarity retrieval, supporting applications such as image search. Moreover, through feature extraction, the high-dimensional information of image data is compressed into low-dimensional feature vectors, which not only reduces the storage space but also improves the computing efficiency.

[0059] Step S200: Input the picture to be queried and convert the picture to be queried into a query vector;

[0060] In the embodiments of the present invention, when it is necessary to search for a picture, the picture to be queried is input, that is, in the embodiments of the present invention, when the user inputs a picture that he hopes to query. This picture can be any type of image, such as a face photo, a landscape photo or any other target image.

[0061] Then, the picture to be queried is converted into a query vector. That is, once the user uploads the picture to be queried, the present invention will use the aforementioned pre-trained deep learning models (such as CNN, VGG, ResNet, etc.) to extract features from this picture. This process encodes the information in the picture into a fixed-length feature vector, usually a high-dimensional array. For example, for a landscape picture, after feature extraction, a 2048-dimensional feature vector may be obtained, and this vector represents the important features of the picture.

[0062] For example, when the user hopes to find a picture similar to a landscape photo in his mobile phone, in the specific implementation of the embodiments of the present invention, the user uploads a landscape photo of mountains and waters, and the present invention uses the pre-trained ResNet model to extract features from this picture. The generated query vector may be: [0.23, -0.56, 0.78,...] (2048 elements). This query vector will be used in the subsequent steps to compare with the feature vectors of other pictures already stored in the database to find similar pictures.

[0063] The advantage of this step is that after converting the picture into a feature vector, the query process becomes more efficient. Vector operations (such as cosine similarity or Euclidean distance) are faster than directly processing images and can more easily calculate similarity. The original image is usually high-dimensional data (such as millions of pixels), while the feature vector condenses this information into a fixed-size array, saving storage space and accelerating the processing speed.

[0064] Moreover, the feature vector of the present invention can extract the key features of the image without being affected by image deformation, illumination change or background interference. This makes the retrieval process more robust and can find images with similar content. And once multiple pictures are all converted into feature vectors, it is convenient for batch retrieval and analysis, and can be quickly extended to tens of thousands of pictures.

[0065] Step S300: Use a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each picture pre-stored in the preset vector database;

[0066] Among them, the similarity calculation algorithm is a method for evaluating the similarity degree between two vectors. In the embodiments of the present invention, the adopted similarity calculation methods include cosine similarity, Euclidean distance, Manhattan distance, etc. These algorithms can help determine the similarity between the query vector (that is, the picture features to be queried) and the feature vectors of other pictures in the database.

[0067] In the embodiments of the present invention, a similarity calculation algorithm is used to calculate the similarity between the query vector and each picture vector in the database. Specifically, when the similarity calculation algorithm is selected, the present invention calculates the similarity between the query vector and each stored feature vector in the database one by one. For example, each vector in the database can be traversed and compared with the query vector, and its similarity score can be recorded.

[0068] For example, when a user inputs a photo of a cat, after feature extraction, a query vector is obtained: [0.5, -0.2, 0.8,...]. This vector will be compared with multiple picture vectors in the database:

[0069] Regarding the example of feature vectors: There are feature vectors of three pictures in the database:

[0070] Picture A (another cat): [0.52, -0.1, 0.75,...];

[0071] Picture B (a photo of a dog): [0.1, -0.6, 0.2,...];

[0072] Picture C (a landscape photo): [0.3, 0.4, -0.1,...];

[0073] Calculating similarity: The present invention uses cosine similarity to calculate the similarity between the query vector and each database vector:

[0074] For Picture A, the calculated similarity is 0.95 (very high);

[0075] For Picture B, the calculated similarity is 0.2 (relatively low);

[0076] For Picture C, the calculated similarity is 0.1 (the lowest);

[0077] Result sorting: According to the calculated similarity scores, the present invention will rank Picture A at the top of the query results because it has the highest similarity with the query vector.

[0078] In this way, the present invention using the similarity calculation algorithm can ensure that the returned results are highly relevant to the user's query, achieve precise matching, and thus provide a better user experience. And the present invention can use efficient algorithms to quickly find vectors similar to the query vector through vectorized storage and similarity calculation, especially significantly improving the retrieval speed in a large database. Moreover, the present invention can select different similarity calculation algorithms according to specific application requirements, enabling the system to flexibly handle various query situations.

[0079] Furthermore, due to the high-dimensional data compression in the feature vector extraction process, the present invention can effectively reduce the influence of background noise and variations on the similarity calculation, improving the stability and accuracy of retrieval.

[0080] Step S400: Sort the query results according to the similarity scores, and return and output the pictures whose similarity to the picture to be queried reaches a predetermined value.

[0081] In the embodiment of the present invention, after calculating the similarity between the query vector and each picture vector in the database, these similarity scores will be sorted. By default, they are sorted from high to low to ensure that the most similar pictures are ranked at the front.

[0082] Through the sorting mechanism, it is ensured that the user can see the content most relevant to their query first, thus saving the user's time when browsing the results.

[0083] The present invention will return and output the pictures that meet the predetermined value. Specifically, a similarity threshold (such as 0.7) can be set during implementation. Only those pictures whose similarity to the query picture reaches or exceeds this threshold (for example, 0.7) will be selected and returned to the user.

[0084] This step can effectively eliminate irrelevant results, improving the retrieval efficiency and the relevance of the results.

[0085] For example, when the user uploads a landscape photo, after a series of processes, the following similarity scores are calculated:

[0086] Picture A (Landscape Photo 1): 0.85;

[0087] Picture B (Landscape Photo 2): 0.75;

[0088] Picture C (Landscape Photo 3): 0.60;

[0089] Picture D (City Photo): 0.52;

[0090] Picture E (Landscape Photo 4): 0.90;

[0091] Sorting:

[0092] The present invention will sort these similarity scores to obtain the following order:

[0093] Picture E: 0.90;

[0094] Picture A: 0.85;

[0095] Picture B: 0.75;

[0096] Picture C: 0.60;

[0097] Picture D: 0.52;

[0098] Then, threshold screening is performed: when the set similarity threshold is 0.70, the embodiments of the present invention will screen out the pictures that meet the requirements according to this threshold:

[0099] Pictures E, A, and B are returned. Pictures C and D are excluded because their similarities do not reach the threshold.

[0100] In this way, the embodiments of the present invention have the following advantages:

[0101] 1) The result relevance is improved: through sorting and threshold screening, the images finally obtained by the user are all pictures with high relevance to the query, significantly improving the quality of retrieval.

[0102] 2) The user experience can be optimized: enabling the user to quickly find the images of interest, simplifying the browsing process, and enhancing the friendliness of the system.

[0103] 3) Low-quality results are filtered: setting the similarity threshold can effectively avoid irrelevant or low-quality query results, reducing the user's trouble and time waste.

[0104] 4) The retrieval efficiency is enhanced: the sorting mechanism of the present invention enables the retrieval to quickly respond to the user's request, rather than displaying a large number of potentially irrelevant results for a long time.

[0105] Through the above steps, the user can not only obtain high-relevance image results, but also the entire retrieval process is more efficient and accurate.

[0106] In another embodiment of the present invention, as Figure 2 shown, the vector-based picture search processing method includes the following steps:

[0107] S10. Start; enter step S11;

[0108] S11. Input the picture to be searched and enter S12;

[0109] S12. Preprocess the picture; that is, preprocess the picture to be searched; and enter step S13;

[0110] S13. Use a deep learning model for feature extraction;

[0111] That is, in this step, use the pre-trained deep learning model to perform feature extraction on the preprocessed picture to be searched, and then enter step S14;

[0112] S14. Convert the features into vector representations, that is, in this step, convert the features extracted from each picture into a query vector with a fixed length; then enter step S15;

[0113] In the embodiments of the present invention, the picture is subjected to feature extraction, and the feature extraction uses a deep learning model (such as a convolutional neural network, CNN) to automatically identify and extract important features in the image. These features can be edges, textures, shapes, etc.

[0114] Then, the extracted features are converted into a feature vector with a fixed length. In the embodiments of the present invention, a deep learning model outputs a multi-dimensional array or tensor, which contains a large amount of feature information. For the convenience of subsequent processing, these features need to be converted into a vector with a fixed length.

[0115] For example, the last fully connected layer of the CNN model in the present invention will compress the input multi-dimensional features into a vector with a length of 2048. Regardless of the size or complexity of the input image, the output feature vector is fixed.

[0116] In the embodiments of the present invention, the feature vector is also normalized to ensure that its value is within a certain range (for example, between 0 and 1), which helps to improve the effect of subsequent calculations (such as similarity calculation).

[0117] For example, when processing a picture of a dog, the steps are as follows:

[0118] Original image: A color photo containing a dog, with a size of 256x256 pixels.

[0119] Feature extraction: Use a pre-trained ResNet model to perform feature extraction on the image, and output a multi-dimensional feature representation.

[0120] Fixed-length vector: The last layer of the model compresses the extracted features into a vector with a length of 2048. For example: Feature vector: [0.1, -0.2, 0.15,..., 0.7] / / A total of 2048 elements.

[0121] In the embodiments of the present invention, regardless of how the input dog photo changes (for example, different angles, lighting conditions, etc.), the output feature vector remains fixed in length (2048 dimensions), which makes subsequent calculations and comparisons more convenient.

[0122] S15. Store the vector in the vector database, that is, in the present invention, the query vectors of each picture will be stored in the vector database, and then enter step S16;

[0123] In this step, the query efficiency of the database can be optimized by controlling the use of the data structure of KD-tree or ball-tree;

[0124] S16. Input a query picture and enter step S17;

[0125] S17. Preprocess the query picture and then enter step S18;

[0126] In the present invention, the to-be-query image input by the user is received, and the to-be-query image is preprocessed;

[0127] S18. Use the same deep learning model CNN to extract features from the image; that is, use the pre-trained deep learning model to extract features from the preprocessed to-be-query image, and proceed to step S19;

[0128] S19. Convert the features extracted from the to-be-query image into a query vector; and proceed to S20;

[0129] That is, in the embodiment of the present invention, for the query image, the processes of image feature extraction and vector conversion are repeated to obtain its vector representation.

[0130] S20. Calculate the similarity between the query vector and the data vector; in this step of the embodiment, the cosine similarity calculation algorithm can be used to calculate the similarity between the query vector and the vectors of each image pre-stored in the preset vector database; then proceed to step S21;

[0131] In the embodiment of the present invention, the cosine similarity calculation method is adopted to characterize the similarity by calculating the cosine value of the included angle between two vectors, and the value range is between -1 and 1. The closer the value is to 1, the more similar the two are. For example, when there is a query vector Q and a vector D in the database, the calculation formula of the cosine similarity is:

[0132]

[0133] where, · represents the dot product of vectors, and ∥Q∥ and ∥D∥ are the norms (or lengths) of the vectors; after the calculation is completed, a similarity score will be obtained for the subsequent sorting and screening of query results.

[0134] For example, when the user queries a photo of a cat, in the embodiment of the present invention, the feature vector Q has been extracted from this photo, as follows:

[0135] Query vector Q: [0.5, 0.6, 0.7];

[0136] And there are the feature vectors of several images in the database, as follows:

[0137] Vector D1 of picture A: [0.4, 0.8, 0.5];

[0138] Vector D2 of picture B: [0.1, 0.2, 0.3];

[0139] Vector D3 of picture C: [0.5, 0.5, 0.5];

[0140] Then, in the embodiment of the present invention, calculate the cosine similarity between the query vector Q and each picture vector:

[0141] 1) Calculate the similarity of Picture A:

[0142]

[0143] The score calculated for Picture A is, for example, 0.90.

[0144] 2) Calculate the similarity of Picture B:

[0145]

[0146] The score calculated for Picture B is, for example, 0.25.

[0147] 3) Calculate the similarity of Picture C:

[0148]

[0149] The score calculated for Picture B is, for example, 0.80.

[0150] Thus, through the similarity calculation of the present invention, it is obtained that:

[0151] The similarity of Picture A is 0.90,

[0152] The similarity of Picture B is 0.25,

[0153] The similarity of Picture C is 0.80.

[0154] Thus, through fast and effective similarity calculation, the present invention can obtain highly relevant retrieval results in a short time, improving the response speed of the system and user satisfaction. Through the above steps, the present invention can accurately and efficiently identify and return the picture content most relevant to the user query during image retrieval.

[0155] S21. Sort the query results according to the similarity scores; and proceed to step S22;

[0156] For example, as described in the above embodiment, the sorting is in turn: the similarity of Picture A is 0.90, the similarity of Picture C is 0.80, and the similarity of Picture B is 0.25;

[0157] S22. Return the most similar picture query results. For example, the top N results with the highest similarity to the picture to be queried can be returned and output, and proceed to step S23;

[0158] For example, as described in the above embodiment, when the similarity threshold is set to 0.7, the most similar picture query results returned are Picture A with a similarity of 0.90 and Picture C with a similarity of 0.80.

[0159] S23. End.

[0160] Exemplary device

[0161] As shown Figure 3 in the figure, an embodiment of the present invention provides a vector-based picture search processing device, which includes:

[0162] A to-be-searched picture input module 310, configured to control the input of the to-be-searched picture and preprocess the to-be-searched picture;

[0163] A feature extraction module 320, configured to use a pre-trained deep learning model to extract features from the preprocessed to-be-searched picture;

[0164] A query vector conversion and storage module 330, configured to convert the features extracted from each picture into a query vector with a fixed length; and store the query vectors of each picture in a vector database;

[0165] A to-be-query picture input and conversion module 340, configured to input the to-be-query picture and convert the to-be-query picture into a query vector;

[0166] A similarity calculation module 350, configured to use a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each picture pre-stored in a preset vector database;

[0167] A query result output module 360, configured to sort the query results according to the similarity scores, and return and output the pictures whose similarity to the to-be-query picture reaches a predetermined value, as specifically described above.

[0168] Based on the above embodiments, the present invention further provides an intelligent terminal, and its principle block diagram can be as Figure 4 shown. The intelligent terminal includes a processor, a memory, a network interface, a display screen, and a database connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a vector-based picture search processing method. The database of the intelligent terminal is used to store a vector-based picture search processing program.

[0169] Those skilled in the art can understand that Figure 4 the principle block diagram shown only shows the block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the intelligent terminal to which the solution of the present invention is applied. The specific intelligent terminal may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0170] In one embodiment, an intelligent terminal is provided, including a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:

[0171] Input the picture to be queried, and convert the picture to be queried into a query vector;

[0172] Use a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each picture pre-stored in the preset vector database;

[0173] Sort the query results according to the similarity scores, and return and output the pictures whose similarity to the picture to be queried reaches a predetermined value, as described above.

[0174] Among them, before the step of inputting the picture to be queried and converting the picture to be queried into a query vector, the following steps are included:

[0175] Previously use a pre-trained deep learning model to extract features from each picture;

[0176] Convert the features extracted from each picture into a vector representation of a fixed length, and store the vectors of each picture in the vector database.

[0177] Among them, before the step of inputting the picture to be queried and converting the picture to be queried into a query vector, the following steps are included:

[0178] Input the picture to be searched, and preprocess the picture to be searched;

[0179] Use a pre-trained deep learning model to extract features from the preprocessed picture to be searched;

[0180] Convert the features extracted from each picture into a query vector of a fixed length;

[0181] And store the query vectors of each picture in the vector database.

[0182] Among them, the step of inputting the picture to be queried and converting the picture to be queried into a query vector includes;

[0183] Input the picture to be queried, and preprocess the picture to be queried;

[0184] Use a pre-trained deep learning model to extract features from the preprocessed picture to be queried, and convert the features extracted from the picture to be queried into a query vector.

[0185] Among them, control the use of a data structure such as a KD tree or a ball tree to optimize the query efficiency of the database.

[0186] Among them, the step of using a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each pre-stored picture in a preset vector database includes:

[0187] Using a cosine similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each pre-stored picture in a preset vector database.

[0188] Among them, the step of sorting the query results according to the similarity scores, and returning and outputting the pictures whose similarity to the picture to be queried reaches a predetermined value includes:

[0189] Sorting the query results according to the similarity scores;

[0190] Returning and outputting the top N results with the highest similarity to the picture to be queried, as specifically described above.

[0191] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided by the present invention can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0192] In summary, the present invention provides a vector-based picture search processing method, device, intelligent terminal, and storage medium. The present invention provides a general method for vector-based picture search. This method converts pictures into vector representations and uses machine learning techniques to calculate the similarity of vectors, realizing fast and accurate picture search. This method is applicable to various types of picture search tasks, including but not limited to image recognition, similar picture search, copyright detection, etc., providing convenience for users.

Claims

1. A vectorized image search processing method, characterized in that: include: Input the image to be queried and convert it into a query vector; Using a similarity calculation algorithm, calculate the similarity between the query vector and the vectors of each image pre-stored in a preset vector database; The query results are sorted according to the similarity scores, and the pictures whose similarity with the query picture reaches a predetermined value are returned and output.

2. The vectorized image search processing method according to claim 1, characterized in that: The step of inputting the image to be queried and converting the image to be queried into a query vector includes: Use the pre-trained deep learning model to extract features from each image in advance; The features extracted from each image are converted into a vector representation of a fixed length, and the vector of each image is stored in a vector database.

3. The vectorized image search processing method according to claim 1, characterized in that: The step of inputting the image to be queried and converting the image to be queried into a query vector includes: Input the image to be searched and pre-process the image to be searched; Use the pre-trained deep learning model to extract features from the pre-processed images to be searched; Convert the features extracted from each image into a query vector of fixed length; And the query vector of each image is stored in the vector database.

4. The vectorized image search processing method according to claim 1, characterized in that: The step of inputting a picture to be queried and converting the picture to be queried into a query vector comprises: Input the image to be queried and preprocess the image to be queried; The pre-processed query image is used to extract features using a pre-trained deep learning model, and the features extracted from the query image are converted into a query vector.

5. The vectorized image search processing method according to claim 2, characterized in that: Control the use of KD tree or ball tree data structure to optimize database query efficiency.

6. The vectorized image search processing method according to claim 1, characterized in that: The step of using a similarity calculation algorithm to calculate the similarity between the query vector and the vectors of each picture pre-stored in a preset vector database includes: The cosine similarity calculation algorithm is used to calculate the similarity between the query vector and the vectors of each picture pre-stored in a preset vector database.

7. The vectorized image search processing method according to claim 1, characterized in that: The step of sorting the query results according to the similarity scores and returning and outputting pictures whose similarity with the picture to be queried reaches a predetermined value comprises: Sort query results based on similarity scores; Return and output the top N results with the highest similarity to the query image, where N is a positive integer greater than 1.

8. A vectorized image search processing device, characterized in that: The device comprises: The image input module to be searched is used to control the input of the image to be searched and pre-process the image to be searched; The feature extraction module is used to extract features from the pre-processed images to be searched using a pre-trained deep learning model; A query vector conversion and storage module is used to convert the features extracted from each image into a query vector of fixed length; and store the query vector of each image in a vector database; The query image input and conversion module is used to input the query image and convert the query image into a query vector; A similarity calculation module, used to calculate the similarity between the query vector and the vectors of each picture pre-stored in a preset vector database using a similarity calculation algorithm; The query result output module is used to sort the query results according to the similarity score, return and output the pictures whose similarity with the query picture reaches a predetermined value.

9. An intelligent terminal, characterized in that: The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include being used to execute the method according to 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 a processor of an electronic device, the electronic device is enabled to execute the method as described in any one of claims 1 to 7.