Image Analysis-Based Training Method for Masson Pine Disease Model

By using an image analysis-based method to train a disease model of Masson pine, and by employing the Sobel edge operator and convolutional neural network, the training process of the disease model is optimized. This solves the problems of cumbersome data annotation and high image quality requirements in traditional methods, and achieves more efficient and accurate disease detection and boundary recognition.

CN121458726BActive Publication Date: 2026-04-03SICHUAN FORESTRY RES INST (SICHUAN FORESTRY IND RES & DESIGN INST)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-08
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Traditional image analysis-based training methods for Masson pine disease models rely on manual annotation and feature selection, resulting in a cumbersome and subjective data annotation process. This makes it difficult to ensure the uniformity of data quality, fully capture complex features in images, and has low processing efficiency. Furthermore, it has high requirements for image quality, cannot effectively deal with noise or low-quality images, and struggles to accurately identify disease change trends and complex disease boundaries.

Method used

By collecting images of Masson pine trees at multiple time points, extracting image grayscale, and calculating gradients using the Sobel edge operator, a temporal boundary sample set is generated. This is then combined with a convolutional neural network to perform gradient response sequence analysis, identify gradient abrupt change points, perform cluster analysis, generate a training annotation set, adjust the convolutional kernel weights, and optimize the disease model training results.

Benefits of technology

It improves the accuracy and efficiency of disease detection, can adapt to different image quality, and shows stronger robustness, especially in low-quality or noisy images. It accurately marks disease areas, optimizes disease boundary recognition, improves the overall detection effect, and accurately captures the development trend of diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121458726B_ABST
    Figure CN121458726B_ABST
Patent Text Reader

Abstract

This invention relates to the field of image analysis technology, specifically to a training method for a Masson pine disease model based on image analysis. The method includes the following steps: acquiring multiple temporal images and constructing boundary samples using grayscale and Sobel algorithms; obtaining gradient deviation through a CNN using the outward normal gradient increment and combining it with contour comparison; identifying and labeling mutation points using differential sequences and clustering to form a label set; adjusting the convolution kernel weights based on the labels and transition clusters to optimize boundary representation; iteratively updating the model to improve the accuracy of Masson pine disease identification, enhance temporal stability and robustness in complex scenes, improve edge detail recovery capabilities, and enhance detection consistency. In this invention, by extracting image grayscale and combining it with Sobel for contour gradient calculation, subtle changes are identified and temporal information is fused to capture disease development; gradient response and error comparison improve detection accuracy; differential clustering analysis identifies mutation points and labels diseased areas; and the model is optimized to reduce boundary deviation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image analysis technology, and in particular to a method for training a disease model of Masson pine based on image analysis. Background Technology

[0002] Image analysis technology involves using computer algorithms to process, analyze, and understand images. Core aspects include image preprocessing, feature extraction, pattern recognition, image segmentation, object detection, and image classification. Image analysis is widely used in medical imaging, video surveillance, industrial inspection, autonomous driving, and many other fields. By deeply analyzing the pixel information of images, extracting effective features, and then identifying and classifying them, image analysis technology can provide data support and decision-making basis for various applications.

[0003] Traditional image analysis-based methods for training disease models in Masson pine refer to techniques that analyze image data of Masson pine trees to establish disease detection models. This method typically involves acquiring diseased image data of Masson pine trees, extracting disease features through image processing techniques, and then using machine learning or deep learning algorithms to train the model to identify and predict different disease types.

[0004] Traditional image-based methods for training Masson pine disease models rely on manual annotation and feature selection, resulting in a cumbersome and subjective data annotation process that struggles to ensure consistent data quality. In image processing, traditional algorithms often depend on simple classification methods, failing to capture complex features in images, leading to low processing efficiency and high image quality requirements, particularly ineffective handling of noise or low-quality images. Furthermore, existing methods underutilize time-series information, making it difficult to accurately identify disease trends and exhibiting significant limitations in identifying complex disease boundaries and precise localization. This impacts the accuracy and robustness of disease detection, and also limits the fine segmentation of Masson pine lesion boundaries and precise disease localization, resulting in overall insufficient detection accuracy. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a training method for a disease model of Masson pine based on image analysis.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a method for training a disease model of Masson pine based on image analysis, comprising the following steps:

[0007] S1: Collect images of Masson pine trees at multiple time points and extract image grayscale. Input the Sobel edge operator to calculate the gradient and analyze the outer edge contour point set. Calculate the grayscale change and combine it with the outer edge contour point set to generate a temporal boundary sample set.

[0008] S2: Based on the temporal boundary sample set, calculate the gradient increment in the normal direction, input it into the convolutional neural network for backpropagation to calculate the gradient response sequence, and compare it with the outer edge contour point set to generate gradient deviation parameters.

[0009] S3: Based on the gradient response sequence, differentially analyze the incremental gradients of adjacent gradients, identify gradient mutation points, perform cluster analysis on the mutation points to generate transition point clusters, and combine the gradient deviation parameters to determine whether the diseased areas are consistent and mark them to generate a training annotation set.

[0010] S4: Based on the training annotation set, extract the center of the transition point cluster and multiple annotation points and analyze the spatial distance, calculate the spatial distance distribution characteristics and adjust the convolution kernel weights to generate the training results of the Masson pine disease model;

[0011] S5: Based on the training results of the Masson pine disease model, calculate the disease boundary identification deviation and identify the unstable gradient region according to the deviation amount, update the convolution kernel weights and re-push the temporal boundary sample set to generate the optimized Masson pine disease model training results.

[0012] As a further embodiment of the present invention, the temporal boundary sample set includes a grayscale change sequence, an outer contour point sequence, and a temporal boundary index sequence; the gradient deviation parameters include gradient offset, error ratio, and response difference; the training annotation set includes a disease annotation point sequence, a transition point corresponding identifier sequence, and a region annotation index sequence; the training result of the Masson pine disease model includes a convolution kernel weight sequence, a gradient propagation coefficient sequence, and a disease boundary output sequence; and the optimized training result of the Masson pine disease model includes an updated convolution kernel weight sequence, a re-inference boundary output sequence, and an inference bias correction sequence.

[0013] As a further aspect of the present invention, the step of obtaining the temporal boundary sample set specifically includes:

[0014] S101: Collect image sequences of Masson pine trees at multiple time points and extract image grayscale. By comparing the grayscale of images at multiple time points with the grayscale of images at the initial time point, calculate the grayscale difference of multiple pixels and merge the grayscale difference with the corresponding coordinates to generate a grayscale difference set.

[0015] S102: Call the grayscale difference set, input the Sobel edge operator to perform gradient operation on multiple time point images, compare the gradient magnitude with the pixel position based on the Sobel horizontal and vertical gradients, filter the pixel coordinates that exceed the gradient magnitude threshold as the outer edge contour point position quantity, and generate the outer edge contour point position quantity set.

[0016] S103: Based on the corresponding pixel coordinates of the outer contour point position set and the gray-level difference set, match the gray-level difference and merge the matched gray-level difference with the outer contour point coordinates. By integrating the combined data of all points in the set, generate a temporal boundary sample set.

[0017] The gradient magnitude threshold is determined by analyzing the range of edge gradient changes in the image, obtaining the magnitude distribution of multiple pixels in the horizontal and vertical gradients, and then determining it based on the median of the magnitude distribution.

[0018] As a further aspect of the present invention, the step of obtaining the gradient deviation parameter specifically includes:

[0019] S201: Based on the time-series boundary sample set, obtain the gradient change of each boundary point in the outward normal direction and compare it with the set normal threshold. Calculate the gradient increment based on the comparison result to generate an outward normal gradient increment set.

[0020] S202: Call the gradient increment set in the outward normal direction and input it into the convolutional neural network for gradient propagation training. The convolutional neural network performs backpropagation operation based on the increment set, and gradually adjusts the weight parameters through multiple convolutional layers to optimize network learning and generate gradient response sequences.

[0021] S203: Based on the gradient response sequence, and combined with the outer edge contour point set, perform error comparison, calculate the difference between the response sequence and the outer edge contour points point by point, and generate gradient deviation parameters;

[0022] The normal threshold is determined by calculating the gradient increments of multiple boundary points in the normal direction and based on the median of the gradient increments.

[0023] As a further aspect of the present invention, the gradient increment is calculated using the formula:

[0024] ;

[0025] in, Representing the Gradient increment in the outward normal direction at each boundary point Representing the Normal gradient at each boundary point Representing the Normal angles of each boundary point This represents the set normal threshold. Represents the smoothing coefficient. Representing the and the The distance between the boundary points This represents the number of neighboring points and the baseline length.

[0026] As a further aspect of the present invention, the step of obtaining the training annotation set specifically includes:

[0027] S301: Based on the gradient response sequence, differentially analyze adjacent gradient increments, calculate the difference in gradient change point by point, identify the location information of gradient abrupt change points, compare the gradient difference value with the set gradient abrupt change point detection threshold, mark the location of the abrupt change point, and generate a gradient abrupt change point location set.

[0028] S302: Call the gradient mutation point location set, perform cluster analysis on the mutation point locations, and use the K-means clustering algorithm to classify the mutation points into multiple transition point clusters based on the relative position and gradient change of the mutation points. Analyze the coordinates and association information of each transition point cluster to generate a transition point cluster information set.

[0029] S303: Based on the information set of the transition point clusters and the gradient deviation parameter, determine whether the disease areas corresponding to each transition point cluster are consistent, mark the consistent disease areas based on the judgment results, and generate a training annotation set.

[0030] The gradient mutation point detection threshold is determined by first calculating the difference between adjacent gradient increments, and then based on the median of the difference values.

[0031] As a further aspect of the present invention, the steps for obtaining the training results of the Masson pine disease model are as follows:

[0032] S401: Based on the training annotation set and the transition point cluster, extract the center point of the transition point cluster and obtain multiple annotation points in the training annotation set. Calculate the spatial distance between the center point and the annotation points respectively. Arrange the distance values ​​in the order of the annotation points and analyze the spatial training values ​​according to the distance change trend to generate a spatial distance sequence.

[0033] S402: Call the spatial distance sequence, use difference operation to analyze the change in spatial training values ​​for adjacent distances in the sequence, adjust the weights of the convolution kernel according to the position of the change in the sequence, and use a weighted shift method to add the change to the corresponding weight position in the convolution kernel to generate the weight adjustment amount;

[0034] S403: Based on the weight adjustment amount, update the weight values ​​of the convolution kernel weights according to the weight adjustment amount, arrange and integrate all the updated weights according to the convolution kernel structure, and generate the training results of the Masson pine disease model.

[0035] As a further aspect of the present invention, the spatial distance sequence generation process specifically comprises: obtaining a preliminary distance sequence by arranging the markers in order according to the spatial distance between the center point of the transition point cluster and multiple marker points; correcting each distance value in the preliminary distance sequence using a weighted method, wherein the correction coefficient is dynamically adjusted according to the distribution density of points within the transition point cluster, thereby generating a corrected spatial distance sequence.

[0036] As a further aspect of the present invention, the steps for obtaining the training results of the optimized Masson pine disease model are as follows:

[0037] S501: Based on the training results of the Masson pine disease model, the boundary coordinate values ​​in the training results and the corresponding coordinate values ​​in the time-series boundary sample set are called to calculate the disease boundary identification deviation, and unstable gradient regions are identified according to the changes in the deviation amount. The deviation amount is sorted out to generate a deviation interval sequence.

[0038] S502: Based on the deviation interval sequence, perform iterative updates for the convolution kernel weights by calculating the ratio of the deviation amount within the interval to the corresponding weight position, add the ratio to the original weights item by item, and concatenate the updated weight value sequence according to the order of the convolution kernel weights to obtain the weight update sequence.

[0039] S503: Call the weight update sequence, perform inference processing on the temporal boundary sample set, use the updated weights to perform convolution operation on the temporal boundary sample set to analyze the current boundary, and integrate the output sequence according to the sample order to generate the optimized Masson pine disease model training result.

[0040] As a further aspect of the present invention, the generation method of the weight update sequence is limited to: sequentially splicing adjacent weights in the convolution kernel according to their original order, and maintaining the sequence position correspondence of multiple weight update values ​​at fixed intervals.

[0041] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0042] In this invention, by extracting image grayscale and combining it with the Sobel edge operator to perform gradient calculations on the outer contour point set, subtle changes in the image can be better identified. Combined with temporal information, the disease development process can be effectively captured, solving the problem of insufficient utilization of time series data in traditional methods. The analysis method comparing gradient response sequences with errors makes disease detection more accurate and adaptable to different image qualities, especially showing stronger robustness when processing low-quality or noisy images. Through difference and cluster analysis, the location of gradient abrupt change points in the disease can be identified, accurately marking disease areas and improving the accuracy and efficiency of disease detection. Simultaneously, by iteratively updating the convolution kernel weights, the model is further optimized, reducing the bias in disease boundary identification and improving the overall detection effect. The model integrates time series change information to more accurately capture disease development trends and achieves precise localization of Masson pine disease areas through refined boundary identification. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of the main steps of the present invention;

[0044] Figure 2 This is a flowchart illustrating the process of obtaining the temporal boundary sample set in this invention.

[0045] Figure 3 This is a flowchart illustrating the process of obtaining the gradient deviation parameter in this invention.

[0046] Figure 4 This is a flowchart illustrating the process of obtaining the training annotation set for this invention.

[0047] Figure 5 This is a flowchart illustrating the process of obtaining the training results of the Masson pine disease model of the present invention.

[0048] Figure 6 This is a flowchart illustrating the process of obtaining the training results of the optimized Masson pine disease model of this invention. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0050] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0051] Please see Figure 1 This invention provides a technical solution for training a disease model of Masson pine based on image analysis, comprising the following steps:

[0052] S1: Collect images of Masson pine trees at multiple time points and extract image grayscale. Input the Sobel edge operator to calculate the gradient and analyze the outer edge contour point set. Calculate the grayscale change and combine it with the outer edge contour point set to generate a temporal boundary sample set.

[0053] S2: Based on the temporal boundary sample set, calculate the gradient increment of the normal direction, input it into the convolutional neural network for backpropagation to calculate the gradient response sequence, and compare it with the outer edge contour point set to generate gradient deviation parameters.

[0054] S3: Based on the gradient response sequence, differential gradient increments are performed on adjacent gradients to identify gradient mutation points and perform cluster analysis on the mutation points to generate transition point clusters. Combined with gradient deviation parameters, the consistency of diseased areas is determined and marked to generate a training annotation set.

[0055] S4: Based on the training annotation set, extract the center of the transition point cluster and multiple annotation points and analyze the spatial distance, calculate the spatial distance distribution characteristics and adjust the convolution kernel weights to generate the training results of the Masson pine disease model;

[0056] S5: Based on the training results of the Masson pine disease model, calculate the disease boundary identification deviation and identify the unstable gradient region according to the deviation amount, update the convolution kernel weights and re-push the temporal boundary sample set to generate the optimized Masson pine disease model training results.

[0057] The temporal boundary sample set includes a grayscale change sequence, an outer contour point sequence, and a temporal boundary index sequence. The gradient bias parameters include gradient offset, error ratio, and response difference. The training annotation set includes a disease annotation point sequence, a transition point corresponding label sequence, and a region annotation index sequence. The training results of the Masson pine disease model include a convolution kernel weight sequence, a gradient propagation coefficient sequence, and a disease boundary output sequence. The optimized Masson pine disease model training results include an updated convolution kernel weight sequence, a re-inference boundary output sequence, and an inference bias correction sequence.

[0058] Please see Figure 2 The specific steps for obtaining the temporal boundary sample set are as follows:

[0059] S101: Collect image sequences of Masson pine trees at multiple time points and extract image grayscale. By comparing the grayscale of images at multiple time points with the grayscale of images at the initial time point, calculate the grayscale difference of multiple pixels and merge the grayscale difference with the corresponding coordinates to generate a grayscale difference set.

[0060] An adult Masson pine tree, numbered MP-402, was selected as the monitoring target within the Masson pine germplasm resource protection area. An industrial-grade visual acquisition device equipped with a Sony IMX250 sensor was deployed on an observation tower 30 meters horizontally from the canopy of the target tree. The image acquisition resolution was set to [missing information]. pixels, lens focal length configuration is And the aperture value is fixed at , the initial time point The monitoring time is set to 09:00:00 AM on the day of monitoring, and subsequent time points... Set to 09:15:00, the camera is started and takes a series of high-resolution images of the pine canopy at the set time points. The acquired raw image data is transmitted to the image processing workstation via a gigabit Ethernet interface. The image matrix is ​​read using the memory mapping mechanism of the image processing program. The coordinates in the time-matrix image are Extract the red channel values ​​of the pixels. Green channel values Blue channel values Call the preset grayscale weighted conversion parameters, i.e., the red weight. Green weight Blue weight Perform linear weighted operation The grayscale value of the pixel at the initial moment is calculated. Preserve pixel coordinates Unchanged, read The RGB values ​​of the image at this coordinate at time point are respectively , , Substitute the same weight parameters to perform the calculation. =140.96, therefore... grayscale value at time Then, a grayscale difference calculation is performed, and the difference is obtained by substituting the aforementioned calculation results into the result. The program iterates through the image across its full resolution range in row-major order. The extraction, weighting, and difference operations are performed on each pixel one by one. For each pixel, the calculated grayscale difference is compared with its corresponding planar coordinates. Bind the data and store all data units in a high-dimensional array to generate a grayscale difference set.

[0061] S102: Call the grayscale difference set, input the Sobel edge operator to perform gradient operation on images at multiple time points, compare the gradient magnitude with the pixel position based on the Sobel horizontal and vertical gradients, filter the pixel coordinates that exceed the gradient magnitude threshold as the outer edge contour point position quantity, and generate the outer edge contour point position quantity set.

[0062] The generated grayscale difference set is retrieved as the data base, and simultaneously loaded. Given the grayscale image matrix of the pine tree at time t, initialize the standard Sobel edge detection operator, and define the horizontal gradient convolution kernel as... matrix Define the vertical gradient convolution kernel as matrix Image coordinates Built around The convolution window is used to extract the grayscale values ​​of 9 pixels covered within it. These 9 grayscale values ​​are then multiplied by the coefficients at corresponding positions of the horizontal and vertical gradient convolution kernels and summed. The horizontal gradient component is then obtained after the convolution operation. and longitudinal gradient components Perform gradient magnitude calculation operation and substitute the numerical values ​​to obtain the gradient magnitude at that point. To determine reasonable screening criteria, the coordinate region of the upper left corner of the image was selected. to Using the non-tree sky background region as the reference region, calculate the arithmetic mean of the gradient magnitudes of all pixels within this region. Set the edge detection multiplier coefficient The gradient magnitude threshold is set by multiplication. , coordinate gradient magnitude at With threshold Perform numerical comparisons and determine Confirm that the pixel belongs to the outer edge of the pine canopy and record its coordinates. If for another coordinate The calculated gradient magnitude is ,determination If the coordinate is not found, the program will repeatedly perform the above convolution, amplitude calculation and threshold comparison operations on all pixels in the image to filter out all pixel coordinates that meet the conditions and generate the set of outer edge contour point positions.

[0063] S103: Based on the corresponding pixel coordinates of the outer contour point position set and the gray-level difference set, match the gray-level difference and merge the matched gray-level difference with the outer contour point coordinates. By integrating the combined data of all points in the set, generate a temporal boundary sample set.

[0064] Call the generated outer edge contour point position set to obtain the values ​​contained therein. Data from discrete coordinate points is used, and the grayscale difference set generated by segment S101 is retrieved simultaneously. A hash table structure is then established to store the final sample data, and an iteration pointer is set. Starting from 1, traverse the set of contour point locations and read the coordinate data of the first outer contour point. With this coordinate Using the key index, a binary search operation is performed on the set of grayscale difference values ​​to locate the corresponding grayscale difference value record and extract the grayscale difference value at that coordinate. coordinate data The amount of grayscale difference matched Merge to create a line containing The feature record is formatted to read the coordinates of the second outer edge contour point. The corresponding difference value was found in the grayscale difference value set. Construct feature records Read the coordinates of the third outer edge contour point. Retrieve the corresponding difference amount Construct feature records Following this logic, all outer contour points are processed sequentially, and each set of successfully matched data is written into the database table in sequence, as shown in Table 1. The table lists some temporal variation feature data of the edge pixels of the Pinus massoniana canopy after matching and integration, and finally summarizes them to generate a temporal boundary sample set.

[0065] Table 1. Sample data of temporal boundary at the edge of the Pinus massoniana canopy.

[0066] ;

[0067] See Table 1, which details the grayscale changes of four key pixels located at the edge of the Masson pine canopy during the monitoring period. This dataset integrates spatial location information and temporal grayscale difference information, providing basic data support for subsequent analysis of the micro-displacement characteristics of trees under wind load.

[0068] Please see Figure 3 The specific steps for obtaining the gradient bias parameter are as follows:

[0069] S201: Based on the temporal boundary sample set, obtain the gradient change of each boundary point in the outward normal direction and compare it with the set normal threshold. Calculate the gradient increment based on the comparison result to generate the gradient increment set in the outward normal direction.

[0070] Call the generated temporal boundary sample set, and select the one with the number . The pixel point at the boundary of the Masson pine canopy is taken as the current processing object, and the pixel coordinates of this point are: Use the formula to calculate the gradient increment , Representing the The gradient increment of the outward normal direction of each boundary point after multidimensional feature weighting is used to quantify the significance of the point in morphological change analysis; For the first The magnitude of the basic normal gradient at each boundary point reflects the edge strength of that point in the image grayscale. Representing the Normal angles of each boundary point This represents the set normal threshold (such as the prevailing wind direction or the main axis of tree growth). For smoothing coefficients, This step calculates the absolute value of the angle difference and smooths it, aiming to give higher weight to boundary points that deviate from the preset direction (such as the windward direction or abnormal growth direction). The division operation is used to normalize and adjust the magnitude of the angle's influence. Indicates the first All points within the neighborhood of each point neighboring points Accumulate. Representing the and the Euclidean distance between boundary points Representing the baseline length, the horizontal gradient component of that point in the image matrix is ​​first extracted. With longitudinal gradient components The normal gradient magnitude at this point is calculated using the Pythagorean theorem. And through inverse trigonometric functions Calculate its normal angle Set normal threshold The prevailing wind direction angle in the monitoring area Set the smoothing coefficient for Set the reference length for Pixel, with the radius set as the center of this boundary point. The search neighborhood of a pixel involves traversing the temporal boundary sample set to find the neighborhood containing... For each of the three adjacent boundary points, calculate the Euclidean distance between the current point and these three neighboring points. The measured distance data are as follows: Pixels Pixels pixels, substituting the above parameters into the gradient increment formula The calculation is performed step by step. First, the angle deviation weighting term is calculated, that is... Next, the neighborhood spatial density term is calculated by first obtaining the sum of squares of the distance ratios. Then, take the square root of the sum to obtain... Finally, the results of each part are multiplied together to calculate the gradient increment in the outward normal direction at that point. The results indicate that the boundary point exhibits a high gradient change weight when it deviates from the prevailing wind direction and its neighborhood points are sparsely distributed. This applies to all points in the sample set. Repeat the above parameter extraction, distance measurement, and formula calculation process for each boundary point, and then calculate all the results. The values ​​are merged according to the corresponding pixel coordinate indices to generate a set of gradient increments in the outward normal direction.

[0071] Table 2. Parameters for calculating gradient increment at boundary points

[0072] ;

[0073] S202: Call the gradient increment set in the outward normal direction, input it into the convolutional neural network for gradient propagation training, and the convolutional neural network performs backpropagation operation based on the increment set. Through multiple convolutional layers, the weight parameters are gradually adjusted to optimize the network learning and generate gradient response sequences.

[0074] Based on the generated set of gradient increments in the outward normal direction, the numerical sequence of gradient increments is extracted as input data. First, the data undergoes min-max normalization to map the values ​​to... We construct a three-layer convolutional neural network within the specified interval, with the input layer dimension set to [dimension value missing]. , The first convolutional layer is configured to represent the total number of elements in the gradient increment set representing the outward normal direction. Each size is Convolution kernel, setting learning rate parameter The weight decay coefficient is The normalized gradient increment sequence is input into the network for forward propagation. The convolutional kernel slides across the sequence to perform cross-correlation operations, for example, for a specific segment of the sequence. With weight kernel Sum the dot products and add the bias. The data is processed by the ReLU activation function to generate feature maps, then downsampled through a max pooling layer, and then fed into a fully connected layer to calculate the predicted output. The mean squared error loss between the output value and the preset stationary benchmark sequence is calculated. Backpropagation is performed based on the chain rule, calculating the partial derivative of the loss function with respect to each weight parameter. The Adam optimizer is then used to adjust the network weights based on the calculated gradients, for example, by adjusting the weights of a certain layer from... Adjusted to ,go through Iterative training in epochs until the loss value converges to Below a certain magnitude, training is stopped, and the original set of gradient increments in the outward normal direction is re-input into the trained and optimized network. The network output layer generates a numerical sequence after feature enhancement and noise suppression, i.e., the gradient response sequence.

[0075] S203: Based on the gradient response sequence, compare the error with the outer edge contour point set, calculate the difference between the response sequence and the outer edge contour points point by point, and generate the gradient deviation parameter.

[0076] Retrieve the output gradient response sequence and simultaneously read the original gradient magnitude data corresponding to the generated outer edge contour point position set. Establish an error comparison loop and set the loop variable. Iterate through each point in the sequence, for the first... For each sample point, its response value in the gradient response sequence is read. (This value has been denormalized and restored), read the initial gradient increment value or reference value calculated from the corresponding original outer edge contour points. Perform absolute error calculation operation Regarding the first For each sample point (refer to the high-increment points in Table 2), read its response value. Read the original value Calculate the difference Regarding the first For each sample point (refer to the low increment points in Table 2), read its response value. Read the original value Calculate the difference The program performs the above subtraction and absolute value operations point by point, and calculates all the differences. Bind to the corresponding pixel coordinates, if the difference at a certain point Exceeding the preset deviation warning threshold (e.g.) If the calculated difference data of all points is integrated, then the point is marked as a potential morphological mutation point. Finally, the gradient deviation parameter is generated by integrating the calculated difference data of all points.

[0077] Please see Figure 4 The specific steps for obtaining the training annotation set are as follows:

[0078] S301: Based on the gradient response sequence, the adjacent gradient increments are differentially analyzed, the difference in gradient change is calculated point by point, and the location information of gradient abrupt change points is identified. The gradient difference value is compared with the set gradient abrupt change point detection threshold to mark the location of the abrupt change point and generate a gradient abrupt change point location set.

[0079] The generated gradient response sequence is used as the base data source, and this sequence is set to contain... Given gradient feature values ​​arranged in temporal or spatial order, initialize a dynamic array to store the difference results, and set a traversal pointer. From the start position of the sequence Start to End, read the first [number]th [item] in the sequence. Gradient response values ​​at each location Read the first Gradient response values ​​at each location Perform the difference operation on adjacent gradient increments, that is, calculate the absolute value of the next value minus the previous value to obtain the difference result. Then read the first Numerical gradient response value at each location With the Numerical gradient response value at each location Calculate the difference results The calculation is performed point by point in this manner until the entire sequence has been traversed, obtaining the sequence containing... To construct a reasonable mutation determination criterion, the gradient difference value sequence is sorted in ascending order, and the sequence with the largest value is removed. The data was filtered to exclude extreme outliers, and the remaining data were selected. The data is used as a background noise reference sample, and the arithmetic mean of this sample set is calculated statistically. and standard deviation Set the statistical significance factor for mutation point detection. Perform linear weighted calculations to set the gradient mutation point detection threshold. The first difference value calculated earlier With threshold Perform numerical comparison and determine Greater than Confirm the pixel coordinates corresponding to this position. This is the gradient mutation point, targeting the second difference value. ,determination Less than If a value is found to be a non-mutation point, it is marked as a non-mutation point and ignored. The program continues to perform the above threshold comparison and filtering operations on all differential values ​​in the sequence, extracts all coordinate data that meet the judgment conditions, and stores these coordinates in a list structure in sequence to generate a gradient mutation point location set.

[0080] S302: Call the gradient mutation point location set, perform cluster analysis on the mutation point locations, and use the K-means clustering algorithm to classify the mutation points into multiple transition point clusters based on the relative position and gradient change of the mutation points. Analyze the coordinates and association information of each transition point cluster to generate a transition point cluster information set.

[0081] From the generated set of gradient mutation point locations, this set contains To extract the spatial clustering characteristics of discrete pixel coordinates from the monitored images, the K-means clustering algorithm module was invoked. The cluster number parameter was set based on the average texture scale and resolution of the pine canopy in the monitored images. Randomly sampled from the mutation point locations Use a coordinate point as the initial centroid, for example, select , Using these as the starting center, the iterative classification process begins, targeting any mutation point in the set. Its coordinates are Calculate the points and respectively The Euclidean distance between the initial centroids, for the centroid Calculate the sum of the squares of the differences in the x-coordinates and the squares of the differences in the y-coordinates, i.e. Then, take the square root of the sum to obtain the distance. Similarly, the distance between this point and the centroid is measured. distance Determined by numerical comparison To find the minimum value, the point was... To be included Cluster 1, with the core as the first cluster, traverse all clusters in the set. After the first round of classification is completed, a centroid update operation is performed. The arithmetic mean of the x-coordinates and y-coordinates of all points in cluster 1 are calculated, and cluster 1 is set to contain... From these points, the new center coordinates are calculated to be... Replace the old centroid with this new coordinate system. Repeat the above steps of distance calculation, classification, and centroid update until the position changes of all centroids are less than the preset convergence threshold. Pixels, algorithm terminates, output For each stable cluster of transition points, extract the geometric center coordinates, the number of mutation points within the cluster, and the average gradient change of all points within the cluster. For example, record the center of cluster 1 as... ,Include The average gradient change is at points . These statistical features are stored in a structured manner to generate a cluster of transition points.

[0082] S303: Based on the information set of transition point clusters and combined with the gradient deviation parameter, determine whether the disease areas corresponding to each transition point cluster are consistent. Based on the judgment results, mark the consistent disease areas and generate a training annotation set.

[0083] The generated transition point cluster information set is read, and the calculated gradient deviation parameters are retrieved as verification criteria. A consistency analysis loop for the diseased area is established. Taking the first transition point cluster as an example, the rectangular area covered by this cluster in the image is obtained. The deviation values ​​of all pixels falling within this area are extracted from the gradient deviation parameters. A total of [number missing] deviation values ​​are extracted. Calculate these values. arithmetic mean of the deviation values Set threshold for disease area identification This threshold is statistically derived based on the maximum elastic deformation deviation of healthy pine trees under wind load. The calculation results will be used to calculate the threshold. With threshold Compare and determine Greater than This indicates that there is significant abnormal deformation in the region. Further calculation of the standard deviation of the deviation values ​​within this region is needed. Set a consistency dispersion threshold Comparison and judgment Less than This indicates that the abnormal deformation within the region exhibits a high degree of spatial consistency and is not caused by random noise. Based on this, the region corresponding to cluster 1 is confirmed as the definite diseased area, and its bounding box coordinates are recorded. The cluster was labeled "suspected pine wilt disease infection," and the deviation values ​​within its region were extracted and averaged for the second transition point cluster. ,determination Less than If the change is not identified as a normal physiological fluctuation or a temporary morphological change caused by wind, it will be left unmarked. The program will then perform the above statistical analysis and judgment logic on all transition point clusters in sequence, summarize the information of all areas identified as diseases, and finally store the selected area coordinates and corresponding labels into the training database to generate a training annotation set.

[0084] Please see Figure 5 The specific steps for obtaining the training results of the Masson pine disease model are as follows:

[0085] S401: Based on the training annotation set and transition point clusters, extract the center point of the transition point clusters and obtain multiple annotation points in the training annotation set. Calculate the spatial distance between the center point and the annotation points respectively. Arrange the distance values ​​in the order of the annotation points and analyze the spatial training values ​​according to the distance change trend to generate a spatial distance sequence.

[0086] The generated transition point cluster information set and the generated training annotation set are used, and the number is selected as... The transition point cluster is taken as the current analysis object, and the coordinates of the geometric center point of the cluster are extracted. And retrieve from the training annotation set those falling within the range of this cluster. The coordinates of the key markers are as follows: , , Calculate the training values ​​in the space using the formula. : This represents the comprehensive spatial training value, used to quantify the anomaly and training value of disease feature points in spatial distribution; This represents the total number of labeled points within the current analysis area. The index number of the marked point; Representing the The Euclidean distance from each labeled point to the geometric center of the region. The average distance of all marked points. This term calculates the normalized deviation of a single point from the overall distribution, reflecting the discreteness of spatial location; This is a weighted exponent, with values ​​of squared or higher, designed to assign non-linear, high weights to points that deviate significantly from the mean (outliers), thereby enhancing the model's sensitivity to marginal samples. Local density of representative points Represents the rate of change over time. As a denominator, a "high-frequency, high-density suppression factor" was constructed. The logic behind this is that if a point is surrounded by a large number of points (high density) and these points change rapidly over time (high-frequency flicker), it often corresponds to environmental noise or the high-frequency shaking of leaves. The formula reduces this effect through division. The contribution of the value is proportional; conversely, low-density and time-stable points are considered structurally significant disease features, and their weights are correspondingly amplified. The advantage of the formula lies in its ability to... Introduce spatial deviation weighting, and combine Introducing spatiotemporal stability constraints allows the calculated spatial training values ​​to automatically filter out high-density wind noise, focusing on early-stage disease feature points that are sparsely distributed but morphologically stable, thereby effectively improving the purity and directionality of the model training data. First, spatial distance measurement calculations are performed using the Euclidean distance formula. Calculate the distance from each marked point to the center point, and obtain the result. Pixels Pixels Pixel, calculate the arithmetic mean of these three distance values. Pixels, a weighted index for setting the distance change trend This index is set based on the nonlinear decay characteristics of disease spread and is used to amplify the weight of outliers. The density value at each marked point is obtained through an image local feature extraction algorithm. (i.e., radius) The number of feature points in the pixel neighborhood and the rate of change over time (That is, the normalized rate of change of the mean gray level of three consecutive frames), which is calculated from the specific image data. , , , , , Substitute the above specific values ​​into the formula The calculation is performed step by step. For the first marked point, the square of the relative deviation term is calculated. Calculate the weighted terms in the denominator The result is For the second marked point, calculate the square of the deviation term. Calculate the denominator term The result is For the third marked point, calculate the square of the deviation term. Calculate the denominator term The result is Finally, the spatial training value for the region is obtained by summing the three results. The results show that the distribution of feature points within the diseased area is relatively uniform and stable. This calculation process was applied to all diseased labeled areas to generate a spatial distance sequence.

[0087] S402: Call the spatial distance sequence, use difference operation to analyze the change in spatial training values ​​for adjacent distances in the sequence, adjust the weights of the convolution kernel according to the position of the change in the sequence, and use a weighted shift method to add the change to the corresponding weight position in the convolution kernel to generate the weight adjustment amount;

[0088] The generated spatial distance sequence is invoked, which contains a set of spatial training values ​​arranged in the order of region scanning. For example, the sequence segment is... Initialize a weight adjustment matrix that matches the size of the convolutional neural network kernel. Perform difference operations on adjacent spatial training values ​​in the sequence to capture the gradient of feature changes, and calculate the first change. Calculate the second change. Set a size as The weighted moving window, whose internal weight vector is set to Slide the window across the sequence of changes. When the center of the window is aligned with the first change, set the changes to its left and right adjacent values ​​as follows: and Perform weighted summation to calculate the adjustment amplitude. This value This refers to the weight adjustment amount corresponding to the convolution kernel position. This process smooths out the fluctuation of a single value by combining the spatial training value changes in the context, ensuring the continuity and robustness of the weight adjustment. The program traverses the entire sequence and the corresponding convolution kernel parameter positions, calculates the specific adjustment value required for each weight parameter, and encapsulates all adjustment values ​​according to the network hierarchy to generate the weight adjustment amount.

[0089] S403: Based on the weight adjustment amount, update the weight values ​​of the convolution kernel weights according to the weight adjustment amount, arrange and integrate all the updated weights according to the convolution kernel structure, and generate the training results of the Masson pine disease model.

[0090] Read the generated weight adjustment values ​​and load the convolutional layer weight parameters of the current Masson pine disease identification model to be optimized, targeting a certain layer. The center weights of each convolution kernel Read the corresponding weight adjustment amount Perform an addition update operation Weight for another position Its adjustment amount is Update calculation as During the update process, a numerical boundary check is performed. If the absolute value of the updated weights exceeds the preset gradient clipping threshold... Then it will be forcibly truncated to or To prevent model divergence caused by gradient explosion, this step is repeated to iterate through the weight parameters of all convolutional and fully connected layers in the model, and all parameter values ​​are refreshed. Then, the updated weight matrix is ​​reorganized and serialized according to the original tensor dimensions and stored. Finally, the training results of the Masson pine disease model containing the latest feature extraction parameters are output.

[0091] Please see Figure 6 The specific steps for obtaining the training results of the optimized Masson pine disease model are as follows:

[0092] S501: Based on the training results of the Masson pine disease model, the boundary coordinate values ​​in the training results are called and the corresponding coordinate values ​​in the temporal boundary sample set are used to calculate the disease boundary identification deviation. The unstable gradient region is identified according to the change of deviation, the deviation is sorted out, and a deviation interval sequence is generated.

[0093] The generated training results of the Masson pine disease model are used as the initial baseline, and a time-series boundary sample set is loaded from the database. This sample set contains... High-precision labeled data of the canopy edge of Masson pine collected in chronological order, with a traversal pointer set. from to Select the first For each time point sample, its true boundary coordinates in the annotation set are read. The corresponding image data is input into the model for forward computation to obtain the boundary coordinates predicted by the model. Perform the deviation calculation operation to calculate the deviation of the horizontal axis respectively. Pixel deviation from ordinate Pixels, calculated using the Pythagorean theorem to determine the overall Euclidean distance deviation. Pixel, then process the first Read the labeled coordinates from samples at various time points. Obtain predicted coordinates Calculate the overall deviation To identify regions with unstable gradients, pixels are differentially analyzed based on the deviations between adjacent time points to calculate the gradient change. Set a threshold for determining gradient instability. This threshold is set based on the maximum amplitude of edge jitter caused by normal wind in historical data, and the calculated gradient change amount is used to determine the threshold. With threshold Perform numerical comparisons and determine Greater than Confirm the first To the The region between frames is an unstable gradient region, meaning that the model's prediction performance fluctuates drastically during this period and requires significant adjustment. Continue iterating through subsequent samples; if the... Frame-based Euclidean distance deviation The gradient change is Once a region is identified as stable, all calculated deviation values, gradient changes, and corresponding stability determination results are compiled into structured data, as shown in Table 3. The table details the deviation analysis of some key samples. Finally, these data are packaged in time series order to generate a deviation interval sequence.

[0094] Table 3 Boundary Recognition Deviation and Gradient Stability Analysis

[0095] ;

[0096] See Table 3. The data in the table shows that the deviation between sample 2 and sample 3 fluctuates dramatically and is identified as a key unstable gradient region, which will serve as the basis for subsequent weight adjustments.

[0097] S502: Based on the deviation interval sequence, perform iterative updates for the convolution kernel weights by calculating the ratio of the deviation amount within the interval to the corresponding weight position, add the ratio to the original weights item by item, and concatenate the updated weight value sequence according to the order of the convolution kernel weights to obtain the weight update sequence.

[0098] Read the generated deviation interval sequence, locate the sequence segment marked as "unstable," pinpoint the convolutional neural network layer that caused the deviation, and set the current processing layer to the [number]th [layer]. A convolutional layer, which contains There are n convolutional kernels, each with a size of [size missing]. ,total For each weight parameter position, extract the normalized bias corresponding to the unstable region. The deviation of sample 2 in Table 3 Pixel normalization is a ratio of the image width, i.e. Set weighted position index from to (corresponding to respectively) (positions from top left to bottom right in the matrix), perform iterative update calculations, targeting the position indices in the convolution kernel. (Top left corner) weight Calculate the ratio of the deviation within the interval to the index of the weighted position, i.e. Perform addition update For location index Weight of (center point) Calculate the ratio Perform update For location index (Bottom right corner) Weight Calculate the ratio Perform update This update strategy allows the weights at edge positions (with smaller indices) to be adjusted more significantly, thereby enhancing the model's ability to capture local small edge features. At the same time, it maintains the relative stability of the center weights (with larger indices). It traverses all convolutional kernels in this layer and all related layers in the model, performing item-by-item calculation and value refresh on tens of thousands of weight parameters. Finally, all updated weight values ​​are concatenated and spliced ​​according to the original arrangement order of the convolutional kernels to form a long one-dimensional array or tensor stream, generating a weight update sequence.

[0099] S503: Call the weight update sequence, perform inference processing on the temporal boundary sample set, use the updated weights to perform convolution operation on the temporal boundary sample set to analyze the current boundary, and integrate the output sequence according to the sample order to generate the optimized Masson pine disease model training results.

[0100] The generated weight update sequence is called, deserialized, and loaded back into the network structure of the Masson pine disease identification model to replace the original parameter matrix. The temporal boundary sample set is then called again for confirmatory inference processing, selecting the [number]th [item] from the sample set. Sample number (original deviation is) The image data is then input into the updated model (pixel-level), and the updated weight parameters participate in the convolution operation. After layers of feature extraction and boundary regression, the new predicted coordinates are output. Calculate the current overall deviation and compare it with the deviation before the update. Pixels, deviation compared to before the update The pixel error has significantly decreased, indicating that the model's adaptability to unstable regions has been repaired. Inference is then performed on subsequent samples in the sample set to obtain the complete current boundary output sequence. Smoothness analysis is performed on the output sequence, and the mean Euclidean distance between the predicted coordinates of adjacent frames is calculated. If the mean is less than a preset stability threshold... If the pixel count is reached, the model is considered converged. The model parameter file containing all updated weights, the error statistics report from the validation phase, and the final boundary prediction results are then integrated and packaged to generate the optimized training results of the Masson pine disease model.

[0101] This model integrates grayscale variations from multiple time-series images with Sobel edge features to keenly capture subtle disease signals such as needle yellowing and abrupt texture changes (e.g., edge blurring caused by needle shrinkage). It utilizes convolutional neural networks to calculate gradient responses and combines this with clustering analysis to accurately locate disease boundaries, effectively solving the edge blurring problem caused by complex needle backgrounds. Simultaneously, by adaptively adjusting convolutional kernel weights based on spatial features and employing an iterative correction mechanism for recognition bias, the model can automatically eliminate environmental interference, thereby achieving early detection, high-precision contour segmentation, and dynamic spread trend monitoring of Masson pine diseases. This represents a leap from static identification to dynamic, high-precision, and automated monitoring of Masson pine diseases, significantly improving the accuracy and efficiency of Masson pine disease monitoring.

[0102] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for training a disease model of Masson pine based on image analysis, characterized in that, Includes the following steps: S1: Collect images of Masson pine trees at multiple time points and extract image grayscale. Input the Sobel edge operator to calculate the gradient and analyze the outer edge contour point set. Calculate the grayscale change and combine it with the outer edge contour point set to generate a temporal boundary sample set. S2: Based on the temporal boundary sample set, calculate the gradient increment in the normal direction, input it into the convolutional neural network for backpropagation to calculate the gradient response sequence, and compare it with the outer edge contour point set to generate gradient deviation parameters. The specific steps for obtaining the gradient deviation parameter are as follows: S201: Based on the time-series boundary sample set, obtain the gradient change of each boundary point in the normal direction and compare it with the set normal threshold. Calculate the gradient increment based on the comparison result to generate a normal direction gradient increment set. S202: Call the gradient increment set in the normal direction and input it into the convolutional neural network for gradient propagation training. The convolutional neural network performs backpropagation operation based on the increment set, and gradually adjusts the weight parameters through multiple convolutional layers to optimize network learning and generate gradient response sequences. S203: Based on the gradient response sequence, and combined with the outer edge contour point set, perform error comparison, calculate the difference between the response sequence and the outer edge contour points point by point, and generate gradient deviation parameters; The normal threshold is determined by calculating the gradient increments of multiple boundary points in the normal direction and based on the median of the gradient increments. The gradient increment is calculated using the following formula: ; in, Representing the Gradient increment in the outward normal direction at each boundary point Representing the Normal gradient at each boundary point Representing the Normal angles of each boundary point This represents the set normal threshold. Represents the smoothing coefficient. Representing the and the The distance between the boundary points Represents the number of neighboring points. Represents the reference length; S3: Based on the gradient response sequence, differentially analyze the incremental gradients of adjacent gradients, identify gradient mutation points, perform cluster analysis on the mutation points to generate transition point clusters, and combine the gradient deviation parameters to determine whether the diseased areas are consistent and mark them to generate a training annotation set. S4: Based on the training annotation set, extract the center of the transition point cluster and multiple annotation points and analyze the spatial distance, calculate the spatial distance distribution characteristics and adjust the convolution kernel weights to generate the training results of the Masson pine disease model; S5: Based on the training results of the Masson pine disease model, calculate the disease boundary identification deviation and identify the unstable gradient region according to the deviation amount, update the convolution kernel weights and re-push the temporal boundary sample set to generate the optimized Masson pine disease model training results.

2. The method for training a disease model of Masson pine based on image analysis according to claim 1, characterized in that, The temporal boundary sample set includes a grayscale change sequence, an outer contour point sequence, and a temporal boundary index sequence. The gradient deviation parameters include gradient offset, error ratio, and response difference. The training annotation set includes a disease annotation point sequence, a transition point corresponding identifier sequence, and a region annotation index sequence. The training results of the Masson pine disease model include a convolution kernel weight sequence, a gradient propagation coefficient sequence, and a disease boundary output sequence. The optimized Masson pine disease model training results include an updated convolution kernel weight sequence, a re-inference boundary output sequence, and an inference bias correction sequence.

3. The method for training a disease model of Masson pine based on image analysis according to claim 1, characterized in that, The specific steps for obtaining the temporal boundary sample set are as follows: S101: Collect image sequences of Masson pine trees at multiple time points and extract image grayscale. By comparing the grayscale of images at multiple time points with the grayscale of images at the initial time point, calculate the grayscale difference of multiple pixels and merge the grayscale difference with the corresponding coordinates to generate a grayscale difference set. S102: Call the grayscale difference set, input the Sobel edge operator to perform gradient operation on multiple time point images, compare the gradient magnitude with the pixel position based on the Sobel horizontal and vertical gradients, filter the pixel coordinates that exceed the gradient magnitude threshold as the outer edge contour point position quantity, and generate the outer edge contour point position quantity set. S103: Based on the corresponding pixel coordinates of the outer contour point position set and the gray-level difference set, match the gray-level difference and merge the matched gray-level difference with the outer contour point coordinates. By integrating the combined data of all points in the set, generate a temporal boundary sample set. The gradient magnitude threshold is determined by analyzing the range of edge gradient changes in the image, obtaining the magnitude distribution of multiple pixels in the horizontal and vertical gradients, and then determining it based on the median of the magnitude distribution.

4. The method for training a disease model of Masson pine based on image analysis according to claim 1, characterized in that, The specific steps for obtaining the training annotation set are as follows: S301: Based on the gradient response sequence, differentially analyze adjacent gradient increments, calculate the difference in gradient change point by point, identify the location information of gradient abrupt change points, compare the gradient difference value with the set gradient abrupt change point detection threshold, mark the location of the abrupt change point, and generate a gradient abrupt change point location set. S302: Call the gradient mutation point location set, perform cluster analysis on the mutation point locations, and use the K-means clustering algorithm to classify the mutation points into multiple transition point clusters based on the relative position and gradient change of the mutation points. Analyze the coordinates and association information of each transition point cluster to generate a transition point cluster information set. S303: Based on the information set of the transition point clusters and the gradient deviation parameter, determine whether the disease areas corresponding to each transition point cluster are consistent, mark the consistent disease areas based on the judgment results, and generate a training annotation set. The gradient mutation point detection threshold is determined by first calculating the difference between adjacent gradient increments, and then based on the median of the difference values.

5. The method for training a disease model of Masson pine based on image analysis according to claim 1, characterized in that, The specific steps for obtaining the training results of the Masson pine disease model are as follows: S401: Based on the training annotation set and the transition point cluster, extract the center point of the transition point cluster and obtain multiple annotation points in the training annotation set. Calculate the spatial distance between the center point and the annotation points respectively. Arrange the distance values ​​in the order of the annotation points and analyze the spatial training values ​​according to the distance change trend to generate a spatial distance sequence. S402: Call the spatial distance sequence, use difference operation to analyze the change in spatial training values ​​for adjacent distances in the sequence, adjust the weights of the convolution kernel according to the position of the change in the sequence, and use a weighted shift method to add the change to the corresponding weight position in the convolution kernel to generate the weight adjustment amount; S403: Based on the weight adjustment amount, update the weight values ​​of the convolution kernel weights according to the weight adjustment amount, arrange and integrate all the updated weights according to the convolution kernel structure, and generate the training results of the Masson pine disease model.

6. The method for training a disease model of Masson pine based on image analysis according to claim 5, characterized in that, The spatial distance sequence generation process is as follows: based on the spatial distance between the center point of the transition point cluster and each labeled point, a preliminary distance sequence is obtained by arranging the labeled points in order; each distance value in the preliminary distance sequence is corrected using a weighted method, and the correction coefficient is dynamically adjusted according to the distribution density of points within the transition point cluster to generate a corrected spatial distance sequence.

7. The method for training a disease model of Masson pine based on image analysis according to claim 1, characterized in that, The specific steps for obtaining the training results of the optimized Masson pine disease model are as follows: S501: Based on the training results of the Masson pine disease model, the boundary coordinate values ​​in the training results and the corresponding coordinate values ​​in the time-series boundary sample set are called to calculate the disease boundary identification deviation, and unstable gradient regions are identified according to the changes in the deviation amount. The deviation amount is sorted out to generate a deviation interval sequence. S502: Based on the deviation interval sequence, perform iterative updates for the convolution kernel weights by calculating the ratio of the deviation amount within the interval to the corresponding weight position, add the ratio to the original weights item by item, and concatenate the updated weight value sequence according to the order of the convolution kernel weights to obtain the weight update sequence. S503: Call the weight update sequence, perform inference processing on the temporal boundary sample set, use the updated weights to perform convolution operation on the temporal boundary sample set to analyze the current boundary, and integrate the output sequence according to the sample order to generate the optimized Masson pine disease model training result.

8. The method for training a disease model of Masson pine based on image analysis according to claim 7, characterized in that, The generation method of the weight update sequence is limited to: sequentially splicing adjacent weights in the convolution kernel according to their original order, and maintaining the sequence position correspondence of multiple weight update values ​​at fixed intervals.

Citation Information

Patent Citations

  • Plant leaf lesion identification method based on neural network

    CN115346202A

  • Resistor disc defect online detection system and grading method based on machine vision

    CN120765532A