Snake species identification method, snake species identification neural network training method and medium

Through the combination of dual-path convolutional neural network and bilinear transformation, combined with the balanced loss function oriented to long-tail distribution, the problem of insufficient snake species identification accuracy and generalization ability in the existing technology is solved, and the problem of snake identification in complex background is realized. Highly accurate snake species identification.

CN118486054BActive Publication Date: 2024-10-18四川互慧软件有限公司
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410931720.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-10-18
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

Existing snake species identification methods rely on artificial professional knowledge, have high misjudgment rates and low accuracy in complex backgrounds. The deep learning model has insufficient generalization capabilities, making it difficult to effectively identify snake species in practical applications.

Method used

A dual-path convolutional neural network architecture is used for image feature extraction, and bilinear transformation is used to capture the interactive information between features. It is combined with a long-tail distribution-oriented balanced loss function for neural network training to improve the model's generalization ability and recognition accuracy. .

Benefits of technology

It improves the accuracy of snake species recognition in complex backgrounds, simulates human visual recognition information of position and shape, and enhances the model's generalization ability and recognition effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118486054B_ABST
    Figure CN118486054B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of fine-grained image processing in computer vision, and specifically to a method for identifying snake species, a method for training a neural network for identifying snake species, and a medium. The identification object is used as input, and the snake species is identified based on a snake species identification neural network obtained through neural network training, including: inputting the identification object into two feature extraction networks for feature extraction processing to obtain a first feature map and a second feature map; bilinear confluence processing is performed on the first feature map and the second feature map to obtain a third feature map for classifier classification. In the scheme, since a dual-path convolutional neural network architecture is used to extract image features, the interactive information between these features is captured through bilinear transformation, so that not only richer feature representations can be extracted, but also human visual recognition information of position and shape can be simulated to a certain extent, and the species of snakes can be accurately identified in complex backgrounds, thereby improving the accuracy of snake species identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision fine-grained image processing, and in particular to a snake species identification method, a snake species identification neural network training method and a medium. Background Art

[0002] Snakes are widely distributed animals around the world, with more than 3,000 species. Their biodiversity is of great significance to biological research. At the same time, snake bites are a neglected tropical disease. According to statistics, 4 million to 5 million people are bitten by snakes every year in the world. In resource-scarce areas in Southeast Asia, Africa and Latin America, the death toll is as high as 81,000 to 138,000 people each year, and 400,000 people are disabled for life. Being able to identify snake species in a timely and correct manner can effectively reduce the mortality and disability rate of snake bites.

[0003] At present, the identification of many snake species is mostly based on manual identification, which requires relatively professional prior knowledge and relevant experience, and has a high degree of manual dependence. Due to the complex background environment and other reasons, misjudgment is still easy to occur during identification.

[0004] In recent years, with the rapid development of deep learning technology, the field of image recognition has ushered in revolutionary changes. Especially in the sub-field of snake image classification, the application of deep learning technology has achieved remarkable results. Deep learning models represented by ResNet, EfficientNet, MobileNet, etc., through deep network structures and a series of innovative technologies such as residual connections, compound scaling, and deep separable convolution, not only greatly improve the accuracy of image classification tasks, but also significantly improve processing efficiency and model running speed. However, although these models have made significant progress in the field of image recognition, they still face some challenges in practical applications. For example, the generalization ability of the model still needs to be improved, and there are still problems to be solved that reduce the accuracy. Summary of the invention

[0005] The technical problem to be solved by the present application is to provide a snake species identification method, a snake species identification neural network training method and a medium, which have the characteristics of higher snake species identification accuracy.

[0006] In a first aspect, an embodiment provides a method for identifying snake species, comprising:

[0007] Get the identification object;

[0008] The identification object is used as input, and the snake species is identified based on the snake species identification neural network obtained through neural network training, including:

[0009] Inputting the identified object into two feature extraction networks respectively for feature extraction processing to obtain a first feature map and a second feature map;

[0010] Performing bilinear confluence processing on the first feature map and the second feature map to obtain correlation information between the first feature map and the second feature map, thereby obtaining a third feature map;

[0011] Classify the third feature map by a classifier to obtain a classification result;

[0012] Using the classification result as a snake species identification result;

[0013] The bilinear merging of the first feature map and the second feature map includes:

[0014] Performing an outer product operation on a first feature map matrix and a second feature map matrix obtained by performing feature extraction processing on any pixel point position in the identified object, thereby obtaining a corresponding converged matrix;

[0015] Perform summing and pooling operations on all converged matrices to obtain feature converged matrices;

[0016] Processing the feature convergence matrix in vector form to obtain a feature convergence matrix in vector form;

[0017] Applying a sign function to each element of the feature convergence matrix in the vector form to obtain a feature convergence matrix after the sign function is applied;

[0018] The feature convergence matrix after the sign function is applied is normalized to obtain a third feature map.

[0019] In one embodiment, the first feature map matrix and the second feature map matrix obtained by performing feature extraction processing on any pixel point position in the identified object are subjected to outer product operation to obtain a corresponding merged matrix, including:

[0020] ,

[0021] or,

[0022] ;

[0023] in, I Represents the identification object, i Represents the position of any pixel in the identified object. b represents the confluence matrix, represents the feature extraction function for obtaining the first feature map, represents the feature extraction function for obtaining the second feature map, and T represents transpose.

[0024] In one embodiment, the summing and pooling operation is performed on all the converged matrices to obtain the feature converged matrix, including:

[0025] ;

[0026] in, represents the feature pooling matrix;

[0027] The step of processing the feature convergence matrix in vector form to obtain a feature convergence matrix in vector form includes:

[0028] ;

[0029] Among them, x represents the feature concatenation matrix in vector form, and vec represents a vector.

[0030] In one embodiment, applying a sign function to each element in the feature convergence matrix in vector form to obtain the feature convergence matrix after the sign function is applied includes:

[0031] ;

[0032] Where y represents the feature confluence matrix after the sign function is applied, Represents a symbolic function.

[0033] In one embodiment, the normalizing the feature convergence matrix after the sign function is applied to obtain a third feature map includes:

[0034] .

[0035] Among them, z represents the third feature map, Represents the norm operation.

[0036] In a second aspect, an embodiment provides a method for training a snake species identification neural network, characterized in that the method is used to train a snake species identification neural network used in the snake species identification method in any of the above embodiments, and the training method includes:

[0037] Obtain the training set and test set required for neural network training;

[0038] Constructing a preliminary snake species identification neural network architecture, including a feature extraction layer, a bilinear confluence layer and a classifier connected in sequence; wherein the feature extraction layer is a two-way feature extraction;

[0039] Initialize network parameters and construct loss functions, including building a balanced loss function for long-tail distribution target detection;

[0040] Using the training set as input of a preliminary snake species identification neural network architecture, training the neural network based on the constructed loss function, thereby obtaining a preliminary snake species identification neural network;

[0041] The test set is input into the preliminary snake species identification neural network to obtain the snake species graphic classification result, and the neural network is retrained based on the classification result to obtain the final snake species identification neural network.

[0042] In one embodiment, the network parameter initialization and loss function construction include:

[0043] The random initialization method is used to assign initial values ​​to the network parameters.

[0044] In one embodiment, the network parameter initialization and loss function construction include:

[0045] A balanced loss function for long-tail distribution target detection is used as the loss function for training.

[0046] In one embodiment, the training set is used as the input of the preliminary snake species identification neural network architecture, and the neural network is trained based on the constructed loss function to obtain the preliminary snake species identification neural network, including:

[0047] Freeze the parameters of the feature extraction layer and the bilinear confluence layer, and train the classifier based on the constructed loss function to obtain a trained classifier;

[0048] Unfreeze the parameters of the feature extraction layer and the bilinear pooling layer, and train the entire snake species recognition neural network based on the constructed loss function.

[0049] In a second aspect, a computer-readable storage medium is provided in an embodiment, characterized in that a program is stored in the medium, and the program can be loaded by a processor and execute the snake species identification method in any of the above embodiments and / or the snake species identification neural network training method in any of the embodiments.

[0050] The beneficial effects of the present invention are:

[0051] Because a dual-path convolutional neural network architecture is used to extract image features and capture the interaction information between these features through bilinear transformation, it is not only possible to extract richer feature representations, but also to simulate human visual recognition information of position and shape to a certain extent, accurately identify the species of snakes in complex backgrounds, and improve the accuracy of snake species recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is a schematic diagram of a process flow of a neural network training method for snake species identification according to an embodiment of the present application;

[0053] Figure 2 This is a schematic diagram of a neural network architecture for snake species identification according to an embodiment of the present application;

[0054] Figure 3 This is a schematic diagram of a bilinear merging process flow of an embodiment of the present application;

[0055] Figure 4 This application Figure 1 A method flow diagram of an embodiment of step S40;

[0056] Figure 5 This is a schematic diagram of a snake species identification method according to an embodiment of the present application;

[0057] Figure 6 This application Figure 5 A method flow chart of an embodiment of step S200 in FIG. DETAILED DESCRIPTION

[0058] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0059] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0060] The serial numbers assigned to the components herein, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0061] To facilitate the description of the inventive concept of the present application, the snake species identification technology is briefly described below.

[0062] With the rapid development of deep learning technology, the field of image recognition has ushered in revolutionary changes. In particular, in the sub-field of snake species image classification, the application of deep learning technology has achieved remarkable results. However, for the identification of snake species, there are large differences between different snake families and small differences between different snake genera. For example, the snake family includes the blind snake family and the viper family, and the viper family includes the iron-headed snake genera and the bamboo leaf green snake genera. There are large differences between different snake families, and the current deep learning-based snake species identification method can basically meet the requirements. However, the differences between different snake genera are small, and the current automatic identification method has low recognition accuracy and cannot meet the recognition requirements.

[0063] Based on this, the present application provides a snake species identification method, a snake species identification neural network training method and a medium. The method adopts a dual-path convolutional neural network architecture to extract image features, and captures the interactive information between these features through bilinear transformation, so as to not only extract richer feature representations, but also simulate human visual recognition information of position and shape to a certain extent, accurately identify the species of snakes in complex backgrounds, and improve the accuracy of snake species identification.

[0064] Since the snake species classification method based on deep learning needs to be implemented based on a trained snake species identification neural network, for ease of understanding, the snake species identification neural network training method is first introduced below.

[0065] Please refer to Figure 1 , a snake species identification neural network training method provided in one embodiment of the present application includes:

[0066] Step S10, obtaining a training set and a test set required for neural network training.

[0067] The required snake image dataset can be obtained through field photography, zoo archives or online resources. The collected snake image dataset is labeled. In one embodiment, the classification labels of the snake images include 61 category labels such as Amblycephalus, Cobra, Krait, Trimeresurus and Cobra.

[0068] In one embodiment, in order to improve the quality of the image data set, the collected snake images are preprocessed, and the preprocessing includes denoising, resizing, cropping, enhancement and other processing operations, thereby eliminating the interference of non-essential factors such as lighting, angle, scale, etc., and laying a solid foundation for subsequent training.

[0069] In one embodiment, during the resizing process of the snake species images, the images are normalized to improve the efficiency and performance of the training, including: normalizing the image size to the same fixed size so that the size of the input image remains consistent, thereby simplifying the design and training of the model. In one embodiment, the size of the collected snake species images is adjusted to 448 pixels * 448 pixels. This size can ensure that the detailed information of the image is not lost, and at the same time can reduce the consumption of computing resources and improve the efficiency of model training.

[0070] In some embodiments, in order to further improve the robustness and generalization ability of the model, multiple data augmentation operations are performed on the training set image data, including random cropping (which introduces transformations such as translation, scaling, and rotation by randomly selecting an area in the original image and cropping a sub-image), random horizontal flipping (which randomly flips the image horizontally, i.e., mirror flips it from left to right, to increase the diversity of the data), random erasing (which randomly selects a part of the image and covers the area with a random value (such as zero value or mean) to simulate partial information loss or occlusion in the image), etc. These operations can simulate different shooting conditions and changes in viewing angles, and enhance the model's ability to adapt to changes in input data.

[0071] After preprocessing, the snake image dataset will be divided into a training set and a test set according to a predetermined ratio. In one implementation, 80% of the data is used as a training set for training and learning the network model, and the remaining 20% ​​is used as a test set to evaluate the performance and generalization ability of the network model, thereby ensuring the model's predictive ability on unknown data.

[0072] Step S20, constructing a preliminary snake species identification neural network architecture.

[0073] Please refer to Figure 2 ,The preliminary snake species recognition neural network architecture includes a feature extraction layer, a bilinear confluence layer and a classifier connected in sequence. Among them, the feature extraction layer is a two-way feature extraction.

[0074] For the feature extraction layer, dual-path feature extraction is used to perform parallel two-path feature extraction on the input image. For dual-path feature extraction, the same feature extraction network can be used, or different feature extraction networks can be used. In one embodiment, two feature extraction networks (convolutional neural network A and convolutional neural network B) are both implemented based on a residual network, which extracts local features of the input data through the convolution operation of the convolution layer. These features can capture the spatial structural information in the data (such as edges and textures in the image). A pooling layer is usually used between each residual block to reduce the size of the feature map to further improve the efficiency of the network.

[0075] In one embodiment, each feature extraction network is implemented using a residual network with the fully connected layer and the global maximum pooling layer removed.

[0076] Based on the dual-path feature extraction network, two-path feature extraction of the input image is realized to obtain two feature maps.

[0077] The two feature maps extracted from the dual-path features are used as input to the bilinear confluence layer, so that the two extracted feature maps are bilinearly confluent to obtain the correlation between the two feature maps. Bilinear confluence is achieved by calculating the outer product between the two feature maps. The outer product multiplication of the two feature maps can capture the spatial correlation between the two feature maps.

[0078] In one embodiment, please refer to Figure 3 , the bilinear merging process specifically includes:

[0079] Step S01, for any pixel position in the learning object (when the snake species object is recognized based on the trained neural network, the learning object here is the recognition object), the first feature map matrix and the second feature map matrix obtained by feature extraction processing are performed, and the outer product operation is performed to obtain the corresponding converged matrix.

[0080] In one embodiment, step S01 includes:

[0081] ,

[0082] or,

[0083] ;

[0084] in, I represents the learning object (when the snake species object is recognized based on the trained neural network, the learning object here is the recognition object), i Represents the position of any pixel in the identified object. b represents the confluence matrix, represents the feature extraction function for obtaining the first feature map, represents the feature extraction function for obtaining the second feature map, and T represents transpose.

[0085] Feature extraction function based on convolutional neural network A Get the first feature map, based on the feature extraction function of the convolutional neural network B Specifically, step S10 is to calculate the position of any pixel point in the learning object I. i The first feature map matrix obtained by feature extraction and the second feature map matrix , perform outer product operation and get the corresponding confluence matrix.

[0086] Step S02: performing a summing and pooling operation on all the converged matrices to obtain a feature converged matrix.

[0087] In one embodiment, step S02 includes:

[0088] ;

[0089] in, represents the feature pooling matrix.

[0090] Based on step S01 and step S02, first perform matrix multiplication on the features at the same position of the feature map to obtain the convergence matrix b, and perform sum pooling on the convergence matrix of all positions (sum pooling is usually applied to the global pooling layer to summarize the information of the entire feature map into a value or a vector. For a given feature map, all its elements are added to obtain a scalar value or a vector as the summary information of the feature map) to obtain the feature convergence matrix .

[0091] Step S03, processing the feature convergence matrix into a vector form to obtain a feature convergence matrix in a vector form.

[0092] In one embodiment, step S03 includes:

[0093] ;

[0094] Among them, x represents the feature concatenation matrix in vector form, and vec represents a vector.

[0095] For a convolutional neural network, the input feature map has C channels, so the feature at position il is 1*C in size, and then at the same position, it is multiplied with the 1*C feature matrix obtained by another convolutional neural network to obtain a C*C matrix. Then the C*C matrices at all positions are summed to obtain the feature convergence matrix Then the feature confluence matrix Converting into vector form, we can get a bilinear vector.

[0096] Step S04: Apply a sign function to each element in the feature convergence matrix in vector form to obtain a feature convergence matrix after the sign function is applied.

[0097] In one embodiment, step S04 includes:

[0098] ;

[0099] Where y represents the feature confluence matrix after the sign function is applied, Represents a symbolic function.

[0100] Apply a sign function to each element in the vector, mapping positive numbers to +1, negative numbers to -1, and leaving zero unchanged. This removes the magnitude of the vector, fixing the magnitude of all non-zero elements to 1.

[0101] In one embodiment of the present application, the absolute value of each element is taken to retain its amplitude information, and the square root of each element is taken to retain its sign information and further reduce its amplitude, so that the vectors have consistency in direction and the difference in magnitude of the vectors can be reduced, thereby making the task more robust and efficient.

[0102] Step S05, normalizing the feature convergence matrix after the sign function is applied to obtain a third feature map.

[0103] In one embodiment, step S05 includes:

[0104] ;

[0105] Among them, z represents the third feature map, Represents the norm operation.

[0106] By normalizing the vector norm, the length of the vector is made equal to 1, so that the third feature map can be used for fine-grained image classification.

[0107] Step S30, network parameter initialization and loss function construction.

[0108] In the training process of deep learning models, the initialization of network parameters is one of the key factors affecting model performance. In one embodiment, a random initialization method is used to assign initial values ​​to network parameters to break the symmetry and ensure the stability of the training process. Subsequently, training parameters, including learning rate, batch size, number of iterations, etc., can be set to optimize the training process.

[0109] The choice of loss function has a direct impact on model performance. For the snake species recognition neural network, due to the existence of some rare snake species, it is difficult to obtain enough training images for rare snake species. When dealing with the problem of class imbalance, the traditional cross entropy loss may cause the model to be overly biased towards the more frequent categories during training, while ignoring the less frequent categories.

[0110] In response to the problem of image category imbalance, this application adopts the balanced loss function (Seesaw Loss) for long-tail distribution target detection as the loss function for training, thereby solving the problem of category imbalance. Based on this balanced loss function, a dynamic weight adjustment mechanism is introduced. According to the difference between the predicted probability and the true label of different categories, the weight of each category in the loss function is adaptively adjusted to better balance the influence between the categories. By accumulating the number of samples in each category and assigning a weight inversely proportional to the number of samples to each category, the loss contribution of each category is adjusted when calculating the loss. This mechanism effectively amplifies the loss of minority categories and reduces the loss of majority categories, promotes the model's recognition ability for minority categories, and enhances the generalization and fairness of the model.

[0111] Step S40, using the training set as the input of the preliminary snake species identification neural network architecture, and training the neural network based on the constructed loss function, so as to obtain a preliminary snake species identification neural network.

[0112] In one embodiment, in order to precisely control the model training process, accuracy (ACC) is used as the main criterion for model evaluation.

[0113] In one embodiment, please refer to Figure 4 , step S40 includes,

[0114] Step S401, freezing the parameters of the feature extraction layer and the bilinear fusion layer, and training the classifier based on the constructed loss function to obtain a trained classifier.

[0115] In the first round of iterative training, the training set of snake images was input into the preliminary snake species recognition neural network architecture, and the backbone network was frozen, and only the classifier part was trained. In this way, the number of training parameters was effectively reduced, the convergence speed of the model was accelerated, and the risk of destroying the pre-trained backbone network due to too fast gradient updates in the initial training stage was avoided, which helped to retain the powerful feature extraction ability of the pre-trained model.

[0116] After the first round of training is completed, the parameters of the backbone network are unfrozen and the learning rate is reduced for the second round of training.

[0117] Step S402, unfreeze the parameters of the feature extraction layer and the bilinear fusion layer, and train the entire snake species recognition neural network based on the constructed loss function.

[0118] During the training phase of step S402, the entire network participates in the back propagation of gradients, allowing the network to make more detailed parameter adjustments to better suit specific classification tasks.

[0119] Through the above-mentioned phased training strategy, the generalization ability and performance of the model can be further improved, and finally a fine-tuned snake image classification model can be output.

[0120] Step S50, input the test set into the preliminary snake species identification neural network to obtain the snake species graphic classification result, and obtain the final snake species identification neural network based on the classification result.

[0121] In one embodiment, a test set of a snake image classification dataset is input into a trained classification model to obtain the classification accuracy. By comparing the accuracies of different models, the best model is selected to ensure the best classification effect in actual deployment.

[0122] The above-mentioned snake species identification neural network training method adopts a dual-path convolutional neural network architecture to extract image features, and captures the interactive information between these features through bilinear transformation, so as to not only extract richer feature representations, but also simulate human visual recognition information of position and shape to a certain extent, accurately identify the species of snakes in complex backgrounds, and improve the accuracy of snake species identification.

[0123] In one embodiment of the present application, a method for identifying snake species is provided. Figure 5 ,include:

[0124] Step S100, obtaining an identification object.

[0125] Step S200, taking the identification object as input, and identifying the snake species based on the snake species identification neural network obtained through neural network training.

[0126] In one embodiment, please refer to Figure 6 , step S200 includes:

[0127] Step S2001, input the identification object into two feature extraction networks respectively for feature extraction processing to obtain a first feature map and a second feature map.

[0128] For the feature extraction layer, a dual-path feature extraction is used to perform two-path feature extraction in parallel on the input image. For the dual-path feature extraction, the same feature extraction network can be used, or different feature extraction networks can be used.

[0129] In one embodiment, each feature extraction network is implemented using a residual network with the fully connected layer and the global maximum pooling layer removed.

[0130] Based on the dual-path feature extraction network, two-path feature extraction of the input image is realized to obtain two feature maps.

[0131] Step S2002: Perform bilinear confluence processing on the first feature map and the second feature map to obtain correlation information between the first feature map and the second feature map, thereby obtaining a third feature map.

[0132] For the specific process of step S2002, please refer to Figure 3 The bilinear merging process.

[0133] Step S2003, classify the third feature map through a classifier to obtain a classification result.

[0134] Step S2004, using the classification result as the snake species identification result.

[0135] The above-mentioned snake species identification method adopts a dual-path convolutional neural network architecture to extract image features, and captures the interactive information between these features through bilinear transformation, so as to not only extract richer feature representations, but also simulate human visual recognition information of position and shape to a certain extent, accurately identify the species of snakes in complex backgrounds, and improve the accuracy of snake species identification.

[0136] In one embodiment of the present application, a computer-readable storage medium is provided, on which a program is stored. The stored program includes a method that can be loaded by a processor and process any of the above embodiments.

[0137] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0138] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.

Claims

1. A neural network training method for snake species identification, characterized in that: The training method is used to train the snake species identification neural network used in the snake species identification method, and the training method includes: Obtain the training set and test set required for neural network training; Constructing a preliminary snake species identification neural network architecture, including a feature extraction layer, a bilinear confluence layer and a classifier connected in sequence; wherein the feature extraction layer is a two-way feature extraction; Initialize network parameters and construct loss functions, including building a balanced loss function for long-tail distribution target detection; Using the training set as input of a preliminary snake species identification neural network architecture, training the neural network based on the constructed loss function, thereby obtaining a preliminary snake species identification neural network; Inputting the test set into the preliminary snake species identification neural network to obtain snake species graphic classification results, and retraining the neural network based on the classification results to obtain a final snake species identification neural network; The network parameter initialization and loss function construction include: The balanced loss function for long-tail distribution target detection is used as the training loss function. A dynamic weight adjustment mechanism is introduced to adaptively adjust the weight of each category in the loss function according to the difference between the predicted probability and the true label of different categories. The method of using the training set as the input of the preliminary snake species identification neural network architecture and training the neural network based on the constructed loss function to obtain a preliminary snake species identification neural network includes: Freeze the parameters of the feature extraction layer and the bilinear confluence layer, and train the classifier based on the constructed loss function to obtain a trained classifier; Unfreeze the parameters of the feature extraction layer and the bilinear pooling layer, and train the entire snake species recognition neural network based on the constructed loss function.

2. The snake species identification neural network training method according to claim 1, characterized in that: The network parameter initialization and loss function construction include: The random initialization method is used to assign initial values ​​to the network parameters.

3. A method for identifying snake species, characterized in that: include: Get the identification object; Taking the identification object as input, the snake species identification neural network trained based on claim 1 or 2 is used to identify the snake species, including: Inputting the identified object into two feature extraction networks respectively for feature extraction processing to obtain a first feature map and a second feature map; Performing bilinear confluence processing on the first feature map and the second feature map to obtain correlation information between the first feature map and the second feature map, thereby obtaining a third feature map; Classify the third feature map by a classifier to obtain a classification result; Using the classification result as a snake species identification result; The bilinear merging of the first feature map and the second feature map includes: Performing an outer product operation on a first feature map matrix and a second feature map matrix obtained by performing feature extraction processing on any pixel point position in the identified object, thereby obtaining a corresponding converged matrix; Perform summing and pooling operations on all converged matrices to obtain feature converged matrices; Processing the feature convergence matrix in vector form to obtain a feature convergence matrix in vector form; Applying a sign function to each element of the feature convergence matrix in the vector form, mapping positive numbers to +1, negative numbers to -1, and leaving zero unchanged, to obtain a feature convergence matrix after the sign function is applied; The feature convergence matrix after the sign function is applied is normalized so that the length of the vector is equal to 1 to obtain a third feature map.

4. The method for identifying snake species as claimed in claim 3, characterized in that: The first feature map matrix and the second feature map matrix obtained by performing feature extraction processing on any pixel position in the identified object, and performing outer product operation to obtain a corresponding converged matrix, include: ; or, ; Where I represents the recognition object, i represents any pixel position in the recognition object, b represents the convergence matrix, represents the feature extraction function for obtaining the first feature map, represents the feature extraction function for obtaining the second feature map, and T represents transpose.

5. The method for identifying snake species as claimed in claim 4, characterized in that: The above-mentioned summing and pooling operations are performed on all the converging matrices. Get the feature convergence matrix, including: ; in, represents the feature pooling matrix; The step of processing the feature convergence matrix in vector form to obtain a feature convergence matrix in vector form includes: ; Among them, x represents the feature concatenation matrix in vector form, and vec represents a vector.

6. The method for identifying snake species as claimed in claim 5, characterized in that: The step of applying a sign function to each element in the feature convergence matrix in the vector form to obtain a feature convergence matrix after the sign function is applied includes: ; Where y represents the feature confluence matrix after the sign function is applied, Represents a symbolic function.

7. The method for identifying snake species according to claim 6, characterized in that: The normalizing of the feature convergence matrix after the sign function is applied to obtain a third feature map includes: ; Among them, z represents the third feature map, Represents the norm operation.

8. A computer-readable storage medium, characterized in that: The medium stores a program, which can be loaded by a processor and execute the snake species identification method described in any one of claims 3 to 7 and / or the snake species identification neural network training method described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • A bilinear feature fusion fine-grained concept model and a learning method

    CN109685115A

  • Animal face recognition method and device, computer equipment and storage medium

    CN110135231A

  • Fine-grained fungus phenotype identification method based on transfer learning and bilinear Inception ResNetV2

    CN110263863A

  • Active interference identification method based on bilinear efficient neural network

    CN112731309A

  • Crop disease long-tail image recognition method based on multi-stage training

    CN113076873A