CN113947780B - Sika face recognition method based on improved convolutional neural network - Google Patents
Sika face recognition method based on improved convolutional neural network Download PDFInfo
- Publication number
- CN113947780B CN113947780B CN202111161433.1A CN202111161433A CN113947780B CN 113947780 B CN113947780 B CN 113947780B CN 202111161433 A CN202111161433 A CN 202111161433A CN 113947780 B CN113947780 B CN 113947780B
- Authority
- CN
- China
- Prior art keywords
- sika
- face
- layer
- data set
- deer
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000013527 convolutional neural network Methods 0.000 title claims abstract description 19
- 241000283007 Cervus nippon Species 0.000 claims abstract description 105
- 238000012549 training Methods 0.000 claims abstract description 53
- 238000012360 testing method Methods 0.000 claims abstract description 35
- 238000001514 detection method Methods 0.000 claims abstract description 21
- 230000001815 facial effect Effects 0.000 claims abstract description 20
- 238000003709 image segmentation Methods 0.000 claims abstract description 15
- 238000005457 optimization Methods 0.000 claims abstract description 3
- 230000006870 function Effects 0.000 claims description 25
- 239000013598 vector Substances 0.000 claims description 21
- 238000012795 verification Methods 0.000 claims description 13
- 238000011176 pooling Methods 0.000 claims description 12
- 238000010606 normalization Methods 0.000 claims description 9
- 241000282994 Cervidae Species 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 7
- 238000000605 extraction Methods 0.000 claims description 6
- 238000012544 monitoring process Methods 0.000 claims description 6
- 230000006835 compression Effects 0.000 claims description 4
- 238000007906 compression Methods 0.000 claims description 4
- 230000005284 excitation Effects 0.000 claims description 4
- 238000011478 gradient descent method Methods 0.000 claims description 3
- 238000007781 pre-processing Methods 0.000 claims description 3
- 210000005069 ears Anatomy 0.000 claims description 2
- 210000001508 eye Anatomy 0.000 claims description 2
- 210000001331 nose Anatomy 0.000 claims description 2
- 241001465754 Metazoa Species 0.000 description 20
- 238000005516 engineering process Methods 0.000 description 9
- 238000009395 breeding Methods 0.000 description 7
- 230000001488 breeding effect Effects 0.000 description 7
- 238000010801 machine learning Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 230000006378 damage Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000036541 health Effects 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 241000283690 Bos taurus Species 0.000 description 1
- 241000282887 Suidae Species 0.000 description 1
- 208000027418 Wounds and injury Diseases 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000001125 extrusion Methods 0.000 description 1
- 210000003128 head Anatomy 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 208000014674 injury Diseases 0.000 description 1
- 244000144972 livestock Species 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000003938 response to stress Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/047—Probabilistic or stochastic networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Probability & Statistics with Applications (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to a sika face recognition method based on an improved convolutional neural network. The sika face recognition method based on the improved convolutional neural network comprises the following steps: detecting individual sika deer by using a target detection model, storing individual picture of sika deer, intercepting facial image of sika deer from the picture, and classifying and storing according to individual labels; dividing sika face data by using an image segmentation model to obtain a sika face data set without background interference; SE-ResNet of an AM-Softmax loss function is used as a backbone network to construct a sika face recognition model: extracting facial features of the sika deer by using the improved network, inputting the features extracted by the network into a Softmax classifier for classification and identification of individual sika deer, training a network model by using a training set, and performing parameter adjustment optimization on the improved convolutional network model; and testing the identification performance of the network model by using the test set. The method has stronger robustness in identifying the image features with higher similarity, and realizes the individual identification of the non-contact sika deer.
Description
Technical Field
The application relates to the field of computer vision, in particular to a sika face recognition method based on an improved convolutional neural network.
Background
Along with the increase of the breeding quantity of sika deer in Jilin province of China, the precise and intelligent management of the sika deer is urgent, and sika deer individual identification is the basis for realizing the precise management. The sika deer is taken as a semi-wild animal, so that individual identification is very difficult, and along with the continuous development of machine learning, the application of machine learning to identify animal individuals can effectively improve the automation degree of sika deer individual identification and reduce the sika deer breeding cost. In recent years, animal face recognition technology has become a focus of attention of students as a new research direction in the field of machine learning. Facial recognition is one of the biological recognition technologies, and has the advantages of low cost, high reliability and the like. Compared with ear tags and ear numbers, the identification technology based on animal facial features is more beneficial to animal health, so that people pay attention. The individual animals in the farm are identified by the face identification technology so as to achieve the aim of tracking and breeding, so that the contactless monitoring of the sika deer by the face identification technology has important significance in the aspect of precise and intelligent breeding of the sika deer. At present, in the livestock breeding industry, animal face recognition technology is widely applied to animal recognition of pigs, cattle and the like with large face difference, and researches on animals with high face similarity such as sika deer are still fresh.
Disclosure of Invention
Aiming at the defects existing in the prior art, the application provides a sika face recognition method based on an improved convolutional neural network. The application adopts the technical means as follows: in order to solve the technical problems or at least partially solve the technical problems, the application provides a sika deer face recognition method based on an improved convolutional neural network.
The application provides a sika deer face recognition method based on an improved convolutional neural network, which is characterized by comprising the following steps of; the method comprises the following steps:
Step (1), sika deer target detection; detecting sika deer in a video by using a YOLO target detection model, positioning each interested sika deer target individual, intercepting the face image of each target sika deer by using an image tool, and respectively storing the face image of each target sika deer into a sika deer face data set according to individual labels of the sika deer;
Step (2), image segmentation; image segmentation is carried out on the face image of each target sika in the sika face data set, so that sika face pictures with a plurality of single backgrounds are obtained; step (3), constructing a sika face training dataset for model training based on a plurality of sika face pictures with single background, dividing the sika face training dataset into a training dataset and a verification dataset, and simultaneously establishing a test dataset;
Step (4), preprocessing an image; carrying out data enhancement on each sika face picture in the sika face training data set to obtain a training data set, a verification data set and a test data set after data enhancement;
Step (5), constructing a sika face recognition network model; constructing a sika face recognition network model for extracting sika face features based on the improved residual training network, and adopting AM-Softmax as a loss function of an output layer of the sika face recognition network model; step (6), training the sika face recognition network model and parameter adjustment optimization by using the sika face training data set with the enhanced data and adopting a gradient descent method, and obtaining network weight parameters after verification by the verification data set with the enhanced data;
Step (7), during testing, the sika face recognition network model is tested by utilizing the test data set with enhanced data, model parameters of the sika face recognition network model are the network weight parameters, and when the test passes, training of the sika face recognition network model is determined to be completed;
And (8) during identification, inputting the acquired sika deer face picture into the sika deer face identification network model, and outputting an identification result by the sika deer face identification network model, wherein the identification result comprises sika deer individual tags.
The specific implementation method of the step (1) comprises the following steps: detecting the position of a sika deer in a video by adopting a YOLO model, intercepting facial pictures of the sika deer of a target in the video, storing the facial pictures in a numbered folder corresponding to individual labels of the sika deer of the target, and selecting a data set to be identified by the following modes:
DEER={deti|Adeti>At,labeldeti=deer;i=0,1,2...n}
The DEER represents an image set to be identified, represents an area of an object detection result, represents a defined area threshold, and is set to be capable of selecting sika DEER in a video by utilizing the At threshold, represents names of the object detection results, represents the number of the object detection results of an image sequence, selects each object detection result, wherein the object name is sika DEER, and if the detected sika DEER individual area is larger than the picture area, cuts sika DEER face pictures in the pictures and stores the sika DEER face pictures in folders with corresponding numbers for identification.
The specific implementation method of the step (2) comprises the following steps: and performing image segmentation on the facial images in the sika deer facial data set by using a Unet image segmentation model to obtain the sika deer facial data set with a single background from which interference is removed.
The specific implementation method of the step (3) comprises the following steps: and (3) the sika face data set obtained in the step (2) is processed according to the following steps: 2 is randomly divided into a training data set and a verification data set, and a part of clear image of each sika deer is selected from the whole sika deer face data set to be used as a test data set, wherein the sika deer face test data set is used for testing.
The specific implementation method of the step (5) comprises the following steps: the improved residual training network comprises four se-layer modules, and all the se-layer modules have the same structure;
the input image is firstly input into a convolution layer with the channel number of 64 and the size of 7*7, and original image information is reserved while the channel number is not increased; then, a maximum pooling layer with the channel number of 64 and the step length of 2 and 3*3 is entered, the picture is subjected to feature extraction, the picture is compressed, then the first se-layer, the second se-layer, the third se-layer and the fourth se-layer are sequentially connected, a se module is connected behind each layer, feature information obtained by each layer is subjected to compression excitation to extract target features such as ears, noses and eyes, and the target features are subjected to feature extraction; then, a global average pooling layer with the step length of 1, the size of 7*7 and the channel number of 2048 is utilized to optimize a network structure, a multi-dimensional feature matrix is changed into a one-dimensional feature sequence through a flat layer and is led into a full-connection layer, in order to prevent over fitting, a dropout layer is added into the full-connection layer, and generalization and over fitting resistance of a model are improved; obtaining 2048 feature vectors through the full connection layer; finally, outputting individual sika deer by using a Softmax classifier; the number of ResBlock modules in the four se-layers is 3, 4, 6 and 3 respectively, the ResBlock modules are used for extracting the important characteristics, the Softmax classification layer is used for classification, and the convolution layer comprises a convolution kernel (Conv 2 d), a normalization layer (BatchNorm d) and an activation layer (ELU).
The first se-layer module comprises 3 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one convolution layer with the size of 3×3;
the second se-layer module comprises 4 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one convolution layer with the size of 3×3;
The third se-layer module comprises 6 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one with the size of 3×3;
the fourth se-layer module comprises 3 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one with the size of 3×3;
The specific implementation method of the step (5) comprises the following steps: the short circuit part in ResBlock uses a maximum pooling layer with a step length of 2 and a convolution kernel of 3*3, the maximum pooling layer is connected with a convolution layer with a step length of 1 and a convolution kernel of 1*1 and a batch normalization layer, information loss during network training is reduced, and the sika face recognition network models all use ELU activation functions.
The specific implementation method of the step (5) comprises the following steps: the AM-Softmax expression is as follows:
Wherein LAM is a loss function, s is a scaling factor, which means that there is a label classification, the label classification is the first label classification, the output is the second dimension, and the output is the other output after removal, c is the total number of the other outputs after removal, W is a weight vector, x is a feature vector, and is an included angle between the feature vector x and the weight vector W; m is a constant, controlling the gap between classes; the AM-Softmax loss function specifically comprises the following implementation flow: the product between the feature vector x and a full connection layer W is equal to the cosine distance after normalization of the features and the weights, an angle between the feature vector and the target weight is calculated by using an inverse cosine function, then an angle margin m is subtracted from the target angle, and then s.cosθ is obtained by rescaling with fixed s.
The specific implementation method of the step (6) comprises the following steps: training the sika face recognition network model by using the training data set, monitoring convergence of a loss function value during training of the sika face recognition network model, adjusting network model parameters if the loss function value is larger than a set threshold value, and obtaining the network weight parameters if the loss function value is smaller than the set threshold value and is stable in a set interval.
The specific implementation method of the step (7) comprises the following steps: inputting the sika face picture in the test data set into the sika face recognition network model, outputting a prediction result by the sika face recognition network model, comparing the prediction result with sika individual tags corresponding to the sika face picture in the test data set, and if the prediction result is matched with the sika individual tags in the test data set, determining that the test is passed and finishing training; if the identification is wrong, returning to the step (6) to continue training until a trained network model is obtained.
The specific implementation method of the step (8) comprises the following steps: inputting the acquired sika face picture into the sika face recognition network model, and outputting a recognition result by the sika face recognition network model, wherein the recognition result comprises sika individual tags.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the embodiment of the invention, the sika deer in the video is detected by utilizing the YOLO target detection model, the protruding sika deer target is positioned, and then the detected sika deer target is intercepted by using an image tool. Cutting out the head of each sika deer, classifying and storing to obtain a sika deer face data set. And then, carrying out image segmentation on each sika face image in the sika face data set by using a Unet image segmentation model to obtain a sika face segmentation data set with single background and without any interference. The sika face recognition model based on the convolutional neural network is trained by utilizing the sika face data set without background interference, sika individuals are recognized in a contactless manner, the sika is not damaged, the stress of the sika is effectively avoided, the recognition efficiency is high, and the cost is low.
The invention has the beneficial effects that:
The invention has reasonable design, adopts the improved residual error training network to construct the recognition model, introduces the compression module to reduce the size of the original image, solves the time-consuming problem in model training, reserves the image characteristics, and applies the extrusion excitation residual error network to animal face recognition with higher similarity. Under the real breeding environment of the sika deer, more detailed face information can be extracted from the sika deer data set image by utilizing the improved residual error network, the recognition capability is enhanced, and the method has reference significance for animal face recognition with higher similarity.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of an overall implementation of the present invention;
FIG. 2 is a flow chart of an implementation of the present invention involving a SE-ReNet network architecture;
FIG. 3 is a graph showing the accuracy of the improved model and the classical model according to the present invention;
FIG. 4 is a graph comparing the loss function curves of the improved model and the classical model according to the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Currently, animal face recognition technology based on computer vision has become a focus of attention of students as a new research direction in the field of machine learning. This approach saves labor costs as opposed to direct visual observation and manual monitoring, and is viable in large scale animal husbandry. In addition, compared with the ear tag, the ear tag and the electronic sensor, the animal face recognition method based on computer vision has no defects of measuring noise generated by sensor faults, sensor damage or loss caused by non-contact of animals, animal injury and the like; on the contrary, the method not only can effectively avoid the stress response of animals, but also is more beneficial to the health of the animals, so that people pay attention. The animal individuals in the farm are identified through the face identification technology, so that the aim of tracking and breeding is fulfilled, and therefore, the method for carrying out contactless monitoring on the animal individuals through the face identification technology has important significance. Therefore, the embodiment of the invention provides a sika face recognition method based on an improved convolutional neural network.
Fig. 1 is a sika face recognition method based on an improved convolutional neural network, provided by an embodiment of the application, the sika face recognition method based on the improved convolutional neural network includes:
and (3) detecting the sika deer target.
The sika deer in the video is detected by utilizing a YOLO target detection model at multiple angles, each protruding sika deer target individual is positioned, the detected target sika deer application image tool is used for intercepting the face image of each target sika deer, and the face image is stored in a sika deer face data set according to sika deer individual labels;
To detect the position of sika deer in video, YOLO model, a deep learning framework for object detection, is used. The frame realizes real-time target detection rate and meets the real-time requirement of sika deer identification. Facial picture interception is carried out on the sika deer highlighted in the video, the facial picture is stored in a numbered folder corresponding to the sika deer individual tag of the target sika deer, and a data set to be identified is selected by the following modes:
DEER={deti|Adeti>At,labeldeti=deer;i=0,1,2...n}
The DEER represents an image set to be identified, represents an area of an object detection result, represents a defined area threshold, and is set to a value that sika DEER in a video can be selected by using the threshold, the name of the object detection result is represented, the number of the object detection results of an image sequence is represented, each object detection result is selected, the object name is sika DEER, and if the detected sika DEER individual area is larger than the picture area, sika DEER face pictures in the pictures are cut and stored in folders with corresponding numbers for identification.
And (2) image segmentation.
Image segmentation is carried out on the face image of each target sika in the sika face data set, so that sika face pictures with a plurality of single backgrounds are obtained; and performing image segmentation on the facial images in the sika deer facial data set by using a Unet image segmentation model to obtain the sika deer facial data set with a single background from which interference is removed.
Step (3), constructing a sika face data set, constructing a sika face training data set for model training based on a plurality of sika face pictures with single background, and carrying out 8 on the sika face data set obtained in the step (2): 2 is randomly divided into a training data set and a verification data set, and a part of clear image of each sika deer is selected from the whole sika deer face data set to be used as a test data set, wherein the sika deer face test data set is used for testing.
And (4) preprocessing the image.
Performing data enhancement on the sika face data set after removing the background by means of horizontal overturning, vertical overturning, brightness enhancement, brightness reduction and the like to obtain a training data set, a verification data set and a test data set after data enhancement; the data enhancement can effectively reduce the false recognition caused by the position deviation, thereby effectively increasing the face recognition accuracy of the sika deer.
And (5) constructing a sika face recognition network model.
Constructing a sika face recognition network model for extracting sika face features based on the improved residual training network, and adopting AM-Softmax as a loss function of an output layer of the sika face recognition network model;
The improved residual training network comprises four se-layer modules, and all the se-layer modules have the same structure; the input image is firstly input into a convolution layer with the channel number of 64 and the size of 7*7, and original image information is reserved while the channel number is not increased; then, a maximum pooling layer with the channel number of 64 and the step length of 2 is entered, the picture is subjected to feature extraction, the picture is compressed, then the first, second, third and fourth layers are sequentially connected, a se module is connected behind each layer, the feature information obtained by each layer is subjected to compression excitation to extract important features, and the important features are subjected to feature extraction; then, a global average pooling layer with the step length of 1, the size of 7*7 and the channel number of 2048 is utilized to optimize a network structure, a multi-dimensional feature matrix is changed into a one-dimensional feature sequence through a flat layer and is led into a full-connection layer, in order to prevent over fitting, a dropout layer is added into the full-connection layer, and generalization and over fitting resistance of a model are improved; obtaining 2048 feature vectors through the full connection layer; finally, outputting individual sika deer by using a Softmax classifier;
The number of ResBlock modules in the four se-layers is 3,4, 6 and 3 respectively, the ResBlock modules are used for extracting the important characteristics, the Softmax classification layer is used for classification, and the convolution layer comprises a convolution kernel (Conv 2 d), a normalization layer (BatchNorm d) and an activation layer (ELU).
The invention uses ELU as an activation function, which is:
the first se-layer module comprises 3 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one convolution layer with the size of 3×3;
the second se-layer module comprises 4 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one convolution layer with the size of 3×3;
The third se-layer module comprises 6 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one with the size of 3×3;
the fourth se-layer module comprises 3 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one with the size of 3×3;
The short circuit part in ResBlock uses a maximum pooling layer with a step length of 2 and a convolution kernel of 3*3, the maximum pooling layer is connected with a convolution layer with a step length of 1 and a convolution kernel of 1*1 and a batch normalization layer, information loss during network training is reduced, and the sika face recognition network models all use ELU activation functions.
The AM-Softmax expression is as follows:
Wherein s is a scaling factor, which means that there is a label classification, a first label classification, a second dimension output, and other outputs after removal, c is the total number of other outputs after removal, W is a weight vector, x is a feature vector, and is an included angle between the feature vector x and the weight vector W; m is a constant, controlling the gap between classes; the AM-Softmax loss function specifically comprises the following implementation flow: the product between the feature vector x and a full connection layer W is equal to the cosine distance after normalization of the features and the weights, an angle between the feature vector and the target weight is calculated by using an inverse cosine function, then an angle margin m is subtracted from the target angle, and then the angle margin m is obtained by rescaling with fixed s.
Step (6), training the sika face recognition network model by using the training data set and adopting a gradient descent method, and obtaining a weight value of the optimal result through verification; training the recognition network model by using a training data set, monitoring the convergence condition of a loss function value during the recognition network model training, adjusting network model parameters if the loss function value is larger than a set threshold, and obtaining the network weight parameters if the loss function value is smaller than the set threshold and is stable in a set interval.
Step (7), during the test, inputting the sika face picture in the test data set into the sika face recognition network model, outputting a prediction result by the sika face recognition network model, comparing the prediction result with sika individual tags corresponding to the sika face picture in the test data set, and if the prediction result is matched with the sika individual tags in the test data set, determining that the test passes, and finishing training; if the identification is wrong, returning to the step (6) to continue training until a trained network model is obtained.
And (8) during identification, inputting the acquired sika deer face picture into the sika deer face identification network model, and outputting an identification result by the sika deer face identification network model, wherein the identification result comprises sika deer individual tags.
The above example is a specific use flowchart of the present invention in conjunction with fig. 1; FIG. 2 is a flow chart of an implementation of the present invention incorporating a SE-ReNet network architecture; FIG. 3 is a comparison of the accuracy curves of the SE-ResNet and classical Resnet-50, seNet, denseNet and GoogleNet models of the invention, the SE-ResNet of the invention being more accurate and the models being more stable than the other classical models; FIG. 4 is a comparison of the loss function convergence curves of the SE-ResNet and classical Resnet-50, seNet, denseNet and GoogleNet models of the invention, with the SE-ResNet model of the invention having lower losses than the other classical models. Therefore, through improvement of Resnet networks, the accuracy of facial recognition and identification of the sika deer is improved, and the superiority of the sika deer facial recognition method in the field of facial recognition of the sika deer is fully shown. It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (7)
1. A sika deer face recognition method based on an improved convolutional neural network is characterized in that the method comprises the following steps of; the method comprises the following steps:
step (1), sika deer target detection;
Detecting sika deer in a video by using a YOLO target detection model, positioning each interested sika deer target individual, intercepting the face image of each target sika deer by using an image tool, and respectively storing the face image of each target sika deer into a sika deer face data set according to individual labels of the sika deer;
step (2), image segmentation;
Image segmentation is carried out on the face image of each target sika in the sika face data set, so that sika face pictures with a plurality of single backgrounds are obtained;
Step (3), constructing a sika face training dataset for model training based on a plurality of sika face pictures with single background, dividing the sika face training dataset into a training dataset and a verification dataset, and simultaneously establishing a test dataset;
step (4), preprocessing an image;
Carrying out data enhancement on each sika face picture in the sika face training data set to obtain a training data set, a verification data set and a test data set after data enhancement; step (5), constructing a sika face recognition network model;
Constructing a sika face recognition network model for extracting sika face features based on the improved residual training network, and adopting AM-Softmax as a loss function of an output layer of the sika face recognition network model;
the specific implementation method of the step (5) comprises the following steps: the improved residual training network comprises four se-layer modules, and all the se-layer modules have the same structure;
The input image is firstly input into a convolution layer with the channel number of 64 and the size of 7*7, and original image information is reserved while the channel number is not increased; then, a maximum pooling layer with the channel number of 64 and the step length of 2 and 3*3 is entered, the picture is subjected to feature extraction, the picture is compressed, then the first se-layer, the second se-layer, the third se-layer and the fourth se-layer are sequentially connected, a se module is connected behind each layer, feature information obtained by each layer is subjected to compression excitation to extract target features such as ears, noses and eyes, and the target features are subjected to feature extraction; then, a global average pooling layer with the step length of 1, the size of 7*7 and the channel number of 2048 is utilized to optimize a network structure, and in order to prevent overfitting, a dropout layer is added in a full-connection layer, so that generalization and overfitting resistance of a model are improved; obtaining 2048 feature vectors through the full connection layer; finally, outputting individual sika deer by using a Softmax classifier;
The number of ResBlock modules in the four se-layers is 3, 4, 6 and 3 respectively, the ResBlock module is used for extracting important features, the Softmax classification layer is used for classifying, and the convolution layer comprises a convolution kernel Conv2d, a normalization layer BatchNorm d and an activation layer ELU;
The specific implementation method of the step (5) comprises the following steps:
the first se-layer module comprises 3 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one convolution layer with the size of 3×3;
the second se-layer module comprises 4 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one convolution layer with the size of 3×3;
The third se-layer module comprises 6 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one with the size of 3×3;
the fourth se-layer module comprises 3 ResBlock modules and 1 se module, and each ResBlock module consists of two convolution layers with the size of 1×1 and one with the size of 3×3;
The specific implementation method of the step (5) comprises the following steps: the short circuit part in ResBlock uses a maximum pooling layer with a step length of 2 and a convolution kernel of 3*3, the maximum pooling layer is connected with a convolution layer with a step length of 1 and a convolution kernel of 1*1 and a batch normalization layer, and the sika face recognition network models all use ELU activation functions;
Step (6), training the sika face recognition network model and parameter adjustment optimization by using the sika face training data set with the enhanced data and adopting a gradient descent method, and obtaining network weight parameters after verification by the verification data set with the enhanced data;
Step (7), during testing, the sika face recognition network model is tested by utilizing the test data set with enhanced data, model parameters of the sika face recognition network model are the network weight parameters, and when the test passes, training of the sika face recognition network model is determined to be completed;
And (8) during identification, inputting the acquired sika deer face picture into the sika deer face identification network model, and outputting an identification result by the sika deer face identification network model, wherein the identification result comprises sika deer individual tags.
2. The sika face recognition method based on the improved convolutional neural network according to claim 1, wherein the specific implementation method of the step (1) is as follows:
detecting the position of a sika deer in a video by adopting a YOLO model, intercepting a face picture of a target sika deer in the video, storing the face picture in a numbered folder corresponding to individual sika deer tags of the target sika deer, and selecting a data set to be identified by the following modes:
Wherein, DEER represents the image set to be identified, represents the region of det i of the object detection result, A t represents the defined region threshold, the value is set to 0.25× (640×480), sika DEER in the video can be selected by using the threshold, the name of the object detection result is represented, the number of the object detection results of the image sequence is represented, each object detection result is selected, the object name is sika DEER, if the individual area occupation area of the detected sika DEER is larger than the picture area, the sika DEER face picture in the picture is cut and stored in the folder with the corresponding number for identification.
3. The sika face recognition method based on the improved convolutional neural network according to claim 1, wherein the specific implementation method of the step (2) is as follows: and performing image segmentation on the facial images in the sika deer facial data set by using a Unet image segmentation model to obtain the sika deer facial data set with a single background from which interference is removed.
4. The sika face recognition method based on the improved convolutional neural network according to claim 1, wherein the specific implementation method of the step (3) is as follows: and (3) the sika face data set obtained in the step (2) is processed according to the following steps: 2 is randomly divided into a training data set and a verification data set, and a part of clear image of each sika deer is selected from the whole sika deer face data set to be used as a test data set, wherein the sika deer face test data set is used for testing.
5. The sika face recognition method based on the improved convolutional neural network according to claim 1, wherein the specific implementation method of the step (5) is as follows: the AM-Softmax expression is as follows:
Wherein s is a scaling factor, N is a label class, yi is a dimension output, and is other outputs after removal, c is the total number of other outputs after removal, W is a weight vector, x is a feature vector, and is an included angle between the feature vector x and the weight vector W; m is a constant, controlling the gap between classes;
The AM-Softmax loss function specifically comprises the following implementation flow: the product between the characteristic vector x and a full connection layer W is equal to the cosine distance cos theta after normalization of the characteristic and the weight, an angle between the characteristic vector and the target weight is calculated by using an inverse cosine function, then an angle margin m is subtracted from the target angle, and finally the angle is obtained by rescaling with fixed s.
6. The sika face recognition method based on the improved convolutional neural network according to claim 1, wherein the specific implementation method of the step (6) is as follows: training the sika face recognition network model by using the training data set, monitoring convergence of a loss function value during training of the sika face recognition network model, adjusting network model parameters if the loss function value is larger than a set threshold value, and obtaining the network weight parameters if the loss function value is smaller than the set threshold value and is stable in a set interval.
7. The sika face recognition method based on the improved convolutional neural network of claim 5, wherein the specific implementation method of the step (7) is as follows: inputting the sika face picture in the test data set into the sika face recognition network model, outputting a prediction result by the sika face recognition network model, comparing the prediction result with sika individual tags corresponding to the sika face picture in the test data set, and if the prediction result is matched with the sika individual tags in the test data set, determining that the test is passed and finishing training;
If the identification is wrong, returning to the step (6) to continue training until a trained network model is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111161433.1A CN113947780B (en) | 2021-09-30 | 2021-09-30 | Sika face recognition method based on improved convolutional neural network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111161433.1A CN113947780B (en) | 2021-09-30 | 2021-09-30 | Sika face recognition method based on improved convolutional neural network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113947780A CN113947780A (en) | 2022-01-18 |
CN113947780B true CN113947780B (en) | 2024-06-21 |
Family
ID=79330202
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111161433.1A Active CN113947780B (en) | 2021-09-30 | 2021-09-30 | Sika face recognition method based on improved convolutional neural network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113947780B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115474580A (en) * | 2022-10-17 | 2022-12-16 | 吉林农业大学 | Method and system for contactless measurement of body temperature of sika deer |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2020101229A4 (en) * | 2020-07-02 | 2020-08-06 | South China University Of Technology | A Text Line Recognition Method in Chinese Scenes Based on Residual Convolutional and Recurrent Neural Networks |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018071424A1 (en) * | 2016-10-10 | 2018-04-19 | University Of Maryland, College Park | All-in-one convolutional neural network for face analysis |
WO2019079180A1 (en) * | 2017-10-16 | 2019-04-25 | Illumina, Inc. | Deep convolutional neural networks for variant classification |
CN108520204A (en) * | 2018-03-16 | 2018-09-11 | 西北大学 | A kind of face identification method |
CN111291604A (en) * | 2018-12-07 | 2020-06-16 | 深圳光启空间技术有限公司 | Face attribute identification method, device, storage medium and processor |
CN110728179A (en) * | 2019-09-04 | 2020-01-24 | 天津大学 | Pig face identification method adopting multi-path convolutional neural network |
CN111414849B (en) * | 2020-03-19 | 2020-12-29 | 四川大学 | Face recognition method based on evolution convolutional neural network |
CN113128341A (en) * | 2021-03-18 | 2021-07-16 | 杭州电子科技大学 | Dog face identification method based on convolutional neural network |
-
2021
- 2021-09-30 CN CN202111161433.1A patent/CN113947780B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2020101229A4 (en) * | 2020-07-02 | 2020-08-06 | South China University Of Technology | A Text Line Recognition Method in Chinese Scenes Based on Residual Convolutional and Recurrent Neural Networks |
Non-Patent Citations (1)
Title |
---|
多变环境下基于多尺度卷积网络的猪个体识别;王荣;史再峰;高荣华;李奇峰;;江西农业大学学报;20200420(02);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113947780A (en) | 2022-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhang et al. | Real-time sow behavior detection based on deep learning | |
CN108520226B (en) | Pedestrian re-identification method based on body decomposition and significance detection | |
CN111178197B (en) | Mass R-CNN and Soft-NMS fusion based group-fed adherent pig example segmentation method | |
CN109829467A (en) | Image labeling method, electronic device and non-transient computer-readable storage medium | |
CN109271884A (en) | Face character recognition methods, device, terminal device and storage medium | |
CN107767416B (en) | Method for identifying pedestrian orientation in low-resolution image | |
CN111368690A (en) | Deep learning-based video image ship detection method and system under influence of sea waves | |
US20230215125A1 (en) | Data identification method and apparatus | |
CN112052772A (en) | Face shielding detection algorithm | |
CN109472733A (en) | Image latent writing analysis method based on convolutional neural networks | |
CN113470076A (en) | Multi-target tracking method for yellow-feather chickens in flat-breeding henhouse | |
CN113780145A (en) | Sperm morphology detection method, sperm morphology detection device, computer equipment and storage medium | |
Wang et al. | Pig face recognition model based on a cascaded network | |
CN116295022A (en) | Pig body ruler measurement method based on deep learning multi-parameter fusion | |
CN113947780B (en) | Sika face recognition method based on improved convolutional neural network | |
CN115147380A (en) | Small transparent plastic product defect detection method based on YOLOv5 | |
Ye et al. | PlantBiCNet: A new paradigm in plant science with bi-directional cascade neural network for detection and counting | |
CN111738062A (en) | Automatic re-identification method and system based on embedded platform | |
CN110717544B (en) | Pedestrian attribute analysis method and system under vertical fisheye lens | |
CN114758356A (en) | Method and system for recognizing cow lip prints based on local invariant features | |
TWI728655B (en) | Convolutional neural network detection method and system for animals | |
Iqbal et al. | Towards Efficient Segmentation and Classification of White Blood Cell Cancer Using Deep Learning | |
Min et al. | Vehicle detection method based on deep learning and multi-layer feature fusion | |
CN113780335B (en) | Small sample commodity image classification method, device, equipment and storage medium | |
CN116933041B (en) | Force sensor number checking system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |