CN106548201A - The training method of convolutional neural networks, image-recognizing method and device - Google Patents

The training method of convolutional neural networks, image-recognizing method and device Download PDF

Info

Publication number
CN106548201A
CN106548201A CN201610942156.0A CN201610942156A CN106548201A CN 106548201 A CN106548201 A CN 106548201A CN 201610942156 A CN201610942156 A CN 201610942156A CN 106548201 A CN106548201 A CN 106548201A
Authority
CN
China
Prior art keywords
training
convolutional neural
neural networks
computation layer
predetermined probabilities
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
CN201610942156.0A
Other languages
Chinese (zh)
Other versions
CN106548201B (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 Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610942156.0A priority Critical patent/CN106548201B/en
Publication of CN106548201A publication Critical patent/CN106548201A/en
Application granted granted Critical
Publication of CN106548201B publication Critical patent/CN106548201B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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

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

The disclosure is directed to a kind of training method of convolutional neural networks, image-recognizing method and device, should be included based on the image-recognizing method of convolutional neural networks:Obtain the convolutional neural networks that training is completed, it is described to train the convolutional neural networks for completing by carrying out convolutional neural networks training to training sample and initialization convolutional neural networks, discard portion computation layer during iterative calculation each time in the training process, and the computation layer for replacing being rejected is mapped with unit and is obtained;Pretreatment is carried out to images to be recognized, test sample is obtained;According to the convolutional neural networks trained and complete, image recognition is carried out to the test sample, result is identified.The technical scheme can save training time and internal memory so that the CNN of the more numbers of plies of training becomes a reality;And in image recognition, the CNN of the more layers completed with training is carrying out image recognition, it is ensured that the accuracy of image recognition.

Description

The training method of convolutional neural networks, image-recognizing method and device
Technical field
It relates to technical field of information processing, more particularly to training method, the image recognition side of convolutional neural networks Method and device.
Background technology
Convolutional neural networks (Convolutional Neural Networks, CNN) are developed recentlies, and are caused A kind of efficient image-recognizing method extensively paid attention to.In CNN, the sub-fraction (local experiences region) of image is used as level The input of the lowermost layer of structure, information are transferred to different layers again successively, and per layer is gone to be observed by a digital filter The most significant feature of data.This method can obtain the marked feature of the observation data to translation, scaling and invariable rotary.
The content of the invention
The embodiment of the present disclosure provides training method, image-recognizing method and the device of convolutional neural networks.The technical side Case is as follows:
According to the first aspect of the embodiment of the present disclosure, there is provided a kind of image-recognizing method based on convolutional neural networks, bag Include:
Obtain the convolutional neural networks that complete of training, the convolutional neural networks that the training is completed by training sample and Initialization convolutional neural networks carry out convolutional neural networks training, discard portion during iterative calculation each time in the training process Computation layer, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Pretreatment is carried out to images to be recognized, test sample is obtained;
According to the convolutional neural networks trained and complete, image recognition is carried out to the test sample, be identified knot Really.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can obtain instruction During the convolutional neural networks that white silk is completed, iterative calculation is only retained less than entering equal to the computation layer of the maximum training depth of computer every time Row computing, it is ensured that computer has enough memory sources to carry out each iterative calculation, and saves the training time so that training The CNN of more numbers of plies becomes a reality;And in image recognition, the CNN of the more layers completed with training is carrying out image knowledge Not, it is ensured that the accuracy of image recognition.
In one embodiment, the discard portion computation layer of iterative calculation each time in the training process, and with singly Bit mapping replaces the computation layer being rejected, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and use unit Mapping replaces the computation layer being rejected;
The convolutional neural networks completed according to the training, carry out image recognition to the test sample, are known Other result, including:
According to the convolutional neural networks and the predetermined probabilities trained and complete, image knowledge is carried out to the test sample Not, it is identified result.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can be each time According to the random discard portion computation layer of predetermined probabilities during iterative calculation so that each computation layer of CNN has the opportunity to be trained, Under conditions of training data deficiency, add regularization constraint equivalent to CNN models, can further improve accuracy of identification; And when image recognition is carried out, according to the convolutional neural networks that complete of training and predetermined probabilities, figure is carried out to the test sample As identification, the correctness of recognition result is further improved.
In one embodiment, the initialization convolutional neural networks include L basic module, each during the training Secondary iterative calculation is according to the random discard portion computation layer of predetermined probabilities, and the computation layer for replacing being rejected is mapped with unit, including:
During iterative calculation each time in the training process, generate according to the predetermined probabilities and the L basic module One-to-one L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and the random value is 0 probability For the predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is rejected with unit mapping replacement Computation layer.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can be according to by pre- If the random value that probability is generated is determining computation layer to be given up, efficient and convenient.
In one embodiment, it is described according to the convolutional neural networks and the predetermined probabilities trained and complete, to institute Stating test sample carries out image recognition, is identified result, including:
By the test sample input described convolutional neural networks trained and complete, by the convolutional Neural trained and complete In network, the output valve of each computation layer is multiplied by the predetermined probabilities, is identified result.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can be by the instruction In the convolutional neural networks that white silk is completed, the output valve of each computation layer is multiplied by the predetermined probabilities, is identified result, can be most Improve the accuracy of identification for training the CNN for completing to image in limits ground.
In one embodiment, methods described also includes:
Predetermined probabilities P are obtained according to below equation:
P=(1-H2/H1);
Wherein, the H1 is the depth of the initialization convolutional neural networks, and the H2 is that the maximum training of computer is deep Spend for H2.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can be to greatest extent The memory source of land productivity computer, trains the computation layer of most multilamellar, and training to a greater degree obtains accurate CNN models, can To improve the accuracy of identification for training the CNN for completing to image to greatest extent.
According to the second aspect of the embodiment of the present disclosure, there is provided a kind of training method of convolutional neural networks, including:
Obtain training sample and initialization convolutional neural networks;
Convolutional neural networks training is carried out according to the training sample and the initialization convolutional neural networks, was being trained Discard portion computation layer during iterative calculation each time in journey, and the computation layer for replacing being rejected is mapped with unit, trained The convolutional neural networks for completing.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can be in training more During the CNN of many numbers of plies, iterative calculation is only retained less than carrying out computing equal to the computation layer of the maximum training depth of computer every time, protects Card computer has enough memory sources to carry out each iterative calculation, and saves the training time so that the more numbers of plies of training CNN become a reality;And in image recognition, the CNN of the more layers completed with training is carrying out image recognition, it is ensured that figure As the accuracy of identification.
In one embodiment, the discard portion computation layer of iterative calculation each time in the training process, and with singly Bit mapping replaces the computation layer being rejected, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and use unit Mapping replaces the computation layer being rejected.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can be each time According to the random discard portion computation layer of predetermined probabilities during iterative calculation so that each computation layer of CNN has the opportunity to be trained, Under conditions of training data deficiency, add regularization constraint equivalent to CNN models, can further improve accuracy of identification.
In one embodiment, the initialization convolutional neural networks include L basic module, each during the training Secondary iterative calculation is according to the random discard portion computation layer of predetermined probabilities, and the computation layer for replacing being rejected is mapped with unit, including:
During iterative calculation each time in the training process, generate according to the predetermined probabilities and the L basic module One-to-one L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and the random value is 0 probability For the predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is rejected with unit mapping replacement Computation layer.
The technical scheme that embodiment of the disclosure is provided can include following beneficial effect:The present embodiment can be according to by pre- If the random value that probability is generated is determining computation layer to be given up, efficient and convenient.
According to the third aspect of the embodiment of the present disclosure, there is provided a kind of pattern recognition device based on convolutional neural networks, bag Include:
First acquisition module, for obtaining the convolutional neural networks that training is completed, the convolutional Neural net that the training is completed Network by training sample and initialization convolutional neural networks carry out convolutional neural networks training, in the training process each time Discard portion computation layer during iterative calculation, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Processing module, for carrying out pretreatment to images to be recognized, obtains test sample;
Identification module, for training the convolutional neural networks for completing according to described, carries out image knowledge to the test sample Not, it is identified result.
In one embodiment, first acquisition module, including:
The first generation replaces submodule, for giving up according to predetermined probabilities at random during iterative calculation each time in the training process Part computation layer, and the computation layer for replacing being rejected is mapped with unit;
The identification module, including:
Identification submodule, for training the convolutional neural networks and the predetermined probabilities that complete according to described, to the survey Sample originally carries out image recognition, is identified result.
In one embodiment, the initialization convolutional neural networks include L basic module;
The first generation replaces submodule, for during iterative calculation each time in the training process, according to described default general Rate is generated and the one-to-one L random value of the L basic module, gives up the random value for 0 corresponding basic module institute Corresponding computation layer, and the computation layer for replacing being rejected is mapped with unit;Wherein, the random value be 1 probability it is default for 1- Probability, it is the predetermined probabilities that the random value is 0 probability.
In one embodiment, the identification submodule, for training the volume for completing by test sample input described The output valve of each computation layer in the convolutional neural networks trained and complete is multiplied by the predetermined probabilities by product neutral net, It is identified result.
In one embodiment, described device also includes:
Second acquisition module, for obtaining predetermined probabilities P according to below equation:P=(1-H2/H1);Wherein, the H1 is The depth of the initialization convolutional neural networks, the H2 are H2 for the maximum training depth of computer.
According to the fourth aspect of the embodiment of the present disclosure, there is provided a kind of training devicess of convolutional neural networks, including:
3rd acquisition module, for obtaining training sample and initialization convolutional neural networks;
Training module, for carrying out convolutional neural networks according to the training sample and the initialization convolutional neural networks Discard portion computation layer when training, iterative calculation each time in the training process, and the meter for replacing being rejected is mapped with unit Layer is calculated, obtains training the convolutional neural networks for completing.
In one embodiment, the training module, including:
The second filial generation replaces submodule, for giving up according to predetermined probabilities at random during iterative calculation each time in the training process Part computation layer, and the computation layer for replacing being rejected is mapped with unit;
In one embodiment, the initialization convolutional neural networks include L basic module;
The second filial generation replaces submodule, for during iterative calculation each time in the training process, according to described default general Rate is generated and the one-to-one L random value of the L basic module, wherein, it is 1- default general that the random value is 1 probability Rate, it is the predetermined probabilities that the random value is 0 probability;It is corresponding to 0 corresponding basic module to give up the random value Computation layer, and the computation layer for replacing being rejected is mapped with unit.
In terms of the 5th of the embodiment of the present disclosure, there is provided a kind of pattern recognition device based on convolutional neural networks, bag Include:
Processor;
For storing the memorizer of processor executable;
Wherein, the processor is configured to:
Obtain the convolutional neural networks that complete of training, the convolutional neural networks that the training is completed by training sample and Initialization convolutional neural networks carry out convolutional neural networks training, discard portion during iterative calculation each time in the training process Computation layer, and the computation layer for replacing being rejected is mapped with unit and is obtained;Pretreatment is carried out to images to be recognized, test specimens are obtained This;
According to the convolutional neural networks trained and complete, image recognition is carried out to the test sample, be identified knot Really.
In terms of the 6th of the embodiment of the present disclosure, there is provided a kind of training devicess of convolutional neural networks, including:
Processor;
For storing the memorizer of processor executable;
Wherein, the processor is configured to:
Obtain training sample and initialization convolutional neural networks;
Convolutional neural networks training is carried out according to the training sample and the initialization convolutional neural networks, was being trained Discard portion computation layer during iterative calculation each time in journey, and the computation layer for replacing being rejected is mapped with unit, trained The convolutional neural networks for completing.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not The disclosure can be limited.
Description of the drawings
During accompanying drawing herein is merged in description and the part of this specification is constituted, show the enforcement for meeting the disclosure Example, and be used for explaining the principle of the disclosure together with description.
Fig. 1 is the flow chart of the image-recognizing method based on convolutional neural networks according to an exemplary embodiment.
Fig. 2 is the block diagram of the basic module according to an exemplary embodiment.
Fig. 3 is the flow chart of the training method of the convolutional neural networks according to an exemplary embodiment.
Fig. 4 is the image-recognizing method flow chart based on convolutional neural networks according to an exemplary embodiment.
Fig. 5 is the image-recognizing method flow chart based on convolutional neural networks according to an exemplary embodiment.
Fig. 6 is the flow chart of the training method of the convolutional neural networks according to an exemplary embodiment.
Fig. 7 is the block diagram of the pattern recognition device based on convolutional neural networks according to an exemplary embodiment.
Fig. 8 is the block diagram of the pattern recognition device based on convolutional neural networks according to an exemplary embodiment.
Fig. 9 is the block diagram of the pattern recognition device based on convolutional neural networks according to an exemplary embodiment.
Figure 10 is the block diagram of the training devicess of the convolutional neural networks according to an exemplary embodiment.
Figure 11 is the block diagram of the training devicess of the convolutional neural networks according to an exemplary embodiment.
Figure 12 is the block diagram of the pattern recognition device based on convolutional neural networks according to an exemplary embodiment.
Figure 13 is the block diagram of the training devicess of the convolutional neural networks according to an exemplary embodiment.
Specific embodiment
Here in detail exemplary embodiment will be illustrated, its example is illustrated in the accompanying drawings.Explained below is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the disclosure.Conversely, they be only with as appended by The example of consistent apparatus and method in terms of some described in detail in claims, the disclosure.
In correlation technique, the number of plies of image recognition accuracy rate and CNN based on CNN has direct relation, carries from initially Go out to constantly improve, the number of plies of CNN increases 152 present layer network structures from the 8 layer network structures for most starting, The image recognition error rate that common image evaluation and test collection closes also is down to 3% from 16%.In order to further improve CNN identification figures The precision of picture, can further increase the number of plies of CNN.However, the memory source of computer cannot meet the CNN's of more numbers of plies Need, meanwhile, the number of plies for increasing CNN can cause machine learning and training speed slack-off;That is, the cost of time and internal memory Do not allow to train the CNN models of more numbers of plies.
To solve the above problems, the present embodiment can give up portion when iterating to calculate each time when the CNN of more numbers of plies is trained Divide computation layer, and the computation layer for replacing being rejected is mapped with unit, obtain training the convolutional neural networks for completing;Thus reduce During training, the expense of computing resource, saves training time and internal memory so that the CNN of the more numbers of plies of training becomes a reality;And And in image recognition, the CNN of the more layers completed with training is carrying out image recognition, it is ensured that the accuracy of image recognition.
Fig. 1 is a kind of flow process of the image-recognizing method based on convolutional neural networks according to an exemplary embodiment Figure, as shown in figure 1, image-recognizing method that should be based on convolutional neural networks is used in the equipment such as terminal, comprises the following steps 101-103:
In a step 101, the convolutional neural networks that training is completed are obtained, the convolutional neural networks that the training is completed pass through Convolutional neural networks training is carried out to training sample and initialization convolutional neural networks, iteration meter each time in the training process Discard portion computation layer during calculation, and the computation layer for replacing being rejected is mapped with unit and is obtained.
In a step 102, pretreatment is carried out to images to be recognized, obtains test sample.
In step 103, according to the convolutional neural networks trained and complete, image knowledge is carried out to the test sample Not, it is identified result.
In this embodiment, terminal is obtained and trains the convolutional neural networks for completing obtain after terminal oneself trains CNN Take and train the convolutional neural networks for completing, or computer aid training CNN to send out after obtaining training the convolutional neural networks for completing Give terminal.
In this embodiment, illustrate so that computer aid training CNN obtains training the convolutional neural networks for completing as an example, count The process of calculation machine training CNN can be as follows:
Here, computer can obtain the picture of training, and to the training with picture carry out pretreatment and trained Sample.The CNN that convolutional neural networks can be more layers is initialized, the number of plies of initialization depth CNN can exceed computer Maximum training depth.Here the maximum training depth of computer refers to that computer is instructed using computation layers whole in CNN When practicing, the number of plies of the computation layer of the CNN of the maximum number of plies that can be trained.
Assume that the maximum of computer trains depth to be H2, then computer obtains training sample and initialization CNN, beginning CNN During training, training sample is input into into initialized CNN, in first time iterative calculation (including propagated forward and back propagation) When, the computation layer of H2 layers can be retained less than, and the computation layer and guarantor for replacing being rejected mapped with unit with discard portion computation layer The computation layer stayed carries out propagated forward and back propagation computing together;Then change the partial parameters in initialization CNN, carry out down An iteration is calculated, and continues discard portion computation layer, is retained less than the computation layer of H2 layers, and is mapped what replacement was rejected with unit Computation layer and the computation layer for retaining carry out propagated forward and back propagation computing together;Successive ignition calculating is carried out so, until In CNN, parameter causes the training result of CNN to restrain, and thus obtains training the CNN for completing.
Need exist for illustrate be, it is assumed that computation layer 1 be rejected and with unit mapping replace after, input value is through computation layer Output valve is obtained after 1, input value now is identical with output valve, i.e., the computation layer for replacing is mapped with unit in the training process simultaneously Computer is not needed to expend memory source to calculate, it is only necessary to which the output valve of previous computation layer is pass-through to the defeated of next computation layer Enter.
In this embodiment, after computer aid training obtains training the convolutional neural networks for completing, the convolution that training is completed Neutral net is sent to terminal, and the convolutional neural networks completed by the terminal applies training carry out image recognition, and terminal is being carried out During image recognition, pretreatment is carried out to images to be recognized first, obtain test sample, image is being carried out to the test sample then During identification, image recognition computing is carried out to the test sample using the whole computation layers in the CNN that training is completed, is identified As a result.
Explanation is needed exist for, terminal will be using to each when the CNN completed using training carries out image recognition Computation layer, it is contemplated that each computation layer has certain reservation probability in training, then in the CNN completed using training When whole computation layers carry out image recognition computing to test sample, the output valve of each computation layer can be multiplied by certain probability Value, it is ensured that the correctness of the recognition result for finally obtaining.
The present embodiment can iterative calculation be only retained less than equal to computer every time when the CNN for carrying out more levels is trained The computation layer of maximum training depth carries out computing, it is ensured that computer has enough memory sources to carry out each iterative calculation, and Save the training time so that the CNN of the more numbers of plies of training becomes a reality;And in image recognition, with being somebody's turn to do that training is completed The CNN of more layers is carrying out image recognition, it is ensured that the accuracy of image recognition.
As a kind of possible embodiment, in the step 101, give up during iterative calculation each time in the training process Part computation layer, and the computation layer for replacing being rejected is mapped with unit, it is possible to achieve for step A1, the step 103 can be real It is now step A2.
In step A1, calculate according to the random discard portion of predetermined probabilities during iterative calculation each time in the training process Layer, and the computation layer for replacing being rejected is mapped with unit.
In step A2, according to the convolutional neural networks and the predetermined probabilities trained and complete, to the test specimens Originally image recognition is carried out, result is identified.
In this embodiment, predetermined probabilities can user input, or computer oneself generate, as long as protecting After card is according to the predetermined probabilities discard portion computation layer, the number of plies of the computation layer of reservation trains depth less than the maximum of computer .
In this embodiment, to examine using to each computation layer when the CNN completed using training carries out image recognition Consider each computation layer in training to be rejected according to predetermined probabilities, then the whole meters in the CNN completed using training When calculation layer carries out image recognition computing to test sample, the output valve of at least one computation layer is multiplied by into (1- predetermined probabilities), this Sample can improve the correctness of recognition result.
Assume in the present embodiment that the depth for initializing CNN is L, therefore the calculation cost paid in training initialization CNN is only Depth is trained only for the cost of the network of (1- predetermined probabilities) * L, what is used when image recognition is carried out is but that depth is L The performance of network.
The present embodiment can be when iterating to calculate according to the random discard portion computation layer of predetermined probabilities each time so that CNN Each computation layer have the opportunity to be trained, training data deficiency under conditions of, equivalent to CNN models add regularization Constraint, can further improve accuracy of identification;And when image recognition is carried out, according to the convolutional neural networks that complete of training and pre- If probability, image recognition is carried out to the test sample, further improve the correctness of recognition result.
Used as a kind of possible embodiment, the initialization convolutional neural networks include L basic module, step A1 Can be implemented as step A11 and A12.
In step A11, during iterative calculation each time in the training process, according to the predetermined probabilities generate with it is described The one-to-one L random value of L basic module, wherein, it is the predetermined probabilities that the random value is 1 probability, it is described with It is 1- predetermined probabilities that machine value is 0 probability.
In step A12, it is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is reflected with unit Penetrate the computation layer for replacing being rejected.
In this embodiment, the initialization CNN can include L basic module, and Fig. 2 is one of which basic module Block diagram, as shown in Fig. 2 the basic module includes input module 201, the first convolution submodule 202, the first normalization submodule 203rd, the first activation submodule 204, the second convolution submodule 205, the second normalization submodule 206, addition submodule 207, the Two activation submodules 208 and output module 209.Other basic modules are similar with the basic module shown in Fig. 2, simply in module Parameter it is different, here is not described in detail one by one.
Explanation is needed exist for, a computation layer in CNN in CNN, is often formed using a basic module.
In this embodiment, when iterating to calculate each time, generate and L basic module (basic module according to predetermined probabilities 1st, basic module 2 ..., basic module L) one-to-one L random value Bl, l=1,2 ..., L, wherein, the random value is 1 Probability be the predetermined probabilities, it is 1- predetermined probabilities that the random value is 0 probability, that is, the L for giving up predetermined probabilities is basic Module, retains L basic module of 1- predetermined probabilities;Thus, in the iterative calculation each time of training, just giving up to fall random value Computation layer corresponding to 0 corresponding basic module, that is, give up to fall the computation layer of predetermined probabilities.Illustratively, predetermined probabilities are 70%, then L random value BlIn have 30% random value to be 1,70% random value is 0, thus, when iterating to calculate each time, Just give up to fall the computation layer that the corresponding basic module of this 70% random value is formed, that is, give up to fall 70% computation layer, only retain 30% computation layer, thus, the memory source of computer is completed by only needing to carry out the computing of this 30% computation layer To depth for L CNN training.
The present embodiment can determine computation layer to be given up according to the random value generated by predetermined probabilities, efficient and convenient.
Used as a kind of possible embodiment, step A2 can be implemented as step A21.
In step A21, the test sample input described convolutional neural networks trained and complete are trained described Into convolutional neural networks in the output valve of each computation layer be multiplied by the predetermined probabilities, be identified result.
In this embodiment, after obtaining training the CNN for completing, the CNN completed using training will when carrying out image recognition Using each basic module, it is contemplated that the survival probability of each basic module is (1- predetermined probabilities) in training, that When image recognition is carried out, the output valve of each basic module will correspondingly be multiplied by (1- predetermined probabilities);So, can be with The accuracy of identification for training the CNN for completing to image is improved to greatest extent.
The output valve of each computation layer in the convolutional neural networks trained and complete can be multiplied by described by the present embodiment Predetermined probabilities, are identified result, can improve the accuracy of identification for training the CNN for completing to image to greatest extent.
Used as a kind of possible embodiment, methods described also includes step B1.
In step bl is determined., predetermined probabilities P are obtained according to below equation:P=(1-H2/H1);Wherein, the H1 is described first The depth of beginningization convolutional neural networks, the H2 are H2 for the maximum training depth of computer.
In this embodiment, when computer obtains initialization CNN, you can the depth for obtaining initialization CNN is H1, i.e., initially There is H1 computation layer in changing CNN, the maximum training depth that the internal memory of simultaneous computer can be carried out is H2, that is, changed when training every time Generation calculates can only H2 computation layer of computing;Thus, computer can obtain predetermined probabilities P=(1-H2/H1).
Illustratively, it is assumed that it is 300 that H1 is 1000, H2, then predetermined probabilities P=(1-300/1000)=;Then iteration each time Just give up to fall 0.7*1000=700 computation layer during calculating at random, and 700 computation layers for replacing being rejected mapped with unit, Retain 300 computation layers, thus, it is (1-0.7) * that the calculation cost paid in training initialization CNN only trains depth The cost of the network of 1000=300;That what is used when image recognition is carried out is but the CNN that depth is L=1000, it is contemplated that In training, the survival probability of each computation layer is (1-0.7), then when image recognition is carried out, the output of each basic module Value will correspondingly be multiplied by (1-0.7)=0.3, to represent that their output valve is given up by random with 0.7 probability in training.
The present embodiment can maximally utilise the memory source of computer, train the computation layer of most multilamellar, more great Cheng The training of degree ground obtains accurate CNN models, can improve the accuracy of identification for training the CNN for completing to image to greatest extent.
Fig. 3 is a kind of flow chart of the training method of the convolutional neural networks according to an exemplary embodiment, such as Fig. 3 Shown, the training method of the convolutional neural networks is used in the equipment such as computer, comprises the following steps 301-302:
In step 301, training sample and initialization convolutional neural networks are obtained.
In step 302, convolutional neural networks are carried out according to the training sample and the initialization convolutional neural networks Discard portion computation layer when training, iterative calculation each time in the training process, and the meter for replacing being rejected is mapped with unit Layer is calculated, obtains training the convolutional neural networks for completing.
In this embodiment, computer first can obtain training picture, and to the training with picture carry out pre- place Reason obtains training sample.Initialization convolutional neural networks can be the CNN of more layers, and the number of plies of initialization depth CNN can be with More than the maximum training depth of computer.Here the maximum training depth of computer refers to that computer is using meters whole in CNN When calculation layer is trained, the number of plies of the computation layer of the CNN of the maximum number of plies that can be trained.
In this embodiment it is assumed that the maximum training depth of computer is H2, then computer obtains training sample and initial Change CNN, when starting CNN training, training sample is input into into initialized CNN, the iterative calculation in first time (includes front to biography Broadcast and back propagation) when, the computation layer of H2 layers can be retained less than, and replaces being given up with unit mapping with discard portion computation layer The computation layer abandoned and the computation layer for retaining carry out propagated forward and back propagation computing together;Then change in initialization CNN Partial parameters, carry out next iteration calculating, continue discard portion computation layer, are retained less than the computation layer of H2 layers, and use unit Mapping replaces the computation layer being rejected and the computation layer for retaining to carry out propagated forward and back propagation computing together;So carry out many Secondary iterative calculation, in CNN, parameter causes the training result of CNN to restrain, and thus obtains training the CNN for completing.
Need exist for illustrate be, it is assumed that computation layer 1 be rejected and with unit mapping replace after, input value is through computation layer Output valve is obtained after 1, input value now is identical with output valve, i.e., the computation layer for replacing is mapped with unit in the training process simultaneously Computer is not needed to expend memory source to calculate, it is only necessary to which the output valve of previous computation layer is pass-through to the defeated of next computation layer Enter.
The present embodiment can iterative calculation be only retained less than equal to computer every time when the CNN for carrying out more levels is trained The computation layer of maximum training depth carries out computing, it is ensured that computer has enough memory sources to carry out each iterative calculation, and Save the training time so that the CNN of the more numbers of plies of training becomes a reality.
As a kind of possible embodiment, give up during iterative calculation each time in the training process in the step 302 Part computation layer is abandoned, and the computation layer for replacing being rejected is mapped with unit, obtain training the convolutional neural networks for completing, Ke Yishi It is now step C1,
In step C1, calculate according to the random discard portion of predetermined probabilities during iterative calculation each time in the training process Layer, and the computation layer for replacing being rejected is mapped with unit.
In this embodiment, predetermined probabilities can user input, or computer oneself generate, as long as protecting After card is according to the predetermined probabilities discard portion computation layer, the number of plies of the computation layer of reservation trains depth less than the maximum of computer .
In this embodiment, to examine using to each computation layer when the CNN completed using training carries out image recognition Consider each computation layer in training to be rejected according to predetermined probabilities, then the whole meters in the CNN completed using training When calculation layer carries out image recognition computing to test sample, the output valve of at least one computation layer is multiplied by into (1- predetermined probabilities), this Sample can improve the correctness of recognition result.
Assume in the present embodiment that the depth for initializing CNN is L, therefore the calculation cost paid in training initialization CNN is only Depth is trained only for the cost of the network of (1- predetermined probabilities) * L, what is used when image recognition is carried out is but that depth is L The performance of network.
The present embodiment can be when iterating to calculate according to the random discard portion computation layer of predetermined probabilities each time so that CNN Each computation layer have the opportunity to be trained, training data deficiency under conditions of, equivalent to CNN models add regularization Constraint, can further improve accuracy of identification.
Used as a kind of possible embodiment, step C1 can be implemented as step C11 and C12, including:
In step C11, during iterative calculation each time in the training process, according to the predetermined probabilities generate with it is described The one-to-one L random value of L basic module, wherein, it is 1- predetermined probabilities that the random value is 1 probability, described random Be worth for 0 probability be the predetermined probabilities.
In step C12, it is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is reflected with unit Penetrate the computation layer for replacing being rejected.
In this embodiment, the initialization CNN can include L basic module, and with reference to Fig. 2, the basic module includes Input module 201, the first convolution submodule 202, the first normalization submodule 203, first activate submodule 204, the second convolution Submodule 205, the second normalization submodule 206, addition submodule 207, second activation submodule 208 and output module 209.Its His basic module is similar with the basic module shown in Fig. 2, and simply the parameter in module is different, and here is not described in detail one by one.
Explanation is needed exist for, a computation layer in CNN in CNN, is often formed using a basic module.
In this embodiment, when iterating to calculate each time, generate and L basic module (basic module according to predetermined probabilities 1st, basic module 2 ..., basic module L) one-to-one L random value Bl, l=1,2 ..., L, wherein, the random value is 1 Probability be the predetermined probabilities, it is 1- predetermined probabilities that the random value is 0 probability, that is, the L for giving up predetermined probabilities is basic Module, retains L basic module of 1- predetermined probabilities;Thus, in the iterative calculation each time of training, just giving up to fall random value Computation layer corresponding to 0 corresponding basic module, that is, give up to fall the computation layer of predetermined probabilities.Illustratively, predetermined probabilities are 70%, then the random value for having 30% in L random value Bl is 1, and 70% random value is 0, thus, when iterating to calculate each time, Just give up to fall the computation layer that the corresponding basic module of this 70% random value is formed, that is, give up to fall 70% computation layer, only retain 30% computation layer, thus, the memory source of computer is completed by only needing to carry out the computing of this 30% computation layer To depth for L CNN training.
Here it should be noted that computer can obtain predetermined probabilities P according to below equation:P=(1-H2/H1); Wherein, the H1 is the depth of the initialization convolutional neural networks, and the H2 is H2 for the maximum training depth of computer. In the embodiment, when computer obtains initialization CNN, you can the depth for obtaining initialization CNN is H1, that is, have in initializing CNN H1 computation layer, the maximum training depth that the internal memory of simultaneous computer can be carried out is H2, that is, only iterate to calculate every time when training Can H2 computation layer of computing;Thus, computer can obtain predetermined probabilities P=(1-H2/H1).
The present embodiment can determine computation layer to be given up according to the random value generated by predetermined probabilities, efficient and convenient.
The process of realization is discussed in detail below by several embodiments.
Fig. 4 is a kind of flow process of the image-recognizing method based on convolutional neural networks according to an exemplary embodiment Figure, as shown in figure 4, the method can be realized by terminal and computer equipment, including step 401-407.
In step 401, computer obtains training sample and initialization convolutional neural networks.
In step 402, the computer obtains predetermined probabilities P according to below equation:P=(1-H2/H1);Wherein, institute The depth that H1 is the initialization convolutional neural networks is stated, the H2 is H2 for the maximum training depth of computer.
In step 403, the computer is rolled up according to the training sample and the initialization convolutional neural networks Product neural metwork training, during iterative calculation each time in the training process, generates according to the predetermined probabilities and the L base The one-to-one L random value of this module, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and the random value is 0 Probability be the predetermined probabilities.
In step 404, it is the computation layer corresponding to 0 corresponding basic module that the computer gives up the random value, And the computation layer for replacing being rejected is mapped with unit, training obtains training the convolutional neural networks for completing.
In step 405, the computer trains the convolutional neural networks for completing to send to terminal by described, the terminal Obtain the convolutional neural networks that training is completed.
In a step 406, the terminal-pair images to be recognized carries out pretreatment, obtains test sample.
In step 407, the convolutional neural networks that test sample input described training is completed by the terminal, by institute The output valve for stating each computation layer in the convolutional neural networks that training is completed is multiplied by the predetermined probabilities, is identified result.
Fig. 5 is a kind of flow chart of the training method of the convolutional neural networks according to an exemplary embodiment, such as Fig. 5 Shown, the method can be realized by equipment such as computers, including step 501-506.
In step 501, training sample and initialization convolutional neural networks are obtained.
In step 502, predetermined probabilities P are obtained according to below equation:P=(1-H2/H1);Wherein, the H1 is described The depth of initialization convolutional neural networks, the H2 are H2 for the maximum training depth of computer.
In step 503, convolutional neural networks are carried out according to the training sample and the initialization convolutional neural networks When training, iterative calculation each time in the training process, generate with the L basic module one by one according to the predetermined probabilities Corresponding L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and it is institute that the random value is 0 probability State predetermined probabilities.
In step 504, it is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is reflected with unit The computation layer for replacing being rejected is penetrated, training obtains training the convolutional neural networks for completing.
In step 505, pretreatment is carried out to images to be recognized, obtains test sample.
In step 506, by the test sample input described convolutional neural networks trained and complete, trained described Into convolutional neural networks in the output valve of each computation layer be multiplied by the predetermined probabilities, be identified result.
Fig. 6 is a kind of flow process of the image-recognizing method based on convolutional neural networks according to an exemplary embodiment Figure, as shown in fig. 6, the method can be realized by equipment such as computers, including step 601-603.
In step 601, training sample and initialization convolutional neural networks are obtained.
In step 602, convolutional neural networks are carried out according to the training sample and the initialization convolutional neural networks When training, iterative calculation each time in the training process, generate according to predetermined probabilities and L basic module one-to-one corresponding L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, the random value be 0 probability for described pre- If probability.
In step 603, it is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is reflected with unit The computation layer for replacing being rejected is penetrated, training obtains training the convolutional neural networks for completing.
It is following for disclosure device embodiment, can be used for performing method of disclosure embodiment.
Fig. 7 is a kind of frame of the pattern recognition device based on convolutional neural networks according to an exemplary embodiment Figure, the device can pass through software, hardware or both be implemented in combination with become some or all of of electronic equipment.Such as Fig. 7 Shown, the device includes:First acquisition module 701, processing module 702 and identification module 703;Wherein:
First acquisition module 701, for obtaining the convolutional neural networks that training is completed, the convolutional Neural that the training is completed Network by carrying out convolutional neural networks training to training sample and initialization convolutional neural networks, in the training process each Discard portion computation layer during secondary iterative calculation, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Processing module 702, for carrying out pretreatment to images to be recognized, obtains test sample;
Identification module 703, for training the convolutional neural networks for completing according to described, carries out image to the test sample Identification, is identified result.
Used as a kind of possible embodiment, the pattern recognition device based on convolutional neural networks disclosed above can be with handle First acquisition module 701 is configured to include that the first generation, for submodule 7011, is configured to identification module 703 to include recognizing submodule 7031, Fig. 8 is the block diagram for being related to said apparatus, wherein:
The first generation replaces submodule 7011, for random according to predetermined probabilities during iterative calculation each time in the training process Discard portion computation layer, and the computation layer for replacing being rejected is mapped with unit;
Identification submodule 7031, for training the convolutional neural networks and the predetermined probabilities that complete according to described, to institute Stating test sample carries out image recognition, is identified result.
Used as a kind of possible embodiment, the initialization convolutional neural networks include L basic module;The first generation For submodule 7011, for, during iterative calculation each time in the training process, generating according to the predetermined probabilities and the L The one-to-one L random value of basic module, it is the computation layer corresponding to 0 corresponding basic module to give up the random value, and The computation layer for replacing being rejected is mapped with unit;Wherein, the random value be 1 probability be 1- predetermined probabilities, the random value Probability for 0 is the predetermined probabilities.
As a kind of possible embodiment, the identification submodule 7031, for the test sample is input into the instruction The convolutional neural networks that white silk is completed, the output valve of each computation layer in the convolutional neural networks trained and complete are multiplied by described Predetermined probabilities, are identified result.
Used as a kind of possible embodiment, the pattern recognition device based on convolutional neural networks disclosed above also includes the Two acquisition modules 704, before the second acquisition module 704 can be configured in the first acquisition module 701, Fig. 9 is to be related to above-mentioned dress The block diagram put, wherein:
Second acquisition module 704, for obtaining predetermined probabilities P according to below equation:P=(1-H2/H1);Wherein, it is described H1 is the depth of the initialization convolutional neural networks, and the H2 is H2 for the maximum training depth of computer.
Figure 10 is a kind of block diagram of the training devicess of the convolutional neural networks according to an exemplary embodiment, the device Can pass through software, hardware or both be implemented in combination with become some or all of of electronic equipment.As shown in Figure 10, the dress Put including:3rd acquisition module 1001 and training module 1002;Wherein:
3rd acquisition module 1001, for obtaining training sample and initialization convolutional neural networks;
Training module 1002, for carrying out convolutional Neural according to the training sample and the initialization convolutional neural networks Discard portion computation layer when network training, iterative calculation each time in the training process, and be rejected with unit mapping replacement Computation layer, obtain training the convolutional neural networks for completing.
Used as a kind of possible embodiment, the training devicess of convolutional neural networks disclosed above can be with training module 1002 are configured to include the second filial generation for submodule 10021, and Figure 11 is the block diagram for being related to said apparatus, wherein:
The second filial generation replaces submodule 10021, for during iterative calculation each time in the training process according to predetermined probabilities with Machine discard portion computation layer, and the computation layer for replacing being rejected is mapped with unit.
Used as a kind of possible embodiment, the initialization convolutional neural networks include L basic module;The second filial generation For submodule 10021, for, during iterative calculation each time in the training process, generating according to the predetermined probabilities and the L The one-to-one L random value of individual basic module, wherein, it is 1- predetermined probabilities that the random value is 1 probability, the random value Probability for 0 is the predetermined probabilities;It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and with singly Bit mapping replaces the computation layer being rejected.
With regard to the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant the method Embodiment in be described in detail, explanation will be not set forth in detail herein.
Figure 12 is a kind of frame of the pattern recognition device based on convolutional neural networks according to an exemplary embodiment Figure.For example, device 1200 can be mobile phone, game console, computer, tablet device, personal digital assistant etc..
Device 1200 can include following one or more assemblies:Process assembly 1201, memorizer 1202, power supply module 1203, multimedia groupware 1204, audio-frequency assembly 1205, input/output (I/O) interface 1206, sensor cluster 1207, Yi Jitong Letter component 1208.
The integrated operation of 1201 usual control device 1200 of process assembly, such as with display, call, data communication, The associated operation of camera operation and record operation.Process assembly 1201 can include one or more processors 1220 to perform Instruction, to complete all or part of step of above-mentioned method.Additionally, process assembly 1201 can include one or more moulds Block, the interaction being easy between process assembly 1201 and other assemblies.For example, process assembly 1201 can include multi-media module, To facilitate the interaction between multimedia groupware 1204 and process assembly 1201.
Memorizer 1202 is configured to store various types of data to support the operation in device 1200.These data Example includes the instruction of any application program or method for operating on device 1200, contact data, telephone book data, Message, picture, video etc..Memorizer 1202 can by any kind of volatibility or non-volatile memory device or they Combination realizes, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), it is erasable can Program read-only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory Reservoir, disk or CD.
Power supply module 1203 provides electric power for the various assemblies of device 1200.Power supply module 1203 can include power management System, one or more power supplys, and other generate, manage and distribute the component that electric power is associated with for device 1200.
Multimedia groupware 1204 is included in the screen of one output interface of offer between described device 1200 and user. In some embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, Screen may be implemented as touch screen, to receive the input signal from user.Touch panel includes that one or more touch and passes Sensor is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or slip be dynamic The border of work, but also detect the persistent period related to the touch or slide and pressure.In certain embodiments, it is many Media component 1204 includes a front-facing camera and/or post-positioned pick-up head.When device 1200 is in operator scheme, mould is such as shot When formula or video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each preposition shooting Head and post-positioned pick-up head can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio-frequency assembly 1205 is configured to output and/or input audio signal.For example, audio-frequency assembly 1205 includes a wheat Gram wind (MIC), when device 1200 is in operator scheme, such as call model, logging mode and speech recognition mode, mike quilt It is configured to receive external audio signal.The audio signal for being received can be further stored in memorizer 1202 or via communication Component 1208 sends.In certain embodiments, audio-frequency assembly 1205 also includes a speaker, for exports audio signal.
The interface 1206 of I/O is that interface, above-mentioned peripheral interface mould are provided between process assembly 1201 and peripheral interface module Block can be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button And locking press button.
Sensor cluster 1207 includes one or more sensors, and the state for various aspects are provided for device 1200 is commented Estimate.For example, sensor cluster 1207 can detect the opening/closed mode of device 1200, such as relative localization of component, institute Display and keypad that component is device 1200 are stated, sensor cluster 1207 can be with detection means 1200 or device 1,200 1 The position change of individual component, user are presence or absence of with what device 1200 was contacted, 1200 orientation of device or acceleration/deceleration and dress Put 1200 temperature change.Sensor cluster 1207 can include proximity transducer, be configured to do not having any physics The presence of object nearby is detected during contact.Sensor cluster 1207 can also include optical sensor, such as CMOS or ccd image sensing Device, for used in imaging applications.In certain embodiments, the sensor cluster 1207 can also include acceleration sensing Device, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communication component 1208 is configured to facilitate the communication of wired or wireless way between device 1200 and other equipment.Dress Put 1200 and can access wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.It is exemplary at one In embodiment, communication component 1208 receives the broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel Information.In one exemplary embodiment, the communication component 1208 also includes near-field communication (NFC) module, to promote short distance Communication.For example, RF identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra broadband can be based in NFC module (UWB) technology, bluetooth (BT) technology and other technologies are realizing.
In the exemplary embodiment, device 1200 can be by one or more application specific integrated circuits (ASIC), numeral Signal processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components realizations, for performing said method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided Such as include the memorizer 1202 of instruction, above-mentioned instruction can be performed to complete said method by the processor 1220 of device 1200.Example Such as, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, soft Disk and optical data storage devices etc..
A kind of pattern recognition device based on convolutional neural networks, including:
Processor;
For storing the memorizer of processor executable;
Wherein, the processor is configured to:
Obtain the convolutional neural networks that complete of training, the convolutional neural networks that the training is completed by training sample and Initialization convolutional neural networks carry out convolutional neural networks training, discard portion during iterative calculation each time in the training process Computation layer, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Pretreatment is carried out to images to be recognized, test sample is obtained;
According to the convolutional neural networks trained and complete, image recognition is carried out to the test sample, be identified knot Really.
The processor can be additionally configured to:
Discard portion computation layer during the iterative calculation each time in the training process, and replace being given up with unit mapping The computation layer abandoned, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and use unit Mapping replaces the computation layer being rejected;
The convolutional neural networks completed according to the training, carry out image recognition to the test sample, are known Other result, including:
According to the convolutional neural networks and the predetermined probabilities trained and complete, image knowledge is carried out to the test sample Not, it is identified result.
The processor can be additionally configured to:
It is described initialization convolutional neural networks include L basic module, the iterative calculation each time during the training according to The random discard portion computation layer of predetermined probabilities, and the computation layer for replacing being rejected is mapped with unit, including:
During iterative calculation each time in the training process, generate according to the predetermined probabilities and the L basic module One-to-one L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and the random value is 0 probability For the predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is rejected with unit mapping replacement Computation layer.
The processor can be additionally configured to:
The convolutional neural networks completed according to the training and the predetermined probabilities, carry out figure to the test sample As identification, result is identified, including:
By the test sample input described convolutional neural networks trained and complete, by the convolutional Neural trained and complete In network, the output valve of each computation layer is multiplied by the predetermined probabilities, is identified result.
The processor can be additionally configured to:
Methods described also includes:
Predetermined probabilities P are obtained according to below equation:
P=(1-H2/H1);
Wherein, the H1 is the depth of the initialization convolutional neural networks, and the H2 is that the maximum training of computer is deep Spend for H2.
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the process of device 1200 When device is performed so that device 1200 is able to carry out the above-mentioned image-recognizing method based on convolutional neural networks, and methods described includes:
Obtain the convolutional neural networks that complete of training, the convolutional neural networks that the training is completed by training sample and Initialization convolutional neural networks carry out convolutional neural networks training, discard portion during iterative calculation each time in the training process Computation layer, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Pretreatment is carried out to images to be recognized, test sample is obtained;
According to the convolutional neural networks trained and complete, image recognition is carried out to the test sample, be identified knot Really.
Instruction in the storage medium can also include:
Discard portion computation layer during the iterative calculation each time in the training process, and replace being given up with unit mapping The computation layer abandoned, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and use unit Mapping replaces the computation layer being rejected;
The convolutional neural networks completed according to the training, carry out image recognition to the test sample, are known Other result, including:
According to the convolutional neural networks and the predetermined probabilities trained and complete, image knowledge is carried out to the test sample Not, it is identified result.
Instruction in the storage medium can also include:
It is described initialization convolutional neural networks include L basic module, the iterative calculation each time during the training according to The random discard portion computation layer of predetermined probabilities, and the computation layer for replacing being rejected is mapped with unit, including:
During iterative calculation each time in the training process, generate according to the predetermined probabilities and the L basic module One-to-one L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and the random value is 0 probability For the predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is rejected with unit mapping replacement Computation layer.
Instruction in the storage medium can also include:
The convolutional neural networks completed according to the training and the predetermined probabilities, carry out figure to the test sample As identification, result is identified, including:
By the test sample input described convolutional neural networks trained and complete, by the convolutional Neural trained and complete In network, the output valve of each computation layer is multiplied by the predetermined probabilities, is identified result.
Instruction in the storage medium can also include:
Methods described also includes:
Predetermined probabilities P are obtained according to below equation:
P=(1-H2/H1);
Wherein, the H1 is the depth of the initialization convolutional neural networks, and the H2 is that the maximum training of computer is deep Spend for H2.
Figure 13 is a kind of block diagram of the training devicess of the convolutional neural networks according to an exemplary embodiment.For example, Device 1300 may be provided in a computer.Device 1300 includes process assembly 1311, and which further includes one or more Processor, and the memory resource by representated by memorizer 1312, can be by the finger of the execution of process assembly 1311 for storage Order, such as application program.The application program stored in memorizer 1312 can include one or more each correspondence In the module of one group of instruction.Additionally, process assembly 1311 is configured to execute instruction, to perform said method.
Device 1300 can also include that power supply module 1313 be configured to the power management of performs device 1300, one Wired or wireless network interface 1314 is configured to for device 1300 to be connected to network, and input and output (I/O) interface 1315.Device 1300 can be operated based on the operating system for being stored in memorizer 1312, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
A kind of training devicess of convolutional neural networks, including:
Processor;
For storing the memorizer of processor executable;
Wherein, the processor is configured to:
Obtain training sample and initialization convolutional neural networks;
Convolutional neural networks training is carried out according to the training sample and the initialization convolutional neural networks, was being trained Discard portion computation layer during iterative calculation each time in journey, and the computation layer for replacing being rejected is mapped with unit, trained The convolutional neural networks for completing.
The processor can be additionally configured to:
Discard portion computation layer during the iterative calculation each time in the training process, and replace being given up with unit mapping The computation layer abandoned, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and use unit Mapping replaces the computation layer being rejected.
The processor can be additionally configured to:
It is described initialization convolutional neural networks include L basic module, the iterative calculation each time during the training according to The random discard portion computation layer of predetermined probabilities, and the computation layer for replacing being rejected is mapped with unit, including:
During iterative calculation each time in the training process, generate according to the predetermined probabilities and the L basic module One-to-one L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and the random value is 0 probability For the predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is rejected with unit mapping replacement Computation layer.
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the process of device 1300 When device is performed so that device 1300 is able to carry out the training method of above-mentioned convolutional neural networks, and methods described includes:
Obtain training sample and initialization convolutional neural networks;
Convolutional neural networks training is carried out according to the training sample and the initialization convolutional neural networks, was being trained Discard portion computation layer during iterative calculation each time in journey, and the computation layer for replacing being rejected is mapped with unit, trained The convolutional neural networks for completing.
Instruction in the storage medium can also include:
Discard portion computation layer during the iterative calculation each time in the training process, and replace being given up with unit mapping The computation layer abandoned, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and use unit Mapping replaces the computation layer being rejected.
Instruction in the storage medium can also include:
It is described initialization convolutional neural networks include L basic module, the iterative calculation each time during the training according to The random discard portion computation layer of predetermined probabilities, and the computation layer for replacing being rejected is mapped with unit, including:
During iterative calculation each time in the training process, generate according to the predetermined probabilities and the L basic module One-to-one L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and the random value is 0 probability For the predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and is rejected with unit mapping replacement Computation layer.
Those skilled in the art will readily occur to its of the disclosure after considering description and putting into practice disclosure disclosed herein Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or Person's adaptations follow the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by following Claim is pointed out.
It should be appreciated that the disclosure is not limited to the precision architecture for being described above and being shown in the drawings, and And various modifications and changes can be being carried out without departing from the scope.The scope of the present disclosure is limited only by appended claim.

Claims (18)

1. a kind of image-recognizing method based on convolutional neural networks, it is characterised in that include:
Obtain the convolutional neural networks that complete of training, the convolutional neural networks that the training is completed are by training sample and initial Changing convolutional neural networks carries out convolutional neural networks training, and during iterative calculation each time in the training process, discard portion is calculated Layer, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Pretreatment is carried out to images to be recognized, test sample is obtained;
According to the convolutional neural networks trained and complete, image recognition is carried out to the test sample, result is identified.
2. method according to claim 1, it is characterised in that give up during the iterative calculation each time in the training process Part computation layer is abandoned, and the computation layer for replacing being rejected is mapped with unit, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and mapped with unit The computation layer that replacement is rejected;
It is described that image recognition is carried out to the test sample according to the convolutional neural networks trained and complete, it is identified knot Really, including:
According to the convolutional neural networks and the predetermined probabilities trained and complete, image recognition is carried out to the test sample, It is identified result.
3. method according to claim 2, it is characterised in that the initialization convolutional neural networks include L basic mould Block, according to the random discard portion computation layer of predetermined probabilities during the iterative calculation each time in the training process, and uses unit Mapping replaces the computation layer being rejected, including:
During iterative calculation each time in the training process, generate with the L basic module one by one according to the predetermined probabilities Corresponding L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and it is institute that the random value is 0 probability State predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and the meter for replacing being rejected is mapped with unit Calculate layer.
4. method according to claim 2, it is characterised in that it is described according to it is described train the convolutional neural networks that complete and The predetermined probabilities, carry out image recognition to the test sample, are identified result, including:
By the test sample input described convolutional neural networks trained and complete, by the convolutional neural networks trained and complete In the output valve of each computation layer be multiplied by the predetermined probabilities, be identified result.
5. the method according to any one of claim 2 to 4, it is characterised in that methods described also includes:
Predetermined probabilities P are obtained according to below equation:
P=(1-H2/H1);
Wherein, the H1 is the depth of the initialization convolutional neural networks, and the H2 is that the maximum training depth of computer is H2。
6. a kind of training method of convolutional neural networks, it is characterised in that include:
Obtain training sample and initialization convolutional neural networks;
Convolutional neural networks training is carried out according to the training sample and the initialization convolutional neural networks, in the training process Iterative calculation each time when discard portion computation layer, and mapped with unit and replace the computation layer that is rejected, obtained training and complete Convolutional neural networks.
7. method according to claim 6, it is characterised in that give up during the iterative calculation each time in the training process Part computation layer is abandoned, and the computation layer for replacing being rejected is mapped with unit, including:
According to the random discard portion computation layer of predetermined probabilities during iterative calculation each time in the training process, and mapped with unit The computation layer that replacement is rejected.
8. method according to claim 7, it is characterised in that the initialization convolutional neural networks include L basic mould Block, the iterative calculation each time during the training is according to the random discard portion computation layer of predetermined probabilities, and is replaced with unit mapping The computation layer being rejected, including:
During iterative calculation each time in the training process, generate with the L basic module one by one according to the predetermined probabilities Corresponding L random value, wherein, it is 1- predetermined probabilities that the random value is 1 probability, and it is institute that the random value is 0 probability State predetermined probabilities;
It is the computation layer corresponding to 0 corresponding basic module to give up the random value, and the meter for replacing being rejected is mapped with unit Calculate layer.
9. a kind of pattern recognition device based on convolutional neural networks, it is characterised in that include:
First acquisition module, for obtaining the convolutional neural networks that training is completed, the convolutional neural networks that the training is completed lead to Crossing carries out convolutional neural networks training to training sample and initialization convolutional neural networks, iteration each time in the training process Discard portion computation layer during calculating, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Processing module, for carrying out pretreatment to images to be recognized, obtains test sample;
Identification module, for training the convolutional neural networks for completing according to described, carries out image recognition to the test sample, obtains To recognition result.
10. device according to claim 9, it is characterised in that first acquisition module, including:
The first generation replaces submodule, for during iterative calculation each time in the training process according to the random discard portion of predetermined probabilities Computation layer, and the computation layer for replacing being rejected is mapped with unit;
The identification module, including:
Identification submodule, for training the convolutional neural networks and the predetermined probabilities that complete according to described, to the test specimens Originally image recognition is carried out, result is identified.
11. devices according to claim 10, it is characterised in that the initialization convolutional neural networks include L substantially Module;
The first generation replaces submodule, for, during iterative calculation each time in the training process, giving birth to according to the predetermined probabilities Into with the one-to-one L random value of the L basic module, give up the random value for corresponding to 0 corresponding basic module Computation layer, and mapped with unit and replace the computation layer that is rejected;Wherein, the random value be 1 probability be 1- predetermined probabilities, It is the predetermined probabilities that the random value is 0 probability.
12. devices according to claim 10, it is characterised in that
The identification submodule, for training the convolutional neural networks for completing by test sample input described, by the instruction In the convolutional neural networks that white silk is completed, the output valve of each computation layer is multiplied by the predetermined probabilities, is identified result.
13. devices according to any one of claim 10 to 12, it is characterised in that described device also includes:
Second acquisition module, for obtaining predetermined probabilities P according to below equation:P=(1-H2/H1);Wherein, the H1 is described The depth of initialization convolutional neural networks, the H2 are H2 for the maximum training depth of computer.
14. a kind of training devicess of convolutional neural networks, it is characterised in that include:
3rd acquisition module, for obtaining training sample and initialization convolutional neural networks;
Training module, for carrying out convolutional neural networks instruction according to the training sample and the initialization convolutional neural networks Practice, discard portion computation layer during iterative calculation each time in the training process, and the calculating for replacing being rejected is mapped with unit Layer, obtains training the convolutional neural networks for completing.
15. devices according to claim 14, it is characterised in that the training module, including:
The second filial generation replaces submodule, for during iterative calculation each time in the training process according to the random discard portion of predetermined probabilities Computation layer, and the computation layer for replacing being rejected is mapped with unit.
16. devices according to claim 15, it is characterised in that the initialization convolutional neural networks include L substantially Module;
The second filial generation replaces submodule, for, during iterative calculation each time in the training process, giving birth to according to the predetermined probabilities Into with the one-to-one L random value of the L basic module, wherein, the random value be 1 probability be 1- predetermined probabilities, It is the predetermined probabilities that the random value is 0 probability;It is the calculating corresponding to 0 corresponding basic module to give up the random value Layer, and the computation layer for replacing being rejected is mapped with unit.
17. a kind of pattern recognition devices based on convolutional neural networks, it is characterised in that include:
Processor;
For storing the memorizer of processor executable;
Wherein, the processor is configured to:
Obtain the convolutional neural networks that complete of training, the convolutional neural networks that the training is completed are by training sample and initial Changing convolutional neural networks carries out convolutional neural networks training, and during iterative calculation each time in the training process, discard portion is calculated Layer, and the computation layer for replacing being rejected is mapped with unit and is obtained;
Pretreatment is carried out to images to be recognized, test sample is obtained;
According to the convolutional neural networks trained and complete, image recognition is carried out to the test sample, result is identified.
18. a kind of training devicess of convolutional neural networks, it is characterised in that include:
Processor;
For storing the memorizer of processor executable;
Wherein, the processor is configured to:
Obtain training sample and initialization convolutional neural networks;
Convolutional neural networks training is carried out according to the training sample and the initialization convolutional neural networks, in the training process Iterative calculation each time when discard portion computation layer, and mapped with unit and replace the computation layer that is rejected, obtained training and complete Convolutional neural networks.
CN201610942156.0A 2016-10-31 2016-10-31 Training method of convolutional neural network, image recognition method and device Active CN106548201B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610942156.0A CN106548201B (en) 2016-10-31 2016-10-31 Training method of convolutional neural network, image recognition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610942156.0A CN106548201B (en) 2016-10-31 2016-10-31 Training method of convolutional neural network, image recognition method and device

Publications (2)

Publication Number Publication Date
CN106548201A true CN106548201A (en) 2017-03-29
CN106548201B CN106548201B (en) 2020-07-21

Family

ID=58392348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610942156.0A Active CN106548201B (en) 2016-10-31 2016-10-31 Training method of convolutional neural network, image recognition method and device

Country Status (1)

Country Link
CN (1) CN106548201B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107145904A (en) * 2017-04-28 2017-09-08 北京小米移动软件有限公司 Determination method, device and the storage medium of image category
CN107194464A (en) * 2017-04-25 2017-09-22 北京小米移动软件有限公司 The training method and device of convolutional neural networks model
CN107229968A (en) * 2017-05-24 2017-10-03 北京小米移动软件有限公司 Gradient parameter determines method, device and computer-readable recording medium
CN107480773A (en) * 2017-08-09 2017-12-15 北京小米移动软件有限公司 The method, apparatus and storage medium of training convolutional neural networks model
CN107885464A (en) * 2017-11-28 2018-04-06 北京小米移动软件有限公司 Date storage method, device and computer-readable recording medium
CN109543766A (en) * 2018-11-28 2019-03-29 钟祥博谦信息科技有限公司 Image processing method and electronic equipment, storage medium
WO2019127927A1 (en) * 2017-12-29 2019-07-04 深圳云天励飞技术有限公司 Neural network chip, method of using neural network chip to implement de-convolution operation, electronic device, and computer readable storage medium
CN110059707A (en) * 2019-04-25 2019-07-26 北京小米移动软件有限公司 Optimization method, device and the equipment of image characteristic point
WO2019218116A1 (en) * 2018-05-14 2019-11-21 Nokia Technologies Oy Method and apparatus for image recognition
CN110516745A (en) * 2019-08-28 2019-11-29 北京达佳互联信息技术有限公司 Training method, device and the electronic equipment of image recognition model

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544506A (en) * 2013-10-12 2014-01-29 Tcl集团股份有限公司 Method and device for classifying images on basis of convolutional neural network
CN104517122A (en) * 2014-12-12 2015-04-15 浙江大学 Image target recognition method based on optimized convolution architecture
CN104850836A (en) * 2015-05-15 2015-08-19 浙江大学 Automatic insect image identification method based on depth convolutional neural network
CN105335712A (en) * 2015-10-26 2016-02-17 小米科技有限责任公司 Image recognition method, device and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544506A (en) * 2013-10-12 2014-01-29 Tcl集团股份有限公司 Method and device for classifying images on basis of convolutional neural network
CN104517122A (en) * 2014-12-12 2015-04-15 浙江大学 Image target recognition method based on optimized convolution architecture
CN104850836A (en) * 2015-05-15 2015-08-19 浙江大学 Automatic insect image identification method based on depth convolutional neural network
CN105335712A (en) * 2015-10-26 2016-02-17 小米科技有限责任公司 Image recognition method, device and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GUO DONG LI ET AL.: "Hail Identification Analysis from Radar Image by CNN", 《APPLIED MECHANICS AND MATERIALS》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107194464A (en) * 2017-04-25 2017-09-22 北京小米移动软件有限公司 The training method and device of convolutional neural networks model
CN107194464B (en) * 2017-04-25 2021-06-01 北京小米移动软件有限公司 Training method and device of convolutional neural network model
CN107145904A (en) * 2017-04-28 2017-09-08 北京小米移动软件有限公司 Determination method, device and the storage medium of image category
CN107229968A (en) * 2017-05-24 2017-10-03 北京小米移动软件有限公司 Gradient parameter determines method, device and computer-readable recording medium
CN107229968B (en) * 2017-05-24 2021-06-29 北京小米移动软件有限公司 Gradient parameter determination method, gradient parameter determination device and computer-readable storage medium
CN107480773B (en) * 2017-08-09 2020-11-13 北京小米移动软件有限公司 Method and device for training convolutional neural network model and storage medium
CN107480773A (en) * 2017-08-09 2017-12-15 北京小米移动软件有限公司 The method, apparatus and storage medium of training convolutional neural networks model
CN107885464A (en) * 2017-11-28 2018-04-06 北京小米移动软件有限公司 Date storage method, device and computer-readable recording medium
US11010661B2 (en) 2017-12-29 2021-05-18 Shenzhen Intellifusion Technologies Co., Ltd. Neural network chip, method of using neural network chip to implement de-convolution operation, electronic device, and computer readable storage medium
WO2019127927A1 (en) * 2017-12-29 2019-07-04 深圳云天励飞技术有限公司 Neural network chip, method of using neural network chip to implement de-convolution operation, electronic device, and computer readable storage medium
WO2019218116A1 (en) * 2018-05-14 2019-11-21 Nokia Technologies Oy Method and apparatus for image recognition
US11948088B2 (en) 2018-05-14 2024-04-02 Nokia Technologies Oy Method and apparatus for image recognition
CN109543766A (en) * 2018-11-28 2019-03-29 钟祥博谦信息科技有限公司 Image processing method and electronic equipment, storage medium
CN110059707A (en) * 2019-04-25 2019-07-26 北京小米移动软件有限公司 Optimization method, device and the equipment of image characteristic point
CN110516745A (en) * 2019-08-28 2019-11-29 北京达佳互联信息技术有限公司 Training method, device and the electronic equipment of image recognition model
CN110516745B (en) * 2019-08-28 2022-05-24 北京达佳互联信息技术有限公司 Training method and device of image recognition model and electronic equipment

Also Published As

Publication number Publication date
CN106548201B (en) 2020-07-21

Similar Documents

Publication Publication Date Title
CN106548201A (en) The training method of convolutional neural networks, image-recognizing method and device
CN109919251B (en) Image-based target detection method, model training method and device
CN110059661A (en) Action identification method, man-machine interaction method, device and storage medium
CN105103221B (en) To the speech recognition aided assessment of Text To Speech articulation problems detection
CN108121952A (en) Face key independent positioning method, device, equipment and storage medium
CN107798669A (en) Image defogging method, device and computer-readable recording medium
CN104700353B (en) Image filters generation method and device
CN107527053A (en) Object detection method and device
CN107832741A (en) The method, apparatus and computer-readable recording medium of facial modeling
CN105279499B (en) Age recognition methods and device
CN107992841A (en) The method and device of identification objects in images, electronic equipment, readable storage medium storing program for executing
CN106295511A (en) Face tracking method and device
CN106296690A (en) The method for evaluating quality of picture material and device
CN107341442A (en) Motion control method, device, computer equipment and service robot
CN106557759A (en) A kind of sign board information getting method and device
CN109359056A (en) A kind of applied program testing method and device
CN106295530A (en) Face identification method and device
CN106228158A (en) The method and apparatus of picture detection
CN108010060A (en) Object detection method and device
CN107845062A (en) image generating method and device
CN107527024A (en) Face face value appraisal procedure and device
CN106169075A (en) Auth method and device
CN112115894B (en) Training method and device of hand key point detection model and electronic equipment
CN109978891A (en) Image processing method and device, electronic equipment and storage medium
CN107766820A (en) Image classification method and device

Legal Events

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