Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase
Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the method for generating model of the disclosure or the implementation of the device for generating model
The exemplary architecture 100 of example.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105.
Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
Various client applications can be installed on terminal device 101,102,103.Such as image processing class application, search
Class application, the application of content share class, U.S. figure class application, the application of instant messaging class, the application of model training class etc..Terminal device 101,
102, it 103 can be interacted by network 104 with server 105, to receive or send message etc..
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard
When part, it can be the various electronic equipments that can receive user's operation, including but not limited to smart phone, tablet computer, above-knee
Type portable computer and desktop computer etc..When terminal device 101,102,103 is software, may be mounted at above-mentioned listed
In the electronic equipment of act.Multiple softwares or software module may be implemented into (such as providing the multiple soft of Distributed Services in it
Part or software module), single software or software module also may be implemented into.It is not specifically limited herein.
Server 105 can be to provide the server of various services, such as can be and utilize terminal device 101,102,103
The training sample set of upload carries out the model training server of model training.Model training server can be to the training sample of acquisition
Sample image is identified in this, is obtained markup information corresponding with the training sample that training sample is concentrated and is then utilized training
Sample and markup information corresponding with training sample carry out model training, generate information prediction model.In addition, training obtains information
After prediction model, information prediction model can also be sent to terminal device 101,102,103 by server, also can use people's letter
It ceases prediction model and information prediction is carried out to face-image, obtain prediction result from hair.
It should be noted that server 105 can be hardware, it is also possible to software.When server is hardware, Ke Yishi
The distributed server cluster of ready-made multiple server compositions, also may be implemented into individual server.When server is software,
Multiple softwares or software module (such as providing multiple softwares of Distributed Services or software module) may be implemented into, it can also
To be implemented as single software or software module.It is not specifically limited herein.
It should be noted that can be by server 105 for generating the method for model provided by embodiment of the disclosure
It executes, can also be executed by terminal device 101,102,103.Correspondingly, it can be set for generating the device of model in service
In device 105, also it can be set in terminal device 101,102,103.In addition, information prediction provided by embodiment of the disclosure
Method can be executed by server 105, can also be executed by terminal device 101,102,103, correspondingly, information prediction device can
To be set in server 105, also can be set in terminal device 101,102,103.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.The training sample set required for training pattern does not need
It is obtained and face-image to be identified does not need in the case where long-range obtain from long-range, above system framework can not include
Network only includes terminal device or server.
With continued reference to Fig. 2, it illustrates the processes according to one embodiment of the method for generating model of the disclosure
200.This be used for generate model method the following steps are included:
Step 201, training sample set is obtained.
In the present embodiment, above-mentioned executing subject (such as the terminal device shown in FIG. 1 for generating the method for model
101,102,103 or server 105) training sample set can be obtained by way of wired connection or wireless connection.?
Here, the training sample which concentrates includes sample face image.The sample face image can be above-mentioned execution master
Capture apparatus that body is installed is got with the capture apparatus being connect, and is also possible to be pre-stored within local.On
Sample face image can be obtained by being used to indicate the routing information for the position that sample face image is stored by stating executing subject.
The object that the sample face image is presented can be the face of people.
Step 202, sample face training sample concentrated using preset number information identification model trained in advance
Image is identified, related information corresponding with the object that sample face image is presented is obtained.
In the present embodiment, the specific number of above- mentioned information identification model is artificial setting, can be according to application scenarios
It needs to be determined that.Above-mentioned preset number information identification model is different information identification model.Specifically, may include but unlimited
In the information identification model of identification facial expression, the information identification model for identifying the age, the information identification model of identification race, know
The information identification model etc. of other gender.In other words, each information identification model all has specific identification function, usually only
It can identify one or two kinds of specific informations.Herein, the related information for needing to obtain as needed determine selection information know
Other model.Above-mentioned related information includes but is not limited to: facial expression information, attribute information.In general, attribute information includes but unlimited
In age, sex, race etc..Specifically, in a certain application scenarios, when the related information that needs obtain includes facial expression letter
When breath and age information, selected information identification model out can be the information identification model for carrying out human facial expression recognition
With the information identification model for carrying out age identification.
In the present embodiment, each of above-mentioned preset number information identification model information identification model is for characterizing
Related information between sample face image and recognition result.To which for the same training sample set, each information be known
Other model carries out sample face image to identify obtained recognition result as above-mentioned related information.
As an example, above-mentioned preset number information identification model includes facial for identification in a certain application scenarios
The information identification model of the information identification model of expression, for identification age and gender, information ethnic for identification identify mould
Type.Each of training sample set sample face image can be input to above-mentioned each information identification mould by above-mentioned executing subject
In type, the facial table corresponding with each sample face image of the information identification model output of facial expression for identification is obtained
The information identification model of feelings information, for identification age and gender output age corresponding with each sample face image and
The ethnic information corresponding with each sample face image of the information identification model output of gender information, for identification race.
Herein, above-mentioned each information identification model may each be technical staff be in advance based on to a large amount of face-image and with
The statistics of information corresponding to the face-image (facial expression information, age information, ethnic information) and pre-establish, store
There is the mapping table of multiple face-images with corresponding information;Or it is based on preset training sample, utilize engineering
The model that learning method obtains after being trained to initial model (such as neural network).
Step 203, using training sample concentrate sample face image as input, will pass corresponding with sample face image
Join information as desired output, using the method for machine learning, training obtains information prediction model.
In the present embodiment, the training sample set according to accessed by step 201, step 202 are obtained and train sample
The corresponding related information of each training sample of this concentration, above-mentioned executing subject can be by each of training sample set sample faces
Portion's image is input to information prediction model to be trained, exported as a result, then will output result and above-mentioned related information into
Row compares, and based on comparative result, whether the information prediction model to determine to be trained trains completion.Specifically, can determine defeated
Whether the difference between result and related information reaches preset threshold out.When reaching preset threshold, determines that training is completed, do not having
Have that when reaching trained threshold value, the parameter of adjustable information prediction model to be trained continues to train.It herein, should be wait train
Information prediction model can be for convolutional neural networks, deep neural network etc..
In some optional implementations of the present embodiment, above- mentioned information prediction model can also instruct as follows
It gets:
Step 2021, for each of training sample set sample face image, which is input to
The feature extraction layer of information prediction model to be trained, obtains the characteristic pattern of the sample face image;By obtained characteristic pattern
It is input to full articulamentum, obtains the sample output result of the sample face image.
Herein, information prediction model to be trained can be neural network (such as convolutional neural networks, depth nerve net
Network) etc..The neural network may include feature extraction layer and full articulamentum.Wherein, feature extraction layer is for extracting face-image
Feature, generate and the corresponding characteristic pattern of sample face image that inputs.This feature figure may include the texture of image, shape,
Profile etc..Full articulamentum is connect with feature extraction layer, for carrying out after connecting entirely to the extracted feature of feature extraction layer, is determined
Sample corresponding with sample face image exports result.
Herein, facial expression information, the Duo Genian of plurality of classes are previously provided in information prediction model to be trained
Age section section, multiple ethnic classification informations, gender information.Above-mentioned full articulamentum can be based on spy indicated by above-mentioned each characteristic pattern
Sign determines probability value corresponding with each information.Such as probability value corresponding with each facial expression information, with each age group information pair
The corresponding probability value of the probability value and various race's classification informations answered and the corresponding probability value of women, probability corresponding with male
Value.
Above-mentioned executing subject can be selected every from being used to indicate in multiple probability values corresponding to different classes of information
Information indicated by the most probable value of one classification exports result as sample.
Step 2022, it is exported based on obtained sample as a result, determining whether default loss function restrains.
Herein, above-mentioned default loss function for example can be logarithm loss function.Whether determine the default loss function
Convergence that is to say whether the penalty values of determining loss function reach preset threshold or whether the absolute value of penalty values variation is less than
Preset threshold.It, can be with when the absolute value for reaching preset threshold or penalty values variation in response to penalty values is less than preset threshold
Determine default loss function convergence.Herein it is worth noting that, the absolute value of above-mentioned penalty values variation is based on when previous instruction
Practice the penalty values being calculated using loss function and the last absolute value for training the difference between obtained penalty values.At this
In, the penalty values of above-mentioned default loss function be used to indicate sample output result in obtained sample output results set with
Error between the related information of corresponding sample face image.
Step 2023, in response to determining that default loss function is restrained, determine that information prediction model training is completed.
In the present embodiment, whether restrained according to default loss function identified in step 2022, in default loss letter
When number convergence, above-mentioned, information prediction model training completion can be determined.
Step 2024, in response to determining that default loss function is not converged, letter to be trained is updated using back-propagation algorithm
The parameter for ceasing prediction model, continues to execute training step shown in step 2021- step 2023.
In the present embodiment, the above-mentioned parameter for updating neural network to be trained for example can be every in neural network to update
The numerical value of the filter of one layer of neural network, the size of filter, step-length etc., can also update the number of plies of neural network.It is above-mentioned
Executing subject is not converged in response to determining default loss function, can use back-propagation algorithm to update nerve net to be trained
The parameter of network then proceedes to execute training step shown in step 2021- step 2023.
The method for generating model that embodiment of the disclosure provides, by obtaining training sample set, then using pre-
The sample face image that first trained preset number information identification model concentrates training sample identifies, obtains and sample
The corresponding related information of the object that face-image is presented saves cost of labor so as to not need manually to be marked,
Improve working efficiency.
With further reference to Fig. 3, it illustrates the processes 300 of one embodiment of the information forecasting method of the disclosure.The letter
Cease the process 300 of generation method, comprising the following steps:
Step 301, the face-image of target user is obtained.
In the present embodiment, above- mentioned information generation method executing subject (such as terminal device shown in FIG. 1 101,102,
103 or server 105) face-image of target user can be obtained by way of wired connection or wireless connection.?
Here, the face-image of the target user can be capture apparatus that above-mentioned executing subject is installed or with the shooting that is connect
What equipment was got, it is also possible to be pre-stored within local.Above-mentioned executing subject can be by being used to indicate target user's
The routing information for the position that face-image is stored obtains face-image.
Step 302, face-image is input to information prediction model trained in advance, obtains pass corresponding with face-image
Join information.
In the present embodiment, which is information prediction model described in the corresponding embodiment of more Fig. 2
Generation method generate.
Herein, related information includes at least one of the following: facial expression information, attribute information.Specifically, above-mentioned letter
The feature extraction layer of breath prediction model can extract the feature of face-image, to obtain characteristic pattern corresponding with face-image.
Then, after the full articulamentum of above- mentioned information prediction model can be to the full attended operation of features described above figure, above- mentioned information prediction is obtained
The corresponding probability value of preset each information in model.The information of above-mentioned pre-set plurality of classes may include facial table
Feelings information, age bracket section, ethnic classification information, gender information etc., tool is determined based on the training result of information prediction model
The classification of the related information of body.Such as and the corresponding probability value of each facial expression information, probability corresponding with each age group information
Value and the corresponding probability value of various race's classification informations and the corresponding probability value of women, probability value corresponding with male.
Above-mentioned executing subject can be selected every from being used to indicate in multiple probability values corresponding to different classes of information
Information indicated by the most probable value of one classification, as related information.
The method that embodiment of the disclosure provides, by obtaining the face-image of target user, the face that then will acquire
Portion's image is input to information prediction model trained in advance, so that related information corresponding with face-image is obtained, so that institute is pre-
The related information measured is more accurate.
With further reference to Fig. 4, it illustrates an application scenario diagrams of the information forecasting method of the disclosure.
In application scenarios as shown in Figure 4, the user's face image 301 that capture apparatus will acquire is input to server
402.Accessed user's face head portrait 401 is input to information prediction model 403 by server 402, to obtain user face
The corresponding related information of the user that portion's image 401 is presented.The related information includes: smile, male, yellow.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, present disclose provides for generating model
One embodiment of device, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to
In various electronic equipments.
As shown in figure 5, the device 500 provided in this embodiment for generating model includes acquiring unit 501, recognition unit
502 and training unit 503.Wherein, acquiring unit 501, are configured to obtain training sample set, and training sample set includes sample face
Portion's image;Recognition unit 502 is configured to concentrate training sample using preset number information identification model trained in advance
Sample face image identified, obtain related information corresponding with the object that sample face image is presented;Training unit
503, the sample face image for being configured to concentrate training sample is believed as input, by association corresponding with sample face image
Breath is used as desired output, and using the method for machine learning, training obtains information prediction model.
In the present embodiment, in the device 500 for generating model: acquiring unit 501, recognition unit 502 and training are single
The specific processing of member 503 and its brought technical effect can be respectively with reference to step 201, the steps 202 in Fig. 2 corresponding embodiment
With the related description of step 203, details are not described herein.
In some optional implementations of the present embodiment, information prediction model to be trained include feature extraction layer and
Full articulamentum;And training unit 503 is further configured to: based on training sample concentrate sample face image, execute with
Lower training step: for each of training sample set sample face image, which is input to wait train
Information prediction model feature extraction layer, obtain the characteristic pattern of the sample face image;Obtained characteristic pattern is input to
Full articulamentum obtains the sample output result of sample face image;The training sample pair concentrated based on identified training sample
The sample output answered is as a result, determine whether default loss function restrains, wherein default loss function is used to indicate obtained sample
Sample output result in this output results set and the error between corresponding related information;In response to determining default loss letter
Number convergence determines that information prediction model training is completed.
In some optional implementations of the present embodiment, for generating the device 500 of model further include: adjustment unit
(not shown) is configured in response to determine that default loss function is not converged, letter to be trained is adjusted using back-propagation algorithm
The parameter for ceasing prediction model, continues to execute training step.
What embodiment of the disclosure provided is used to generate model equipment, by obtaining training sample set, then using preparatory
The sample face image that trained preset number information identification model concentrates training sample identifies, obtains and sample face
The corresponding related information of the object that portion's image is presented saves cost of labor, mentions so as to not need manually to be marked
High working efficiency.
With further reference to Fig. 6, as the realization to method shown in above-mentioned each figure, present disclose provides information prediction devices
One embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 3, which specifically can be applied to various electricity
In sub- equipment.
As shown in fig. 6, information prediction device 600 provided in this embodiment includes image acquisition unit 601 and generation unit
602.Image acquisition unit 601 is configured to obtain the face-image of target user;Generation unit 602, being configured to will be facial
Image is input to the information prediction model generated using the method such as any embodiment in first aspect, obtains and face-image pair
The related information answered, related information include at least one of the following: facial expression information, attribute information.
Below with reference to Fig. 7, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1
Terminal device) 700 structural schematic diagram.Terminal device in embodiment of the disclosure can include but is not limited to such as move electricity
Words, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia
Player), the mobile terminal and such as number TV, desktop computer etc. of car-mounted terminal (such as vehicle mounted guidance terminal) etc.
Fixed terminal.Terminal device shown in Fig. 7 is only an example, function to embodiment of the disclosure and should not use model
Shroud carrys out any restrictions.
As shown in fig. 7, electronic equipment 700 may include processing unit (such as central processing unit, graphics processor etc.)
701, random access can be loaded into according to the program being stored in read-only memory (ROM) 702 or from storage device 708
Program in memory (RAM) 703 and execute various movements appropriate and processing.In RAM 703, it is also stored with electronic equipment
Various programs and data needed for 700 operations.Processing unit 701, ROM 702 and RAM703 are connected with each other by bus 704.
Input/output (I/O) interface 705 is also connected to bus 704.
In general, following device can connect to I/O interface 705: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph
As the input unit 706 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration
The output device 707 of dynamic device etc.;Storage device 708 including such as tape, hard disk etc.;And communication device 709.Communication device
709, which can permit electronic equipment 700, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 7 shows tool
There is the electronic equipment 700 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with
Alternatively implement or have more or fewer devices.Each box shown in Fig. 7 can represent a device, can also root
According to needing to represent multiple devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communication device 709, or from storage device 708
It is mounted, or is mounted from ROM 702.When the computer program is executed by processing unit 701, the implementation of the disclosure is executed
The above-mentioned function of being limited in the method for example.
It is situated between it should be noted that the computer-readable medium of embodiment of the disclosure description can be computer-readable signal
Matter or computer readable storage medium either the two any combination.Computer readable storage medium for example can be with
System, device or the device of --- but being not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or it is any more than
Combination.The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires
Electrical connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable
Read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited
Memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer readable storage medium, which can be, appoints
What include or the tangible medium of storage program that the program can be commanded execution system, device or device use or and its
It is used in combination.And in embodiment of the disclosure, computer-readable signal media may include in a base band or as carrier wave
The data-signal that a part is propagated, wherein carrying computer-readable program code.The data-signal of this propagation can be adopted
With diversified forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal is situated between
Matter can also be any computer-readable medium other than computer readable storage medium, which can be with
It sends, propagate or transmits for by the use of instruction execution system, device or device or program in connection.Meter
The program code for including on calculation machine readable medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable,
RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned terminal device;It is also possible to individualism, and not
It is fitted into the terminal device.Above-mentioned computer-readable medium carries one or more program, when said one or more
When a program is executed by the electronic equipment, so that the electronic equipment: obtaining training sample set, training sample set includes sample face
Image;Known using the sample face image that preset number information identification model trained in advance concentrates training sample
Not, related information corresponding with the object that sample face image is presented is obtained;The sample face image that training sample is concentrated
As input, will related information corresponding with sample face image as desired output, it is trained using the method for machine learning
To information prediction model.
In addition, when said one or multiple programs are executed by the electronic equipment, it is also possible that the electronic equipment: obtaining
Take the face-image of target user;Face-image is input to the information prediction model generated using the method such as first aspect,
Related information corresponding with face-image is obtained, related information includes at least one of the following: facial expression information, attribute information.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof
The computer program code of work, programming language include object oriented program language-such as Java,
Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language
Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence
Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or
It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet
Include local area network (LAN) or wide area network (WAN) --- it is connected to subscriber computer, or, it may be connected to outer computer (such as
It is connected using ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in embodiment of the disclosure can be realized by way of software, can also be passed through
The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor
Including a kind of processor, including acquiring unit, recognition unit and training unit.Wherein, the title of these units is in certain situation
Under do not constitute restriction to the unit itself, for example, acquiring unit is also described as " obtaining training sample set
Unit ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art
Member it should be appreciated that embodiment of the disclosure involved in invention scope, however it is not limited to the specific combination of above-mentioned technical characteristic and
At technical solution, while should also cover do not depart from foregoing invention design in the case where, by above-mentioned technical characteristic or its be equal
Feature carries out any combination and other technical solutions for being formed.Such as disclosed in features described above and embodiment of the disclosure (but
It is not limited to) technical characteristic with similar functions is replaced mutually and the technical solution that is formed.