CN108197669A - The feature training method and device of convolutional neural networks - Google Patents

The feature training method and device of convolutional neural networks Download PDF

Info

Publication number
CN108197669A
CN108197669A CN201810096726.8A CN201810096726A CN108197669A CN 108197669 A CN108197669 A CN 108197669A CN 201810096726 A CN201810096726 A CN 201810096726A CN 108197669 A CN108197669 A CN 108197669A
Authority
CN
China
Prior art keywords
feature
loss function
convolutional neural
neural networks
picture
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
CN201810096726.8A
Other languages
Chinese (zh)
Other versions
CN108197669B (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.)
Beijing Moshanghua Technology Co Ltd
Original Assignee
Beijing Moshanghua 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 Beijing Moshanghua Technology Co Ltd filed Critical Beijing Moshanghua Technology Co Ltd
Priority to CN201810096726.8A priority Critical patent/CN108197669B/en
Publication of CN108197669A publication Critical patent/CN108197669A/en
Application granted granted Critical
Publication of CN108197669B publication Critical patent/CN108197669B/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/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24147Distances to closest patterns, e.g. nearest neighbour classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

This application discloses the feature training methods and device of a kind of convolutional neural networks.This feature training method includes:Extract fisrt feature picture;It determines the characteristic pattern of the fisrt feature picture, and fisrt feature is obtained according to the characteristic pattern;Using the fisrt feature as input, the penalty values of counting loss function;And update convolutional neural networks according to the penalty values.Present application addresses loss object function can not ensure inter- object distance it is opposite closer to between class distance it is relatively farther the technical issues of.

Description

The feature training method and device of convolutional neural networks
Technical field
This application involves computer realm, in particular to the feature training method and dress of a kind of convolutional neural networks It puts.
Background technology
Convolutional neural networks achieve good performance in computer vision field, especially in object identification, object detection, The fields such as object segmentation.Training convolutional neural networks are stacked using convolutional layer from level to level and active coating, can realize very strong regard Feel characterization ability, wherein convolutional neural networks structure is made of two parts:Convolutional network, target loss function.
Inventor has found, has some loss functions in convolutional neural networks, shortcoming is to be difficult to ensure that in class Distance is closer to the distance between class is farther.If ensure that this premise, the representational ability for the feature that the network that is trained to proposes It is stronger.Separately there are some loss functions, ensure distance in class closer to but there is no guarantee that between class distance is farther, while can also The accuracy rate of object identification is influenced, therefore is mostly widely used in face classification field.Also some loss functions, both ensured in class away from From closer to, and ensure between class distance it is farther, however problem be if training data there are some noises, trained processes in itself It is difficult to restrain.
It can not ensure that inter- object distance is opposite closer to relatively farther between class distance for object function is lost in the relevant technologies The problem of, currently no effective solution has been proposed.
Invention content
The main purpose of the application is to provide a kind of feature training method of convolutional neural networks, to solve the problems, such as.
To achieve these goals, according to the one side of the application, a kind of feature instruction of convolutional neural networks is provided Practice method, including:Extract fisrt feature picture;It determines the characteristic pattern of the fisrt feature picture, and is obtained according to the characteristic pattern Take fisrt feature;Using the fisrt feature as input, the penalty values of counting loss function;And according to the penalty values Update convolutional neural networks;Wherein, the loss function is for so that the character symbol trained in updated convolutional neural networks Close preset classification.
Further, the penalty values of counting loss function include:First-loss function is configured, wherein, the first-loss Function is used for the loss function combined as Softmax and cross entropy;The second loss function is configured, wherein, second loss Function is used for as angle loss function.
Further, the penalty values of counting loss function include:
Wherein,Represent yiCorresponding weight, N represent input picture number;
The average value obtained after the N corresponding all probability of input picture are added is calculated by loss function.
The penalty values of counting loss function include:
Wherein,Represent yiCorresponding weight, N represent input picture number, yiRepresent the corresponding class of every input picture Not;
N pictures are calculated by loss functionAverage value.
Further, it is further included after updating convolutional neural networks according to the penalty values:Input second picture to be tested; By obtaining corresponding second feature after the updated convolutional neural networks of the penalty values;Using the second feature as Input, the penalty values of counting loss function;Determine that the second picture corresponds to the classification of object.
Further, the loss function for so that updated convolutional neural networks in training feature meet it is default Classification it is as follows:The inter- object distance of feature;The between class distance of feature.
To achieve these goals, according to the another aspect of the application, a kind of feature instruction of convolutional neural networks is provided Practice device.
Included according to the feature training device of the convolutional neural networks of the application:Extraction unit, for extracting fisrt feature Picture;Determination unit for determining the characteristic pattern of the fisrt feature picture, and obtains fisrt feature according to the characteristic pattern; Loss function unit, for using the fisrt feature as input, the penalty values of counting loss function;Reversed unit is used According to penalty values update convolutional neural networks;Wherein, the loss function is for so that updated convolutional Neural net The feature of training meets preset classification in network.
Further, the loss function unit includes:First-loss function unit and the second loss function unit, it is described First-loss function unit, for the loss function as Softmax and cross entropy combination;The second loss function unit, For as angle loss function.
Further, device further includes:Test cell, for inputting second picture to be tested;Pass through the penalty values Corresponding second feature is obtained after updated convolutional neural networks;Using the second feature as input, counting loss The penalty values of function;Determine that the second picture corresponds to the classification of object.
Further, the reversed unit is additionally operable to, by being instructed in the updated convolutional neural networks of loss function Experienced feature meets default:The inter- object distance of feature closer to;The between class distance of feature is farther.
In the embodiment of the present application, it by the way of feature training is optimized in convolutional neural networks, is used by loss function In the feature of training in updated convolutional neural networks is caused to meet preset classification, it is stronger trained recognition capability has been reached Purpose, it is achieved thereby that train the technique effect of the stronger feature of recognition capability, and then solve loss object function can not Ensure inter- object distance it is opposite closer to between class distance it is relatively farther the technical issues of.
Description of the drawings
The attached drawing for forming the part of the application is used for providing further understanding of the present application so that the application's is other Feature, objects and advantages become more apparent upon.The illustrative examples attached drawing and its explanation of the application is for explaining the application, not Form the improper restriction to the application.In the accompanying drawings:
Fig. 1 is the feature training method schematic diagram according to the convolutional neural networks of the application first embodiment;
Fig. 2 is the feature training method schematic diagram according to the convolutional neural networks of the application second embodiment;
Fig. 3 is the feature training method schematic diagram according to the convolutional neural networks of the application 3rd embodiment;And
Fig. 4 is the feature training device schematic diagram according to the convolutional neural networks of the application preferred embodiment.
Specific embodiment
In order to which those skilled in the art is made to more fully understand application scheme, below in conjunction in the embodiment of the present application The technical solution in the embodiment of the present application is clearly and completely described in attached drawing, it is clear that described embodiment is only The embodiment of the application part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people Member's all other embodiments obtained without making creative work should all belong to the model of the application protection It encloses.
It should be noted that term " first " in the description and claims of this application and above-mentioned attached drawing, " Two " etc. be the object for distinguishing similar, and specific sequence or precedence are described without being used for.It should be appreciated that it uses in this way Data can be interchanged in the appropriate case, so as to embodiments herein described herein.In addition, term " comprising " and " tool Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit Process, method, system, product or equipment are not necessarily limited to those steps or unit clearly listed, but may include without clear It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
Up to the present many loss functions are suggested, the loss function that initial Softmax is combined with cross entropy, it Shortcoming be to be difficult to ensure that distance in class closer to, the distance between class is farther, if ensure that this premise, the network being trained to The representational of the feature of proposition could be stronger.
Center-Loss is suggested later, it may ensure that the distance in class is closer to but there is no guarantee that between class distance It is farther, while Center-Loss can also influence the accuracy rate of object identification, so it is mostly made extensively in face classification field With;Be suggested in L-Softmax later, it both ensure that inter- object distance closer to, guaranteed between class distance is farther, however it Problem is if training data is in itself there are some noises, and trained process is difficult to restrain.
In a manner that the method for the embodiment of the present application is using optimization feature training in convolutional neural networks, by losing letter Number has reached trained recognition capability more for the feature of training in updated convolutional neural networks to be caused to meet preset classification Strong purpose, it is achieved thereby that training the technique effect of the stronger feature of recognition capability.
The loss function based on angle that method in the embodiment of the present application uses is mainly used for based on deep learning convolution In the training process of neural network object identification, wherein major function is embodied in:A. the characterization ability of trained feature is stronger, i.e., Inter- object distance is closer between class distance is farther;B. under the premise of ensuring that a. is set up, ensure the convergence of neural network training process Property.
(4) the target loss function that this method is related to, can be used for the model training of the task other than object identification, Including object detection, object segmentation etc..
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
As shown in Figure 1, this method includes steps S102 to step S108:
Step S102 extracts fisrt feature picture;
By inputting N pictures, then N pictures are done with normalization pretreatment, all pixel values are allowed between [- 1,1]; Then convolutional neural networks are inputted.
Since convolutional neural networks structure includes multiple convolutional layers, behind each convolutional layer in convolutional neural networks An active coating can be connect, often by one layer of convolutional layer, corresponding characteristic pattern will be obtained.
Corresponding characteristic pattern is obtained by inputting convolutional neural networks after the normalized in above-mentioned steps.
Step S104 determines the characteristic pattern of the fisrt feature picture, and obtains fisrt feature according to the characteristic pattern;
It determines that the characteristic pattern of the feature image refers to, according to the port number of characteristic pattern, the length of characteristic pattern and width, obtains spy Levy the characteristic pattern of picture.
For example, the size of every characteristic pattern is set as c*h*w, wherein, c is characterized the port number of figure, and h and w are characterized figure Long and wide, what it is due to input is N pictures, i.e., can finally obtain N characteristic patterns.
Step S106, using the fisrt feature as input, the penalty values of counting loss function;
Using multiple characteristic patterns as input, by the full articulamentum in convolutional neural networks, dimension multiple features are obtained as defeated Enter.
For example, N characteristic patterns, by full articulamentum, obtain NxM dimensional features as input.I.e. N number of feature, corresponding to N Picture, each feature M dimensions.
The penalty values of counting loss function refer to, using the class label of the feature of NxM dimensions and picture as input, calculate damage Lose the penalty values of function.
Step S108 updates convolutional neural networks according to the penalty values;
The loss function is for so that the feature of training meets preset classification in updated convolutional neural networks.
Feature meets preset classification, ensures the distance between similar (in class) feature closer to foreign peoples (between class) Distance is farther between feature.
Specifically, the penalty values of counting loss function, including two loss functions, first-loss function is Softmax and cross entropy combine, and the second loss function is angle loss function.
It can be seen from the above description that the present invention realizes following technique effect:
In the embodiment of the present application, it by the way of feature training is optimized in convolutional neural networks, is used by loss function In the feature of training in updated convolutional neural networks is caused to meet preset classification, it is stronger trained recognition capability has been reached Purpose, it is achieved thereby that train the technique effect of the stronger feature of recognition capability, and then solve loss object function can not Ensure inter- object distance it is opposite closer to between class distance it is relatively farther the technical issues of.Method is trained in the embodiment of the present application When do not introduce more hyper parameters, reduce and artificial adjust the cost of ginseng, while train when is not significantly increased video memory With the usage amount of memory.
In the embodiment of the present application during test, the picture feature of extraction, in addition to can be used for object identification field Outside, the fields such as object retrieval be can be also used for.
According to embodiments of the present invention, as preferred in the present embodiment, as shown in Fig. 2, the penalty values of counting loss function Including:
First-loss function is configured in step S202,
The first-loss function is used for the loss function combined as Softmax and cross entropy;
The penalty values of counting loss function include:
Wherein,Represent yiCorresponding weight, N represent input picture number;
The average value obtained after the N corresponding all probability of input picture are added is calculated by loss function.
Loss function refers toWherein, f is the fisrt feature obtained,For class The corresponding weight vectors of other i classes, soFor classification yiCorresponding weight vectors (set M classification, every input in this application Picture corresponds to oneself specific one classification yi), yiAs the corresponding true classification of input picture.
Pass throughIt is multiplied to obtain a score with f, andIn formula, represent f and be judged to be broken into yiSuch Probability on not.
The second loss function is configured in step S204,
Second loss function is used for as angle loss function.
The penalty values of counting loss function include:
Wherein,Represent yiCorresponding weight, N represent input picture number, yiRepresent the corresponding class of every input picture Not;
N pictures are calculated by loss functionAverage value.
Wherein f is the fisrt feature obtained,For classification yiCorresponding weight vectors (set M classification, often in this application It opens input picture and corresponds to oneself specific one classification yi), yiAs the corresponding true classification of input picture.
It representsWith the cosine value cos (Wyi, f) of the angle of f, range is between [- 1,1], and closer 1, ThenAngle between vector and f feature vectors is smaller.
What above-mentioned loss function Loss Function were calculated is N picturesAverage value, can To allowIt is small as possible with the angle of f.
According to embodiments of the present invention, it as preferred in the present embodiment, is rolled up as shown in figure 3, being updated according to the penalty values It is further included after product neural network:
Step S302 inputs second picture to be tested;
Picture to be tested is inputted, the quantity of picture can be N (N>=1), by having completed trained neural network, Obtain corresponding feature.
Step S304, by obtaining corresponding second feature after the updated convolutional neural networks of the penalty values;
After calculating penalty values in step S108, all parameters of whole network are updated using backpropagation. So picture to be tested is inputted updated convolutional neural networks obtains corresponding characteristic pattern.
Step S306, using the second feature as input, the penalty values of counting loss function;
The loss function that input is combined by Softmax and cross entropyAngle Spend loss functionThe penalty values of counting loss function.
Step S308 determines that the second picture corresponds to the classification of object.
In test phase feature by Softmax layers, the probability (probability adds up to 1) of all known class is obtained, is chosen The highest classification that object is corresponded to as the picture of probability.
As preferred in the present embodiment, the loss function is for so that training in updated convolutional neural networks It is as follows that feature meets preset classification:The inter- object distance of feature;The between class distance of feature.
When the loss function is for so that the feature of training meets default in updated convolutional neural networks, feature is protected Inter- object distance closer to the between class distance of feature is farther.
It should be noted that step shown in the flowchart of the accompanying drawings can be in such as a group of computer-executable instructions It is performed in computer system, although also, show logical order in flow charts, it in some cases, can be with not The sequence being same as herein performs shown or described step.
According to embodiments of the present invention, a kind of feature training method for being used to implement above-mentioned convolutional neural networks is additionally provided Device, as shown in figure 4, the device includes:Extraction unit 10, for extracting fisrt feature picture;Determination unit 20, for determining The characteristic pattern of the fisrt feature picture, and fisrt feature is obtained according to the characteristic pattern;Loss function unit 30, for by institute The fisrt feature is stated as input, the penalty values of counting loss function;Reversed unit 40, for being updated according to the penalty values Convolutional neural networks;Wherein, the loss function for so that updated convolutional neural networks in training feature meet it is pre- If classification.
By inputting N pictures, then N pictures are done with normalization pretreatment in the extraction unit 10 of the embodiment of the present application, All pixel values are allowed between [- 1,1];Then convolutional neural networks are inputted.
Since convolutional neural networks structure includes multiple convolutional layers, behind each convolutional layer in convolutional neural networks An active coating can be connect, often by one layer of convolutional layer, corresponding characteristic pattern will be obtained.
Corresponding characteristic pattern is obtained by inputting convolutional neural networks after the normalized in above-mentioned steps.
Determine that the characteristic pattern of the feature image refers in the determination unit 20 of the embodiment of the present application, according to the logical of characteristic pattern Road number, the length of characteristic pattern and width, obtain the characteristic pattern of feature image.
For example, the size of every characteristic pattern is set as c*h*w, wherein, c is characterized the port number of figure, and h and w are characterized figure Long and wide, what it is due to input is N pictures, i.e., can finally obtain N characteristic patterns.
Using multiple characteristic patterns as input in the loss function unit 30 of the embodiment of the present application, by convolutional neural networks Full articulamentum, obtain dimension multiple features as input.
For example, N characteristic patterns, by full articulamentum, obtain NxM dimensional features as input.I.e. N number of feature, corresponding to N Picture, each feature M dimensions.
The penalty values of counting loss function refer to, using the class label of the feature of NxM dimensions and picture as input, calculate damage Lose the penalty values of function.
Loss function described in the reversed unit 40 of the embodiment of the present application is for so that in updated convolutional neural networks Trained feature meets preset classification.
Feature meets preset classification, ensures the distance between similar (in class) feature closer to foreign peoples (between class) Distance is farther between feature.
Specifically, the penalty values of counting loss function, including two loss functions, first-loss function is Softmax and cross entropy combine, and the second loss function is angle loss function.
As preferred in the present embodiment, the loss function unit 30 includes:First-loss function unit and the second damage Lose function unit, the first-loss function unit, for the loss function as Softmax and cross entropy combination;Described Two loss function units, for as angle loss function.
In first-loss function unit, the penalty values of counting loss function include:
Wherein,Represent yiCorresponding weight, N represent input picture number;
The average value obtained after the N corresponding all probability of input picture are added is calculated by loss function.
Loss function refers toWherein, f is the fisrt feature obtained,For class The corresponding weight vectors of other i classes, soFor classification yiCorresponding weight vectors (set M classification, every input in this application Picture corresponds to oneself specific one classification yi), yiAs the corresponding true classification of input picture.
Pass throughIt is multiplied to obtain a score with f, andIn formula, represent f and be judged to be broken into yiSuch Probability on not.
The penalty values that loss function is calculated in second loss function unit include:
Wherein,Represent yiCorresponding weight, N represent input picture number, yiRepresent the corresponding class of every input picture Not;
N pictures are calculated by loss functionAverage value.
Wherein f is the fisrt feature obtained,For classification yiCorresponding weight vectors (set M classification, often in this application It opens input picture and corresponds to oneself specific one classification yi), yiAs the corresponding true classification of input picture.
It representsWith the cosine value cos (Wyi, f) of the angle of f, range is between [- 1,1], and closer 1, ThenAngle between vector and f feature vectors is smaller.
What above-mentioned loss function Loss Function were calculated is N picturesAverage value, can To allowIt is small as possible with the angle of f.
As preferred in the present embodiment, further include:Test cell, for inputting second picture to be tested;Pass through institute Corresponding second feature is obtained after stating the updated convolutional neural networks of penalty values;Using the second feature as input, The penalty values of counting loss function;Determine that the second picture corresponds to the classification of object.
Picture to be tested is inputted in the test cell of the embodiment of the present application, the quantity of picture can be N (N>=1) it, passes through After having completed trained neural network, corresponding feature is obtained.
After calculating penalty values in step S108, all parameters of whole network are updated using backpropagation. So picture to be tested is inputted updated convolutional neural networks obtains corresponding characteristic pattern.
The loss function that input is combined by Softmax and cross entropyAngle Spend loss functionThe penalty values of counting loss function.
In test phase feature by Softmax layers, the probability (probability adds up to 1) of all known class is obtained, is chosen The highest classification that object is corresponded to as the picture of probability.
As preferred in the present embodiment, the loss function is for so that training in updated convolutional neural networks It is as follows that feature meets preset classification:The inter- object distance of feature;The between class distance of feature.
When the loss function is for so that the feature of training meets default in updated convolutional neural networks, feature is protected Inter- object distance closer to the between class distance of feature is farther.
For implementing the device of the feature training method of above-mentioned convolutional neural networks, the stronger spy of recognition capability is trained Sign, ensures the inter- object distance of feature closer to the between class distance of feature is farther.The training of feature is mainly by based on orientation optimization Loss function, with reference to Softmax cross entropy loss functions, trained relative to traditional method for only using Softmax cross entropies The feature arrived, the feature that training obtains in the device of the embodiment of the present application identify on the data sets such as Cifar10 and Cifar100 Rate has 1% promotion, and original method recognition accuracy of training pattern on the two data sets is respectively 92.5% He 69.24%, the recognition accuracy in the device of the embodiment of the present application is 93.7% and 72%.
Relative to L-Softmax, the application is easier to train, and L-Softmax methods increase feature very strong constraint, Benefit is can to train the stronger feature of discrimination, but can also face the problem of training process is difficult convergence, and the application is instructing Not convergent process will not be occurred substantially by practicing process, be primarily due to auxiliary of this method as Softmax cross entropies, will not be to spy The constraint of sign is too strong.
Specifically, the feature training method of neural network is performed as follows in the device of the embodiment of the present application:
Mainly for the object identification based on deep learning convolutional neural networks, including training stage and test phase, Middle this method is mainly used for the training stage, helps the stronger model of training recognition capability;
Training stage:Using entire convolutional neural networks as two parts, first part is extraction feature, and second part is It calculates the loss function of feature and does and optimize;
S1 inputs N pictures, and N is the quantity that picture is inputted in batch processing, and N pictures are done with normalization pretreatment, allows institute Some pixel values are between [- 1,1].
S2 is made of convolutional neural networks structure, convolutional neural networks mechanism multiple convolutional layers, after each convolutional layer Face can connect an active coating, often by one layer of convolutional layer, will obtain corresponding characteristic pattern, the specific convolution number of plies and structure meeting Changed according to specific task, only need the output of last layer of convolutional neural networks here;
S3 obtains characteristic pattern to the end, and the size of every characteristic pattern is cxhxw here, and c is characterized the port number of figure, h and w The length and width of figure are characterized, because input is N pictures, finally obtains N characteristic patterns;
S4N characteristic patterns by full articulamentum, obtain NxM dimensional features, i.e., N number of feature, corresponding to N figures as input Piece, each feature M dimensions;
The feature of the last NxM dimensions of S5 and the class label of picture are as input, the penalty values of counting loss function, wherein wrapping Two loss functions are included, first-loss function is that Softmax and cross entropy combine, and the second loss function is angle loss function, Specific formula is as follows:
After S6 counting loss values, all parameters of whole network are updated using backpropagation;
Test phase
S1 inputs picture to be tested, and the quantity of picture is N (N>=1) it, by having completed trained neural network, obtains To corresponding feature;
S2 features pass through Softmax layers, obtain the probability (probability adds up to 1) of all known class, choose probability highest The classification that object is corresponded to as the picture.
Obviously, those skilled in the art should be understood that each module of the above-mentioned present invention or each step can be with general Computing device realize that they can concentrate on single computing device or be distributed in multiple computing devices and be formed Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored In the storage device by computing device come perform either they are fabricated to respectively each integrated circuit modules or by they In multiple modules or step be fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific Hardware and software combines.
The foregoing is merely the preferred embodiments of the application, are not limited to the application, for the skill of this field For art personnel, the application can have various modifications and variations.It is all within spirit herein and principle, made any repair Change, equivalent replacement, improvement etc., should be included within the protection domain of the application.

Claims (10)

1. a kind of feature training method of convolutional neural networks, which is characterized in that including:
Extract fisrt feature picture;
It determines the characteristic pattern of the fisrt feature picture, and fisrt feature is obtained according to the characteristic pattern;
Using the fisrt feature as input, the penalty values of counting loss function;And
Convolutional neural networks are updated according to the penalty values;
Wherein, the loss function is for so that the feature of training meets preset classification in updated convolutional neural networks.
2. feature training method according to claim 1, which is characterized in that the penalty values of counting loss function include:
First-loss function is configured, wherein, the first-loss function is used for the loss letter combined as Softmax and cross entropy Number;
The second loss function is configured, wherein, second loss function is used for as angle loss function.
3. feature training method according to claim 1, which is characterized in that the penalty values of counting loss function include:
Wherein,Represent yiCorresponding weight, N represent input picture number;
The average value obtained after the N corresponding all probability of input picture are added is calculated by loss function.
4. feature training method according to claim 1, which is characterized in that the penalty values of counting loss function include:
Wherein,Represent yiCorresponding weight, N represent input picture number, yiRepresent the corresponding classification of every input picture;
N pictures are calculated by loss functionAverage value.
5. feature training method according to claim 1, which is characterized in that update convolutional Neural net according to the penalty values It is further included after network:
Input second picture to be tested;
By obtaining corresponding second feature after the updated convolutional neural networks of the penalty values;
Using the second feature as input, the penalty values of counting loss function;
Determine that the second picture corresponds to the classification of object.
6. according to claim 1-4 any one of them feature training methods, which is characterized in that the loss function is used to cause It is as follows to meet preset classification for the feature of training in updated convolutional neural networks:
The inter- object distance of feature closer to;
The between class distance of feature is farther.
7. a kind of feature training device of convolutional neural networks, which is characterized in that including:
Extraction unit, for extracting fisrt feature picture;
Determination unit for determining the characteristic pattern of the fisrt feature picture, and obtains fisrt feature according to the characteristic pattern;
Loss function unit, for using the fisrt feature as input, the penalty values of counting loss function;
Reversed unit, for updating convolutional neural networks according to the penalty values;Wherein, the loss function is for so that update The feature of training meets preset classification in convolutional neural networks afterwards.
8. feature training device according to claim 7, which is characterized in that the loss function unit includes:First damage Function unit and the second loss function unit are lost,
The first-loss function unit, for the loss function as Softmax and cross entropy combination;
The second loss function unit, for as angle loss function.
9. feature training device according to claim 7, which is characterized in that further include:Test cell, it is to be measured for inputting The second picture of examination;
By obtaining corresponding second feature after the updated convolutional neural networks of the penalty values;
Using the second feature as input, the penalty values of counting loss function;
Determine that the second picture corresponds to the classification of object.
10. feature training device according to claim 7, which is characterized in that the reversed unit is additionally operable to, and passes through loss It is default that function so that the feature of training in updated convolutional neural networks meets:The inter- object distance of feature closer to;The class of feature Between distance it is farther.
CN201810096726.8A 2018-01-31 2018-01-31 Feature training method and device of convolutional neural network Active CN108197669B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810096726.8A CN108197669B (en) 2018-01-31 2018-01-31 Feature training method and device of convolutional neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810096726.8A CN108197669B (en) 2018-01-31 2018-01-31 Feature training method and device of convolutional neural network

Publications (2)

Publication Number Publication Date
CN108197669A true CN108197669A (en) 2018-06-22
CN108197669B CN108197669B (en) 2021-04-30

Family

ID=62591623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810096726.8A Active CN108197669B (en) 2018-01-31 2018-01-31 Feature training method and device of convolutional neural network

Country Status (1)

Country Link
CN (1) CN108197669B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109165566A (en) * 2018-08-01 2019-01-08 中国计量大学 A kind of recognition of face convolutional neural networks training method based on novel loss function
CN109977845A (en) * 2019-03-21 2019-07-05 百度在线网络技术(北京)有限公司 A kind of drivable region detection method and car-mounted terminal
CN110378278A (en) * 2019-07-16 2019-10-25 北京地平线机器人技术研发有限公司 Training method, object search method, apparatus and the electronic equipment of neural network
CN110414550A (en) * 2019-06-14 2019-11-05 北京迈格威科技有限公司 Training method, device, system and the computer-readable medium of human face recognition model
CN110717359A (en) * 2018-07-12 2020-01-21 浙江宇视科技有限公司 Back propagation optimization method and device based on mathematical statistics and electronic equipment
CN113420737A (en) * 2021-08-23 2021-09-21 成都飞机工业(集团)有限责任公司 3D printing pattern recognition method based on convolutional neural network

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682734A (en) * 2016-12-30 2017-05-17 中国科学院深圳先进技术研究院 Method and apparatus for increasing generalization capability of convolutional neural network
CN107909145A (en) * 2017-12-05 2018-04-13 苏州天瞳威视电子科技有限公司 A kind of training method of convolutional neural networks model
CN107944410A (en) * 2017-12-01 2018-04-20 中国科学院重庆绿色智能技术研究院 A kind of cross-cutting facial characteristics analytic method based on convolutional neural networks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682734A (en) * 2016-12-30 2017-05-17 中国科学院深圳先进技术研究院 Method and apparatus for increasing generalization capability of convolutional neural network
CN107944410A (en) * 2017-12-01 2018-04-20 中国科学院重庆绿色智能技术研究院 A kind of cross-cutting facial characteristics analytic method based on convolutional neural networks
CN107909145A (en) * 2017-12-05 2018-04-13 苏州天瞳威视电子科技有限公司 A kind of training method of convolutional neural networks model

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717359A (en) * 2018-07-12 2020-01-21 浙江宇视科技有限公司 Back propagation optimization method and device based on mathematical statistics and electronic equipment
CN110717359B (en) * 2018-07-12 2023-07-25 浙江宇视科技有限公司 Counter propagation optimization method and device based on mathematical statistics and electronic equipment
CN109165566A (en) * 2018-08-01 2019-01-08 中国计量大学 A kind of recognition of face convolutional neural networks training method based on novel loss function
CN109165566B (en) * 2018-08-01 2021-04-27 中国计量大学 Face recognition convolutional neural network training method based on novel loss function
CN109977845A (en) * 2019-03-21 2019-07-05 百度在线网络技术(北京)有限公司 A kind of drivable region detection method and car-mounted terminal
CN110414550A (en) * 2019-06-14 2019-11-05 北京迈格威科技有限公司 Training method, device, system and the computer-readable medium of human face recognition model
CN110414550B (en) * 2019-06-14 2022-07-29 北京迈格威科技有限公司 Training method, device and system of face recognition model and computer readable medium
CN110378278A (en) * 2019-07-16 2019-10-25 北京地平线机器人技术研发有限公司 Training method, object search method, apparatus and the electronic equipment of neural network
CN110378278B (en) * 2019-07-16 2021-11-02 北京地平线机器人技术研发有限公司 Neural network training method, object searching method, device and electronic equipment
CN113420737A (en) * 2021-08-23 2021-09-21 成都飞机工业(集团)有限责任公司 3D printing pattern recognition method based on convolutional neural network
CN113420737B (en) * 2021-08-23 2022-01-25 成都飞机工业(集团)有限责任公司 3D printing pattern recognition method based on convolutional neural network

Also Published As

Publication number Publication date
CN108197669B (en) 2021-04-30

Similar Documents

Publication Publication Date Title
CN108197669A (en) The feature training method and device of convolutional neural networks
CN111242088B (en) Target detection method and device, electronic equipment and storage medium
CN107657249A (en) Method, apparatus, storage medium and the processor that Analysis On Multi-scale Features pedestrian identifies again
CN112818862B (en) Face tampering detection method and system based on multi-source clues and mixed attention
CN106650615B (en) A kind of image processing method and terminal
CN108399362A (en) A kind of rapid pedestrian detection method and device
CN110097051A (en) Image classification method, device and computer readable storage medium
CN110246163A (en) Image processing method and its device, equipment, computer storage medium
CN108090433A (en) Face identification method and device, storage medium, processor
CN108961675A (en) Fall detection method based on convolutional neural networks
CN105427333B (en) Real-time Registration, system and the camera terminal of video sequence image
CN112883902B (en) Video detection method and device, electronic equipment and storage medium
CN104318570A (en) Self-adaptation camouflage design method based on background
CN110135460B (en) Image information enhancement method based on VLAD convolution module
CN110069959A (en) A kind of method for detecting human face, device and user equipment
CN109685145A (en) A kind of small articles detection method based on deep learning and image procossing
CN109685772B (en) No-reference stereo image quality evaluation method based on registration distortion representation
CN110008819A (en) A kind of facial expression recognizing method based on figure convolutional neural networks
CN109993089A (en) A kind of video object removal and background recovery method based on deep learning
CN105551063B (en) A kind of method and device for being used to track moving target in video
CN106557566A (en) A kind of text training method and device
González-Hidalgo et al. A new edge detector based on uninorms
CN108846420A (en) Network structure and client
CN112446845A (en) Map construction method, map construction device, SLAM system, and storage medium
Heng et al. Harmonic adversarial attack method

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
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20180622

Assignee: Apple R&D (Beijing) Co., Ltd.

Assignor: BEIJING MOSHANGHUA TECHNOLOGY CO., LTD.

Contract record no.: 2019990000054

Denomination of invention: Characteristic training method and device of convolutional neural network

License type: Exclusive License

Record date: 20190211

GR01 Patent grant
GR01 Patent grant