ES-based multi-dimensional picture retrieval method, system, device and storage medium
By employing an ES-based multi-dimensional image retrieval method that combines scoring and similarity calculations across multiple dimensions, including title, theme color, and image vectors, the method addresses the low efficiency of single-dimensional retrieval in existing technologies, achieving a highly efficient and accurate image retrieval service.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN COVER MEDIA TECH CO LTD
- Filing Date
- 2023-11-20
- Publication Date
- 2026-07-14
AI Technical Summary
Most existing image retrieval methods rely on a single data dimension, making it difficult to balance performance, effectiveness, and ease of use, and resulting in low retrieval efficiency.
This paper adopts an ES-based multi-dimensional image retrieval method. By obtaining multi-dimensional retrieval information input by the user, it performs preliminary screening, word segmentation, scoring calculation and vector similarity calculation, and comprehensively selects and sorts the results to provide multi-dimensional image retrieval results.
It achieves a balanced hybrid image retrieval in terms of performance, effectiveness, and difficulty, providing fast and accurate image retrieval services and supporting millisecond-level response times for millions of data points.
Smart Images

Figure CN117453939B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information retrieval technology, specifically relating to a multi-dimensional image retrieval method, system, device, and storage medium based on Elasticsearch (ES). Background Technology
[0002] The rapid development of internet technology has generated a massive amount of media asset image data. For the traditional media industry in particular, image asset management is a crucial foundational technology, inseparable from efficient and accurate retrieval support. Currently, there are numerous solutions available for image retrieval, ranging from simple methods based on titles and tags to vector retrieval of the top n images, and more complex methods such as separately trained multimodal hybrid scoring models. However, most of these image retrieval methods operate on a single data dimension, requiring improvement in effectiveness and accuracy. Furthermore, more complex retrieval methods struggle to achieve a balance between performance, effectiveness, and ease of use, resulting in low image retrieval efficiency. Summary of the Invention
[0003] The purpose of this invention is to provide a multi-dimensional image retrieval method, system, device, and storage medium based on Elasticsearch (ES) to solve the aforementioned problems existing in the prior art.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] Firstly, it provides a multi-dimensional image retrieval method based on Elasticsearch, including:
[0006] The system obtains multi-dimensional search information input by the user, including the search title, reference image, several theme color parameters, and the weight value corresponding to each theme color parameter.
[0007] Based on each theme color parameter, all pre-stored images in the ES database are initially screened using the set theme color parameter initial screening range. The pre-screened images are then aggregated to obtain the initial screening set. The pre-stored images are associated with the corresponding text content, theme color dataset, and multi-dimensional image vector data.
[0008] The search title is segmented into words to obtain several search terms;
[0009] Determine the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and calculate the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image;
[0010] Based on each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set, calculate the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter, and calculate the color dimension score of the corresponding pre-stored image based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter.
[0011] Based on the text dimension score and color dimension score of each pre-stored image in the initial screening set, a set number of pre-stored images are selected from the initial screening set to form a pre-selection set;
[0012] Vector features are extracted from the reference image to obtain the corresponding multidimensional vector parameters;
[0013] Based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set, calculate the similarity between the reference image and each pre-stored image in the pre-selection set.
[0014] Based on the similarity between the reference image and each pre-stored image in the pre-selection set, the pre-stored images in the pre-selection set are sorted in ascending order to obtain the result set, and the result set is then visualized and displayed to the user.
[0015] In one possible design, the theme color parameters include target HSV values, the theme color dataset includes multiple theme color data corresponding to pre-stored images and the proportions of each theme color data, the theme color data includes theme color HSV values, and the preliminary screening of all pre-stored images in the ES database based on each theme color parameter and using a set theme color parameter initial screening range includes:
[0016] The target HSV value of each theme color parameter is appended with the set initial screening range of the theme color parameter to obtain the corresponding initial screening conditions for the theme color.
[0017] Iterate through all the pre-stored images in the ES database, select the highest proportion of several theme color data from multiple theme color data of the corresponding pre-stored image as the theme color data to be screened for the corresponding pre-stored image, and compare the theme color HSV value of each theme color data to be screened with the initial screening conditions of each theme color.
[0018] When a pre-stored image has a certain theme color HSV value that meets the initial screening criteria for a certain theme color, the corresponding pre-stored image will be selected.
[0019] In one possible design, the step involves calculating the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter based on each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set. Then, based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter, the step of calculating the color dimension score of the corresponding pre-stored image includes:
[0020] Iterate through each pre-stored image in the initial screening set, and select the highest proportion of several theme color data from multiple theme color data of the corresponding pre-stored image as the theme color data to be evaluated for the corresponding pre-stored image.
[0021] The target HSV value of each theme color parameter is compared with the theme color HSV value of each theme color data to be evaluated in the corresponding pre-stored image. The score of the theme color HSV value of each theme color data to be evaluated relative to the corresponding target HSV value is determined in the three HSV channels. The average score of the three HSV channels is then taken to obtain the HSV score of the theme color HSV value of each theme color data to be evaluated relative to the corresponding target HSV value.
[0022] The average of the HSV scores of each subject color data relative to the corresponding target HSV value is taken to obtain the subject color score of the corresponding pre-stored image relative to the corresponding target HSV value.
[0023] The color dimension score of the corresponding pre-stored image is obtained by weighting the theme color score of the image relative to the target HSV value of each theme color parameter according to the weight value of each theme color parameter.
[0024] In one possible design, the word segmentation of the search title yields several search terms, including:
[0025] The search title is segmented using a pre-configured IK word segmenter to obtain several search terms.
[0026] In one possible design, determining the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and calculating the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image, includes:
[0027] Based on the ES inverted index and relevance scoring, the relevance of each search term to the text content associated with each pre-stored image in the initial screening set is calculated. Then, a weighted average is calculated for the relevance of each search term to the text content associated with the corresponding pre-stored image to obtain the text dimension score of the corresponding pre-stored image.
[0028] In one possible design, the step of selecting a predetermined number of pre-stored images from the initial screening set to form a pre-selection set based on the text dimension score and color dimension score of each pre-stored image in the initial screening set includes:
[0029] The text dimension score and color dimension score of each pre-stored image in the initial screening set are weighted and summed to obtain the comprehensive score of each pre-stored image.
[0030] The images in the initial screening set are sorted in ascending order according to their comprehensive scores, and a set number of images with the highest comprehensive scores are selected to form a pre-selection set.
[0031] In one possible design, calculating the similarity between the reference image and each pre-stored image in the pre-selection set based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set includes:
[0032] Based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set, the Euclidean distance between the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image is calculated, and the similarity between the reference image and each pre-stored image in the pre-selection set is determined based on the Euclidean distance calculation results.
[0033] Secondly, it provides a multi-dimensional image retrieval system based on Elasticsearch, including a collection unit, a filtering unit, a word segmentation unit, a determination unit, a calculation unit, a selection unit, an extraction unit, a comparison unit, and an output unit, wherein:
[0034] The acquisition unit is used to acquire multi-dimensional search information input by the user. The multi-dimensional search information includes the search title, reference image, several theme color parameters, and the weight value corresponding to each theme color parameter.
[0035] The filtering unit is used to perform preliminary filtering on all pre-stored images in the ES database based on each theme color parameter and using a set theme color parameter preliminary filtering range. The pre-stored images that are pre-filtered are summarized to obtain the preliminary filtering set. The pre-stored images are associated with corresponding text content, theme color datasets and multi-dimensional image vector data.
[0036] The word segmentation unit is used to segment the search title into words to obtain several search terms;
[0037] The determination unit is used to determine the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and to calculate the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image.
[0038] The calculation unit is used to calculate the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter based on each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set, and to calculate the color dimension score of the corresponding pre-stored image based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter.
[0039] The selection unit is used to select a set number of pre-stored images from the initial screening set to form a pre-selection set based on the text dimension score and color dimension score of each pre-stored image in the initial screening set.
[0040] The extraction unit is used to extract vector features from the reference image to obtain the corresponding multidimensional vector parameters.
[0041] The comparison unit is used to calculate the similarity between the reference image and each pre-stored image in the pre-selection set based on the multi-dimensional vector parameters of the reference image and the multi-dimensional image vector data of each pre-stored image in the pre-selection set.
[0042] The output unit is used to sort the pre-stored images in the pre-selection set in ascending order based on the similarity between the reference image and each pre-stored image in the pre-selection set, obtain the result set, and visualize the result set to the user.
[0043] Thirdly, it provides multi-dimensional image retrieval devices based on Elasticsearch, including:
[0044] Memory, used to store instructions;
[0045] A processor is configured to read instructions stored in the memory and execute the method described in any one of the first aspects above, according to the instructions.
[0046] Fourthly, a computer-readable storage medium is provided, on which instructions are stored, which, when executed on a computer, cause the computer to perform any of the methods described in the first aspect. A computer program product containing instructions is also provided, which, when executed on a computer, cause the computer to perform any of the methods described in the first aspect.
[0047] Beneficial Effects: This invention performs hybrid image retrieval based on Elasticsearch (ES) by acquiring multi-dimensional search information from users. First, all pre-stored images in the database are initially screened to obtain a preliminary set. Then, each pre-stored image in the preliminary set is scored based on its title and theme color dimensions. The corresponding pre-stored images are then selected to form a pre-selection set. Finally, based on the similarity comparison of reference image vector dimensions, the pre-stored images in the pre-selection set are ranked, and the result set is fed back to the user. This achieves a balanced hybrid image retrieval method in terms of performance, effectiveness, and difficulty, allowing users to find the images they expect. This invention provides a simple and effective hybrid retrieval method, relying on the distributed and easily scalable characteristics of ES, which helps users perform fast and accurate image retrieval. Based on ES, this invention can achieve high-performance hybrid image retrieval across multiple dimensions, including title, theme color, and image vector, achieving millisecond-level response times for millions of data points. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1This is a schematic diagram of the steps in the method of Embodiment 1 of the present invention;
[0050] Figure 2 This is a schematic diagram of the system configuration in Embodiment 2 of the present invention;
[0051] Figure 3 This is a schematic diagram of the device configuration in Embodiment 3 of the present invention. Detailed Implementation
[0052] It should be noted that the descriptions of these embodiments are intended to aid in understanding the invention and do not constitute a limitation thereof. The specific structural and functional details disclosed herein are merely for describing exemplary embodiments of the invention. However, the invention may be embodied in many alternative forms and should not be construed as being limited to the embodiments described herein.
[0053] It should be understood that, unless otherwise explicitly specified and limited, the term "connection" should be interpreted broadly. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments according to the specific circumstances.
[0054] Specific details are provided in the following description to provide a complete understanding of the exemplary embodiments. However, those skilled in the art will understand that the exemplary embodiments can be implemented without these specific details. For example, the system may be shown in block diagrams to avoid obscuring the example with unnecessary details. In other embodiments, well-known processes, structures, and techniques may be shown without non-essential details to avoid obscuring the embodiments.
[0055] Example 1:
[0056] This embodiment provides a multi-dimensional image retrieval method based on Elasticsearch, which can be applied to corresponding image retrieval servers, such as... Figure 1 As shown, the method includes the following steps:
[0057] S1. Obtain multi-dimensional search information input by the user, including search title, reference image, several theme color parameters, and weight values corresponding to each theme color parameter.
[0058] In specific implementation, the multi-dimensional search information input by the user on the front end is first obtained. The multi-dimensional search information includes the search title, reference image, several theme color parameters and the weight values corresponding to each theme color parameter. The theme color parameters include target HSV values (HSV values are a way of representing colors in the HSV color space, composed of three elements: hue (H), saturation (S), and brightness (V)). Each theme color parameter and its corresponding weight value can be comprehensively represented as (H1, S1, V1, weight1), (H2, S2, V2, weight2), (H3, S3, V3, weight3), etc. For example, H1S1V1, H2S2V2, etc. are the target HSV values, and weight1, weight2, etc. are the corresponding weight values.
[0059] S2. Based on each theme color parameter, perform preliminary screening on all pre-stored images in the ES database using the set theme color parameter initial screening range, summarize the pre-screened pre-stored images to obtain the initial screening set, and associate the pre-stored images with the corresponding text content, theme color dataset and multi-dimensional image vector data.
[0060] In practice, after obtaining multi-dimensional search information, multi-dimensional image retrieval can be performed in Elasticsearch (ES). Prior to this, several pre-stored images need to be imported into the ES database. These pre-stored images are associated with corresponding text content, theme color datasets, and multi-dimensional image vector data. The process of importing the pre-stored images includes:
[0061] Text information extraction: Extract the title information inherent in the pre-stored image itself as its text content;
[0062] Vector information extraction: The size of the pre-stored image is preprocessed. While balancing accuracy and efficiency, the size of the pre-stored image is scaled to 512*512. Then, it is input into the vectorization model for vector feature extraction to obtain 256-dimensional image vector information, that is, the multi-dimensional image vector data of the pre-stored image.
[0063] Color information extraction: The size of the pre-stored image is preprocessed. While balancing accuracy and efficiency, the size of the pre-stored image is scaled to 512*512, resulting in 512*512 sample points. Initially, 10 center points are selected. All sample points are traversed, and the sample points are clustered based on their distance from the center points. Then, the center points are updated based on the clustering results, and the distance from the sample points to the new center points is recalculated. This process is repeated until the center points no longer change significantly. The 10 theme color data with the largest proportion in the pre-stored image are selected and converted into theme color HSV values in the HSV color space. The theme color HSV values of the 10 theme color data and their proportions are used as color dimension information, i.e., the theme color dataset of the pre-stored image.
[0064] Each pre-stored image is associated with its corresponding text dimension information, vector dimension information, and color dimension information and stored in the ES database as image media assets for users to search for images.
[0065] When performing multi-dimensional image retrieval, an initial screening is performed in the Elasticsearch database using other constraints (such as the image's tenant, whether the image is published, whether the image has been deleted, etc.) and color data to filter out pre-stored images in the Elasticsearch database that do not meet the criteria. The color filtering logic is as follows:
[0066] By adding the set initial screening range of the theme color parameters to the target HSV values of each theme color parameter, the corresponding initial screening conditions for theme colors are obtained. For example, adding the set initial screening range of theme color parameters to the target HSV values (H1, S1, V1) yields the hue range H1-30.
[0067] Iterate through all the pre-stored images in the ES database, and select the top 5 theme color data with the highest proportion from the multiple theme color data of the corresponding pre-stored image (considering the balance between efficiency and effect, the top 5 theme color data can be selected) as the theme color data to be screened for the corresponding pre-stored image. Then compare the theme color HSV value of each theme color data to be screened with the initial screening conditions of each theme color to determine whether the theme color HSV value of each theme color data to be screened falls within the corresponding HSV range of the initial screening conditions of each theme color.
[0068] When a pre-stored image is determined to have a theme color HSV value that meets a certain theme color initial screening condition, the corresponding pre-stored image is filtered out. That is, for multiple input target HSV values, the filtering process for a single theme color is followed. The relationship between multiple theme colors is "OR". As long as there is a theme color HSV value in the pre-stored image that meets one of the initial screening conditions for multiple input target HSV values, it will not be filtered out.
[0069] S3. Perform word segmentation on the search title to obtain several search terms.
[0070] In practice, the search title can be segmented using the IK segmenter of ES (ElasticSearch) to obtain several search terms.
[0071] S4. Determine the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and calculate the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image.
[0072] In practice, the relevance of each search term to the text content associated with each pre-stored image in the initial screening set can be calculated based on the ES inverted index and relevance scoring. The inverted index uses the search terms in the title as the index and the text content containing the search terms as records. The relevance scoring describes the degree of matching between each search term and its corresponding text content. The ES inverted index can be used to obtain a list of records matching the search terms, and the ES relevance scoring model (BM25 model) can be used to calculate the relevance between the search terms and each text content. Then, a weighted average of the relevance between each search term and the text content associated with the corresponding pre-stored image is calculated to obtain the text dimension score of the corresponding pre-stored image.
[0073] S5. Based on each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set, calculate the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter, and calculate the color dimension score of the corresponding pre-stored image based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter.
[0074] In practice, based on the target HSV values of each theme color parameter, such as (H1, S1, V1), (H2, S2, V2), (H3, S3, V3), etc., the color filtering logic of the initial screening can be used to perform small-scale filtering on each pre-stored image in the initial screening set. For example, the filtering conditions can be selected as the range around 15 for hue (H value) and the range around 10 for saturation (S value) and brightness (V value). Then, the pre-stored images within the small range are scored in terms of color dimension. The specific scoring logic is as follows:
[0075] Iterate through each pre-stored image in the initial screening set, and select the top 5 theme color data with the highest proportion from the multiple theme color data of the corresponding pre-stored image (considering the balance between efficiency and effect, the top 5 theme color data can be selected) as the theme color data to be evaluated for the corresponding pre-stored image.
[0076] The target HSV values for each theme color parameter are compared with the theme color HSV values of each pre-stored theme color data to be evaluated. This determines the score of each theme color HSV value relative to the corresponding target HSV value in the three channels: Hue (H), Saturation (S), and Luminance (V). A decay function can be used for scoring; the closer the theme color HSV value is to the target HSV value, the higher the score. Conversely, the greater the difference between the theme color HSV value and the target HSV value, the lower the score. Then, the average score of the theme color HSV value for each theme color data to be evaluated in the three channels (H, S, and V) is taken to obtain the HSV score of each theme color HSV value relative to the corresponding target HSV value.
[0077] The HSV values of the theme colors of each of the five pre-saved image's theme color data to be evaluated (the HSV scores of the theme color HSV values of the five pre-saved image's theme color data to be evaluated are obtained relative to the corresponding target HSV values in the manner described above) are averaged relative to the corresponding target HSV values to obtain the theme color score of the corresponding pre-saved image relative to the corresponding target HSV value.
[0078] The color dimension score of the corresponding pre-stored image relative to the target HSV value of each theme color parameter is calculated by weighting the weight values of each theme color parameter (i.e., the weight values of weight1, weight2, and weight3 in (H1, S1, V1, weight1), (H2, S2, V2, weight2), and (H3, S3, V3, weight3)) to obtain the color dimension score of the corresponding pre-stored image.
[0079] S6. Based on the text dimension score and color dimension score of each pre-stored image in the initial screening set, select a set number of pre-stored images from the initial screening set to form a pre-selection set.
[0080] In practice, the text dimension scores and color dimension scores of each pre-stored image in the initial screening set are weighted and summed to obtain a comprehensive score for each pre-stored image. Then, the pre-stored images in the initial screening set are sorted in ascending order according to the comprehensive score, and a set number of pre-stored images with the highest comprehensive scores (considering the balance between performance and effect, the top 10,000 comprehensive scores can be selected) are selected to form a pre-selection set.
[0081] S7. Extract vector features from the reference image to obtain the corresponding multidimensional vector parameters.
[0082] In practice, the reference image can be preprocessed and then subjected to vector feature extraction using a corresponding vector processing model to obtain 256-dimensional vector data, i.e., multi-dimensional vector parameters.
[0083] S8. Calculate the similarity between the reference image and each pre-stored image in the pre-selection set based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set.
[0084] In practice, based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set, the Euclidean distance between the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image is calculated. The similarity between the reference image and each pre-stored image in the pre-selection set is determined based on the Euclidean distance calculation result. The smaller the distance, the higher the similarity.
[0085] S9. Based on the similarity between the reference image and each pre-stored image in the pre-selection set, sort the pre-stored images in the pre-selection set in ascending order to obtain the result set, and then visualize the result set to the user.
[0086] In practice, after determining the similarity between the reference image and each pre-stored image in the pre-selection set, the pre-stored images in the pre-selection set can be sorted in ascending order according to the similarity to obtain the result set. Then, the result set is fed back to the front end, and the pre-stored images in ascending order in the result set are displayed to the user in a paginated and visual manner.
[0087] This embodiment provides a simple and effective hybrid retrieval method. Leveraging the distributed and easily scalable characteristics of Elasticsearch (ES), it helps users perform fast and accurate image searches. Based on ES, the method enables high-performance hybrid image retrieval across multiple dimensions, including title, theme color, and image vectors, achieving millisecond-level response times for millions of data points.
[0088] Example 2:
[0089] This embodiment provides a multi-dimensional image retrieval system based on Elasticsearch, such as... Figure 2 As shown, it includes a collection unit, a filtering unit, a word segmentation unit, a determination unit, a calculation unit, a selection unit, an extraction unit, a comparison unit, and an output unit, wherein:
[0090] The acquisition unit is used to acquire multi-dimensional search information input by the user. The multi-dimensional search information includes the search title, reference image, several theme color parameters, and the weight value corresponding to each theme color parameter.
[0091] The filtering unit is used to perform preliminary filtering on all pre-stored images in the ES database based on each theme color parameter and using a set theme color parameter preliminary filtering range. The pre-stored images that are pre-filtered are summarized to obtain the preliminary filtering set. The pre-stored images are associated with corresponding text content, theme color datasets and multi-dimensional image vector data.
[0092] The word segmentation unit is used to segment the search title into words to obtain several search terms;
[0093] The determination unit is used to determine the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and to calculate the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image.
[0094] The calculation unit is used to calculate the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter based on each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set, and to calculate the color dimension score of the corresponding pre-stored image based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter.
[0095] The selection unit is used to select a set number of pre-stored images from the initial screening set to form a pre-selection set based on the text dimension score and color dimension score of each pre-stored image in the initial screening set.
[0096] The extraction unit is used to extract vector features from the reference image to obtain the corresponding multidimensional vector parameters.
[0097] The comparison unit is used to calculate the similarity between the reference image and each pre-stored image in the pre-selection set based on the multi-dimensional vector parameters of the reference image and the multi-dimensional image vector data of each pre-stored image in the pre-selection set.
[0098] The output unit is used to sort the pre-stored images in the pre-selection set in ascending order based on the similarity between the reference image and each pre-stored image in the pre-selection set, obtain the result set, and visualize the result set to the user.
[0099] Example 3:
[0100] This embodiment provides a multi-dimensional image retrieval device based on Elasticsearch, such as... Figure 3 As shown, at the hardware level, it includes:
[0101] The data interface is used to establish data communication between the processor and the data front end;
[0102] Memory, used to store instructions;
[0103] The processor is used to read the instructions stored in the memory and execute the multi-dimensional image retrieval method in Embodiment 1 according to the instructions.
[0104] Optionally, the device also includes an internal bus. The processor, memory, and data interface can be interconnected via the internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0105] The memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0106] Example 4:
[0107] This embodiment provides a computer-readable storage medium storing instructions. When these instructions are executed on a computer, the computer performs the multi-dimensional image retrieval method described in Embodiment 1. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable systems.
[0108] This embodiment also provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the multi-dimensional image retrieval method of Embodiment 1. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system.
[0109] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A multi-dimensional image retrieval method based on Elasticsearch, characterized in that, include: The system obtains multi-dimensional search information input by the user, including the search title, reference image, several theme color parameters, and the weight value corresponding to each theme color parameter. Based on each theme color parameter, a preliminary screening of all pre-stored images in the ES database is performed using a set theme color parameter initial screening range. The pre-screened images are then aggregated to obtain a preliminary screening set. Each pre-stored image is associated with corresponding text content, a theme color dataset, and multidimensional image vector data. The theme color parameters include target HSV values. The theme color dataset includes multiple theme color data points corresponding to the pre-stored images and the proportions of each theme color data point. The theme color data includes theme color HSV values. The preliminary screening of the ES database based on each theme color parameter and the set theme color parameter initial screening range... All pre-stored images are initially screened, including: adding a set initial screening range of theme color parameters to the target HSV values of each theme color parameter to obtain the corresponding initial screening conditions; traversing all pre-stored images in the ES database, selecting the highest proportion of several theme color data from multiple theme color data of the corresponding pre-stored image as the theme color data to be screened for the corresponding pre-stored image, and comparing the theme color HSV value of each theme color data to be screened with each theme color initial screening condition; when a certain theme color HSV value of a corresponding pre-stored image meets a certain theme color initial screening condition, the corresponding pre-stored image is screened out; The search title is segmented into words to obtain several search terms; Determine the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and calculate the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image; Based on each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set, calculate the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter, and calculate the color dimension score of the corresponding pre-stored image based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter. Based on the text dimension score and color dimension score of each pre-stored image in the initial screening set, a set number of pre-stored images are selected from the initial screening set to form a pre-selection set; Vector features are extracted from the reference image to obtain the corresponding multidimensional vector parameters; Based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set, calculate the similarity between the reference image and each pre-stored image in the pre-selection set. Based on the similarity between the reference image and each pre-stored image in the pre-selection set, the pre-stored images in the pre-selection set are sorted in ascending order to obtain the result set, and the result set is then visualized and displayed to the user.
2. The multi-dimensional image retrieval method based on Elasticsearch according to claim 1, characterized in that, The process involves calculating the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter based on the theme color dataset of each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set. Then, based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter, the process also involves calculating the color dimension score of the corresponding pre-stored image, including: Iterate through each pre-stored image in the initial screening set, and select the highest proportion of several theme color data from multiple theme color data of the corresponding pre-stored image as the theme color data to be evaluated for the corresponding pre-stored image. The target HSV value of each theme color parameter is compared with the theme color HSV value of each theme color data to be evaluated in the corresponding pre-stored image. The score of the theme color HSV value of each theme color data to be evaluated relative to the corresponding target HSV value is determined in the three HSV channels. The average score of the three HSV channels is then taken to obtain the HSV score of the theme color HSV value of each theme color data to be evaluated relative to the corresponding target HSV value. The average of the HSV scores of each subject color data relative to the corresponding target HSV value is taken to obtain the subject color score of the corresponding pre-stored image relative to the corresponding target HSV value. The color dimension score of the corresponding pre-stored image is obtained by weighting the theme color score of the image relative to the target HSV value of each theme color parameter according to the weight value of each theme color parameter.
3. The multi-dimensional image retrieval method based on Elasticsearch according to claim 1, characterized in that, The word segmentation of the search title yields several search terms, including: The search title is segmented using a pre-configured IK word segmenter to obtain several search terms.
4. The multi-dimensional image retrieval method based on Elasticsearch according to claim 1, characterized in that, The process of determining the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and calculating the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image, includes: Based on the ES inverted index and relevance scoring, the relevance of each search term to the text content associated with each pre-stored image in the initial screening set is calculated. Then, a weighted average is calculated for the relevance of each search term to the text content associated with the corresponding pre-stored image to obtain the text dimension score of the corresponding pre-stored image.
5. The multi-dimensional image retrieval method based on Elasticsearch according to claim 1, characterized in that, The step of selecting a predetermined number of pre-stored images from the initial screening set based on the text dimension score and color dimension score of each pre-stored image in the initial screening set to form a pre-selection set includes: The text dimension score and color dimension score of each pre-stored image in the initial screening set are weighted and summed to obtain the comprehensive score of each pre-stored image. The images in the initial screening set are sorted in ascending order according to their comprehensive scores, and a set number of images with the highest comprehensive scores are selected to form a pre-selection set.
6. The multi-dimensional image retrieval method based on Elasticsearch according to claim 1, characterized in that, The step of calculating the similarity between the reference image and each pre-stored image in the pre-selection set based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set includes: Based on the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image in the pre-selection set, the Euclidean distance between the multidimensional vector parameters of the reference image and the multidimensional image vector data of each pre-stored image is calculated, and the similarity between the reference image and each pre-stored image in the pre-selection set is determined based on the Euclidean distance calculation results.
7. A multi-dimensional image retrieval system based on Elasticsearch, characterized in that, It includes a collection unit, a filtering unit, a word segmentation unit, a determination unit, a calculation unit, a selection unit, an extraction unit, a comparison unit, and an output unit, wherein: The acquisition unit is used to acquire multi-dimensional search information input by the user. The multi-dimensional search information includes the search title, reference image, several theme color parameters, and the weight value corresponding to each theme color parameter. A filtering unit is used to perform preliminary filtering on all pre-stored images in the ES database based on each theme color parameter and using a set preliminary filtering range of theme color parameters. The pre-stored images are then aggregated to obtain a preliminary set. Each pre-stored image is associated with corresponding text content, a theme color dataset, and multidimensional image vector data. The theme color parameters include target HSV values. The theme color dataset includes multiple theme color data points corresponding to the pre-stored images and the proportions of each theme color data point. The theme color data includes theme color HSV values. The preliminary filtering on all pre-stored images in the ES database is performed based on each theme color parameter and using a set preliminary filtering range of theme color parameters. All pre-stored images in the database undergo preliminary screening, including: attaching a set preliminary screening range of the theme color parameter to the target HSV value of each theme color parameter to obtain the corresponding preliminary screening conditions; traversing all pre-stored images in the ES database, selecting the several theme color data with the highest proportion from multiple theme color data of the corresponding pre-stored image as the theme color data to be screened for the corresponding pre-stored image, and comparing the theme color HSV value of each theme color data to be screened with each theme color preliminary screening condition; when a certain theme color HSV value of a corresponding pre-stored image meets a certain theme color preliminary screening condition, the corresponding pre-stored image is selected; The word segmentation unit is used to segment the search title into words to obtain several search terms; The determination unit is used to determine the relevance of each search term to the text content associated with each pre-stored image in the initial screening set, and to calculate the text dimension score of the corresponding pre-stored image based on the relevance of each search term to the text content associated with the corresponding pre-stored image. The calculation unit is used to calculate the theme color score of each pre-stored image in the initial screening set relative to each theme color parameter based on each theme color parameter and the theme color dataset of each pre-stored image in the initial screening set, and to calculate the color dimension score of the corresponding pre-stored image based on the theme color score of the corresponding pre-stored image relative to each theme color parameter and the weight value corresponding to each theme color parameter. The selection unit is used to select a set number of pre-stored images from the initial screening set to form a pre-selection set based on the text dimension score and color dimension score of each pre-stored image in the initial screening set. The extraction unit is used to extract vector features from the reference image to obtain the corresponding multidimensional vector parameters. The comparison unit is used to calculate the similarity between the reference image and each pre-stored image in the pre-selection set based on the multi-dimensional vector parameters of the reference image and the multi-dimensional image vector data of each pre-stored image in the pre-selection set. The output unit is used to sort the pre-stored images in the pre-selection set in ascending order based on the similarity between the reference image and each pre-stored image in the pre-selection set, obtain the result set, and visualize the result set to the user.
8. A multi-dimensional image retrieval device based on Elasticsearch (ES), characterized in that, The method includes a memory and a processor. The memory is used to store instructions, and the processor is used to read the instructions stored in the memory and execute the multi-dimensional image retrieval method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the multi-dimensional image retrieval method according to any one of claims 1-6.