A method, apparatus, and medium for flower quality grading
By applying multimodal feature fusion and deep neural networks, the scientific and reliability issues of flower value assessment have been solved, and the accuracy and interpretability of flower quality grading have been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AGRI INFORMATION INST OF CHINESE ACAD OF AGRI SCI
- Filing Date
- 2025-02-05
- Publication Date
- 2026-05-29
AI Technical Summary
Current flower valuation techniques lack scientific rigor and reliability, especially in online transactions where reliable valuation references are lacking, and the grading results are not interpretable.
A multimodal feature fusion method was adopted, combining image and text data. Key features were extracted using regular expressions, and deep neural networks were used to grade flower quality. The SHAP analysis algorithm was then used to quantify the feature contribution.
It improves the accuracy and interpretability of flower quality grading and provides a scientific reference for value assessment.
Smart Images

Figure CN120071063B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of plant testing technology, and in particular to a method, equipment and medium for grading the quality of flowers. Background Technology
[0002] In recent years, with the improvement of living standards, the popularity of flower cultivation in households has increased significantly. However, in the current flower industry transaction, the valuation of flowers mainly relies on the subjective preferences of sellers and consumers, and different cultivation experts disagree on the assessment of flower quality and value. Therefore, the standards for flower valuation and the key characteristics affecting their value are still unclear, especially in the increasingly popular online transactions, where the lack of labeled data makes it impossible to provide consumers with reliable value assessment references.
[0003] Existing flower feature extraction algorithms primarily rely on image data for flower variety classification or flower quantity extraction, or combine existing grading standards with image data to classify flower quality. However, these methods employ a single-modal image data approach, failing to extract key features that truly reflect the value of flowers. Furthermore, the grading results lack interpretability, resulting in insufficient reliability and scientific rigor, and are ill-suited for high-value flowers lacking clearly defined grading standards. Summary of the Invention
[0004] The purpose of this application is to provide a method, equipment, and medium for grading the quality of flowers, which can improve the accuracy of flower quality grading.
[0005] To achieve the above objectives, this application provides the following solution:
[0006] Firstly, this application provides a method for grading the quality of flowers, including:
[0007] Collect image and text data of the target flower;
[0008] Regular expressions are used to perform pattern matching on text data to extract multiple target key features. Each target key feature includes a feature name and a feature value.
[0009] Each feature name is used to form an index vector, which is then input into the embedding layer to obtain a feature index vector; each feature value is used to form a feature value vector.
[0010] The image data is segmented to obtain a petal image after removing the background;
[0011] The average RGB color is determined based on the petal image;
[0012] The petal image is subjected to feature transformation to obtain a global fine-grained feature vector;
[0013] Perform a vector dot product operation on the feature index vector, the feature value vector, and the average RGB color to obtain the dot product output;
[0014] The dot product output is concatenated with the global fine-grained feature vector to obtain a multimodal feature fusion vector;
[0015] The multimodal feature fusion vector is input into the flower quality grading model to obtain the grading result; the flower quality grading model is obtained by training a deep neural network using a training set.
[0016] Optionally, after inputting the multimodal feature fusion vector into the flower quality grading model to obtain the grading result, the flower quality grading method further includes:
[0017] The SHAP analysis algorithm is used to calculate the marginal contribution of each target's key features to the classification results.
[0018] Optionally, the target key features include petal shape, longest leaf length, widest leaf width, leaf height, number of flowers, number of seedlings, and number of buds.
[0019] Optionally, image segmentation is performed on the image data to obtain a petal image after removing the background, specifically including:
[0020] The image data was segmented using a UNet neural network to obtain a petal image after removing the background.
[0021] Optionally, the petal image is subjected to feature transformation to obtain a global fine-grained feature vector, specifically including:
[0022] The petal image is subjected to feature transformation via a Vision Transformer neural network to obtain a global fine-grained feature vector.
[0023] Optionally, the deep neural network includes a first TransformerEncoder layer, a second TransformerEncoder layer, a third TransformerEncoder layer, a pooling layer, a linear layer, and an output layer connected in sequence.
[0024] Optionally, the average RGB color is represented as:
[0025]
[0026] Among them, Average_RGB i N represents the average RGB color. i R represents the total number of pixels. k G k B kGiven the R, G, and B color values of the k-th pixel, the average RGB color is copied three times to generate an average RGB color vector containing nine elements.
[0027] Optionally, the multimodal feature fusion vector is represented as: Fusion_2 = Vec ViT ⊕Fusion1;
[0028]
[0029] Wherein, Fusion_2 represents the multimodal feature fusion vector, and Vec ViT Fusion1 represents the global fine-grained feature vector, and Fusion1 represents the dot product output. This represents the j-th element in the feature index vector. This represents the j-th element in the eigenvalue vector. This represents the j-th element in the average RGB color vector.
[0030] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the flower quality grading method described in any one of the above.
[0031] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the flower quality grading method described above.
[0032] According to the specific embodiments provided in this application, the following technical effects are disclosed:
[0033] This application provides a method, device, and medium for grading flower quality. The method involves performing a vector dot product operation on the feature index vector, the feature value vector, and the average RGB color to obtain a dot product output. The dot product output is then concatenated with the global fine-grained feature vector to obtain a multimodal feature fusion vector. This achieves multimodal feature fusion of images and text, thereby improving the accuracy of flower quality grading. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments 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.
[0035] Figure 1A flowchart illustrating a method for grading flower quality according to an embodiment of this application;
[0036] Figure 2 This is a schematic diagram of a deep neural network structure provided in an embodiment of this application;
[0037] Figure 3 A schematic diagram of the overall architecture of the interpretable Cymbidium goeringii quality grading model provided in an embodiment of this application using the multimodal ViT method;
[0038] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] This application provides a method for grading the quality of flowers, such as Figure 1 and Figure 3 As shown, the flower quality grading method includes steps 101 to 109.
[0042] Step 101: Collect image and text data of the target flower.
[0043] Step 102: Use regular expressions to perform pattern matching on the text data and extract multiple target key features. Each target key feature includes a feature name and a feature value.
[0044] Step 103: Input an index vector composed of each feature name into the embedding layer to obtain a feature index vector; each feature value constitutes a feature value vector.
[0045] Step 104: Perform image segmentation on the image data to obtain a petal image after removing the background.
[0046] Step 105: Determine the average RGB color based on the petal image.
[0047] Step 106: Perform feature transformation on the petal image to obtain a global fine-grained feature vector.
[0048] Step 107: Perform a vector dot product operation on the feature index vector, the feature value vector, and the average RGB color to obtain the dot product output.
[0049] Step 108: Concatenate the dot product output with the global fine-grained feature vector to obtain a multimodal feature fusion vector.
[0050] Step 109: Input the multimodal feature fusion vector into the flower quality grading model to obtain the grading result; the flower quality grading model is obtained by training a deep neural network using a training set.
[0051] In an exemplary embodiment, after step 109, the flower quality grading method further includes: using the SHAP analysis algorithm to calculate the marginal contribution of each target key feature to the grading result.
[0052] In an exemplary embodiment, image segmentation is performed on the image data to obtain a petal image after removing the background. Specifically, this includes: using a UNet neural network to perform image segmentation on the image data to obtain a petal image after removing the background.
[0053] In an exemplary embodiment, the petal image is subjected to feature transformation to obtain a global fine-grained feature vector. Specifically, this includes: performing feature transformation on the petal image using a Vision Transformer (ViT) neural network to obtain a global fine-grained feature vector.
[0054] like Figure 2 As shown, the deep neural network includes a first TransformerEncoder layer (TransformerEncoder layer 1), a second TransformerEncoder layer (TransformerEncoder layer 2), a third TransformerEncoder layer (TransformerEncoder layer 3), a pooling layer, a linear layer, and an output layer connected in sequence. The output layer is a Softmax layer, which outputs the probabilities of each level. When the target flower is Cymbidium goeringii, the Softmax layer outputs 7 levels of probability.
[0055] In an exemplary embodiment, taking the Cymbidium goeringii dataset as an example, 4556 sample data were obtained from an orchid trading website. Each sample data includes image data, text data, and tag data. The image data is an image of the current Cymbidium goeringii sample, the text data is a feature description of the Cymbidium goeringii sample, and the tag data is the quality grade represented by the sample. Then, by using regular expressions to perform pattern matching on the text data, seven target key features of the Cymbidium goeringii were extracted. The seven target key features are: petal type, longest leaf length, widest leaf width, leaf height, number of flowers, number of seedlings, and number of buds. Each key feature includes a feature name and a feature value.
[0056] Then, each feature name is mapped to a unique feature index. The feature index of the missing feature name in the sample is set to 9, and its corresponding missing feature value is ( Figure 3 In the NULL case, it is set to 0. The feature names of the 7 key features constitute an index vector, and the feature values of the feature names of the 7 key features constitute a feature value vector. The index vector is input into the embedding layer to obtain the output. The embedding layer is a 7x1 matrix.
[0057] For image data processing, the Cymbidium goeringii images in the sample data are segmented using a UNet neural network to obtain background-removed images of the orchid petals, and the average RGB color of the petals in these images is extracted. Simultaneously, the background-removed petal images are processed using a VisionTransformer neural network to obtain global fine-grained feature vectors. The output of the embedding layer, the feature vector, and the average RGB color of the petals are then multiplied by a vector dot product to obtain the dot product output. This dot product output is then concatenated with the global fine-grained feature vector obtained from ViT to complete the multimodal feature fusion vector. Each multimodal feature fusion vector and its corresponding label data constitute the training set. Using the multimodal feature fusion vector as input and the label data as output, a deep neural network is trained to obtain a flower quality grading model.
[0058] In the process of training the deep neural network, this application includes using the Mini-batch algorithm to process the sample data in the training set to form multiple mini-batches, with the batch size of each mini-batch set to 64; then each mini-batch is sequentially input into the flower quality grading model, and the Adamax optimizer is used to train the Cymbidium goeringii quality grading model.
[0059] Then, the accuracy of the trained Cymbidium goeringii quality grading model was verified using sample data from the test set. The weight coefficients of the deep Transformer model and the ViT neural network were retained to obtain the Cymbidium goeringii quality grading model. Finally, the SHAP analysis algorithm was used to calculate the marginal contribution of the seven features to the output of the Cymbidium goeringii quality grading model to quantify the importance of each feature to the prediction result.
[0060] The flower quality grading model provided in this application uses the Cymbidium goeringii dataset as training data and employs the TransformerEncoder model and ViT as the basic algorithm architecture. The self-attention mechanism of the TransformerEncoder model can effectively learn the influence mechanism of Cymbidium goeringii features in the dataset on its value, and combined with global fine-grained image features and RGB color features, it achieves the organic fusion of multimodal features, thus achieving the goal of accurate grading of Cymbidium goeringii quality. The SHAP algorithm quantifies the importance of seven features to the grading results, ensuring the reliability, scientific nature, and interpretability of the grading results.
[0061] The multimodal Cymbidium goeringii dataset is shown in Table 1.
[0062] Table 1. Multimodal Cymbidium goeringii dataset (taking 7 samples as an example, "—" indicates missing features)
[0063]
[0064]
[0065] The key characteristics of the target include petal shape, longest leaf length, widest leaf width, leaf height, number of flowers, number of seedlings, and number of buds.
[0066] Because the seller's information on the Cymbidium goeringii features was incomplete to varying degrees, including petal types such as lotus petal, plum petal, and narcissus petal (Lotus for lotus petal, Plum for plum petal, and Narcissus for narcissus petal), the seven feature names were mapped to unique feature indices to make the model accept the missing feature information. The correspondence is shown in Table 2.
[0067] Table 2. Correspondence between feature names and feature indices
[0068]
[0069] Suppose that a sample i is missing two features: "leaf height" and "number of buds". Its feature index and feature value are shown in Table 3.
[0070] Table 3 shows samples lacking the features "leaf height" and "bud number".
[0071]
[0072] Therefore, the feature index vector converted from this sample is:
[0073] Feature_idx i =(0, 1, 2, 3, 4, 6, 8, 9, 9)
[0074] Feature_idx i This represents the feature index vector of the i-th sample.
[0075] Where "9" represents the padding value used for missing features. If the sample's petal shape belongs to the lotus petal type, its corresponding feature vector is 1,0,0; similarly, the feature vector for the plum petal type is 0,1,0; and the feature vector for the narcissus petal type is 0,0,1. Therefore, the feature vector converted from this sample is:
[0076] Feature_val i =(0, 1, 0, 8.0, 2.4, 6, 3, 0, 0)
[0077] Feature_val i Let represent the feature vector of the i-th sample.
[0078] The average RGB color is represented as:
[0079]
[0080] Among them, Average_RGB i The average RGB color is represented, specifically the average RGB color of the i-th sample, N. i R is the total number of pixels in the i-th sample. k G k B k Let R, G, and B be the R, G, and B color values of the k-th pixel, and then the average RGB color is copied three times. Duplicate the vector three times to generate an average RGB color vector with nine elements.
[0081] Feature_idx i Feature_val i Average_RGB i Performing a dot product operation on three vectors to fuse text and color features, the formula is as follows:
[0082]
[0083] Here, j represents taking the j-th element of the vector.
[0084] The ViT neural network is used to perform feature transformation on the petal image segmented by UNet, with weights W. ViT ViT transforms the petal image into an 8-element vector Vec_ViT. Finally, Vec_ViT is concatenated with Fusion_1. A multimodal feature vector Fusion_2 with 9 elements is obtained, which fuses the visual and textual features of Cymbidium goeringii. The formula is described as follows:
[0085]
[0086] Wherein, Fusion_2 represents the multimodal feature fusion vector, and Vec ViT Fusion1 represents the global fine-grained feature vector, and Fusion1 represents the dot product output. This represents the j-th element in the feature index vector. This represents the j-th element in the eigenvalue vector. This represents the j-th element in the average RGB color vector.
[0087] Furthermore, this application inputs the multimodal feature vector Fusion_2 (hereinafter referred to as X) into a 6-layer TransformerEncoder model for feature transformation based on a multi-head self-attention mechanism. Each TransformerEncoder layer contains a multi-head self-attention mechanism (using two heads here), layer normalization, and a fully connected neural network, and uses residual connections to enhance information transmission. In this application, the TransformerEncoder layer is set to three layers. In the first TransformerEncoder layer, X is fed into the multi-head self-attention mechanism. In this application, two heads are used, which means that each input vector will be projected into two different query vectors. Through two different sets of weight matrices... and We obtain two distinct query, key, and value vectors for X, represented as: the query, key, and value vector of the first 1. and And the first two queries, key and value vectors and in, and This is a trainable weight matrix. For each head, the self-attention output is calculated using the following formula. The self-attention output of head 1 is calculated separately for head 1 and head 2:
[0088]
[0089] And the self-attention output of the first two:
[0090]
[0091] Where, d k This is a scaling factor, typically the square root of the dimension of the key vector, used to stabilize the gradient. The self-attention outputs of head 1 and head 2 are concatenated to obtain a new vector, which is then processed by a linear transformation W. O Mapping to the output dimension:
[0092]
[0093] Where MultiHeadAtttention(X) is the output of the multi-head self-attention mechanism, W O This is a trainable matrix used to integrate the outputs of each head. The concatenated vector represents the overall output of the multi-head self-attention mechanism. Then, the multi-head self-attention output is residually concatenated with the input vector X, followed by layer normalization, as described in the following formula:
[0094] Output1=LayerNormX+MultiHeadAtttentionX
[0095] LayerNorm() represents layer normalization.
[0096] Then, the normalized output Output1 is fed into the feedforward neural network (FFN). Each layer has a non-linear activation function, calculated as follows:
[0097] FFN(x) = max(0, xW1+b1)W2+b2
[0098] Here, W1, W2, b1, and b2 are all trainable parameters. Then, the output of the FFN is residually concatenated with the input of the previous layer and subjected to layer normalization to obtain the final output of the current layer.
[0099] Output2 = LayerNorm(X + FFN(X))
[0100] Output2 is the output of the second-level normalization.
[0101] The above steps are repeated in the second and third TransformerEncoder layers, with the output of each layer serving as the input to the next. After processing by the three TransformerEncoder layers, the output is pooled for dimensionality reduction to simplify features and retain important information. The pooled output then passes through a linear layer to further map the dimensions to the dimensions required by the output layer. The output of the linear layer finally passes through a Softmax layer, converting the result into the probability that a sample belongs to one of the seven levels. The formula for calculating Softmax is as follows:
[0102]
[0103] Among them, z i′ Let y be the i′th value of the linear layer output, and P(y=i′|x) be the probability that the sample belongs to the i′th level.
[0104] Next, a quality grading model for Cymbidium goeringii was trained using the obtained 4556 samples. A mini-batch algorithm was employed to process the sample data in the training set, forming multiple mini-batches with a batch size of 64. Each mini-batch was then sequentially input into the Cymbidium goeringii quality grading model, and the Adamax optimizer was used to train the model with a learning rate of 0.01. Training ended when the network weights were updated to the optimal weights suitable for Cymbidium goeringii quality grading.
[0105] Finally, the SHAP analysis algorithm is used to calculate the contribution of the seven features to the model ranking results (average SHAP value) to measure the importance of the features. The formula is described as follows:
[0106]
[0107] Where f represents the flower quality grading model; f() represents the output of the flower quality grading model; Let F represent the expected value; S is the complete set of features, S is a subset of features, S is the number of features in the subset S, and |F| is the total number of features; v(S) represents the expected gain on the model output when only the subset S is used for prediction; v(S∪{j}) represents the expected gain on the model output when feature j is incorporated into S; i represents the index of the sample, j represents the index of a feature, C represents the feature set in set F excluding the subset S, and C\j represents the feature set in set C excluding sample i. and Let X represent the specific values of sample i on S and S∪{j}, respectively; C and Let and represent the distribution functions of and , respectively, i.e., the probability distributions used to calculate the expectation of the "residual features"; N represents the total number of samples in the dataset; F\{j} represents the feature set obtained after excluding feature j from the complete feature set F; is the feature SHAP value obtained by inputting the sample into the flower quality grading model; f is the output of the prediction model given the features in S; f is the output of the model when the feature is added to S. By calculating the average of the SHAP values of each feature in all samples, the importance of the seven features is determined and they are ranked from largest to smallest. The results show that the petal shape index is the most important feature affecting the value of Cymbidium goeringii. The method proposed in this application is not only applicable to Cymbidium goeringii, but also to the quality evaluation of other flowers and other agricultural products. It only requires sufficient price range, images, and text descriptions. Key indicators can be automatically extracted from the text descriptions to establish characteristic indicators for different flowers or agricultural products.
[0108] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 4 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores flower quality grading data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a flower quality grading method.
[0109] Those skilled in the art will understand that Figure 4 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0110] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0111] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0112] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0113] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0114] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units, etc., and are not limited to these.
[0115] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0116] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for grading the quality of flowers, characterized in that, The flower quality grading method includes: Collect image and text data of the target flower; Regular expressions are used to perform pattern matching on text data to extract multiple target key features. Each target key feature includes a feature name and a feature value. Each feature name is used to form an index vector, which is then input into the embedding layer to obtain a feature index vector; each feature value is used to form a feature value vector. The image data is segmented to obtain a petal image after removing the background; The average RGB color is determined based on the petal image; The petal image is subjected to feature transformation to obtain a global fine-grained feature vector; Perform a vector dot product operation on the feature index vector, the feature value vector, and the average RGB color to obtain the dot product output; The dot product output is concatenated with the global fine-grained feature vector to obtain a multimodal feature fusion vector; The multimodal feature fusion vector is input into the flower quality grading model to obtain the grading result; the flower quality grading model is obtained by training a deep neural network using a training set; The SHAP analysis algorithm is used to calculate the marginal contribution of each target's key features to the classification results.
2. The method for grading flower quality according to claim 1, characterized in that, The key characteristics of the target include petal shape, longest leaf length, widest leaf width, leaf height, number of flowers, number of seedlings, and number of buds.
3. The method for grading flower quality according to claim 1, characterized in that, The image data is segmented to obtain a petal image after removing the background, specifically including: The image data was segmented using a UNet neural network to obtain a petal image after removing the background.
4. The method for grading flower quality according to claim 1, characterized in that, The petal image is subjected to feature transformation to obtain a global fine-grained feature vector, specifically including: The petal image is subjected to feature transformation via a Vision Transformer neural network to obtain a global fine-grained feature vector.
5. The method for grading flower quality according to claim 1, characterized in that, The deep neural network includes a first TransformerEncoder layer, a second TransformerEncoder layer, a third TransformerEncoder layer, a pooling layer, a linear layer, and an output layer connected in sequence.
6. The method for grading flower quality according to claim 1, characterized in that, The average RGB color is represented as: ; in, This represents the average RGB color. Total number of pixels , , The first The R, G, and B color values of each pixel are taken, and the average RGB color is copied three times to generate an average RGB color vector containing nine elements.
7. The method for grading flower quality according to claim 6, characterized in that, The multimodal feature fusion vector is represented as: ; ; in, This represents the multimodal feature fusion vector. This represents the global fine-grained feature vector. This indicates the output of the dot product. Indicating the first element in the feature index vector j One element, Represents the eigenvalue vector of the th j One element, Represents the th element in the average RGB color vector. j Each element.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the flower quality grading method according to any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the flower quality grading method according to any one of claims 1-7.