CN110245714A - Image-recognizing method, device and electronic equipment - Google Patents

Image-recognizing method, device and electronic equipment Download PDF

Info

Publication number
CN110245714A
CN110245714A CN201910535939.0A CN201910535939A CN110245714A CN 110245714 A CN110245714 A CN 110245714A CN 201910535939 A CN201910535939 A CN 201910535939A CN 110245714 A CN110245714 A CN 110245714A
Authority
CN
China
Prior art keywords
image
feature vector
target
sample
cluster
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910535939.0A
Other languages
Chinese (zh)
Other versions
CN110245714B (en
Inventor
王辰龙
高岩
赵雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meitu Technology Co Ltd
Original Assignee
Xiamen Meitu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meitu Technology Co Ltd filed Critical Xiamen Meitu Technology Co Ltd
Priority to CN201910535939.0A priority Critical patent/CN110245714B/en
Publication of CN110245714A publication Critical patent/CN110245714A/en
Application granted granted Critical
Publication of CN110245714B publication Critical patent/CN110245714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a kind of image-recognizing method, device and electronic equipment, first passes through carry out feature extraction to training sample set and cluster operation obtains multiple cluster centres in advance, then obtain positive sample subset in multiple cluster centre belonging to cluster centre.When being identified to target image, the target feature vector of target image is calculated first, cluster centre belonging to the target feature vector is determined again, detect target feature vector belonging to cluster centre and cluster centre belonging to positive sample subset it is whether consistent, thus judge target image whether with any image in positive sample subset for same type.With this solution, by the way of clustering processing, the type of target image can accurately be determined.

Description

Image-recognizing method, device and electronic equipment
Technical field
This application involves graph processing technique fields, set in particular to a kind of image-recognizing method, device and electronics It is standby.
Background technique
With the development of internet technology, user often because various demands mobile phone is shot picture, screenshot picture Etc. being uploaded to social platform to be shared.The picture that social platform can upload user identify, some include to filter out The abnormal picture of privacy information or sensitive information.Currently, being usually using the identification mould for being trained acquisition by training sample Type identifies picture, this mode, when being trained to model, in order to learn model more preferably to this kind of abnormal picture Feature, therefore increase in training sample ratio shared by this kind of abnormal picture.But in practical situations, this kind of Abnormal Map Ratio shared by piece be it is minimum, cause to learn the feature of positive sample more and increase its proportion and positive sample picture exists Proportion is not consistent under actual conditions.Accordingly, there exist the practical institutes of the demand of the study to positive sample feature and positive sample Contradiction between accounting example.
Summary of the invention
In view of this, the embodiment of the present application is designed to provide a kind of image-recognizing method, device and electronic equipment, with Solve or improve the above problem.
In a first aspect, the embodiment of the present application provides a kind of image-recognizing method, which comprises
Target image is input to the disaggregated model that training obtains in advance to identify, exports the target of the target image Feature vector;
Target cluster centre belonging to the target feature vector is determined from preset multiple cluster centres, wherein each To be obtained to training sample set progress feature extraction and cluster operation in advance, the training sample set includes a cluster centre Positive sample subset and negative sample subset;
Whether consistent with candidate cluster center detect the target cluster centre, wherein the candidate cluster center is pre- The positive sample subset first obtained cluster centre affiliated in the multiple cluster centre;
According to the target cluster centre and the whether consistent testing result in candidate cluster center is detected, the target is judged Whether image with any one image in the positive sample subset belongs to same type.
Optionally, described from determining that target belonging to the target feature vector clusters in preset multiple cluster centres The step of heart, comprising:
Calculate the Euclidean distance between the target feature vector and preset each cluster centre;
Using the corresponding cluster centre of the minimum euclidean distance being calculated as target belonging to the target feature vector Cluster centre.
Optionally, the method also includes:
It concentrates each sample image for including to import the disaggregated model that training obtains in advance the training sample to know Not, the feature vector of each sample image is exported;
Cluster operation is carried out to the feature vector of each sample image, obtains multiple cluster centres;
Each positive sample image for including in the positive sample subset is imported the disaggregated model to identify, output is each Open the feature vector of positive sample image;
Obtain the feature vector of each positive sample image in the multiple cluster centre belonging to cluster centre as institute State candidate cluster center.
Optionally, the feature vector to each sample image carries out cluster operation, obtains the step of multiple cluster centres Suddenly, comprising:
Preset quantity feature vector is selected at random from the feature vector of multiple sample images, as in initial clustering The heart;
The feature vector of each sample image Euclidean distance between each initial cluster center respectively is calculated, for every Sample image is opened, using the smallest initial cluster center of the Euclidean distance between the feature vector of the sample image as this Initial cluster center belonging to the feature vector of sample image;
For at least two sample images of affiliated same initial cluster center, at least two sample images are calculated Feature vector central feature vector, according to the central feature vector to it belonging to initial cluster center deviate.
Optionally, described to concentrate each sample image for including to import the classification that training obtains in advance the training sample After the step of model is identified, exports the feature vector of each sample image, the method also includes:
Regularization principal component analysis processing is carried out to the feature vector of every sample image, training obtains regularization PCA throwing Shadow matrix;
The target image input disaggregated model that training obtains in advance of acquisition is identified, the target image is exported After the step of target feature vector, the method also includes:
Dimension-reduction treatment is carried out to the target feature vector using the regularization PCA projection matrix of acquisition.
Optionally, the feature vector to every sample image carries out regularization principal component analysis processing, and training obtains The step of regularization PCA projection matrix, comprising:
The dimension of the feature vector of the quantity and every sample image for the sample image for including according to the training sample set Degree constructs initial matrix;
The initial matrix is decomposed using regularization algorithm, obtains the regularization PCA projection matrix.
Optionally, the feature vector of regularization principal component analysis treated every sample image includes multi-C vector, institute State method further include:
Every one-dimensional vector mapping that feature vector by regularization principal component analysis treated each sample image includes On to corresponding solid axes;
Normalized is made to the standard deviation of the vector mapped on each solid axes;
For each sample image, carried out more according to feature vector of the vector after normalized to the sample image Newly.
Second aspect, the embodiment of the present application provide a kind of pattern recognition device, and described device includes:
Identification module is identified for target image to be input to the disaggregated model that training obtains in advance, described in output The target feature vector of target image;
Determining module, for determining the cluster of target belonging to the target feature vector from preset multiple cluster centres Center, wherein each cluster centre is obtained to training sample set progress feature extraction and cluster operation in advance, the instruction Practicing sample set includes positive sample subset and negative sample subset;
Detection module, it is whether consistent with candidate cluster center for detecting the target cluster centre, wherein the candidate Cluster centre be the positive sample subset that is obtained ahead of time in the multiple cluster centre belonging to cluster centre;
Judgment module, for being tied according to the whether consistent detection of the detection target cluster centre and candidate cluster center Fruit, judges whether the target image with any one image in the positive sample subset belongs to same type.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, including memory, processor and are stored in described deposit On reservoir and the computer program that can run on the processor, the processor are realized when executing the computer program State the method.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer program, The computer program realizes method described above when being executed by processor.
Image-recognizing method, device and electronic equipment provided by the embodiments of the present application, first pass through in advance to training sample set into Row feature extraction and cluster operation obtain multiple cluster centres, then obtain positive sample subset in multiple cluster centre belonging to Cluster centre.When identifying to target image, the target feature vector of target image is calculated first, then determines the target signature Cluster centre belonging to vector.Finally, cluster belonging to cluster centre belonging to detection target feature vector and positive sample subset Whether center consistent, thus judge target image whether with any image in positive sample subset for same type.In this way, being not necessarily to The classification results of direct basis disaggregated model carry out image recognition, and are detected using the matched mode of cluster centre, avoid In the prior art positive sample proportion is increased in order to more preferably learn the feature of positive sample, and the existing spy to positive sample There are contradictions between the demand and practical positive sample proportion of sign study, it is difficult to the problem of improving the accuracy of identification model.
To enable the above objects, features, and advantages of the embodiment of the present application to be clearer and more comprehensible, below in conjunction with embodiment, and Cooperate appended attached drawing, elaborates.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the schematic diagram of image identification system provided by the embodiments of the present application.
Fig. 2 is the flow chart of image-recognizing method provided by the embodiments of the present application.
Fig. 3 is the hierarchical structure schematic diagram of neural network model provided by the embodiments of the present application.
Fig. 4 is the flow chart of cluster centre provided by the embodiments of the present application and candidate cluster center acquisition methods.
Fig. 5 is the schematic effect picture of cluster centre provided by the embodiments of the present application.
Fig. 6 is the example components schematic diagram of electronic equipment provided by the embodiments of the present application.
Fig. 7 is the functional block diagram of pattern recognition device provided by the embodiments of the present application.
Icon: 10- image identification system;100- server;110- storage medium;120- processor;130- image recognition Device;131- identification module;132- determining module;133- detection module;134- judgment module;140- communication interface;200- is used Family terminal.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it should be understood that attached drawing in the application The purpose of illustration and description is only played, is not used to limit the protection scope of the application.In addition, it will be appreciated that schematical attached Figure does not press scale.Process used herein shows real according to some embodiments of the embodiment of the present application Existing operation.It should be understood that the operation of flow chart can be realized out of order, the step of context relation of logic can be with Reversal order is implemented simultaneously.In addition, those skilled in the art under the guide of teachings herein, can add to flow chart Other one or more operations, can also remove one or more operations from flow chart.
In addition, described embodiments are only a part of embodiments of the present application, instead of all the embodiments.Usually exist The component of the embodiment of the present application described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed the application's to the detailed description of the embodiments herein provided in the accompanying drawings below Range, but it is merely representative of the selected embodiment of the application.Based on embodiments herein, those skilled in the art are not being done Every other embodiment obtained under the premise of creative work out, shall fall in the protection scope of this application.
Fig. 1 show the schematic diagram of image identification system 10 provided by the embodiments of the present application, wherein the image identification system 10 social platforms that can be for realizing services such as picture sharings.The image identification system 10 may include server 100 and User terminal 200.User terminal 200 may include it is multiple, multiple user terminals 200 respectively with server 100 communicate to connect.With Family terminal 200 may be, but not limited to, the terminal devices such as smart phone, tablet computer, laptop.Wherein, user terminal It can be installed in 200 for providing the internet product of information sharing, for example, internet product can be computer or intelligent hand Application APP relevant to information sharing service, Web page, small routine etc. used in machine.User terminal 200 can will scheme The information such as piece are uploaded to social platform to be shared, wherein and picture can be the picture that the shooting of user terminal 200 obtains, It can be the resulting picture of screenshotss.
Server 100 can be the background server of the internet product of above information sharing service, for society It hands over the information of platform to be managed, can be individual server, be also possible to server cluster.
Fig. 2 shows the flow diagrams of image-recognizing method provided by the embodiments of the present application, which can The server 100 as shown in Fig. 1 executes.It should be appreciated that in other embodiments, the image-recognizing method of the present embodiment is wherein The sequence of part steps can be exchanged with each other according to actual needs or part steps therein also can be omitted or delete.It should The detailed step of image-recognizing method is described below.
Target image is input to the disaggregated model that training obtains in advance and identified, exports the target by step S210 The target feature vector of image.
Step S220, from determining that target belonging to the target feature vector clusters in preset multiple cluster centres The heart.
Whether consistent with candidate cluster center step S230 detects the target cluster centre.
Step S240 sentences according to the target cluster centre and the whether consistent testing result in candidate cluster center is detected Whether the target image that breaks with any one image in the positive sample subset belongs to same type.
User can be uploaded to server 100 by user terminal 200 by the information of desired sharing, such as picture.User institute The picture of sharing may have some pictures comprising privacy information, such as the picture comprising chat record including letter of transferring accounts The picture of breath or the picture comprising personally identifiable information etc..The picture that server 100 can upload user identifies, with determination It whether is this kind of picture comprising privacy information, if it is, the above-mentioned picture of user is filtered out, to avoid on platform It propagates, prevents the leakage of user privacy information.Or the open permission for browsing the picture of user of the picture is passed only up, and put down Other users on platform do not have browse right, to avoid getting privacy information by other people.
In the present embodiment, when obtaining the target image that user terminal 200 is uploaded, pass through the classification that training obtains in advance Model identifies target image, exports the target feature vector of target image.The disaggregated model, which can be, utilizes sample graph As (image comprising privacy information and the image without privacy information) is trained institute to Mobile Net neural network model It obtains.Obtained target feature vector can be the feature vector of 1024 dimensions.
Wherein, the disaggregated model obtained based on the training of Mobile Net neural network model can successively include convolutional layer (Conv layer), layer (Flatten layer) and full articulamentum (Fully Connected layer) are flattened, incorporated by reference to ginseng Read Fig. 3.It should be appreciated that disaggregated model may also include other hierarchical structures, such as excitation layer etc., here not to disaggregated model Specific hierarchical structure is defined.
When the target image of input is the image of 224x224x3 dimension, exportable 224 dimension of the full articulamentum of disaggregated model The class probability of target image.In the present embodiment, it is contemplated that there are accuracys is not high for the class probability that disaggregated model directly exports The shortcomings that, the output of the pressing layer of disaggregated model is obtained herein as a result, carrying out subsequent operation based on the output result.Wherein, it presses The output of leveling can be the feature vector of 1024 dimensions.
Then, then from preset multiple cluster centres cluster centre belonging to the target feature vector is determined.This is pre- If multiple cluster centres obtained to carry out feature extraction and cluster operation to training sample set in advance, the training sample set packet Include positive sample subset and negative sample subset.Wherein, positive sample subset may include multiple images, which is to believe comprising privacy The image of breath, such as can will include different types of privacy information comprising chat record, transfer information or personally identifiable information etc. Image be divided into different type.And the image for including in negative sample subset is the image not comprising privacy information, can be equally divided into A variety of different types.
In the present embodiment, whether target cluster centre belonging to detection target feature vector is consistent with candidate distance center, The candidate cluster center be positive sample set in above-mentioned multiple cluster centres belonging to cluster centre.It should be appreciated that just When in sample set including a variety of different types of images, then candidate cluster center is correspondingly multiple.
By detection target cluster centre and candidate cluster center it is whether consistent, thus judge target image whether with just Any one image in sample set belongs to same type.In target cluster centre and any one in candidate cluster center When consistent, figure corresponding to consistent cluster centre in the candidate cluster center in target image and positive sample subset can determine that As belonging to same type, otherwise, it may be determined that any one image in target image and positive sample subset is not belonging to same type, I.e. the target image does not include privacy information.
In the present embodiment, it in above-mentioned steps S220, can be determined in the following manner from preset multiple cluster centres Target cluster centre belonging to target feature vector:
Calculate the Euclidean distance between target feature vector and preset each cluster centre, the minimum Europe that will be calculated Formula is apart from corresponding cluster centre as target cluster centre belonging to the target feature vector.In the present embodiment, about target The specific calculating process of Euclidean distance between feature vector and each cluster centre can refer to the prior art, not go to live in the household of one's in-laws on getting married herein It states.
Referring to Fig. 4, in the present embodiment, above-mentioned multiple cluster centres and candidate cluster center can first pass through in advance with Lower step obtains:
The training sample is concentrated each sample image for including to import the classification mould that training obtains in advance by step S410 Type is identified, the feature vector of each sample image is exported.
Step S420 carries out cluster operation to the feature vector of each sample image, obtains multiple cluster centres.
Each positive sample image for including in the positive sample subset is imported the disaggregated model and known by step S430 Not, the feature vector of each positive sample image is exported.
Step S440, obtain each positive sample image feature vector in the multiple cluster centre belonging to cluster in The heart is as the candidate cluster center.
It can be seen from the above, it includes positive sample subset and negative sample subset that training sample, which is concentrated, i.e. training sample concentration includes Multiple sample images include the positive sample image with privacy information and negative sample image without privacy information.And it is wrapping In multiple the positive sample images contained again can be divided into different types of positive sample image, can according to comprising privacy information difference come Progress division, such as the positive sample image comprising chat record, the positive sample image comprising transfer information etc..Similarly, multiple Negative sample image can also be divided into a variety of different types, and various types of negative sample images are without privacy information comprising other The image of different types of information.
Each sample image that training sample is concentrated is identified using the disaggregated model that preparatory training obtains, is exported The feature vector of each sample image.The disaggregated model can be obtained by above-mentioned based on the training of Mobile Net neural network model The disaggregated model obtained.Cluster operation is carried out to the feature vector of each obtained sample image, obtains multiple cluster centres.
In the present embodiment, the K- based on CUDA (Compute Unified Device Architecture) can be used Mean clustering algorithm carries out cluster operation, optionally, preset quantity can be selected at random from the feature vector of multiple sample images A feature vector, such as 100 or 200 etc., as initial cluster center.Then, then the feature of each sample image is calculated The vector Euclidean distance between each initial cluster center respectively.For every sample image, by the spy with the sample image It levies initial belonging to a smallest feature vector of the initial cluster center as the sample image of Euclidean distance between vector Cluster centre.
In addition, being directed at least two sample images of affiliated same initial cluster center, at least two samples are calculated The central feature vector of the feature vector of this image, according to the central feature vector to it belonging to initial cluster center carry out it is inclined It moves.Wherein, which is the mean value of the feature vector of at least two sample images.Detectable obtained center is special Levy vector and its belonging to initial cluster center it is whether consistent, if inconsistent, using obtained central feature vector as update Initial cluster center afterwards, then converging operation is carried out based on updated initial cluster center, until obtained central feature to Until amount is consistent with initial cluster center, the corresponding multiple cluster centres of final training sample set are obtained.
In the present embodiment, vector between the complexity and dimension for the target feature vector that reduces in dimension The degree of association, can also carry out dimension-reduction treatment and whitening operation to obtained target feature vector.
After the target feature vector using disaggregated model output target image, thrown using the regularization PCA of acquisition Shadow matrix carries out dimension-reduction treatment to target feature vector.Wherein, regularization PCA projection matrix is by concentrating to training sample Every sample image feature vector carry out regularization principal component analysis processing and training obtain regularization PCA projection square Battle array.
It specifically, can be according to the quantity for the sample image that training sample set includes and the feature vector of every sample image Number of dimensions, construct initial matrix.Initial matrix is decomposed using regularization algorithm again, to obtain above-mentioned regularization PCA projection matrix.For example, it is 1000 that training sample, which concentrates the quantity of sample image, the feature vector of every sample image Dimension is 1024 dimensions, then can construct the initial matrix of a 1000*1024.It is decomposed to initial matrix using regularization algorithm again Afterwards, the base of the initial clustering is regularization PCA projection matrix.
The regularization PCA projection matrix obtained by training sample set can be used for the feature of image in positive sample subset to The dimension-reduction treatment of the target feature vector of the dimension-reduction treatment and target image of amount.
In addition, still including multi-C vector by the feature vector after dimension-reduction treatment, and the vector between each dimension It is larger in the degree of association, cause information redundancy.Therefore, in the present embodiment, by regularization principal component analysis treated each sample Every one-dimensional vector that the feature vector of this image includes maps on corresponding solid axes.Due on each solid axes Standard on data it is different, therefore, can the standard deviation again to the vector mapped on each solid axes make normalized.Needle To each sample image, it is updated according to feature vector of the vector after normalized to the sample image.To, so that The standard of the vector of each dimension of feature vector is unified, improves the accuracy of identification.
In the present embodiment, it is assumed that each sample image that training sample is concentrated carry out feature extraction and cluster operation it Afterwards, 400 cluster centres are produced, wherein each cluster centre is the central feature vector of 256 dimensions, can be in each cluster The heart carries out number consecutively, and the cluster centre of generation can dot as shown in Figure 5.To each positive sample figure in positive sample subset The cluster centre as belonging to the feature vector after feature extraction obtains corresponding feature vector, be calculated includes number For 49,234 and 380 cluster centre.It then can be determined that, the type for the image that these cluster centres are characterized is to need to carry out It filters out or image that permission limits, i.e. the image comprising the information such as chat record, transfer information or personal identification.
When formally being identified to target image, similarly, feature extraction is carried out to target image, then be calculated Target feature vector cluster centre affiliated in multiple cluster centres, if cluster centre belonging to target feature vector is number For any one in 49,234 or 380 cluster centre, it is determined that target image is the image comprising privacy information.Also, The specific cluster centre according to belonging to target image, determines the concrete type of target image.For example, if in positive sample subset Comprising chat record, transfer information, personally identifiable information image belonging to cluster centre be followed successively by 49,234 and 380 when.If Cluster centre belonging to target image is 49, then can determine that target image is the image comprising chat record.
Referring to Fig. 6, being the example components schematic diagram of electronic equipment provided by the embodiments of the present application, which can For server 100 shown in Fig. 1.The electronic equipment may include storage medium 110, processor 120, pattern recognition device 130 And communication interface 140.In the present embodiment, storage medium 110 is respectively positioned in electronic equipment with processor 120 and the two is separated and set It sets.It is to be understood, however, that storage medium 110 is also possible to independently of except electronic equipment, and can be by processor 120 It is accessed by bus interface.Alternatively, storage medium 110 is also desirably integrated into processor 120, for example, it may be high Speed caching and/or general register.
Pattern recognition device 130 can be understood as the processor 120 of above-mentioned electronic equipment or electronic equipment, can also manage Solution is to realize above-mentioned image-recognizing method under electronic equipment control independently of except above-mentioned electronic equipment or processor 120 Software function module.
As shown in fig. 7, above-mentioned pattern recognition device 130 may include identification module 131, determining module 132, detection module 133 and judgment module 134, the function of each functional module of the pattern recognition device 130 is described in detail separately below.
Identification module 131 identifies for target image to be input to the disaggregated model that training obtains in advance, exports institute State the target feature vector of target image.It is appreciated that the identification module 131 can be used for executing above-mentioned steps S210, about The detailed implementation of the identification module 131 is referred to above-mentioned to the related content of step S210.
Determining module 132, for determining target belonging to the target feature vector from preset multiple cluster centres Cluster centre, wherein each cluster centre is obtained to training sample set progress feature extraction and cluster operation in advance, institute Stating training sample set includes positive sample subset and negative sample subset.It is appreciated that the determining module 132 can be used for executing it is above-mentioned Step S220, the detailed implementation about the determining module 132 are referred to above-mentioned to the related content of step S220.
Detection module 133, it is whether consistent with candidate cluster center for detecting the target cluster centre, wherein described Candidate cluster center be the positive sample subset that is obtained ahead of time in the multiple cluster centre belonging to cluster centre.It can be with Understand, which can be used for executing above-mentioned steps S230, and the detailed implementation about the detection module 133 can With referring to above-mentioned to the related content of step S230.
Judgment module 134, for according to the detection target cluster centre and the whether consistent detection in candidate cluster center As a result, judging whether the target image with any one image in the positive sample subset belongs to same type.It can manage Solution, which can be used for executing above-mentioned steps S240, and the detailed implementation about the judgment module 134 can be with Referring to above-mentioned to the related content of step S240.
Further, the embodiment of the present application also provides a kind of computer readable storage medium, computer readable storage medium It is stored with machine-executable instruction, machine-executable instruction, which is performed, realizes image-recognizing method provided by the above embodiment.
In conclusion image-recognizing method provided by the embodiments of the present application, device and electronic equipment, first pass through in advance to training Sample set carries out feature extraction and cluster operation obtains multiple cluster centres, then obtains positive sample subset in multiple cluster centre In belonging to cluster centre.When identifying to target image, the target feature vector of target image is calculated first, then determining should Cluster centre belonging to target feature vector detects and gathers belonging to cluster centre belonging to target feature vector and positive sample subset Whether class center consistent, thus judge target image whether with any image in positive sample subset for same type.By this Scheme, by the way of clustering processing, accurately to determine the type of target image.In this way, being not necessarily to direct basis disaggregated model Classification results carry out image recognition, and detected using the matched mode of cluster centre, avoid in the prior art in order to More preferably learn the feature of positive sample and increases positive sample proportion, and the demand and reality of the existing feature learning to positive sample There are contradictions between the positive sample proportion of border, it is difficult to the problem of improving the accuracy of identification model.
The above is only the protection scopes of the specific embodiment of the application, but the application to be not limited thereto, any to be familiar with Those skilled in the art within the technical scope of the present application, can easily think of the change or the replacement, and should all cover Within the protection scope of the application.Therefore, the protection scope of the application should be subject to the protection scope in claims.

Claims (10)

1. a kind of image-recognizing method, which is characterized in that the described method includes:
Target image is input to the disaggregated model that training obtains in advance to identify, exports the target signature of the target image Vector;
Target cluster centre belonging to the target feature vector is determined from preset multiple cluster centres, wherein Ge Geju To be obtained to training sample set progress feature extraction and cluster operation in advance, the training sample set includes positive sample at class center This subset and negative sample subset;
Whether consistent with candidate cluster center detect the target cluster centre, wherein the candidate cluster center is to obtain in advance The positive sample subset obtained cluster centre affiliated in the multiple cluster centre;
According to the target cluster centre and the whether consistent testing result in candidate cluster center is detected, the target image is judged Whether with any one image in the positive sample subset same type is belonged to.
2. image-recognizing method according to claim 1, which is characterized in that described true from preset multiple cluster centres The step of target cluster centre belonging to the fixed target feature vector, comprising:
Calculate the Euclidean distance between the target feature vector and preset each cluster centre;
It is clustered the corresponding cluster centre of the minimum euclidean distance being calculated as target belonging to the target feature vector Center.
3. image-recognizing method according to claim 1, which is characterized in that the method also includes:
It concentrates each sample image for including to import the disaggregated model that training obtains in advance the training sample to identify, it is defeated The feature vector of each sample image out;
Cluster operation is carried out to the feature vector of each sample image, obtains multiple cluster centres;
Each positive sample image for including in the positive sample subset is imported the disaggregated model to identify, each of output is just The feature vector of sample image;
Obtain the feature vector of each positive sample image in the multiple cluster centre belonging to cluster centre as the time Select cluster centre.
4. image-recognizing method according to claim 3, which is characterized in that the feature vector to each sample image The step of carrying out cluster operation, obtaining multiple cluster centres, comprising:
Preset quantity feature vector is selected at random from the feature vector of multiple sample images, as initial cluster center;
The feature vector of each sample image Euclidean distance between each initial cluster center respectively is calculated, for every sample This image, using the smallest initial cluster center of the Euclidean distance between the feature vector of the sample image as the sample Initial cluster center belonging to the feature vector of image;
For at least two sample images of affiliated same initial cluster center, the spy of at least two sample images is calculated Levy vector central feature vector, according to the central feature vector to it belonging to initial cluster center deviate.
5. image-recognizing method according to claim 3, which is characterized in that described to include by training sample concentration Each sample image imports the disaggregated model that training obtains in advance and is identified, exports the step of the feature vector of each sample image After rapid, the method also includes:
Regularization principal component analysis processing is carried out to the feature vector of every sample image, training obtains regularization PCA projection square Battle array;
The target image input disaggregated model that training obtains in advance of acquisition is identified, the target of the target image is exported After the step of feature vector, the method also includes:
Dimension-reduction treatment is carried out to the target feature vector using the regularization PCA projection matrix of acquisition.
6. image-recognizing method according to claim 5, which is characterized in that the feature vector to every sample image Regularization principal component analysis processing is carried out, the step of obtaining regularization PCA projection matrix is trained, comprising:
The number of dimensions of the feature vector of the quantity and every sample image for the sample image for including according to the training sample set, Construct initial matrix;
The initial matrix is decomposed using regularization algorithm, obtains the regularization PCA projection matrix.
7. image-recognizing method according to claim 5, which is characterized in that regularization principal component analysis treated every The feature vector of sample image includes multi-C vector, the method also includes:
Every one-dimensional vector that feature vector by regularization principal component analysis treated each sample image includes maps to pair On the solid axes answered;
Normalized is made to the standard deviation of the vector mapped on each solid axes;
For each sample image, it is updated according to feature vector of the vector after normalized to the sample image.
8. a kind of pattern recognition device, which is characterized in that described device includes:
Identification module identifies for target image to be input to the disaggregated model that training obtains in advance, exports the target The target feature vector of image;
Determining module, for from determining that target belonging to the target feature vector clusters in preset multiple cluster centres The heart, wherein each cluster centre is obtained to training sample set progress feature extraction and cluster operation in advance, the training Sample set includes positive sample subset and negative sample subset;
Detection module, it is whether consistent with candidate cluster center for detecting the target cluster centre, wherein the candidate cluster Center be the positive sample subset that is obtained ahead of time in the multiple cluster centre belonging to cluster centre;
Judgment module, for sentencing according to the target cluster centre and the whether consistent testing result in candidate cluster center is detected Whether the target image that breaks with any one image in the positive sample subset belongs to same type.
9. a kind of electronic equipment, which is characterized in that including memory, processor and be stored on the memory and can be described The computer program run on processor, the processor are realized in the claims 1 to 7 when executing the computer program Described in any item methods.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt Such as method of any of claims 1-7 is realized when processor executes.
CN201910535939.0A 2019-06-20 2019-06-20 Image recognition method and device and electronic equipment Active CN110245714B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910535939.0A CN110245714B (en) 2019-06-20 2019-06-20 Image recognition method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910535939.0A CN110245714B (en) 2019-06-20 2019-06-20 Image recognition method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110245714A true CN110245714A (en) 2019-09-17
CN110245714B CN110245714B (en) 2021-08-20

Family

ID=67888384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910535939.0A Active CN110245714B (en) 2019-06-20 2019-06-20 Image recognition method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110245714B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143597A (en) * 2019-12-13 2020-05-12 浙江大华技术股份有限公司 Image retrieval method, terminal and storage device
CN111242124A (en) * 2020-01-13 2020-06-05 支付宝实验室(新加坡)有限公司 Certificate classification method, device and equipment
CN111753618A (en) * 2019-12-20 2020-10-09 北京沃东天骏信息技术有限公司 Image recognition method and device, computer equipment and computer readable storage medium
CN111931670A (en) * 2020-08-14 2020-11-13 成都数城科技有限公司 Depth image head detection and positioning method and system based on convolutional neural network
CN112749668A (en) * 2021-01-18 2021-05-04 上海明略人工智能(集团)有限公司 Target image clustering method and device, electronic equipment and computer readable medium
WO2021237967A1 (en) * 2020-05-29 2021-12-02 上海依图网络科技有限公司 Target retrieval method and apparatus

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122386A (en) * 2011-03-01 2011-07-13 西安电子科技大学 SAR (stop and reveres) image segmentation method based on dictionary migration clustering
CN102982349A (en) * 2012-11-09 2013-03-20 深圳市捷顺科技实业股份有限公司 Image recognition method and device
CN103955671A (en) * 2014-04-23 2014-07-30 浙江工业大学 Human behavior recognition method based on rapid discriminant common vector algorithm
US20140355871A1 (en) * 2012-06-15 2014-12-04 Vufind, Inc. System and method for structuring a large scale object recognition engine to maximize recognition accuracy and emulate human visual cortex
CN105138993A (en) * 2015-08-31 2015-12-09 小米科技有限责任公司 Method and device for building face recognition model
CN106845513A (en) * 2016-12-05 2017-06-13 华中师范大学 Staff detector and method based on condition random forest
CN107292314A (en) * 2016-03-30 2017-10-24 浙江工商大学 A kind of lepidopterous insects species automatic identification method based on CNN
CN107451565A (en) * 2017-08-01 2017-12-08 重庆大学 A kind of semi-supervised small sample deep learning image model classifying identification method
CN107643925A (en) * 2017-09-30 2018-01-30 广东欧珀移动通信有限公司 Background application method for cleaning, device, storage medium and electronic equipment
CN109389174A (en) * 2018-10-23 2019-02-26 四川大学 A kind of crowd massing Sensitive Image Detection Method
CN109711269A (en) * 2018-12-03 2019-05-03 辽宁工程技术大学 A kind of classification hyperspectral imagery algorithm for composing empty Fusion Features based on 3D convolution

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122386A (en) * 2011-03-01 2011-07-13 西安电子科技大学 SAR (stop and reveres) image segmentation method based on dictionary migration clustering
US20140355871A1 (en) * 2012-06-15 2014-12-04 Vufind, Inc. System and method for structuring a large scale object recognition engine to maximize recognition accuracy and emulate human visual cortex
CN102982349A (en) * 2012-11-09 2013-03-20 深圳市捷顺科技实业股份有限公司 Image recognition method and device
CN103955671A (en) * 2014-04-23 2014-07-30 浙江工业大学 Human behavior recognition method based on rapid discriminant common vector algorithm
CN105138993A (en) * 2015-08-31 2015-12-09 小米科技有限责任公司 Method and device for building face recognition model
CN107292314A (en) * 2016-03-30 2017-10-24 浙江工商大学 A kind of lepidopterous insects species automatic identification method based on CNN
CN106845513A (en) * 2016-12-05 2017-06-13 华中师范大学 Staff detector and method based on condition random forest
CN107451565A (en) * 2017-08-01 2017-12-08 重庆大学 A kind of semi-supervised small sample deep learning image model classifying identification method
CN107643925A (en) * 2017-09-30 2018-01-30 广东欧珀移动通信有限公司 Background application method for cleaning, device, storage medium and electronic equipment
CN109389174A (en) * 2018-10-23 2019-02-26 四川大学 A kind of crowd massing Sensitive Image Detection Method
CN109711269A (en) * 2018-12-03 2019-05-03 辽宁工程技术大学 A kind of classification hyperspectral imagery algorithm for composing empty Fusion Features based on 3D convolution

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴方奇: "空间目标的数字图像识别方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
黄韶杰: "基于聚类的煤岩分界图像识别技术研究", 《中国优秀博士学位论文全文数据库 工程科技I辑》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143597A (en) * 2019-12-13 2020-05-12 浙江大华技术股份有限公司 Image retrieval method, terminal and storage device
CN111143597B (en) * 2019-12-13 2023-06-20 浙江大华技术股份有限公司 Image retrieval method, terminal and storage device
CN111753618A (en) * 2019-12-20 2020-10-09 北京沃东天骏信息技术有限公司 Image recognition method and device, computer equipment and computer readable storage medium
CN111242124A (en) * 2020-01-13 2020-06-05 支付宝实验室(新加坡)有限公司 Certificate classification method, device and equipment
CN111242124B (en) * 2020-01-13 2023-10-31 支付宝实验室(新加坡)有限公司 Certificate classification method, device and equipment
WO2021237967A1 (en) * 2020-05-29 2021-12-02 上海依图网络科技有限公司 Target retrieval method and apparatus
CN111931670A (en) * 2020-08-14 2020-11-13 成都数城科技有限公司 Depth image head detection and positioning method and system based on convolutional neural network
CN111931670B (en) * 2020-08-14 2024-05-31 成都数城科技有限公司 Depth image head detection and positioning method and system based on convolutional neural network
CN112749668A (en) * 2021-01-18 2021-05-04 上海明略人工智能(集团)有限公司 Target image clustering method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN110245714B (en) 2021-08-20

Similar Documents

Publication Publication Date Title
CN110245714A (en) Image-recognizing method, device and electronic equipment
Zhang et al. Celeba-spoof: Large-scale face anti-spoofing dataset with rich annotations
TWI773189B (en) Method of detecting object based on artificial intelligence, device, equipment and computer-readable storage medium
CN112200062B (en) Target detection method and device based on neural network, machine readable medium and equipment
CN109034159A (en) image information extracting method and device
CN109949296A (en) A kind of transmission line of electricity defect identification method, device and storage medium
CN108537269A (en) A kind of the object detection deep learning method and its system of weak interactive mode
CN106022317A (en) Face identification method and apparatus
CN112215171B (en) Target detection method, device, equipment and computer readable storage medium
Yan et al. Multiscale convolutional neural networks for hand detection
CN109408821A (en) A kind of corpus generation method, calculates equipment and storage medium at device
CN107679457A (en) User identity method of calibration and device
CN109977832A (en) A kind of image processing method, device and storage medium
CN111444826A (en) Video detection method and device, storage medium and computer equipment
CN111027576A (en) Cooperative significance detection method based on cooperative significance generation type countermeasure network
Xie et al. A method for surface defect detection of printed circuit board based on improved YOLOv4
CN108446659A (en) Method and apparatus for detecting facial image
US20210357644A1 (en) Explanatory visualizations for object detection
CN116701706B (en) Data processing method, device, equipment and medium based on artificial intelligence
CN110059748A (en) Method and apparatus for output information
Yu Accurate recognition method of human body movement blurred image gait features using graph neural network
CN109376602A (en) A kind of finger vein identification method, device and terminal device
CN115115869A (en) Business image labeling method and device, electronic equipment and computer program product
Dong et al. Pedestrian detection in metro station based on improved ssd
CN114267064A (en) Face recognition method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant