CN109886073A - A kind of image detecting method and device - Google Patents

A kind of image detecting method and device Download PDF

Info

Publication number
CN109886073A
CN109886073A CN201811596614.5A CN201811596614A CN109886073A CN 109886073 A CN109886073 A CN 109886073A CN 201811596614 A CN201811596614 A CN 201811596614A CN 109886073 A CN109886073 A CN 109886073A
Authority
CN
China
Prior art keywords
convolutional neural
neural networks
label
face
image
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
Application number
CN201811596614.5A
Other languages
Chinese (zh)
Inventor
吴伟
吴涛
杨龙
张兆丰
王孝宇
田第鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201811596614.5A priority Critical patent/CN109886073A/en
Publication of CN109886073A publication Critical patent/CN109886073A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the present invention provides a kind of image detecting method and device, this method comprises: obtaining image to be detected;The position of face in image to be detected is detected using the first cascade convolutional neural networks;First cascade convolutional neural networks are the concatenated convolutional neural network obtained according to the second cascade convolutional neural networks training, first cascade convolutional neural networks and the second cascade convolutional neural networks are cascaded by M convolutional neural networks, for the complexity of first cascade convolutional neural networks less than the complexity of the second cascade convolutional neural networks, M is the integer more than or equal to 3.Implement the embodiment of the present invention, image detection efficiency can be improved.

Description

A kind of image detecting method and device
Technical field
The present invention relates to image identification technical fields, and in particular to a kind of image detecting method and device.
Background technique
In order to not influence image detection efficiency while improving image detection accuracy, industry introduces concatenated convolutional mind Through network.During using concatenated convolutional neural network detection image, all areas of image will be by first volume Product neural network, although the calculation amount of first convolutional neural networks is small, the areal for needing to judge is most.Convolution below It is therefore wanted from the region for being considered face that one convolutional neural networks in front export in the input picture region of neural network It is fewer than the areal that previous convolutional neural networks need to judge, but the calculation amount that each region is judged is big.Cascade Although convolutional neural networks do not influence image detection efficiency, in the case where needing the higher image of detection resolution, detection effect Rate is lower.
Summary of the invention
The embodiment of the present invention provides a kind of image detecting method and device, and image detection efficiency can be improved.
First aspect of the embodiment of the present invention provides a kind of image detecting method, comprising:
Obtain image to be detected;
The face in described image to be detected is detected using the first cascade convolutional neural networks;
The first cascade convolutional neural networks are the concatenated convolutional obtained according to the second cascade convolutional neural networks training Neural network, the first cascade convolutional neural networks and the second cascade convolutional neural networks are by M convolutional Neural net Network cascades, and the complexity of the first cascade convolutional neural networks and the first cascade convolutional neural networks is less than described The complexity of second cascade convolutional neural networks, the M are the integer more than or equal to 3.
Since the complexity of the first cascade convolutional neural networks is lower, the network of the first cascade convolutional neural networks It is relatively simple for structure, image detection efficiency can be improved;In addition, although the network structure of the first cascade convolutional neural networks compares Simply, but since the first cascade convolutional neural networks are to be obtained according to the higher second cascade convolutional neural networks training of complexity , will not influence the detection accuracy of the first cascade convolutional neural networks, so as to while improving image detection efficiency not It will affect image detection accuracy.
In one embodiment, the method also includes:
Training data is obtained, the training data includes that image segments collection and described image segment concentrate each image sheet The the first face label and first position label of section;
By the first image segments input the second cascade convolutional neural networks, the second face label, the first image are obtained Segment is any image segment of described image segment collection, and the second cascade convolutional neural networks are trained concatenated convolutionals Neural network;
The first image segment is inputted into concatenated convolutional neural network to be trained, obtains third face label and second Set label;
According to the first face label, the second face label, the third face label, first position mark Label and the second position label calculate total losses;
The parameter for optimizing the concatenated convolutional neural network to be trained according to the total losses obtains the first cascade volume Product neural network.
It not only used true face label when as it can be seen that calculating loss, also use the second cascade convolutional Neural The face label of network output, information content is relatively abundant, therefore, although the complexity of the first cascade convolutional neural networks is less than the The complexity of two cascade convolutional neural networks, but the precision of the first cascade convolutional neural networks can achieve the second concatenated convolutional mind Precision through network, so as to will not influence image detection accuracy while improving image detection efficiency.
In one embodiment, described according to the first face label, the second face label, the third face Label, the first position label and the second position label, calculating total losses includes:
According to the first face label, the second face label and the third face label, Classification Loss is calculated;
According to the first position label and the second position label, calculates and return loss;
It is lost according to the Classification Loss and the recurrence, calculates total losses.
As it can be seen that Classification Loss includes the classification damage from true Classification Loss and from the second cascade convolutional neural networks It loses.
In one embodiment, described according to the first face label, the second face label and the third party Face label, calculating Classification Loss includes:
According to the first face label and the third face label, the first Classification Loss is calculated;
According to the second face label and the third face label, the second Classification Loss is calculated;
According to first Classification Loss and second Classification Loss, Classification Loss is calculated.
In one embodiment, described according to the first face label and the third face label, calculate first point Class is lost
It is defeated according to i-th of convolutional neural networks in the first face label and the concatenated convolutional neural network to be trained Face label out, calculates the i-th 1 Classification Loss, and the i is greater than 0 and to be less than the integer of M+1;
It is described according to the second face label and the third face label, calculating the second Classification Loss includes:
According to the face label of i-th convolutional neural networks output in the second cascade convolutional neural networks and it is described to The face label of i-th of convolutional neural networks output, calculates the i-th 2 Classification Loss in training concatenated convolutional neural network;
It is described according to first Classification Loss and second Classification Loss, calculating Classification Loss includes:
According to the i-th 1 Classification Loss and the i-th 2 Classification Loss, the i-th Classification Loss is calculated.
As it can be seen that when calculating Classification Loss, the loss of different convolutional neural networks in concatenated convolutional neural network to be trained It is to be calculated according to the label and corresponding true tag of convolutional neural networks output corresponding in the second cascade convolutional neural networks , therefore, different convolutional neural networks can achieve the second cascade convolutional neural networks in concatenated convolutional neural network to be trained In corresponding convolutional neural networks detection accuracy.In addition, when calculating Classification Loss, in concatenated convolutional neural network to be trained The loss of different convolutional neural networks individually calculates, that is, different convolutional neural networks in concatenated convolutional neural network to be trained There is different Classification Loss.
In one embodiment, described according to the first position label and the second position label, it calculates and returns damage Mistake includes:
It is defeated according to i-th of convolutional neural networks in the first position label and the concatenated convolutional neural network to be trained Location tags out calculate i-th and return loss;
Described to be lost according to the Classification Loss and the recurrence, calculating total losses includes:
Loss is returned according to i-th Classification Loss and described i-th, calculates the i-th loss;
The parameter for optimizing the concatenated convolutional neural network to be trained according to the total losses, obtains the first order Joining convolutional neural networks includes:
Optimize the ginseng of i-th of convolutional neural networks in the concatenated convolutional neural network to be trained according to i-th loss Number obtains the first cascade convolutional neural networks.
As it can be seen that when calculating recurrence loss, the loss of different convolutional neural networks in concatenated convolutional neural network to be trained It individually calculates, that is, different convolutional neural networks have different recurrence losses in concatenated convolutional neural network to be trained.Similarly, When calculating total losses, the loss of different convolutional neural networks is individually calculated in concatenated convolutional neural network to be trained, i.e., Different convolutional neural networks have different total losses in concatenated convolutional neural network to be trained.
Second aspect of the embodiment of the present invention provides a kind of image detection device, including for executing first aspect or first party The unit for the image detecting method that any embodiment in face provides.
The third aspect of the embodiment of the present invention provides a kind of image detection device, including processor and memory, the processing Device and the memory are connected with each other, wherein for the memory for storing computer program, the computer program includes journey Sequence instruction, what the processor was used to that any embodiment of described program instruction execution first aspect or first aspect to be called to provide Image detecting method.
Fourth aspect provides a kind of readable storage medium storing program for executing, and the readable storage medium storing program for executing is stored with computer program, described Computer program includes program instruction, described program instruction make when being executed by a processor the processor execute first aspect or The image detecting method that any embodiment of first aspect provides.
5th aspect provides a kind of application program, and the application program for executing first aspect or first party at runtime The image detecting method that any embodiment in face provides.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to needed in the embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of image detecting method provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of another image detecting method provided in an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of image detection device provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of another image detection device provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic diagram of concatenated convolutional neural network detection face disclosed by the embodiments of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
The embodiment of the present invention provides a kind of image detecting method and device, and image detection efficiency can be improved.Individually below It is described in detail.
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of image detecting method provided in an embodiment of the present invention.According to not With demand, certain steps in flow chart shown in FIG. 1 can be split as several steps.As shown in Figure 1, the image detection side Method may comprise steps of.
101, image to be detected is obtained.
In the present embodiment, when needing to identify the face in image, image to be detected is obtained.Image to be detected can be this The image of ground storage is also possible to the image obtained from network or server, can also be through image acquisition device Image, this embodiment is not limited.Wherein, image to be detected can be all images for needing to identify, be also possible to need to know One or more image in other image.
102, the position of face in image to be detected is detected using the first cascade convolutional neural networks.
In the present embodiment, the first cascade convolutional neural networks are trained in advance, after getting image to be detected, use One cascade convolutional neural networks detect the position of face in image to be detected, i.e., image to be detected are inputted the first concatenated convolutional mind Through network, deposited in image to be detected in the context of a person's face, first cascade convolutional neural networks output mark out face to Detection image, in the case where face is not present in image to be detected, the first cascade convolutional neural networks are not exported.Wherein, Box, circle etc. can be used and mark out face.The all areas of face can be marked out, the big portion of face can also be marked out Subregion.
In the present embodiment, the first cascade convolutional neural networks are the grade obtained according to the second cascade convolutional neural networks training Join convolutional neural networks, the first cascade convolutional neural networks and the second cascade convolutional neural networks are by M convolutional neural networks It cascades, the complexity of M convolutional neural networks in the first cascade convolutional neural networks and the second cascade convolutional neural networks Successively increase, first cascade convolutional neural networks complexity less than second cascade convolutional neural networks complexity, M be greater than Or the integer equal to 3.Since the complexity of the first cascade convolutional neural networks is lower, the first cascade convolutional neural networks Network structure it is fairly simple, image detection efficiency can be improved;Although in addition, the network knot of the first cascade convolutional neural networks Structure is fairly simple, but since the first cascade convolutional neural networks are according to the higher second cascade convolutional neural networks instruction of complexity It gets, will not influence the detection accuracy of the first cascade convolutional neural networks, so as to improve image detection efficiency It will not influence image detection accuracy simultaneously.
Referring to Fig. 5, Fig. 5 is a kind of signal of concatenated convolutional neural network detection face disclosed by the embodiments of the present invention Figure.Concatenated convolutional neural network in Fig. 5 is cascaded by 3 convolutional neural networks.As shown in figure 5, input picture is inputted After concatenated convolutional neural network, as face in first convolutional neural networks identification image in concatenated convolutional neural network All areas simultaneously export after being labeled, it is seen then that and it include multiple callout box in the image of first convolutional neural networks output, this There may be overlapping between a little callout box, further, since the network structure of first convolutional neural networks is fairly simple, therefore, Detection accuracy is lower.The image including multiple callout box by first convolutional neural networks output inputs second convolution later Neural network, second convolutional neural networks to first convolutional neural networks in image mark out as face region again It is identified, since the accuracy of identification of second convolutional neural networks is higher than the accuracy of identification of first convolutional neural networks, because This, second convolutional neural networks can filter out the region that the part that first convolutional neural networks identifies is not face, As it can be seen that in the image that than first convolutional neural networks of callout box in the image of second convolutional neural networks output export Callout box is few, and the region of mark is also more accurate.The image including callout box that second convolutional neural networks is exported later is defeated Enter third convolutional neural networks, the picture people that third convolutional neural networks mark out second convolutional neural networks in image The region of face identified again, due to third convolutional neural networks accuracy of identification than second convolutional neural networks knowledge Other precision is also high, and therefore, the output of third convolutional neural networks is the facial image for including a callout box, this callout box Most of region of face is marked out, while also including fraction not is the region of face.
In the image detecting method described in Fig. 1, since the complexity of the first cascade convolutional neural networks is lower, because This, the network structure of the first cascade convolutional neural networks is fairly simple, and image detection efficiency can be improved;Although in addition, first The network structure of concatenated convolutional neural network is fairly simple, but since the first cascade convolutional neural networks are higher according to complexity The second cascade convolutional neural networks training obtain, will not influence the detection accuracy of the first cascade convolutional neural networks, thus Image detection accuracy can be will not influence while improving image detection efficiency.
Referring to Fig. 2, Fig. 2 is the flow diagram of another image detecting method provided in an embodiment of the present invention.According to Different demands, certain steps in flow chart shown in Fig. 2 can be split as several steps.As shown in Fig. 2, the image detection Method may comprise steps of.
201, training data is obtained.
In the present embodiment, it is available for training training data, training data may include image segments collection and Image segments concentrate the first face label and first position label of each image segments.First face label is that user is image The label that segment is beaten, for identifying in image segments with the presence or absence of human face region.For example, including belonging to face in image segments Region in the case where, it does not include belonging to face in image segments that the value of the corresponding first face label of the image segments, which is 1, Region in the case where, the value of the corresponding first face label of the image segments is 0.First position label is that user is image sheet The label that section is beaten can be labeled for marking out the position for belonging to human face region in image segments with box, circle etc.. In the case where image segments include belonging to human face region, there are corresponding first position labels for the image segments, in image sheet Section does not include in the case where belonging to human face region, which is not present corresponding first position label.
202, it using training data and the second cascade convolutional neural networks training concatenated convolutional neural network to be trained, obtains First cascade convolutional neural networks.
In the present embodiment, training data is got, training data and the second cascade convolutional neural networks training can be used Concatenated convolutional neural network to be trained obtains the first cascade convolutional neural networks, can be the first image segments inputting the second level Connection convolutional neural networks obtain the second face label, and the first image segments are inputted concatenated convolutional neural network to be trained and obtain the Three face labels and second position label, according to the first face label, the second face label, third face label, first position Label and second position label calculate total losses, obtain the according to the parameter that total losses optimizes concatenated convolutional neural network to be trained One cascade convolutional neural networks.First image segments are any image segment of image segments collection, the second cascade convolutional Neural net Network is preparatory trained concatenated convolutional neural network.The loss function of concatenated convolutional neural network to be trained includes point of face The recurrence loss function of class loss function and face location frame (i.e. callout box).Classification Loss function can be softmax function, It may be other Classification Loss functions, this embodiment is not limited.Returning loss function can be L1 loss function, can also be with It can also be other recurrence loss functions, this embodiment is not limited for L2 loss function.Second face label and third face Label is the value between 0 to 1 for identifying the probability that image segments belong to human face region.Second position label is for identifying mark The registration of the position for belonging to human face region and first position label in the image segments outpoured is the value between 0 to 1.Its In, the second face label, third face label and second position label are all the value after normalization, i.e., the multiple figures inputted simultaneously The corresponding second face label of photo section, third face label or second position label and be 1.
In the present embodiment, classification damage can be calculated according to the first face label, the second face label and third face label It loses, i.e., Classification Loss is calculated according to the first face label, the second face label, third face label and Classification Loss function.It can To be to calculate the first Classification Loss according to the first face label and third face label, i.e., according to the first face label, the third party Face label and Classification Loss function calculate the first Classification Loss.Second point is calculated according to the second face label and third face label Class loss, i.e., calculate the second Classification Loss according to the second face label, third face label and Classification Loss function.Basis later First Classification Loss and the second Classification Loss calculate Classification Loss, can be by the weighting of the first Classification Loss and the second Classification Loss Be determined as Classification Loss, how weight distributes, and can according to need setting, this embodiment is not limited.Meanwhile it can basis First position label and second position label, which calculate, returns loss, i.e., according to first position label, second position label and recurrence Loss function, which calculates, returns loss.Later according to Classification Loss and recurrence costing bio disturbance total losses, by Classification Loss and can return The weighted sum of loss is returned to be determined as total losses, how weight distributes, and can according to need setting, this embodiment is not limited.
It, can be according to i-th of convolution mind in the first face label and concatenated convolutional neural network to be trained in the present embodiment Face label through network output calculates the i-th 1 Classification Loss, according to i-th of convolutional Neural in the second cascade convolutional neural networks The face label meter of i-th of convolutional neural networks output in the face label of network output and concatenated convolutional neural network to be trained The i-th 2 Classification Loss are calculated, calculate the i-th Classification Loss according to the i-th 1 Classification Loss and the i-th 2 Classification Loss later.According to first position The location tags that i-th of convolutional neural networks exports in label and concatenated convolutional neural network to be trained calculate i-th and return damage It loses.Costing bio disturbance i-th is returned according to the i-th Classification Loss and i-th later to lose, and is optimized according to the i-th loss and cascaded to training The parameter of i-th of convolutional neural networks obtains the first cascade convolutional neural networks in convolutional neural networks, it is seen then that cascades to training Different convolutional neural networks have different losses in convolutional neural networks, their parameter is carried out using respective loss respectively Optimization.I is the integer greater than 0 and less than M+1.
203, image to be detected is obtained.
In the present embodiment, when needing to identify the face in image, image to be detected is obtained.Image to be detected can be this The image of ground storage is also possible to the image obtained from network or server, can also be through image acquisition device Image, this embodiment is not limited.Wherein, image to be detected can be all images for needing to identify, be also possible to need to know One or more image in other image.
204, the position of face in image to be detected is detected using the first cascade convolutional neural networks.
In the present embodiment, after getting image to be detected, mapping to be checked is detected using the first cascade convolutional neural networks The position of face as in, i.e., by image to be detected input the first cascade convolutional neural networks, there are faces in image to be detected In the case where, the first cascade convolutional neural networks output marks out image to be detected of face, is not present in image to be detected In the case where face, the first cascade convolutional neural networks are not exported.Wherein it is possible to mark out face using box, circle etc.. The all areas of face can be marked out, most of region of face can also be marked out.
In the present embodiment, the first cascade convolutional neural networks are the grade obtained according to the second cascade convolutional neural networks training Join convolutional neural networks, the first cascade convolutional neural networks and the second cascade convolutional neural networks are by M convolutional neural networks It cascades, the complexity of M convolutional neural networks in the first cascade convolutional neural networks and the second cascade convolutional neural networks Successively increase, first cascade convolutional neural networks complexity less than second cascade convolutional neural networks complexity, M be greater than Or the integer equal to 3.Since the complexity of the first cascade convolutional neural networks is lower, the first cascade convolutional neural networks Network structure it is fairly simple, image detection efficiency can be improved;Although in addition, the network knot of the first cascade convolutional neural networks Structure is fairly simple, but since the first cascade convolutional neural networks are according to the higher second cascade convolutional neural networks instruction of complexity It gets, will not influence the detection accuracy of the first cascade convolutional neural networks, so as to improve image detection efficiency It will not influence image detection accuracy simultaneously.
Referring to Fig. 5, Fig. 5 is a kind of signal of concatenated convolutional neural network detection face disclosed by the embodiments of the present invention Figure.Concatenated convolutional neural network in Fig. 5 is cascaded by 3 convolutional neural networks.As shown in figure 5, input picture is inputted After concatenated convolutional neural network, as face in first convolutional neural networks identification image in concatenated convolutional neural network All areas simultaneously export after being labeled, it is seen then that and it include multiple callout box in the image of first convolutional neural networks output, this There may be overlapping between a little callout box, further, since the network structure of first convolutional neural networks is fairly simple, therefore, Detection accuracy is lower.The image including multiple callout box by first convolutional neural networks output inputs second convolution later Neural network, second convolutional neural networks to first convolutional neural networks in image mark out as face region again It is identified, since the accuracy of identification of second convolutional neural networks is higher than the accuracy of identification of first convolutional neural networks, because This, second convolutional neural networks can filter out the region that the part that first convolutional neural networks identifies is not face, As it can be seen that in the image that than first convolutional neural networks of callout box in the image of second convolutional neural networks output export Callout box is few, and the region of mark is also more accurate.The image including callout box that second convolutional neural networks is exported later is defeated Enter third convolutional neural networks, the picture people that third convolutional neural networks mark out second convolutional neural networks in image The region of face identified again, due to third convolutional neural networks accuracy of identification than second convolutional neural networks knowledge Other precision is also high, and therefore, the output of third convolutional neural networks is the facial image for including a callout box, this callout box Most of region of face is marked out, while also including fraction not is the region of face.
In the image detecting method described in Fig. 2, since the complexity of the first cascade convolutional neural networks is lower, because This, the network structure of the first cascade convolutional neural networks is fairly simple, and image detection efficiency can be improved;Although in addition, first The network structure of concatenated convolutional neural network is fairly simple, but since the first cascade convolutional neural networks are higher according to complexity The second cascade convolutional neural networks training obtain, will not influence the detection accuracy of the first cascade convolutional neural networks, thus Image detection accuracy can be will not influence while improving image detection efficiency.
Referring to Fig. 3, Fig. 3 is a kind of structural schematic diagram of image detection device provided in an embodiment of the present invention.Such as Fig. 3 institute Show, which may include:
First acquisition unit 301, for obtaining image to be detected;
Detection unit 302, the mapping to be checked obtained using the first cascade convolutional neural networks detection first acquisition unit 301 The position of face as in;
First cascade convolutional neural networks are the concatenated convolutional nerve obtained according to the second cascade convolutional neural networks training Network, the first cascade convolutional neural networks and the second cascade convolutional neural networks are cascaded by M convolutional neural networks, the For the complexity of one cascade convolutional neural networks less than the complexity of the second cascade convolutional neural networks, M is whole more than or equal to 3 Number.
As a kind of possible embodiment, which can also include:
Second acquisition unit 303, for obtaining training data, training data includes image segments collection and image segments collection In each image segments the first face label and first position label;
Input unit 304, for obtaining the second face mark for the first image segments input the second cascade convolutional neural networks Label, the first image segments are any image segment for the image segments collection that second acquisition unit 303 obtains, the second concatenated convolutional mind It is trained concatenated convolutional neural network through network;
Input unit 304 is also used to inputting the first image segments into concatenated convolutional neural network to be trained, obtains the third party Face label and second position label;
Computing unit 305, the first face label, input unit 304 for being obtained according to second acquisition unit 303 obtain The second face label, third face label, first position label and second position label, calculate total losses;
Optimize unit 306, the total losses for calculating according to computing unit 305 optimizes concatenated convolutional neural network to be trained Parameter, obtain the first cascade convolutional neural networks.
Specifically, detection unit 302 is obtained using the first cascade convolutional neural networks detection first that optimization unit 306 obtains The face in image to be detected for taking unit 301 to obtain.
As a kind of possible embodiment, computing unit 305 is specifically used for:
According to the first face label, the second face label and third face label, Classification Loss is calculated;
According to first position label and second position label, calculates and return loss;
According to Classification Loss and loss is returned, calculates total losses.
As a kind of possible embodiment, computing unit 305 is according to the first face label, the second face label and third Face label, calculating Classification Loss includes:
According to the first face label and third face label, the first Classification Loss is calculated;
According to the second face label and third face label, the second Classification Loss is calculated;
According to the first Classification Loss and the second Classification Loss, Classification Loss is calculated.
As a kind of possible embodiment, computing unit 305 is calculated according to the first face label and third face label First Classification Loss includes:
The face exported according to i-th of convolutional neural networks in the first face label and concatenated convolutional neural network to be trained Label, calculates the i-th 1 Classification Loss, and i is greater than 0 and to be less than the integer of M+1;
According to the second face label and third face label, calculate the second Classification Loss includes: computing unit 305
It is cascaded according to the face label of i-th of convolutional neural networks output in the second cascade convolutional neural networks and to training The face label that i-th of convolutional neural networks exports in convolutional neural networks calculates the i-th 2 Classification Loss;
According to the first Classification Loss and the second Classification Loss, calculate Classification Loss includes: computing unit 305
According to the i-th 1 Classification Loss and the i-th 2 Classification Loss, the i-th Classification Loss is calculated.
As a kind of possible embodiment, computing unit 305 is calculated according to first position label and second position label Returning loss includes:
The position exported according to i-th of convolutional neural networks in first position label and concatenated convolutional neural network to be trained Label calculates i-th and returns loss;
Computing unit 305 is according to Classification Loss and returns loss, calculates total losses and includes:
Loss is returned according to the i-th Classification Loss and i-th, calculates the i-th loss;
Optimize unit 306, specifically for optimizing i-th of convolution in concatenated convolutional neural network to be trained according to the i-th loss The parameter of neural network obtains the first cascade convolutional neural networks.
Related above-mentioned first acquisition unit 301, second acquisition unit 303, input unit 304, calculates detection unit 302 Unit 305 and optimization unit 306 more detailed description can be directly with reference to the phases in above-mentioned Fig. 1-embodiment of the method shown in Fig. 2 It closes description to directly obtain, is not added repeats here.
Referring to Fig. 4, Fig. 4 is the structural schematic diagram of another image detection device provided in an embodiment of the present invention.Such as Fig. 4 Shown, which may include processor 401, memory 402 and bus 403.Processor 401 can be one and lead to With central processing unit (CPU) or multiple CPU, monolithic or muti-piece graphics processor (GPU), microprocessor, the integrated electricity of specific application Road (application-specific integrated circuit, ASIC), or it is one or more for controlling present invention side The integrated circuit that case program executes.Memory 402 can be read-only memory (read-only memory, ROM) or can store The other kinds of static storage device of static information and instruction, random access memory (random access memory, RAM) or the other kinds of dynamic memory of information and instruction can be stored, is also possible to the read-only storage of electric erazable programmable Device (Electrically Erasable Programmable Read-Only Memory, EEPROM), CD-ROM (Compact Disc Read-Only Memory, CD-ROM) or other optical disc storages, optical disc storage (including compression optical disc, swash Optical disc, optical disc, Digital Versatile Disc, Blu-ray Disc etc.), magnetic disk storage medium or other magnetic storage apparatus or can use In carry or storage have instruction or data structure form desired program code and can by computer access it is any its His medium, but not limited to this.Memory 402, which can be, to be individually present, and can also be integrated with processor 401.Bus 403 It is connected with processor 401.Bus 403 transmits information between said modules.Wherein:
Batch processing code is stored in memory 402, processor 401 is for calling the program stored in memory 402 Code executes following operation:
Obtain image to be detected;
The position of face in image to be detected is detected using the first cascade convolutional neural networks;
First cascade convolutional neural networks are the concatenated convolutional nerve obtained according to the second cascade convolutional neural networks training Network, the first cascade convolutional neural networks and the second cascade convolutional neural networks are cascaded by M convolutional neural networks, the For the complexity of one cascade convolutional neural networks less than the complexity of the second cascade convolutional neural networks, M is whole more than or equal to 3 Number.
As a kind of possible embodiment, processor 401 is also used to that the program code stored in memory 402 is called to hold The following operation of row:
Training data is obtained, training data includes first that image segments collection and image segments concentrate each image segments Face label and first position label;
By the first image segments input the second cascade convolutional neural networks, the second face label, the first image segments are obtained For any image segment of image segments collection, the second cascade convolutional neural networks are trained concatenated convolutional neural networks;
First image segments are inputted into concatenated convolutional neural network to be trained, obtain third face label and second position mark Label;
It is marked according to the first face label, the second face label, third face label, first position label and the second position Label calculate total losses;
The parameter for optimizing concatenated convolutional neural network to be trained according to total losses obtains the first cascade convolutional neural networks.
As a kind of possible embodiment, processor 401 is according to the first face label, the second face label, the third party Face label, first position label and second position label, calculating total losses includes:
According to the first face label, the second face label and third face label, Classification Loss is calculated;
According to first position label and second position label, calculates and return loss;
According to Classification Loss and loss is returned, calculates total losses.
As a kind of possible embodiment, processor is according to the first face label, the second face label and third face Label, calculating Classification Loss includes:
According to the first face label and third face label, the first Classification Loss is calculated;
According to the second face label and third face label, the second Classification Loss is calculated;
According to the first Classification Loss and the second Classification Loss, Classification Loss is calculated.
As a kind of possible embodiment, processor 401 is according to the first face label and third face label, calculates the One Classification Loss includes:
The face exported according to i-th of convolutional neural networks in the first face label and concatenated convolutional neural network to be trained Label, calculates the i-th 1 Classification Loss, and i is greater than 0 and to be less than the integer of M+1;
According to the second face label and third face label, calculate the second Classification Loss includes: processor 401
It is cascaded according to the face label of i-th of convolutional neural networks output in the second cascade convolutional neural networks and to training The face label that i-th of convolutional neural networks exports in convolutional neural networks calculates the i-th 2 Classification Loss;
According to the first Classification Loss and the second Classification Loss, calculate Classification Loss includes: processor 401
According to the i-th 1 Classification Loss and the i-th 2 Classification Loss, the i-th Classification Loss is calculated.
As a kind of possible embodiment, processor 401 calculates back according to first position label and second position label The loss is returned to include:
The position exported according to i-th of convolutional neural networks in first position label and concatenated convolutional neural network to be trained Label calculates i-th and returns loss;
Processor 401 is according to Classification Loss and returns loss, calculates total losses and includes:
Loss is returned according to the i-th Classification Loss and i-th, calculates the i-th loss;
Processor 401 optimizes the parameter of concatenated convolutional neural network to be trained according to total losses, obtains the first concatenated convolutional Neural network includes:
Optimize the parameters of i-th of convolutional neural networks in concatenated convolutional neural network to be trained according to the i-th loss, obtains the One cascade convolutional neural networks.
A kind of readable storage medium storing program for executing is provided in one embodiment, which is used to store application program, Application program for executing the image detecting method of Fig. 1 or Fig. 2 at runtime.
A kind of application program is provided in one embodiment, and the application program for executing Fig. 1's or Fig. 2 at runtime Image detecting method.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can It is completed with instructing relevant hardware by program, which can store in computer readable storage medium, and storage is situated between Matter may include: flash disk, read-only memory (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc..
The embodiment of the present invention has been described in detail above, specific case used herein to the principle of the present invention and Embodiment is expounded, and the above description of the embodiment is only used to help understand the method for the present invention and its core ideas; At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the present invention There is change place, in conclusion the contents of this specification are not to be construed as limiting the invention.

Claims (10)

1. a kind of image detecting method characterized by comprising
Obtain image to be detected;
The position of face in described image to be detected is detected using the first cascade convolutional neural networks;
The first cascade convolutional neural networks are the concatenated convolutional nerve obtained according to the second cascade convolutional neural networks training Network, the first cascade convolutional neural networks and the second cascade convolutional neural networks are by M convolutional neural networks grade Joining, the complexity of the first cascade convolutional neural networks is less than the complexity of the second cascade convolutional neural networks, The M is the integer more than or equal to 3.
2. the method according to claim 1, wherein the method also includes:
Training data is obtained, the training data includes that image segments collection and described image segment concentrate each image segments First face label and first position label;
By the first image segments input the second cascade convolutional neural networks, the second face label, the first image segment are obtained For any image segment of described image segment collection, the second cascade convolutional neural networks are trained concatenated convolutional nerves Network;
The first image segment is inputted into concatenated convolutional neural network to be trained, obtains third face label and second position mark Label;
According to the first face label, the second face label, the third face label, the first position label and The second position label calculates total losses;
The parameter for optimizing the concatenated convolutional neural network to be trained according to the total losses obtains the first concatenated convolutional mind Through network.
3. according to the method described in claim 2, it is characterized in that, described according to the first face label, second people Face label, the third face label, the first position label and the second position label, calculating total losses includes:
According to the first face label, the second face label and the third face label, Classification Loss is calculated;
According to the first position label and the second position label, calculates and return loss;
It is lost according to the Classification Loss and the recurrence, calculates total losses.
4. according to the method described in claim 3, it is characterized in that, described according to the first face label, second people Face label and the third face label, calculating Classification Loss includes:
According to the first face label and the third face label, the first Classification Loss is calculated;
According to the second face label and the third face label, the second Classification Loss is calculated;
According to first Classification Loss and second Classification Loss, Classification Loss is calculated.
5. according to the method described in claim 4, it is characterized in that, described according to the first face label and the third party Face label, calculating the first Classification Loss includes:
According to i-th of convolutional neural networks output in the first face label and the concatenated convolutional neural network to be trained Face label, calculates the i-th 1 Classification Loss, and the i is greater than 0 and to be less than the integer of M+1;
It is described according to the second face label and the third face label, calculating the second Classification Loss includes:
According to the face label of i-th convolutional neural networks output in the second cascade convolutional neural networks and described wait train The face label that i-th of convolutional neural networks exports in concatenated convolutional neural network calculates the i-th 2 Classification Loss;
It is described according to first Classification Loss and second Classification Loss, calculating Classification Loss includes:
According to the i-th 1 Classification Loss and the i-th 2 Classification Loss, the i-th Classification Loss is calculated.
6. according to the method described in claim 5, it is characterized in that, described according to the first position label and the second Label is set, calculating recurrence loss includes:
According to i-th of convolutional neural networks output in the first position label and the concatenated convolutional neural network to be trained Location tags calculate i-th and return loss;
Described to be lost according to the Classification Loss and the recurrence, calculating total losses includes:
Loss is returned according to i-th Classification Loss and described i-th, calculates the i-th loss;
The parameter for optimizing the concatenated convolutional neural network to be trained according to the total losses obtains the first cascade volume Accumulating neural network includes:
The parameter for optimizing i-th of convolutional neural networks in the concatenated convolutional neural network to be trained according to i-th loss, obtains To the first cascade convolutional neural networks.
7. a kind of image detection device characterized by comprising
First acquisition unit, for obtaining image to be detected;
Detection unit, for detecting people in image to be detected that the acquiring unit obtains using the first cascade convolutional neural networks The position of face;
The first cascade convolutional neural networks are the concatenated convolutional nerve obtained according to the second cascade convolutional neural networks training Network, the first cascade convolutional neural networks and the second cascade convolutional neural networks are by M convolutional neural networks grade Joining, the complexity of the first cascade convolutional neural networks is less than the complexity of the second cascade convolutional neural networks, The M is the integer more than or equal to 3.
8. device according to claim 7, which is characterized in that described device further include:
Second acquisition unit, for obtaining training data, the training data includes image segments collection and described image segment Concentrate the first face label and first position label of each image segments;
Input unit, it is described for obtaining the second face label for the first image segments input the second cascade convolutional neural networks First image segments are any image segment for the image segments collection that the second acquisition unit obtains, second concatenated convolutional Neural network is trained concatenated convolutional neural network;
The input unit is also used to inputting the first image segment into concatenated convolutional neural network to be trained, obtains third Face label and second position label;
Computing unit, the first face label, the input unit for being obtained according to the second acquisition unit obtain Two face labels, the third face label, the first position label and the second position label calculate total losses;
Optimize unit, for optimizing the concatenated convolutional neural network to be trained according to the received total losses of the computing unit Parameter obtains the first cascade convolutional neural networks.
9. a kind of image detection device, which is characterized in that including processor and memory, the processor and the memory phase It connects, wherein the memory is for storing computer program, and the computer program includes program instruction, the processing Device is for calling the described program instruction execution such as described in any item image detecting methods of claim 1-7.
10. a kind of storage medium, which is characterized in that the storage medium is stored with computer program, the computer program packet Program instruction is included, described program instruction executes the processor such as any one of claim 1-7 institute The image detecting method stated.
CN201811596614.5A 2018-12-26 2018-12-26 A kind of image detecting method and device Pending CN109886073A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811596614.5A CN109886073A (en) 2018-12-26 2018-12-26 A kind of image detecting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811596614.5A CN109886073A (en) 2018-12-26 2018-12-26 A kind of image detecting method and device

Publications (1)

Publication Number Publication Date
CN109886073A true CN109886073A (en) 2019-06-14

Family

ID=66925191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811596614.5A Pending CN109886073A (en) 2018-12-26 2018-12-26 A kind of image detecting method and device

Country Status (1)

Country Link
CN (1) CN109886073A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879972A (en) * 2019-10-24 2020-03-13 深圳云天励飞技术有限公司 Face detection method and device
CN112492323A (en) * 2019-09-12 2021-03-12 上海哔哩哔哩科技有限公司 Live broadcast mask generation method, readable storage medium and computer equipment
CN113239631A (en) * 2021-06-07 2021-08-10 昆明理工大学 Modeling method and system for improving complex dynamic scene segmentation

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650699A (en) * 2016-12-30 2017-05-10 中国科学院深圳先进技术研究院 CNN-based face detection method and device
CN107239736A (en) * 2017-04-28 2017-10-10 北京智慧眼科技股份有限公司 Method for detecting human face and detection means based on multitask concatenated convolutional neutral net
CN107688786A (en) * 2017-08-30 2018-02-13 南京理工大学 A kind of method for detecting human face based on concatenated convolutional neutral net
CN108052940A (en) * 2017-12-17 2018-05-18 南京理工大学 SAR remote sensing images waterborne target detection methods based on deep learning
CN108229534A (en) * 2017-11-28 2018-06-29 北京市商汤科技开发有限公司 Neural network model moving method and system, electronic equipment, program and medium
CN108229651A (en) * 2017-11-28 2018-06-29 北京市商汤科技开发有限公司 Neural network model moving method and system, electronic equipment, program and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650699A (en) * 2016-12-30 2017-05-10 中国科学院深圳先进技术研究院 CNN-based face detection method and device
CN107239736A (en) * 2017-04-28 2017-10-10 北京智慧眼科技股份有限公司 Method for detecting human face and detection means based on multitask concatenated convolutional neutral net
CN107688786A (en) * 2017-08-30 2018-02-13 南京理工大学 A kind of method for detecting human face based on concatenated convolutional neutral net
CN108229534A (en) * 2017-11-28 2018-06-29 北京市商汤科技开发有限公司 Neural network model moving method and system, electronic equipment, program and medium
CN108229651A (en) * 2017-11-28 2018-06-29 北京市商汤科技开发有限公司 Neural network model moving method and system, electronic equipment, program and medium
CN108052940A (en) * 2017-12-17 2018-05-18 南京理工大学 SAR remote sensing images waterborne target detection methods based on deep learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
余飞等: ""多级联卷积神经网络人脸检测"", 《五邑大学学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112492323A (en) * 2019-09-12 2021-03-12 上海哔哩哔哩科技有限公司 Live broadcast mask generation method, readable storage medium and computer equipment
CN112492323B (en) * 2019-09-12 2022-07-19 上海哔哩哔哩科技有限公司 Live broadcast mask generation method, readable storage medium and computer equipment
CN110879972A (en) * 2019-10-24 2020-03-13 深圳云天励飞技术有限公司 Face detection method and device
CN113239631A (en) * 2021-06-07 2021-08-10 昆明理工大学 Modeling method and system for improving complex dynamic scene segmentation

Similar Documents

Publication Publication Date Title
CN108229555B (en) Sample weights distribution method, model training method, electronic equipment and storage medium
CN108595585B (en) Sample data classification method, model training method, electronic equipment and storage medium
CN108875522A (en) Face cluster methods, devices and systems and storage medium
CN103995889B (en) Picture classification method and device
CN107480730A (en) Power equipment identification model construction method and system, the recognition methods of power equipment
CN109447169A (en) The training method of image processing method and its model, device and electronic system
CN109829371A (en) A kind of method for detecting human face and device
CN110399890A (en) Image-recognizing method, device, electronic equipment and readable storage medium storing program for executing
CN109886073A (en) A kind of image detecting method and device
CN109784381A (en) Markup information processing method, device and electronic equipment
CN109697434A (en) A kind of Activity recognition method, apparatus and storage medium
CN110532894A (en) Remote sensing target detection method based on boundary constraint CenterNet
CN110084165A (en) The intelligent recognition and method for early warning of anomalous event under the open scene of power domain based on edge calculations
CN109117879A (en) Image classification method, apparatus and system
CN110348441A (en) VAT invoice recognition methods, device, computer equipment and storage medium
CN110287873A (en) Noncooperative target pose measuring method, system and terminal device based on deep neural network
CN110047095A (en) Tracking, device and terminal device based on target detection
CN112819110B (en) Incremental small sample target detection method and system based on weight generation
CN107358182A (en) Pedestrian detection method and terminal device
CN110490238A (en) A kind of image processing method, device and storage medium
CN109035579A (en) A kind of commodity recognition method, self-service machine and computer readable storage medium
CN110490052A (en) Face datection and face character analysis method and system based on cascade multi-task learning
CN108229418A (en) Human body critical point detection method and apparatus, electronic equipment, storage medium and program
CN108875481A (en) Method, apparatus, system and storage medium for pedestrian detection
CN103093208A (en) Method and system for fruit and vegetable recognition

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

Application publication date: 20190614

RJ01 Rejection of invention patent application after publication