A flower identification and classification method and device

By using a machine learning model based on the Transformer architecture, combined with the Conv-Trans and ResMLP modules, and employing knowledge distillation training, the problem of imperfect local and global feature extraction in flower image classification was solved, achieving efficient and accurate flower recognition and classification.

CN115359353BActive Publication Date: 2026-07-03GUANGDONG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG UNIV OF TECH
Filing Date
2022-08-19
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing flower image classification methods struggle to simultaneously focus on both local and global key features of an image, resulting in imperfect feature extraction capabilities and inaccurate classification.

Method used

A machine learning model based on the Transformer architecture is adopted, combining the Conv-Trans module and the ResMLP module. Feature fusion is performed through multi-head self-attention mechanism and convolution operation, and a classifier is built using knowledge distillation training method to achieve accurate extraction and classification of flower features.

Benefits of technology

It improves the accuracy of flower image classification, enables efficient feature extraction and classification on small-scale networks, is suitable for edge embedded devices, and reduces human and material costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115359353B_ABST
    Figure CN115359353B_ABST
Patent Text Reader

Abstract

The application discloses a flower identification and classification method and device, and provides a scheme for photographing flowers to obtain images, or directly selecting images from an album; then, preprocessing is performed, and a flower object is obtained after the image is preprocessed; finally, a flower image after the preprocessing is subjected to a flower identification model to obtain a final classification result, wherein the flower identification model adopts a Transformer architecture design model, uses a self-attention mechanism to extract features from the whole image, focuses attention on the flower part and ignores the complex background, so that the flower features can be accurately extracted, accurate classification can be realized, and the technical problem that the existing classification method adopts a convolution method to extract local image features, cannot simultaneously pay attention to local and global key features, the feature extraction capability is imperfect, and the classification is inaccurate is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, and in particular to a method and apparatus for flower identification and classification. Background Technology

[0002] In the field of floriculture, automated cultivation first requires the identification and classification of flowers to further monitor their growth. Relying on professional guidance for a large amount of repetitive flower classification work results in significant waste of human and material resources. Therefore, there is a huge demand and practical application value in using artificial intelligence technology for the automated identification and classification of flowers.

[0003] In the field of flower image classification, most traditional classification methods are based on extracting corresponding features using specific image processing algorithms, and then using a classifier to perform mathematical analysis on the features to obtain the classification result. However, most existing methods use convolution to extract local features of the image, which makes it difficult to simultaneously focus on key local and global features, resulting in imperfect feature extraction capabilities and difficulty in achieving accurate classification. Summary of the Invention

[0004] This application provides a flower identification and classification method and apparatus to solve the technical problem that existing classification methods use convolution to extract local features of images, which makes it difficult to simultaneously focus on key local and global features, resulting in imperfect feature extraction capabilities and inaccurate classification.

[0005] To address the aforementioned technical problems, the first aspect of this application provides a method for flower identification and classification, comprising:

[0006] Collect images of the flowers to be identified;

[0007] The flower image is preprocessed;

[0008] The preprocessed flower images are input into a preset flower recognition model for recognition and classification to obtain classification results. The flower recognition model is a machine learning model based on the Transformer structure, and the flower recognition model is specifically composed of a linear mapping layer, multiple Conv-Trans modules, multiple ResMLP modules, and a classifier.

[0009] The Conv-Trans module is used to perform spatial domain feature fusion on the image block sequence through a multi-head self-attention mechanism, and then perform channel domain feature fusion on the image block sequence through convolution operation.

[0010] The ResMLP module is used to integrate the channel domain features and spatial domain features of the image block sequence through ResMLP processing.

[0011] The classifier is constructed based on a student network model obtained through knowledge distillation training.

[0012] Preferably, the formula for the convolution process is as follows:

[0013]

[0014] In the formula, Z i X represents the output of the image patch sequence after passing through the Conv-Trans module. i Let be the input image patch sequence, σ be the GELU activation function, n be the length of the image patch sequence, T be the matrix transpose, W1 be the convolution operation based on the first convolution kernel, and W2 be the convolution operation based on the second convolution kernel.

[0015] Preferably, the formula definition of the ResMLP module is specifically as follows:

[0016] Y i =X i +W3·σ·(W4·LayerNorm(X) i )

[0017] i = 1, 2, 3, ..., n

[0018] In the formula, Y i X represents the output of the image patch sequence after passing through the ResMLP module. i σ is the input image patch sequence, σ is the GELU activation function, n is the length of the image patch sequence, W3 represents the convolution operation based on the third convolution kernel, and W4 represents the convolution operation based on the fourth convolution kernel.

[0019] Preferably, the knowledge distillation training method is a soft distillation training method.

[0020] Preferably, the objective function of the classifier is:

[0021] L total =(1-λ)L CE (ψ(z s ),y)+λT 2 L KL (ψ(z s ,T),ψ(z t ,T))

[0022] In the formula, L total It is the total loss; L CE () is the cross-entropy loss function; L KL () is the KL divergence loss function; ψ() is the soft objective function; z s and z tThese are the class classification probabilities output by the student model and the teacher model, respectively; T is the temperature coefficient, λ is the distillation coefficient, and y is the classification label.

[0023] The soft objective function is specifically:

[0024]

[0025] In the formula, q i For the soft target output of the function, z i It is the category classification probability output by the student model or the teacher model.

[0026] A second aspect of this application provides a flower identification and classification device, comprising:

[0027] Image acquisition unit, used to acquire images of the flowers to be identified;

[0028] A preprocessing unit is used to preprocess the flower image;

[0029] The model classification processing unit is used to input the preprocessed flower image into a preset flower recognition model for recognition and classification to obtain classification results. The flower recognition model is a machine learning model based on the Transformer structure, and the flower recognition model specifically consists of a linear mapping layer, multiple Conv-Trans modules, multiple ResMLP modules, and a classifier.

[0030] The Conv-Trans module is used to perform spatial domain feature fusion on the image block sequence through a multi-head self-attention mechanism, and then perform channel domain feature fusion on the image block sequence through convolution operation.

[0031] The ResMLP module is used to integrate the channel domain features and spatial domain features of the image block sequence through ResMLP processing.

[0032] The classifier is constructed based on a student network model obtained through knowledge distillation training.

[0033] Preferably, the formula for the convolution process is as follows:

[0034]

[0035] In the formula, Z i X represents the output of the image patch sequence after passing through the Conv-Trans module. i Let be the input image patch sequence, σ be the GELU activation function, n be the length of the image patch sequence, T be the matrix transpose, W1 be the convolution operation based on the first convolution kernel, and W2 be the convolution operation based on the second convolution kernel.

[0036] Preferably, the formula definition of the ResMLP module is specifically as follows:

[0037] Yi = X i +W3·σ·(W4·LayerNorm(X) i )

[0038] i = 1, 2, 3, ..., n

[0039] In the formula, Y i X represents the output of the image patch sequence after passing through the ResMLP module. i σ is the input image patch sequence, σ is the GELU activation function, n is the length of the image patch sequence, W3 represents the convolution operation based on the third convolution kernel, and W4 represents the convolution operation based on the fourth convolution kernel.

[0040] Preferably, the knowledge distillation training method is a soft distillation training method.

[0041] Preferably, the objective function of the classifier is:

[0042] L total =(1-λ)L CE (ψ(z s ),y)+λT 2 L KL (ψ(z s ,T),ψ(z t ,T))

[0043] In the formula, L total It is the total loss; L CE () is the cross-entropy loss function; L KL () is the KL divergence loss function; ψ() is the soft objective function; z s and z t These are the class classification probabilities output by the student model and the teacher model, respectively; T is the temperature coefficient, λ is the distillation coefficient, and y is the classification label.

[0044] The soft objective function is specifically:

[0045]

[0046] In the formula, q i For the soft target output of the function, z i It is the category classification probability output by the student model or the teacher model.

[0047] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0048] The solution provided in this application involves capturing images of flowers or directly selecting images from a photo album; then preprocessing the images to obtain flower objects; finally, the preprocessed flower images are processed through a flower recognition model to obtain the final classification result. The flower recognition model in this application adopts a Transformer architecture and utilizes its self-attention mechanism to extract features from the global image, focusing attention on the flower parts while ignoring complex backgrounds, thereby achieving accurate extraction of flower features and accurate classification. This solves the technical problem of existing classification methods that use convolution to extract local image features, making it difficult to simultaneously focus on key local and global features, resulting in imperfect feature extraction capabilities and inaccurate classification. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 A schematic diagram of the overall system framework for a flower identification and classification method provided in this application.

[0051] Figure 2 This is a flowchart illustrating an embodiment of a flower identification and classification method provided in this application.

[0052] Figure 3 This is a framework diagram for knowledge distillation.

[0053] Figure 4 This is a schematic diagram of one embodiment of a flower identification and classification device provided in this application. Detailed Implementation

[0054] This application provides a flower identification and classification method and apparatus to solve the technical problem that existing classification methods use convolution to extract local features of images, which makes it difficult to simultaneously focus on key local and global features, resulting in imperfect feature extraction capabilities and inaccurate classification.

[0055] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] like Figure 1 As shown, this application is based on the flower recognition model provided below. The flower recognition method of this embodiment can be implemented through a mobile-based flower recognition system. This system can be divided into a mobile client and a cloud server, adopting a client-server (C / S) model. The mobile client device can be a mobile phone or an embedded device such as a microcontroller.

[0057] The mobile client is primarily responsible for flower image acquisition, image preprocessing, and running a small-scale network model for flower image classification. The specific workflow is as follows: First, the mobile device's camera is used to capture images of flowers, or images are directly selected from the photo album; then, preprocessing is performed, including cropping or flipping the image, and using an interactive selection box to define a square area containing the flower object; finally, the preprocessed flower image is passed through the network model to obtain the final classification result.

[0058] The main function of the server is to train the network model and interact with the mobile device.

[0059] Please see Figure 2 The first embodiment of this application provides a method for flower identification and classification, including:

[0060] Step 101: Collect images of the flowers to be identified.

[0061] Step 102: Preprocess the flower image.

[0062] Step 103: Input the preprocessed flower image into the preset flower recognition model for recognition and classification to obtain the classification result. The flower recognition model is a machine learning model based on the Transformer structure, and the flower recognition model is specifically composed of a linear mapping layer, multiple Conv-Trans modules, multiple ResMLP modules and a classifier.

[0063] The system model design provided in this embodiment uses 1×1 convolutional kernels instead of linear layers, which increases the network's flexibility and enhances its nonlinear expressive power. Linear fully connected layers require a fixed input tensor size, while convolution can arbitrarily adjust the input tensor size. Furthermore, linear fully connected layers disrupt the spatial structure of feature maps, while convolution operations preserve the spatial characteristics of two-dimensional feature maps. Unlike the pyramid architecture of convolutional neural networks, the input to each layer is of a fixed size, consistent with ViT. However, ViT adds a classification label block to the input image patch sequence as the basis for the final classification output, while this model does not add a classification label block; the final classification output is based on the average output of the image patch sequence.

[0064] It should be noted that the Conv-Trans module is used to perform spatial domain feature fusion on the image patch sequence through a multi-head self-attention mechanism, and then to perform channel domain feature fusion on the image patch sequence through convolution operation.

[0065] The Conv-Trans module design includes a multi-head self-attention layer, two convolutional layers, and one non-linear layer. Skip-layer connections and layer normalization are also incorporated into the module.

[0066] This module follows multi-head self-attention with convolutional operations. The input image is a c×h×w image (where h is the height, w is the width, and c is the number of channels). After passing through a linear layer, it produces a sequence of image blocks, each with a size of c×p×p, forming an image block sequence X(x1, x2, ..., x...). n ), with a length of n, n = h·w / p 2 'p' represents the length and width of each image patch, typically chosen to be 16×16 or 32×32. Smaller patch sizes result in longer sequences. The sequence size remains unchanged after passing through a multi-head self-attention mechanism, but its dimensions need to be transposed before convolution. The specific formula for the convolution operation is defined as follows:

[0067]

[0068] Z i X represents the output of the image patch sequence after passing through the Conv-Trans module. i The input is σ, the GELU activation function is n, the length of the image patch sequence is n, T represents transpose, and W represents the convolution operation. The subscripts of W represent different convolution kernels. That is, W1 represents the convolution operation based on the first convolution kernel, and W2 represents the convolution operation based on the second convolution kernel.

[0069] The ResMLP (Residual Multi-layer Perceptron) module is used to integrate the channel domain features and spatial domain features of an image block sequence through ResMLP processing.

[0070] It should be noted that the ResMLP module design in this embodiment includes two fully connected layers and one nonlinear layer, with a Dropout layer added between each fully connected layer and the nonlinear layer. To improve network performance, layer normalization is added to each ResMLP module, and the concept of residual networks is introduced, with skip connections added between each ResMLP module. The specific formulas for the modules are defined as follows:

[0071] Y i =Xi +W3·σ·(W4·LayerNorm(X) i )

[0072] i = 1, 2, 3, ..., n

[0073] Where Y i X represents the output of the image patch sequence after passing through the ResMLP module. i σ is the input, n is the length of the image patch sequence, W3 represents the convolution operation based on the third convolution kernel, and W4 represents the convolution operation based on the fourth convolution kernel.

[0074] The classifier is constructed based on a student network model obtained through knowledge distillation training.

[0075] It should be noted that knowledge distillation transfers knowledge learned by a large-scale pre-trained model to a smaller network model. The flower datasets used in this example are all small-scale. Directly using them to train large networks could easily lead to overfitting and poor generalization. Flower image classification is a fine-grained image classification method, where different flower species exhibit certain similarities. Using knowledge distillation allows for better utilization of soft targets, which have higher entropy values ​​and contain more information than hard targets, including the relationships between different flower species.

[0076] Moreover, knowledge distillation can transfer knowledge learned by large-scale networks to smaller networks with weaker learning capabilities. Small, lightweight networks are easier to deploy on edge embedded devices, enabling the true implementation of AI automation technologies.

[0077] The soft target is defined by the following formula:

[0078]

[0079] Where: T is a temperature parameter that controls the softening degree of the output probability. When T = 1, the output is the class probability of SoftMax. As T approaches infinity, this formula is equivalent to the logic unit of the network output; z i The SoftMax function outputs the probability of each classification category; q i This is the soft target output of the function.

[0080] Knowledge distillation can be divided into soft distillation and hard distillation. The difference lies in whether it utilizes the soft target or the hard target output by the teacher network. The hard target is the predicted label output by the teacher network. This embodiment preferably uses soft distillation, and its framework process is as follows: Figure 3As shown, the purpose of soft distillation is to minimize the Kullback-Leibler divergence between the SoftMax output of the teacher model and the SoftMax output of the student model. The loss function for soft knowledge distillation is as follows:

[0081] L total =(1-λ)L CE (ψ(z s ),y)+λT 2 L KL (ψ(z s ,T),ψ(z t ,T))

[0082] Where: L total It is the total loss; L CE () is the cross-entropy loss function; L KL () is the KL divergence loss function; ψ() is the soft objective function; z s and z t These are the category classification probabilities output by the student model and the teacher model, respectively; T is the temperature coefficient.

[0083] This application proposes a solution that, based on the existing ViT (Vision Transformer) network, utilizes its self-attention mechanism to accurately extract flower features. It then introduces a double convolutional layer and a residual structure RseMLP (Residual Multi-layer Perceptron) fully connected layer to enhance the model's feature extraction and recognition capabilities. The double convolutional layer makes the model's attention mechanism more focused and accurate, further strengthening its feature extraction ability. Building upon this, a ResMLP module is introduced into the proposed model to further improve classification accuracy. Secondly, in validating and evaluating the model, in addition to using publicly available datasets, a self-made, more complex, fine-grained dataset is used to address the limitation of datasets. Finally, a knowledge distillation method is proposed to compress large-scale network models. Large-scale network models possess better learning capabilities, and knowledge distillation can transfer knowledge learned by large-scale networks to smaller, less capable networks. Small, lightweight networks are easier to deploy on edge embedded devices, enabling the true implementation of AI automation technology.

[0084] The above content is a detailed description of an embodiment of a flower identification and classification method provided by this application. The following is a detailed description of an embodiment of a flower identification and classification device provided by this application.

[0085] Please see Figure 4 The second aspect of this application provides a flower identification and classification device, comprising:

[0086] Image acquisition unit 201 is used to acquire images of flowers to be identified;

[0087] Preprocessing unit 202 is used to preprocess the flower image;

[0088] The model classification processing unit 203 is used to input the preprocessed flower image into a preset flower recognition model for recognition and classification to obtain classification results. The flower recognition model is a machine learning model based on the Transformer structure, and the flower recognition model is specifically composed of a linear mapping layer, multiple Conv-Trans modules, multiple ResMLP modules and a classifier.

[0089] The Conv-Trans module is used to fuse spatial domain features of image patch sequences through a multi-head self-attention mechanism, and then fuse channel domain features of image patch sequences through convolution operations.

[0090] The ResMLP module is used to integrate the channel domain features and spatial domain features of an image block sequence through ResMLP processing.

[0091] The classifier is constructed based on a student network model obtained through knowledge distillation training.

[0092] Furthermore, the specific formula for convolution processing is as follows:

[0093]

[0094] In the formula, Z i X represents the output of the image patch sequence after passing through the Conv-Trans module. i Let be the input image patch sequence, σ be the GELU activation function, n be the length of the image patch sequence, and T be the matrix transpose.

[0095] Furthermore, the formula definition of the ResMLP module is as follows:

[0096] Y i =X i +W3·σ·(W4·LayerNorm(X) i )

[0097] i = 1, 2, 3, ..., n

[0098] In the formula, Y i X represents the output of the image patch sequence after passing through the ResMLP module. i σ is the input image patch sequence, σ is the GELU activation function, n is the length of the image patch sequence, W3 represents the convolution operation based on the third convolution kernel, and W4 represents the convolution operation based on the fourth convolution kernel.

[0099] Furthermore, the knowledge distillation training method is specifically a soft distillation training method.

[0100] Furthermore, the objective function of the classifier is specifically:

[0101] L total =(1-λ)L CE (ψ(z s ),y)+λT 2 L KL (ψ(z s ,T),ψ(z t ,T))

[0102] In the formula, L total It is the total loss; L CE () is the cross-entropy loss function; L KL () is the KL divergence loss function; ψ() is the soft objective function; z s and z t These are the class classification probabilities output by the student model and the teacher model, respectively; T is the temperature coefficient, λ is the distillation coefficient, and y is the classification label.

[0103] The soft objective function is as follows:

[0104]

[0105] In the formula, q i For the soft target output of the function, z i It is the category classification probability output by the student model or the teacher model.

[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the terminals, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0107] In the several embodiments provided in this application, it should be understood that the disclosed terminals, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0108] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0109] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0110] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0111] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0112] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A flower identification classification method, characterized by, include: Collect images of the flowers to be identified; The flower image is preprocessed; The preprocessed flower images are input into a preset flower recognition model for recognition and classification to obtain classification results. The flower recognition model is a machine learning model based on the Transformer structure, and the flower recognition model is specifically composed of a linear mapping layer, multiple Conv-Trans modules, multiple ResMLP modules, and a classifier. The Conv-Trans module is used to perform spatial domain feature fusion on the image block sequence through a multi-head self-attention mechanism, and then perform channel domain feature fusion on the image block sequence through convolution operation. The ResMLP module is used to integrate the channel domain features and spatial domain features of the image block sequence through ResMLP processing. The classifier is constructed based on a student network model obtained through knowledge distillation training.

2. The flower recognition and classification method of claim 1, wherein, The specific formula for the convolution process is as follows: In the formula, denotes the output of the image block sequence through the Conv-Trans module, is the input image block sequence, is the GELU activation function, is the length of the image block sequence, denotes the matrix transpose, W1 represents the convolution operation based on the first convolution kernel, and W2 represents the convolution operation based on the second convolution kernel.

3. The flower identification and classification method according to claim 1, characterized in that, The formula definition of the ResMLP module is as follows: In the formula, This represents the output of the ResMLP module, which represents the sequence of image patches. Given a sequence of image patches as input, For GELU activation function, W3 represents the length of the image patch sequence, W4 represents the convolution operation based on the third convolution kernel, and W3 represents the convolution operation based on the fourth convolution kernel.

4. The flower identification and classification method according to claim 1, characterized in that, The knowledge distillation training method is specifically a soft distillation training method.

5. The flower identification and classification method according to claim 4, characterized in that, The objective function of the classifier is specifically: In the formula, This is the total loss; It is the cross-entropy loss function; It is the KL divergence loss function; It is a soft objective function; and These are the category classification probabilities output by the student model and the teacher model, respectively. That is the temperature coefficient. y is the distillation coefficient, and y is the classification label; The soft objective function is specifically: In the formula, For the soft target output of the function, It is the category classification probability result output by the student model or the teacher model.

6. A flower identification and classification device, characterized in that, include: Image acquisition unit, used to acquire images of the flowers to be identified; A preprocessing unit is used to preprocess the flower image; The model classification processing unit is used to input the preprocessed flower image into a preset flower recognition model for recognition and classification to obtain classification results. The flower recognition model is a machine learning model based on the Transformer structure, and the flower recognition model specifically consists of a linear mapping layer, multiple Conv-Trans modules, multiple ResMLP modules, and a classifier. The Conv-Trans module is used to perform spatial domain feature fusion on the image block sequence through a multi-head self-attention mechanism, and then perform channel domain feature fusion on the image block sequence through convolution operation. The ResMLP module is used to integrate the channel domain features and spatial domain features of the image block sequence through ResMLP processing. The classifier is constructed based on a student network model obtained through knowledge distillation training.

7. A flower identification and classification device according to claim 6, characterized in that, The specific formula for the convolution process is as follows: In the formula, This represents the output of the image patch sequence after passing through the Conv-Trans module. Given a sequence of image patches as input, For GELU activation function, The length of the image patch sequence. W1 represents the matrix transpose, W2 represents the convolution operation based on the first convolution kernel, and W2 represents the convolution operation based on the second convolution kernel.

8. A flower identification and classification device according to claim 6, characterized in that, The formula definition of the ResMLP module is as follows: In the formula, This represents the output of the ResMLP module, which represents the sequence of image patches. Given a sequence of image patches as input, For GELU activation function, W3 represents the length of the image patch sequence, W4 represents the convolution operation based on the third convolution kernel, and W3 represents the convolution operation based on the fourth convolution kernel.

9. A flower identification and classification device according to claim 6, characterized in that, The knowledge distillation training method is specifically a soft distillation training method.

10. A flower identification and classification device according to claim 9, characterized in that, The objective function of the classifier is specifically: In the formula, This is the total loss; It is the cross-entropy loss function; It is the KL divergence loss function; It is a soft objective function; and These are the category classification probabilities output by the student model and the teacher model, respectively. That is the temperature coefficient. y is the distillation coefficient, and y is the classification label; The soft objective function is specifically: In the formula, For the soft target output of the function, It is the category classification probability output by the student model or the teacher model.