Deep learning-based B-end application-oriented flower variety and quality identification method

By deploying a deep learning model on the embedded board end and using the Inception v2 module to fusion of flower image features, the existing flower recognition methods are solved, and the rapid, accurate identification and localization of flower species and quality are achieved.

CN119851129APending Publication Date: 2025-04-18JINSUZHI (CHANGZHOU) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411963035.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing flower species and quality identification methods are inefficient and insufficient in accuracy, and traditional methods rely on cloud computing to have problems such as network dependence and high latency.

Method used

Using a deep learning-based method, we build a flower image recognition neural network model, use the Inception v2 module to perform feature fusion, and deploy the model to an embedded board with an AI inference engine to achieve localized and rapid identification of flower species and quality.

Benefits of technology

It realizes fast and accurate identification of flower species and quality, reduces dependence on network connections, improves recognition efficiency and accuracy, and supports real-time decision-making and operation in B-end application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851129A_ABST
    Figure CN119851129A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, and discloses a deep learning-based B-end application-oriented flower type and quality recognition method, which comprises the following steps of: acquiring a flower image data set through a flower image acquisition module; constructing a flower image recognition neural network model, wherein the flower image recognition neural network model comprises a plurality of stacked Inception v2 modules; training the constructed flower image recognition neural network model by using the flower image data set; deploying the trained flower image recognition neural network model to an embedded board end with an AI inference engine; a flower image data set and a reasoning module are integrated at a board end, and real-time acquisition and reasoning of flower types and quality at the board end are realized. The flower type and quality identification method solves the problems of low efficiency and insufficient accuracy of the existing flower type and quality identification method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a method for identifying flower species and qualities based on deep learning for B-side applications. Background Art

[0002] The flower industry plays an important role in the global agricultural economy. With the scale and internationalization of the flower market, the rapid and accurate identification of flower species and quality has become a demand for the development of the industry. However, traditional flower identification mainly relies on manual work, which has the following problems: 1. High subjectivity: Manual identification is limited by experience and it is difficult to maintain high consistency in large-scale scenarios; 2. Low efficiency: Manual methods are time-consuming and cannot meet the needs of fast processing; 3. Difficult to standardize: Due to the wide variety of flower species and complex appearance, different individuals may have deviations in identifying the same flower.

[0003] In recent years, image recognition based on convolutional neural networks has made significant progress in the field of computer vision and has gradually been applied to agricultural scenarios, including plant species identification, pest and disease detection, etc. However, compared with conventional crops, flower recognition has higher technical challenges: 1. A wide variety of species: There are more than 400,000 known flower species in the world, and different species may have only slight differences; 2. Complex appearance: Flowers have diverse colors, shapes, textures, and structures, and are easily affected by shooting angles and lighting; 3. Real-time requirements: In application scenarios, the recognition system needs to respond quickly to support subsequent decisions and operations.

[0004] Traditional flower image recognition systems usually run on cloud servers or high-performance computing platforms. This approach has high computing power, but has the following problems: 1. Dependence on network connection: images are uploaded to the cloud and are subject to network quality; 2. High latency: data transmission and remote computing increase overall latency; 3. Privacy protection: recognition tasks in the flower market may involve commercial secrets or specific protected varieties, and have high requirements for localized data processing.

[0005] Therefore, there is an urgent need for a method that can localize and quickly identify the type and quality of flowers. Summary of the invention

[0006] The purpose of the present invention is to solve the problems of low efficiency and insufficient accuracy of existing flower species and quality identification methods, and to provide a flower species and quality identification method based on deep learning for B-side applications.

[0007] In order to achieve the above-mentioned object of the invention, the embodiment of the present invention provides the following technical solutions:

[0008] The flower species and quality identification method based on deep learning for B-side applications includes the following steps:

[0009] Step 1: collect several types of flower images through the flower image collection module, and each type of flower includes at least three qualities, and collect several flower images for each quality, so as to form a flower image dataset;

[0010] Step 2, constructing a flower image recognition neural network model, wherein the flower image recognition neural network model includes multiple stacked Inception v2 modules;

[0011] Step 3, using the flower image dataset to train the constructed flower image recognition neural network model;

[0012] Step 4: Deploy the trained flower image recognition neural network model to the embedded board with an AI inference engine;

[0013] Step 5: Integrate the flower image dataset and reasoning module on the board to realize real-time collection and reasoning of flower species and quality on the board.

[0014] Compared with the prior art, the present invention has the following beneficial effects:

[0015] (1) The present invention designs a flower image acquisition module, builds a large flower image dataset for B-side applications based on the flower image acquisition module, designs and trains a flower image recognition neural network model on the PC side, transplants the model to the embedded board side, constructs an inference module based on the board side API, integrates the flower image acquisition module and the inference module on the board side, realizes the rapid acquisition and inference of flower images on the end-side device in the B-side application scenario, and solves the problems of low efficiency and insufficient accuracy of existing flower species and quality recognition methods.

[0016] (2) The present invention provides a method for identifying flower species and qualities based on deep learning for B-side applications. The flower image dataset constructed based on the flower image acquisition module can fully reflect the characteristics of flowers. The designed flower image recognition neural network model can make full use of the deep semantic information of the flower image dataset. Based on the Inception v2 module, the flower image features learned from convolution kernels of different sizes can be fused. When deployed on the end side, data can be read and processed from the board side, and a fast response can be achieved. The recognition result can drive the control mechanism to complete the sorting of different flower species and qualities, thereby achieving cost reduction and efficiency improvement in large flower markets.

[0017] (3) The present invention provides a method for constructing a flower image dataset based on a flower image acquisition module. Each bunch of flowers on the conveyor belt will pass through an image acquisition point. The three cameras at the acquisition point will synchronously expose and capture images of each bunch of flowers from three perspectives, so that the constructed flower image dataset can fully reflect the characteristics of flowers. The two dimensions of "type" and "quality" are combined to form 90 categories. Compared with the existing open source image datasets that can only be used to identify flower types, it has more application value. Through data enhancement, the constructed dataset with 90 categories and 3.6 million images is more suitable for the training of deep convolutional neural network models.

[0018] (4) The present invention provides a specific structure of a flower image acquisition module. Through the flower image acquisition module provided by the present invention, when the shapes and sizes of each groove for placing flowers on the conveyor belt are equal and the spacing is equal, an image acquisition point is set based on the center of a certain groove, which can ensure that the center of each subsequent groove can pass through the acquisition point. The three cameras are triggered to take pictures based on external signals. After the corresponding sensors on the left and right sides of the acquisition point are blocked by the passing flowers, they send a photo signal to the three cameras synchronously, thereby realizing the continuous acquisition of flower images. Compared with the video stream, this stream acquisition method can very accurately capture each bunch of flower images and has lower performance consumption. The ring light source located above the acquisition point and below the camera is used for fill light to ensure that the camera can capture a clear and bright flower surface under different lighting conditions.

[0019] (5) The present invention provides a structure of a neural network model for flower image recognition. Compared with a conventional stacked neural network structure, the branch structure of the Inception v2 module can learn flower image features from multiple scales and fuse image features learned from convolution kernels of different scales. Based on feature map visualization, it is found that stacking 6 Inception v2 modules can not only extract image semantic features well but also does not generate a large number of repeated and redundant features. Adding a set of 7x7 convolutional layers in parallel with other channels to Inception v25a and Inception v25b can completely cover the 7x7 feature maps of their previous layer outputs, thereby combining with convolution kernels of other sizes to fully extract high-level semantic information of flower images and improve the performance of the model.

[0020] (6) The present invention provides a method for training a neural network model for flower image recognition. Center cropping is used to ensure that the cropped image will not be twisted or distorted. The image is uniformly adjusted to 224x224 to match the model input requirements. In addition, the smaller image pixel size can also reduce the video memory usage during the model training process, improve the training efficiency, and standardize the image data to make the feature distribution of the training data more uniform, reduce the model's dependence on a specific feature value range, and thus improve the model's generalization ability on test data. The model is first trained using an open source flower image dataset, which can enable the model to have prior knowledge about flower images, thereby improving the convergence speed of the model on the flower image dataset created by the present invention. A decaying learning rate is used, and the learning rate can be automatically updated according to the performance of the model on the validation set. Early stopping is used to avoid overfitting of the model.

[0021] (7) The present invention provides a method for deploying a flower image recognition neural network model on an embedded board. The model file in ONNX format can be used across platforms and is convenient for deployment in different hardware environments. The model parameter accuracy is converted from FP32 to INT8, which can significantly reduce the model size and memory usage during runtime, improve the model's reasoning speed, and deploy the model to the board to give full play to the hardware acceleration capabilities of the embedded platform. In addition, compared with high-performance computing platforms such as graphics cards or servers, embedded devices are cheaper and more cost-effective.

[0022] (8) The present invention provides a method for integrating a flower image acquisition module and an inference module on a board. By streamlining the number of cameras, the equipment cost and system complexity can be reduced. By using an external signal trigger, the acquisition of invalid images can be avoided. The multi-threaded division of labor for stream acquisition and inference can make full use of hardware resources. Compared with placing stream acquisition and inference in a loop structure, frame loss can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flow chart of the method of the present invention;

[0025] FIG. 2( a ) is a schematic diagram of the structure of a flower image acquisition module according to an embodiment of the present invention;

[0026] FIG2( b ) is a schematic diagram of the structure of the flower image acquisition module according to another embodiment of the present invention;

[0027] Figure 3A schematic diagram of the network structure of a flower image recognition neural network model according to an embodiment of the present invention;

[0028] FIG4( a ) is a schematic diagram of the network structure of Inception v23a, Inception v23b, Inception v24a, and Inception v24b in the flower image recognition neural network model according to an embodiment of the present invention;

[0029] FIG4( b ) is a schematic diagram of the network structure of Inception v25a and Inception v25b in the flower image recognition neural network model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0031] It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance, or implying any such actual relationship or order between these entities or operations. In addition, the terms "connected", "connected", etc. can be directly connected between elements, or indirectly connected via other elements.

[0032] The present invention is achieved through the following technical solutions: Figure 1 As shown, a method for identifying flower species and quality based on deep learning for B-side applications includes the following steps:

[0033] Step 1: collect several types of flower images through the flower image collection module, and each type of flower contains at least three qualities, and collect several flower images for each quality, thereby forming a flower image dataset.

[0034] The step 1 specifically comprises the following steps:

[0035] Step 1-1, design the flower image acquisition module.

[0036] As shown in Figure 2(a) and Figure 2(b), the flower image acquisition module is designed based on the on-site production environment. The flower image acquisition module includes three cameras, a pair of through-beam photoelectric sensors, a ring light source, and a conveyor belt. The conveyor belt is provided with multiple grooves arranged in a line and at equal intervals. During the conveying process, each groove is used to place a type of flower. The image acquisition point is set based on the center of the groove, so that the center of each groove can pass through the acquisition point. The camera is a 5-megapixel gigabit network port industrial array camera that supports external triggering. The three cameras are located directly above and on the left and right sides of the acquisition point and are fixed with a bracket. The left and right sides refer to the left and right sides of the conveying direction of the conveyor belt. The camera lens faces the acquisition point. A pair of through-beam photoelectric sensors are installed on the left and right sides of the acquisition point. When a flower passes by, the light beam of the photoelectric sensor is blocked, and the signal at the receiving end is interrupted, thereby synchronously outputting a trigger signal to the three cameras to ensure the synchronous exposure of the three cameras; the ring light source is located directly above the acquisition point and below the camera, and will not cause occlusion of the photo, so as to take the top view, left view and right view of each bunch of flowers.

[0037] In this embodiment, the camera can be a Hikvision MV-CS050-60GM industrial camera, or other industrial cameras with similar performance parameters. The three cameras are fixed by an aluminum alloy bracket. The optical axis of the camera lens directly above is perpendicular to the conveyor belt, and the angle between the optical axis of the camera lenses on the left and right sides and the surface of the conveyor belt can be 45°. The three cameras are all focused on the collection point and are also equipped with infrared cut-off filters to ensure clear shooting effects and avoid infrared interference. The ring light source uses an LED lamp, which is installed below the upper camera. The lighting direction is consistent with the camera optical axis to ensure uniform lighting and no shadows.

[0038] Step 1-2, simulating on-site operations, using the designed flower image acquisition module to take pictures of each bunch of flowers moving on the conveyor belt, and obtaining flower images of each bunch of flowers from three perspectives at the same time.

[0039] In steps 1-3, based on the B-side application requirements, 30 types of flowers (such as Phalaenopsis, roses, chrysanthemums, etc.) and three qualities of each flower (divided into three levels of A, B, C according to the freshness) were photographed, and 90 categories (such as Phalaenopsis A, Phalaenopsis B, Phalaenopsis C, etc.) were formed in the form of "type + quality", with 10,000 images in each category.

[0040] Steps 1-4, pre-processing the collected flower images.

[0041] Data enhancement is performed on the collected flower images, and the data volume is expanded to 4 times the original volume by horizontal flipping, vertical flipping, and random cropping. In this embodiment, in addition to the several geometric transformations used above, the image brightness can also be adjusted to adapt the model to different lighting conditions, and contrast can be adjusted to enhance the detailed information in the image. Noise or distortion can be added to the image to enhance the robustness of the model to noise. The above are some simple data enhancement methods in geometric space, which can multiply the amount of data. More complex methods can also be used, such as synthesizing new images through generative adversarial networks or other models to expand the amount of data.

[0042] In steps 1-5, the preprocessed flower images are stored in different files according to their categories, forming a large flower image dataset of 90 categories and 3.6 million images. The category labels consist of two dimensions: "species" and "quality".

[0043] Step 2: Build a neural network model for flower image recognition.

[0044] like Figure 3 The figure shows a schematic diagram of the network structure of the flower image recognition neural network model of this embodiment. The flower image recognition neural network model includes 6 Inception v2 modules, namely Inception v23a, Inception v23b, Inception v24a, Inception v24b, Inception v25a, and Inception v25b, and also includes a first convolutional layer (7×7), a first maximum pooling layer (3×3), a second convolutional layer (1×1), a third convolutional layer (3×3), a second maximum pooling layer (3×3), a third maximum pooling layer (3×3), a fourth maximum pooling layer (3×3), an average pooling layer, and a fully connected layer. The input flower image of size 224×224 passes through the first convolutional layer (7×7), the first maximum pooling layer (3×3), the second convolutional layer (1×1), the third convolutional layer (3×3), the second maximum pooling layer (3×3), Inception v23a, Inceptionv23b, the third maximum pooling layer (3×3), Inception v24a, Inception v24b, the fourth maximum pooling layer (3×3), Inception v25a, Inception v25b, the global average pooling layer, the fully connected layer, and finally the recognition result is output.

[0045] Among them, the structures of Inception v23a, Inception v23b, Inception v24a and Inception v24b are the same, as shown in Figure 4(a), where an Inception v2 module includes a first channel, a second channel, a third channel, and a fourth channel. The first channel includes 1×1conv, the second channel includes 1×1conv, 3×3conv, the third channel includes 1×1conv, 3×3conv, 3×3conv, and the fourth channel includes 3×3maxpool, 1×1conv. The feature maps output by the previous level of the Inception v2 module pass through the four channels respectively and are cascaded through the filters.

[0046] The structures of Inception v25a and Inception v25b are the same, as shown in Figure 4(b), where one Inception v2 module includes a first channel, a second channel, a third channel, a fourth channel, and a fifth channel. The first channel includes 1×1conv, the second channel includes 1×1conv, 3×3conv, the third channel includes 1×1conv, 3×3conv, 3×3conv, the fourth channel includes 1×1conv, 7×7conv, and the fifth channel includes 3×3maxpool and 1×1conv. The feature maps output by the previous level of the Inception v2 module pass through five channels and are cascaded through filters.

[0047] The flower image recognition neural network model of this embodiment significantly improves the model's ability to recognize flowers by stacking multiple layers of Inception v2 modules. The input layer receives image data of size 224×224. The input image passes through the first convolution layer (7×7) to capture the global preliminary features of the image. Then, the first maximum pooling layer (3×3) is used to downsample the image to reduce the spatial dimension. Then, the second convolution layer (1×1) is convolved to achieve feature compression and channel fusion, and then the third convolution layer (3×3) is convolved to enhance the local feature perception ability. After the second maximum pooling layer (3×3), a feature map is obtained and input into Inception v23a. In Inception v23a to Inception v25b, each module is designed with a multi-channel structure. The multi-channel uses convolution layers with different convolution kernel sizes (such as 1×1, 3×3, and 7×7) to capture feature information of different scales. The features output by these channels are spliced ​​through the channel dimension, so that multi-scale features are integrated in a single network structure. Every two Inception The maximum pooling layer connected between the v2 modules is used to further reduce the resolution of the feature map while ensuring important features. A 7×7 convolutional layer parallel to other channels is added to the Inception v25a and Inception v25b modules to expand the receptive field and further enhance the model's ability to capture flower features. The global average pooling layer averages the features output by Inception v25b channel by channel to generate a one-dimensional feature vector. The fully connected layer then maps this global feature to a specific classification space to complete the conversion from feature to category. Finally, the softmax outputs the final classification probability to determine the specific category of the flower in terms of type and quality.

[0048] Step 3: Use the flower image dataset to train the constructed flower image recognition neural network model.

[0049] The step 3 specifically includes the following steps:

[0050] Step 3-1, divide the flower image dataset into a training set and a validation set in a ratio of 7:3.

[0051] Step 3-2, perform center cropping on the images in the flower image dataset to make its pixel size 224×224. In this embodiment, assuming that the width of the input image is W and the height is H, first calculate the coordinates of the center point of the cropping area Then expand to the upper left corner and lower right corner of the cropping area based on the center point, and calculate the coordinates of the upper left corner of the cropping area as follows: The coordinates of the lower right corner of the cropping area are According to the calculated coordinates of the cropped area, the corresponding area is extracted from the original image.

[0052] Step 3-3, standardize the image data. First, divide the pixel value of the image by 255 to reduce it to [0,1]. Then calculate the mean and standard deviation of the pixel values ​​of each channel based on the following formula:

[0053]

[0054] Among them, μ c represents the mean of channel c, x i,c,h,w represents the pixel value of channel c at pixel position (h, w) in the i-th image, N represents the total number of images, and H and W represent the height and width of the image respectively.

[0055]

[0056] Among them, δ c represents the standard deviation of channel c. Thus, the mean values ​​of pixels in each RGB channel are μ R , μ G , μ B , and the pixel standard deviations are δ R , δ G , δ B .

[0057] Based on the mean and standard deviation of each channel pixel, the following formula is used to standardize each pixel in the range [0,1]:

[0058]

[0059] Among them, x norm represents the pixel value after normalization, x represents the pixel value before normalization (between 0 and 1), μ c Indicates the pixel mean of the channel where the pixel is located, δ c Indicates the pixel standard deviation of the channel where the pixel is located.

[0060] In step 3-4, before using the flower image recognition neural network model constructed by the present invention, the model is pre-trained on the PC side using a flower image dataset. The deep learning framework used for the training model is pytorch, the graphics card used is NVIDIA RTX 4060, the training batch batchsize is 32, and the momentum factor is 0.9. The use of the momentum term can effectively alleviate the oscillation during the model training process.

[0061] During the model training phase, a cross entropy loss function is designed to focus on hard-to-classify samples:

[0062]

[0063] Among them, Loss(y,p) represents the cross entropy loss function; p i The vector output by the last fully connected layer of the model is normalized by the softmax function to obtain the probability that the sample belongs to each category; (1-p i ) a is the attention factor, a is set to 2; y i is the label vector. By adding the attention factor, when the predicted probability of a sample is close to 1, the loss contributed by the sample will be smaller, and when the predicted probability of a sample is closer to 0, the loss contributed by the sample will be larger. This algorithm can make the model pay more attention to samples that are difficult to distinguish. In addition, the present invention gives the unique hot label vector Introduce noise, label vector after introducing noise b is a hyperparameter with a value of 0.1, and N×M is the total number of categories. By adding noise to the true label, the model can be prevented from being overconfident about the correct label, making the difference between the output values ​​of the predicted positive and negative samples less significant, which can improve the convergence speed of the model during training and improve the generalization ability of the model.

[0064] Step 3-5: On the PC side, input the training set in batches into the pre-trained flower image recognition neural network model for training, and use the stochastic gradient descent algorithm with momentum factor to optimize the parameters.

[0065] Step 3-6, use the same batch size as the training set, input the validation set into the model for validation, and adjust the learning rate and number of iterations according to the performance of the model on the validation set. In this embodiment, the validation set is preprocessed in the same way as the training set, including center cropping and standardization. During the validation process, the model does not perform gradient updates, and the initial learning rate is 0.001. When the validation set loss decreases slowly, the learning rate is reduced to 0.1 times the original value. When the validation set accuracy reaches more than 98%, stop training and save the model.

[0066] Step 3-7, repeat steps 3-5 to 3-6 until the accuracy of the verification set reaches the threshold, end the training, and obtain a trained flower image recognition neural network model.

[0067] Step 4: Deploy the trained flower image recognition neural network model to the embedded board with an AI inference engine.

[0068] The step 4 specifically comprises the following steps:

[0069] Step 4-1: On the PC, convert the trained flower image recognition neural network model into ONNX format.

[0070] Step 4-2, on the PC side, use the tool chain provided by the embedded platform to convert the flower image recognition neural network model in ONNX format into a format supported by the board-side inference engine. During the conversion process, the model is quantized and the parameter accuracy is converted from FP32 to INT8. In this embodiment, the embedded development board used is Rockchip RK3588S, which has an NPU with a computing power of 6.0TOPs. Based on this NPU, the reasoning and deployment of the flower image recognition neural network model can be achieved. In addition, the present invention is not limited to this model development board, and any development board with similar performance to RK3588S can be used, such as NVIDIA Jetson or Huawei Ascend series. In the model quantization process, based on a set of calibration data sets, the quantization range of the activation function is calculated to ensure that the accuracy of the quantized flower image recognition neural network model is as close to the original model as possible.

[0071] Step 4-3, copy the converted flower image recognition neural network model to the board, and use the board API to call the flower image recognition neural network model to form an inference module.

[0072] Step 5: Integrate the flower image dataset and reasoning module on the board to realize real-time collection and reasoning of flower species and quality on the board.

[0073] The step 5 specifically comprises the following steps:

[0074] Step 5-1, in the flower image acquisition module, remove the cameras on the left and right sides of the acquisition point, retain only the camera above the acquisition point, use external signal triggering, and trigger the camera to take pictures when a flower passes through the camera lens. In this embodiment, the cameras on the left and right sides are removed because the flower image data set constructed based on the three cameras above contains the top view of the flower and the images from the left and right perspectives. The model trained with this has learned the characteristics of flowers from different perspectives. Therefore, in the inference stage, a similar image of any perspective of the flower is used to collect the model, and the correct result can be inferred. In addition, using only one camera can reduce the complexity of the system, and the triggering accuracy and response speed of the camera will also be improved, so that the moment when the flower passes by can be captured more accurately and stably.

[0075] Step 5-2, on the board side, write the stream acquisition code based on the camera SDK, send the stream acquisition result to the inference module, so as to obtain real-time recognition results on the end side. In this process, the stream acquisition and inference time of a single image are both within 10ms. In addition, multi-threaded programming is used to divide the stream acquisition and inference into two threads. During the stream acquisition process, the image data is placed in the queue in chronological order for the inference code to obtain from the queue, forming a "producer-consumer" model. In this embodiment, secondary development is performed based on the offset SDK, the collected data is restored to image data, and then the image center is cropped and standardized using the same preprocessing method as the training stage. The category label is stored in a txt file. After obtaining the index of the maximum probability value through the softmax function, the corresponding category label is found in the txt file based on this index.

[0076] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention. It should be noted that similar numbers and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0077] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for identifying flower species and quality based on deep learning for B-side applications, characterized by: The following steps are involved: Step 1: collect several types of flower images through the flower image collection module, and each type of flower includes at least three qualities, and collect several flower images for each quality, so as to form a flower image dataset; Step 2, constructing a flower image recognition neural network model, wherein the flower image recognition neural network model includes multiple stacked Inception v2 modules; Step 3, using the flower image dataset to train the constructed flower image recognition neural network model; Step 4: Deploy the trained flower image recognition neural network model to the embedded board with an AI inference engine; Step 5: Integrate the flower image dataset and reasoning module on the board to realize real-time collection and reasoning of flower species and quality on the board.

2. The method for identifying flower species and quality based on deep learning for B-side applications according to claim 1 is characterized in that: The step 1 specifically comprises the following steps: Step 1-1, design a flower image acquisition module; Step 1-2, simulating on-site operations, using the designed flower image acquisition module to take pictures of each bunch of flowers moving on the conveyor belt, and obtaining flower images of each bunch of flowers from three perspectives at the same time; Step 1-3: Based on the application requirements of the B-side, shoot N types of flowers and M qualities of each flower, and form N×M categories in the form of type plus quality. The number of images in each category is K; Steps 1-4, preprocessing the collected flower images; In steps 1-5, the preprocessed flower images are stored in different files according to categories, forming a large flower image dataset of N×M categories. The category labels consist of two dimensions: species and quality.

3. The method for identifying flower species and quality based on deep learning for B-side applications according to claim 1, characterized in that: In the step 2, the flower image recognition neural network model includes a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a third convolutional layer, a second maximum pooling layer, Inception v23a, Inception v23b, a third maximum pooling layer, Inception v24a, Inception v24b, a fourth maximum pooling layer, Inceptionv25a, Inception v25b, a global average pooling layer, and a fully connected layer, which are connected in sequence.

4. The method for identifying flower species and quality based on deep learning for B-side applications according to claim 3 is characterized in that: The network structures of Inception v23a, Inception v23b, Inception v24a and Inception v24b are the same, including a first channel, a second channel, a third channel and a fourth channel. The first channel includes 1×1conv, the second channel includes 1×1conv and 3×3conv, the third channel includes 1×1conv, 3×3conv and 3×3conv, and the fourth channel includes 3×3maxpool and 1×1conv. The feature maps outputted from the previous stage pass through the four channels respectively and are cascaded through filters.

5. The method for identifying flower species and quality based on deep learning for B-side applications according to claim 3 is characterized in that: The network structure of the Inception v25a and Inception v25b is the same, including a first channel, a second channel, a third channel, a fourth channel, and a fifth channel. The first channel includes 1×1conv, the second channel includes 1×1conv, 3×3conv, the third channel includes 1×1conv, 3×3conv, 3×3conv, the fourth channel includes 1×1conv, 7×7conv, and the fifth channel includes 3×3maxpool and 1×1conv. The feature maps output by the previous stage pass through five channels respectively and are cascaded through filters.

6. The method for identifying flower species and quality based on deep learning for B-side applications according to claim 1, characterized in that: The step 3 specifically comprises the following steps: Step 3-1, divide the flower image dataset into a training set and a validation set in a ratio of 7:3; Step 3-2, center-crop the images in the flower image dataset to make their pixel size 224×224; Step 3-3, standardize the image data and calculate the mean and standard deviation of the pixel values ​​of each channel; Step 3-4: Use the flower image dataset to pre-train the model on the PC. Step 3-5: On the PC side, input the training set into the pre-trained flower image recognition neural network model in batches for training, and use the stochastic gradient descent algorithm with momentum factor to optimize the parameters; Step 3-6, use the same batch size as the training set and input the validation set into the flower image recognition neural network model for validation; Step 3-7, repeat steps 3-5 to 3-6 until the accuracy of the verification set reaches the threshold, end the training, and obtain a trained flower image recognition neural network model.

7. The method for identifying flower species and quality based on deep learning for B-side applications according to claim 6 is characterized in that: The step 3-3 is as follows: The pixel values ​​of the image are divided by 255 to reduce to [0,1], and the mean and standard deviation of the pixel values ​​of each channel are calculated based on the following formula: Among them, μ c represents the mean of channel c, x i,c,h,w represents the pixel value of channel c at pixel position (h,w) in the i-th image, N represents the total number of images, H and W represent the height and width of the image respectively; Among them, δ c represents the standard deviation of channel c. Thus, the mean values ​​of pixels in each RGB channel are μ R , μ G , μ B , and the pixel standard deviations are δ R , δ G , δ B ; Based on the mean and standard deviation of each channel pixel, the following formula is used to standardize each pixel in the range [0,1]: Among them, x norm represents the pixel value after normalization, x represents the pixel value before normalization, μ c Indicates the pixel mean of the channel where the pixel is located, δ c Indicates the pixel standard deviation of the channel where the pixel is located.