Image search method, device, equipment and storage medium
By determining local area images in image search and performing feature extraction and classification processing, the problem of background influence in image search is solved, the search accuracy and efficiency are improved, and the robustness of the algorithm is enhanced.
Patent Information
- Application Number
- CN202111440175.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In the prior art, non-target search objects such as image backgrounds have an impact on the search results during the image search process, resulting in problems of low search accuracy and low search efficiency.
By obtaining preset search images, target classification model and preset classification thresholds, multiple local area images are determined, feature extraction and classification processing are performed, target feature vectors are obtained, and background information is ignored to improve search accuracy and efficiency.
It improves the accuracy and efficiency of image search, enhances the robustness of the algorithm, can ignore noise data such as viewing angles, and enhances the determination accuracy of feature vectors.
Smart Images

Figure CN114154008B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image search technology, and in particular to an image search method, device, equipment and storage medium. Background Art
[0002] With the development of science and technology, images play a great role in e-commerce and information dissemination. Since images can give people a "what you see is what you get" feeling, the way users obtain product information has changed from the original text-based search to image-based search. Generally speaking, image search is divided into similarity search and same-style search (the so-called same-style search refers to searching for product images with the same style as the image to be searched). The development of deep learning feature vectors has improved the feature description ability of images, and image similarity search has met the user's usage requirements. However, in the current image search and matching process, non-target search objects such as background, lighting, and angle in the image will affect the search results. Summary of the invention
[0003] The technical problem to be solved by the present invention is that in the prior art, during the image search process, non-target search objects such as image background affect the search results, resulting in low search accuracy and low search efficiency.
[0004] According to one aspect of the present application, an image search method is disclosed, the method comprising:
[0005] Acquire a preset search image, a target classification model, and a preset classification threshold, wherein the target classification model corresponds to the preset search image;
[0006] Determining a plurality of local area images according to the preset search image, wherein the local area images include a preset search object;
[0007] Extract features from each local area image to obtain feature vectors corresponding to each of the multiple local area images;
[0008] Inputting the feature vectors corresponding to the plurality of local region images into the target classification model for classification processing, and determining the classification result corresponding to each local feature vector;
[0009] Determine the local feature vector whose classification result reaches the preset classification threshold as the target feature vector;
[0010] An image search is performed according to the target feature vector to obtain an image set including the preset search object.
[0011] In a possible implementation, determining a plurality of local area images according to the preset search image includes:
[0012] Randomly dividing the preset search image to randomly determine an area having a first size;
[0013] The image corresponding to the area of the first size is processed for resolution change to obtain a plurality of local area images with different resolutions.
[0014] In another possible implementation, determining a plurality of local area images according to the preset search image includes:
[0015] Randomly dividing the preset search image multiple times to randomly determine multiple areas with a first size;
[0016] An image corresponding to each region having the first size is determined as a local region image to obtain a plurality of local region images.
[0017] Furthermore, the step of extracting features from each local area image to obtain feature vectors corresponding to each of the multiple local area images includes:
[0018] Based on the full convolutional network, features are extracted for each local area image to obtain feature vectors corresponding to multiple local area images.
[0019] Furthermore, before obtaining the target classification model, the method further includes:
[0020] Determine a plurality of preset training images according to the preset search image, each preset training image including the preset search object;
[0021] The plurality of preset training images are trained to obtain the target classification model.
[0022] Further, the determining a plurality of preset training images according to the preset search image comprises:
[0023] Randomly dividing the preset search image multiple times to randomly determine a plurality of regions having a second size;
[0024] An image corresponding to each region having the second size is determined as a preset training image to obtain the plurality of preset training images.
[0025] Furthermore, performing image search according to the target feature vector to obtain an image set including the preset search object includes:
[0026] Performing dimensionality reduction processing on the target feature vector to obtain a target search feature vector after dimensionality reduction;
[0027] An image search is performed according to the target search feature vector to obtain an image set including the preset search object.
[0028] According to another aspect of the present application, an image search device is also disclosed, the device comprising:
[0029] An acquisition module, used to acquire a preset search image, a target classification model and a preset classification threshold, wherein the target classification model corresponds to the preset search image;
[0030] A local area image determination module, used to determine a plurality of local area images according to the preset search image, wherein the local area images include preset search objects;
[0031] A feature vector determination module is used to extract features from each local area image to obtain feature vectors corresponding to each of the multiple local area images;
[0032] A classification result determination module, used for inputting the feature vectors corresponding to each of the plurality of local area images into the target classification model for classification processing, and determining the classification result corresponding to each local feature vector;
[0033] A target feature vector determination module, used to determine the local feature vector whose classification result reaches the preset classification threshold as the target feature vector;
[0034] The image set determination module is used to perform image search according to the target feature vector to obtain an image set including the preset search object.
[0035] According to another aspect of the present application, an electronic device is also disclosed, including:
[0036] processor;
[0037] a memory for storing instructions executable by the processor;
[0038] The processor is configured to execute the instructions to implement the image search method as described in the above claims.
[0039] According to another aspect of the present application, a computer-readable storage medium is also disclosed, characterized in that when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the image search method as described in the above claims.
[0040] The method of the present invention comprises obtaining a preset search image, a target classification model and a preset classification threshold, determining multiple local area images according to the preset search image, the local area images including the preset search object; extracting features from each local area image to obtain feature vectors corresponding to each of the multiple local area images; inputting the feature vectors corresponding to each of the multiple local area images into the target classification model for classification processing to determine the classification result corresponding to each local feature vector; determining the local feature vector whose classification result reaches the preset classification threshold as the target feature vector; obtaining multiple local area images by processing the preset search image, the number of local area images can be increased, the amount of information of the preset search object can be increased, and thus the determination accuracy of the target feature vector corresponding to the preset search object can be improved. Further, image search is performed according to the target feature vector to obtain an image set including the preset search object. The present invention performs image search based on the target feature vector. Since the target classification model corresponds to the preset search image, the determined target feature vector can be used as the key feature information of the preset search object, so that the present invention can determine the image with the target object based only on the target feature vector, and the influence of background information in the search image on the search result can be ignored, thereby improving the image search accuracy and search efficiency. Furthermore, the present invention can also ignore noise data such as viewing angle, thereby improving the robustness of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 is a flow chart of an image search method provided by an embodiment of the present application;
[0043] Figure 2 is a flowchart of another image search method provided in an embodiment of the present application;
[0044] Figure 3 is a flowchart of another image search method provided in an embodiment of the present application;
[0045] Figure 4 is a flowchart of another image search method provided in an embodiment of the present application;
[0046] Figure 5 is a structural block diagram of an image search device provided in an embodiment of the present application;
[0047] Figure 6 It is a block diagram of an electronic device for image search provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0049] "One embodiment" or "embodiment" referred to herein refers to a specific feature, structure or characteristic that may be included in at least one implementation of the present invention. In the description of the present invention, it should be understood that the terms "first", "second", "third" and "fourth" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units that are inherent to these processes, methods, products or devices.
[0050] Figure 1 A flowchart of an image search method is shown, specifically, Figure 1 As shown, the method includes:
[0051] S100: Obtain a preset search image, a target classification model, and a preset classification threshold.
[0052] Specifically, the preset search image may be a predetermined image that is desired to be searched. The preset search image may be an electronic image of any format and size, including but not limited to JPG, PNG, TIF, and BMP. The preset search image may be obtained by downloading it directly from the Internet or by taking a photo with a mobile phone or camera and uploading it. Exemplarily, in an embodiment of the present application, the preset search pattern may be a 300mm×270mm picture in JPG format.
[0053] Furthermore, the target classification model corresponds to the preset search image. That is, the target classification model is a model determined based on the preset search object in the preset search image. After obtaining the preset search image, the model training can be first performed based on the preset search object in the preset search image to obtain the target classification model for the preset search object. Exemplarily, the training of the target classification model can be implemented based on the residual network.
[0054] Furthermore, the preset classification threshold may be preset. For example, the preset classification threshold may be represented by K, which is specifically used to determine a limit value of a classification result.
[0055] S102: Determine a plurality of local area images according to a preset search image.
[0056] Specifically, the local area feature may be an area in the preset search image that includes the preset search object. The multiple local area images may be obtained by randomly cropping the preset search image multiple times, or may be obtained by zooming in and out of the preset search image.
[0057] S104 , extracting features from each local area image to obtain feature vectors corresponding to each of the multiple local area images.
[0058] Specifically, each local area image corresponds to a feature vector, and multiple local area images can be directly input into a convolutional neural network (CNN), which will output a feature vector corresponding to each local area image. The output feature vector has a high dimension, and the dimension of each feature vector is the same. Exemplarily, the dimension of the output feature vector may be 1000 dimensions, or 2000 dimensions, etc., which is specifically determined by the output result of the convolutional neural network. Preferably, the convolutional neural network can be a fully convolutional network (FCN).
[0059] S106: Input the feature vectors corresponding to the multiple local area images into the target classification model for classification processing, and determine the classification result corresponding to each local feature vector.
[0060] It is understandable that the feature vectors corresponding to the multiple local area images determined in step S104 are input into the target classification model, and the target classification model will output the classification result corresponding to each local feature vector. Exemplarily, the output classification result can be the score corresponding to each local feature vector, for example, the score of the output classification result can be 0.3, 0.8, 0.2, 0, 0.1, etc.
[0061] S108: Determine the local feature vector whose classification result reaches a preset classification threshold as the target feature vector.
[0062] Specifically, the preset classification threshold may specifically refer to a specific boundary value, such as K. The classification result reaching the preset classification threshold is determined as the target feature vector, which may refer to determining the feature vector corresponding to the classification result whose score is in the top K in the classification result as the target feature vector.
[0063] Furthermore, in other feasible solutions, the preset classification threshold may also refer to a specific score value, and the classification result reaching the preset classification threshold may also specifically refer to the score corresponding to the classification result being greater than the score corresponding to the preset classification threshold. When the preset classification threshold is 0.5, and the classification results are 0.8, 0.6, 0.1, 0.3, 0.7, and 0.9, the classification results reach the preset classification threshold at four values: 0.8, 0.6, 0.7, and 0.9. That is, the local feature vectors corresponding to the classification results of 0.8, 0.6, 0.7, and 0.9 can be used to determine the target feature vector.
[0064] S110 , performing image search according to the target feature vector to obtain an image set including a preset search object.
[0065] Specifically, the target feature vector can be input into an image database to search for an image set including a preset search object. Exemplarily, the image database can be images stored in, for example, Taobao backend or Alibaba backend. The image set can include at least two images.
[0066] Furthermore, when operating step S110, the determined target feature vector may be first subjected to dimensionality reduction processing to obtain a target search feature vector after dimensionality reduction, and an image search is performed based on the target search feature vector to obtain an image set including a preset search object.
[0067] Specifically, dimensionality reduction can be performed based on dimensionality reduction algorithms, such as principal component analysis (PCA) or factor analysis (FA). It is understandable that dimensionality reduction can make the algorithm operate faster, achieve better results, and achieve data visualization. Exemplarily, the dimension of the target feature vector can be reduced by the dimensionality reduction algorithm, for example, reducing a 1000-dimensional target feature vector to a 40-dimensional target feature vector.
[0068] It can be understood that the present invention can increase the number of local area images and the amount of information of the preset search object by processing the preset search image to increase the accuracy of determining the target feature vector corresponding to the preset search object. In addition, classification processing is first performed in a large number of feature vectors to determine the target feature vector, and then image search is performed based on the target feature vector. Since the target classification model corresponds to the preset search image, the determined target feature vector can be used as the key feature information of the preset search object. Therefore, the present invention can determine the image with the target object based only on the target feature vector, and can ignore the influence of background information in the search image on the search results, thereby improving the image search accuracy and search efficiency, and can ignore noise data such as viewing angle, thereby improving the robustness of the algorithm.
[0069] Figure 2 A flowchart of another image search method is shown. Figure 2 As shown, the method includes:
[0070] S100: Obtain a preset search image, a target classification model, and a preset classification threshold.
[0071] S102: Determine a plurality of local area images according to a preset search image.
[0072] Specifically, in the embodiment of the present application, step S102 can be implemented based on the following steps:
[0073] S200: randomly divide a preset search image to randomly determine an area with a first size.
[0074] Specifically, the preset search image may be randomly divided to randomly determine an area with a first size, wherein the first size includes the preset search object in the preset search image. Exemplarily, the first size may be a size determined by the user. For example, the first size may be a square size including the preset search object.
[0075] Preferably, before randomly dividing the preset search image, the preset search image may be subjected to center cropping. Exemplarily, the preset search image may be subjected to center cropping to obtain a square image. For example, the preset search image of the size of 300mm×270mm at the above distance may be subjected to center cropping to obtain an image of 250mm×250mm, and then the center cropped image may be subjected to random division. For example, the center cropped image of 250mm×250mm may be subjected to random division into regions of a first size of 224mm×224mm. It is understandable that center cropping the preset search image may unify the division size and reduce the memory occupied by the image.
[0076] S202 , performing resolution change processing on an image corresponding to an area of the first size to obtain a plurality of local area images with different resolutions.
[0077] Specifically, performing resolution change processing on the image corresponding to the area of the first size may be performing scale change of resolution on the image corresponding to the area of the first size to obtain a plurality of local area images with different resolutions. Specifically, the plurality of local area images with different resolutions may be constructed as an image pyramid. Specifically, by performing multi-scale resolution processing on the preset search image, the number of local area images may be increased, thereby increasing the number of target feature vectors corresponding to the preset search object in the preset search image, and improving the search accuracy.
[0078] S104 , extracting features from each local area image to obtain feature vectors corresponding to each of the multiple local area images.
[0079] S106: Input the feature vectors corresponding to the multiple local area images into the target classification model for classification processing, and determine the classification result corresponding to each local feature vector.
[0080] S108: Determine the local feature vector whose classification result reaches a preset classification threshold as the target feature vector.
[0081] S110 , performing image search according to the target feature vector to obtain an image set including a preset search object.
[0082] It is understandable that for the steps not introduced in this embodiment, please refer to the above introduction and will not be repeated here.
[0083] Figure 3 A flowchart of another image search method is shown. Figure 3 As shown, the method includes:
[0084] S100: Obtain a preset search image, a target classification model, and a preset classification threshold.
[0085] S102: Determine a plurality of local area images according to a preset search image.
[0086] Specifically, in the embodiment of the present application, step S102 can be implemented based on the following steps:
[0087] S300: randomly divide a preset search image to randomly determine a plurality of regions having a first size.
[0088] Specifically, the preset search image may be randomly divided multiple times to randomly determine multiple areas with a first size. Exemplarily, the first size may be a size determined by a user. For example, the first size may be a square size containing the preset search object.
[0089] Preferably, before randomly dividing the preset search image, the preset search image may be subjected to center cropping. Exemplarily, the preset search image may be subjected to center cropping to obtain a square image. For example, the preset search image of the size of 300mm×270mm at the above distance may be subjected to center cropping to obtain an image of 250mm×250mm, and then the center cropped image may be subjected to random division. For example, the center cropped image of 250mm×250mm may be subjected to random division into regions of a first size of 224mm×224mm. It is understandable that center cropping the preset search image may unify the division size and reduce the memory occupied by the image.
[0090] S302: Determine an image corresponding to each region having a first size as a local region image to obtain a plurality of local region images.
[0091] S104 , extracting features from each local area image to obtain feature vectors corresponding to each of the multiple local area images.
[0092] S106: Input the feature vectors corresponding to the multiple local area images into the target classification model for classification processing, and determine the classification result corresponding to each local feature vector.
[0093] S108: Determine the local feature vector whose classification result reaches a preset classification threshold as the target feature vector.
[0094] S110 , performing image search according to the target feature vector to obtain an image set including a preset search object.
[0095] It is understandable that for the steps not introduced in this embodiment, please refer to the above introduction and will not be repeated here.
[0096] Figure 4 A flowchart of another image search method is shown. Figure 4 As shown, the method includes:
[0097] S100: Obtain a preset search image, a target classification model, and a preset classification threshold.
[0098] Furthermore, the target classification model corresponds to the preset search image. That is, the target classification model is a model determined based on the preset search object in the preset search image. After obtaining the preset search image, the model training can be first performed based on the preset search object in the preset search image to obtain the target classification model for the preset search object. Exemplarily, the training of the target classification model can be implemented based on the residual network. Exemplarily, the target classification model can be determined based on the following steps:
[0099] S400: Determine a plurality of preset training images according to a preset search image, each preset training image including a preset search object.
[0100] Specifically, the preset search image may be randomly divided multiple times to randomly determine multiple areas of the second size. Preferably, before the preset search image is randomly divided, the preset search image may be center cropped. Exemplarily, the preset search image may be center cropped to obtain a square image. For example, a preset search image of 300mm×270mm size at the above distance may be center cropped to obtain an image of 250mm×250mm. It is understandable that center cropping the preset search image may unify the size and reduce the memory occupied by the image.
[0101] S402: Determine an image corresponding to each region having a second size as a preset training image to obtain a plurality of preset training images.
[0102] S404: Train multiple preset training images to obtain a target classification model.
[0103] Exemplarily, a plurality of preset training images may be input into a residual network for model training to obtain a target classification model for a preset search object.
[0104] It is understandable that after determining the preset search image to be searched, the target classification model for the preset search object in the preset search image is firstly trained.
[0105] S102: Determine a plurality of local area images according to a preset search image.
[0106] S104 , extracting features from each local area image to obtain feature vectors corresponding to each of the multiple local area images.
[0107] S106: Input the feature vectors corresponding to the multiple local area images into the target classification model for classification processing, and determine the classification result corresponding to each local feature vector.
[0108] S108: Determine the local feature vector whose classification result reaches a preset classification threshold as the target feature vector.
[0109] S110 , performing image search according to the target feature vector to obtain an image set including a preset search object.
[0110] Further, such as Figure 5 As shown, an image search device is also disclosed, the device comprising:
[0111] An acquisition module, used to acquire a preset search image, a target classification model and a preset classification threshold, wherein the target classification model corresponds to the preset search image;
[0112] A local area image determination module, used to determine a plurality of local area images according to a preset search image, wherein the local area images include a preset search object;
[0113] A feature vector determination module is used to extract features from each local area image to obtain feature vectors corresponding to each of the multiple local area images;
[0114] A classification result determination module, used for inputting the feature vectors corresponding to each of the multiple local area images into the target classification model for classification processing, and determining the classification result corresponding to each local feature vector;
[0115] A target feature vector determination module is used to determine a local feature vector whose classification result reaches a preset classification threshold as a target feature vector;
[0116] The image set determination module is used to perform image search according to the target feature vector to obtain an image set including a preset search object.
[0117] Furthermore, the local area image determination module includes:
[0118] The first division unit is used to randomly divide the preset search image to randomly determine an area with a first size.
[0119] The first local area image determination unit is used to perform resolution change processing on an image corresponding to an area of a first size to obtain a plurality of local area images with different resolutions.
[0120] Furthermore, the local area image determination module also includes:
[0121] The second division unit is used to randomly divide the preset search image multiple times to randomly determine a plurality of areas with a first size.
[0122] The second local area image determination unit is used to determine the image corresponding to each area having the first size as a local area image to obtain a plurality of local area images.
[0123] Furthermore, the feature vector determination module includes:
[0124] The feature vector determination unit is used to extract features from each local area image based on a full convolutional network to obtain feature vectors corresponding to each of the multiple local area images.
[0125] Furthermore, the device also includes:
[0126] A preset training image determination module, used to determine a plurality of preset training images according to a preset search image, each preset training image including a preset search object;
[0127] The target classification model training module is used to train multiple preset training images to obtain a target classification model.
[0128] Furthermore, the preset training image determination module includes:
[0129] A third division unit, configured to randomly divide the preset search image multiple times to randomly determine a plurality of regions having a second size;
[0130] The preset training image determining unit is used to determine the image corresponding to each area having the second size as a preset training image to obtain a plurality of preset training images.
[0131] Furthermore, the image set determination module includes:
[0132] A target search feature vector determination unit is used to perform dimensionality reduction processing on the target feature vector to obtain a target search feature vector after dimensionality reduction;
[0133] The image set determination unit is used to perform image search according to the target search feature vector to obtain an image set including a preset search object.
[0134] The implementation scheme of each module in a vehicle positioning device in this embodiment refers to the processing steps of the above method, which will not be repeated here.
[0135] Furthermore, the present application also discloses an electronic device, comprising:
[0136] processor;
[0137] a memory for storing processor-executable instructions;
[0138] The processor is configured to execute instructions to implement the above-mentioned image search method.
[0139] For example, Figure 6 is a block diagram of an electronic device for image search according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device 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 electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image search method is implemented.
[0140] Those skilled in the art will understand that Figure 6The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0141] Furthermore, the present application also discloses a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the image search method as described above.
[0142] The computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0143] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to perform the image search method in the embodiment of the present disclosure.
[0144] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0145] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0146] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0147] It is worth noting that in the above-mentioned device and terminal embodiments, the modules and units included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the modules and units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0148] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.
[0149] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An image search method, characterized in that: The method comprises: Acquire a preset search image, a target classification model, and a preset classification threshold, wherein the target classification model corresponds to the preset search image; Determining a plurality of local area images according to the preset search image, wherein the local area images include a preset search object; Extract features from each local area image to obtain feature vectors corresponding to each of the multiple local area images; Inputting the feature vectors corresponding to the plurality of local region images into the target classification model for classification processing, and determining the classification result corresponding to each local feature vector; Determine the local feature vector whose classification result reaches the preset classification threshold as the target feature vector; An image search is performed according to the target feature vector to obtain an image set including the preset search object.
2. The image search method according to claim 1, characterized in that: The determining of a plurality of local area images according to the preset search image comprises: Randomly dividing the preset search image to randomly determine an area having a first size; The image corresponding to the area of the first size is processed for resolution change to obtain a plurality of local area images with different resolutions.
3. The image search method according to claim 1, characterized in that: The determining of a plurality of local area images according to the preset search image comprises: Randomly dividing the preset search image multiple times to randomly determine multiple areas with a first size; An image corresponding to each region having the first size is determined as a local region image to obtain a plurality of local region images.
4. The image search method according to claim 2, characterized in that: The feature extraction of each local area image to obtain the feature vectors corresponding to each of the multiple local area images comprises: Based on the full convolutional network, features are extracted for each local area image to obtain feature vectors corresponding to multiple local area images.
5. The image search method according to claim 1, characterized in that: Before obtaining the target classification model, the method further includes: Determine a plurality of preset training images according to the preset search image, each preset training image including the preset search object; The plurality of preset training images are trained to obtain the target classification model.
6. The image search method according to claim 5, characterized in that: The determining a plurality of preset training images according to the preset search image comprises: Randomly dividing the preset search image multiple times to randomly determine a plurality of regions having a second size; An image corresponding to each region having the second size is determined as a preset training image to obtain the plurality of preset training images.
7. The image search method according to claim 1, characterized in that: The performing of image search according to the target feature vector to obtain an image set including the preset search object comprises: Performing dimensionality reduction processing on the target feature vector to obtain a target search feature vector after dimensionality reduction; An image search is performed according to the target search feature vector to obtain an image set including the preset search object.
8. An image search device, characterized in that: The device comprises: An acquisition module, used to acquire a preset search image, a target classification model and a preset classification threshold, wherein the target classification model corresponds to the preset search image; A local area image determination module, used to determine a plurality of local area images according to the preset search image, wherein the local area images include preset search objects; A feature vector determination module is used to extract features from each local area image to obtain feature vectors corresponding to each of the multiple local area images; A classification result determination module, used for inputting the feature vectors corresponding to each of the plurality of local area images into the target classification model for classification processing, and determining the classification result corresponding to each local feature vector; A target feature vector determination module, used to determine the local feature vector whose classification result reaches the preset classification threshold as the target feature vector; The image set determination module is used to perform image search according to the target feature vector to obtain an image set including the preset search object.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image search method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image search method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Image retrieval method and system
CN108255858A
Method and device for searching a target in an image
US20180210896A1
