CN112036520A - Panda age identification method and device based on deep learning and storage medium - Google Patents
Panda age identification method and device based on deep learning and storage medium Download PDFInfo
- Publication number
- CN112036520A CN112036520A CN202011226989.XA CN202011226989A CN112036520A CN 112036520 A CN112036520 A CN 112036520A CN 202011226989 A CN202011226989 A CN 202011226989A CN 112036520 A CN112036520 A CN 112036520A
- Authority
- CN
- China
- Prior art keywords
- panda
- image
- training
- age
- image data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 208000025174 PANDAS Diseases 0.000 title claims abstract description 138
- 208000021155 Paediatric autoimmune neuropsychiatric disorders associated with streptococcal infection Diseases 0.000 title claims abstract description 138
- 240000004718 Panda Species 0.000 title claims abstract description 138
- 235000016496 Panda oleosa Nutrition 0.000 title claims abstract description 138
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000013135 deep learning Methods 0.000 title claims abstract description 28
- 238000003860 storage Methods 0.000 title claims abstract description 21
- 238000012549 training Methods 0.000 claims abstract description 90
- 238000012360 testing method Methods 0.000 claims abstract description 39
- 230000001815 facial effect Effects 0.000 claims abstract description 33
- 238000000605 extraction Methods 0.000 claims abstract description 24
- 238000013527 convolutional neural network Methods 0.000 claims abstract description 12
- 238000012545 processing Methods 0.000 claims description 25
- 238000002372 labelling Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 11
- 238000005520 cutting process Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 claims description 6
- 210000002569 neuron Anatomy 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000010606 normalization Methods 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims description 3
- 238000007405 data analysis Methods 0.000 abstract description 2
- 238000011161 development Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 238000010191 image analysis Methods 0.000 description 5
- 241001465754 Metazoa Species 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 241000894007 species Species 0.000 description 2
- 241000282452 Ailuropoda melanoleuca Species 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 238000004883 computer application Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000366 juvenile effect Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000003716 rejuvenation Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a panda age identification method, a panda age identification device and a storage medium based on deep learning.A panda facial image to be processed is defined as image sample data, and the image sample data is divided into training image data and testing image data according to the difference of attribute characteristics to form a training set and a testing set; inputting training image data in a training set into a convolutional neural network for feature extraction; training a pre-constructed age identification model based on the features after feature extraction and the coded age labels to obtain an identification result, and decoding the result to obtain the age of the pandas. The scheme of the invention divides the data set of the panda facial image to be processed, reasonably selects a data analysis means to combine with a convolutional neural network to extract the deep features, provides an effective coding mode to train a model and a decoding mode to obtain a recognition result, and provides a new idea for the current panda age recognition problem.
Description
Technical Field
The invention relates to the technical field of computer application technology and image analysis, in particular to a panda age identification method and device based on deep learning and a storage medium.
Background
Panda (A)Ailuropoda melanoleuca) Is a unique treasure species in China and a flagship species for protecting wild animals in the world. China is dedicated to developing effective panda and associated rare endangered wild animal protection through panda field population survey for a long time, and then organizing professional panda scientific survey four times in sequence.
The age distribution of pandas, namely the proportion or allocation of different age groups in panda populations, has a great influence on the birth rate and the death rate of panda populations. Relevant studies the panda age groups were divided into 4 groups: juvenile group (0-1.5 years old), young group (1.5-5.5 years old), adult group (5.5-20 years old), and elderly group (over 20 years old). The research on the age distribution or the age structure of the pandas can predict, forecast and even monitor the population dynamics and the population quantity of the pandas in real time. However, the research on the age structure of the wild pandas still has a great deal of bottleneck work needing to be broken through, wherein the statistics of the wild pandas particularly shows that the statistics is time-consuming, large in manpower, material resources and financial resources and low in timeliness. The fourth survey data statistics of the pandas nationwide show shows that the wild pandas nationwide are only distributed in six mountain systems such as Minshan, Qin mountain, Daqinling mountain, Xiaoqinling mountain, Liangshan and Qinling mountain, and are divided into 33 isolated small populations, wherein some populations are endangered to be extinct. Whether a wild population development trend is healthy or not is judged, the understanding of the age structure of the panda population is very important, and meanwhile, important scientific guidance is provided for the designated scientific protection management strategy and even the population rejuvenation management. In order to understand the age structure of panda population in a region more accurately and quickly, a new method is expected to be proposed.
With the generation of big data and the development of artificial intelligence technology, the convolutional neural network can learn high-dimensional features which cannot be observed by human eyes by setting appropriate constraints, and is widely applied to the technical field of image analysis. But less methods are applied to the image of the animal face.
Disclosure of Invention
The embodiment of the invention aims to provide a panda age identification method, a panda age identification device and a storage medium based on deep learning, which utilize an image analysis technology to perform auxiliary discriminant analysis on a panda age structure captured in the field, and further promote population management development of pandas.
To achieve the above object:
in a first aspect, the invention provides a panda age identification method based on deep learning, which comprises the following steps:
acquiring a panda facial image to be processed;
defining the panda facial image to be processed as image sample data, and dividing the image sample data into training image data and testing image data according to the difference of attribute characteristics to form a training set and a testing set;
inputting the training image data in the training set into a convolutional neural network for feature extraction;
training a pre-constructed age identification model based on the features after feature extraction and the coded age labels, and obtaining an identification result which is an age identification result of the pandas obtained after decoding.
Preferably, the acquiring the panda facial image to be processed includes:
manually labeling a pre-collected panda image to obtain a labeling box, and defining the labeling box as a temporary interesting area, wherein the temporary interesting area comprises a panda face;
recording coordinates x and y of the upper left corner of the labeling square box and the width w and the height h of the labeling square box;
calculating the coordinate values x + w/2 and y + h/2 of the central point of the temporary region of interest;
comparing the width w and the height h, recording the maximum value as a, and cutting to obtain a new square region of interest by taking the central point of the temporary region of interest as the center and a as the side length;
and converting the content of the square interested area into an image, and zooming to a preset size to obtain a panda facial image to be processed.
Preferably, the pre-collected panda image is obtained by shooting through terminal equipment provided with a camera;
the method further comprises the following steps before the manual annotation of the pre-collected panda image data: and adding labels to the acquired panda images, and storing the panda images according to the corresponding labels.
Further, the dividing the image sample data into training image data and test image data according to the difference of the attribute features includes:
classifying the image sample data based on individual attribute characteristics of the panda facial image, and carrying out dimension transformation on the classified training image sample;
obtained by dimension conversion according to a preset training ratenDimensional sample imageThe data is divided into training image data and test image data.
Preferably, before inputting the training image data in the training set into the convolutional neural network for feature extraction, the method further includes: carrying out normalization processing on training image data in a training set;
the method specifically comprises the following steps:
randomly clipping the panda face image to obtain a clipped image with the height H multiplied by the width W;
carrying out random horizontal mirror image turning processing and rotation processing on the cut image;
filling the residual parts left after the random horizontal mirror image overturning treatment and the rotating treatment with black;
randomly filling a small random block part in the cut image with black pixels;
randomly moving the cut image in horizontal and vertical directions, wherein the incomplete part is filled with black;
randomly denoising the cut image;
and normalizing the cut image according to the mean and variance of the ImageNet data set.
Preferably, the pre-constructing of the deep learning based age identification model comprises:
using ResNet50 and removing the last full connection layer as a feature extraction network, loading weights pre-trained by the data set ImageNet as initialization;
connecting a full connection layer containing 6 neurons after the feature extraction network;
encoding the age label, and using a multi-binary cross entropy loss function for constraint;
training image data is input into the model for training to obtain a set of model parameters.
In a second aspect, an embodiment of the present invention provides an panda age recognition apparatus based on deep learning, including:
the acquisition module is used for acquiring a panda facial image to be processed;
the dividing module is used for defining the panda facial image to be processed as image sample data, and dividing the image sample data into training image data and testing image data according to the difference of attribute characteristics to form a training set and a testing set;
the processing module is used for inputting the training image data in the training set into a convolutional neural network for feature extraction;
and the identification module is used for training a pre-constructed age identification model based on the features after feature extraction and the coded age labels, and obtaining an identification result which is an age identification result of the pandas obtained after decoding.
Preferably, the test image data is a plurality of test images;
the training image data is a plurality of training images;
the age identifying apparatus further includes: and the building module is used for building an age identification model based on deep learning according to the plurality of training images.
In a third aspect, the present invention provides a control apparatus based on panda age identification, including a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored therein a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of the first aspect described above.
Compared with the closest prior art, the invention has the following beneficial effects:
according to the panda age identification method, the panda age identification device and the storage medium based on deep learning, data set division is carried out on a panda face image to be processed, a data analysis means is reasonably selected, deep feature extraction is carried out by combining a convolutional neural network, an effective coding mode is provided for training a model and obtaining a decoding mode of an identification result, and a new thought is provided for the problem of identification of the panda age at present. The age of the pandas caught in the field is judged in an auxiliary way by utilizing an image analysis technology, so that the population management development of the pandas is further promoted.
Drawings
FIG. 1 is a flow diagram of an overall process provided by an embodiment of the present invention;
fig. 2 is a flowchart of a panda age identification method based on deep learning according to embodiment 1 of the present invention;
FIG. 3 is a schematic diagram of a panda face image input by the method according to the embodiment of the invention;
FIG. 4 is a schematic diagram of a model structure provided by an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a panda age recognition apparatus based on deep learning according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a control device based on panda age identification according to an embodiment of the present invention.
Detailed Description
In order to more clearly illustrate the detailed description of the invention or the technical solutions in the prior art, the drawings that are needed in the detailed description of the invention or the prior art will be briefly described below.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The specific embodiment of the invention provides a panda age identification method based on deep learning, as shown in fig. 1, the method mainly comprises the following steps:
s1, acquiring a panda facial image to be processed;
s2, defining the panda facial image to be processed as image sample data, dividing the image sample data into training image data and testing image data according to the difference of attribute characteristics to form a training set and a testing set;
s3, inputting the training image data in the training set into a convolutional neural network for feature extraction;
and S4, training a pre-constructed age identification model based on the features after feature extraction and the coded age labels, and obtaining an identification result which is an age identification result of the pandas obtained after decoding.
In step S1, the acquiring a panda facial image to be processed includes:
manually labeling a pre-collected panda image to obtain a labeling box, and defining the labeling box as a temporary interesting area, wherein the temporary interesting area comprises a panda face;
recording coordinates x and y of the upper left corner of the labeling square box and the width w and the height h of the labeling square box;
calculating the coordinate values x + w/2 and y + h/2 of the central point of the temporary region of interest;
comparing the width w and the height h, recording the maximum value as a, and cutting to obtain a new square region of interest by taking the central point of the temporary region of interest as the center and a as the side length;
and converting the content of the square interested area into an image, and zooming to a preset size to obtain a panda facial image to be processed.
The pre-collected panda image is obtained by shooting through terminal equipment provided with a camera;
the method further comprises the following steps before the manual annotation of the pre-collected panda image data: and adding labels to the acquired panda images, and storing the panda images according to the corresponding labels.
In step S2, the dividing the image sample data into training image data and test image data according to the difference in the attribute characteristics includes:
classifying the image sample data based on individual attribute characteristics of the panda facial image, and carrying out dimension transformation on the classified training image sample;
obtained by dimension conversion according to a preset training ratenThe dimensional sample image data is divided into training image data and test image data.
Before the step S3 is executed, before inputting the training image data in the training set into the convolutional neural network for feature extraction, the method further includes: carrying out normalization processing on training image data in a training set; the normalizing process of the training image data in the training set specifically includes:
randomly clipping the panda face image to obtain a clipped image with the height H multiplied by the width W;
carrying out random horizontal mirror image turning processing and rotation processing on the cut image;
filling the residual parts left after the random horizontal mirror image overturning treatment and the rotating treatment with black;
randomly filling a small random block part in the cut image with black pixels;
randomly moving the cut image in horizontal and vertical directions, wherein the incomplete part is filled with black;
randomly denoising the cut image;
and normalizing the cut image according to the mean and variance of the ImageNet data set.
In step S4, the pre-construction of the age identification model based on deep learning includes:
using ResNet50 and removing the last full connection layer as a feature extraction network, loading weights pre-trained by the data set ImageNet as initialization;
connecting a full connection layer containing 6 neurons after the feature extraction network;
encoding the age label, and using a multi-binary cross entropy loss function for constraint;
training image data is input into the model for training to obtain a set of model parameters.
Example 1:
referring to fig. 2, the panda age identification method based on deep learning according to embodiment 1 of the present invention may include the following steps:
s101, collecting a plurality of panda images. In this embodiment, a plurality of panda images can be collected by shooting tools such as a camera and a mobile phone, and the collected data is stored according to the corresponding tag for subsequent processing.
And S102, manually marking to obtain a plurality of panda facial images to be processed.
Specifically, a panda facial region is cut out from a panda image manually, and the cut-out region is normalized into an image with a uniform size, and the method specifically comprises the following steps:
1) manually marking the panda image to obtain a marked box, determining the marked box as a temporary interesting area, and recording the coordinates of the upper left corner of the marked boxAndand width of the labeled boxAnd height(ii) a The temporary interesting area comprises a panda face, the labeling frame is not limited by the length-width ratio, and only the panda face needs to be included; this stage can effectively avoid the interference of the background to the model,and the problem of different image scales caused by different shooting distances of various cameras;
2) calculating the coordinate value of the center point of the temporary region of interestAndand is relatively wideAnd heightRecording the maximum value therein as;
3) Centering on the central point of the temporary region of interestCutting to obtain a new square interested area for the side length;
4) and converting the content of the square interested area into an image, and zooming to a preset size to obtain the panda facial image to be processed. A general image classification model takes as input an image of size 224 × 224 or 299 × 299. The application adopts 512 x 512, because the resolution of the data is larger, and the features contained in the input image with larger size are more specific, which is beneficial to modeling the details of the image.
And step S103, dividing a data set of the panda facial image to be processed according to the attribute characteristics of the panda object to obtain a training set and a test set. The training set comprises a plurality of training images, and the test set comprises a plurality of test images. The embodiment of the application aims to learn the age characteristics of an image, so that the attribute characteristics of a panda object are the age characteristics of a panda, in order to avoid individual characteristics from being included in training data and reduce data correlation, in this embodiment, data set division is performed according to panda individuals, and the specific method is as follows:
dividing the panda facial image objects into age-spanning objects and single-age objects according to age characteristics contained in attribute characteristics of the panda facial image objects, storing the age-spanning objects into a training set, sorting the data of the whole single-age object in a descending order of the single-age object according to the number of images of each individual, then screening the images with the number of the images being (10, max) and sending the images into a test set, wherein the max value is dynamically adjusted according to the number stored into the test set, finally, the proportion of the data quantity of the training set to the data quantity of the test set is about 9:1, and the rest single-age objects are sent into the training set. The operation ensures that the pictures of the same panda only exist in the training set or the test set without intersection, the ratio of the number of the panda objects to the number of the images is about 9:1, the traditional machine learning data division habit is met, and the experimental result is convincing.
It should be noted that, in this embodiment, the data set is divided according to the attribute features, that is, all pictures of the pandas a exist in only one of the training set and the test set, which has the advantage of ensuring that only the information of the age is learned: if 70% of the images of pandas A are in the training set and 30% are in the testing set, then the model is trained to possibly be other information of pandas A.
In this example, 47 subjects were selected as the test set, including 5 young, 10 sub-adults, 29 adults, 3 old people, and 871 total pictures, and the remaining 171 subjects were selected as the training set, wherein the young comprises 60, the sub-adults comprises 87, the adult comprises 92, the old comprises 11, and 5570 total pictures.
And S104, performing data enhancement and preprocessing on the training set image to obtain a processing result. Suppose thatFor processed imagesIf the image is an image before processing, step S104 specifically includes:
1) randomly cutting the test image into the size of H × W, which takes 224 × 224 as an example in this embodiment;
2) horizontally mirroring the cropped image with a probability of 0.5 by the following formula;
3) the cropped image is processed by the following formulaThe probability of (2) randomly moves a small step range along the horizontal and vertical directions, and the embodiment adoptsRange pixels, the defective part is filled with black;
4) the clipped image is randomly zoomed according to the following formula, and the original image is adopted in the proportion range of [0.9,1 ];
5) in the embodiment, random rotation is adopted to enhance data, so that errors caused by face angle pair identification can be effectively reduced, the angle in the range of [ -25,25] is adopted through the following formula, and the incomplete part is filled with black;
6) the three channels of the input image "RGB" were normalized to the mean and variance of the ImageNet dataset. Fig. 3 is an example of the panda face image processed through the above steps.
And S105, constructing an age identification model based on deep learning according to the plurality of training images.
Specifically, in the age identification model in this embodiment, ResNet50 removes the last full connection layer as a feature extraction network, ImageNet is used to initialize pre-training weights, a full connection layer including 6 neurons is added, collected training set image data is used, and corresponding age labels are encoded, a multi-binary cross entropy loss is used to train parameters of a set of models, and the parameters are input to a convolution basis network to obtain the age identification model. Figure 4 shows the model structure used in the present invention.
The meaning of the added full-link layer is 3 binary classifiers, which are used to indicate whether the current age is greater than the current age, such as: the age label is 1, i.e. greater than age label 0, less than age labels 1, 2. The tag is thus encoded using a combination of a plurality of One-Hot codes (One-Hot), such as: when the age label is 1, the label is larger than the age label 0, and is smaller than the age labels 1 and 2, so that the label of each classifier is 1,0 and 0 respectively, the classifier is converted into one-hot codes 01,10 and 10, and the combined final coding result is 011010. By adopting a multi-binary cross entropy loss function, a plurality of two classifiers are constrained actually, but a matrix calculation mode is adopted, so that the parallel capability of calculation resources can be better utilized.
It should be noted that, in order to prevent overfitting, during training, a fine adjustment mode is adopted, and the pictures of the same panda only exist in one data set, and cannot have intersections. Random gradient descent with momentum is adopted as an optimization algorithm, and multi-binary cross entropy is adopted as a loss function.
And S106, identifying the processing result based on the deeply learned age identification model to obtain the age identification result of the pandas.
Specifically, the basic convolutional network is adopted to perform high-level feature extraction on the processing result, the output coding result is obtained through the last full-link layer, and the coding result needs to be decoded, that is, the result processing is performed on each binary classifier, and the decoding formula is as follows:
wherein,for the (i) th output value,the number of age groups is indicated. The accuracy of the model on the panda age test data set is 82.5%.
When the embodiment of the invention is implemented, the age of the pandas caught in the field is judged in an auxiliary way by utilizing the image analysis technology, so that the population management development of the pandas is promoted. Furthermore, the embodiment of the invention reasonably selects a data enhancement means and a basic model, can effectively extract the high-level characteristics belonging to the age of pandas, improves the identification accuracy through the encoding and decoding of the age label and under the constraint of a multi-binary cross entropy loss function, and provides a new idea for the current difficult problem of identifying the age of pandas.
Example 2:
based on the same inventive concept of embodiment 1, embodiment 2 of the present invention further provides a panda facial age recognition device based on deep learning. As shown in fig. 5, the apparatus includes:
the acquisition module 10 is used for acquiring a panda facial image to be processed;
the dividing module 20 is configured to perform data set division on the panda facial image to be processed according to the attribute features of the pandas to obtain a training set and a test set, where the test set includes multiple test images;
the processing module 30 is configured to perform data enhancement and preprocessing on the test image to obtain a processing result;
and the identification module 40 is used for identifying the processing result based on the deeply learned age identification model so as to obtain an age identification result of the pandas.
Further, the apparatus further comprises:
and the building module 50 is used for building an age identification model based on deep learning according to the plurality of training images.
Wherein, the building block 50 is specifically configured to:
1) training parameters of a set of models according to the training set;
2) inputting the parameters into a convolution basic network to obtain the age identification model; the convolution basic network is ResNet-50, initialization is carried out by adopting ImageNet pre-training weights, meanwhile, the last full-connection layer is removed, and the full-connection layer suitable for containing 6 neurons is accessed.
Wherein, the acquisition module 10 is specifically configured to:
collecting a plurality of panda images;
manually labeling the panda image to obtain a labeling box, and determining the labeling box as a temporary interesting area, wherein the temporary interesting area comprises a panda face;
recording the coordinates of the upper left corner of the labeling square frameAndand the width of the labeled boxAnd height;
Centering on the central point of the temporary region of interestCutting to obtain a new square interested area for the side length;
and converting the content of the square interested area into an image, and zooming to a preset size to obtain the panda facial image to be processed.
The processing module 30 is specifically configured to:
randomly cropping the test image to obtain a cropped image with the size of H multiplied by W;
performing horizontal mirror image processing on the cut image;
performing rotation processing on the cut image, wherein the incomplete part is filled with black;
randomly filling a small random block part in the cut image with black pixels;
randomly moving the cut image in horizontal and vertical directions, wherein the incomplete part is filled with black;
randomly denoising the cut image;
and normalizing the cut image according to the mean and variance of the ImageNet data set.
Alternatively, in another embodiment 3 of the present invention, as shown in fig. 6, the control device based on panda age identification may include: one or more processors 101, one or more input devices 102, one or more output devices 103, and memory 104, the processors 101, input devices 102, output devices 103, and memory 104 being interconnected via a bus 105. The memory 104 is used for storing a computer program comprising program instructions, the processor 101 being configured for invoking the program instructions for performing the methods of the above-described method embodiment parts.
It should be understood that, in the embodiment of the present invention, the Processor 101 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 102 may include a keyboard or the like, and the output device 103 may include a display (LCD or the like), a speaker, or the like.
The memory 104 may include read-only memory and random access memory, and provides instructions and data to the processor 101. A portion of the memory 104 may also include non-volatile random access memory. For example, the memory 104 may also store device type information.
In a specific implementation, the processor 101, the input device 102, and the output device 103 described in this embodiment of the present invention may execute the implementation manner described in the embodiment of the panda facial image age identification method based on deep learning provided in this embodiment of the present invention, which is not described herein again.
It should be noted that, for the specific work flow of the apparatus according to the embodiment of the present invention, please refer to the foregoing method embodiment, which is not described herein again.
Accordingly, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions that, when executed by a processor, implement: the panda facial image age identification method based on deep learning.
The computer readable storage medium may be an internal storage unit of the system according to any of the foregoing embodiments, for example, a hard disk or a memory of the system. The computer readable storage medium may also be an external storage device of the system, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) Card, Flash memory Card (Flash Card), etc. provided on the system. Further, the computer readable storage medium may also include both an internal storage unit and an external storage device of the system. The computer-readable storage medium is used for storing the computer program and other programs and data required by the system. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A panda age identification method based on deep learning is characterized by comprising the following steps:
acquiring a panda facial image to be processed;
defining the panda facial image to be processed as image sample data, and dividing the image sample data into training image data and testing image data according to the difference of attribute characteristics to form a training set and a testing set;
inputting the training image data in the training set into a convolutional neural network for feature extraction;
training a pre-constructed age identification model based on the features after feature extraction and the coded age labels, and obtaining an identification result which is an age identification result of the pandas obtained after decoding.
2. The panda age recognition method based on deep learning of claim 1, wherein the obtaining of the panda facial image to be processed includes:
manually labeling a pre-collected panda image to obtain a labeling box, and defining the labeling box as a temporary interesting area, wherein the temporary interesting area comprises a panda face;
recording coordinates x and y of the upper left corner of the labeling square box and the width w and the height h of the labeling square box;
calculating the coordinate values x + w/2 and y + h/2 of the central point of the temporary region of interest;
comparing the width w and the height h, recording the maximum value as a, and cutting to obtain a new square region of interest by taking the central point of the temporary region of interest as the center and a as the side length;
and converting the content of the square interested area into an image, and zooming to a preset size to obtain a panda facial image to be processed.
3. The panda age identification method based on deep learning of claim 1, wherein the pre-collected panda image is obtained by shooting through a terminal device equipped with a camera;
the method further comprises the following steps before the manual annotation of the pre-collected panda image data: and adding labels to the acquired panda images, and storing the panda images according to the corresponding labels.
4. The method of claim 2, wherein the dividing the image sample data into training image data and test image data according to the difference in the attribute features comprises:
classifying the image sample data based on individual attribute characteristics of the panda facial image, and carrying out dimension transformation on the classified training image sample;
obtained by dimension conversion according to a preset training ratenThe dimensional sample image data is divided into training image data and test image data.
5. The panda age identification method based on deep learning of claim 1, wherein before inputting the training image data in the training set into a convolutional neural network for feature extraction, the method further comprises: carrying out normalization processing on training image data in a training set;
the method specifically comprises the following steps:
randomly clipping the panda face image to obtain a clipped image with the height H multiplied by the width W;
carrying out random horizontal mirror image turning processing and rotation processing on the cut image;
filling the residual parts left after the random horizontal mirror image overturning treatment and the rotating treatment with black;
randomly filling a small random block part in the cut image with black pixels;
randomly moving the cut image in horizontal and vertical directions, wherein the incomplete part is filled with black;
randomly denoising the cut image;
and normalizing the cut image according to the mean and variance of the ImageNet data set.
6. The panda age identification method based on deep learning according to claim 1, wherein the pre-constructing of the age identification model comprises:
using ResNet50 and removing the last full connection layer as a feature extraction network, loading weights pre-trained by the data set ImageNet as initialization;
connecting a full connection layer containing 6 neurons after the feature extraction network;
encoding the age label, and using a multi-binary cross entropy loss function for constraint;
training image data is input into the model for training to obtain a set of model parameters.
7. A panda age recognition device based on deep learning, comprising:
the acquisition module is used for acquiring a panda facial image to be processed;
the dividing module is used for defining the panda facial image to be processed as image sample data, and dividing the image sample data into training image data and testing image data according to the difference of attribute characteristics to form a training set and a testing set;
the processing module is used for inputting the training image data in the training set into a convolutional neural network for feature extraction;
and the identification module is used for training a pre-constructed age identification model based on the features after feature extraction and the coded age labels, and obtaining an identification result which is an age identification result of the pandas obtained after decoding.
8. The device for identifying the age of pandas in deep learning according to claim 7, wherein the test image data is a plurality of test images;
the training image data is a plurality of training images;
the age identifying apparatus further includes: and the building module is used for building an age identification model based on deep learning according to the plurality of training images.
9. A panda age identification based control apparatus comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is configured to store a computer program, the computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of claim 1.
10. A computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the method of any of the preceding claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011226989.XA CN112036520A (en) | 2020-11-06 | 2020-11-06 | Panda age identification method and device based on deep learning and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011226989.XA CN112036520A (en) | 2020-11-06 | 2020-11-06 | Panda age identification method and device based on deep learning and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112036520A true CN112036520A (en) | 2020-12-04 |
Family
ID=73572759
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011226989.XA Pending CN112036520A (en) | 2020-11-06 | 2020-11-06 | Panda age identification method and device based on deep learning and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112036520A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112712133A (en) * | 2021-01-15 | 2021-04-27 | 北京华捷艾米科技有限公司 | Deep learning network model training method, related device and storage medium |
CN112966789A (en) * | 2021-04-22 | 2021-06-15 | 广东中烟工业有限责任公司 | Tobacco maturity identification method, device and equipment |
CN113128525A (en) * | 2021-05-19 | 2021-07-16 | 内蒙古农业大学 | Control device and method for desert grassland population patch identification |
CN116990468A (en) * | 2023-09-28 | 2023-11-03 | 国网江苏省电力有限公司电力科学研究院 | System and method for testing and evaluating gas state of simulated sulfur hexafluoride electrical equipment |
CN118015430A (en) * | 2024-03-19 | 2024-05-10 | 河北数微信息技术有限公司 | Intelligent government affair service training method and system based on deep learning |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108460428A (en) * | 2018-04-11 | 2018-08-28 | 波奇(上海)信息科技有限公司 | A kind of method and apparatus of pet image recognition |
US20180293429A1 (en) * | 2017-03-30 | 2018-10-11 | George Mason University | Age invariant face recognition using convolutional neural networks and set distances |
CN110414298A (en) * | 2018-04-28 | 2019-11-05 | 中山大学 | A kind of more attribute joint recognition methods of monkey face |
CN110781866A (en) * | 2019-11-08 | 2020-02-11 | 成都大熊猫繁育研究基地 | Panda face image gender identification method and device based on deep learning |
-
2020
- 2020-11-06 CN CN202011226989.XA patent/CN112036520A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180293429A1 (en) * | 2017-03-30 | 2018-10-11 | George Mason University | Age invariant face recognition using convolutional neural networks and set distances |
CN108460428A (en) * | 2018-04-11 | 2018-08-28 | 波奇(上海)信息科技有限公司 | A kind of method and apparatus of pet image recognition |
CN110414298A (en) * | 2018-04-28 | 2019-11-05 | 中山大学 | A kind of more attribute joint recognition methods of monkey face |
CN110781866A (en) * | 2019-11-08 | 2020-02-11 | 成都大熊猫繁育研究基地 | Panda face image gender identification method and device based on deep learning |
Non-Patent Citations (1)
Title |
---|
谢程娟: "人脸年龄估计与老化合成方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112712133A (en) * | 2021-01-15 | 2021-04-27 | 北京华捷艾米科技有限公司 | Deep learning network model training method, related device and storage medium |
CN112966789A (en) * | 2021-04-22 | 2021-06-15 | 广东中烟工业有限责任公司 | Tobacco maturity identification method, device and equipment |
CN113128525A (en) * | 2021-05-19 | 2021-07-16 | 内蒙古农业大学 | Control device and method for desert grassland population patch identification |
CN116990468A (en) * | 2023-09-28 | 2023-11-03 | 国网江苏省电力有限公司电力科学研究院 | System and method for testing and evaluating gas state of simulated sulfur hexafluoride electrical equipment |
CN116990468B (en) * | 2023-09-28 | 2023-12-05 | 国网江苏省电力有限公司电力科学研究院 | System and method for testing and evaluating gas state of simulated sulfur hexafluoride electrical equipment |
CN118015430A (en) * | 2024-03-19 | 2024-05-10 | 河北数微信息技术有限公司 | Intelligent government affair service training method and system based on deep learning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108664996B (en) | Ancient character recognition method and system based on deep learning | |
US10410353B2 (en) | Multi-label semantic boundary detection system | |
CN112036520A (en) | Panda age identification method and device based on deep learning and storage medium | |
US12008076B2 (en) | End-to-end attention pooling-based classification method for histopathology images | |
CN112784763B (en) | Expression recognition method and system based on local and overall feature adaptive fusion | |
Sermanet et al. | Convolutional neural networks applied to house numbers digit classification | |
CN108108751B (en) | Scene recognition method based on convolution multi-feature and deep random forest | |
CN110363091B (en) | Face recognition method, device and equipment under side face condition and storage medium | |
WO2017016240A1 (en) | Banknote serial number identification method | |
CN106408037B (en) | Image recognition method and device | |
JP2014232533A (en) | System and method for ocr output verification | |
CN110046574A (en) | Safety cap based on deep learning wears recognition methods and equipment | |
Chandran et al. | Missing child identification system using deep learning and multiclass SVM | |
CN105389588B (en) | Based on multi-semantic meaning code book image feature representation method | |
CN113490947A (en) | Detection model training method and device, detection model using method and storage medium | |
CN109255289A (en) | A kind of across aging face identification method generating model based on unified formula | |
CN113205002B (en) | Low-definition face recognition method, device, equipment and medium for unlimited video monitoring | |
CN110188750A (en) | A kind of natural scene picture character recognition method based on deep learning | |
CN108229432A (en) | Face calibration method and device | |
CN116188879A (en) | Image classification and image classification model training method, device, equipment and medium | |
CN113111880A (en) | Certificate image correction method and device, electronic equipment and storage medium | |
CN110414431B (en) | Face recognition method and system based on elastic context relation loss function | |
CN108229505A (en) | Image classification method based on FISHER multistage dictionary learnings | |
CN114842478A (en) | Text area identification method, device, equipment and storage medium | |
CN107944363A (en) | Face image processing process, system and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201204 |