Lightweight tea shoot segmentation method, device and medium based on coding structure
By employing a lightweight tea shoot segmentation method with an encoding and decoding structure, and utilizing cross-layer connectivity and feature fusion technology, the problems of low recognition accuracy and high computational load in mechanized tea harvesting are solved, achieving efficient and accurate tea shoot segmentation and supporting real-time harvesting.
Patent Information
- Application Number
- CN202211512651.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-11-30
AI Technical Summary
Traditional mechanized tea picking methods result in low tea leaf integrity and high damage rates. Furthermore, traditional visual recognition methods are greatly affected by lighting conditions and have low recognition accuracy, failing to meet the needs of real-time tea shoot segmentation.
A lightweight tea shoot segmentation method based on an encoding and decoding structure is adopted. By connecting multiple encoding and decoding modules across layers and combining attention gate modules and ASPP modules, feature fusion is performed to reduce computation and improve recognition accuracy.
It achieves tea shoot segmentation with low computational cost and high recognition accuracy, meeting the needs of mechanized tea picking in real-time scenarios and improving the integrity and accuracy of tea picking.
Smart Images

Figure CN115719452B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and more specifically, to a lightweight method, apparatus, and medium for segmenting tender tea shoots based on an encoding and decoding structure. Background Technology
[0002] The tea industry is a labor-intensive industry, especially in the harvesting process, which requires a large amount of manual labor. In recent years, the aging of the workforce has become increasingly apparent, and the difficulty in recruiting workers and the high cost of labor have become key problems that the tea industry must face. Therefore, it is necessary to conduct research on the development of intelligent tea-harvesting technology based on advanced technologies.
[0003] Traditional mechanized tea picking mainly uses a reciprocating cutting method to pick tea leaves indiscriminately, which easily leads to a low tea leaf integrity rate, damage to buds and leaves, missed picking, and mispicking of tea leaves.
[0004] Therefore, some technologies rely on computer vision to identify tender leaves on tea trees, and then use harvesting equipment to selectively pick the tea leaves to ensure their integrity. However, traditional visual recognition methods extract relatively simple features, are significantly affected by lighting conditions, and their accuracy is highly dependent on the selected features, resulting in low recognition precision. Furthermore, traditional encoding and decoding structures often employ multiple convolutional pooling operations for downsampling feature extraction, followed by interpolation or transposed convolution for image restoration. These operations require more parameters and computational resources, which cannot meet the requirements of real-time applications.
[0005] In view of this, the applicant hereby submits this application after studying the existing technology. Summary of the Invention
[0006] The present invention provides a lightweight method, apparatus and medium for segmenting tender tea shoots based on an encoding and decoding structure, in order to improve at least one of the above-mentioned technical problems.
[0007] First aspect
[0008] This invention provides a lightweight tea shoot segmentation method based on an encoding / decoding structure, which includes steps S1 and S2.
[0009] S1. Obtain the initial image and perform preprocessing.
[0010] S2. Input the pre-processed image into the pre-trained lightweight segmentation model to obtain the recognition image of tea buds.
[0011] The lightweight segmentation model consists of multiple sequentially connected encoding modules, multiple sequentially connected decoding modules, and an ASPP module connecting the last encoding module and the first decoding module. There is a one-to-one correspondence between the encoding and decoding modules, with cross-layer connections achieved through attention gate modules. The attention gate modules fuse the features output from the encoding and decoding modules to obtain more salient features. The first attention gate fuses the features output from the last encoding module and the ASPP module.
[0012] The second aspect
[0013] This invention provides a lightweight tea shoot segmentation device based on an encoding / decoding structure, comprising:
[0014] The initial image acquisition module is used to acquire the initial image and perform preprocessing.
[0015] The image recognition module is used to input the pre-processed image into a pre-trained lightweight segmentation model to obtain the recognition image of tea buds.
[0016] The lightweight segmentation model consists of multiple sequentially connected encoding modules, multiple sequentially connected decoding modules, and an ASPP module connecting the last encoding module and the first decoding module. There is a one-to-one correspondence between the encoding and decoding modules, with cross-layer connections achieved through attention gate modules. The attention gate modules fuse the features output from the encoding and decoding modules to obtain more salient features. The first attention gate fuses the features output from the last encoding module and the ASPP module.
[0017] Third aspect
[0018] This invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the lightweight tea shoot segmentation method based on the encoding and decoding structure described in any paragraph of the first aspect.
[0019] By adopting the above technical solution, the present invention can achieve the following technical effects:
[0020] The lightweight tea shoot segmentation method of this invention has low computational load and high recognition accuracy, providing higher real-time performance and high accuracy, thus meeting the needs of mechanized tea shoot picking in real-time scenarios. It provides a foundation for automated tea picking and has great practical significance. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating a lightweight method for segmenting tender tea shoots.
[0023] Figure 2 This is a framework diagram of a lightweight segmentation model.
[0024] Figure 3 This is a structural diagram of the encoding module.
[0025] Figure 4 This is a structural diagram of the ASPP module.
[0026] Figure 5 This is a structural diagram of the attention gate module.
[0027] Figure 6 This is a structural diagram of the decoding module.
[0028] Figure 7 This is a schematic diagram of a lightweight tea shoot splitting device. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0030] Example 1
[0031] Please see Figures 1 to 6 The first embodiment of the present invention provides a lightweight tea shoot segmentation method based on an encoding and decoding structure.
[0032] It can be performed by a lightweight tea shoot segmentation device based on an encoding / decoding structure (hereinafter referred to as: lightweight tea shoot segmentation device). In particular, it is performed by one or more processors in the lightweight tea shoot segmentation device to implement steps S1 and S2.
[0033] S1. Obtain the initial image and perform preprocessing.
[0034] Based on the above embodiments, in an optional embodiment of the present invention, step S1 specifically includes steps S11 and S12.
[0035] S11. Obtain the initial image.
[0036] S12. Fill and resize the initial image to obtain an image of the preset size.
[0037] It is understood that the lightweight tea shoot splitting device can be an electronic device with computing power, such as a portable laptop computer, desktop computer, server, smartphone, or tablet computer.
[0038] S2. Input the pre-processed image into the pre-trained lightweight segmentation model to obtain the recognition image of tea buds.
[0039] The lightweight segmentation model consists of multiple sequentially connected encoding modules, multiple sequentially connected decoding modules, and an ASPP module connecting the last encoding module and the first decoding module. There is a one-to-one correspondence between the encoding and decoding modules, with cross-layer connections achieved through attention gate modules. The attention gate modules fuse the features output from the encoding and decoding modules to obtain more salient features. The first attention gate fuses the features output from the last encoding module and the ASPP module.
[0040] like Figure 2 and Figure 3 As shown, based on the above embodiments, in an optional embodiment of the present invention, the encoding module includes a first convolutional layer, a first batch normalization layer, a first activation layer, a second convolutional layer, a second batch normalization layer, a second activation layer, and a first summing layer connected in sequence. The first summing layer is used to add the features input to the first convolutional layer and the features output by the second activation layer.
[0041] Preferably, the lightweight segmentation model includes four encoding modules. The first and second convolutional layers have 3x3 convolutional kernels. The stride of the first convolutional layer is 2. The first and second activation layers are ReLU layers.
[0042] Specifically, the encoding structure contains four encoding modules. Each encoding module consists of a residual module composed of a 3*3 convolutional layer with a stride of 2, a batch normalization (BN) layer, a ReLU activation layer, and another 3*3 convolutional layer, a batch normalization (BN) layer, and a ReLU activation layer. The original input image is represented by X, and after four downsampling operations, four encoding layer output feature maps X1, X2, X3, and X4 are obtained respectively.
[0043] Feature maps are extracted through four encoding layers. The encoding layers use a convolutional structure with a stride of 2 instead of traditional convolutional pooling modules for downsampling. This significantly reduces network parameters and computational cost, better meeting the real-time requirements of application scenarios.
[0044] like Figure 2 and Figure 4 As shown, based on the above embodiments, in an optional embodiment of the present invention, the ASPP module (Diffuse Spatial Convolutional Pooling Pyramid) includes an eighth convolutional layer for outputting features, a second splicing layer connected to the eighth convolutional layer, an image pooling layer arranged in parallel and respectively connected to the second splicing layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, and a seventh convolutional layer.
[0045] Preferably, the kernels of the fourth, fifth, and sixth convolutional layers are 3x3. The expansion rate of the fourth convolutional layer is 18. The expansion rate of the fifth convolutional layer is 12. The expansion rate of the sixth convolutional layer is 6. The kernels of the seventh and eighth convolutional layers are 1x1.
[0046] Specifically, the output feature map X4 of the lowest coding layer is passed through the ASPP module. The ASPP module includes five parallel modules: an image pooling module, a conv(1*1) module, and a conv(3*3) module (dilation rate = (6,12,18)). The outputs of the five modules are concatenated and convolved, and then rich semantic features are further fused to obtain a new fused feature X5.
[0047] The encoding module is connected to the ASPP module at the bottom, increasing the network's receptive field and obtaining fused feature maps. This enhances the segmentation network's ability to obtain multi-scale context. Furthermore, it integrates rich semantic features to improve the network's accuracy.
[0048] like Figure 2 and Figure 5 As shown, based on the above embodiments, in an optional embodiment of the present invention, the attention gate module includes a ninth convolutional layer and a tenth convolutional layer arranged in parallel, a third summing layer connected to the ninth convolutional layer and the tenth convolutional layer, a fourth activation layer connected to the third summing layer, an eleventh convolutional layer connected to the fourth activation layer, a fifth activation layer connected to the eleventh convolutional layer, a resampling layer connected to the fifth activation layer, and a first multiplication layer connected to the resampling layer.
[0049] Preferably, the convolution kernels of the ninth, tenth, and eleventh convolutional layers are 1*1. The fourth activation layer is a ReLU layer. The fifth activation layer is a Sigmoid layer.
[0050] Specifically, attention gate units are introduced at the end of the skip connections connecting the encoding and decoding modules. These attention gate units are used to fuse the output feature map of the corresponding encoding layer, such as X4, and the fused feature map, such as X5 (which needs to be restored to the same size as X4 through convolution). After ReLU operation and channel dimensionality reduction (1*1 convolution), the result is subjected to a Sigmoid operation to obtain attention weights, which are then assigned to the corresponding encoding layer feature map X4, resulting in a low-level semantic feature map X4* (a salient encoding layer feature map) with fused attention.
[0051] like Figure 2 As shown, in this embodiment, multiple decoding modules are connected sequentially, and multiple encoding modules are connected sequentially as well. There is a one-to-one correspondence between the encoding and decoding modules, and they are connected through skip connection layers. An attention gate is introduced at the end of the skip connection layer. The feature maps output by the encoding and decoding modules obtain significant encoding layer feature maps through the attention gate module. Here, "encoding module and decoding module" refers to the encoding module corresponding to the decoding module connected to the attention gate output, and the decoding module preceding the decoding module connected to the attention gate output.
[0052] like Figure 2 and Figure 6 As shown, based on the above embodiments, in an optional embodiment of the present invention, the decoding module includes a first sub-pixel convolutional layer, a first concatenation layer, a third convolutional layer, a third batch normalization layer, a third activation layer, and a second summing layer connected in sequence. The first sub-pixel convolutional layer is used to upsample the features output by the previous decoding module. The first concatenation layer is used to concatenate the features output by the attention gate and the features output by the first sub-pixel convolutional layer. The second summing layer is used to add the features output by the first concatenation layer and the features output by the third activation layer.
[0053] Based on the above embodiments, in an optional embodiment of the present invention, the lightweight segmentation model includes four decoding modules. The third convolutional layer has a 3*3 kernel. The third activation layer is a ReLU layer.
[0054] Specifically, the decoding module includes a subpixel convolutional upsampling module and a residual module consisting of 3x3 convolutional layers, BN layers, and ReLU layers. Feature map X5 is upsampled through subpixel convolution, doubling the image size to obtain the decoding layer output D4. The aforementioned attention-fused encoding layer feature map X4* and the upsampled corresponding feature map D4 are concatenated, and then passed through the residual module containing 3x3 convolutional layers, BN layers, and ReLU layers to obtain the decoding layer output feature map D4* fused with contextual features.
[0055] This subpixel convolution module is an implicit convolutional layer that requires no additional computation. It is used to integrate feature maps and restore image scale. The decoding module first learns image features through convolution operations, obtaining a feature tensor with r² channels. Then, it uses periodic shuffling operations to reassemble the tensor of size H*W*C*r² into a tensor of size rH*rW*C, gradually restoring the resolution of the segmented image and obtaining the decoded feature map. Here, r is set to 2.
[0056] The fused feature map is processed through four decoding modules (Decode Layer) for image reconstruction, ultimately restoring a segmented image with the same size as the input image. Each decoding module uses subpixel convolution for image upsampling. The salient encoding layer feature map, enhanced by an attention gate, is then concatenated and fused with the corresponding feature map output from the decoding module.
[0057] The lightweight tea shoot segmentation method based on an encoding / decoding structure in this invention uses four encoding modules with a stride of 2 for downsampling to obtain encoding layer feature maps. Then, the ASPP module is used to increase the network's receptive field, enhancing its ability to acquire multi-scale context and obtaining a fused feature map. Attention gates are introduced at the ends of skip connections to obtain more salient encoding layer feature maps. In the four decoding modules, subpixel convolution is used for feature map scale recovery. The salient encoding layer feature maps are concatenated with their corresponding decoding layer feature maps, and then further upsampled using subpixel convolution modules to finally reconstruct a segmented image with the same size as the original input image.
[0058] The lightweight tea shoot segmentation method of this invention has low computational load and high recognition accuracy, providing higher real-time performance and high accuracy, thus meeting the needs of mechanized tea shoot picking in real-time scenarios. It provides a foundation for automated tea picking and has great practical significance.
[0059] Based on the above embodiments, in an optional embodiment of the present invention, the training steps of the lightweight segmentation model include steps A1 to A5.
[0060] A1. Construct the initial model.
[0061] Specifically, the network structure of the initial model is as follows: Figure 2 As shown.
[0062] A2. Obtain the original image set. The original images are those containing tea buds.
[0063] Specifically, the original image can be obtained through web crawlers or other means. This invention does not limit the method of obtaining the original image.
[0064] A3. Obtain the annotation files of the original image set and combine them with the original image set to form the original dataset.
[0065] Specifically, the collected raw tea bud images were manually annotated using the Labelme annotation tool to create annotation files. These annotation files were stored in a corresponding folder, forming the original dataset along with the tea bud images. Finally, the original dataset was divided into training and test sets in a 7:3 ratio.
[0066] A4. Preprocess the original dataset. In an optional embodiment of the present invention, based on the above embodiments, step A4 specifically includes steps A41 and A42.
[0067] A41. Randomly crop the original images and corresponding annotation files of the original dataset, normalize the pixel values after random cropping, and then pad them to obtain images and standard files of the same size.
[0068] A42. Perform intensity transformation and / or random flipping along two axes and affine transformation on images of the same size and standard files with a probability of 0.5.
[0069] Specifically, data augmentation is performed through preprocessing. This increases the amount of training data and improves the model's generalization ability.
[0070] A5. Input the preprocessed original dataset into the initial model and train it by calculating the loss to obtain a lightweight segmentation model.
[0071] Specifically, the loss is calculated based on the prediction results of the initial model and the labeled file. After multiple rounds of training, the optimal tea bud segmentation network is obtained. The loss is a 1:1 fusion of the segmentation loss function (DiceLoss) and the cross-entropy loss function (binary cross-entropy loss function, BCELoss).
[0072] The binary cross-entropy loss function is:
[0073]
[0074] In the formula, y i For binary labels 0 or 1, p(y) i ) represents the probability of belonging to the label value.
[0075] The segmentation loss function is:
[0076]
[0077] In the formula, X and Y are the segmentation label and predicted value, respectively, and smooth is the smoothing coefficient, which serves to prevent the denominator from being 0.
[0078] After the model is trained, the test set is preprocessed and then input into the trained lightweight segmentation model to test the quality of the model.
[0079] Specifically, the tea bud images in the test set are padded and resized to obtain images with the same size as the training set. The preprocessed test set is then input into the trained model for recognition. The recognition results are compared with the labeled files to verify the model's quality.
[0080] Example 2
[0081] This invention provides a lightweight tea shoot segmentation device based on an encoding / decoding structure, comprising:
[0082] Initial image acquisition module 1 is used to acquire the initial image and perform preprocessing.
[0083] Image recognition module 2 is used to input the pre-processed image into a pre-trained lightweight segmentation model to obtain recognition images of tea buds.
[0084] The lightweight segmentation model consists of multiple sequentially connected encoding modules, multiple sequentially connected decoding modules, and an ASPP module connecting the last encoding module and the first decoding module. There is a one-to-one correspondence between the encoding and decoding modules, with cross-layer connections achieved through attention gate modules. The attention gate modules fuse the features output from the encoding and decoding modules to obtain more salient features. The first attention gate fuses the features output from the last encoding module and the ASPP module.
[0085] Example 3
[0086] This invention provides a computer-readable storage medium, which includes a stored computer program. When the computer program is running, it controls the device where the computer-readable storage medium is located to execute the lightweight tea shoot segmentation method based on the encoding and decoding structure described in any paragraph of Embodiment 1.
[0087] In the several embodiments provided in this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0088] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0089] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. In the absence of further restrictions, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0090] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0091] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0092] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0093] The use of "first" and "second" in the embodiments is merely to distinguish similar objects and does not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permitted. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0094] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A lightweight tea shoot segmentation method based on codec structure, characterized by, The application relates to a tea bud recognition method and device. An initial image is acquired and preprocessed; The preprocessed image is input into a pre-trained lightweight segmentation model to obtain a tea bud recognition image; The lightweight segmentation model comprises a plurality of encoding modules connected in sequence, a plurality of decoding modules connected in sequence and an ASPP module used to connect the last encoding module and the first decoding module; the encoding modules and the decoding modules are one-to-one corresponding and are connected through attention gate modules; the attention gate modules are used to fuse the features output by the encoding modules and the decoding modules to obtain more significant features; the first attention gate is used to fuse the features output by the last encoding module and the ASPP module; The encoding module comprises a first convolutional layer, a first batch normalization layer, a first activation layer, a second convolutional layer, a second batch normalization layer, a second activation layer and a first addition layer connected in sequence; wherein the first addition layer is used to add the features input into the first convolutional layer and the features output by the second activation layer; The decoding module comprises a first sub-pixel convolutional layer, a first splicing layer, a third convolutional layer, a third batch normalization layer, a third activation layer and a second addition layer connected in sequence; the first sub-pixel convolutional layer is used to up-sample the features output by the previous decoding module; the first splicing layer is used to splice the features output by the attention gate and the features output by the first sub-pixel convolutional layer; and the second addition layer is used to add the features output by the first splicing layer and the features output by the third activation layer; The lightweight segmentation model comprises four encoding modules and four decoding modules; the convolutional kernels of the first convolutional layer, the second convolutional layer and the third convolutional layer are 3*3; the step of the first convolutional layer is 2; and the first activation layer, the second activation layer and the third activation layer are Relu layers.
2. The codec structure based light-weight tea shoot tip segmentation method according to claim 1, wherein, The ASPP module comprises an eighth convolutional layer used to output features, a second splicing layer connected to the eighth convolutional layer, image pooling layers, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer and a seventh convolutional layer which are arranged in parallel and connected to the second splicing layer respectively; The convolutional kernels of the fourth convolutional layer, the fifth convolutional layer and the sixth convolutional layer are 3*3; the dilation rate of the fourth convolutional layer is 18; the dilation rate of the fifth convolutional layer is 12; the dilation rate of the sixth convolutional layer is 6; and the convolutional kernels of the seventh convolutional layer and the eighth convolutional layer are 1*1.
3. The codec structure based light-weight tea shoot tip segmentation method according to claim 1, wherein, The attention gate module comprises a ninth convolutional layer and a tenth convolutional layer arranged in parallel, a third addition layer connected to the ninth convolutional layer and the tenth convolutional layer, a fourth activation layer connected to the third addition layer, an eleventh convolutional layer connected to the fourth activation layer, a fifth activation layer connected to the eleventh convolutional layer, a resampling layer connected to the fifth activation layer and a first multiplication layer connected to the resampling layer; The convolutional kernels of the ninth convolutional layer, the tenth convolutional layer and the eleventh convolutional layer are 1*1; the fourth activation layer is a Relu layer; and the fifth activation layer is a Sigmoid layer.
4. The light-weight tea shoot segmentation method based on codec structure according to any one of claims 1 to 3, characterized in that, The training steps of the lightweight segmentation model comprise: building an initial model; Obtaining an original image set; wherein the original image is an image containing tea sprouts; Obtaining a label file of the original image set, and combining the original image set and the label file to form an original data set; Preprocessing the original data set; Inputting the preprocessed original data set into the initial model, and training by calculating a loss to obtain the lightweight segmentation model.
5. The codec structure based light-weight tea shoot tip segmentation method according to claim 4, characterized in that, The preprocessing of the original data set specifically includes: Randomly cropping the original image of the original data set and the corresponding label file, performing pixel value normalization after random cropping, and then performing padding to obtain images and standard files with consistent size; Performing intensity transformation and / or random flipping and affine transformation in two axial directions on the images and standard files with consistent size according to a probability of 0.
5. The loss is a segmentation loss and a cross-entropy loss fused at a ratio of 1:
1.
6. The light-weight tea shoot segmentation method based on codec structure according to any one of claims 1 to 3, characterized in that, Obtaining an initial image and preprocessing, specifically including: Obtaining an initial image; Padding and size adjustment are performed on the initial image to obtain an image with a preset size.
7. A lightweight tea shoot segmentation device based on codec structure, characterized by, A lightweight tea sprout segmentation method based on a coding structure according to any one of claims 1 to 6; The lightweight tea sprout segmentation device comprises: An initial image acquisition module for obtaining an initial image and preprocessing; An image recognition module for inputting the preprocessed image into a pre-trained lightweight segmentation model to obtain a recognized image of tea sprouts; The lightweight segmentation model comprises a plurality of coding modules connected in sequence, a plurality of decoding modules connected in sequence, and an ASPP module for connecting the last coding module and the first decoding module; the coding modules and the decoding modules are one-to-one corresponding and are connected across layers through attention gate modules; the attention gate modules are used to fuse the features output by the coding modules and the decoding modules to obtain more significant features; the first attention gate is used to fuse the features output by the last coding module and the ASPP module.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, the computer-readable storage medium controls the device where the computer-readable storage medium is located to execute the lightweight tea sprout segmentation method based on the coding structure according to any one of claims 1 to 5. The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, the computer-readable storage medium controls the device where the computer-readable storage medium is located to execute the lightweight tea sprout segmentation method based on the coding structure according to any one of claims 1 to 5.
Citation Information
Patent Citations
Tea tender shoot image segmentation method based on saliency detection and Grabcut algorithm
CN112085017A
Medical image segmentation method and system based on feature reuse and attention gate
CN115115838A