A landscape plant image semantic segmentation method based on weak supervision
By combining weakly supervised learning and multi-scale fusion deep learning models with adaptive processing techniques, the problems of data dependence and environmental adaptability in landscape plant image segmentation are solved, achieving efficient and accurate landscape plant identification and segmentation.
Patent Information
- Application Number
- CN202411090953.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-08-09
AI Technical Summary
Existing semantic segmentation methods for landscape plant images rely on a large amount of labeled data, which is costly and time-consuming to acquire. They are also difficult to handle landscape plant images in complex environments. Furthermore, existing methods lack specific optimizations for landscape plants, resulting in unsatisfactory edge details and visual consistency in the segmentation results.
We employ a weakly supervised semantic segmentation method for landscape plant images. This method is trained using partially labeled data, combined with a multi-scale fusion deep learning model and an adaptive activation function to extract high-dimensional features. Adaptive preprocessing and postprocessing are then performed to optimize the identification and segmentation of landscape plants.
It significantly reduces the reliance on fully labeled data, improves segmentation accuracy and robustness in complex environments, and enhances the accuracy of plant species identification and the visual consistency of segmentation results.
Smart Images

Figure CN119152502B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of semantic segmentation technology, and in particular to a semantic segmentation method for landscape plant images based on weak supervision. Background Technology
[0002] In landscape design and garden management, the identification and classification of landscape plants is a crucial task. Traditional methods for identifying landscape plants typically rely on manual labeling and classification, which is not only time-consuming and labor-intensive but also requires a high level of expertise from the labelers. Therefore, how to efficiently achieve automated identification and classification of landscape plants has become an urgent problem to be solved in this field.
[0003] With the development of computer vision technology, image semantic segmentation has become an effective means of solving this problem. Semantic segmentation is an advanced image processing task that aims to classify each pixel in an image into a specific category. However, existing image semantic segmentation methods typically rely on supervised learning training with large amounts of labeled data. This labeled data requires fine annotation, which is costly and time-consuming to obtain. For example, in large-scale landscape images, accurate pixel-level annotation of each plant not only requires a significant amount of time and human resources but also necessitates that the annotators possess high levels of expertise. This makes traditional supervised learning methods face considerable difficulties in practical applications.
[0004] To reduce reliance on large amounts of labeled data, weakly supervised learning techniques have emerged. Weakly supervised learning utilizes partially labeled data for training, significantly reducing the cost and difficulty of data annotation. However, existing weakly supervised learning methods still have some shortcomings when applied to landscape plant images in complex environments. First, landscape images contain a wide variety of plant species and morphologies, and the same plant species can behave differently in different environments, making it difficult for existing methods to handle such highly complex and diverse scenes. Second, factors such as changes in lighting, occlusion, and background interference can significantly affect image segmentation results, and existing methods exhibit low robustness and accuracy when dealing with these complex environmental conditions.
[0005] Furthermore, most existing image semantic segmentation methods are used for the detection and segmentation of general objects, lacking specific optimization for landscape plants. These methods often ignore the biological characteristics and visual features of plants, failing to fully utilize the expertise of botany and landscape design, thus affecting the accuracy of the segmentation results. In addition, when processing complex landscape images, existing methods often produce segmentation results with unsatisfactory edge details and overall visual consistency, impacting practical application effectiveness. Summary of the Invention
[0006] The purpose of this invention is to provide a semantic segmentation method for landscape plant images based on weak supervision. By reducing the dependence on a large amount of labeled data, it improves the segmentation accuracy and robustness in complex environments, specifically optimizes the identification and segmentation of landscape plants, and adaptively adjusts and optimizes the segmentation results, significantly improving the edge details and visual consistency of the segmentation results. It has significant practical value and broad application prospects.
[0007] The objective of this invention can be achieved through the following technical solutions:
[0008] A semantic segmentation method for landscape plant images based on weak supervision includes the following steps:
[0009] S1. Obtain the input landscape plant image;
[0010] S2. Preprocess the input landscape plant images and adaptively adjust the preprocessing parameters according to different landscape plant image qualities and environmental conditions.
[0011] S3. Use a deep learning model to extract high-dimensional features of landscape plants from the preprocessed landscape plant images.
[0012] S4. Weakly supervised learning training of deep learning models using partially labeled data;
[0013] S5. Using the trained deep learning model and extracted high-dimensional features, perform preliminary semantic segmentation on the input landscape plant image, classifying each pixel in the landscape plant image into a specific landscape plant category.
[0014] S6. Post-process the preliminary segmentation results and adaptively adjust the post-processing parameters according to different landscape plant image quality and environmental conditions;
[0015] S7. Output the semantically segmented landscape plant image based on the post-processing results.
[0016] The input formats for the landscape plant images include landscape plant images captured by a digital camera and landscape plant images extracted from an image database.
[0017] The preprocessing includes image enhancement, noise removal, and scale transformation.
[0018] The preprocessing includes the following steps:
[0019] S21. Convert the acquired landscape plant images into formats, and convert landscape plant images from different sources and formats into image formats supported by the processing system. Image formats include JPEG, PNG and TIFF formats.
[0020] S22. Detect the image resolution, image sharpness, and color saturation of the landscape plant images;
[0021] S23. Using a gradient detection-based image quality enhancement algorithm, perform image enhancement processing on low-quality landscape plant images to improve their contrast and edge sharpness:
[0022]
[0023] Among them, I enhanced Represents the enhanced landscape vegetation image, I original This represents the original landscape vegetation image, where α is the enhancement factor. Represents the image gradient;
[0024] S24. An adaptive median filtering algorithm is used to remove noise from the landscape plant images that have undergone quality inspection and enhancement processing:
[0025] I denoised (x, y) = median{I enhanced (i,j)|(i,j)∈N(x,y)};
[0026] Among them, I denoised (x,y) represents the pixel value of the landscape plant image after denoising, N(x,y) represents the set of neighboring pixels centered at (x,y), and median is the median operation;
[0027] S25. Adjust the size and resolution of the landscape plant image according to its resolution and size to meet the requirements of subsequent processing steps. The adjustment standard is set to a fixed size or proportional scaling.
[0028] I resized =resize(I denoised (,target_size);
[0029] Among them, I resized This represents the resized landscape plant image, where `resize` is the resizing function and `target_size` represents the target size.
[0030] S26. Perform color space conversion on the resized landscape plant image, converting the image from RGB color space to Lab color space:
[0031] I Lab =convert(I resized ,RGB2Lab);
[0032] Among them, I LabThis represents the converted landscape plant image. `convert` is the color space conversion function, and `RGB2Lab` represents the conversion from RGB to Lab.
[0033] S3 includes the following steps:
[0034] S31. The preprocessed landscape plant image is input into a multi-scale fusion deep learning model, which includes multiple parallel convolutional neural network branches, each of which processes landscape plant image features at different scales.
[0035] S32. In each branch of the convolutional neural network, perform multi-scale convolution operations on the features of the input landscape plant image to extract local features at different scales:
[0036]
[0037] in, This represents the convolution result at the s-th scale branch position (i,j) in the first layer. This represents the kernel weights of the s-th scale branch in the first layer. This represents the input feature map at position (i+m, j+n) in layer 1-1, b l,s k represents the bias of the s-th scale branch in the first layer. s This represents half the kernel size of the s-th scale branch. The kernel size is typically an odd number, therefore k... s This represents the number of positions from the center of the convolution kernel to the boundary.
[0038] S33. After each convolutional layer, an adaptive activation function is applied to the result of the convolution operation. The adaptive activation function dynamically adjusts its parameters based on the statistical properties of the input features to adjust the non-linear expressive power.
[0039]
[0040] in, This represents the activation result at the s-th scale branch position (i,j) in the l-th layer. For dynamically adjusted parameters, σ represents the standard deviation of the input features, ReLU is the adaptive activation function, and γ is the dynamically adjusted parameter used to adjust the influence of the standard deviation of the input features on the activation result.
[0041] S34. Fuse the activation results of all scale branches and obtain the fused feature map by weighted summation:
[0042]
[0043] in, This represents the feature map after fusion at layer l, α s Let S be the weight coefficient of the s-th scale branch, and S be the total number of scale branches.
[0044] S35. Perform global feature extraction on the fused feature map and use an attention mechanism to enhance global contextual information:
[0045]
[0046] in, This represents the feature map after applying the attention mechanism to the l-th layer. and These represent the feature vectors of the query, key, and value, respectively, and softmax is the normalized activation function;
[0047] S36. The feature map processed by multi-scale fusion and attention mechanism is globally pooled to obtain a fixed-length feature vector representation, which serves as a high-dimensional feature representation of landscape plants.
[0048] S4 includes the following steps:
[0049] S41. Divide the partially labeled landscape plant image data into a training set and a validation set, with samples of each category distributed in both sets;
[0050] S42. Define a loss function specific to landscape plant images, including biological characteristic loss and visual feature loss. Biological characteristic loss incorporates the biological characteristics of the plants, and visual feature loss incorporates the visual characteristics of the plants. The mathematical expression of the loss function is:
[0051]
[0052] Where L represents the total loss, L bio Indicating loss of biological characteristics, L visual L represents visual feature loss. unsup L represents unsupervised loss. struct Represents the structural similarity loss, y i This represents the true label of the i-th labeled sample. Let I represent the predicted label of the i-th labeled sample. i This represents the original image of the i-th labeled sample. Let y represent the predicted image of the i-th labeled sample. j This represents the pseudo-label of the j-th unlabeled sample. I represents the predicted label of the j-th unlabeled sample. j This represents the original image of the j-th unlabeled sample. Let represent the predicted image of the j-th unlabeled sample, where β and δ are weight coefficients, λ is the weight coefficient of the unsupervised loss, N is the number of labeled samples, and M is the number of unlabeled samples;
[0053] S43. Initialize the parameters of the multi-scale fusion deep learning model and optimize the multi-scale fusion deep learning model using the stochastic gradient descent algorithm;
[0054] S44. Perform forward propagation calculation on the labeled samples to obtain the predicted labels and calculate the biological feature loss and visual feature loss:
[0055]
[0056]
[0057] Where C represents the number of landscape plant categories. This represents the true label of the i-th sample belonging to category c. w represents the predicted probability that the i-th sample belongs to class c. c The biological characteristic weights for category c, I represents the neighborhood of a pixel. i (p,q) and Let represent the original and predicted values of the i-th sample at pixel (p,q), respectively; G represents the visual feature similarity function; and μ is the weighting coefficient of the visual feature similarity.
[0058] S45. Perform forward propagation calculations on unlabeled samples, generate pseudo-labels using the model, and calculate unsupervised loss and structural similarity loss:
[0059]
[0060]
[0061] Where H and W represent the height and width of the image, respectively. and Let represent the original and predicted gradients of the j-th sample at pixel (p, q), respectively. The pseudo-label of the j-th unlabeled sample:
[0062]
[0063] S46. The biological characteristic loss, visual feature loss, unsupervised loss and structural similarity loss are weighted and summed to obtain the total loss, and the parameters of the multi-scale fusion deep learning model are updated through the backpropagation algorithm.
[0064] S47. Repeat the forward and backward propagation process until the loss function on the validation set converges, finally obtaining the multi-scale fusion deep learning model f trained with weakly supervised learning. θ* (x); where f θ (x) represents a multi-scale fusion deep learning model, where x represents the input landscape plant image, and θ * This represents the optimal set of parameters obtained after weakly supervised learning.
[0065] S5 includes the following steps:
[0066] S51. Input the preprocessed landscape plant images and extracted high-dimensional features into a multi-scale fusion deep learning model trained with weak supervision.
[0067] S52. Perform forward propagation calculation on the input landscape plant image to obtain the classification prediction probability for each pixel:
[0068]
[0069] in, f represents the pixel classification prediction probability at position (i,j). θ* (x i,j ) represents the pixel feature x at position (i,j) in a multi-scale fusion deep learning model. i,j The output of , where softmax is the normalized activation function;
[0070] S53. Maximize the predicted classification probability for each pixel to determine the final classification label for each pixel:
[0071]
[0072] in, The final category label for the pixel at position (i,j) is given. This represents the predicted probability that the pixel at position (i,j) belongs to category c;
[0073] S54. Combine the final classification labels of all pixels into a complete semantic segmentation map to represent the plant category to which each pixel in the landscape plant image belongs.
[0074] The post-processing includes edge smoothing, region merging, and noise filtering.
[0075] The edge smoothing specifically involves: performing edge detection and refinement on the semantic segmentation map, and using a convolutional post-processing algorithm to optimize the segmentation results, adjusting the accuracy of edges and the clarity of details.
[0076]
[0077] in, This represents the optimized semantic segmentation result, where conv is the convolution operation. These represent the semantic segmentation results of the pixels adjacent to position (i,j).
[0078] The specific method for adaptively adjusting preprocessing or postprocessing parameters based on different landscape plant image qualities and environmental conditions is as follows:
[0079] Based on the quality of the input landscape plant image and environmental conditions, define an adaptive adjustment parameter set Θ = {θ1, θ2, ..., θ...} n}, where each parameter θ i For a specific preprocessing or postprocessing operation, n is the number of parameters that need to be adjusted;
[0080] The input landscape plant image is quality assessed by calculating its contrast, brightness, noise level, and resolution. The mathematical expression for quality assessment is as follows:
[0081] Q = {q1, q2, q3, q4};
[0082] Where q1 represents the contrast evaluation value, q2 represents the brightness evaluation value, q3 represents the noise level evaluation value, and q4 represents the resolution evaluation value;
[0083] Based on the image quality assessment results and the preset threshold range, select the corresponding preprocessing parameter θ. pre and post-processing parameter θ post ;
[0084] Apply the selected preprocessing parameter θ pre and post-processing parameter θ post Adaptive preprocessing and postprocessing operations are performed separately.
[0085] Compared with the prior art, the present invention has the following beneficial effects:
[0086] (1) By using weakly supervised learning technology, this invention only requires training with partially labeled data, which greatly reduces the dependence on the full amount of labeled data. It also combines biological characteristics and visual features for optimization, which not only reduces the cost and time investment of data labeling, but also reduces the dependence on professional labelers.
[0087] (2) By adopting a multi-scale fusion deep learning model and an adaptive activation function, this invention significantly improves the accuracy of landscape plant identification and segmentation in complex environments. The multi-scale fusion deep learning model can effectively extract features at different scales, enhancing the model's adaptability to plants of different sizes and shapes. In addition, the adaptive adjustment of the preprocessing and postprocessing modules can dynamically adjust parameters according to image quality and environmental conditions, ensuring the efficiency and accuracy of the processing steps and improving the robustness of the model under different environmental conditions.
[0088] (3) This invention is specifically optimized for landscape plants, combining professional knowledge of botany and landscape design to improve the accuracy of plant species identification. By post-processing the preliminary segmentation results, including edge smoothing, region merging and noise filtering, the visual consistency and practical application effect of the segmentation results are improved. Attached Figure Description
[0089] Figure 1 This is a flowchart of the method of the present invention;
[0090] Figure 2 This is a schematic diagram of the structure of a multi-scale fusion deep learning model in one embodiment. Detailed Implementation
[0091] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0092] This embodiment provides a semantic segmentation method for landscape plant images based on weak supervision, such as... Figure 1 As shown, it includes the following steps:
[0093] S1. Obtain the input landscape plant image.
[0094] In this embodiment, the input forms of landscape plant images include landscape plant images taken by a digital camera and landscape plant images extracted from an image database.
[0095] S2. Preprocess the input landscape plant images, including image enhancement, noise removal, and scale transformation, and adaptively adjust the preprocessing parameters according to different landscape plant image qualities and environmental conditions.
[0096] In one embodiment, the preprocessing includes the following steps:
[0097] S21. Convert the acquired landscape plant images into formats, and convert landscape plant images from different sources and formats into image formats supported by the processing system. Image formats include JPEG, PNG and TIFF formats.
[0098] S22. Detect the image resolution, image sharpness, and color saturation of the landscape plant images;
[0099] S23. Using a gradient detection-based image quality enhancement algorithm, perform image enhancement processing on low-quality landscape plant images to improve their contrast and edge sharpness:
[0100]
[0101] Among them, I enhanced Represents the enhanced landscape vegetation image, I original This represents the original landscape vegetation image, where α is the enhancement factor. Represents the image gradient;
[0102] S24. An adaptive median filtering algorithm is used to remove noise from the landscape plant images that have undergone quality inspection and enhancement processing:
[0103] I denoised (x,y)=median{I enhanced (i,j)|(i,j)∈N(x,y)};
[0104] Among them, I denoised (x,y) represents the pixel value of the landscape plant image after denoising, N(x,y) represents the set of neighboring pixels centered at (x,y), and median is the median operation;
[0105] S25. Adjust the size and resolution of the landscape plant image according to its resolution and size to meet the requirements of subsequent processing steps. The adjustment standard is set to a fixed size or proportional scaling.
[0106] I resized =resize(I denoised (,target_size);
[0107] Among them, I resized This represents the resized landscape plant image, where `resize` is the resizing function and `target_size` represents the target size.
[0108] S26. Perform color space conversion on the resized landscape plant image, converting the image from RGB color space to Lab color space:
[0109] I Lab =convert(I resized ,RGB2Lab);
[0110] Among them, I LabThis represents the converted landscape plant image. `convert` is the color space conversion function, and `RGB2Lab` represents the conversion from RGB to Lab.
[0111] S3. Use a deep learning model to extract high-dimensional features of landscape plants from the preprocessed landscape plant images.
[0112] In one embodiment, S3 includes the following steps:
[0113] S31. The preprocessed landscape plant image is input into a multi-scale fusion deep learning model. This model includes multiple parallel convolutional neural network branches, each processing landscape plant image features at different scales, such as... Figure 2 As shown;
[0114] S32. In each branch of the convolutional neural network, perform multi-scale convolution operations on the features of the input landscape plant image to extract local features at different scales:
[0115]
[0116] in, Let represent the convolution result at the s-th scale branch position (i,j) in the l-th layer. This represents the kernel weights of the s-th scale branch in the l-th layer. This represents the input feature map at position (i+m, j+n) in the (l-1)th layer, b l , s k represents the bias of the s-th scale branch in the l-th layer. s This represents half the kernel size of the s-th scale branch. The kernel size is usually an odd number, therefore k... s This represents the number of positions from the center of the convolution kernel to the boundary.
[0117] S33. After each convolutional layer, an adaptive activation function is applied to the result of the convolution operation. The adaptive activation function dynamically adjusts its parameters based on the statistical properties of the input features to adjust the non-linear expressive power.
[0118]
[0119] in, This represents the activation result at the s-th scale branch position (i,j) in the l-th layer. For dynamically adjusted parameters, σ represents the standard deviation of the input features, ReLU is the adaptive activation function, and γ is the dynamically adjusted parameter used to adjust the influence of the standard deviation of the input features on the activation result.
[0120] S34. Fuse the activation results of all scale branches and obtain the fused feature map by weighted summation:
[0121]
[0122] in, This represents the feature map after fusion at layer l, α s Let S be the weight coefficient of the s-th scale branch, and S be the total number of scale branches.
[0123] S35. Perform global feature extraction on the fused feature map and use an attention mechanism to enhance global contextual information:
[0124]
[0125] in, This represents the feature map after applying the attention mechanism to the l-th layer. and These represent the feature vectors of the query, key, and value, respectively, and softmax is the normalized activation function;
[0126] S36. The feature map processed by multi-scale fusion and attention mechanism is globally pooled to obtain a fixed-length feature vector representation, which serves as a high-dimensional feature representation of landscape plants.
[0127] S4. Weakly supervised learning training of the deep learning model is performed using partially labeled data.
[0128] In one embodiment, S4 includes the following steps:
[0129] S41. Divide the partially labeled landscape plant image data into a training set and a validation set, with samples of each category distributed in both sets;
[0130] S42. Define a loss function specific to landscape plant images, including biological characteristic loss and visual feature loss. Biological characteristic loss incorporates the biological characteristics of the plants, and visual feature loss incorporates the visual characteristics of the plants. The mathematical expression of the loss function is:
[0131]
[0132] Where L represents the total loss, L bio Indicating loss of biological characteristics, L visual L represents visual feature loss. unsup L represents unsupervised loss. struct Represents the structural similarity loss, y i This represents the true label of the i-th labeled sample. Let I represent the predicted label of the i-th labeled sample. iThis represents the original image of the i-th labeled sample. Let y represent the predicted image of the i-th labeled sample. j This represents the pseudo-label of the j-th unlabeled sample. I represents the predicted label of the j-th unlabeled sample. j This represents the original image of the j-th unlabeled sample. Let represent the predicted image of the j-th unlabeled sample, where β and δ are weight coefficients, λ is the weight coefficient of the unsupervised loss, N is the number of labeled samples, and M is the number of unlabeled samples;
[0133] S43. Initialize the parameters of the multi-scale fusion deep learning model and optimize the multi-scale fusion deep learning model using the stochastic gradient descent algorithm;
[0134] S44. Perform forward propagation calculation on the labeled samples to obtain the predicted labels and calculate the biological feature loss and visual feature loss:
[0135]
[0136]
[0137] Where C represents the number of landscape plant categories. This represents the true label of the i-th sample belonging to category c. w represents the predicted probability that the i-th sample belongs to class c. c The biological characteristic weights for category c, I represents the neighborhood of a pixel. i (p,q) and Let represent the original and predicted values of the i-th sample at pixel (p,q), respectively; G represents the visual feature similarity function; and μ is the weighting coefficient of the visual feature similarity.
[0138] S45. Perform forward propagation calculations on unlabeled samples, generate pseudo-labels using the model, and calculate unsupervised loss and structural similarity loss:
[0139]
[0140]
[0141] Where H and W represent the height and width of the image, respectively. and Let represent the original and predicted gradients of the j-th sample at pixel (p, q), respectively. The pseudo-label of the j-th unlabeled sample:
[0142]
[0143] S46. The biological characteristic loss, visual feature loss, unsupervised loss and structural similarity loss are weighted and summed to obtain the total loss, and the parameters of the multi-scale fusion deep learning model are updated through the backpropagation algorithm.
[0144] S47. Repeat the forward and backward propagation process until the loss function on the validation set converges, finally obtaining the multi-scale fusion deep learning model f trained with weakly supervised learning. θ* (x); where f θ (x) represents a multi-scale fusion deep learning model, where x represents the input landscape plant image, and θ * This represents the optimal set of parameters obtained after weakly supervised learning.
[0145] S5. Using the trained deep learning model and extracted high-dimensional features, perform preliminary semantic segmentation on the input landscape plant image, classifying each pixel in the landscape plant image into a specific landscape plant category.
[0146] In one embodiment, S5 includes the following steps:
[0147] S51. Input the preprocessed landscape plant images and extracted high-dimensional features into a multi-scale fusion deep learning model trained with weak supervision.
[0148] S52. Perform forward propagation calculation on the input landscape plant image to obtain the classification prediction probability for each pixel:
[0149]
[0150] in, f represents the pixel classification prediction probability at position (i,j). θ* (x i,j ) represents the pixel feature x at position (i,j) in a multi-scale fusion deep learning model. i,j The output of , where softmax is the normalized activation function;
[0151] S53. Maximize the predicted classification probability for each pixel to determine the final classification label for each pixel:
[0152]
[0153] in, The final category label for the pixel at position (i,j) is given. This represents the predicted probability that the pixel at position (i,j) belongs to category c;
[0154] S54. Combine the final classification labels of all pixels into a complete semantic segmentation map to represent the plant category to which each pixel in the landscape plant image belongs.
[0155] S6. Post-process the preliminary segmentation results, including edge smoothing, region merging, and noise filtering, and adaptively adjust the post-processing parameters according to different landscape plant image quality and environmental conditions.
[0156] Specifically, edge smoothing involves: performing edge detection and refinement on the semantic segmentation map, and using a convolutional post-processing algorithm to optimize the segmentation results, adjusting the accuracy of edges and the clarity of details.
[0157]
[0158] in, This represents the optimized semantic segmentation result, where conv is the convolution operation. These represent the semantic segmentation results of the pixels adjacent to position (i,j).
[0159] The processes of region merging and noise filtering are standard practices in this field, and will not be elaborated upon here to avoid obscuring the purpose of this application.
[0160] S7. Output the semantically segmented landscape plant image based on the post-processing results.
[0161] The optimized semantic segmentation map is output, and the classification result of each pixel is visualized to obtain the final semantic segmentation result of the landscape plant image.
[0162] In this embodiment, the specific method for adaptively adjusting preprocessing or postprocessing parameters according to different landscape plant image qualities and environmental conditions is as follows:
[0163] Based on the quality of the input landscape plant image and environmental conditions, define an adaptive adjustment parameter set Θ = {θ1, θ2, ..., θ...} n}, where each parameter θ i For a specific preprocessing or postprocessing operation, n is the number of parameters that need to be adjusted;
[0164] The input landscape plant image is quality assessed by calculating its contrast, brightness, noise level, and resolution. The mathematical expression for quality assessment is as follows:
[0165] Q = {q1, q2, q3, q4};
[0166] Where q1 represents the contrast evaluation value, q2 represents the brightness evaluation value, q3 represents the noise level evaluation value, and q4 represents the resolution evaluation value;
[0167] Based on the image quality assessment results and the preset threshold range, select the corresponding preprocessing parameter θ. pre and post-processing parameter θ post ;
[0168] Apply the selected preprocessing parameter θ pre and post-processing parameter θ post Adaptive preprocessing and postprocessing operations are performed separately.
[0169] Throughout the processing, the preprocessing and postprocessing parameters Θ are dynamically adjusted based on the real-time assessment of image quality and environmental conditions.
[0170] In the management of a certain garden scenic area, landscape designers and maintenance personnel need to accurately identify and classify the plants within the area to better facilitate landscape design, plant maintenance, and scenic area management. However, the scenic area has a wide variety of plant species with diverse forms, and their appearance changes significantly under different seasons and lighting conditions. Traditional manual labeling and classification methods are not only time-consuming and labor-intensive but also require a high level of professional knowledge, making them difficult to meet practical needs. Therefore, this invention applies a weakly supervised semantic segmentation method for landscape plant images to automatically identify and classify the plants within the scenic area.
[0171] In the management of this garden scenic area, this embodiment collected landscape plant image data under different seasons, time periods, and lighting conditions. This data includes high-resolution images captured by digital cameras and real-time monitoring images extracted from the scenic area's monitoring system. To verify the effectiveness of the method of this invention, we divided these image data into training and testing sets. Some images were precisely labeled for training weakly supervised learning, while the remaining images were used for model testing and validation.
[0172] In the image processing, the input landscape plant image is first preprocessed. Preprocessing steps include image enhancement, noise removal, and scale transformation. Specifically, contrast enhancement, brightness adjustment, and color balancing techniques are used to improve the visual quality of the image, while an adaptive median filtering algorithm is used to remove noise. The preprocessed image quality is significantly improved, laying a solid foundation for subsequent feature extraction and segmentation steps.
[0173] Next, a multi-scale fusion deep learning model trained with weak supervision is used to extract features and perform semantic segmentation on the preprocessed images. This model can extract plant features at different scales and enhance the expressive power of features using adaptive activation functions and attention mechanisms. During model training, we use partially labeled data for supervised learning and combine it with an unsupervised loss function, optimizing the model parameters through stochastic gradient descent, ultimately obtaining an efficient model trained with weak supervision.
[0174] In practical applications, preprocessed and feature-extracted landscape plant images are input into a trained model for semantic segmentation. The model calculates the classification prediction probability for each pixel and determines the final classification label for each pixel based on the maximum value. The initial segmentation results are then processed using convolutional post-processing algorithms for edge smoothing, region merging, and noise filtering, ultimately yielding an accurate semantic segmentation map.
[0175] To verify the effectiveness of the method of this invention, multiple tests were conducted in actual application in the garden scenic area, and the results were compared with traditional manual annotation and classification methods. The test data included 1000 high-resolution landscape plant images from different seasons, time periods, and lighting conditions. Table 1 below shows the data comparison of the test results:
[0176] Table 1 Comparison of semantic segmentation methods for landscape plant images.
[0177]
[0178] Table 1 shows that while traditional manual annotation and classification methods can achieve a certain level of accuracy, they are time-consuming, inefficient, and highly dependent on specialized knowledge. In contrast, the method of this invention uses only a portion of the labeled data and, through weakly supervised learning, significantly reduces the cost and difficulty of data annotation. Regarding processing time, the method of this invention processes each image in an average of only 5 minutes, greatly improving processing efficiency. Furthermore, the method of this invention outperforms traditional methods in terms of segmentation accuracy, edge detail, and user satisfaction, especially demonstrating higher robustness and accuracy when processing landscape plant images in complex environments.
[0179] Through practical application and testing in this garden scenic area, this embodiment fully verifies the effectiveness and advantages of the method of the present invention. The method of the present invention not only solves the shortcomings of traditional methods in terms of data annotation and processing efficiency, but also significantly improves the segmentation accuracy and visual consistency of landscape plant images, providing strong technical support for the design and management of garden scenic areas.
[0180] This invention utilizes weakly supervised learning technology, requiring only partially labeled data for training, which greatly reduces the reliance on the full amount of labeled data. Furthermore, it incorporates biological characteristics and visual features for optimization, thereby reducing not only the cost and time investment in data labeling but also the dependence on professional labelers.
[0181] This invention significantly improves the accuracy of landscape plant identification and segmentation in complex environments by employing a multi-scale fusion deep learning model and adaptive activation function. The multi-scale fusion deep learning model can effectively extract features at different scales, enhancing the model's adaptability to plants of different sizes and shapes. In addition, the adaptive adjustment of preprocessing and postprocessing modules can dynamically adjust parameters according to image quality and environmental conditions, ensuring the efficiency and accuracy of processing steps and improving the robustness of the model under different environmental conditions.
[0182] This invention is specifically optimized for landscape plants, combining expertise in botany and landscape design to improve the accuracy of plant species identification. Post-processing of the initial segmentation results, including edge smoothing, region merging, and noise filtering, enhances the visual consistency and practical application effectiveness of the segmentation results.
[0183] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A semantic segmentation method for landscape plant images based on weak supervision, characterized in that, Includes the following steps: S1. Obtain the input landscape plant image; S2. Preprocess the input landscape plant images and adaptively adjust the preprocessing parameters according to different landscape plant image qualities and environmental conditions. S3. Use a deep learning model to extract high-dimensional features of landscape plants from the preprocessed landscape plant images. S4. Weakly supervised learning training of deep learning models using partially labeled data; S5. Using the trained deep learning model and extracted high-dimensional features, perform preliminary semantic segmentation on the input landscape plant image, classifying each pixel in the landscape plant image into a specific landscape plant category. S6. Post-process the preliminary segmentation results and adaptively adjust the post-processing parameters according to different landscape plant image quality and environmental conditions; S7. Output the semantically segmented landscape plant image based on the post-processing results.
2. The semantic segmentation method for landscape plant images based on weak supervision according to claim 1, characterized in that, The input formats for the landscape plant images include landscape plant images captured by a digital camera and landscape plant images extracted from an image database.
3. The semantic segmentation method for landscape plant images based on weak supervision according to claim 1, characterized in that, The preprocessing includes image enhancement, noise removal, and scale transformation.
4. The semantic segmentation method for landscape plant images based on weak supervision according to claim 3, characterized in that, The preprocessing includes the following steps: S21. Convert the acquired landscape plant images into formats, and convert landscape plant images from different sources and formats into image formats supported by the processing system. Image formats include JPEG, PNG and TIFF formats. S22. Detect the image resolution, image sharpness, and color saturation of the landscape plant images; S23. Using a gradient detection-based image quality enhancement algorithm, perform image enhancement processing on low-quality landscape plant images to improve their contrast and edge sharpness: Among them, I enhanced Represents the enhanced landscape vegetation image, I original This represents the original landscape vegetation image, where α is the enhancement factor. Represents the image gradient; S24. An adaptive median filtering algorithm is used to remove noise from the landscape plant images that have undergone quality inspection and enhancement processing: I denoised (z,y)=median{I enhanced (i,j)∣(i,j)∈N(x,y)}; Among them, I denoised (x,y) represents the pixel value of the landscape plant image after denoising, N(x,y) represents the set of neighboring pixels centered at (x,y), and median is the median operation; S25. Adjust the size and resolution of the landscape plant image according to its resolution and size to meet the requirements of subsequent processing steps. The adjustment standard is set to a fixed size or proportional scaling. I resized =resize(I denoised ,target_size); Among them, I resized This represents the resized landscape plant image, where `resize` is the resizing function and `target_size` represents the target size. S26. Perform color space conversion on the resized landscape plant image, converting the image from RGB color space to Lab color space: I Lab =convert(I resized ,RGB2Lab); Among them, I Lab This represents the converted landscape plant image. `convert` is the color space conversion function, and `RGB2Lab` represents the conversion from RGB to Lab.
5. The semantic segmentation method for landscape plant images based on weak supervision according to claim 1, characterized in that, S3 includes the following steps: S31. The preprocessed landscape plant image is input into a multi-scale fusion deep learning model, which includes multiple parallel convolutional neural network branches, each of which processes landscape plant image features at different scales. S32. In each branch of the convolutional neural network, perform multi-scale convolution operations on the features of the input landscape plant image to extract local features at different scales: in, Let represent the convolution result at the s-th scale branch position (i,j) in the l-th layer. This represents the kernel weights of the s-th scale branch in the l-th layer. This represents the input feature map at position (i+m, j+n) in the (l-1)th layer, b l,s k represents the bias of the s-th scale branch in the l-th layer. s This represents half the kernel size of the s-th scale branch; S33. After each convolutional layer, an adaptive activation function is applied to the result of the convolution operation. The adaptive activation function dynamically adjusts its parameters based on the statistical properties of the input features to adjust the non-linear expressive power. in, This represents the activation result at the s-th scale branch position (i,j) in the l-th layer. For dynamically adjusting parameters, σ represents the standard deviation of the input features, ReLU is the adaptive activation function, and γ is the dynamically adjusted parameter used to adjust the influence of the standard deviation of the input features on the activation result; S34. Fuse the activation results of all scale branches and obtain the fused feature map by weighted summation: in, This represents the feature map after fusion at layer l, α s Let S be the weight coefficient of the s-th scale branch, and S be the total number of scale branches. S35. Perform global feature extraction on the fused feature map and use an attention mechanism to enhance global contextual information: in, This represents the feature map after applying the attention mechanism to the l-th layer. and These represent the feature vectors of the query, key, and value, respectively, and softmax is the normalized activation function; S36. The feature map processed by multi-scale fusion and attention mechanism is globally pooled to obtain a fixed-length feature vector representation, which serves as a high-dimensional feature representation of landscape plants.
6. The semantic segmentation method for landscape plant images based on weak supervision according to claim 1, characterized in that, S4 includes the following steps: S41. Divide the partially labeled landscape plant image data into a training set and a validation set, with samples of each category distributed in both sets; S42. Define a loss function specific to landscape plant images, including biological characteristic loss and visual feature loss. Biological characteristic loss incorporates the biological characteristics of the plants, and visual feature loss incorporates the visual characteristics of the plants. The mathematical expression of the loss function is: Where L represents the total loss, L bio Indicating loss of biological characteristics, L visual L represents visual feature loss. unsup L represents unsupervised loss. struct Represents the structural similarity loss, y i This represents the true label of the i-th labeled sample. Let I represent the predicted label of the i-th labeled sample. i This represents the original image of the i-th labeled sample. Let y represent the predicted image of the i-th labeled sample. j This represents the pseudo-label of the j-th unlabeled sample. I represents the predicted label of the j-th unlabeled sample. j This represents the original image of the j-th unlabeled sample. Let represent the predicted image of the j-th unlabeled sample, where β and δ are weight coefficients, λ is the weight coefficient of the unsupervised loss, N is the number of labeled samples, and M is the number of unlabeled samples; S43. Initialize the parameters of the multi-scale fusion deep learning model and optimize the multi-scale fusion deep learning model using the stochastic gradient descent algorithm; S44. Perform forward propagation calculation on the labeled samples to obtain the predicted labels and calculate the biological feature loss and visual feature loss: Where C represents the number of landscape plant categories. This represents the true label of the i-th sample belonging to category c. w represents the predicted probability that the i-th sample belongs to class c. c The biological characteristic weights for category c are given by N, which represents the neighborhood of the pixel. i (p,q) and Let represent the original and predicted values of the i-th sample at pixel (p,q), respectively; G represents the visual feature similarity function; and μ is the weighting coefficient of the visual feature similarity. S45. Perform forward propagation calculations on unlabeled samples, generate pseudo-labels using the model, and calculate unsupervised loss and structural similarity loss: Where H and W represent the height and width of the image, respectively. and Let represent the original and predicted gradients of the j-th sample at pixel (p, q), respectively. The pseudo-label of the j-th unlabeled sample: S46. The biological characteristic loss, visual feature loss, unsupervised loss and structural similarity loss are weighted and summed to obtain the total loss, and the parameters of the multi-scale fusion deep learning model are updated through the backpropagation algorithm. S47. Repeat the forward and backward propagation process until the loss function converges on the validation set, finally obtaining a multi-scale fusion deep learning model trained with weak supervision. Among them, f θ (x) represents a multi-scale fusion deep learning model, where x represents the input landscape plant image, and θ * This represents the optimal set of parameters obtained after weakly supervised learning.
7. The semantic segmentation method for landscape plant images based on weak supervision according to claim 1, characterized in that, S5 includes the following steps: S51. Input the preprocessed landscape plant images and extracted high-dimensional features into a multi-scale fusion deep learning model trained with weak supervision. S52. Perform forward propagation calculation on the input landscape plant image to obtain the classification prediction probability for each pixel: in, Let (i,j) represent the pixel classification prediction probability at position (i,j). The pixel feature x at position (i,j) represents the multi-scale fusion deep learning model. i,j The output of , where softmax is the normalized activation function; S53. Maximize the predicted classification probability for each pixel to determine the final classification label for each pixel: in, The final category label for the pixel at position (i,j) is given. This represents the predicted probability that the pixel at position (i,j) belongs to category c; S54. Combine the final classification labels of all pixels into a complete semantic segmentation map to represent the plant category to which each pixel in the landscape plant image belongs.
8. The semantic segmentation method for landscape plant images based on weak supervision according to claim 1, characterized in that, The post-processing includes edge smoothing, region merging, and noise filtering.
9. A semantic segmentation method for landscape plant images based on weak supervision according to claim 8, characterized in that, The edge smoothing specifically involves: performing edge detection and refinement on the semantic segmentation map, and using a convolutional post-processing algorithm to optimize the segmentation results, adjusting the accuracy of edges and the clarity of details. in, This represents the optimized semantic segmentation result, where conv is the convolution operation. These represent the semantic segmentation results of the pixels adjacent to position (i,j).
10. A semantic segmentation method for landscape plant images based on weak supervision according to claim 1, characterized in that, The specific method for adaptively adjusting preprocessing or postprocessing parameters based on different landscape plant image qualities and environmental conditions is as follows: Based on the quality of the input landscape plant image and environmental conditions, define an adaptive adjustment parameter set Θ = {θ1, θ2, ..., θ...} n }, where each parameter θ i For a specific preprocessing or postprocessing operation, n is the number of parameters that need to be adjusted; The input landscape plant image is quality assessed by calculating its contrast, brightness, noise level, and resolution. The mathematical expression for quality assessment is as follows: Q = {q1, q2, q3, q4}; Where q1 represents the contrast evaluation value, q2 represents the brightness evaluation value, q3 represents the noise level evaluation value, and q4 represents the resolution evaluation value; Based on the image quality assessment results and the preset threshold range, select the corresponding preprocessing parameter θ. pre and post-processing parameter θ post ; Apply the selected preprocessing parameter θ pre and post-processing parameter θ post Adaptive preprocessing and postprocessing operations are performed separately.
Citation Information
Patent Citations
Weak supervision semantic segmentation method based on deep learning
CN113159048A
Plant semantic segmentation system based on SpringCloud framework
CN117523198A
