CN109460485A - A kind of image library method for building up, device and storage medium - Google Patents
A kind of image library method for building up, device and storage medium Download PDFInfo
- Publication number
- CN109460485A CN109460485A CN201811191658.XA CN201811191658A CN109460485A CN 109460485 A CN109460485 A CN 109460485A CN 201811191658 A CN201811191658 A CN 201811191658A CN 109460485 A CN109460485 A CN 109460485A
- Authority
- CN
- China
- Prior art keywords
- image
- label
- recognition model
- character
- sample
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a kind of image library method for building up, comprising: obtains the first image;The first image is identified based on preset first image recognition model, obtains recognition result;The recognition result characterization the first image belongs to the confidence level of target class image;When determining that the first image belongs to target class image according to the recognition result, the first image is stored in described image library.The invention also discloses a kind of image libraries to establish device and computer readable storage medium.
Description
Technical field
The present invention relates to machine learning techniques more particularly to a kind of people's image library method for building up, device and computer-readable
Storage medium.
Background technique
Due to the continuous development of multimedia information technology (such as: network, intelligent terminal etc.), parade, rally, protest are lived
The images such as dynamic, riot can be acquired on network at the first time.In order not to cause social fear, which activity tool detected
There is violence property just to become to be highly desirable;But there is presently no a kind of sudden and violent probably construction method of image data base and sudden and violent probably images
The image-pickup method of database.
Summary of the invention
In view of this, the main purpose of the present invention is to provide a kind of image library method for building up, device and computer-readable
Storage medium.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
The embodiment of the invention provides a kind of image library method for building up, which comprises
Obtain the first image;
The first image is identified based on preset first image recognition model, obtains recognition result;The recognition result
Characterization the first image belongs to the confidence level of target class image;
When determining that the first image belongs to target class image according to the recognition result, the first image is stored in
Described image library.
In above scheme, the method also includes: generate the first image identification model;
The first image recognition model of the generation, comprising:
Obtain the sample image of preset quantity;Each sample image is corresponding with first in the sample image of the preset quantity
Label;Whether sample image described in first tag characterization is target class image;
It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on convolution
The learning training of neural network obtains the first image identification model.
In above scheme, it is described the first image is stored in described image library after, the method also includes:
It is corresponding with the first image to be stored in described image library using the recognition result as the first label.
In above scheme, the method also includes: the second label of the first image is determined, by the second determining label
It is corresponding with the first image to be stored in described image library;
Using following at least one method, the second label of the first image is determined:
The first image is identified according to preset second image recognition model, determines that the image of the first image is special
Sign;At least one target object that the first image includes is determined according to described image feature, based at least one described mesh
Mark object determines the second label of the first image;
The facial image in the first image is extracted, the facial image is identified according to preset person recognition model,
It determines the corresponding character attribute of the facial image, the second label of the first image is determined based on the character attribute;Institute
State character attribute, including it is following at least one: personage's age, personage's gender;
The first image is identified according to preset emotion recognition model, determines the affective characteristics of the first image;Root
At least one affective style that the first image performance is determined according to the affective characteristics, based at least one affective style
Determine the second label of the first image.
In above scheme, the method also includes: generate the person recognition model;
The generation person recognition model, comprising:
Obtain at least one character image;Each of at least one character image object image is corresponding with personage's category
Property, the character attribute include it is following at least one: personage's age, personage's gender;
It is carried out according at least one described character image and the corresponding character attribute of each character image based on neural network
Learning training, obtain the person recognition model.
Device is established the embodiment of the invention provides a kind of image library, and described device includes: first processing module, at second
Manage module and third processing module;Wherein,
The first processing module, for obtaining the first image;
The Second processing module, for identifying that the first processing module obtains based on preset first image recognition model
The first image taken obtains recognition result;The recognition result characterization the first image belongs to setting for target class image
Reliability;
The third processing module, for determining that the first image belongs to target class image according to the recognition result
When, the first image is stored in described image library.
In above scheme, described device further include: the first preprocessing module, for generating the first image identification mould
Type;
First preprocessing module, specifically for obtaining the sample image of preset quantity;The sample of the preset quantity
Each sample image is corresponding with the first label in image;Whether sample image described in first tag characterization is target class figure
Picture;
It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on convolution
The learning training of neural network obtains the first image identification model.
In above scheme, described device further include: fourth processing module, for using the recognition result as the first mark
Label, it is corresponding with the first image to be stored in described image library.
In above scheme, the fourth processing module is also used to determine the second label of the first image, will be determining
Second label is corresponding with the first image to be stored in described image library;
The fourth processing module is specifically used for determining the second of the first image using following at least one method
Label:
The first image is identified according to preset second image recognition model, determines that the image of the first image is special
Sign;At least one target object that the first image includes is determined according to described image feature, based at least one described mesh
Mark object determines the second label of the first image;
The facial image in the first image is extracted, the facial image is identified according to preset person recognition model,
It determines the corresponding character attribute of the facial image, the second label of the first image is determined based on the character attribute;Institute
State character attribute, including it is following at least one: personage's age, personage's gender;
The first image is identified according to preset emotion recognition model, determines the affective characteristics of the first image;Root
At least one affective style that the first image performance is determined according to the affective characteristics, based at least one affective style
Determine the second label of the first image.
In above scheme, described device further include: the second preprocessing module, for generating the person recognition model;
Second preprocessing module is specifically used for obtaining at least one character image;At least one described character image
Each of object image be corresponding with character attribute, the character attribute include it is following at least one: personage's age, Ren Wuxing
Not;
It is carried out according at least one described character image and the corresponding character attribute of each character image based on neural network
Learning training, obtain the person recognition model.
Device is established the embodiment of the invention provides a kind of image library, and described device includes: processor and for storing energy
The memory of enough computer programs run on a processor;Wherein,
The processor is established for when running the computer program, executing any one of above-described described image library
The step of method.
The embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer program, the meter
Calculation machine program realizes the step of any one of above-described described image library method for building up when being executed by processor.
Image library method for building up, device and computer readable storage medium provided by the embodiment of the present invention obtain first
Image;The first image is identified based on preset first image recognition model, obtains recognition result;The recognition result characterization
The first image belongs to the confidence level of target class image;Determine that the first image belongs to target class according to the recognition result
When image, the first image is stored in described image library.In the embodiment of the present invention, can identify whether the first image is mesh
The first image marked class image, and will determine as target class image, which is added in database, to be saved, and image library is constructed.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of image library method for building up provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of another image library method for building up provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of ResNet34 network structure provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of ResNet module provided in an embodiment of the present invention;
Fig. 5 is a kind of convolution flow diagram provided in an embodiment of the present invention;
Fig. 6 is a kind of image using labelImg tool provided in an embodiment of the present invention showing of confining that tool demarcated
It is intended to;
Fig. 7 is that a kind of effect using emotion recognition model identification affective style and display provided in an embodiment of the present invention is shown
It is intended to;
Fig. 8 is a kind of flow diagram of scaling method provided in an embodiment of the present invention
Fig. 9 is a kind of schematic diagram of AlexNet structure provided in an embodiment of the present invention;
Figure 10 is the structural schematic diagram that a kind of image library provided in an embodiment of the present invention establishes device;
Figure 11 is the structural schematic diagram that another image library provided in an embodiment of the present invention establishes device.
Specific embodiment
In various embodiments of the present invention, the first image is obtained;Institute is identified based on preset first image recognition model
The first image is stated, recognition result is obtained;The recognition result characterization the first image belongs to the confidence level of target class image;Root
When determining that the first image belongs to target class image according to the recognition result, the first image is stored in described image
Library.
Below with reference to embodiment, the present invention is further described in more detail.
Fig. 1 is a kind of flow diagram of image library method for building up provided in an embodiment of the present invention;As shown in Figure 1, described
Method includes:
Step 101 obtains the first image.
Here, the first image is image to be identified.
The method can be applied in the server of building image library.In one embodiment, the first image can be with
It saves in the server, the first image of itself preservation is read by the server, that is, obtains the first image;In another embodiment
In, the first image can be sent to the server by other terminals, so that the server obtains the first image;?
In another embodiment, the first image can be obtained from network by web crawlers by the server.
Step 102 identifies the first image based on preset first image recognition model, obtains recognition result;It is described
Recognition result characterization the first image belongs to the confidence level of target class image.
In the present embodiment, the method also includes: generate the first image identification model.
Specifically, the first image recognition model of the generation, comprising:
Obtain the sample image of preset quantity;Each sample image is corresponding with first in the sample image of the preset quantity
Label;Whether sample image described in first tag characterization is target class image;
It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on convolution
The learning training of neural network obtains the first image identification model.
Here, the target class image can be to fear image with sudden and violent probably feature, such as: about riot, protestor, collection cruelly
The images such as meeting, demonstration, the attack of terrorism, terrorist.
Here, the sample image for obtaining preset quantity;Each sample image in the sample image of the preset quantity
It is corresponding with the first label, may include:
The sample image of the preset quantity is divided into the first image set and the second image set;The first image collection includes
At least one first sample image, second image set include at least one second sample image;The first sample image
It is corresponding with positive label, second sample image is corresponding with negative label.Here, the first image collection and second image set
The ratio of amount of images can be 1:3.
The positive tag characterization image is target class image, can refer specifically to fear image cruelly here;
The negative tag characterization image non-target class image can refer specifically to the arbitrary image in addition to fearing image cruelly here.
Here, described to be carried out according to the sample image of the preset quantity and corresponding first label of each sample image
Learning training based on convolutional neural networks obtains the first image identification model, may include:
According in the first image collection at least one first sample image and the corresponding positive label of first sample image,
The second sample image of at least one of second image set and the corresponding negative label of the second sample image are carried out based on convolution
The learning training of neural network obtains the first image identification model.
Step 103, when determining that the first image belongs to target class image according to the recognition result, by first figure
As being stored in described image library.
Specifically, the server can determine the confidence level in recognition result, judge whether the confidence level is more than pre-
If threshold value, when determining that the confidence level is more than the preset threshold, it is determined that the first image belongs to target class image.
In the present embodiment, it is described the first image is stored in described image library after, the method also includes: by institute
Recognition result is stated as the first label, it is corresponding with the first image to be stored in described image library.
In the present embodiment, the method also includes: the second label of the first image is determined, by the second determining label
It is corresponding with the first image to be stored in described image library.
Specifically, the second label of the first image can be determined using following at least one method:
The first image is identified according to preset second image recognition model, determines that the image of the first image is special
Sign;At least one target object that the first image includes is determined according to described image feature, based at least one described mesh
Mark object determines the second label of the first image;
The facial image in the first image is extracted, the facial image is identified according to preset person recognition model,
It determines the corresponding character attribute of the facial image, the second label of the first image is determined based on the character attribute;Institute
State character attribute, including it is following at least one: personage's age, personage's gender;
The first image is identified according to preset emotion recognition model, determines the affective characteristics of the first image;Root
At least one affective style that the first image performance is determined according to the affective characteristics, based at least one affective style
Determine the second label of the first image.
Here, the target object that the second image recognition model includes in image for identification;The target object can
With include it is following at least one: poster, explosive fire accident, law-executor, be greater than 20 people groups, be greater than 100 people groups, flag, gun,
Military weapon, bloody, corpse etc..The affective style that the emotion recognition model is expressed in image for identification;The emotion class
Type includes: glad, sad, frightened, angry, violence degree etc..
The second image recognition model, the person recognition model, the emotion recognition model can be by image libraries
Developer presets and saves.
For example, the method may include: generate the person recognition model.
Specifically, the generation person recognition model, comprising:
Obtain at least one character image;Each of at least one character image object image is corresponding with personage's category
Property, the character attribute include it is following at least one: personage's age, personage's gender;
It is carried out according at least one described character image and the corresponding character attribute of each character image based on neural network
Learning training, obtain the person recognition model.
The method can also include: to generate the second image recognition model.
The second image recognition model of the generation, comprising:
Obtain the image that at least one includes target object;At least one described each of image comprising target object
Image comprising target object is corresponding with target object label;The target object label include it is following at least one: it is poster, quick-fried
Fried fire, is greater than 20 people groups, is greater than 100 people groups, flag, gun, military weapon, bloody, corpse law-executor;
According to it is described at least one include image of target object and each include the corresponding target of the image of target object
Object tag carries out learning training neural network based, obtains the second image recognition model.
The method can also include: to generate the emotion recognition model.
The generation emotion recognition model, comprising:
Obtain the emotion sample image of preset quantity;Each emotion sample graph in the emotion sample image of the preset quantity
As being corresponding with affective tag;The affective tag include it is following at least one: glad, sad, frightened, angry, violence degree;
It is carried out according to the emotion sample image of the preset quantity and the corresponding affective tag of each emotion sample image
Learning training obtains the emotion recognition model.
Fig. 2 is the flow diagram of another image library method for building up provided in an embodiment of the present invention;The method can be with
Applied to server, as shown in Figure 2, which comprises
Step 201, the sample image for acquiring preset quantity.
Specifically, the server by web crawlers from microblogging (Weibo), push away spy (Twitter), Google
(Google), the image of preset quantity (can specifically be greater than 100,000) is acquired on the websites such as Baidu (Baidu) as the sample
This image.
The image of acquisition, comprising: with the sudden and violent probably feature such as violence, terrified color cruelly probably image and do not have violence,
Terrified color etc. fears the arbitrary image of feature cruelly.
Step 202, the sample image for determining training, are trained according to the sample image of training, obtain sudden and violent probably mould
Type.
Here, described to fear the first image recognition model described in model, that is, Fig. 1 method cruelly.The sample graph of the training
As can be 30% in the image of acquisition.
Specifically, the step 202, comprising:
Positive sample collection is established according to the sample image of the training, the positive sample collection includes with the sudden and violent of sudden and violent probably feature
Probably image;It is described that probably image specifically can be about riot, protestor, rally, demonstration, the attack of terrorism, terrorist cruelly
Equal images;
Negative sample collection is established according to the sample image of the training;The negative sample collection includes not having to fear feature cruelly
Arbitrary image;Here, positive sample and the amount of images ratio of negative sample are 1:3;
The learning training based on convolutional neural networks is carried out according to the positive sample collection and the negative sample collection, is obtained cruelly probably
Model.
It is described to be corresponding with positive label with the image of fearing cruelly for fearing feature cruelly in the present embodiment, it is described to fear feature without sudden and violent
Arbitrary image be corresponding with negative label, the server can screen sample image by way of keyword search,
And then establish positive sample collection and negative sample collection.In addition, the server can remove nothing with artificial screening before training fears model cruelly
The image of pass further increases the quality of subsequent training pattern.
In the present embodiment, the convolutional Neural of the improved ResNet34 network structure as training can be used
Network is trained according to the sample image that positive sample collection and negative sample are concentrated.It specifically includes: the size of sample image is carried out
Adjustment, makes its size become 224 × 224;Concentrate the sample image for taking out 80% as instruction from the positive sample collection and negative sample
Practice collection, for 20% sample image as test set, label uses positive sample and negative sample;According in the training set and training set
The corresponding label of each sample image carries out propagated forward training, corresponding according to sample image each in the test set and test set
Label carries out back-propagating training, the ResNet34 network structure after being trained, as sudden and violent probably model.
Fig. 3 is a kind of schematic diagram of ResNet34 network structure provided in an embodiment of the present invention;In figure, Softmax function
Two classification are classified as, the ResNet module is specifically as shown in Figure 4.In Fig. 4, BN is Batch Normalization, that is, criticizes rule
Generalized;RELU is amendment linear unit (Rectified Linear Unit) function, RELU functional form are as follows: θ (x)=max
(0, x);CONV is convolutional layer, and convolutional layer is to extract characteristics of image by carrying out convolution operation to image.In convolutional Neural net
In network, each convolutional layer would generally include multiple trainable convolution masks (i.e. convolution kernel), and different convolution masks is corresponding not
Same characteristics of image.After convolution kernel and input picture carry out convolution operation, by nonlinear activation function, such as Sigmoid letter
Number, amendment linear unit (RELU, Rectified Linear Unit) function, ELU function etc., can map and be corresponded to
Characteristic pattern (Feature Map).Wherein, the parameter of convolution kernel is usually to use specific learning algorithm (such as: under stochastic gradient
Drop algorithm) be calculated.The convolution refers to being weighted with the pixel value of parameter and image corresponding position in template
The operation of summation.One typical convolution process can be as shown in figure 5, by sleiding form window, to the institute in input picture
There is position to carry out convolution operation, corresponding characteristic pattern can be obtained later.
Step 203 obtains images to be recognized, fears the model identification images to be recognized cruelly with described, obtains identification knot
Fruit.
Here, for any images to be recognized, image recognition is carried out by the model of fearing cruelly that step 202 obtains, is known
Other result;The recognition result characterization images to be recognized belongs to the confidence level of sudden and violent probably image;The confidence level can probably belong to be sudden and violent
Property degree value, such as " cruelly probably degree 80% ", alternatively, the confidence level can also be embodied by forms such as grade, numerical value.
Step 204 determines whether the images to be recognized is to fear image cruelly according to the recognition result, determines described wait know
Other image is to add label to the images to be recognized after fearing image cruelly.
Specifically, described to determine whether the images to be recognized is to fear image cruelly according to the recognition result, comprising: judgement
Whether the confidence level is more than preset threshold, when determining that the confidence level is more than preset threshold, determines that the images to be recognized is
Image is feared cruelly.For example, the preset threshold be cruelly probably degree 70%, then above-mentioned confidence level, i.e. cruelly fear degree 80% to
Identify that image is to fear image cruelly.
Specifically, the label may include it is following at least one: visual attribute, character attribute, emotion attribute.It is described can
See that attribute is primarily referred to as the contents such as objects in images, quantity, the emotion attribute is primarily referred to as the expression of personage in image, movement
The emotion embodied.The visual attribute may include: poster, explosive fire accident, law-executor, be greater than 20 people groups, is greater than 100
People group, flag, gun, military weapon, bloody, corpse etc..The emotion attribute may include: glad, sad, frightened, anger
Anger, violence degree etc..The character attribute may include: personage's gender, personage's age etc. (such as: 38-43 years old, male etc.).With
Upper label can use numerical value, grade or other forms of expression, and the method marked in pairs preferably can be used and pass through
Bradley-Terry model gives sample labeling continuous emotional intensity score.
Specifically, determine that the images to be recognized is that after fearing image cruelly, Amazon Mechanical can be used
The crowdsourcings platform such as Turk distribution task adds label to it, can also pass through automation or semi-automatic using other algorithms, model
The mode of change adds label.
It is above-described that semi-automatic mask method is carried out using tool, it can specifically be marked using target detection
(labelImg) tool, the labelImg tool can mark multiple similar targets in same picture, and it is marked
Corresponding txt file can be generated after the completion, do not need that corresponding xml document can be converted to by other tools.Such as Fig. 6 institute
Show, confines the schematic diagram that tool is demarcated for a kind of image using labelImg tool.To it after demarcating a certain region
Add label.
Alternatively, can use trained model, come the method for carrying out automation marking, use is trained can
Model (i.e. the second image recognition model described in Fig. 1 method), the person recognition model, emotion recognition model for seeing attribute, according to
It is secondary that images to be recognized is identified.As shown in fig. 7, to be shown using the effect of emotion recognition model identification affective style and display
It is intended to.
Building below for person recognition model and be embodiment based on person recognition model identification character attribute, carries out
Explanation.
It is described that label is added to the images to be recognized, comprising:
Judge to determine whether comprising face in the images to be recognized in the images to be recognized comprising face, extracts institute
The facial image in images to be recognized is stated, the facial image is identified according to preset person recognition model, determines the face
The corresponding character attribute of image determines the second label of the images to be recognized based on the character attribute;The character attribute,
Including it is following at least one: personage's age, personage's gender;The determining character attribute is added to label.
Specifically, the facial image extracted in images to be recognized, comprising: the face in calibration images to be recognized,
Extract facial image.Here, specifically facial image can be extracted by the following method: by multitask concatenated convolutional nerve net
Network (MTCNN, Multi-task Cascaded Convolutional Networks) identifies the face in picture, specifically can be with
Position, the boundary of face etc. of people's face are demarcated, the mode of the calibration, which can be, to be represented the point of face position, connects face edge
Face etc. where line or face;The part of face is partitioned into from picture according to above-mentioned calibration, extracts facial image.
The MTCNN is a kind of cascade convolutional neural networks frame, by Face datection by way of multi-task learning
It is integrated with two tasks of positioning feature point.Its network structure mainly includes three phases, and each stage is rolled up by one
Product neural network (CNN, Convolutional Neural Network) is constituted.Firstly, shallow by one in first stage
The convolutional neural networks (P-Net, Proposal Network) of layer quickly generate a large amount of candidate windows;Secondly, in second stage,
A large amount of non-face windows are excluded by using a relatively complicated convolutional neural networks (R-Net, Refine Network)
To optimize candidate window;Finally, using more complicated convolutional neural networks (O-Net, an Output in the phase III
Network) optimize output window again, while exporting the coordinate of five human face characteristic points.
By taking the input picture of Fig. 8 as an example, which is first different size by the size adjusting of input picture, to construct
Its image pyramid (Image Pyramid), obtained image pyramid is by the input as tri- subtended network configurations of MTCNN
Image.
Before the facial image according to the identification of preset person recognition model, the method also includes: generate people
Object identification model.Specifically, the person recognition model, comprising: utilize existing face database, such as Adience data
Library and improved AlexNet structure obtain person recognition model by training.The person recognition model can be according to face
Image recognition goes out the character attributes such as age, gender.
The Adience database includes 2284 people, 26580 pictures;Label is that 8 age groups (include: 0-2,4-
6,8-13,15-20,25-32,38-43,45-53,60-) and gender attribute (including: male, female).By Adience number
It is input in improved AlexNet structure according to the picture in library and the attributes such as age and gender is trained respectively, can be obtained
The model of suitable age, gender etc. for identification, i.e., the described person recognition model.
Improvement to the AlexNet structure mainly include it is following at least one:
(1), more shallow and network does not have the stacking of multiple volume bases and active coating (RELU);
(2), full articulamentum interior joint is less;
(3), (LRN) is normalized without the use of local acknowledgement using batch normalization (BN);
(4), a small amount of dropout is introduced.
AlexNet structure is inputted after facial image size is adjusted to 227 × 227, network specific structure is as shown in Figure 9.
Wherein, it refers in the training process of network for Dropout layers, ignores the neuron of a part at random, allow it not work, the party
On the one hand method can accelerate operation, on the other hand reduce the risk of model over-fitting.P=0.25 ignores 25% mind at random
Through member.
Step 205 is established and fears image data base cruelly.
Here, described probably database includes above-mentioned sample image and corresponding label cruelly, for any sample graph
The label of picture may include it is following at least one: cruelly fear attribute (i.e. positive label or negative label), visual attribute, emotion attribute, people
Object attribute.
With the method for procedure described above 201- step 205, can be generated cruelly probably model, by cruelly fear model to appoint
The attribute of fearing cruelly of one image is judged, automatic to add the sudden and violent probably corresponding label of attribute, additionally it is possible to for object special in image
The features such as body, number, personage's emotion, character attribute add special label (i.e. visual attribute, emotion attribute, character attribute).
The sudden and violent probably image data base established can collect fears image cruelly, and stores the sudden and violent probably corresponding label of image, to search for certain kinds
The sudden and violent probably image of type and obtain rapidly the relevant information in image (such as comprising number, include sudden and violent fear feature).
Figure 10 is the structural schematic diagram that a kind of image library provided in an embodiment of the present invention establishes device;As shown in Figure 10, institute
Stating device includes: first processing module 301, Second processing module 302 and third processing module 303.
The first processing module 301, for obtaining the first image
The Second processing module 302, for based on preset first image recognition model identification the first processing mould
The first image that block obtains obtains recognition result;The recognition result characterization the first image belongs to target class image
Confidence level.
The third processing module 303, for determining that the first image belongs to target class figure according to the recognition result
When picture, the first image is stored in described image library.
Specifically, described device further include: the first preprocessing module, for generating the first image identification model.
First preprocessing module, specifically for obtaining the sample image of preset quantity;The sample of the preset quantity
Each sample image is corresponding with the first label in image;Whether sample image described in first tag characterization is target class figure
Picture;
It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on convolution
The learning training of neural network obtains the first image identification model.
Specifically, described device further include: fourth processing module, for using the recognition result as the first label, with
The first image correspondence is stored in described image library.
Specifically, the fourth processing module is also used to determine the second label of the first image, by determining second
Label is corresponding with the first image to be stored in described image library.
The fourth processing module is specifically used for determining the second of the first image using following at least one method
Label:
The first image is identified according to preset second image recognition model, determines that the image of the first image is special
Sign;At least one target object that the first image includes is determined according to described image feature, based at least one described mesh
Mark object determines the second label of the first image;
The facial image in the first image is extracted, the facial image is identified according to preset person recognition model,
It determines the corresponding character attribute of the facial image, the second label of the first image is determined based on the character attribute;Institute
State character attribute, including it is following at least one: personage's age, personage's gender;
The first image is identified according to preset emotion recognition model, determines the affective characteristics of the first image;Root
At least one affective style that the first image performance is determined according to the affective characteristics, based at least one affective style
Determine the second label of the first image.
It should be understood that image library provided by the above embodiment establish device carry out image library establish when, only more than
The division progress of each program module is stated for example, can according to need in practical application and distribute above-mentioned processing by difference
Program module complete, i.e., the internal structure of device is divided into different program modules, with complete it is described above whole or
Person part is handled.In addition, image library provided by the above embodiment establish device belong to image library method for building up embodiment it is same
Design, specific implementation process are detailed in embodiment of the method, and which is not described herein again.
Figure 11 is the structural schematic diagram that another image library provided in an embodiment of the present invention establishes device;Described image library is built
Vertical device can be applied to server;As shown in figure 11, described device 40 includes: processor 401 and can be in institute for storing
State the memory 402 of the computer program run on processor;Wherein, the processor 401 is for running the computer journey
It when sequence, executes: obtaining the first image;The first image is identified based on preset first image recognition model, obtains identification knot
Fruit;The recognition result characterization the first image belongs to the confidence level of target class image;Institute is determined according to the recognition result
When stating the first image and belonging to target class image, the first image is stored in described image library.
In one embodiment, it when the processor 401 is also used to run the computer program, executes: generating described the
One image recognition model;The first image recognition model of the generation, comprising: obtain the sample image of preset quantity;It is described default
Each sample image is corresponding with the first label in the sample image of quantity;Sample image described in first tag characterization whether be
Target class image;It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on volume
The learning training of product neural network, obtains the first image identification model.
In one embodiment, it when the processor 401 is also used to run the computer program, executes: by the identification
As a result it is used as the first label, it is corresponding with the first image to be stored in described image library.
In one embodiment, it when the processor 401 is also used to run the computer program, executes: determining described the
Second label of one image is stored in described image library for the second determining label is corresponding with the first image;Wherein, it uses
Following at least one method, determines the second label of the first image: identifying institute according to preset second image recognition model
The first image is stated, determines the characteristics of image of the first image;Determine what the first image included according to described image feature
At least one target object determines the second label of the first image based at least one described target object;Described in extraction
Facial image in first image identifies the facial image according to preset person recognition model, determines the facial image
Corresponding character attribute determines the second label of the first image based on the character attribute;The character attribute, including with
Descend at least one: personage's age, personage's gender;According to preset emotion recognition model identify the first image, determine described in
The affective characteristics of first image;At least one affective style of the first image performance, base are determined according to the affective characteristics
The second label of the first image is determined at least one affective style.
In one embodiment, it when the processor 401 is also used to run the computer program, executes: generating the people
Object identification model;The generation person recognition model, comprising: obtain at least one character image;At least one described figure map
As each of object image be corresponding with character attribute, the character attribute include it is following at least one: personage's age, Ren Wuxing
Not;Study neural network based is carried out according at least one described character image and the corresponding character attribute of each character image
Training, obtains the person recognition model.
Belong to it should be understood that image library provided by the above embodiment establishes device with image library method for building up embodiment
Same design, specific implementation process are detailed in embodiment of the method, and which is not described herein again.
When practical application, described device 40 can also include: at least one network interface 403.Image library establishes device 40
In various components be coupled by bus system 404.It is understood that bus system 404 is for realizing between these components
Connection communication.Bus system 404 further includes that power bus, control bus and status signal are total in addition to including data/address bus
Line.But for the sake of clear explanation, various buses are all designated as bus system 404 in Figure 11.Wherein, the processor
404 number can be at least one.Network interface 403 establishes wired between device 40 and other equipment or nothing for image library
The communication of line mode.
Memory 402 in the embodiment of the present invention is for storing various types of data to support image library to establish device 40
Operation.
The method that the embodiments of the present invention disclose can be applied in processor 401, or be realized by processor 401.
Processor 401 may be a kind of IC chip, the processing capacity with signal.During realization, the above method it is each
Step can be completed by the integrated logic circuit of the hardware in processor 401 or the instruction of software form.Above-mentioned processing
Device 401 can be general processor, digital signal processor (DSP, Digital Signal Processor) or other can
Programmed logic device, discrete gate or transistor logic, discrete hardware components etc..Processor 401 may be implemented or hold
Disclosed each method, step and logic diagram in the row embodiment of the present invention.General processor can be microprocessor or appoint
What conventional processor etc..The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly at hardware decoding
Reason device executes completion, or in decoding processor hardware and software module combine and execute completion.Software module can be located at
In storage medium, which is located at memory 402, and processor 401 reads the information in memory 402, in conjunction with its hardware
The step of completing preceding method.
In the exemplary embodiment, image library establish device 40 can be by one or more application specific integrated circuit
(ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD,
Programmable Logic Device), Complex Programmable Logic Devices (CPLD, Complex Programmable Logic
Device), field programmable gate array (FPGA, Field-Programmable Gate Array), general processor, control
Device, microcontroller (MCU, Micro Controller Unit), microprocessor (Microprocessor) or other electronics member
Part is realized, for executing preceding method.
The embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, described
It when computer program is run by processor, executes: obtaining the first image;Based on described in the identification of preset first image recognition model
First image obtains recognition result;The recognition result characterization the first image belongs to the confidence level of target class image;According to
When the recognition result determines that the first image belongs to target class image, the first image is stored in described image library.
In one embodiment, it when the computer program is run by processor, executes: generating the first image and identify mould
Type;The first image recognition model of the generation, comprising: obtain the sample image of preset quantity;The sample graph of the preset quantity
Each sample image is corresponding with the first label as in;Whether sample image described in first tag characterization is target class image;
It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on convolutional neural networks
Learning training, obtain the first image identification model.
In one embodiment, it when the computer program is run by processor, executes: using the recognition result as first
Label, it is corresponding with the first image to be stored in described image library.
In one embodiment, it when the computer program is run by processor, executes: determining the second of the first image
Label is stored in described image library for the second determining label is corresponding with the first image;Wherein, using following at least one
Method determines the second label of the first image: identifying the first image according to preset second image recognition model, really
Determine the characteristics of image of the first image;At least one target pair that the first image includes is determined according to described image feature
As determining the second label of the first image based at least one described target object;Extract the people in the first image
Face image identifies the facial image according to preset person recognition model, determines the corresponding character attribute of the facial image,
The second label of the first image is determined based on the character attribute;The character attribute, including it is following at least one: personage
Age, personage's gender;The first image is identified according to preset emotion recognition model, determines that the emotion of the first image is special
Sign;At least one affective style that the first image performance is determined according to the affective characteristics, based at least one feelings
Sense type determines the second label of the first image.
In one embodiment, it when the computer program is run by processor, executes: generating the person recognition model;
The generation person recognition model, comprising: obtain at least one character image;Each of at least one described character image
Object image is corresponding with character attribute, the character attribute include it is following at least one: personage's age, personage's gender;According to described
At least one character image and the corresponding character attribute of each character image carry out learning training neural network based, obtain institute
State person recognition model.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it
Its mode is realized.Apparatus embodiments described above are merely indicative, for example, the division of the unit, only
A kind of logical function partition, there may be another division manner in actual implementation, such as: multiple units or components can combine, or
It is desirably integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed each composition portion
Mutual coupling or direct-coupling or communication connection is divided to can be through some interfaces, the INDIRECT COUPLING of equipment or unit
Or communication connection, it can be electrical, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member, which can be or may not be, to be physically separated, aobvious as unit
The component shown can be or may not be physical unit, it can and it is in one place, it may be distributed over multiple network lists
In member;Some or all of units can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated in one processing unit, it can also
To be each unit individually as a unit, can also be integrated in one unit with two or more units;It is above-mentioned
Integrated unit both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can be stored in a computer readable storage medium, the program
When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned include: movable storage device, it is read-only
Memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or
The various media that can store program code such as person's CD.
If alternatively, the above-mentioned integrated unit of the present invention is realized in the form of software function module and as independent product
When selling or using, it also can store in a computer readable storage medium.Based on this understanding, the present invention is implemented
Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words,
The computer software product is stored in a storage medium, including some instructions are used so that computer equipment (can be with
It is personal computer, server or network equipment etc.) execute all or part of each embodiment the method for the present invention.
And storage medium above-mentioned includes: that movable storage device, ROM, RAM, magnetic or disk etc. are various can store program code
Medium.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention, it is all
Made any modifications, equivalent replacements, and improvements etc. within the spirit and principles in the present invention, should be included in protection of the invention
Within the scope of.
Claims (12)
1. a kind of image library method for building up, which is characterized in that the described method includes:
Obtain the first image;
The first image is identified based on preset first image recognition model, obtains recognition result;The recognition result characterization
The first image belongs to the confidence level of target class image;
When determining that the first image belongs to target class image according to the recognition result, the first image is stored in described
Image library.
2. the method according to claim 1, wherein the method also includes: generate the first image identification
Model;
The first image recognition model of the generation, comprising:
Obtain the sample image of preset quantity;Each sample image is corresponding with the first mark in the sample image of the preset quantity
Label;Whether sample image described in first tag characterization is target class image;
It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on convolutional Neural
The learning training of network obtains the first image identification model.
3. the method according to claim 1, wherein it is described by the first image be stored in described image library it
Afterwards, the method also includes:
It is corresponding with the first image to be stored in described image library using the recognition result as the first label.
4. method according to claim 1 or 3, which is characterized in that the method also includes: determine the first image
Second label is stored in described image library for the second determining label is corresponding with the first image;
Using following at least one method, the second label of the first image is determined:
The first image is identified according to preset second image recognition model, determines the characteristics of image of the first image;Root
At least one target object that the first image includes is determined according to described image feature, based at least one described target object
Determine the second label of the first image;
The facial image in the first image is extracted, the facial image is identified according to preset person recognition model, is determined
The corresponding character attribute of the facial image, the second label of the first image is determined based on the character attribute;The people
Object attribute, including it is following at least one: personage's age, personage's gender;
The first image is identified according to preset emotion recognition model, determines the affective characteristics of the first image;According to institute
At least one affective style that affective characteristics determine the first image performance is stated, is determined based at least one affective style
Second label of the first image.
5. according to the method described in claim 4, it is characterized in that, the method also includes: generate the person recognition model;
The generation person recognition model, comprising:
Obtain at least one character image;Each of at least one character image object image is corresponding with character attribute,
The character attribute include it is following at least one: personage's age, personage's gender;
Neural network based is carried out according at least one described character image and the corresponding character attribute of each character image
Training is practised, the person recognition model is obtained.
6. a kind of image library establishes device, which is characterized in that described device include: first processing module, Second processing module and
Third processing module;Wherein,
The first processing module, for obtaining the first image;
The Second processing module, for identifying what the first processing module obtained based on preset first image recognition model
The first image obtains recognition result;The recognition result characterization the first image belongs to the confidence level of target class image;
The third processing module will when for determining that the first image belongs to target class image according to the recognition result
The first image is stored in described image library.
7. device according to claim 6, which is characterized in that described device further include: the first preprocessing module, for giving birth to
At the first image identification model;
First preprocessing module, specifically for obtaining the sample image of preset quantity;The sample image of the preset quantity
In each sample image be corresponding with the first label;Whether sample image described in first tag characterization is target class image;
It is carried out according to the sample image of the preset quantity and corresponding first label of each sample image based on convolutional Neural
The learning training of network obtains the first image identification model.
8. device according to claim 6, which is characterized in that described device further include: fourth processing module is used for institute
Recognition result is stated as the first label, it is corresponding with the first image to be stored in described image library.
9. device according to claim 8, which is characterized in that the fourth processing module is also used to determine described first
Second label of image is stored in described image library for the second determining label is corresponding with the first image;
The fourth processing module is specifically used for determining the second label of the first image using following at least one method:
The first image is identified according to preset second image recognition model, determines the characteristics of image of the first image;Root
At least one target object that the first image includes is determined according to described image feature, based at least one described target object
Determine the second label of the first image;
The facial image in the first image is extracted, the facial image is identified according to preset person recognition model, is determined
The corresponding character attribute of the facial image, the second label of the first image is determined based on the character attribute;The people
Object attribute, including it is following at least one: personage's age, personage's gender;
The first image is identified according to preset emotion recognition model, determines the affective characteristics of the first image;According to institute
At least one affective style that affective characteristics determine the first image performance is stated, is determined based at least one affective style
Second label of the first image.
10. device according to claim 9, which is characterized in that described device further include: the second preprocessing module is used for
Generate the person recognition model;
Second preprocessing module is specifically used for obtaining at least one character image;In at least one described character image
Each character image is corresponding with character attribute, the character attribute include it is following at least one: personage's age, personage's gender;
Neural network based is carried out according at least one described character image and the corresponding character attribute of each character image
Training is practised, the person recognition model is obtained.
11. a kind of image library establishes device, which is characterized in that described device includes: processor and can handle for storing
The memory of the computer program run on device;Wherein,
The processor is for the step of when running the computer program, perform claim requires any one of 1 to 5 the method.
12. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
The step of any one of claim 1 to 5 the method is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811191658.XA CN109460485A (en) | 2018-10-12 | 2018-10-12 | A kind of image library method for building up, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811191658.XA CN109460485A (en) | 2018-10-12 | 2018-10-12 | A kind of image library method for building up, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109460485A true CN109460485A (en) | 2019-03-12 |
Family
ID=65607611
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811191658.XA Pending CN109460485A (en) | 2018-10-12 | 2018-10-12 | A kind of image library method for building up, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109460485A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110297928A (en) * | 2019-07-02 | 2019-10-01 | 百度在线网络技术(北京)有限公司 | Recommended method, device, equipment and the storage medium of expression picture |
CN112100524A (en) * | 2020-09-17 | 2020-12-18 | 北京百度网讯科技有限公司 | Information recommendation method, device, equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001035326A1 (en) * | 1999-11-09 | 2001-05-17 | The Victoria University Of Manchester | Object class identification, verification or object image synthesis |
US20120230545A1 (en) * | 2009-11-30 | 2012-09-13 | Tong Zhang | Face Recognition Apparatus and Methods |
CN104063683A (en) * | 2014-06-06 | 2014-09-24 | 北京搜狗科技发展有限公司 | Expression input method and device based on face identification |
CN104346503A (en) * | 2013-07-23 | 2015-02-11 | 广州华久信息科技有限公司 | Human face image based emotional health monitoring method and mobile phone |
CN105303149A (en) * | 2014-05-29 | 2016-02-03 | 腾讯科技(深圳)有限公司 | Figure image display method and apparatus |
CN106372615A (en) * | 2016-09-19 | 2017-02-01 | 厦门中控生物识别信息技术有限公司 | Face anti-counterfeiting identification method and apparatus |
CN106951848A (en) * | 2017-03-13 | 2017-07-14 | 平安科技(深圳)有限公司 | The method and system of picture recognition |
CN107657239A (en) * | 2017-09-30 | 2018-02-02 | 清华大学深圳研究生院 | Palmprint image gender classification method and device, computer installation and readable storage medium storing program for executing |
-
2018
- 2018-10-12 CN CN201811191658.XA patent/CN109460485A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001035326A1 (en) * | 1999-11-09 | 2001-05-17 | The Victoria University Of Manchester | Object class identification, verification or object image synthesis |
US20120230545A1 (en) * | 2009-11-30 | 2012-09-13 | Tong Zhang | Face Recognition Apparatus and Methods |
CN104346503A (en) * | 2013-07-23 | 2015-02-11 | 广州华久信息科技有限公司 | Human face image based emotional health monitoring method and mobile phone |
CN105303149A (en) * | 2014-05-29 | 2016-02-03 | 腾讯科技(深圳)有限公司 | Figure image display method and apparatus |
CN104063683A (en) * | 2014-06-06 | 2014-09-24 | 北京搜狗科技发展有限公司 | Expression input method and device based on face identification |
CN106372615A (en) * | 2016-09-19 | 2017-02-01 | 厦门中控生物识别信息技术有限公司 | Face anti-counterfeiting identification method and apparatus |
CN106951848A (en) * | 2017-03-13 | 2017-07-14 | 平安科技(深圳)有限公司 | The method and system of picture recognition |
CN107657239A (en) * | 2017-09-30 | 2018-02-02 | 清华大学深圳研究生院 | Palmprint image gender classification method and device, computer installation and readable storage medium storing program for executing |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110297928A (en) * | 2019-07-02 | 2019-10-01 | 百度在线网络技术(北京)有限公司 | Recommended method, device, equipment and the storage medium of expression picture |
CN112100524A (en) * | 2020-09-17 | 2020-12-18 | 北京百度网讯科技有限公司 | Information recommendation method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Ahmed et al. | Facial expression recognition using convolutional neural network with data augmentation | |
Rao et al. | Deep convolutional neural networks for sign language recognition | |
Xu et al. | Reasoning-rcnn: Unifying adaptive global reasoning into large-scale object detection | |
CN110188635B (en) | Plant disease and insect pest identification method based on attention mechanism and multi-level convolution characteristics | |
Zhang et al. | A gated peripheral-foveal convolutional neural network for unified image aesthetic prediction | |
Yu et al. | Image quality classification for DR screening using deep learning | |
CN105426356B (en) | A kind of target information recognition methods and device | |
Kae et al. | Augmenting CRFs with Boltzmann machine shape priors for image labeling | |
US20220215259A1 (en) | Neural network training method, data processing method, and related apparatus | |
CN111598164B (en) | Method, device, electronic equipment and storage medium for identifying attribute of target object | |
CN109522925A (en) | A kind of image-recognizing method, device and storage medium | |
CN106295591A (en) | Gender identification method based on facial image and device | |
CN106326857A (en) | Gender identification method and gender identification device based on face image | |
CN109472209A (en) | A kind of image-recognizing method, device and storage medium | |
CN109472193A (en) | Method for detecting human face and device | |
CN111368672A (en) | Construction method and device for genetic disease facial recognition model | |
CN109919252A (en) | The method for generating classifier using a small number of mark images | |
CN112862005B (en) | Video classification method, device, electronic equipment and storage medium | |
CN105303163B (en) | A kind of method and detection device of target detection | |
CN109784196A (en) | Visual information, which is sentenced, knows method, apparatus, equipment and storage medium | |
CN108073851A (en) | A kind of method, apparatus and electronic equipment for capturing gesture identification | |
CN109508640A (en) | A kind of crowd's sentiment analysis method, apparatus and storage medium | |
Depuru et al. | Convolutional neural network based human emotion recognition system: A deep learning approach | |
CN109460485A (en) | A kind of image library method for building up, device and storage medium | |
Lipi et al. | Static-gesture word recognition in Bangla sign language using convolutional neural network |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190312 |