A Deep Learning-Based Method and System for Identifying Root and Leaf Characteristics of Leafy Vegetables
By using an improved YOLOv8 network to identify the characteristics of the roots and leaves of leafy vegetables, the problem of accuracy in identifying the location of roots and characteristics of leaves in leafy vegetable processing was solved, thereby improving processing efficiency and food safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGNAN UNIV
- Filing Date
- 2026-04-24
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, it is difficult to accurately and in real time identify the location of the roots and the characteristics of the leaves (yellow or green leaves) of leafy vegetables, resulting in low processing efficiency, high labor costs and food safety risks.
A deep learning-based method for identifying the characteristics of roots and leaves in leafy vegetables is adopted. An improved YOLOv8 network is used for image feature extraction and fusion. Combined with orthogonal task decoupling and dynamic attention processing, the root and leaf characteristics in vegetable images are identified.
It enables precise identification of the characteristics of leafy vegetable roots and leaves, improving processing efficiency, reducing loss rate, and enhancing food safety.
Smart Images

Figure CN122090439A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vegetable identification technology, and in particular to a method and system for identifying the characteristics of leafy vegetable roots and leaves based on deep learning. Background Technology
[0002] Leafy vegetables are a core category of high-frequency consumption and easily perishable food in people's daily lives. Different varieties have different processing requirements, and currently, their pre-processing still heavily relies on manual labor. This operational model suffers from inefficiency and insufficient standardization, making it difficult to cope with the pressure of concentrated stockpiling during peak periods. It also easily leads to quality problems such as incomplete root removal, inadequate cleaning of yellow leaves, and insufficient cleanliness. This not only increases the defect rate but also poses potential food safety risks.
[0003] Leafy vegetables come in a wide variety of types and shapes. Traditional processing relies on manual labor to complete all the processes, including root removal, washing, yellowing leaf removal, drying, and packaging. This method is not only inefficient and labor-intensive, but also suffers from uneven root removal, incomplete washing, low precision in removing yellow leaves, and insufficient packaging standardization. As a result, the loss rate has remained at a high level for a long time, which seriously restricts the sustainable development of the fresh produce supply chain.
[0004] The machine, specifically designed for processing leafy vegetables, integrates multiple processes such as "cleaning (washing and purification), picking (removing yellow leaves), and packaging (quantitative packaging)" into one. It enables fully automated processing from feeding multiple varieties of unprocessed vegetables with roots and soil into the finished leafy vegetable products that have been cleaned, rooted, and packaged. The processing efficiency and cleaning cleanliness are significantly improved compared to manual processing, and the loss rate is significantly reduced. It effectively breaks through the efficiency and quality bottlenecks of large-scale processing of multiple varieties of leafy vegetables, and provides core equipment support for fresh food enterprises, central kitchens, and other entities to reduce operating costs and increase production capacity.
[0005] In my country, there is a lack of standardization in machines specifically designed for processing leafy vegetables. For example, these machines cannot accurately identify and cut off the roots of leafy vegetables, nor can they effectively and accurately identify the freshness of leafy vegetables (i.e., whether the leaves are yellow or green). Therefore, it is necessary to achieve accurate and real-time identification of the location of the roots of leafy vegetables and the freshness of the leaves (whether they are yellow or green). Summary of the Invention
[0006] Therefore, the technical problem to be solved by the present invention is to overcome the problem of accurate and real-time identification of the root position and leaf characteristics (yellow or green leaves) of leafy vegetables in the prior art.
[0007] To address the aforementioned technical problems, this invention provides a deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves, comprising:
[0008] Step S1: Acquire vegetable images, wherein the vegetable images are images of leafy vegetables with roots and leaves;
[0009] Step S2: Extract features of different resolutions from the vegetable image, fuse the features of different resolutions to obtain fused features, perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features, and predict the classification decoupling and localization decoupling features respectively to identify the root and leaf characteristics in the vegetable image.
[0010] In one embodiment of the present invention, step S2 is implemented using an improved YOLOv8 network, wherein,
[0011] The improved YOLOv8 network comprises a Backbone network, a Neck network, a VRF-Head network, and a Head network connected in sequence. The Backbone network is used to extract features of different resolutions from vegetable images. The Neck network is used to fuse features of different resolutions. The VRF-Head network is used to perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features. The Head network is used to predict the classification decoupling and localization decoupling features respectively to identify root and leaf characteristics in vegetable images.
[0012] In one embodiment of the present invention, the Backbone network includes a first Conv layer, a second Conv layer, a first LVF-C2f module, a third Conv layer, a second LVF-C2f module, a fourth Conv layer, a third LVF-C2f module, a fifth Conv layer, a fourth LVF-C2f module, and an SPFF module connected in sequence.
[0013] The Neck network includes a C2PSA module, a first Upsample layer, a first Concat layer, a fifth LVF-C2f module, a second Upsample layer, a second Concat layer, a sixth LVF-C2f module, a sixth Conv layer, a third Concat layer, a seventh LVF-C2f module, a seventh Conv layer, a fourth Concat layer, and an eighth LVF-C2f module connected in sequence. The output of the second LVF-C2f module is also connected to the input of the second Concat layer, the output of the third LVF-C2f module is also connected to the input of the first Concat layer, the output of the SPFF module is connected to the input of the C2PSA module, the output of the C2PSA module is also connected to the input of the fourth Concat layer, and the output of the fifth LVF-C2f module is also connected to the input of the third Concat layer.
[0014] The VRF-Head network includes a first VRF-Head module, a second VRF-Head module, and a third VRF-Head module. The sixth LVF-C2f module is connected to the input of the first VRF-Head module, the output of the seventh LVF-C2f module is connected to the input of the second VRF-Head module, and the output of the eighth LVF-C2f module is connected to the input of the third VRF-Head module.
[0015] The Head network includes a first Detect layer, a second Detect layer, and a third Detect layer. The output of the first VRF-Head module is connected to the input of the first Detect layer, the output of the second VRF-Head module is connected to the input of the second Detect layer, and the output of the third VRF-Head module is connected to the input of the third Detect layer. The first to third Detect layers are used to output the detection results of the root position and leaf characteristics of the vegetable image.
[0016] In one embodiment of the present invention, the first LVF-C2f module to the eighth LVF-C2f module includes a first branch and a second branch, wherein,
[0017] The first branch includes a 1×1 dilated convolution and a first SiLU nonlinear activation function connected in sequence. The 1×1 dilated convolution is used to reduce the dimensionality of the input features, thereby reducing the parameter calculation of the model while establishing local feature connections. The first SiLU nonlinear activation function is used to introduce nonlinear expressive power and improve the network's fitting and learning effect on leaf texture and complex root features.
[0018] The second branch includes three parallel 3×3 standard convolutions, a 3×3 dilated convolution with an inflation rate of 2, and a 3×3 dilated convolution with an inflation rate of 4. The first 3×3 standard convolution is used to extract leaf texture and root details of leafy vegetables. The 3×3 dilated convolution with an inflation rate of 2 is used to expand the receptive field and capture the overall relative position of the roots and leaves of leafy vegetables. The 3×3 dilated convolution with an inflation rate of 4 is used to further expand the receptive field, thereby enhancing the ability to perceive large-scale leaves and global contextual information.
[0019] The outputs of the first branch and the second branch are added element-wise, and the result of the element-wise addition is subjected to one-dimensional global average pooling to generate a position-sensitive feature map.
[0020] The position-sensitive feature map is restored to the same size as the input feature map of the LVF-C2f module by a first 1×1 standard convolution.
[0021] In one embodiment of the present invention, the first to the third VRF-Head modules each include a texture smoothing aggregation module, an edge-guided spatial enhancement module, and an orthogonal task decoupling module connected in sequence. The texture smoothing aggregation module is used to smooth the rough texture of the leaves without losing any pixel resolution, while retaining the sharp local high-frequency features of the root. The edge-guided spatial enhancement module is used to filter out the gentle soil background noise to highlight the physical edges of the leaves and roots. The orthogonal task decoupling module is used to physically isolate the feature channels and independently learn geometric boundary information or texture color information, thereby eliminating the interference of leaf characteristic classification on root localization from the source.
[0022] The input features are sequentially passed through the second 3×3 standard convolution, the first BN layer, and the second SiLU nonlinear activation function of the texture smoothing aggregation module. The residuals of the input features and the output of the second SiLU nonlinear activation function are added together to obtain the aggregated feature F1.
[0023] The aggregated feature F1 is filtered by the Laplacian high-pass filter of the edge-guided spatial enhancement module. The aggregated feature F1 and the filtered feature are concatenated by channel to obtain the channel concatenated feature. The concatenated feature is then passed through the second 1×1 standard convolution and the first Hard Sigmoid function in sequence, and then multiplied by the aggregated feature F1 to obtain the high-precision spatial feature F2.
[0024] The high-precision spatial feature F2 is sequentially processed by the orthogonal task decoupling module through 1×1 grouped convolution, the second BN layer, the third SiLU nonlinear activation function, average global pooling, the third 1×1 standard convolution, the ReLU activation function, the fourth 1×1 standard convolution, and the second Hard Sigmoid function to obtain the first dynamic attention weight feature and the second dynamic attention weight feature. The output of the third SiLU nonlinear activation function is further processed by Decoupled Feature to obtain pure geometric boundary and pure texture color channel features. The first dynamic attention weight feature is multiplied by the pure geometric boundary to obtain the localization decoupling feature, and the second dynamic attention weight feature is multiplied by the pure texture color channel feature to obtain the classification decoupling feature.
[0025] In one embodiment of the present invention, the improved YOLOv8 network is further trained to achieve network convergence, and the loss function used during training is:
[0026] ;
[0027] in, For directional shape root loss, For bounding box regression loss, For vertically sensitive penalty items, For shape constraints, For vertical bias weights, The bias weights for the shape constraint terms.
[0028] In one embodiment of the present invention,
[0029] ;
[0030] ;
[0031] ;
[0032] in, The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box is... , To predict the area of the frame, This represents the actual area of the frame. and These are the center ordinates of the predicted bounding box and the ground truth bounding box, respectively; This represents the total height of the image. The width of the prediction box; The width of the actual bounding box; The height of the predicted bounding box; This is the height of the actual bounding box.
[0033] To address the aforementioned technical problems, this invention provides a deep learning-based system for identifying the characteristics of leafy vegetable roots and leaves, comprising:
[0034] Acquisition module: used to acquire vegetable images, wherein the vegetable images are leafy vegetable images with roots and leaves;
[0035] Recognition module: used to extract features of different resolutions of the vegetable image, perform feature fusion on the features of different resolutions to obtain fused features, perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features, and predict the classification decoupling and localization decoupling features respectively to identify the root and leaf characteristics in the vegetable image.
[0036] To address the aforementioned technical problems, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves as described above.
[0037] To address the aforementioned technical problems, the present invention provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves as described above.
[0038] Compared with the prior art, the above-described technical solution of the present invention has the following advantages:
[0039] The deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves described in this invention can effectively and accurately identify the characteristics of roots and leaves (i.e., yellow or green leaves) in vegetable images by constructing an improved YOLOv8 network.
[0040] The LVF-C2f module constructed in this invention can improve the ability to identify subtle features of leafy vegetables (such as root tip growth points and tiny insect holes);
[0041] The VRF-Head module constructed in this invention can effectively filter out high-frequency noise interference from complex backgrounds, and eliminate mutual interference between tasks from the root by physically isolating classification and positioning features, thus significantly improving the positioning accuracy of tiny root tips and the classification accuracy of leaf yellow-green characteristics. Attached Figure Description
[0042] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings.
[0043] Figure 1 This is a flowchart of the method of the present invention;
[0044] Figure 2 This is a schematic diagram of the improved YOLOv8 network structure in an embodiment of the present invention;
[0045] Figure 3 This is a schematic diagram of the structure of the first LVF-C2f module to the eighth LVF-C2f module in an embodiment of the present invention;
[0046] Figure 4 This is a schematic diagram of the structure of the first VRF-Head module to the third VRF-Head module in an embodiment of the present invention. Detailed Implementation
[0047] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0048] Example 1
[0049] Reference Figure 1As shown, this invention relates to a deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves, comprising:
[0050] Step S1: Acquire vegetable images, wherein the vegetable images are images of leafy vegetables with roots and leaves;
[0051] Step S2: Extract features of different resolutions from the vegetable image, fuse the features of different resolutions to obtain fused features, perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features, and predict the classification decoupling and localization decoupling features respectively to identify the root and leaf characteristics (i.e., yellow leaves or green leaves) in the vegetable image.
[0052] Further, please refer to Figure 2 Step S2 is implemented using an improved YOLOv8 network, which includes a Backbone network, a Neck network, a VRF-Head network, and a Head network connected in sequence. The Backbone network is used to extract features of different resolutions from the vegetable image. The Neck network is used to fuse features of different resolutions. The VRF-Head network is used to perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features. The Head network is used to predict the classification decoupling and localization decoupling features respectively to identify root and leaf characteristics (i.e., yellow or green leaves) in the vegetable image.
[0053] Furthermore, the Backbone network includes a first Conv layer, a second Conv layer, a first LVF-C2f module, a third Conv layer, a second LVF-C2f module, a fourth Conv layer, a third LVF-C2f module, a fifth Conv layer, a fourth LVF-C2f module, and an SPFF module connected in sequence.
[0054] Furthermore, the Neck network includes a C2PSA module, a first Upsample layer, a first Concat layer, a fifth LVF-C2f module, a second Upsample layer, a second Concat layer, a sixth LVF-C2f module, a sixth Conv layer, a third Concat layer, a seventh LVF-C2f module, a seventh Conv layer, a fourth Concat layer, and an eighth LVF-C2f module connected in sequence. The output of the second LVF-C2f module is also connected to the input of the second Concat layer, the output of the third LVF-C2f module is also connected to the input of the first Concat layer, the output of the SPFF module is connected to the input of the C2PSA module, the output of the C2PSA module is also connected to the input of the fourth Concat layer, and the output of the fifth LVF-C2f module is also connected to the input of the third Concat layer.
[0055] Furthermore, the VRF-Head network includes a first VRF-Head module, a second VRF-Head module, and a third VRF-Head module, wherein a sixth LVF-C2f module is connected to the input of the first VRF-Head module, the output of the seventh LVF-C2f module is connected to the input of the second VRF-Head module, and the output of the eighth LVF-C2f module is connected to the input of the third VRF-Head module.
[0056] Furthermore, the Head network includes a first Detect layer, a second Detect layer, and a third Detect layer. The output of the first VRF-Head module is connected to the input of the first Detect layer, the output of the second VRF-Head module is connected to the input of the second Detect layer, and the output of the third VRF-Head module is connected to the input of the third Detect layer. The first to third Detect layers detect simultaneously and output their results. The outputs of the three Detect layers are then fused into a final detection result to obtain the final detection results of the root and leaf characteristics (yellow or green leaves) of the vegetable image.
[0057] The Conv layers (each Conv layer consists of convolution, BN, and SiLU functions), SPFF modules, C2PSA modules, and Detect layers in the improved YOLOv8 network are the same as those in the traditional YOLOv8 network and belong to the prior art. Therefore, they will not be described in detail in this embodiment.
[0058] Furthermore, the Conv layer and C2f module in the traditional YOLOv8 network use a fixed receptive field, which easily leads to the loss of localization information of fine root tips. Therefore, this embodiment replaces the C2f module in the YOLOv8 network by constructing an LVF-C2f module. For details, please refer to... Figure 3 The first LVF-C2f module to the eighth LVF-C2f module include a first branch and a second branch. The first branch includes a 1×1 dilated convolution and a first SiLU nonlinear activation function connected in sequence. The 1×1 dilated convolution is used to reduce the dimensionality of the input features, reducing the computational cost of the model parameters while establishing local feature connections. The first SiLU nonlinear activation function is used to introduce nonlinear expressive power, improving the network's fitting and learning effect on leaf texture and complex root features. The second branch includes three parallel first 3×3 standard convolutions, a 3×3 dilated convolution with an inflation rate of 2, and a 3×3 dilated convolution with an inflation rate of 4. The first 3×3 standard convolution is used to extract leaf texture and root details of leafy vegetables. The 3×3 dilated convolution with an inflation rate of 2 is used to expand the receptive field and capture the overall relative position of the leafy vegetable roots and leaves. The 3×3 dilated convolution with an inflation rate of 4 is used to further expand the receptive field exponentially, thereby enhancing the perception of large-scale leaves and global contextual information. The outputs of the first and second branches are added element-wise, and the result of the element-wise addition is subjected to one-dimensional global average pooling (i.e., one-dimensional global average pooling is performed along the horizontal (X) direction and the vertical (Y) direction of the feature map respectively) to generate a position-sensitive feature map; the size of the position-sensitive feature map is restored to the same size as the input feature map of the LVF-C2f module by the first 1×1 standard convolution.
[0059] It should be noted that in this embodiment, the first to eighth LVF-C2f modules use dilated convolution, which can not only exponentially expand the receptive field without increasing the number of parameters, but also avoid feature loss caused by pooling layers. This dilated convolution branch can capture the overall relative position of the root and leaf, establish long-distance spatial association, and enhance the ability to capture root tip growth points and small lesions. Compared with directly increasing the network depth, the LVF-C2f module constructed in this embodiment can better utilize the concurrent computing power of the GPU through branch parallelization design, and improve detection accuracy while keeping the inference speed basically the same.
[0060] Further, please refer to Figure 4 In this embodiment, the first VRF-Head module to the third VRF-Head module each include a texture smoothing aggregation module, an edge-guided spatial enhancement module, and an orthogonal task decoupling module connected in sequence. The texture smoothing aggregation module is used to smooth the rough texture of the leaves without losing any pixel resolution, while retaining the sharp local high-frequency features of the root. The edge-guided spatial enhancement module is used to filter out the gentle soil background noise to highlight the physical edges of the leaves and roots. The orthogonal task decoupling module is used to physically isolate the feature channels and independently learn geometric boundary information or texture color information, thereby eliminating the interference of leaf characteristic classification on root localization from the root.
[0061] The input features are sequentially passed through the second 3×3 standard convolution, the first BN layer, and the second SiLU nonlinear activation function of the texture smoothing aggregation module. The residuals of the input features and the output of the second SiLU nonlinear activation function are added together to obtain the aggregated feature F1.
[0062] The aggregated feature F1 is filtered by the Laplacian high-pass filter of the edge-guided spatial enhancement module. The aggregated feature F1 and the filtered feature are concatenated by channel to obtain the channel concatenated feature. The concatenated feature is then passed through a second 1×1 standard convolution and a first Hard Sigmoid function, and then multiplied by the aggregated feature F1 to obtain the high-precision spatial feature F2. Considering that there is a lot of residual soil color on the machine assembly line, which will cause high-frequency noise interference to the recognition, the model can easily mistake the edge of the soil for the edge of the vegetable root. Therefore, this embodiment introduces a Laplacian high-pass filter. The Laplacian high-pass filter is extremely sensitive to "drastic changes" in color and grayscale. When the feature map passes through it, the smooth soil background will be directly filtered to 0, while the "intersection of green vegetable leaves and white vegetable roots" and the "intersection of white vegetable roots and dark conveyor belt" will be forced to stand out with extremely high response values.
[0063] The high-precision spatial feature F2 is sequentially processed through the orthogonal task decoupling module's 1×1 grouped convolution (using Groups=2 grouped convolution, which mathematically "splits" the channel in half: one half of the channel is physically isolated, completely ignoring color and only responsible for learning the geometric boundary information transmitted through the Laplacian high-pass filter, used for extremely high-precision knife-cutting localization regression; the other half of the channel only considers texture and color, used for yellow leaf classification. This effectively reduces the amount of parameter computation and eliminates the interference of classification on localization from the root), the second BN layer, the third SiLU nonlinear activation function, average global pooling, the third 1×1 standard convolution, the ReLU activation function, the fourth 1×1 standard convolution, and the second Hard Sigmoid function to obtain the first dynamic attention weight feature and the second dynamic attention weight feature. The output of the third SiLU nonlinear activation function is also processed by Decoupled Feature to obtain pure geometric boundary and pure texture color channel features. Multiplying the first dynamic attention weight feature with the pure geometric boundary yields the localization decoupling feature, and multiplying the second dynamic attention weight feature with the pure texture color channel feature yields the classification decoupling feature. Each of the first VRF-Head module to the third VRF-Head module outputs its corresponding localization decoupling feature and classification decoupling feature. These features are then input into the corresponding Detect layer for detection. Finally, the outputs of the three Detect layers are fused into a final detection result.
[0064] The Hard Sigmoid function is an existing technology. Its main function is to map and restrict the input feature values (usually real numbers of any range after convolution processing) to the interval (0,1). An output value close to 1 represents "preserving / enhancing the feature", and a value close to 0 represents "suppressing / forgetting the feature".
[0065] This embodiment also includes training the improved YOLOv8 network to achieve network convergence, enabling better identification and accurate localization of leafy vegetable roots, yellow and green leaves. The accuracy and stability are both at a high level, and it has strong practical value. The loss function used during training is:
[0066] ;
[0067] in, For directional shape root loss, For bounding box regression loss, For vertically sensitive penalty items, For shape constraints, For vertical bias weights, The bias weights for the shape constraint terms.
[0068] ;
[0069] ;
[0070] ;
[0071] in, The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box is... , To predict the area of the frame, This represents the actual area of the frame. and These are the center ordinates of the predicted bounding box and the ground truth bounding box, respectively; This represents the total height of the image. The width of the prediction box; The width of the actual bounding box; The height of the predicted bounding box; This is the height of the actual bounding box.
[0072] Table 1 below compares the inference speed and accuracy of the improved YOLOv8 network with the original YOLOv8 network in the prior art. mAP@0.5 (%) represents the average accuracy when the Intersection over Union (IoU) threshold is 0.5, reflecting the basic detection accuracy of the model. mAP@0.5:0.95 (%) represents the overall average accuracy performance within the IoU threshold range of 0.5 to 0.95 (step size 0.05), reflecting the model's performance under high-precision positioning requirements. It is clear from Table 1 that the improved YOLOv8 network constructed in this embodiment has better inference speed and accuracy.
[0073] Table 1. Comparison between the improved YOLOv8 network and the original YOLOv8 network
[0074]
[0075] Example 2
[0076] This embodiment provides a deep learning-based system for recognizing the characteristics of leafy vegetable roots and leaves, including:
[0077] Acquisition module: used to acquire vegetable images, wherein the vegetable images are leafy vegetable images with roots and leaves;
[0078] Recognition module: used to extract features of different resolutions of the vegetable image, perform feature fusion on the features of different resolutions to obtain fused features, perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features, and predict the classification decoupling and localization decoupling features respectively to identify the root and leaf characteristics in the vegetable image.
[0079] Example 3
[0080] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves as described in Embodiment 1.
[0081] Example 4
[0082] This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves as described in Embodiment 1.
[0083] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0084] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0085] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0086] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0087] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for identifying the characteristics of root and leaf parts of leafy vegetables based on deep learning, characterized in that, include: Step S1: Acquire vegetable images, wherein the vegetable images are images of leafy vegetables with roots and leaves; Step S2: Extract features of different resolutions from the vegetable image, fuse the features of different resolutions to obtain fused features, perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features, and predict the classification decoupling and localization decoupling features respectively to identify the root and leaf characteristics in the vegetable image.
2. The deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves according to claim 1, characterized in that: Step S2 is implemented using an improved YOLOv8 network, wherein, The improved YOLOv8 network comprises a Backbone network, a Neck network, a VRF-Head network, and a Head network connected in sequence. The Backbone network is used to extract features of different resolutions from vegetable images. The Neck network is used to fuse features of different resolutions. The VRF-Head network is used to perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features. The Head network is used to predict the classification decoupling and localization decoupling features respectively to identify root and leaf characteristics in vegetable images.
3. The deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves according to claim 2, characterized in that: The Backbone network includes a first Conv layer, a second Conv layer, a first LVF-C2f module, a third Conv layer, a second LVF-C2f module, a fourth Conv layer, a third LVF-C2f module, a fifth Conv layer, a fourth LVF-C2f module, and an SPFF module connected in sequence. The Neck network includes a C2PSA module, a first Upsample layer, a first Concat layer, a fifth LVF-C2f module, a second Upsample layer, a second Concat layer, a sixth LVF-C2f module, a sixth Conv layer, a third Concat layer, a seventh LVF-C2f module, a seventh Conv layer, a fourth Concat layer, and an eighth LVF-C2f module connected in sequence. The output of the second LVF-C2f module is also connected to the input of the second Concat layer, the output of the third LVF-C2f module is also connected to the input of the first Concat layer, the output of the SPFF module is connected to the input of the C2PSA module, the output of the C2PSA module is also connected to the input of the fourth Concat layer, and the output of the fifth LVF-C2f module is also connected to the input of the third Concat layer. The VRF-Head network includes a first VRF-Head module, a second VRF-Head module, and a third VRF-Head module. The sixth LVF-C2f module is connected to the input of the first VRF-Head module, the output of the seventh LVF-C2f module is connected to the input of the second VRF-Head module, and the output of the eighth LVF-C2f module is connected to the input of the third VRF-Head module. The Head network includes a first Detect layer, a second Detect layer, and a third Detect layer. The output of the first VRF-Head module is connected to the input of the first Detect layer, the output of the second VRF-Head module is connected to the input of the second Detect layer, and the output of the third VRF-Head module is connected to the input of the third Detect layer. The first to third Detect layers are used to output the detection results of the root position and leaf characteristics of the vegetable image.
4. The deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves according to claim 3, characterized in that: The first LVF-C2f module to the eighth LVF-C2f module include a first branch and a second branch, wherein, The first branch includes a 1×1 dilated convolution and a first SiLU nonlinear activation function connected in sequence. The 1×1 dilated convolution is used to reduce the dimensionality of the input features, thereby reducing the parameter calculation of the model while establishing local feature connections. The first SiLU nonlinear activation function is used to introduce nonlinear expressive power and improve the network's fitting and learning effect on leaf texture and complex root features. The second branch includes three parallel 3×3 standard convolutions, a 3×3 dilated convolution with an inflation rate of 2, and a 3×3 dilated convolution with an inflation rate of 4. The first 3×3 standard convolution is used to extract leaf texture and root details of leafy vegetables. The 3×3 dilated convolution with an inflation rate of 2 is used to expand the receptive field and capture the overall relative position of the roots and leaves of leafy vegetables. The 3×3 dilated convolution with an inflation rate of 4 is used to further expand the receptive field, thereby enhancing the ability to perceive large-scale leaves and global contextual information. The outputs of the first branch and the second branch are added element-wise, and the result of the element-wise addition is subjected to one-dimensional global average pooling to generate a position-sensitive feature map. The position-sensitive feature map is restored to the same size as the input feature map of the LVF-C2f module by a first 1×1 standard convolution.
5. The deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves according to claim 3, characterized in that: Each of the first to third VRF-Head modules includes a texture smoothing aggregation module, an edge-guided spatial enhancement module, and an orthogonal task decoupling module connected in sequence. The texture smoothing aggregation module is used to smooth the rough texture of the leaves without losing any pixel resolution, while retaining the sharp local high-frequency features of the root. The edge-guided spatial enhancement module is used to filter out the gentle soil background noise to highlight the physical edges of the leaves and roots. The orthogonal task decoupling module is used to physically isolate the feature channels and independently learn geometric boundary information or texture color information, thereby eliminating the interference of leaf feature classification on root localization from the source. The input features are sequentially passed through the second 3×3 standard convolution, the first BN layer, and the second SiLU nonlinear activation function of the texture smoothing aggregation module. The residuals of the input features and the output of the second SiLU nonlinear activation function are added together to obtain the aggregated feature F1. The aggregated feature F1 is filtered by the Laplacian high-pass filter of the edge-guided spatial enhancement module. The aggregated feature F1 and the filtered feature are concatenated by channel to obtain the channel concatenated feature. The concatenated feature is then passed through the second 1×1 standard convolution and the first Hard Sigmoid function in sequence, and then multiplied by the aggregated feature F1 to obtain the high-precision spatial feature F2. The high-precision spatial feature F2 is sequentially processed by the orthogonal task decoupling module through 1×1 grouped convolution, the second BN layer, the third SiLU nonlinear activation function, average global pooling, the third 1×1 standard convolution, the ReLU activation function, the fourth 1×1 standard convolution, and the second Hard Sigmoid function to obtain the first dynamic attention weight feature and the second dynamic attention weight feature. The output of the third SiLU nonlinear activation function is further processed by Decoupled Feature to obtain pure geometric boundary and pure texture color channel features. The first dynamic attention weight feature is multiplied by the pure geometric boundary to obtain the localization decoupling feature, and the second dynamic attention weight feature is multiplied by the pure texture color channel feature to obtain the classification decoupling feature.
6. The method for identifying the characteristics of leafy vegetable roots and leaves based on deep learning according to claim 2, characterized in that: This also includes training the improved YOLOv8 network to achieve network convergence, and the loss function used during training is: ; in, For directional shape root loss, For bounding box regression loss, For vertically sensitive penalty items, For shape constraints, For vertical bias weights, The bias weights for the shape constraint terms.
7. The deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves according to claim 6, characterized in that: ; ; ; in, The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box is... , To predict the area of the frame, This represents the actual area of the frame. and These are the center ordinates of the predicted bounding box and the ground truth bounding box, respectively; This represents the total height of the image. The width of the prediction box; The width of the actual bounding box; The height of the predicted bounding box; This is the height of the actual bounding box.
8. A deep learning-based system for identifying the characteristics of leafy vegetable roots and leaves, characterized in that, include: Acquisition module: used to acquire vegetable images, wherein the vegetable images are leafy vegetable images with roots and leaves; Recognition module: used to extract features of different resolutions of the vegetable image, perform feature fusion on the features of different resolutions to obtain fused features, perform orthogonal task decoupling and dynamic attention processing on the fused features to obtain classification decoupling and localization decoupling features, and predict the classification decoupling and localization decoupling features respectively to identify the root and leaf characteristics in the vegetable image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves as described in any one of claims 1 to 7.
10. 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 steps of the deep learning-based method for identifying the characteristics of leafy vegetable roots and leaves as described in any one of claims 1 to 7.