Image search method, device, medium and electronic equipment
Technical field
The present invention relates to data retrieval technology fields, fill in particular to a kind of image search method, image retrieval
It sets, computer-readable medium and electronic equipment.
Background technique
With the development of machine learning, the application of the image retrieval algorithm of characteristics of image is extracted using machine learning model
Field is more and more extensive.
However, being continuously increased with image magnitude, system needs support the image retrieval of more than one hundred million ranks, each storage section
Point will store the characteristics of image of ten million magnitude.The characteristics of image of ten million magnitude not only needs a large amount of memory space, examines in image
Suo Shi, speed are also very slow.Currently, by the way that characteristics of image progress dimensionality reduction can be increased the feature that single machine can store
Amount, but this method is not still able to satisfy the demand of actual amount of data;Also, it is more next that the increasing of characteristic quantity will lead to retrieval time
It is longer, poor user experience.
Therefore, the too low problem of image retrieval efficiency still has to be solved.
It should be noted that information is only used for reinforcing the reason to background of the invention disclosed in above-mentioned background technology part
Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of image search method, image retrieving apparatus, computer-readable Jie
Matter and electronic equipment, and then image retrieval low efficiency is overcome the problems, such as at least to a certain extent.
Other characteristics and advantages of the invention will be apparent from by the following detailed description, or partially by the present invention
Practice and acquistion.
According to a first aspect of the embodiments of the present invention, a kind of image search method is provided, comprising: carry out to sample image
Cluster obtains multiple class clusters;Each sample image is respectively stored in different data clusters based on each class cluster;It obtains
Image to be retrieved is taken, the first characteristics of image of the image to be retrieved is extracted;The image to be retrieved is clustered, according to poly-
Class result determines target data cluster;The corresponding target image of the image to be retrieved is determined from the target data cluster.
In the exemplary embodiment, described that sample image is clustered to obtain multiple class clusters, comprising: to the sample graph
As being clustered, multiple sample sets are obtained;The sample set is clustered, it is corresponding multiple to obtain the sample set
Class cluster.
In the exemplary embodiment, described that the image to be retrieved is clustered, number of targets is determined according to cluster result
Include: to be clustered based on sample image to the image to be retrieved according to cluster, determines the corresponding target of the image to be retrieved
Sample set;Based on the target sample subset, the image to be retrieved is clustered again, determines the image to be retrieved
Corresponding target class cluster;According to the identification number of the target class cluster, the sample image for saving and including in the target class cluster is determined
Target data cluster.
In the exemplary embodiment, the sample image is clustered, after obtaining multiple sample sets, further includes:
The cluster centre of multiple sample sets is determined respectively, to be based on the cluster centre, determines the image to be retrieved
Target sample subset.
In the exemplary embodiment, described that each sample image is respectively stored in by different numbers based on each class cluster
According in cluster, comprising: each sample set to be respectively stored in the first data cluster;Based on first data cluster,
The corresponding multiple class clusters of the sample set are stored in the second data cluster.
In the exemplary embodiment, described that each sample image is respectively stored in by different numbers based on each class cluster
According in cluster, comprising: quantify to the characteristic of each sample image, the quantization for obtaining each sample image is special
Sign;For the quantization characteristic for including in each class cluster, is saved, obtained multiple by distributed file system respectively
Data cluster.
In the exemplary embodiment, described that the corresponding target of the image to be retrieved is determined from the target data cluster
Image includes: to quantify to the characteristic of the image to be retrieved, obtains the first characteristics of image;Calculate the target data
The similarity of quantization characteristic and the first image feature in cluster;It is determined according to the similarity calculation result described to be checked
The corresponding target image of rope image.
In the exemplary embodiment, described that the corresponding mesh of the image to be retrieved is determined according to the similarity calculation result
Logo image comprises determining that the corresponding image pattern of characteristic that the similarity calculation result meets preset threshold is target figure
Picture.
In the exemplary embodiment, described to obtain image to be retrieved, comprising: to learn the image unit device to be retrieved
In model, the second characteristics of image of the image to be retrieved is obtained.
In the exemplary embodiment, the method also includes: every preset time period is updated the sample image,
The class cluster is reacquired using updated sample image.
In the exemplary embodiment, the method also includes: using roll update mechanism to each data cluster respectively into
Row updates, to update the target data cluster.
According to a second aspect of the embodiments of the present invention, a kind of image retrieving apparatus is provided, comprising: sample clustering unit,
For being clustered to obtain multiple class clusters to sample image;Cluster acquiring unit, for being based on each class cluster for each sample
This image is respectively stored in different data clusters;Image clustering unit, for obtaining image to be retrieved, to described to be retrieved
Image is clustered, and determines target data cluster according to cluster result;Image determination unit is used for from the target data cluster
The corresponding target image of the middle determination image to be retrieved.
According to a third aspect of the embodiments of the present invention, a kind of computer-readable medium is provided, computer is stored thereon with
Program realizes the image search method as described in first aspect in above-described embodiment when described program is executed by processor.
According to a fourth aspect of the embodiments of the present invention, a kind of electronic equipment is provided, comprising: one or more processors;
Storage device, for storing one or more programs, when one or more of programs are held by one or more of processors
When row, so that one or more of processors realize the image search method as described in first aspect in above-described embodiment.
Technical solution provided in an embodiment of the present invention can include the following benefits:
In the technical solution provided by some embodiments of the present invention, on the one hand, store image by data cluster
Feature can increase the magnitude of the characteristics of image of storage, be conducive to improve the comprehensive of image retrieval.On the other hand, to be checked
Rope image carries out cluster and determines target data cluster, and target image is then determined in target data cluster, can reduce figure
As the range of retrieval, be conducive to the speed for improving image retrieval, to improve recall precision, improve user experience.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and be used to explain the principle of the present invention together with specification.It should be evident that the accompanying drawings in the following description is only the present invention
Some embodiments for those of ordinary skill in the art without creative efforts, can also basis
These attached drawings obtain other attached drawings.In the accompanying drawings:
Fig. 1 is diagrammatically illustrated in embodiment according to the present invention to be illustrated for realizing the system architecture of image search method
Figure;
Fig. 2 diagrammatically illustrates first flow chart of the image search method of embodiment according to the present invention;
Fig. 3 diagrammatically illustrates second flow chart of the image search method of embodiment according to the present invention;
Fig. 4 diagrammatically illustrates the third flow chart of the image search method of embodiment according to the present invention;
Fig. 5 diagrammatically illustrates the 4th flow chart of the image search method of embodiment according to the present invention;
Fig. 6 diagrammatically illustrates the 5th flow chart of the image search method of embodiment according to the present invention;
Fig. 7 diagrammatically illustrates the 6th flow chart of the image search method of embodiment according to the present invention;
Fig. 8 diagrammatically illustrates the block diagram of the image retrieving apparatus of embodiment according to the present invention;
Fig. 9 schematically shows a kind of computer-readable storage of image search method for realizing the embodiment of the present invention
Medium;
Figure 10 shows the example block diagram for being suitable for the electronic equipment for being used to realize the embodiment of the present invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes
Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the present invention will more
Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner
In example.In the following description, many details are provided to provide and fully understand to the embodiment of the present invention.However,
It will be appreciated by persons skilled in the art that technical solution of the present invention can be practiced without one or more in specific detail,
Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side
Method, device, realization or operation are to avoid fuzzy each aspect of the present invention.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity.
I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit
These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step,
It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close
And or part merge, therefore the sequence actually executed is possible to change according to the actual situation.
A kind of system architecture for realizing image search method is provided firstly in this example embodiment.With reference to Fig. 1
Shown, which may include terminal device 101,102,103, network 104 and server 105.Network 104 to
The medium of communication link is provided between terminal device 101,102,103 and server 105.Network 104 may include various companies
Connect type, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out
Send request instruction etc..Various telecommunication customer end applications can be installed, such as picture processing is answered on terminal device 101,102,103
With, shopping class application, web browser applications, searching class application, instant messaging tools, mailbox client, social platform software
Deng.
Terminal device 101,102,103 can be the various electronic equipments with display screen and supported web page browsing, packet
Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 105 can be to provide the server of various services, such as utilize terminal device 101,102,103 to user
The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception
To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter
Breath -- merely illustrative) feed back to terminal device.
It should be noted that image search method provided by the application embodiment is generally executed by server 105, phase
Ying Di, image retrieving apparatus are generally positioned in terminal device 101.
Based on above system framework 100, this example embodiment proposes a kind of image search method.The image search method
Executing subject can be the equipment with calculation processing function, such as server etc..
As shown in Fig. 2, the image search method may include step S210, step S220, step S230 and step
S240.Wherein:
Step S210 clusters sample image to obtain multiple class clusters;
Each sample image is respectively stored in different data clusters by step S220 based on each class cluster;
Step S230 obtains image to be retrieved, clusters to the image to be retrieved, determines target according to cluster result
Data cluster;
Step S240 determines the corresponding target image of the image to be retrieved from the target data cluster.
According to the image search method in this illustrative embodiment, on the one hand, store image spy by data cluster
Sign, can increase the magnitude of the characteristics of image of storage, be conducive to improve the comprehensive of image retrieval.On the other hand, first is utilized
Characteristics of image carries out cluster to image to be retrieved and determines target data cluster, so as to the range of downscaled images retrieval, so
The corresponding target image of image to be retrieved is determined in target data cluster afterwards, is conducive to the speed for improving image retrieval, in turn
Recall precision is improved, user experience is improved.
In the following, Fig. 2 to Fig. 7 will be combined to carry out more each step of the image search method in this illustrative embodiment
Add detailed description.
As shown in Fig. 2, being clustered to obtain multiple class clusters to sample image in step S210.
Sample image can refer to the image in image data base, need to retrieve mesh in the database in image retrieval
Logo image.The image pattern may include multiple attribute informations, such as image identification number, image size, image type etc..Sample
This image can also be including other information, such as characteristics of image etc., present embodiment does not limit this.User can input uncommon
The information for hoping the target image searched, searches target image based on the information, that is, find out qualified sample in the database
Image passes through searching image features target image for example, searching the target image in sample image by the keyword of input
Deng.Also, user can also input an image, search the target image met by the image of the input, for example, user can be with
A character image is inputted, the target image etc. comprising the personage, therefore this example embodiment party can be found from sample image
The image search method of formula can be used for various retrieval scenes, such as the retrieval by keyword, the retrieval by image, pass through
The retrieval etc. of characteristics of image.Furthermore, it is possible to which every preset time period is updated sample image, to guarantee the complete of image resource
Face property and validity.
Cluster can be carried out to sample image by Clustering Model and obtains multiple class clusters, wherein every one kind cluster includes certain
The sample image of quantity.The sample image of substantial amounts can be divided into multiple image quantities for including by cluster
Class, also, the same or similar sample image of characteristics of image can be in same class, in order to the energy when carrying out images match
It is enough first to reduce the range for needing matched sample image, to reduce the calculation times of images match, improve effectiveness of retrieval.
For step S220, sample image is respectively stored in different data clusters based on all kinds of clusters.
Due to the enormous amount of sample image, even if after by cluster, the amount of images that every one kind cluster includes is also bigger,
Therefore distribution storage can be carried out to image by way of data cluster.The sample image for belonging to same class cluster can store
In same data cluster, data cluster may include at least two or multiple servers, which may be constructed void
Quasi-simple data base logic image.That is, multiple server centereds are got up to be managed collectively, and database service is carried out together.From
And the magnitude of the characteristics of image saved is greatly increased, the comprehensive of image retrieval is improved, and then be conducive to improve image inspection
The accuracy of rope.
In illustrative embodiments, can include by repeatedly cluster further reducing in every one kind to sample image
Amount of images, as shown in Figure 3.Specifically:
Step S301. clusters the sample image, obtains multiple sample sets;
Step S302. clusters the sample set, obtains the corresponding multiple class clusters of the sample set.
All sample images can be carried out once clustering and be divided into multiple classes, that is, sample set includes in each subset
A certain number of sample images.Each subset is clustered again respectively, each subset is divided into multiple classes, i.e. class cluster, is made
The quantity for obtaining the sample image for including in every a kind of cluster is less than the quantity of the sample image in subset included.It is then possible to will not
The sample image for including in same class cluster is stored in different data clusters, to reduce to the memory space of data cluster
It is required that.And it is possible to which the characteristics of image to sample image quantifies, and then the characteristic after quantization is stored in data set
In group, to save memory space.In addition, cluster to sample image and the cluster of sample set can be used different poly-
Class model, such as the first Clustering Model for being completed with training are clustered to obtain multiple sample sets to sample image, then with instructing
The second Clustering Model practiced clusters sample set to obtain multiple class clusters.
It illustratively, can be sub by sample according to the cluster result of first time cluster as shown in figure 5, in step S501
The image of concentration is stored in the first data cluster, and the image for belonging to different sample sets is stored in different data clusters.
Then in step S502, the data saved in the first data cluster is divided into again by multiple classes according to the result of second of cluster and are deposited
In the second data cluster.
And it is possible to the sample image for including in every class cluster is saved by container instrument, or by sample image
Characteristic saved, to obtain the corresponding each data cluster of all kinds of clusters.Container instrument may include various Container Managements
Platform, such as Kubernetes etc..Identify different data clusters using the address or port of each data cluster, and with it is each
Class cluster establishes mapping relations.For example, multiple data clusters can be created by Container Management platform, pass through each data cluster
Address can identify each data cluster, and it is possible to which mapping is established in the address of each identification number and data cluster in advance
Relationship.After obtaining target signature collection, the corresponding data of target signature collection can be found according to the identification number of target signature collection
The address of cluster, the data cluster are target data cluster.
For step S230, image to be retrieved is obtained, image to be retrieved is clustered, target is determined according to cluster result
Data cluster.
In this example embodiment, an interface can be provided, obtains search condition by the interface, search condition can be with
Including data such as keyword, characteristics of image, images.If user is retrieved using image, user can will be to be retrieved
Image uploads to the interface, or the identification number of image to be retrieved can also be uploaded to interface.Illustratively, which can
To include a graphic user interface.It may include a search box in the graphic user interface, user inputs in the search box
Then the identification number of image to be retrieved obtains corresponding image to be retrieved in the database of storage image by the identification number.
Alternatively, the graphic user interface also may include the control of a upload image, user is carried out image to be retrieved by the control
It uploads, and then obtains the image to be retrieved.
After obtaining image to be retrieved, the characteristics of image of image to be retrieved can be extracted by various algorithms, such as feature becomes
Change method (Scale-invariant features transform, referred to as SIFT), histogram method (histogram of
Oriented Gradient, referred to as HOG) etc..Other algorithms, such as local binary can also be passed through by extracting characteristics of image
Method etc..In this example embodiment, the characteristics of image of image to be retrieved can be extracted by machine learning model.Specifically, can
To obtain a large amount of sample image in advance, instruction is input to using sample image training machine learning model, then by image to be retrieved
In machine learning model after white silk, to obtain characteristics of image.For example, can use deep learning GoogLeNet algorithm to instruct
Practice a GoogLeNet model, utilizes the characteristics of image of model extraction image to be retrieved.
It can be classified to image to be retrieved using characteristics of image, determine target data cluster according to classification results.Root
Characteristics of image can be clustered according to the attribute of characteristics of image, such as color characteristic, textural characteristics, shape feature etc..Alternatively,
Classified using machine learning model to characteristics of image.Specifically, as shown in figure 4, classifying to image to be retrieved, thus
The method for determining target data cluster may include step S401, step S402 and step S403.
By above-mentioned steps it is found that can be clustered to obtain multiple sample to sample image by the first Clustering Model
Collection, then sample set is clustered with the second Clustering Model to obtain multiple class clusters.It therefore, can be right using the first Clustering Model
Image to be retrieved carries out first time cluster, determines target sample subset, that is, determine that the image to be retrieved belongs to multiple sample sets
In which kind of.After determining target sample subset, again image to be retrieved cluster really based on the second Clustering Model
Fixed image to be retrieved corresponds to target class cluster.The target data set for saving target class cluster can be determined according to the identification number of target class cluster
Group.
Illustratively, using K-means algorithm the first Clustering Model of training, using the first model after training to multiple samples
This image is clustered, and N number of class is obtained.If sample image is 10,000,000, if N is 20, then each sample set is flat after classifying
It may include 500,000 characteristics.Second cluster after sample set can be divided into 10 class clusters, then every a kind of cluster can be with
Including 50,000 characteristics.The identification number of every one kind cluster can be " 1,2,3,4 ... " etc., each identification number and a data cluster
Location has mapping relations, and the characteristic of image or image that each class cluster includes is stored in data cluster, i.e., every number
About 50,000 parts of characteristics can be saved according to cluster, the requirement to memory space substantially reduces.
Can periodically to be updated to sample image in step illustrative embodiments, then the image for including in class cluster
Also it updates accordingly, then the corresponding each data cluster of all kinds of clusters is also required to be updated.Each data cluster can be distinguished
Rolling update is carried out, so that target data cluster is updated.For example, in Kubernetes cluster, in each data cluster
If there are 10 pod, the first two pod can be first updated, data service can be provided there are also 8 pod at this time, the first two has updated
Cheng Hou, then next two are successively updated, and so on, it is completed until all pod update, that is, during update extremely
Rare 8 pod are capable of providing data service.It can be avoided data service interruption using the method updated is rolled, cause user's body
Poor problem is tested, and the robustness of system can also be improved.
Determine that the corresponding target data cluster of image to be retrieved can be determined by the cluster centre of all kinds of clusters.For poly-
Multiple sample sets that class model is classified can determine the cluster centre of each sample set respectively.It calculates in sample set
Each sample apart from mean value, available cluster centre.Corresponding target sample of image to be retrieved is determined based on cluster centre
Collection.Each cluster centre is calculated separately at a distance from the characteristics of image of image to be retrieved, it will be corresponding apart from the smallest cluster centre
Sample set determines target sample subset.Similarly, it can also determine that image to be retrieved is corresponding by the cluster centre of all kinds of clusters
Target class cluster.Alternatively, first Clustering Model will be according to image spy after image to be retrieved is inputted first Clustering Model
Sign classifies to first characteristics of image at a distance from each cluster centre, then exports target sample belonging to the image to be retrieved
This subset.
In example embodiment, sample image is stored in based on the cluster result to sample image by different data sets
It may include step S601 and step S602 in group, as shown in Figure 6.
In step s 601, the characteristic of sample image can be quantified, to obtain quantization characteristic.Pass through drop
Dimension algorithm quantifies characteristic, such as eliminates scheduling algorithm by low variance filter, opposite feature and carry out to characteristic
Dimensionality reduction.It can be 0 or 1 by floating number characteristic quantification by quantifying to characteristic.Available each figure after quantization
As the corresponding quantization characteristic of feature.
In step S602, quantization characteristic is saved by distributed file system, multiple data sets can be obtained
Group.Each data cluster saves the quantization characteristic in same class cluster, quantization characteristic compare with for the primitive character of image, it is required
Memory space greatly reduce, thus meet data magnitude growth requirement.
With continued reference to Fig. 2, in step S240, the corresponding target figure of image to be retrieved is determined from target data cluster
Picture.
In this example embodiment, pass through the number saved on the accessible target data cluster in the address of target data cluster
According to, and then target image is determined according to the characteristic in the characteristics of image of image to be retrieved and target data cluster.Example
Property, the sample image feature in target class cluster can be saved using distributed file system, and then to be checked determining
After the corresponding target class cluster of rope image, file system belonging to target class cluster can be determined.If each sample set includes
Sample set can be divided into 10 classes by 10000 sample images, the second Clustering Model, then may include about in each class cluster
1000 images, then the sample image saved in file system belonging to target class cluster is about 1000, is needed and image to be retrieved
The characteristic of box counting algorithm similarity be about 1000, so as to greatly reduce calculation amount, improve data and calculate speed
Degree, to improve image retrieval efficiency.
The characteristics of image for extracting image to be retrieved, by the figure for calculating characteristic and image to be retrieved in target class cluster
As the similarity of feature, and then determine target image.If saving the feature after sample image quantization in data cluster,
The characteristics of image of the retrieval image extracted can be quantified, by quantization after feature and data cluster in feature into
Row similarity calculation.The calculating of similarity can by Euclidean distance, Hamming distance etc., can also by other algorithms, such as
COS distance, mahalanobis distance etc..It after calculating similarity, can be ranked up from high to low according to similarity, choose top n
The corresponding image pattern of characteristic is as target image.Alternatively, the corresponding image of the characteristic that similarity is met threshold value
Sample is as target image.
In illustrative embodiments, the above-mentioned image search method of the disclosure can also be including step S701 to step
S705, as shown in Figure 7.
In step s 701, user can initiate the request of image retrieval by a user interface, to obtain on user
The retrieval image of biography;Or corresponding image is obtained as retrieval figure from database according to the image identification number that user inputs
Picture.In step S702, after retrieval image has been determined, the characteristics of image of retrieval image is extracted, and start first in GPU
Clustering Model predicts classification belonging to the retrieval image.The characteristics of image that first Clustering Model can export retrieval image is corresponding
The identification number of classification.
In step S703, the sample image in database can be divided into multiple classes, each classification by the first Clustering Model
The copy set in Kubernetes cluster is corresponded to, includes a certain number of sample images in the copy set.Kubernetes is
Manage the Open Source Platform of container cluster.In step S704, it is determined that after the corresponding copy set of above-mentioned characteristics of image, by image spy
Sign is clustered again in the copy set, determines the feature set in GlusterFS.GlusterFS is a distributed text
Part system deploys the characteristic of multiple sample images or sample image.This document system is mounted on pod, pod
The data stored above can be accessed, the data that oneself is responsible for can be loaded into memory by each pod when servicing starting.
It, can be to image without saving the primitive image features of sample image in data cluster in order to save memory space
Feature extraction is quantified after coming out, and the characteristic after quantization is stored in data cluster.Similarly, distributed field system
The characteristic saved in system is also possible to the characteristic after the image characteristic quantization to sample image.That is,
After one Clustering Model clusters sample image, the cluster centre of available each sample set, then according in the cluster
The heart determines target sample subset, and the sample image for including in target sample subset is clustered using the second Clustering Model,
Multiple class clusters are obtained after cluster, then quantify the characteristics of image for the sample for including in all kinds of clusters, utilize distributed text
Part system saves the characteristic after quantization.
Optionally, if the data volume of sample image is very huge, after clustering twice, the sample size in each class is still
So in ten million magnitude, then can cluster again, until the sample size of final each subset is in million magnitudes or less.
In step S705, it is determined that after the corresponding class cluster of image to be retrieved, characteristic loaded into memory is read,
The characteristics of image of image to be retrieved and the similarity of the characteristic read are calculated, determines to examine according to similarity calculation result
The corresponding target image of rope image.The target image can be by user interface presentation to user.
The device of the invention embodiment introduced below can be used for executing the above-mentioned image search method of the present invention.Such as Fig. 8
Shown, which may include: sample clustering unit 810, cluster acquiring unit 820, image clustering unit
830 and image determination unit 840.
Specifically, sample clustering unit 810, obtains multiple class clusters for being clustered to sample image;Cluster obtains single
Member 820, for each sample image to be respectively stored in different data clusters based on each class cluster;Image clustering list
Member 830, for obtaining image to be retrieved, clusters the image to be retrieved, determines target data set according to cluster result
Group;Image determination unit 840, for determining the corresponding target image of the image to be retrieved from the target data cluster.
In the exemplary embodiment, aforementioned schemes are based on, sample clustering unit 810 may include: the first cluster cell, use
It is clustered in the sample image, obtains multiple sample sets;Second cluster cell, for being carried out to the sample set
Cluster, obtains the corresponding multiple class clusters of the sample set.
In the exemplary embodiment, aforementioned schemes are based on, image clustering unit 830 may include: that the first subset determines list
Member clusters the image to be retrieved, determines the corresponding target sample of the image to be retrieved for being based on sample image
Subset;Class cluster determination unit clusters the image to be retrieved again, determines for being based on the target sample subset
The corresponding target class cluster of the image to be retrieved;Cluster determination unit is determined and is protected for the identification number according to the target class cluster
Deposit the target data cluster for the sample image for including in the target class cluster.
In the exemplary embodiment, aforementioned schemes are based on, described device 800 can also include: second subset determination unit,
For determining the cluster centre of multiple sample sets respectively, to be based on the cluster centre, the figure to be retrieved is determined
The target sample subset of picture.
In the exemplary embodiment, aforementioned schemes are based on, cluster acquiring unit 820 may include: the first storage unit, use
It is respectively stored in the first data cluster in by each sample set;Second storage unit, for being based on first data
The corresponding multiple class clusters of the sample set are stored in the second data cluster by cluster.
In the exemplary embodiment, aforementioned schemes are based on, cluster acquiring unit 820 may include: data quantization unit, use
Quantify in the characteristic to each sample image, obtains the quantization characteristic of each sample image;Data save single
Member is saved by distributed file system respectively, is obtained for the logical quantization characteristic for including in each class cluster
To multiple data clusters.
In the exemplary embodiment, aforementioned schemes are based on, image determination unit 840 may include: image characteristic quantization list
Member quantifies for the characteristic to the image to be retrieved, obtains the first characteristics of image;Similarity calculated is used
In the similarity for calculating quantization characteristic and the first image feature in the target data cluster;Target image determines single
Member, for determining the corresponding target image of the image to be retrieved according to the similarity calculation result.
In the exemplary embodiment, aforementioned schemes are based on, target image determination unit can be used for: determine the similarity
The corresponding image pattern of characteristic that calculated result meets preset threshold is target image.
In the exemplary embodiment, aforementioned schemes are based on, image clustering unit 830 can be used for: by the figure to be retrieved
As obtaining the second characteristics of image of the image to be retrieved in input machine learning model.
In the exemplary embodiment, aforementioned schemes are based on, image retrieving apparatus 800 can also include: data updating unit,
The sample set is updated for every preset time period, reacquires the feature set using updated sample set.
In the exemplary embodiment, aforementioned schemes are based on, image retrieving apparatus 800 can also include: that data cluster updates
Unit, for being updated using rolling update mechanism to each data cluster, to update target data cluster.
In addition, although describing each step of method in the disclosure in the accompanying drawings with particular order, this does not really want
These steps must be executed in this particular order by asking or implying, or having to carry out step shown in whole could realize
Desired result.Additional or alternative, it is convenient to omit multiple steps are merged into a step and executed by certain steps, and/
Or a step is decomposed into execution of multiple steps etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the disclosure
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server, mobile terminal or network equipment etc.) is executed according to disclosure embodiment
Object control method.
Person of ordinary skill in the field it is understood that various aspects of the disclosure can be implemented as system, method or
Program product.Therefore, various aspects of the disclosure can be with specific implementation is as follows, it may be assumed that complete hardware embodiment, complete
The embodiment combined in terms of full Software Implementation (including firmware, microcode etc.) or hardware and software, can unite here
Referred to as circuit, " module " or " system ".
In an exemplary embodiment of the disclosure, a kind of computer readable storage medium is additionally provided, energy is stored thereon with
Enough realize the program product of this specification above method.In some possible embodiments, various aspects of the disclosure may be used also
In the form of being embodied as a kind of program product comprising program code, when described program product is run on the terminal device, institute
Program code is stated for executing the terminal device described in above-mentioned " illustrative methods " part of this specification according to this public affairs
The step of opening various illustrative embodiments.
Refering to what is shown in Fig. 9, describing the program product for realizing the above method according to embodiment of the present disclosure
900, can using portable compact disc read only memory (CD-ROM) and including program code, and can in terminal device,
Such as it is run on PC.However, the program product of the disclosure is without being limited thereto, in this document, readable storage medium storing program for executing can be with
To be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or
It is in connection.
Described program product can be using any combination of one or more readable mediums.Readable medium can be readable letter
Number medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example can be but be not limited to electricity, magnetic, optical, electromagnetic, infrared ray or
System, device or the device of semiconductor, or any above combination.The more specific example of readable storage medium storing program for executing is (non exhaustive
List) include: electrical connection with one or more conducting wires, portable disc, hard disk, random access memory (RAM), read-only
Memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read only memory
(CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
In carry readable program code.The data-signal of this propagation can take various forms, including but not limited to electromagnetic signal,
Optical signal or above-mentioned any appropriate combination.Readable signal medium can also be any readable Jie other than readable storage medium storing program for executing
Matter, the readable medium can send, propagate or transmit for by instruction execution system, device or device use or and its
The program of combined use.
The program code for including on readable medium can transmit with any suitable medium, including but not limited to wirelessly, have
Line, optical cable, RF etc. or above-mentioned any appropriate combination.
Can with any combination of one or more programming languages come write for execute the disclosure operation program
Code, described program design language include object oriented program language-Java, C++ etc., further include conventional
Procedural programming language-such as " C " language or similar programming language.Program code can be fully in user
It calculates and executes in equipment, partly executes on a user device, being executed as an independent software package, partially in user's calculating
Upper side point is executed on a remote computing or is executed in remote computing device or server completely.It is being related to far
Journey calculates in the situation of equipment, and remote computing device can pass through the network of any kind, including local area network (LAN) or wide area network
(WAN), it is connected to user calculating equipment, or, it may be connected to external computing device (such as utilize ISP
To be connected by internet).
In an exemplary embodiment of the disclosure, a kind of electronic equipment that can be realized the above method is additionally provided.
The electronic equipment 1000 of this embodiment according to the disclosure is described referring to Figure 10.The electricity that Figure 10 is shown
Sub- equipment 1000 is only an example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in Figure 10, electronic equipment 1000 is showed in the form of universal computing device.The component of electronic equipment 1000 can
To include but is not limited to: at least one above-mentioned processing unit 1010, connects not homologous ray at least one above-mentioned storage unit 1020
The bus 1030 of component (including storage unit 1020 and processing unit 1010).
Wherein, the storage unit is stored with program code, and said program code can be held by the processing unit 1010
Row, so that various according to the disclosure described in the execution of the processing unit 1010 above-mentioned " illustrative methods " part of this specification
The step of illustrative embodiments.For example, the processing unit 1010 can execute as shown in Figure 2: step S210, to sample
This image is clustered to obtain multiple class clusters;Each sample image is respectively stored in by step S220 based on each class cluster
In different data clusters;Step S230 obtains image to be retrieved, clusters to the image to be retrieved, is tied according to cluster
Fruit determines target data cluster;Step S240 determines the corresponding target of the image to be retrieved from the target data cluster
Image.
Storage unit 1020 may include the readable medium of volatile memory cell form, such as Random Access Storage Unit
(RAM) 10201 and/or cache memory unit 10202, it can further include read-only memory unit (ROM) 10203.
Storage unit 1020 can also include program/utility with one group of (at least one) program module 10205
10204, such program module 10205 includes but is not limited to: operating system, one or more application program, other programs
It may include the realization of network environment in module and program data, each of these examples or certain combination.
Bus 1030 can be to indicate one of a few class bus structures or a variety of, including storage unit bus or storage
Cell controller, peripheral bus, graphics acceleration port, processing unit use any bus structures in a variety of bus structures
Local bus.
Electronic equipment 1000 can also be with one or more external equipments 1100 (such as keyboard, sensing equipment, bluetooth equipment
Deng) communication, can also be enabled a user to one or more equipment interact with the electronic equipment 1000 communicate, and/or with make
The electronic equipment 1000 can with it is one or more of the other calculating equipment be communicated any equipment (such as router, modulation
Demodulator etc.) communication.This communication can be carried out by input/output (I/O) interface 1050.Also, electronic equipment 1000
Network adapter 1060 and one or more network (such as local area network (LAN), wide area network (WAN) and/or public affairs can also be passed through
Common network network, such as internet) communication.As shown, network adapter 1060 passes through its of bus 1030 and electronic equipment 1000
The communication of its module.It should be understood that although not shown in the drawings, other hardware and/or software can be used in conjunction with electronic equipment 1000
Module, including but not limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, magnetic
Tape drive and data backup storage system etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the disclosure
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server, terminal installation or network equipment etc.) is executed according to disclosure embodiment
Method.
In addition, above-mentioned attached drawing is only the schematic theory of the processing according to included by the method for disclosure exemplary embodiment
It is bright, rather than limit purpose.It can be readily appreciated that the time that above-mentioned processing shown in the drawings did not indicated or limited these processing is suitable
Sequence.In addition, be also easy to understand, these processing, which can be, for example either synchronously or asynchronously to be executed in multiple modules.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure
His embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or
Adaptive change follow the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure or
Conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by claim
It points out.