CN108197225A - Sorting technique, device, storage medium and the electronic equipment of image - Google Patents

Sorting technique, device, storage medium and the electronic equipment of image Download PDF

Info

Publication number
CN108197225A
CN108197225A CN201711466322.5A CN201711466322A CN108197225A CN 108197225 A CN108197225 A CN 108197225A CN 201711466322 A CN201711466322 A CN 201711466322A CN 108197225 A CN108197225 A CN 108197225A
Authority
CN
China
Prior art keywords
sample
image
feature
classification
sample set
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
CN201711466322.5A
Other languages
Chinese (zh)
Other versions
CN108197225B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711466322.5A priority Critical patent/CN108197225B/en
Publication of CN108197225A publication Critical patent/CN108197225A/en
Application granted granted Critical
Publication of CN108197225B publication Critical patent/CN108197225B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers

Landscapes

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

Abstract

The embodiment of the present application discloses a kind of sorting technique of image, device, storage medium and electronic equipment, wherein, the method for pushing is included when detecting that image is moved to the operation of class library, and the corresponding multidimensional characteristic of acquisition image builds the corresponding sample set of multiple class libraries as sample;Sample classification is carried out to sample set for the information gain of sample classification according to feature, to construct the decision-tree model of class library, the output of decision-tree model is corresponding multiple class libraries;When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;Corresponding class library is predicted according to forecast sample and decision-tree model.The intelligent classification of image is realized with this, improves the classification accuracy of image.

Description

Sorting technique, device, storage medium and the electronic equipment of image
Technical field
This application involves fields of communication technology, and in particular to a kind of sorting technique of image, device, storage medium and electronics Equipment.
Background technology
At present, with the high speed development of terminal technology, among increasingly going deep into people’s lives such as smart mobile phone, user is past It is largely applied, such as application of taking pictures, game application, map application toward that can be installed on smart mobile phone.
Wherein, user often classifies to photo, after by taking pictures using shooting photo according to demand by photo It is put into corresponding classification folder, so that next time can be quickly found out in classification folder, still, when the quantity of photo reaches During to certain range, each photo manually is put into corresponding classification folder can waste user time, and operate Process is extremely cumbersome, solves the above problems therefore, it is necessary to provide a kind of method.
Invention content
In view of this, the embodiment of the present application provides a kind of sorting technique of image, device, storage medium and electronics and sets It is standby, can classification processing quickly be carried out to image, and improve the accuracy of image classification.
In a first aspect, a kind of sorting technique of image that provides of the embodiment of the present application, including:
When detecting that image is moved to the operation of class library, the corresponding multidimensional characteristic of acquisition described image as sample, And build the corresponding sample set of multiple class libraries;
Sample classification is carried out to the sample set for the information gain of sample classification according to the feature, to construct point The decision-tree model of class libraries, the output of the decision-tree model is corresponding multiple class libraries;
When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;
Corresponding class library is predicted according to the forecast sample and the decision-tree model.
Second aspect, a kind of sorter of image that provides of the embodiment of the present application, including:
First collecting unit, for when detecting that image is moved to the operation of class library, acquisition described image to be corresponding Multidimensional characteristic builds the corresponding sample set of multiple class libraries as sample;
Building block, for carrying out sample point to the sample set for the information gain of sample classification according to the feature Class, to construct the decision-tree model of class library, the output of the decision-tree model is corresponding multiple class libraries;
Second collecting unit, for when detecting image classification instruction, acquiring the corresponding multidimensional characteristic of image to be classified As forecast sample;
Predicting unit, for predicting corresponding class library according to the forecast sample and the decision-tree model.
The third aspect, storage medium provided by the embodiments of the present application, is stored thereon with computer program, when the computer When program is run on computers so that the computer performs the classification side of the image provided such as the application any embodiment Method.
Fourth aspect, electronic equipment provided by the embodiments of the present application, including processor and memory, the memory has meter Calculation machine program, which is characterized in that the processor is by calling the computer program, for performing such as any implementation of the application The sorting technique for the image that example provides.
The embodiment of the present application is by the way that when detecting that image is moved to the operation of class library, the corresponding multidimensional of acquisition image is special Sign builds the corresponding sample set of multiple class libraries as sample;According to feature for sample classification information gain to sample Collection carries out sample classification, and to construct the decision-tree model of class library, the output of decision-tree model is corresponding multiple class libraries; When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;According to forecast sample Corresponding class library is predicted with decision-tree model.The intelligent classification of image is realized with this, the classification for improving image is accurate Rate.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is the application scenarios schematic diagram of the sorting technique of image provided by the embodiments of the present application.
Fig. 2 is a flow diagram of the sorting technique of image provided by the embodiments of the present application.
Fig. 3 is a kind of schematic diagram of decision tree provided by the embodiments of the present application.
Fig. 4 is the schematic diagram of another decision tree provided by the embodiments of the present application.
Fig. 5 is another flow diagram of the sorting technique of image provided by the embodiments of the present application.
Fig. 6 is a structure diagram of the sorter of image provided by the embodiments of the present application.
Fig. 7 is another structure diagram of the sorter of image provided by the embodiments of the present application.
Fig. 8 is a structure diagram of electronic equipment provided by the embodiments of the present application.
Fig. 9 is another structure diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Schema is please referred to, wherein identical element numbers represent identical component, the principle of the application is to implement one It is illustrated in appropriate computing environment.The following description be based on illustrated the application specific embodiment, should not be by It is considered as limitation the application other specific embodiments not detailed herein.
In the following description, the specific embodiment of the application will be with reference to as the step performed by one or multi-section computer And symbol illustrates, unless otherwise stating clearly.Therefore, these steps and operation will have to mention for several times is performed by computer, this paper institutes The computer execution of finger includes by representing with the computer processing unit of the electronic signal of the data in a structuring pattern Operation.This operation is converted at the data or the position being maintained in the memory system of the computer, reconfigurable Or in addition change the running of the computer in a manner of known to the tester of this field.The data structure that the data are maintained For the provider location of the memory, there is the specific feature as defined in the data format.But the application principle is with above-mentioned text Word illustrates that be not represented as a kind of limitation, this field tester will appreciate that plurality of step as described below and behaviour Also it may be implemented in hardware.
Term as used herein " module " can regard the software object to be performed in the arithmetic system as.It is as described herein Different components, module, engine and service can be regarded as the objective for implementation in the arithmetic system.And device as described herein and side Method can be implemented in a manner of software, can also be implemented on hardware certainly, within the application protection domain.
Term " first ", " second " and " third " in the application etc. is for distinguishing different objects rather than for retouching State particular order.In addition, term " comprising " and " having " and their any deformations, it is intended that cover non-exclusive include. Such as contain the step of process, method, system, product or the equipment of series of steps or module is not limited to list or Module, but some embodiments further include the step of not listing or module or some embodiments further include for these processes, Method, product or equipment intrinsic other steps or module.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.
The embodiment of the present application provides a kind of sorting technique of image, and the executive agent of the sorting technique of the image can be this The electronic equipment of the sorter for applying for the image that embodiment provides or the sorter for being integrated with the image, the wherein figure Hardware may be used in the sorter of picture or the mode of software is realized.Wherein, electronic equipment can be smart mobile phone, tablet electricity The equipment such as brain, palm PC, laptop or desktop computer.
Referring to Fig. 1, Fig. 1 is the application scenarios schematic diagram of the sorting technique of image provided by the embodiments of the present application, to scheme For the sorter of picture integrates in the electronic device, when detecting that image is moved to the operation of class library, the figure is acquired As corresponding multidimensional characteristic is as sample, and builds the corresponding sample set of multiple class libraries;According to the feature for sample point The information gain of class carries out sample classification to the sample set, to construct the decision-tree model of class library, the decision tree mould The output of type is corresponding multiple class libraries;When detecting image classification instruction, the corresponding multidimensional of acquisition image to be classified is special Sign is as forecast sample;Corresponding class library is predicted according to the forecast sample and the decision-tree model.
It specifically, can be in historical time section, when the operation for detecting image and being moved to class library such as shown in Fig. 1 When, the corresponding multidimensional characteristic (brightness, textural characteristics, contrast metric etc.) of acquisition image builds classification as sample The corresponding sample set in library;According to feature (brightness, textural characteristics, contrast metric etc.) for the information gain of sample classification Sample classification is carried out to sample set, to construct the decision-tree model of class library;When detecting user images sort instructions, adopt Collect the corresponding multidimensional characteristic (brightness, textural characteristics, contrast metric etc.) of image to be classified as forecast sample, according to pre- Test sample sheet and decision-tree model predict corresponding class library.And the image to be classified is moved in the class library, to complete Sort operation.
Referring to Fig. 2, Fig. 2 is the flow diagram of the sorting technique of image provided by the embodiments of the present application.The application is real The idiographic flow for applying the sorting technique of the image of example offer can be as follows:
201st, when detecting that image is moved to the operation of class library, the corresponding multidimensional characteristic of acquisition image as sample, And build the corresponding sample set of multiple class libraries.
Class library mentioned by the present embodiment, can be the file in electronic equipment, and the storage of current electronic device is empty Between it is increasing, can store image quantity also correspond to it is increasing, it is therefore desirable to different classes of image is put into different In file, management to be facilitated to search.Further, multiple files can be included, user can be named file. Such as figure kind's file and landscape class file folder.
Wherein, which has the dimension of certain length, the corresponding characterization destination of the parameter in each of which dimension A kind of characteristic information, i.e., the multidimensional characteristic breath be made of multiple features.Multiple feature can be moved to classification including image During library, the corresponding relevant characteristic information of image, such as:Current luminance information;Current texture information;Current contrast Information etc..
Wherein, the sample set of class library can include multiple samples, and each sample includes the corresponding multidimensional of each class library Feature.In the sample set of class library, it can include in historical time section, multiple samples of the class library of acquisition.Historical time Section, such as can be 7 days, 14 days etc. in the past.It is understood that the multi-dimensional feature data of the class library once acquired forms one A sample, multiple samples form sample set.
After sample set is formed, each sample in sample set can be marked, obtain the sample of each sample Label, since this implementation will be accomplished that the corresponding class library of prognostic chart picture, the sample label marked includes multiple points Class libraries namely sample class are multiple class libraries.
202nd, sample classification is carried out to sample set for the information gain of sample classification according to feature, to construct class library Decision-tree model.
The embodiment of the present application can carry out sample classification for the information gain of sample classification with feature based to sample set, with Build the decision-tree model of class library.For example, can decision-tree model be built based on ID3 algorithms.
Wherein, decision tree is a kind of a kind of tree relied on decision and set up.In machine learning, decision tree is a kind of Prediction model, representative is a kind of a kind of mapping relations between object properties and object value, some is right for each node on behalf As, each diverging paths in tree represent some possible property value, and each leaf node then correspond to from root node to The value of the object represented by path that the leaf node is undergone.Decision tree only has single output, can be with if there is multiple outputs Independent decision tree is established respectively to handle different output.
Wherein, ID3 (Iterative Dichotomiser 3,3 generation of iteration binary tree) algorithm is one kind of decision tree, it It is based on "ockham's razor" principle, i.e., with doing more things with less thing as possible.In information theory, it is expected that information is got over It is small, then information gain is bigger, so as to which purity is higher.The core concept of ID3 algorithms is exactly to be belonged to information gain to measure Property selection, the attribute of information gain maximum is into line splitting after selection division.The algorithm uses top-down greedy search time Go through possible decision space.
Wherein, information gain exactly sees a feature t for feature one by one, and system has it and do not have It when information content be respectively how many, the difference of the two is exactly the information content that this feature is brought to system, i.e. information gain.
The process classified based on information gain to sample set is described in detail below, for example, assorting process can wrap Include following steps:
Corresponding root node is generated, and using sample set as the nodal information of root node;
The sample set of root node is determined as current target sample collection to be sorted;
Obtain the information gain that feature classifies for sample set in target sample collection;
Current division feature is chosen from feature according to information gain selection;
Sample set is divided according to feature is divided, obtains several subsample collection;
The division feature of sample in sub- sample set is removed, subsample collection after being removed;
The child node of present node is generated, and using subsample collection after removal as the nodal information of child node;
Judge whether child node meets default classification end condition;
If it is not, target sample collection then is updated to subsample collection after removing, and returns to execution and obtain spy in target sample collection Levy the information gain classified for sample set;
If so, using child node as leaf node, the classification for concentrating sample according to subsample after removal sets leaf section The output of point, the classification of sample is corresponding multiple class libraries.
Wherein, it divides and is characterized as the feature chosen from feature according to the information gain that each feature classifies for sample set, For classifying to sample set.Wherein, there are many modes that division feature is chosen according to information gain, such as in order to promote sample point The accuracy of class, can choose maximum information gain it is corresponding be characterized as divide feature.
Wherein, the classification of sample is corresponding multiple class library classifications.
When child node meets default classification end condition, can it stop to the son using child node as leaf node The sample set classification of node, and can concentrate the classification of sample that the output of the leaf node is set based on subsample after removal. There are many modes of the output of classification setting leaf node based on sample.It for example, can be by sample number in sample set after removal Measure output of most classifications as the leaf node.
Wherein, presetting classification end condition can set according to actual demand, and child node meets default classification and terminates item During part, using current node as leaf node, stop the corresponding sample set to child node and carry out participle classification;Child node is not When meeting default classification end condition, continue the corresponding sample set to child node and classify.For example, default classification end condition It can include:The categorical measure of sample is in the set of subsample after the removal of child node and preset quantity namely step " judge son Whether node meets default classification end condition " it can include:
Subsample concentrates whether the categorical measure of sample is preset quantity after judging the corresponding removal of child node;
If so, determine that child node meets default classification end condition;
If not, it is determined that child node is discontented with default classified terminal end condition.
For example, default classification end condition can include:The classification of sample is concentrated in subsample after the corresponding removal of child node Quantity be 1 namely the sample set of child node in only there are one classification sample.At this point, if child node meets the default classification End condition, then, the classification of sample is concentrated into as the output of the leaf node in subsample.Subsample is concentrated only after such as removing When having the sample that classification is " class library 1 ", then, it can be by the output of " class library 1 " as the leaf node.
In one embodiment, in order to promote the accuracy of determination of decision-tree model, a gain threshold can also be set;When When maximum information gain is more than the threshold value, just choose the information gain for feature to divide feature.That is, step " root Current division feature is chosen from feature according to information gain selection " it can include:
Maximum target information gain is chosen from information gain;
Judge whether target information gain is more than predetermined threshold value;
If so, the corresponding feature of target information gain is chosen as current division feature.
It in one embodiment, can be using present node as leaf section when target information gain is not more than predetermined threshold value Point, and choose output of the most sample class of sample size as the leaf node.Wherein, sample class is corresponding classification Library.
Wherein, predetermined threshold value can be set according to actual demand, such as 0.9,0.8.
For example, when feature 1 for sample classification information gain 0.9 be maximum information gain when, predetermined threshold value 0.8 When, since maximum information gain is more than predetermined threshold value, at this point it is possible to using feature 1 as division feature.
In another example when predetermined threshold value is 1, then maximum information gain is less than predetermined threshold value, at this point it is possible to will work as prosthomere Point understands sample set analysis classification is most for the sample size of " class library 2 ", is more than other classifications as leaf node The sample size of " class library 1 ", at this point it is possible to by the output of " class library 2 " as the leaf node.
In one embodiment, sample is carried out there are many modes of classifying and dividing, for example, can be with base according to division feature Sample set is divided in the characteristic value for dividing feature.Namely step " being divided according to feature is divided to sample set " can To include:
Obtain the characteristic value that feature is divided in sample set;
Sample set is divided according to characteristic value.
It is concentrated for example, can will divide the identical sample of characteristic value in sample set and be divided into same subsample.For example, it divides The characteristic value of feature includes:0th, 1,2, then at this point it is possible to the sample that the characteristic value for dividing feature is 0 be classified as it is a kind of, by feature The sample being worth for 1 is classified as sample that is a kind of, being 2 by characteristic value and is classified as one kind.
For example, for sample set A { sample 1, sample 2 ... sample i ... samples n }, wherein sample 1 includes feature 1, spy Sign 2 ... feature m, sample i include feature 1, feature 2 ... feature m, sample n include feature 1, feature 2 ... feature m.
First, samples all in sample set are initialized, then, generate a root node a, and using sample set as The nodal information of root node a, such as with reference to figure 3.
Calculate each feature information gain g1, g2 ... gm that for example feature 1, feature 2 ... feature m classify for sample set; Maximum information gain gmax is chosen, if gi is maximum information gain.
When maximum information gain gmax is less than predetermined threshold value ε, current node chooses sample number as leaf node Measure output of most sample class as leaf node.
When maximum information gain gmax is more than predetermined threshold value ε, the corresponding feature i conducts of information gain gmax can be chosen Feature t is divided, sample set A { sample 1, sample 2 ... sample i ... samples n } is divided according to feature i, such as by sample Collection is divided into two sub- sample set A1 { sample 1, sample 2 ... sample k } and A2 { sample k+1 ... samples n }.
Feature t removal will be divided in subsample collection A1 and A2, at this point, in subsample collection A1 and A2 sample include feature 1, Feature 2 ... feature i-1, feature i+1 ... features n }.Generate the child node a1 and a2 of root node a with reference to figure 3, and by increment This collection A1 as the nodal information of child node a1, using subsample collection A2 as the nodal information of child node a2.
Then, for each child node, by taking child node a1 as an example, judge whether child node meets default classification and terminate item Part, if so, using current child node a1 as leaf node, and according to the class of the corresponding subsample concentration samples of child node a1 The leaf node is not set to export.
When child node is unsatisfactory for default classification end condition, by the way of the above-mentioned classification based on information gain, continue To child node, corresponding subsample collection is classified, can such as be calculated by taking child node a2 as an example in A2 sample sets each feature relative to The information gain g of sample classification chooses maximum information gain gmax, when maximum information gain gmax is more than predetermined threshold value ε When, can choose information gain gmax it is corresponding be characterized as divide feature t, based on divide feature t A2 is divided into several sons A2 can be such as divided into subsample collection A21, A22, A23 by sample set, then, by the division in subsample collection A21, A22, A23 Feature t is removed, and generates child node a21, a22, a23 of present node a2, will remove the sample set A21 after dividing feature t, A22, A23 are respectively as the nodal information of child node a21, a22, a23.
And so on, decision tree as shown in Figure 4 is may be constructed out using the above-mentioned mode based on information gain classification, The output of the leaf node of the decision tree includes multiple class libraries.
In the embodiment of the present application, empirical entropy that can be based on sample classification and feature are for the item of sample set classification results Part entropy obtains the information gain that feature classifies for sample set.Namely " feature is for sample set in acquisition target sample collection for step The information gain of classification " can include:
Obtain the empirical entropy of sample classification;
Obtain conditional entropy of the feature for sample set classification results;
According to conditional entropy and empirical entropy, the information gain that feature classifies for sample set is obtained.
Wherein it is possible to the probability that each class library sample occurs in sample set is obtained, the sample class of the class library sample Not Wei corresponding multiple class libraries, according to the probability of each class library obtain sample empirical entropy.
For example, for sample set Y { sample 1, sample 2 ... sample i ... samples n }, if sample class is " class library The sample size of 1 " sample is j, and the sample size of " class library 2 " sample is n-j;At this point, " class library 1 " sample is in sample set Y In appearance Probability p 1=j/n, the probability of occurrence p2=n-j/n of " class library 2 " in sample set Y.Then, based on passing through below The calculation formula of entropy is tested, calculates the empirical entropy H (Y) of sample classification:
Wherein, pi is probability of occurrence of the sample in sample set Y.In decision tree classification problem, information gain is exactly certainly The difference of plan tree information before carrying out Attributions selection and dividing and after dividing.
In one embodiment, can sample set be divided by several subsample collection according to feature t, then, obtains each increment The probability that the comentropy of this collection classification and each characteristic value of this feature t occur in sample set, according to the comentropy and is somebody's turn to do Probability can be divided after comentropy, i.e., this feature t is for the conditional entropy of sample set classification results.
For example, for sample characteristics X, sample characteristics X can be by following for the conditional entropy of sample set Y classification results Formula is calculated:
Wherein, n is characterized the value kind number of X, i.e. characteristic value number of types.At this point, it is i-th kind of value that pi, which is X characteristic values, The probability that occurs in sample set Y of sample, xi is i-th kind of value of X.H (Y | X=xi) it is the experience that subsample collection Yi classifies Entropy, the X characteristic values of sample are i-th kind of value in the collection i of the subsample.
For example, using the value kind number of feature X as 3, i.e., for x1, x2, x3, at this point it is possible to which feature X is by sample set Y { samples 1st, sample 2 ... sample i ... samples n } three sub- sample sets are divided into, characteristic value is Y1 { sample 1, sample 2 ... the sample of x1 This d }, the Y2 { sample d+1 ... samples e } that characteristic value is x2, the Y3 { sample e+1 ... samples n } that characteristic value is x3.D, e is equal For positive integer, and less than n.
At this point, feature X is for the conditional entropy of sample set Y classification results:
H (Y | X)=p1H (Y | x1)+p2H (Y | x2)+p3H (Y | x3);
Wherein, p1=Y1/Y, p2=Y2/Y, p2=Y3/Y;
H (Y | x1) it is the comentropy that subsample collection Y1 classifies, i.e. empirical entropy, the calculation formula of above-mentioned empirical entropy can be passed through It is calculated.
In the empirical entropy H (Y) and feature X for obtaining sample classification for the conditional entropy H (Y | X) of sample set Y classification results Afterwards, the information gain that feature X classifies for sample set Y can be calculated, is such as calculated by the following formula:
G (Y, X)=H (Y)-H (Y | X)
Namely feature X is for the sample set Y information gains classified:Empirical entropy H (Y) and feature X classifies for sample set Y As a result the difference of conditional entropy H (Y | X).
203rd, when detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample.
Wherein, image classification instruction instruction user needs to carry out image sort operation, therefore is based on detecting image point When class instructs, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample.
It should be strongly noted that in the embodiment of the present application, the multidimensional characteristic acquired in step 201 and 203 is identical spy Sign, such as:Current luminance information;Current texture information;Current contrast information etc..
204th, corresponding class library is predicted according to forecast sample and decision-tree model.
Specifically, corresponding output is obtained according to forecast sample and decision-tree model as a result, being determined pair according to output result The class library answered.Wherein, output result includes each class library.
For example, can corresponding leaf node be determined according to the feature and decision-tree model of forecast sample, by the leaf section The output of point is as prediction output result.Current leaf is such as determined according to the branch condition of decision tree using the feature of forecast sample Child node takes result of the output of the leaf node as prediction.Since the output of leaf node includes multiple class libraries.Cause This, can obtain the class library that image to be classified corresponds to classification.
For example, after the multidimensional characteristic of acquisition image to be classified, it can be with point according to decision tree in decision tree shown in Fig. 4 The corresponding leaf node of branch conditional search is an1, and the output of leaf node an1 is class library 1, at this point, just determining that this is to be sorted The corresponding class library of image is class library 1.
From the foregoing, it will be observed that the embodiment of the present application is by when detecting that image is moved to the operation of class library, acquiring image pair The multidimensional characteristic answered builds the corresponding sample set of multiple class libraries as sample;According to feature for the information of sample classification Gain carries out sample classification to sample set, and to construct the decision-tree model of class library, the output of decision-tree model is corresponding Multiple class libraries;When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;Root It is predicted that sample and decision-tree model predict corresponding class library.The intelligent classification of image is realized with this, improves image Classification accuracy.
Further, image is moved to each point usually due in each sample of sample set, including reflection user Multiple characteristic informations of the behavioural habits of class libraries, thus the embodiment of the present application can cause the classification to image it is more personalized and It is intelligent.
Further, it realizes that the classification of image is predicted based on decision tree prediction model, the standard of image classification can be promoted True property is more bonded the use habit of user.
Below by the basis of the method described in above-described embodiment, the sorting technique of the application is described further.Ginseng Fig. 5 is examined, the sorting technique of the image can include:
301st, when detecting that image is moved to the operation of class library, the corresponding multidimensional characteristic of acquisition image as sample, And build the corresponding sample set of multiple class libraries.
Wherein, when detecting user by image and being moved to the operation of class library, as image is moved to class library 1 by user When middle, the corresponding multidimensional characteristic of the image is acquired as sample.
The multidimensional characteristic information of application has the dimension of certain length, the corresponding characterization image of the parameter in each of which dimension A kind of characteristic information, i.e. the multidimensional characteristic information is made of multiple characteristic informations.Multiple characteristic information can include scheming As the relevant characteristic information of image when being moved to class library, such as:Current luminance information;Current texture information;Currently Contrast information;Current saturation infromation;Current color range information etc..
In the sample set of class library, the multiple samples acquired in historical time section can be included.Historical time section, such as It can be 7 days, 14 days etc. in the past.It is understood that once the multi-dimensional feature data of acquisition class library forms a sample, it is more A sample forms sample set.
One specific sample can be as shown in table 1 below, includes the characteristic information of multiple dimensions, it should be noted that 1 institute of table The characteristic information shown is only for example, and in practice, the quantity of characteristic information that a sample is included can be more than than shown in table 1 The quantity of information can also be less than the quantity of information shown in table 1, and the specific features information taken can also be different from shown in table 1, It is not especially limited herein.
Dimension Characteristic information
1 Current luminance information
2 Current texture information
3 Current contrast information
4 Current saturation infromation
5 Current color range information
Table 1
302nd, the sample in sample set is marked, obtains the sample label of each sample.
Since this implementation will be accomplished that prediction class library, the sample label marked includes each class library.It should The sample label of sample characterizes the sample class of the sample.At this point, sample class can " class library 1 ", " class library 2 " etc..
303rd, the root node of decision-tree model is generated, and using sample set as the nodal information of root node.
For example, with reference to figure 3, for sample set A { sample 1, sample 2 ... sample i ... samples n }, can first generate certainly The root node a of plan tree, and using sample set A as the nodal information of root node a.
304th, determine sample set for current target sample collection to be sorted.
Namely the sample set of determining root node is as current target sample collection to be sorted.
305th, the information gain that each feature classifies for sample set in target sample collection is obtained, and determines that maximum information increases Benefit.
For example, for sample set A, each feature can be calculated as feature 1, feature 2 ... feature m classify for sample set Information gain g1, g2 ... gm;Choose maximum information gain gmax.
Wherein, following manner acquisition may be used in the information gain that feature classifies for sample set:
Obtain the empirical entropy of sample classification;Obtain conditional entropy of the feature for sample set classification results;According to conditional entropy and Empirical entropy obtains the information gain that feature classifies for sample set.
For example, each class library classification can be obtained.
The probability that each class library sample occurs in sample set can be obtained, it is pair which, which is sample class, The class library answered obtains the empirical entropy of sample according to the probability of each class library.
For example, by taking the sample class of class library sample only " class library 1 " and " class library 2 " as an example, for sample set Y { sample 1, sample 2 ... sample i ... samples n }, if the sample size that sample class is " class library 1 " is j, " class library 2 " sample size is n-j;At this point, the probability of occurrence p1=j/n of " class library 1 " in sample set Y, " class library 2 " is in sample Collect the probability of occurrence p2=n-j/n in Y.Then, the calculation formula based on following empirical entropy calculates the empirical entropy of sample classification H(Y):
In decision tree classification problem, information gain is exactly decision tree information after carrying out Attributions selection and dividing preceding and division Difference.
In one embodiment, can sample set be divided by several subsample collection according to feature t, then, obtains each increment The probability that the comentropy of this collection classification and each characteristic value of this feature t occur in sample set, according to the comentropy and is somebody's turn to do Probability can be divided after comentropy, i.e., this feature t is for the conditional entropy of sample set classification results.
For example, for sample characteristics X, sample characteristics X can be by following for the conditional entropy of sample set Y classification results Formula is calculated:
Wherein, n is characterized the value kind number of X, i.e. characteristic value number of types.At this point, it is i-th kind of value that pi, which is X characteristic values, The probability that occurs in sample set Y of sample, xi is i-th kind of value of X.H (Y | X=xi) it is the experience that subsample collection Yi classifies Entropy, the X characteristic values of sample are i-th kind of value in the collection i of the subsample.
For example, using the value kind number of feature X as 3, i.e., for x1, x2, x3, at this point it is possible to which feature X is by sample set Y { samples 1st, sample 2 ... sample i ... samples n } three sub- sample sets are divided into, characteristic value is Y1 { sample 1, sample 2 ... the sample of x1 This d }, the Y2 { sample d+1 ... samples e } that characteristic value is x2, the Y3 { sample e+1 ... samples n } that characteristic value is x3.D, e is equal For positive integer, and less than n.
At this point, feature X is for the conditional entropy of sample set Y classification results:
H (Y | X)=p1H (Y | x1)+p2H (Y | x2)+p3H (Y | x3);
Wherein, p1=Y1/Y, p2=Y2/Y, p3=Y3/Y;
H (Y | x1) it is the comentropy that subsample collection Y1 classifies, i.e. empirical entropy, the calculation formula of above-mentioned empirical entropy can be passed through It is calculated.
In the empirical entropy H (Y) and feature X for obtaining sample classification for the conditional entropy H (Y | X) of sample set Y classification results Afterwards, the information gain that feature X classifies for sample set Y can be calculated, is such as calculated by the following formula:
G (Y, X)=H (Y)-H (Y | X)
Namely feature X is for the sample set Y information gains classified:Empirical entropy H (Y) and feature X classifies for sample set Y As a result the difference of conditional entropy H (Y | X).
306th, judge whether maximum information gain is more than predetermined threshold value, if so, step 307 is performed, if it is not, then performing Step 313.
Such as, it can be determined that whether maximum information gain gmax is more than preset threshold epsilon, which can be according to reality Border demand setting.
307th, the corresponding feature of maximum information gain is chosen as division feature, and according to the characteristic value of the division feature Sample set is divided, obtains several subsample collection.
For example, when the maximum corresponding features of information gain gmax are characterized i, it can be using selected characteristic i as division feature.
Specifically, can sample set be divided by several subsample collection, subsample according to the characteristic value kind number for dividing feature The quantity of collection is identical with characteristic value kind number.For example, the identical sample of characteristic value can will be divided in sample set is divided into same son In sample set.For example, the characteristic value for dividing feature includes:0th, 1,2, then at this point it is possible to the sample that the characteristic value for dividing feature is 0 Originally it is classified as sample that is a kind of, being 1 by characteristic value and is classified as sample that is a kind of, being 2 by characteristic value being classified as one kind.
308th, the division feature that subsample is concentrated sample removes, subsample collection after being removed.
For example, divide the value of feature i there are two types of when, sample set A can be divided into A1 { sample 1, sample 2 ... sample This k } and A2 { sample k+1 ... samples n }.It is then possible to the division feature i in subsample collection A1 and A2 is removed.
309th, the child node of present node is generated, and using subsample collection after removal as the nodal information of corresponding child node.
Wherein, a sub- sample set corresponds to a child node.For example, with reference to figure 3 generate root node a child node a1 and A2, and using subsample collection A1 as the nodal information of child node a1, using subsample collection A2 as the nodal information of child node a2.
310th, judge whether the subsample collection of child node meets default classification end condition, if so, step 311 is performed, If it is not, then perform step 312.
Wherein, presetting classification end condition can set according to actual demand, and child node meets default classification and terminates item During part, using current node as leaf node, stop the corresponding sample set to child node and carry out participle classification;Child node is not When meeting default classification end condition, continue the corresponding volume sample set to child node and classify.For example, default classification terminates item Part can include:The categorical measure of sample is and preset quantity in the set of subsample after the removal of child node.
For example, default classification end condition can include:The classification of sample is concentrated in subsample after the corresponding removal of child node Quantity be 1 namely the sample set of child node in only there are one classification sample.
The 311st, target sample collection is updated to the subsample collection of child node, and return and perform step 305.
312nd, using the child node as leaf node, and concentrate sample class that the leaf is set according to the subsample of child node The output of node.
For example, default classification end condition can include:The classification of sample is concentrated in subsample after the corresponding removal of child node Quantity be 1 namely the sample set of child node in only there are one classification sample.
At this point, if child node meets the default classification end condition, then, by the class library class of subsample concentration sample Not as the output of the leaf node.When the sample for only having class library classification to be " class library 2 " is concentrated in subsample after such as removing, that , can be by the output of " class library 2 " as the leaf node
313rd, using present node as leaf node, and the most sample class of sample size is chosen as the leaf node Output.
Wherein, sample class includes each class library.
For example, in the subsample collection A1 classification of child node a1, if maximum information gain is small and predetermined threshold value, at this point, It can be using the most sample class of sample size in the collection A1 of subsample as the output of the leaf node.Such as the sample of " class library 1 " This quantity is most, then can be by the output of " class library 1 " as leaf node a1.
314th, after decision-tree model has been built, when detecting image classification instruction, acquisition image to be classified is corresponding Multidimensional characteristic is as forecast sample.
Wherein, when detecting that user needs to carry out sort operation to image, corresponding image classification instruction is generated.It is corresponding , the multidimensional characteristic of the image to be classified is acquired as forecast sample.
315th, corresponding class library is predicted according to forecast sample and decision-tree model.
For example, can corresponding leaf node be determined according to the feature and decision-tree model of forecast sample, by the leaf section The output of point is as prediction output result.Current leaf is such as determined according to the branch condition of decision tree using the feature of forecast sample Child node takes result of the output of the leaf node as prediction.Since the output of leaf node includes each class library, because This, can determine to need the corresponding class library of image to be classified based on decision tree at this time.
For example, after acquiring current multidimensional characteristic, it can be with the branch condition according to decision tree in decision tree shown in Fig. 4 Corresponding leaf node is searched as an2, the output of leaf node an2 is class library 2, at this point, just determining the image to be classified pair The class library answered is class library 2.
In one embodiment, it after this predicts corresponding class library according to forecast sample and decision-tree model, also wraps It includes:
(1) when detecting that the image in a class library is moved in another class library by user, acquisition image is corresponding Multidimensional characteristic is as sample.
It is understood that when user is unsatisfied with classification results, it can be manual by the dissatisfied image in a class library It is moved in satisfied another class library, i.e., ought detect that the image in a class library is moved in another class library by user When, it can acquire by the mobile corresponding multidimensional characteristic of image as sample, the use which is more close to the users current is practised It is used.
(2) sample is replaced storage time in sample set it is first as this.
Wherein it is possible to freshly harvested sample is replaced as storage time is first in sample set this, it therefore, can be complete Into the update of data.
In one embodiment, a fixed update cycle can be set, such as 30 days, after decision tree generates 30 days, is made New decision tree is regenerated with updated sample set, therefore, can be in real time updated as the custom of user changes, The more intelligent classification being close to the users custom.
From the foregoing, it will be observed that the embodiment of the present application is by when detecting that image is moved to the operation of class library, acquiring image pair The multidimensional characteristic answered builds the corresponding sample set of multiple class libraries as sample;According to feature for the information of sample classification Gain carries out sample classification to sample set, and to construct the decision-tree model of class library, the output of decision-tree model is corresponding Multiple class libraries;When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;Root It is predicted that sample and decision-tree model predict corresponding class library.The intelligent classification of image is realized with this, improves image Classification accuracy.
Further, image is moved to each point usually due in each sample of sample set, including reflection user Multiple characteristic informations of the behavioural habits of class libraries, thus the embodiment of the present application can cause the classification to image it is more personalized and It is intelligent.
Further, it realizes that the classification of image is predicted based on decision tree prediction model, the standard of image classification can be promoted True property is more bonded the use habit of user.
A kind of sorter of image is additionally provided in one embodiment.Referring to Fig. 6, Fig. 6 is carried for the embodiment of the present application The structure diagram of the sorter of the image of confession.Wherein the sorter of the image is applied to electronic equipment, point of the image Class device includes the first collecting unit 401, construction unit 402, the second collecting unit 403 and predicting unit 404, as follows:
First collecting unit 401, for when detecting that image is moved to the operation of class library, acquisition described image to correspond to Multidimensional characteristic as sample, and build the corresponding sample set of multiple class libraries;
Construction unit 402, for carrying out sample to the sample set for the information gain of sample classification according to the feature This classification, to construct the decision-tree model of class library, the output of the decision-tree model is corresponding multiple class libraries;
Second collecting unit 403, for when detecting image classification instruction, the corresponding multidimensional of acquisition image to be classified to be special Sign is as forecast sample;
Predicting unit 404, for predicting corresponding class library according to the forecast sample and the decision-tree model.
In one embodiment, with reference to figure 7, construction unit 402 can include:
First node generates subelement 4021, for generating corresponding root node, and using the sample set as described The nodal information of node;The sample set of the root node is determined as current target sample collection to be sorted;
Gain obtains subelement 4022, and the information that sample set is classified is increased for obtaining the feature in target sample collection Benefit;
Feature determination subelement 4023, for choosing current division from the feature according to described information gain selection Feature;
Classification subelement 4024 for being divided according to the division feature to the sample set, obtains several increments This collection;
Second node generates subelement 4025, and the division feature for concentrating sample to the subsample is gone It removes, subsample collection after being removed;The child node of present node is generated, and using subsample collection after the removal as the sub- section The nodal information of point;
Judgment sub-unit 4026, for judging whether child node meets default classification end condition, if it is not, then by the mesh Mark sample set is updated to subsample collection after the removal, and triggers the gain and obtain in subelement execution acquisition target sample collection The step of information gain that the feature classifies for sample set;If so, using the child node as leaf node, according to institute Subsample concentrates the classification of sample to set the output of the leaf node after stating removal, and the classification of the sample is corresponding multiple Class library.
Wherein, classification subelement 4024 can be used for obtaining in the sample set and divide the characteristic value of feature;
The sample set is divided according to the characteristic value.Identical sample is divided into identical subsample collection.
Wherein, feature determination subelement 4023, can be used for:
Maximum target information gain is chosen from described information gain;
Judge whether the target information gain is more than predetermined threshold value;
If so, the corresponding feature of the target information gain is chosen as current division feature.
In one embodiment, gain obtains subelement 4022, can be used for:
Obtain the empirical entropy of sample classification;
Obtain conditional entropy of the feature for sample set classification results;
According to the conditional entropy and the empirical entropy, the information gain that the feature classifies for the sample set is obtained.
For example, gain obtains subelement 4022, can be used for:Obtain each class library sample occur in sample set it is general Rate, the class library sample are that sample class is corresponding class library, and the empirical entropy of sample is obtained according to the probability of each class library.
In one embodiment, judgment sub-unit 4025 can be used for judging subsample after the corresponding removal of the child node Whether the categorical measure for concentrating sample is preset quantity;
If so, determine that the child node meets default classification end condition.
In one embodiment, feature determination subelement 4023 can be also used for being not more than default threshold when target information gain During value, using present node as leaf node, and the most sample class of sample size is chosen as the defeated of the leaf node Go out.
In one embodiment, with reference to figure 7, the sorter of described image further includes:
Third collecting unit 405 detects that the image in a class library is moved in another class library by user for working as When, the corresponding multidimensional characteristic of acquisition described image is as sample;
Replacement unit 406, for the sample is replaced the storage time in sample set it is first as this.
Wherein, the method that the step of each unit performs in the sorter of image can refer to the description of above method embodiment Step.The sorter of the image can integrate in the electronic device, such as mobile phone, tablet computer.
When it is implemented, Yi Shang each unit can be independent entity realization, arbitrary combination can also be carried out, as Same or several entities realize, more than the specific implementation of each unit can be found in the embodiment of front, details are not described herein.
From the foregoing, it will be observed that the sorter of the present embodiment image can be worked as by the first collecting unit 401 detects that image moves When moving the operation of class library, the corresponding multidimensional characteristic of acquisition image builds the corresponding sample of multiple class libraries as sample Collection;Building block 402 carries out sample classification for the information gain of sample classification according to feature to sample set, to construct classification The decision-tree model in library, the output of decision-tree model is corresponding multiple class libraries;Second collecting unit 403, which is worked as, detects image During sort instructions, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;Predicting unit 404 according to forecast sample and Decision-tree model predicts corresponding class library.The intelligent classification of image is realized with this, improves the classification accuracy of image.
The embodiment of the present application also provides a kind of electronic equipment.Referring to Fig. 8, electronic equipment 500 include processor 501 and Memory 502.Wherein, processor 501 is electrically connected with memory 502.
The processor 500 is the control centre of electronic equipment 500, is set using various interfaces and the entire electronics of connection Standby various pieces computer program in memory 502 and are called by operation or load store and are stored in memory Data in 502 perform the various functions of electronic equipment 500 and handle data, so as to carry out whole prison to electronic equipment 500 Control.
The memory 502 can be used for storage software program and module, and processor 501 is stored in memory by operation 502 computer program and module, so as to perform various functions application and data processing.Memory 502 can mainly include Storing program area and storage data field, wherein, storing program area can storage program area, the computer needed at least one function Program (such as sound-playing function, image player function etc.) etc.;Storage data field can be stored uses institute according to electronic equipment Data of establishment etc..In addition, memory 502 can include high-speed random access memory, non-volatile memories can also be included Device, for example, at least a disk memory, flush memory device or other volatile solid-state parts.Correspondingly, memory 502 can also include Memory Controller, to provide access of the processor 501 to memory 502.
In the embodiment of the present application, the processor 501 in electronic equipment 500 can be according to the steps, by one or one The corresponding instruction of process of a above computer program is loaded into memory 502, and be stored in by the operation of processor 501 Computer program in reservoir 502, it is as follows so as to fulfill various functions:
When detecting that image is moved to the operation of class library, the corresponding multidimensional characteristic of acquisition described image as sample, And build the corresponding sample set of multiple class libraries;
Sample classification is carried out to the sample set for the information gain of sample classification according to the feature, to construct point The decision-tree model of class libraries, the output of the decision-tree model is corresponding multiple class libraries;
When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;
Corresponding class library is predicted according to the forecast sample and the decision-tree model.
In some embodiments, the information gain of sample classification is carrying out the sample set according to the feature Sample classification, during constructing the decision-tree model of the application, processor 501 can specifically perform following steps:
Corresponding root node is generated, and using the sample set as the nodal information of the root node;
The sample set of the root node is determined as current target sample collection to be sorted;
Obtain the information gain that the feature classifies for sample set in target sample collection;
Current division feature is chosen from the feature according to described information gain;
The sample set is divided according to the division feature, obtains several subsample collection;
The division feature for concentrating sample to the subsample is removed, subsample collection after being removed;
The child node of present node is generated, and using subsample collection after the removal as the nodal information of the child node;
Judge whether child node meets default classification end condition;
If it is not, the target sample collection then is updated to subsample collection after the removal, and returns to execution and obtain target sample The step of information gain that the feature classifies for sample set in this collection;
If so, using the child node as leaf node, the classification for concentrating sample according to subsample after the removal is set The output of the leaf node is put, the classification of the sample is corresponding multiple class libraries.
In some embodiments, corresponding class library is being predicted according to the forecast sample and the decision-tree model Later, processor 501 can also specifically perform following steps:
When detecting that the image in a class library is moved in another class library by user, acquisition described image is corresponding Multidimensional characteristic is as sample;
The sample is replaced storage time in sample set it is first as this.
In some embodiments, when choosing current division feature from the feature according to described information gain, Processor 501 can specifically perform following steps:
Maximum target information gain is chosen from described information gain;
Judge whether the target information gain is more than predetermined threshold value;
If so, the corresponding feature of the target information gain is chosen as current division feature.
In some embodiments, processor 501 can also specifically perform following steps:
When target information gain is not more than predetermined threshold value, using present node as leaf node, and sample size is chosen Output of most sample class as the leaf node.
In some embodiments, the information gain that the feature classifies for sample set in target sample collection is being obtained When, processor 501 can specifically perform following steps:
Obtain the empirical entropy of sample classification;
Obtain conditional entropy of the feature for sample set classification results;
According to the conditional entropy and the empirical entropy, the information gain that the feature classifies for the sample set is obtained.
It can be seen from the above, the electronic equipment of the embodiment of the present application, detects that image is moved to the operation of class library by working as When, the corresponding multidimensional characteristic of acquisition image builds the corresponding sample set of multiple class libraries as sample;According to feature for sample The information gain of this classification carries out sample classification, to construct the decision-tree model of class library, decision-tree model to sample set It exports as corresponding multiple class libraries;When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is made For forecast sample;Corresponding class library is predicted according to forecast sample and decision-tree model.The intelligence point of image is realized with this Class improves the classification accuracy of image.
Also referring to Fig. 9, in some embodiments, electronic equipment 500 can also include:Display 503, radio frequency electrical Road 504, voicefrequency circuit 505 and power supply 506.Wherein, wherein, display 503, radio circuit 504, voicefrequency circuit 505 and Power supply 506 is electrically connected respectively with processor 501.
The display 503 is displayed for by information input by user or is supplied to the information of user and various figures Shape user interface, these graphical user interface can be made of figure, text, icon, video and its arbitrary combination.Display 503 can include display panel, in some embodiments, liquid crystal display (Liquid Crystal may be used Display, LCD) or the forms such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) match Put display panel.
The radio circuit 504 can be used for transceiving radio frequency signal, with by radio communication with the network equipment or other electricity Sub- equipment establishes wireless telecommunications, the receiving and transmitting signal between the network equipment or other electronic equipments.
The voicefrequency circuit 505 can be used for providing the audio between user and electronic equipment by loud speaker, microphone Interface.
The power supply 506 is used to all parts power supply of electronic equipment 500.In some embodiments, power supply 506 Can be logically contiguous by power-supply management system and processor 501, so as to realize management charging by power-supply management system, put The functions such as electricity and power managed.
Although being not shown in Fig. 9, electronic equipment 500 can also include camera, bluetooth module etc., and details are not described herein.
The embodiment of the present application also provides a kind of storage medium, and the storage medium is stored with computer program, when the meter When calculation machine program is run on computers so that the computer performs the sorting technique of the image in any of the above-described embodiment, Such as:When detecting that image is moved to the operation of class library, the corresponding multidimensional characteristic of acquisition described image is as sample, and structure Build the corresponding sample set of multiple class libraries;Sample is carried out to the sample set for the information gain of sample classification according to the feature This classification, to construct the decision-tree model of class library, the output of the decision-tree model is corresponding multiple class libraries;Work as inspection When measuring image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;According to the forecast sample Corresponding class library is predicted with the decision-tree model.
In the embodiment of the present application, storage medium can be magnetic disc, CD, read-only memory (Read Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
It should be noted that for the sorting technique of the image of the embodiment of the present application, this field common test personnel can With understand realize the embodiment of the present application image sorting technique all or part of flow, be can by computer program come Relevant hardware is controlled to complete, the computer program can be stored in a computer read/write memory medium, be such as stored in In the memory of electronic equipment, and by the electronic equipment at least one processor perform, may include in the process of implementation as The flow of the embodiment of the sorting technique of image.Wherein, the storage medium can be magnetic disc, it is CD, read-only memory, random Access/memory body etc..
For the sorter of the image of the embodiment of the present application, each function module can be integrated in a processing chip In or modules be individually physically present, can also two or more modules be integrated in a module.It is above-mentioned The form that hardware had both may be used in integrated module is realized, can also be realized in the form of software function module.It is described integrated If module realized in the form of software function module and be independent product sale or in use, one can also be stored in In a computer read/write memory medium, the storage medium is for example read-only memory, disk or CD etc..
A kind of sorting technique of image, device, storage medium and the electronic equipment provided above the embodiment of the present application Be described in detail, the principle and implementation of this application are described for specific case used herein, more than it is real The explanation for applying example is merely used to help understand the present processes and its core concept;Meanwhile for those skilled in the art, According to the thought of the application, there will be changes in specific embodiments and applications, in conclusion in this specification Hold the limitation that should not be construed as to the application.

Claims (14)

1. a kind of sorting technique of image, which is characterized in that including:
When detecting that image is moved to the operation of class library, the corresponding multidimensional characteristic of acquisition described image is as sample, and structure Build the corresponding sample set of multiple class libraries;
Sample classification is carried out to the sample set for the information gain of sample classification according to the feature, to construct class library Decision-tree model, the output of the decision-tree model is corresponding multiple class libraries;
When detecting image classification instruction, the corresponding multidimensional characteristic of acquisition image to be classified is as forecast sample;
Corresponding class library is predicted according to the forecast sample and the decision-tree model.
2. the sorting technique of image as described in claim 1, which is characterized in that according to the feature for the letter of sample classification It ceases gain and sample classification is carried out to the sample set, to construct the decision-tree model of class library, including:
Corresponding root node is generated, and using the sample set as the nodal information of the root node;
The sample set of the root node is determined as current target sample collection to be sorted;
Obtain the information gain that the feature classifies for sample set in target sample collection;
Current division feature is chosen from the feature according to described information gain;
The sample set is divided according to the division feature, obtains several subsample collection;
The division feature for concentrating sample to the subsample is removed, subsample collection after being removed;
The child node of present node is generated, and using subsample collection after the removal as the nodal information of the child node;
Judge whether child node meets default classification end condition;
If it is not, the target sample collection then is updated to subsample collection after the removal, and returns to execution and obtain target sample collection The step of information gain that the interior feature classifies for sample set;
If so, using the child node as leaf node, the classification for concentrating sample according to subsample after the removal sets institute The output of leaf node is stated, the classification of the sample is corresponding multiple class libraries.
3. the sorting technique of image as claimed in claim 2, which is characterized in that according to the forecast sample and the decision tree Model prediction goes out after corresponding class library, further includes:
When detecting that the image in a class library is moved in another class library by user, the corresponding multidimensional of acquisition described image Feature is as sample;
The sample is replaced storage time in sample set it is first as this.
4. the sorting technique of image as claimed in claim 2, which is characterized in that according to described information gain from the feature Current division feature is chosen, including:
Maximum target information gain is chosen from described information gain;
Judge whether the target information gain is more than predetermined threshold value;
If so, the corresponding feature of the target information gain is chosen as current division feature.
5. the sorting technique of image as claimed in claim 4, which is characterized in that the sorting technique of described image further includes:
When target information gain is not more than predetermined threshold value, using present node as leaf node, and it is most to choose sample size Output of the sample class as the leaf node.
6. the sorting technique of image as claimed in claim 2, which is characterized in that judge whether child node meets default classification eventually Only condition, including:
Subsample concentrates whether the categorical measure of sample is preset quantity after judging the corresponding removal of the child node;
If so, determine that the child node meets default classification end condition.
7. such as the sorting technique of claim 2-6 any one of them images, which is characterized in that obtain described in target sample collection The information gain that feature classifies for sample set, including:
Obtain the empirical entropy of sample classification;
Obtain conditional entropy of the feature for sample set classification results;
According to the conditional entropy and the empirical entropy, the information gain that the feature classifies for the sample set is obtained.
8. a kind of sorter of image, which is characterized in that including:
First collecting unit, for when detecting that image is moved to the operation of class library, acquiring the corresponding multidimensional of described image Feature builds the corresponding sample set of multiple class libraries as sample;
Building block, for carrying out sample classification to the sample set for the information gain of sample classification according to the feature, To construct the decision-tree model of class library, the output of the decision-tree model is corresponding multiple class libraries;
Second collecting unit, for when detecting image classification instruction, acquiring the corresponding multidimensional characteristic conduct of image to be classified Forecast sample;
Predicting unit, for predicting corresponding class library according to the forecast sample and the decision-tree model.
9. the sorter of image as claimed in claim 8, which is characterized in that the construction unit includes:
First node generates subelement, for generating corresponding root node, and using the sample set as the section of the root node Point information;The sample set of the root node is determined as current target sample collection to be sorted;
Gain obtains subelement, for obtaining the information gain that the feature classifies for sample set in target sample collection;
Feature determination subelement, for choosing current division feature from the feature according to described information gain selection;
Classification subelement for being divided according to the division feature to the sample set, obtains several subsample collection;
Second node generates subelement, and the division feature for concentrating sample to the subsample is removed, and is gone Except rear subsample collection;The child node of present node is generated, and using subsample collection after the removal as the node of the child node Information;
Judgment sub-unit, for judging whether child node meets default classification end condition, if it is not, then by the target sample collection Subsample collection after the removal is updated to, and triggers the gain and obtains subelement and perform and obtain the feature in target sample collection For sample set classification information gain the step of;If so, using the child node as leaf node, after the removal Subsample concentrates the classification of sample to set the output of the leaf node, and the classification of the sample is corresponding multiple class libraries.
10. the sorter of image as claimed in claim 9, which is characterized in that described device further includes:
Third collecting unit, for when detecting that the image in a class library is moved in another class library by user, acquiring The corresponding multidimensional characteristic of described image is as sample;
Replacement unit, for the sample is replaced the storage time in sample set it is first as this.
11. the sorter of image as claimed in claim 9, which is characterized in that feature determination subelement is used for:
Maximum target information gain is chosen from described information gain;
Judge whether the target information gain is more than predetermined threshold value;
If so, the corresponding feature of the target information gain is chosen as current division feature.
12. the sorter of image as claimed in claim 9, which is characterized in that the gain obtains subelement, is used for:
Obtain the empirical entropy of sample classification;
Obtain conditional entropy of the feature for sample set classification results;
According to the conditional entropy and the empirical entropy, the information gain that the feature classifies for the sample set is obtained.
13. a kind of storage medium, is stored thereon with computer program, which is characterized in that when the computer program is in computer During upper operation so that the computer performs the sorting technique of image as described in any one of claim 1 to 7.
14. a kind of electronic equipment, including processor and memory, the memory has computer program, which is characterized in that described Processor is by calling the computer program, for performing the classification side of image as described in any one of claim 1 to 7 Method.
CN201711466322.5A 2017-12-28 2017-12-28 Image classification method and device, storage medium and electronic equipment Active CN108197225B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711466322.5A CN108197225B (en) 2017-12-28 2017-12-28 Image classification method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711466322.5A CN108197225B (en) 2017-12-28 2017-12-28 Image classification method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN108197225A true CN108197225A (en) 2018-06-22
CN108197225B CN108197225B (en) 2020-12-01

Family

ID=62585826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711466322.5A Active CN108197225B (en) 2017-12-28 2017-12-28 Image classification method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN108197225B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766461A (en) * 2018-12-15 2019-05-17 深圳壹账通智能科技有限公司 Photo management method, device, computer equipment and medium based on micro- expression
CN109915913A (en) * 2018-08-01 2019-06-21 永康市蜂蚁科技有限公司 Intelligent die casting aluminium radiator
CN109934296A (en) * 2019-03-18 2019-06-25 江苏科技大学 One kind is based on the infrared and multi-environment lower topside personnel's recognition methods of visible images
CN112200170A (en) * 2020-12-07 2021-01-08 北京沃东天骏信息技术有限公司 Image recognition method and device, electronic equipment and computer readable medium
CN112884700A (en) * 2020-12-11 2021-06-01 武汉光谷航天三江激光产业技术研究院有限公司 Laser cleaning image classification method and device based on decision tree

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831440A (en) * 2012-08-20 2012-12-19 中国测绘科学研究院 Method and device for decision tree based wide-area remote sensing image classification
CN104392250A (en) * 2014-11-21 2015-03-04 浪潮电子信息产业股份有限公司 Image classification method based on MapReduce
CN105701835A (en) * 2016-02-26 2016-06-22 华北电力大学 Image edge detection method and system facing electric power facilities
CN106650637A (en) * 2016-12-02 2017-05-10 华中师范大学 Smiling face detector based on condition random forests and method
CN106845513A (en) * 2016-12-05 2017-06-13 华中师范大学 Staff detector and method based on condition random forest
US9720934B1 (en) * 2014-03-13 2017-08-01 A9.Com, Inc. Object recognition of feature-sparse or texture-limited subject matter

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831440A (en) * 2012-08-20 2012-12-19 中国测绘科学研究院 Method and device for decision tree based wide-area remote sensing image classification
US9720934B1 (en) * 2014-03-13 2017-08-01 A9.Com, Inc. Object recognition of feature-sparse or texture-limited subject matter
CN104392250A (en) * 2014-11-21 2015-03-04 浪潮电子信息产业股份有限公司 Image classification method based on MapReduce
CN105701835A (en) * 2016-02-26 2016-06-22 华北电力大学 Image edge detection method and system facing electric power facilities
CN106650637A (en) * 2016-12-02 2017-05-10 华中师范大学 Smiling face detector based on condition random forests and method
CN106845513A (en) * 2016-12-05 2017-06-13 华中师范大学 Staff detector and method based on condition random forest

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邹丽 等: ""基于决策树对支持向量机的医学图像分类新方法"", 《计算机工程与应用》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109915913A (en) * 2018-08-01 2019-06-21 永康市蜂蚁科技有限公司 Intelligent die casting aluminium radiator
CN109915913B (en) * 2018-08-01 2021-01-05 盐城市盐南高新区都市产业发展有限公司 Intelligent die-casting aluminum radiator
CN109766461A (en) * 2018-12-15 2019-05-17 深圳壹账通智能科技有限公司 Photo management method, device, computer equipment and medium based on micro- expression
CN109934296A (en) * 2019-03-18 2019-06-25 江苏科技大学 One kind is based on the infrared and multi-environment lower topside personnel's recognition methods of visible images
CN112200170A (en) * 2020-12-07 2021-01-08 北京沃东天骏信息技术有限公司 Image recognition method and device, electronic equipment and computer readable medium
CN112200170B (en) * 2020-12-07 2021-11-30 北京沃东天骏信息技术有限公司 Image recognition method and device, electronic equipment and computer readable medium
CN112884700A (en) * 2020-12-11 2021-06-01 武汉光谷航天三江激光产业技术研究院有限公司 Laser cleaning image classification method and device based on decision tree
CN112884700B (en) * 2020-12-11 2023-08-22 武汉光谷航天三江激光产业技术研究院有限公司 Laser cleaning image classification method and device based on decision tree

Also Published As

Publication number Publication date
CN108197225B (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN108197225A (en) Sorting technique, device, storage medium and the electronic equipment of image
CN108108455A (en) Method for pushing, device, storage medium and the electronic equipment of destination
CN109961077A (en) Gender prediction's method, apparatus, storage medium and electronic equipment
CN107678845A (en) Application program management-control method, device, storage medium and electronic equipment
CN107704070B (en) Application cleaning method and device, storage medium and electronic equipment
CN109063163A (en) A kind of method, apparatus, terminal device and medium that music is recommended
CN108337358A (en) Using method for cleaning, device, storage medium and electronic equipment
CN107077489A (en) Automatic for multidimensional data is seen clearly
CN108090497A (en) Video classification methods, device, storage medium and electronic equipment
CN107430604A (en) The semantic expressiveness of picture material
CN107894827A (en) Using method for cleaning, device, storage medium and electronic equipment
CN107678531B (en) Application cleaning method and device, storage medium and electronic equipment
CN109961075A (en) User gender prediction method, apparatus, medium and electronic equipment
CN107678800A (en) Background application method for cleaning, device, storage medium and electronic equipment
CN112990318B (en) Continuous learning method, device, terminal and storage medium
US10275501B2 (en) System and method for multi-dimensional data representation of objects
CN113254354A (en) Test case recommendation method and device, readable storage medium and electronic equipment
CN109300041A (en) Typical karst ecosystem recommended method, electronic device and readable storage medium storing program for executing
CN112241789A (en) Structured pruning method, device, medium and equipment for lightweight neural network
CN101918946A (en) Ordering of data items
CN109961163A (en) Gender prediction's method, apparatus, storage medium and electronic equipment
CN109598285A (en) A kind of processing method of model, device and equipment
CN110022397A (en) Image processing method, device, storage medium and electronic equipment
CN107643925A (en) Background application method for cleaning, device, storage medium and electronic equipment
CN107943537A (en) Using method for cleaning, device, storage medium and electronic equipment

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant