Plant species identification method and device, terminal and storage medium
By designing a hierarchical classification head, plant species recognition is carried out layer by layer, which solves the problem of limited plant species recognition accuracy in the prior art, and achieves high-precision recognition in complex environments.
Patent Information
- Application Number
- CN202510750282.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-06
AI Technical Summary
In the prior art, plant species identification methods lack hierarchical information utilization, resulting in limited classification accuracy in complex multi-level classification tasks.
The hierarchical classification head design is adopted, including the order classification layer, family classification layer, genus classification layer and species classification layer. Each level corresponds to different orders of plant classification, and plant species identification is carried out through layer-by-layer prediction.
It significantly improves the accuracy and robustness of plant species recognition, and can effectively extract features under complex backgrounds and lighting changes, reducing calculation complexity.
Smart Images

Figure CN120279339A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a method, apparatus, terminal, and storage medium for plant species recognition. Background Art
[0002] Plant species recognition is an important part of biodiversity research and ecological monitoring, and its recognition accuracy directly affects the accuracy of species classification and the reliability of ecological data. Existing plant species recognition methods mainly rely on deep neural network models, such as Residual Network (ResNet), Dense Convolutional Network (DenseNet), etc. These models directly extract features from the input image and classify them in an end-to-end manner. Although these methods perform well in single-level classification tasks, when dealing with complex multi-level classification tasks, due to the lack of utilization of hierarchical information, plant species recognition is usually regarded as a single flat classification. This single-level classification strategy cannot fully utilize the prior knowledge of plant taxonomy, resulting in limited classification accuracy.
[0003] Therefore, there are defects in the existing technology and it needs to be improved and developed. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method, apparatus, terminal, and storage medium for plant species recognition aiming at the above-mentioned defects of the existing technology, so as to solve the problem of limited plant species recognition accuracy in the existing technology.
[0005] The technical solution adopted by the present invention to solve the technical problem is as follows: In a first aspect, an embodiment of the present invention provides a method for plant species recognition, the method including: Obtain a plant image to be recognized; After preprocessing the plant image to be recognized, input it into a preset feature extraction network to obtain target visual features; Input the target visual features into a trained hierarchical classification head, the hierarchical classification head includes multiple classification layers, each classification layer corresponds to a different taxonomic rank of plant classification in sequence, and perform classification prediction layer by layer through the hierarchical classification head, and output the plant species recognition result.
[0006] In an implementation manner, after preprocessing the plant image to be recognized and inputting it into a preset feature extraction network to obtain target visual features, it includes: After preprocessing the plant image to be recognized, obtain a second plant image; After inputting the second plant image into a preset feature extraction network and processing it through a feature extraction module in the feature extraction network, initial visual features are obtained. After inputting the initial visual features into a linear layer of the feature extraction network for dimensional adjustment, target visual features are obtained.
[0007] In one implementation, preprocessing a plant image to be recognized to obtain a second plant image includes: Judging the category of the plant image to be recognized; If the category is satellite remote sensing image, performing radiometric calibration, atmospheric correction, orthorectification, multi-spectral and panchromatic image fusion, target area image cropping, image normalization, and image size unification operations on the plant image of satellite remote sensing image category in sequence to obtain a second plant image; If the category is non-satellite remote sensing image, performing image normalization and image size unification operations on the plant image of non-satellite remote sensing image category to obtain a second plant image.
[0008] In one implementation, the multiple classification layers include an order classification layer, a family classification layer, a genus classification layer, and a species classification layer. The order classification layer is used to predict the order-level classification of plants, the family classification layer is used to predict the family-level classification of plants, the genus classification layer is used to predict the genus-level classification of plants, and the species classification layer is used to predict plant species.
[0009] In one implementation, inputting the target visual features into a trained hierarchical classification head. The hierarchical classification head contains multiple classification layers, and each classification layer corresponds to different taxonomic ranks of plant classification in sequence. Through classification prediction layer by layer by the hierarchical classification head, a plant species recognition result is output, including: Inputting the target visual features into the order classification layer, generating an order-level prediction probability through classification processing, converting it into an order-level prediction feature through an embedding layer in the order classification layer, and performing weighted fusion with the target visual features using an attention mechanism to obtain a first concatenated feature; Inputting the first concatenated feature into the family classification layer, generating a family-level prediction probability through classification processing, converting the family-level prediction probability into a family-level prediction feature through an embedding layer in the family classification layer, and performing weighted fusion with the first concatenated feature using an attention mechanism to obtain a second concatenated feature; Inputting the second concatenated feature into the genus classification layer, generating a genus-level prediction probability through classification processing, converting the genus-level prediction probability into a genus-level prediction feature through an embedding layer in the genus classification layer, and performing weighted fusion with the second concatenated feature using an attention mechanism to obtain a third concatenated feature; Input the third splicing feature into the species classification layer. After classification processing by the species classification layer, generate the species layer prediction probability as the plant species recognition result and output it.
[0010] In one implementation, the training steps of the hierarchical classification head include: Obtain a training set, which contains a number of plant images and corresponding order-level category annotations, family-level category annotations, genus-level category annotations, and plant species annotations; Input the training set into a preset feature extraction network to generate multiple target training visual features; Input all the target training visual features into the hierarchical classification head to be trained. In each classification layer of the hierarchical classification head, calculate the corresponding loss function, and add the loss functions of each layer according to preset weights to obtain the total loss function; Based on the total loss function, adjust the parameters of all classification layers in the hierarchical classification head through the backpropagation algorithm; Repeat the processes of generating target training visual features, calculating the total loss function, and adjusting parameters until after reaching the preset number of rounds, obtain the trained hierarchical classification head.
[0011] In one implementation, the loss function of each classification layer is the cross-entropy loss function.
[0012] In a second aspect, an embodiment of the present invention further provides a plant species recognition device, which includes: An image acquisition module, configured to acquire a plant image to be recognized; A target visual feature generation module, configured to input the plant image to be recognized after preprocessing into a preset feature extraction network to obtain target visual features; A species recognition module, configured to input the target visual features into the trained hierarchical classification head. The hierarchical classification head includes multiple classification layers, and each classification layer corresponds to different taxonomic ranks of plant classification in sequence. After classification prediction layer by layer by the hierarchical classification head, output the plant species recognition result.
[0013] In a third aspect, an embodiment of the present invention further provides a terminal, which includes: a memory, a processor, and a plant species recognition program stored on the memory and executable on the processor. When the plant species recognition program is executed by the processor, it implements the steps of the plant species recognition method as described above.
[0014] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores a plant species recognition program, and the plant species recognition program can be executed to implement the steps of the plant species recognition method as described above.
[0015] Advantages of the present invention: The present invention obtains a plant image to be recognized; after preprocessing the plant image to be recognized, it is input into a preset feature extraction network to obtain target visual features; the target visual features are input into a trained hierarchical classification head, the hierarchical classification head includes multiple classification layers, each classification layer corresponds to a different taxonomic rank of plant classification in sequence, and through the hierarchical classification head, classification prediction is carried out layer by layer, and the plant species recognition result is output. By adopting the design of a hierarchical classification head corresponding to the taxonomic ranks of plants, and using the classification layers in the hierarchical classification head to progressively predict the plant species, the present invention can effectively improve the recognition accuracy of plant species. Description of the Drawings
[0016] Figure 1 is a flowchart of a preferred embodiment of the plant species recognition method in the present invention.
[0017] Figure 2 is a schematic structural diagram of the hierarchical classification head in the present invention.
[0018] Figure 3 is a schematic diagram of the deep supervision learning mechanism in the order classification layer.
[0019] Figure 4 is a schematic diagram of the calculation of the total loss function in the present invention.
[0020] Figure 5 is a schematic structural diagram of a preferred embodiment of the plant species recognition device in the present invention.
[0021] Figure 6 is a schematic block diagram of the terminal principle in the present invention. Detailed Embodiments
[0022] To make the objectives, technical solutions and advantages of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0023] Plant species identification is an important part of biodiversity research and ecological monitoring, and its identification accuracy directly affects the accuracy of species classification and the reliability of ecological data. Existing plant species identification methods mainly rely on deep neural network models, such as Residual Network (ResNet), Dense Convolutional Network (DenseNet), etc. These models directly extract features from the input image and classify them in an end-to-end manner. Although these methods perform well in single-level classification tasks, when dealing with complex multi-level classification tasks, due to the lack of utilization of hierarchical information, plant species identification is usually regarded as a single flat classification. This single-level classification strategy cannot fully utilize the prior knowledge of plant taxonomy, resulting in limited classification accuracy.
[0024] In view of the above defects of the prior art, the present invention provides a plant species identification method, device, terminal and storage medium. The method includes: obtaining a plant image to be identified; after preprocessing the plant image to be identified, inputting it into a preset feature extraction network to obtain target visual features; inputting the target visual features into a trained hierarchical classification head, the hierarchical classification head includes multiple classification layers, and each classification layer corresponds to different taxonomic ranks of plant classification in sequence. Through classification prediction layer by layer by the hierarchical classification head, a plant species identification result is output. The present invention designs a hierarchical classification head structure that conforms to the taxonomic rank characteristics of plants, and uses its internal hierarchical progression to predict plant species, which can effectively improve the identification accuracy of plant species.
[0025] Please refer to Figure 1 , the plant species identification method described in the embodiment of the present invention includes the following steps: Step S100, obtain a plant image to be identified.
[0026] Specifically, the plant image can be obtained by devices such as cameras, drones, cameras, mobile phones, etc., or can be obtained by satellite remote sensing platforms collecting ground data, which is not limited here.
[0027] Please refer to Figure 1 , the plant species identification method described in the embodiment of the present invention further includes the following steps: Step S200, after preprocessing the plant image to be identified, input it into a preset feature extraction network to obtain target visual features.
[0028] Specifically, the target visual features extracted by the feature extraction network can be used as the basis for subsequent plant species identification. The feature extraction network includes a feature extraction module and a linear layer.
[0029] In one implementation, after preprocessing the plant image to be recognized, it is input into a preset feature extraction network to obtain target visual features, including: After preprocessing the plant image to be recognized, a second plant image is obtained; After inputting the second plant image into the preset feature extraction network, it is processed by the feature extraction module in the feature extraction network to obtain initial visual features; After inputting the initial visual features into the linear layer of the feature extraction network for dimension adjustment, target visual features are obtained.
[0030] Specifically, the type of the plant image to be recognized is judged: if the type is satellite remote sensing image, the plant image of satellite remote sensing image type is successively subjected to radiometric calibration, atmospheric correction, orthorectification, multi-spectral and full-band image fusion, target area image cropping, image normalization and image size unification operations to obtain a second plant image; if the type is non-satellite remote sensing image, the plant image of non-satellite remote sensing image type is subjected to image normalization and image size unification operations to obtain a second plant image. By differentially preprocessing images from different sources, a stable data basis is provided for model processing, thereby effectively ensuring the processing accuracy of the model.
[0031] Input the second plant image into the preset feature extraction network, and after being processed by the feature extraction module, initial visual features are obtained. The feature extraction module can be a Convolutional Neural Network (CNN) or a Transformer network. Then, the linear layer in the feature extraction network is used to adjust the dimensions of the initial visual features to adapt them to the subsequent hierarchical classification head, and target visual features are obtained.
[0032] Please refer to Figure 1 , the method for identifying plant species according to the embodiment of the present invention further includes the following steps: Step S300: Input the target visual features into the trained hierarchical classification head. The hierarchical classification head includes multiple classification layers, and each classification layer corresponds to different taxonomic ranks of plant classification in sequence. After classification prediction is performed layer by layer by the hierarchical classification head, the plant species recognition result is output.
[0033] Specifically, with the rapid development of deep learning technology, image classification methods based on convolutional neural networks (CNN) and transformer networks have been widely used in plant species recognition. However, plant species recognition faces many challenges, such as high visual similarity between species, complex image background, and variable lighting conditions. Traditional single classification methods often find it difficult to achieve high classification accuracy when dealing with these complex scenes. In the prior art, the plant species recognition task is usually simplified into a single flat recognition process, ignoring the inherent hierarchical structure of order-family-genus-species in plant taxonomy, resulting in the inability to effectively utilize taxonomic prior knowledge to improve accuracy. As the classification level deepens, the number of categories explodes exponentially, significantly increasing the model complexity and computational load, and reducing the training and reasoning efficiency of multi-level classification tasks. This approach only focuses on the final species classification results and ignores the intermediate level information (such as family-level features, genus-level features, etc.). The loss of this level of information will lead to insufficient generalization of the model in complex scenes, especially when facing species with high visual similarity, the classification error is large. At the same time, the lack of a hierarchical feature transfer mechanism makes it difficult for the model to extract effective discriminant features under complex backgrounds, lighting changes and noise interference, resulting in reduced plant classification accuracy and poor robustness.
[0034] The present invention sets a hierarchical classification head aligned with the plant classification level, which includes an order classification layer, a family classification layer, a genus classification layer and a species classification layer in sequence, and these classification layers are all linear layers. The order classification layer is used to predict the order classification of plants, the family classification layer is used to predict the family classification of plants, the genus classification layer is used to predict the genus classification of plants, and the species classification layer is used to predict the plant species. In this way, the taxonomic prior knowledge can be explicitly encoded into the network structure. Each classification layer corresponds to a specific biological classification unit, so that the model automatically learns the feature discrimination mode of different classification levels during the training process. This hierarchical classification method can make full use of the prior knowledge of plant taxonomy and enhance the discrimination ability of the classification layer. In addition, the exponentially growing category space is decomposed into four hierarchical tasks. For example, in the genus classification stage, the model only needs to distinguish several candidate genera, rather than directly facing tens of thousands of species categories, which significantly reduces the decision difficulty and computational complexity of single-level classification. The present invention can effectively guide the next classification layer with the morphological knowledge learned in the previous classification layer through layer-by-layer prediction, and effectively improve the accuracy of prediction. At the same time, the four levels of classification layers work together to enable the model to extract effective discriminant features under complex backgrounds, lighting changes and noise interference, further improving accuracy and robustness.
[0035] In one implementation, the target visual feature is input into a trained hierarchical classification head, which includes multiple classification layers. Each classification layer corresponds to a different taxonomic rank of plant classification in sequence. Through classification prediction layer by layer by the hierarchical classification head, a plant species recognition result is output, including: The target visual feature is input into the order classification layer. After classification processing, an order-level prediction probability is generated, which is converted into an order-level prediction feature through the embedding layer in the order classification layer, and is weighted and fused with the target visual feature using an attention mechanism to obtain a first concatenated feature; The first concatenated feature is input into the family classification layer. After classification processing, a family-level prediction probability is generated. The family-level prediction probability is converted into a family-level prediction feature through the embedding layer in the family classification layer, and is weighted and fused with the first concatenated feature using an attention mechanism to obtain a second concatenated feature; The second concatenated feature is input into the genus classification layer. After classification processing, a genus-level prediction probability is generated. The genus-level prediction probability is converted into a genus-level prediction feature through the embedding layer in the genus classification layer, and is weighted and fused with the second concatenated feature using an attention mechanism to obtain a third concatenated feature; The third concatenated feature is input into the species classification layer. After classification processing by the species classification layer, a species-level prediction probability is generated as the plant species recognition result and output.
[0036] Specifically, the order-level prediction probability is an order-level probability distribution, indicating the possibility that the plant image belongs to each order level. The family-level prediction probability is a family-level probability distribution, indicating the possibility that the plant image belongs to each family level. The genus-level prediction probability is a genus-level probability distribution, indicating the possibility that the plant image belongs to each genus level. The species-level prediction probability is a species-level probability distribution, indicating the possibility that the plant image belongs to each species level, that is, the final plant species recognition result.
[0037] The structural schematic diagram of the hierarchical classification head is as Figure 2 shown. After classification by each classification layer, the classification prediction probability is converted into a prediction feature through the embedding layer, and is concatenated with the feature of the previous layer to form a new feature vector. This feature concatenation mechanism can not only provide more information for the next layer, but also narrow the classification range of the next layer, thereby improving the classification accuracy. When facing species with high visual similarity, the present invention can effectively identify them. In addition, the hierarchical classification head of the present invention gradually narrows the candidate species set of each classification layer through the hierarchical constraints of the order classification layer, family classification layer, genus classification layer, and species classification layer, which greatly reduces the model calculation cost. By embedding the prior knowledge of plant taxonomy into the deep learning model in this way, the prediction probability of each level not only provides the classification result of the current taxonomic rank, but also constrains the search space of subsequent levels through feature fusion, so as to achieve efficient fine-grained species recognition.
[0038] In one implementation, the training steps of the hierarchical classification head include: Obtain a training set, where the training set contains a number of plant images and corresponding class labels at the order level, family level, genus level, and plant species labels; Input the training set into a preset feature extraction network to generate multiple target training visual features; Input all the target training visual features into the hierarchical classification head to be trained. In each classification layer of the hierarchical classification head, calculate the corresponding loss function, and add the loss functions of each layer according to preset weights to obtain the total loss function; Based on the total loss function, adjust the parameters of all classification layers in the hierarchical classification head through the backpropagation algorithm; Repeat the processes of generating target training visual features, calculating the total loss function, and adjusting parameters until after reaching the preset number of rounds, obtain the trained hierarchical classification head.
[0039] Specifically, the training set contains multiple plant images and the corresponding class labels at the order level, family level, genus level, and plant species labels for each plant image. These plant images cover images of various plants in different environments, different growth stages, and different shooting angles. By constructing a diverse training set, the generalization ability of the model can be effectively improved.
[0040] A corresponding loss function is introduced in each classification layer for deep supervised learning. A schematic diagram of the deep supervised learning mechanism in the order classification layer is as Figure 3 shown. When receiving the target training visual features output by the linear layer in the feature extraction network, the order classification layer calculates the loss function of this layer. The input data passes through the order classification layer, family classification layer, genus classification layer, and species classification layer in sequence. After each classification layer finishes processing the current classification task, immediately calculate the loss value of this classification layer and save the calculation result. The calculation flowchart of the total loss function is as Figure 4 shown. After the forward propagation of all classification layers is completed, sum the losses of each classification layer weighted by weights to obtain the total loss function. The loss function of each classification layer is the cross-entropy loss function. The total loss function is expressed as: ; where, α m1 , α m2 , α m3 , α L are preset weights, α m1 + α m2 + α m3 + α L = 1, and 0 ≤ α m1 , α m2 , α m3 , αL ≤1, is the loss function of the order classification layer, is the loss function of the family classification layer, is the loss function of the genus classification layer, is the loss function of the species classification layer, t j is the probability of the j-th class in the true label t, usually represented in one-hot encoding form. C is the number of categories of plant species, and j is the subscript representing the species. is the predicted probability that the plant output by the order classification layer belongs to the j-th class at the order level. is the predicted probability that the plant output by the family classification layer belongs to the j-th class at the family level. is the predicted probability that the plant output by the genus classification layer belongs to the j-th class at the genus level. is the predicted probability that the plant output by the family classification layer belongs to the j-th class at the family level. α can be dynamically adjusted during training. m1 α m2 α m3 α L The weights of. The present invention designs the total loss function as a weighted loss function. By assigning different weights to the loss functions of each layer, the classification results of the intermediate layer and the last layer are comprehensively considered. This weighted loss function can balance the classification tasks at different levels and avoid the overinfluence of the classification error of a certain layer on the overall result. The present invention ensures that the classification results of each layer are effectively supervised by designing a deep supervision mechanism, avoiding the classification error caused by the loss of hierarchical information in the traditional method, and effectively improving the overall classification accuracy and robustness of the model. In addition, through the hierarchical feature transfer method, the search space of the classification task is gradually reduced, significantly reducing the computational complexity. After multiple rounds of training, a trained hierarchical classification head can be obtained. The trained hierarchical classification head can be well applied to the scenario of plant species recognition. When processing images with complex backgrounds, illumination changes, and noise interference, it can effectively extract features and judge the category of plants.
[0041] In summary, the present invention does not rely on traditional single classification strategies. By simulating the hierarchical structure of plant taxonomy, it conducts coarse classification and fine classification layer by layer, and is applicable to complex plant species classification tasks. The present invention can automatically extract the features of plant images and gradually refine the classification results through a hierarchical classification head. This hierarchical classification method can make full use of the prior knowledge of plant taxonomy, enhance the discriminative ability of the classifier, and thus improve the accuracy of species recognition. The four-level classification layers cooperate with each other, enabling the model to extract effective discriminative features under complex backgrounds, illumination changes, and noise interference, further improving the accuracy and robustness. Decomposing the exponentially growing category space into four-level tasks significantly reduces the decision-making difficulty and computational complexity of single-level classification. The classification results of each layer are constrained by supervision signals, realizing deep supervised learning, thereby avoiding classification errors caused by the loss of hierarchical information in traditional methods. Through this hierarchical classification head, the present invention can significantly improve the generalization ability and robustness of the model while ensuring the classification accuracy.
[0042] In one embodiment, as Figure 5 shown, based on the above plant species recognition method, the present invention also correspondingly provides a plant species recognition device, which includes: An image acquisition module 100 for acquiring plant images to be recognized; A target visual feature generation module 200 for inputting the plant images to be recognized, after preprocessing, into a preset feature extraction network to obtain target visual features; A species recognition module 300 for inputting the target visual features into a trained hierarchical classification head, the hierarchical classification head includes multiple classification layers, and each classification layer corresponds to different taxonomic ranks of plant classification in sequence. After classification prediction is performed layer by layer by the hierarchical classification head, a plant species recognition result is output.
[0043] In one embodiment, the target visual feature generation module includes: A preprocessing unit for preprocessing the plant images to be recognized to obtain second plant images; A coarse feature extraction unit for inputting the second plant images into a preset feature extraction network and processing them through a feature extraction module in the feature extraction network to obtain initial visual features; A target visual feature generation unit for inputting the initial visual features into a linear layer of the feature extraction network for dimension adjustment to obtain target visual features.
[0044] In one embodiment, the device further includes: A species judgment unit for judging the species of the plant images to be recognized; The first image processing unit is configured to, if the type is satellite remote sensing image, perform radiometric calibration, atmospheric correction, orthorectification, multi-spectral and panchromatic image fusion, target area image cropping, image normalization, and image size unification operations on the plant image of the satellite remote sensing image type in sequence to obtain a second plant image; The second image processing unit is configured to, if the type is non-satellite remote sensing image, perform image normalization and image size unification operations on the plant image of the non-satellite remote sensing image type to obtain a second plant image.
[0045] In one embodiment, the species recognition module includes: The first prediction unit is configured to input the target visual feature into the target classification layer, generate a target layer prediction probability after classification processing, convert it into a target layer prediction feature through the embedding layer in the target classification layer, and perform weighted fusion with the target visual feature by using an attention mechanism to obtain a first splicing feature; The second prediction unit is configured to input the first splicing feature into the family classification layer, generate a family layer prediction probability after classification processing, convert the family layer prediction probability into a family layer prediction feature through the embedding layer in the family classification layer, and perform weighted fusion with the first splicing feature by using an attention mechanism to obtain a second splicing feature; The third prediction unit is configured to input the second splicing feature into the genus classification layer, generate a genus layer prediction probability after classification processing, convert the genus layer prediction probability into a genus layer prediction feature through the embedding layer in the genus classification layer, and perform weighted fusion with the second splicing feature by using an attention mechanism to obtain a third splicing feature; The fourth prediction unit is configured to input the third splicing feature into the species classification layer, generate a species layer prediction probability after classification processing by the species classification layer as the plant species recognition result and output it.
[0046] In one embodiment, the device further includes: The training set acquisition unit is configured to acquire a training set, where the training set includes a number of plant images and corresponding target-level category annotations, family-level category annotations, genus-level category annotations, and plant species annotations; The target training visual feature generation unit is configured to input the training set into a preset feature extraction network to generate a plurality of target training visual features; The loss function calculation unit is configured to input all the target training visual features into the hierarchical classification head to be trained, calculate the corresponding loss function in each classification layer of the hierarchical classification head, and add the loss functions of each layer according to a preset weight to obtain a total loss function; The parameter update unit is configured to adjust the parameters of all classification layers in the hierarchical classification head based on the total loss function through the backpropagation algorithm; An iterative unit is used to repeatedly perform the processes of generating target training visual features, calculating the total loss function, and adjusting parameters until, after reaching a preset number of rounds, a trained hierarchical classification head is obtained.
[0047] Based on the above embodiments, the present invention also provides a terminal, and its structural schematic diagram can be as Figure 6 shown. The above terminal includes a processor, a memory, a network interface, and a display screen connected through a device bus. Among them, the processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating device and a plant species recognition program. The internal memory provides an environment for the operation of the operating device and the plant species recognition program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal through a network connection. When the plant species recognition program is executed by the processor, the steps of any one of the above plant species recognition methods are implemented. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen.
[0048] Those skilled in the art can understand that Figure 6 the structural schematic diagram shown in
[0049] is only a schematic diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0050] In an embodiment, a terminal is provided. The above terminal includes a memory, a processor, and a plant species recognition program stored on the above memory and executable on the above processor. When the plant species recognition program is executed by the above processor, the steps of any one of the plant species recognition methods provided by the embodiments of the present invention are implemented.
[0051] It should be understood that the sequence numbers of the above steps do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0052] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present invention. The specific working processes of the units and modules in the above device can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0053] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0054] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0055] In the embodiments provided by the present invention, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / terminal device embodiments described above are only illustrative. For example, the above division of modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0056] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or perform equivalent replacements for some of the technical features. However, these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the respective embodiments of the present invention and should all be included in the protection scope of the present invention.
Claims
1. A method for identifying plant species, characterized in that, The method includes: Obtaining a plant image to be recognized; After preprocessing the plant image to be recognized, inputting it into a preset feature extraction network to obtain target visual features; Inputting the target visual features into a trained hierarchical classification head, the hierarchical classification head includes multiple classification layers, each classification layer corresponds to a different taxonomic rank of plant classification in sequence, and through the hierarchical classification head, classification prediction is performed layer by layer, and the plant species recognition result is output.
2. The plant species identification method according to claim 1, characterized in that, After preprocessing the plant image to be recognized, inputting it into a preset feature extraction network to obtain target visual features, including: After preprocessing the plant image to be recognized, obtaining a second plant image; After inputting the second plant image into the preset feature extraction network, processing it through the feature extraction module in the feature extraction network to obtain initial visual features; After inputting the initial visual features into the linear layer of the feature extraction network for dimension adjustment, obtaining target visual features.
3. The plant species identification method according to claim 2, characterized in that After preprocessing the plant image to be recognized, obtaining a second plant image, including: Judging the species of the plant image to be recognized; If the species is a satellite remote sensing image, performing radiometric calibration, atmospheric correction, orthorectification, multi-spectral and panchromatic image fusion, target area image cropping, image normalization, and image size unification operations on the plant image of the satellite remote sensing image in sequence to obtain a second plant image; If the species is a non-satellite remote sensing image, performing image normalization and image size unification operations on the plant image of the non-satellite remote sensing image to obtain a second plant image.
4. The plant species recognition method according to claim 1, characterized in that, The multiple classification layers include an order classification layer, a family classification layer, a genus classification layer, and a species classification layer. The order classification layer is used to predict the order-level classification of plants, the family classification layer is used to predict the family-level classification of plants, the genus classification layer is used to predict the genus-level classification of plants, and the species classification layer is used to predict plant species.
5. The plant species recognition method according to claim 4, wherein Inputting the target visual features into a trained hierarchical classification head, the hierarchical classification head includes multiple classification layers, each classification layer corresponds to a different taxonomic rank of plant classification in sequence, and through the hierarchical classification head, classification prediction is performed layer by layer, and the plant species recognition result is output, including: Inputting the target visual features into the order classification layer, generating an order-level prediction probability after classification processing, converting it into an order-level prediction feature through the embedding layer in the order classification layer, and performing weighted fusion with the target visual features using an attention mechanism to obtain a first concatenated feature; Inputting the first concatenated feature into the family classification layer, generating a family-level prediction probability after classification processing, converting the family-level prediction probability into a family-level prediction feature through the embedding layer in the family classification layer, and performing weighted fusion with the first concatenated feature using an attention mechanism to obtain a second concatenated feature; Inputting the second concatenated feature into the genus classification layer, generating a genus-level prediction probability after classification processing, converting the genus-level prediction probability into a genus-level prediction feature through the embedding layer in the genus classification layer, and performing weighted fusion with the second concatenated feature using an attention mechanism to obtain a third concatenated feature; Input the third splicing feature into the species classification layer. After classification processing by the species classification layer, generate the species layer prediction probability as the plant species recognition result and output it.
6. The plant species identification method according to claim 1, characterized in that The training steps of the hierarchical classification head include: Obtain a training set, which contains a number of plant images and corresponding order-level category annotations, family-level category annotations, genus-level category annotations, and plant species annotations; Input the training set into a preset feature extraction network to generate multiple target training visual features; Input all the target training visual features into the hierarchical classification head to be trained. In each classification layer of the hierarchical classification head, calculate the corresponding loss function, and add the loss functions of each layer according to preset weights to obtain the total loss function; Based on the total loss function, adjust the parameters of all classification layers in the hierarchical classification head through the backpropagation algorithm; Repeat the process of generating target training visual features, calculating the total loss function, and adjusting parameters until, after reaching the preset number of rounds, obtain the trained hierarchical classification head.
7. The plant species identification method according to claim 6, characterized in that, The loss function of each classification layer is the cross-entropy loss function.
8. A plant species recognition device, characterized in that It includes: An image acquisition module for acquiring a plant image to be recognized; A target visual feature generation module for inputting the plant image to be recognized, after preprocessing, into a preset feature extraction network to obtain target visual features; A species recognition module for inputting the target visual features into the trained hierarchical classification head. The hierarchical classification head contains multiple classification layers, and each classification layer corresponds to a different taxonomic rank of plant classification in sequence. After classification prediction by the hierarchical classification head layer by layer, output the plant species recognition result.
9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a plant species recognition program stored on the memory and executable on the processor. When the plant species recognition program is executed by the processor, it implements the steps of the plant species recognition method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A plant species recognition program is stored on the computer-readable storage medium. When the plant species recognition program is executed by the processor, it implements the steps of the plant species recognition method according to any one of claims 1-7.
Citation Information
Patent Citations
Plant recognition method based on deep learning and plant classification
CN109871885A
Long-tail distribution image recognition method based on hierarchical learning
CN111738303A
Hierarchical classification method for wild animal monitoring images based on species classification tree
CN119723171A
Image Recognition Method and System of Convolutional Neural Network Based on Global Detail Supplement
US20230368497A1
Cited By
Electric power multi-modal sample knowledge enhancement question-answering method, system and device and medium
CN120851224A