Image-recognizing method and deviceTechnical field
The present invention relates to field of image recognition, in particular to a kind of image-recognizing method and device.
Background technique
In existing field of image recognition, the field of face identification of special mainstream, mainly by image recognition model intoRow identification, image recognition model is all based on deep learning algorithm model and is trained to obtain, deep learning model training it is goodThe bad influence to recognition accuracy is most important.And in entire depth learning model training process, for trained data setIt is the most important thing again, can exerts a decisive influence to the final algorithm performance of deep learning model.
It carries out, such as in field of face identification, instructs on individualized training data set currently, deep learning model is substantiallyPractice the open face database that data set can be the collected human face data under some scene or download from the Internet.ByIdentical people may be covered between different data collection, and due to naming rule disunity between different data collection, soIt is difficult to merge the face picture of identical people according to its filename.And when carrying out recognition of face classification based training, must be requested that phaseThe face picture of same people shares identical label classification number, so leading to not be likely to occur personnel's intersection using multiple simultaneouslyHuman face data collection.It is based only on the deep learning model that the training of individualized training data set obtains, the accuracy in image recognitionIt is low, it is unable to satisfy the demand of different application.
For the low problem of the recognition accuracy of image-recognizing method in the prior art, effective solution is not yet proposed at presentScheme.
Summary of the invention
The embodiment of the invention provides a kind of image-recognizing method and devices, at least to solve image recognition in the prior artThe low technical problem of the recognition accuracy of method.
According to an aspect of an embodiment of the present invention, a kind of image-recognizing method is provided, comprising: obtain figure to be identifiedPicture;Obtain the image recognition model that pre-establishes, wherein image recognition model be by multiple training sets to initial model intoRow training obtains, and initial model is the identification model established based on branch's training algorithm, and the same training set is from sameExtraction obtains in data set, and different training sets are to extract to obtain from different data sets;It is treated using image recognition modelIdentification image is identified, recognition result is obtained.
Further, the above method further include: obtain multiple data sets;Every image in multiple data sets is dividedClass obtains the label of every image, wherein label is used to characterize the classification results of every image, includes in multiple data setsThe label of at least two images is identical;Sample image is extracted from sorted each data set, obtains multiple training sets.
Further, sample image is being extracted from sorted each data set, it is above-mentioned before obtaining multiple training setsMethod further include: extract the default feature of every image in sorted each data set;Default spy based on every imageSign carries out alignment operation to every image;Sample image is extracted from each data set after operation, obtains multiple training sets.
Further, in the case where every image is facial image, feature is preset including at least one of following: eyes,Eyebrow, nose and the corners of the mouth.
Further, sample image is extracted from each data set after operation, obtains multiple training sets, comprising: from behaviourSample image is extracted at random in each data set after work;The store path and label for obtaining sample image, obtain multiple trainingCollection.
Further, multiple data sets are obtained, comprising: obtain the collected video image of acquisition equipment and preset dataCollection;Video image and preset data collection are detected, multiple data sets are obtained.
Further, the above method further include: initial model is established based on branch's training algorithm, wherein initial model is extremelyIt less include: multiple loss functions, multiple loss functions are one-to-one with multiple training sets;Multiple training sets are inputted parallelIn initial model, initial model is trained;Whether the model that training of judgement obtains meets preset condition;If training obtainsModel meet preset condition, it is determined that the obtained model of training is image recognition model.
Further, multiple training sets are inputted in initial model parallel, initial model is trained, comprising: will be moreA training set inputs in initial model parallel, obtains the functional value of multiple loss functions;According to the functional value of multiple loss functionsWith chain type derivative algorithms, the gradient value of each parameter in initial model is obtained;According to stochastic gradient descent algorithm to each parameterGradient value be updated, obtain the obtained model of training.
Further, whether the model that training of judgement obtains meets preset condition, comprising: obtains verifying collection;Utilize verifyingCollect the model for obtaining training to verify, obtains the precision for the model that training obtains;The precision for the model that training of judgement obtainsIt is whether identical as history precision, wherein history precision is model precision obtained in upper primary verification process that training obtains;If the precision for the model that training obtains is identical as history precision, it is determined that the model that training obtains meets preset condition.
Further, if the precision for the model that training obtains is different from history precision, it is determined that the model that training obtainsPrecision be history precision, and continue to be trained initial model.
Further, precision is used to characterize verifying and concentrates the sum of verification result of all verifying samples and all verifying samplesThe ratio of sum.
Further, verifying collection is obtained, comprising: obtain other images in multiple data sets except sample image;From itImage authentication pair is extracted at random in his image, is verified collection.
Further, image authentication to include: positive sample to and negative sample pair, positive sample is to identical comprising two labelsImage, negative sample is to the image different comprising two labels.
Further, loss function is quadratic loss function.
According to another aspect of an embodiment of the present invention, a kind of pattern recognition device is additionally provided, comprising: first obtains mouldBlock, for obtaining images to be recognized;Second obtains module, for obtaining the image recognition model pre-established, wherein imageIdentification model is to be trained by multiple training sets to initial model, and initial model is built based on branch's training algorithmVertical identification model, the same training set are to extract to obtain from the same data set, and different training sets are from different dataExtraction is concentrated to obtain;Identification module obtains identification knot for identifying using image recognition model to images to be recognizedFruit.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, storage medium includes the journey of storageSequence, wherein equipment where control storage medium executes above-mentioned image-recognizing method in program operation.
According to another aspect of an embodiment of the present invention, a kind of processor is additionally provided, processor is used to run program,In, program executes above-mentioned image-recognizing method when running.
In embodiments of the present invention, initial model can be established based on branch's training algorithm, and raw by different data collectionAt multiple training sets initial model is trained, obtain image recognition model, further by image recognition model toThe images to be recognized of family input is identified, final recognition result is obtained.Compared with prior art, multiple data sets are combinedBranch training image recognition model than it is existing based on individual data collection training image recognition model accuracy rate it is higher,The technical effect for improving recognition accuracy is reached, and then the recognition accuracy for solving image-recognizing method in the prior art is lowThe technical issues of.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hairBright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of image-recognizing method according to an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of optional face picture according to an embodiment of the present invention;
Fig. 3 is the schematic diagram of the face picture after a kind of optional alignment according to an embodiment of the present invention;
Fig. 4 is a kind of recognition of face depth nerve optionally based on individual data collection input according to an embodiment of the present inventionThe schematic diagram of network model;
Fig. 5 is a kind of recognition of face depth nerve optionally based on the input of multiple data sets according to an embodiment of the present inventionThe schematic diagram of network model;
Fig. 6 is a kind of flow chart of optional image-recognizing method according to an embodiment of the present invention;And
Fig. 7 is a kind of schematic diagram of pattern recognition device according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present inventionAttached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is onlyThe embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill peopleThe model that the present invention protects all should belong in member's every other embodiment obtained without making creative workIt encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this wayData be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein orSequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that coverCover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited toStep or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, productOr other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of image-recognizing method is provided, it should be noted that in attached drawingThe step of process illustrates can execute in a computer system such as a set of computer executable instructions, although also,Logical order is shown in flow chart, but in some cases, it can be to be different from shown by sequence execution herein or retouchThe step of stating.
Fig. 1 is a kind of flow chart of image-recognizing method according to an embodiment of the present invention, as shown in Figure 1, this method includesFollowing steps:
Step S102 obtains images to be recognized.
Specifically, above-mentioned images to be recognized can be the image identified, in embodiments of the present invention, with peopleIt is described in detail for face image.
Step S104 obtains the image recognition model pre-established, wherein image recognition model is by multiple trainingWhat collection was trained initial model, initial model is the identification model established based on branch's training algorithm, the same instructionPracticing collection is to extract to obtain from the same data set, and different training sets are to extract to obtain from different data sets.
Specifically, in order to improve image recognition accuracy rate, it is more that multiple and different data set buildings can be first passed through in advanceA training set, and initial model is trained by training set, to obtain final image recognition model.
In field of face identification, due to that may include the face picture of identical people, Er Qieyong between different data collectionFamily can not determine that different data is concentrated comprising which identical people, it is thus impossible to which different data collection is simply directly closedAnd at a single data set.Score value training method can be gathered and establish deep neural network model, obtain initial model, led toIt crosses and different data collection is separately carried out to branch's training, so as to obtain trained image recognition model, and will be trainedImage recognition model is deployed in application scenarios.
Step S106 identifies images to be recognized using image recognition model, obtains recognition result.
Specifically, it in field of face identification, can be carried out by comparing face characteristic feat-ID (using Euclidean distance)Recognition of face process.
In the above embodiments of the present application, initial model can be established based on branch's training algorithm, and pass through different data collectionThe multiple training sets generated are trained initial model, obtain image recognition model, further pass through image recognition model pairThe images to be recognized of user's input identifies, obtains final recognition result.Compared with prior art, multiple data are combinedCollection branch training image recognition model than it is existing based on individual data collection training image recognition model accuracy rate moreHeight has reached the technical effect for improving recognition accuracy, and then the identification for solving image-recognizing method in the prior art is accurateThe low technical problem of rate.
Optionally, in the above embodiment of the present invention, this method further include: obtain multiple data sets;To in multiple data setsEvery image classify, obtain the label of every image, wherein label is used to characterize the classification results of every image, moreA data concentrate the label at least two images for including identical;Sample image is extracted from sorted each data set,Obtain multiple training sets.
Specifically, it in field of face identification, in order to construct multiple training sets, can obtain in advance under different application sceneFace picture, obtain multiple data sets.Since the open face data set downloaded from internet has usually marked, for the data set not marked, with artificial detection and face picture can be extracted, classified and is marked, phase will be belonged toThe face picture of same people is put together and is marked, and the label of every photo is obtained.Assuming that total number of persons is N, everyone has MOpen face picture.A certain number of face pictures can be randomly selected in each data set being labeled, obtained everyA training set.
Optionally, in the above embodiment of the present invention, sample image is being extracted from sorted each data set, is being obtained moreBefore a training set, this method further include: extract the default feature of every image in sorted each data set;Based on everyThe default feature for opening image carries out alignment operation to every image;Sample image is extracted from each data set after operation, is obtainedTo multiple training sets.
Optionally, in the case where every image is facial image, feature is preset including at least one of following: eyes, eyebrowHair, nose and the corners of the mouth.
Specifically, in field of face identification, facial angle and face location in face picture be it is inconsistent, in order toGuarantee extracts stable feature and obtains preferable recognition of face effect, needs to carry out alignment operation to face picture, to removeFacial angle influences recognition of face bring.Key point includes the position of eyes, nose and corners of the mouth etc., as shown in Figure 2.AlignmentFace afterwards is as shown in Figure 3.
Optionally, in the above embodiment of the present invention, sample image is extracted from each data set after operation, is obtained multipleTraining set, comprising: extract sample image at random from each data set after operation;Obtain the store path and mark of sample imageLabel, obtain multiple training sets.
Specifically, it can be labeled and randomly selected in the face picture of face alignment while including face identityThe face picture of information and verification information, obtains sample image, and each training sample extracted is as follows: face picture img_1,The identity information (classification number) of img_1 ..., the identity information (classification number) of face picture img_N, img_N.
Wherein, face picture img_1 refers to that the store path of the 1st face picture, classification number refer to us for the peopleThe label marked in advance, classification number is generally since 0.For different people inside the same data set of different tag representationsDigital code.For example first data is concentrated, and 100 people is shared, then classification number is respectively 1-0,1-1,1-2 ... ..., 1-99;Second data set or scene cover 50 people, then classification number is respectively 2-0,2-1,2-2 ... ..., 2-49.Two groupsIt is not equivalent between classification number, respectively from different data sets.
Optionally, in the above embodiment of the present invention, multiple data sets are obtained, comprising: obtain the acquisition collected view of equipmentFrequency image and preset data collection;Video image and preset data collection are detected, multiple data sets are obtained.
Specifically, in field of face identification, acquisition equipment can be mounted in the camera in different application scene, makeVideo pictures are acquired with camera, and in computer systems by network transmission and data line storage, application scenarios can beThe corresponding usage scenario of engineering project, such as bank VTM (Video Teller Machine, remote teller machine) verifying, jewelryShop VIP identification etc..Above-mentioned preset data collection can be the open face data set from the Internet download.
Identical people may be covered between the human face data collection obtained by the above method, for example, in bank and jewelryThe customer that shop was photographed with camera, photo may also occur on the internet and be organized in open face data set.AndAnd disclosed on internet between face data set A and B may also include same person face picture.
Video pictures collected for camera carry out Face datection to collected video pictures, by face pictureIt extracts and is stored in computer system hard.
Optionally, in the above embodiment of the present invention, this method further include: initial model is established based on branch's training algorithm,Wherein, initial model includes at least: multiple loss functions, and multiple loss functions are one-to-one with multiple training sets;It will be moreA training set inputs in initial model parallel, is trained to initial model;It is default whether the model that training of judgement obtains meetsCondition;If the model that training obtains meets preset condition, it is determined that the model that training obtains is image recognition model.
It should be noted that only using a Softmax loss loss function in existing image recognition model as meshMark is trained, and the image recognition model shown in Fig. 4 based on individual data collection input only includes a Classification Loss function,Loss=SoftmaxLoss 1.
Different data collection can separately be carried out to branch's training, be concurrently input in the same image recognition model, i-thFace picture after the alignment that a data are concentrated is docked to corresponding loss function after propagated forward obtains featureSoftmaxLoss i is optimized as independent objective function.As shown in figure 5, concentrated when i-th of human face data of inputWhen face picture carries out branch's training into initial model, corresponding loss function is Loss=SoftmaxLoss i.
It should be noted that Fig. 4 and image recognition model shown in fig. 5 show showing for simplified general residual error networkIt is intended to.
Optionally, loss function is quadratic loss function.
Specifically, in field of face identification, in order to carry out recognition of face process using Euclidean distance, in initial modelMultiple loss functions can be quadratic loss function.
Further, above-mentioned preset condition, which can be training, terminates Rule of judgment, when the model that training obtains meets in advanceIf when condition, determining that training terminates, the model that final training obtains is trained image recognition model.
Optionally, in the above embodiment of the present invention, multiple training sets are inputted in initial model parallel, to initial model intoRow training, comprising: multiple training sets are inputted in initial model parallel, obtain the functional value of multiple loss functions;According to multipleThe functional value and chain type derivative algorithms of loss function, obtain the gradient value of each parameter in initial model;According under stochastic gradientDrop algorithm is updated the gradient value of each parameter, obtains the model that training obtains.
Specifically, it after inputting multiple training sets in initial model parallel, can be lost by branch's trainingThen the functional value Loss of function is obtained each in image recognition model as shown in Figure 5 according to Loss and chain type derivative algorithmsThe gradient value of a parameter finally updates model parameter according to stochastic gradient descent algorithm, obtains trained model, trainingModel meet training terminate Rule of judgment after, can determine trained model be final image recognition model.
Optionally, in the above embodiment of the present invention, whether the model that training of judgement obtains meets preset condition, comprising: obtainsVerifying is taken to collect;It is verified using the model that verifying collection obtains training, obtains the precision for the model that training obtains;Training of judgementWhether the precision of obtained model is identical as history precision, wherein history precision is to train obtained model in upper primary verifyingPrecision obtained in process;If the precision for the model that training obtains is identical as history precision, it is determined that the model that training obtainsMeet preset condition.
It, can will be current every fixed the number of iterations it should be noted that in the training process of image recognition modelTrained model is tested on verifying collection, with the training of model, precision meeting of the trained model on verifying collectionIt is constantly promoted, but as model is constantly trained, when model tends to restrain or the phenomenon that over-fitting occur, model collects in verifyingOn precision will not stable promotion again, show that model training can stopped.
Optionally, it is total with all verifying samples to be used to characterize the sum of verification results of all verifying samples of verifying concentration for precisionSeveral ratios.
Specifically, in field of face identification, verifying collection is by the face picture verifying randomly selected to forming.According to the worldThe rule of standard faces validation test collection LFW, it is 6000 pairs that the quantity of face picture verifying pair is concentrated in verifying.For including 6000To the verifying collection of face picture verifying pair, measuring accuracy can be with is defined as:Wherein, xiFor characterizing i-thThe verification result of face picture verifying pair.If the recognition result of model is identical as the physical tags of face picture verifying pair,It determines and verifies correct namely xi=1;If the recognition result of model is different from the physical tags of face picture verifying pair, reallyDetermine authentication error namely xi=0.
Further, above-mentioned history precision can be last when verifying to trained model, getThe precision of trained model.If the precision of trained model is identical as history precision, Ye Jixun this time in verification processThe no longer stable promotion of the precision for the model perfected can determine that training terminates, using this trained model as final figureAs identification model.
Optionally, in the above embodiment of the present invention, if the precision for the model that training obtains is different from history precision, reallyThe precision for the model that fixed training obtains is history precision, and continues to be trained initial model.
In a kind of optional scheme, if the precision for the model that training obtains is different from history precision, that is, trainedTo model satisfaction be unsatisfactory for preset condition, it is determined that training be not finished, need to continue to train, using this precision as underHistory precision in model verification process.Whether the precision with history precision of the good model of training of judgement are identical again, fromAnd whether the model for determining that training obtains meets preset condition.
Optionally, in the above embodiment of the present invention, obtain verifying collection, comprising: obtain in multiple data sets sample image itOther outer images;Image authentication pair is extracted at random from other images, is verified collection.
Optionally, image authentication to include: positive sample to and negative sample pair, positive sample is to including the identical figure of two labelsPicture, negative sample is to the image different comprising two labels.
Specifically, in field of face identification, it is assumed that there is the face picture of K people to be used for the production of training set, then it can be withThe face picture of remaining N-K people is used to verify the production of collection.Verifying collection is verified by the human face photo randomly selected to groupAt, extract positive sample to and negative sample pair, the quantity of positive and negative samples pair is identical, for including the verifying pair of 6000 pairs of face picturesVerifying collection, positive and negative samples are to respectively taking 3000 pairs.Wherein, positive sample is to a picture for n-th of people, the b of n-th of peoplePicture;Negative sample is to the c picture for i-th of people, the d picture of j-th of people.Image recognition model is by positive sample pairIn two face pictures when being judged as the same person, can determine that verification result is correct;Image recognition model is by negative sample pairIn two face pictures be judged as when not being a people, can determine verifying structure;No person, verification result mistake.
Fig. 6 is a kind of flow chart of optional image-recognizing method according to an embodiment of the present invention, with field of face identificationFor be illustrated, as shown in fig. 6, this method comprises: collecting the face picture under multiple scenes;To the face picture being collected intoFace datection is carried out, face picture is extracted and is stored in hard disc of computer;Manually to the face figure for detecting and extractingPiece is classified and is marked, and the face picture for belonging to identical people is put together and is marked;Face picture is carried out crucialPoint alignment operation is influenced with removing facial angle to recognition of face bring;In being labeled the photo being aligned with faceIt randomly selects while the face picture comprising face identity information and verification information is to being trained, namely extract face identity-Verify training set;Conjugate branch training algorithm establishes recognition of face deep neural network model, includes multiple losses in modelFunction;Recognition of face deep neural network model is trained based on more data sets, obtains trained network model;JudgementWhether measuring accuracy of the trained network model on verifying collection is constantly promoted, namely judges whether that reaching training terminates itemPart;If conditions are not met, then continuing model training;If it is satisfied, then obtaining face recognition algorithms network model and model ginsengNumber;Trained face recognition algorithms network model is deployed in application scenarios, it can be by comparing face characteristic feat-ID(using Euclidean distance) carries out recognition of face process.
The scheme provided through the foregoing embodiment can be used in bank VIP identification project, adopt under true application scenariosCollect face picture, while also downloading to some open face data sets from internet;Then by the face in these data setsPicture detected, alignment operation, and makes corresponding face identity-verifying training set;Use the training of previously described methodFace recognition algorithms model out is known to obtain the face with high discrimination and recognition effect in bank VIP identification sceneOther algorithm, this method can preferably combine the human face data information in multiple data sets, so as to obtain recognition effect moreGood human face recognition model.Combine multiple data sets branch training face deep neural network model than it is general based onThe face recognition algorithms accuracy rate of the deep learning network of individual data collection training (including gradually being finely tuned on multiple data sets)It is higher.
Embodiment 2
According to embodiments of the present invention, a kind of embodiment of pattern recognition device is provided.
Fig. 7 is a kind of schematic diagram of pattern recognition device according to an embodiment of the present invention, as shown in fig. 7, the device includes:
First obtains module 72, for obtaining images to be recognized.
Specifically, above-mentioned images to be recognized can be the image identified, in embodiments of the present invention, with peopleIt is described in detail for face image.
Second obtains module 74, for obtaining the image recognition model pre-established, wherein image recognition model is logicalCross what multiple training sets were trained initial model, initial model is the identification mould established based on branch's training algorithmType, the same training set are to extract to obtain from the same data set, and different training sets are extracted from different data setsIt arrives.
Specifically, in order to improve image recognition accuracy rate, it is more that multiple and different data set buildings can be first passed through in advanceA training set, and initial model is trained by training set, to obtain final image recognition model.
In field of face identification, due to that may include the face picture of identical people, Er Qieyong between different data collectionFamily can not determine that different data is concentrated comprising which identical people, it is thus impossible to which different data collection is simply directly closedAnd at a single data set.Score value training method can be gathered and establish deep neural network model, obtain initial model, led toIt crosses and different data collection is separately carried out to branch's training, so as to obtain trained image recognition model, and will be trainedImage recognition model is deployed in application scenarios.
Identification module 76 obtains recognition result for identifying using image recognition model to images to be recognized.
Specifically, it in field of face identification, can be carried out by comparing face characteristic feat-ID (using Euclidean distance)Recognition of face process.
In the above embodiments of the present application, initial model can be established based on branch's training algorithm, and pass through different data collectionThe multiple training sets generated are trained initial model, obtain image recognition model, further pass through image recognition model pairThe images to be recognized of user's input identifies, obtains final recognition result.Compared with prior art, multiple data are combinedCollection branch training image recognition model than it is existing based on individual data collection training image recognition model accuracy rate moreHeight has reached the technical effect for improving recognition accuracy, and then the identification for solving image-recognizing method in the prior art is accurateThe low technical problem of rate.
Optionally, in the above embodiment of the present invention, the device further include: third obtains module, for obtaining multiple dataCollection;Categorization module obtains the label of every image, wherein label for classifying to every image in multiple data setsFor characterizing the classification results of every image, the label of at least two for including in multiple data sets image is identical;First mentionsModulus block obtains multiple training sets for extracting sample image from sorted each data set.
Optionally, in the above embodiment of the present invention, the device further include: the second extraction module, it is sorted for extractingThe default feature of every image in each data set;Alignment module schemes every for the default feature based on every imageAs carrying out alignment operation;Third extraction module obtains multiple instructions for extracting sample image from each data set after operationPractice collection.
Optionally, in the case where every image is facial image, feature is preset including at least one of following: eyes, eyebrowHair, nose and the corners of the mouth.
Optionally, in the above embodiment of the present invention, third extraction module includes: extraction unit, for from every after operationA data concentrate random extraction sample image;First acquisition unit is obtained for obtaining the store path and label of sample imageMultiple training sets.
Optionally, in the above embodiment of the present invention, it includes: second acquisition unit that third, which obtains module, for obtaining acquisitionThe collected video image of equipment and preset data collection;Detection unit, for being detected to video image and preset data collection,Obtain multiple data sets.
Optionally, in the above embodiment of the present invention, the device further include: module is established, for being based on branch's training algorithmEstablish initial model, wherein initial model includes at least: multiple loss functions, multiple loss functions and multiple training sets are oneOne is corresponding;Training module is trained initial model for inputting multiple training sets in initial model parallel;JudgementWhether module, the model obtained for training of judgement meet preset condition;Determining module, if the model for training to obtain is fullSufficient preset condition, it is determined that the model that training obtains is image recognition model.
Optionally, loss function is quadratic loss function.
Optionally, in the above embodiment of the present invention, training module includes: input unit, for multiple training sets are parallelIt inputs in initial model, obtains the functional value of multiple loss functions;Processing unit, for the functional value according to multiple loss functionsWith chain type derivative algorithms, the gradient value of each parameter in initial model is obtained;Updating unit, for being calculated according to stochastic gradient descentMethod is updated the gradient value of each parameter, obtains the model that training obtains.
Optionally, in the above embodiment of the present invention, judgment module includes: third acquiring unit, for obtaining verifying collection;It testsUnit is demonstrate,proved, the model for being obtained using verifying collection to training is verified, and the precision for the model that training obtains is obtained;Judgement is singleWhether member, the precision and history precision of the model obtained for training of judgement are identical, wherein history precision is the mould that training obtainsType precision obtained in upper primary verification process;Determination unit, if the precision and history essence of the model obtained for trainingIt spends identical, it is determined that the model that training obtains meets preset condition.
Optionally, it is total with all verifying samples to be used to characterize the sum of verification results of all verifying samples of verifying concentration for precisionSeveral ratios.
Optionally, in the above embodiment of the present invention, if training module is also used to train the precision of obtained model and go throughHistory precision is different, it is determined that the precision for the model that training obtains is history precision, and continues to be trained initial model.
Optionally, in the above embodiment of the present invention, third acquiring unit for obtain in multiple data sets sample image itOther outer images, and image authentication pair is extracted at random from other images, it is verified collection.
Optionally, image authentication to include: positive sample to and negative sample pair, positive sample is to including the identical figure of two labelsPicture, negative sample is to the image different comprising two labels.
Embodiment 3
According to embodiments of the present invention, a kind of embodiment of storage medium is provided, storage medium includes the program of storage,In, in program operation, equipment where control storage medium executes the image-recognizing method in above-described embodiment 1.
Embodiment 4
According to embodiments of the present invention, a kind of embodiment of processor is provided, processor is for running program, wherein journeyThe image-recognizing method in above-described embodiment 1 is executed when sort run.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodimentThe part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through othersMode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke YiweiA kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine orPerson is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutualBetween coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or moduleIt connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unitThe component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multipleOn unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated listMember both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent productWhen, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantiallyThe all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other wordsIt embodies, which is stored in a storage medium, including some instructions are used so that a computerEquipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole orPart steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are depositedReservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program codeMedium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the artFor member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answeredIt is considered as protection scope of the present invention.