Forestry dead wood identification method and system based on image identification
By dynamically setting the frame splitting frequency, integrating the marking of dead tree body and tree roots, and using multi-directional clustering analysis, the problems of poor accuracy in dead tree identification and resource utilization efficiency in existing technologies have been solved, achieving efficient and accurate dead tree identification and improving the level of intelligence and refinement in forestry management.
Patent Information
- Application Number
- CN202511386281.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-12-23
AI Technical Summary
In the processing of large-scale forest remote sensing images, the existing technology with a fixed frame splitting frequency cannot balance the accuracy of dead tree identification with the efficiency of computing power utilization, resulting in low dead tree identification accuracy and waste of resources, especially in areas with dense and sparse dead trees.
By dynamically setting the frame splitting frequency, integrating the marking of dead tree body and tree roots, and performing multi-directional clustering analysis, combined with the sequential input of geographic coordinates into the pre-trained model, the morphology of individual trees is optimized, achieving efficient and accurate dead tree identification.
It significantly improves the accuracy and efficiency of dead tree identification, reduces the rate of missed detection and false detection, and enhances the level of intelligence and precision in forestry management.
Smart Images

Figure CN121190983A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for identifying dead trees in forestry based on image recognition. Background Technology
[0002] In forestry resource management and ecological security monitoring, image recognition-based dead tree identification technology has gradually replaced traditional manual inspections, becoming a key means to improve the efficiency of dead tree identification. However, existing technologies have a core technical pain point when processing remote sensing images of large-scale forest areas: they generally use a fixed frame splitting frequency for processing forest remote sensing images, and the construction of individual tree morphology lacks integrated labeling optimization of the main body and tree roots, making it difficult to balance the accuracy of dead tree identification with the efficiency of computing power utilization.
[0003] Specifically, existing technologies, in the frame segmentation stage, do not consider the distribution density of dead trees and the complexity of regional edges in different sub-regions of the forest area. For sub-regions with dense dead trees and tortuous edges, a fixed low frame segmentation frequency cannot fully capture the outline details of the dead tree body and the weak features of the roots, easily leading to missed detections in the root area and distortion of the individual tree morphology. Conversely, for sub-regions with sparse dead trees and flat edges, a fixed high frame segmentation frequency will generate a large number of redundant segmentation frames, resulting in unnecessary waste of computing resources. At the same time, in the individual tree morphology construction stage, existing technologies mostly only label and fit the outline of the dead tree body, ignoring the correlation between the roots and the body. Furthermore, subsequent clustering analysis is mostly limited to a single horizontal or vertical direction, which cannot accurately match the actual growth morphology of the dead tree, further leading to a high missed detection rate for dead tree identification and failing to meet the needs of rapid and accurate identification of dead trees in large-scale forestry management.
[0004] Therefore, this invention proposes a method and system for identifying dead trees in forestry based on image recognition. Summary of the Invention
[0005] This invention provides a method and system for identifying dead trees in forestry based on image recognition, in order to solve the aforementioned technical problems.
[0006] This invention provides a method for identifying dead trees in forestry based on image recognition, comprising:
[0007] Step 1: Obtain a remote sensing map of the forestry area, and perform coarse analysis and regional division on the remote sensing map to obtain several sub-regions, the regional boundary line of each sub-region, and the coarse deadwood coefficient;
[0008] Step 2: Set the frame splitting frequency for each sub-region according to the region edge line and the coarse deadwood coefficient, and split the region image of the corresponding sub-region according to the frame splitting frequency to obtain several split frames;
[0009] Step 3: Mark the first point of the dead tree body in each split frame and mark the second point of the dead tree roots in each split frame. Based on the distribution of the outer edges of the first and second point marks, construct the initial shape of a single tree.
[0010] Step 4: Perform cluster analysis on the initial shape of the single tree according to the first threshold in the horizontal direction, the second threshold in the vertical direction, and the direction of the centerline of the outer edge marked by the second point, respectively, lock the cluster points based on different directions, and construct the length sequence of the same cluster point in each direction and each cluster point in the other two directions.
[0011] Step 5: Optimize the initial morphology of the single tree based on the length sequence of the same cluster point and the corresponding cluster analysis results to obtain the current morphology of the single tree;
[0012] Step 6: Input all the current single tree forms of the corresponding sub-region into the pre-trained image recognition model in the order of their positions to obtain the dead tree recognition results of the corresponding sub-region. The order of their positions is from left to right and from top to bottom according to the geographical coordinates of the sub-region.
[0013] Preferably, the remote sensing area map is subjected to coarse analysis and area division, including:
[0014] The vegetation spectral features, dead tree texture features, and spatial neighborhood features of each pixel in the remote sensing area map are extracted to obtain the comprehensive feature value of each pixel;
[0015] Based on the fact that the similarity of the comprehensive feature values is greater than or equal to the clustering threshold, the standard remote sensing image is divided into several initial sub-regions. The difference rate of the comprehensive feature values of adjacent initial sub-regions is calculated, and the pixel line connecting the points where the comprehensive feature values change abruptly is used as the region edge line to obtain several sub-regions and corresponding region edge lines.
[0016] The percentage of pixels in each sub-region whose deadwood texture features meet the preset conditions is counted, and the coarse deadwood coefficient X is obtained by combining the comprehensive feature value of the corresponding sub-region.
[0017] and
[0018] Among them, K min K is the minimum value among all subregions corresponding to K; max The maximum value among all sub-regions corresponding to K; K is the initial deadwood coefficient of the corresponding sub-region; (K min_out ,K max_out ) represents the target interval for the output coefficients; eR represents the normalized interval. Information entropy; eW is the normalized value. The information entropy; R is the pixel percentage of the corresponding sub-region; Rmin is the minimum value of R among all sub-regions; Rmax is the maximum value of R among all sub-regions; Wi is the comprehensive feature value of the i-th pixel in the corresponding sub-region; N represents the number of pixels in the corresponding sub-region, which is a variable; Wmin is the minimum value among the average feature values of all sub-regions; Wmax is the maximum value among the average feature values of all sub-regions.
[0019] Preferably, the frame splitting frequency is set for each sub-region according to the region edge line and the coarse deadwood coefficient, including:
[0020] The edge curvature of each sub-region's edge line is quantified as C = L / L0, where L is the actual pixel length of the corresponding region's edge line, and L0 is the perimeter of the minimum bounding rectangle of the corresponding sub-region.
[0021] Based on the area S of the corresponding sub-region and the resolution Rs of the remote sensing area map, the fundamental frequency is set. Where ∝ represents the initial frequency;
[0022] Based on the coarse wood coefficient X and the edge tortuosity C, the base frequency of the corresponding sub-region is corrected to obtain the frame splitting frequency f = fb × (1 + β × X + γ × (C - 1)), and fmin ≤ f ≤ fmax, where β is the coarse wood coefficient weight factor; γ is the edge complexity weight factor; and (fmin, fmax) is the upper and lower limits of the frequency.
[0023] Preferably, based on the distribution of the outer edges of the first and second point markers, the initial shape of a single tree is constructed, including:
[0024] The first point is marked by collecting several edge points P along the outer edge of the dead tree body at a preset sampling interval. 1o Let o = 1, 2, 3, ..., n, where n is the number of the first point markers, and record the edge points P of each main body. 1o coordinates (x) 1o ,y 1o and pixel grayscale value G 1o ;
[0025] The second point is marked as several root edge points P collected along the outer edge of the tree root at the same sampling interval. 2u u = 1, 2, 3, ..., m, where m is the number of second point markers, and the root edge points P of each tree are recorded. 2u coordinates (x) 2u ,y 2u and pixel grayscale value G 2u ;
[0026] Calculate the point density D1 = n / S1 at the outer edge of the first mark and the point density D2 = m / S2 at the outer edge of the second mark, where S1 is the minimum circumscribed circle area of the dead tree body and S2 is the minimum circumscribed circle area of the tree root.
[0027] Calculate the first curvature of adjacent body edge points At this point, o = 2, 3, ..., n-1. Simultaneously, the second curvature of the adjacent root edge points is calculated. At this point, u = 2, 3, ..., m-1;
[0028] Calculate each body edge point P 1o With all tree root edge points P 2u The Euclidean distance dou is used to filter point pairs that are less than or equal to a preset distance threshold, which are then considered as associated point pairs;
[0029] Connect the first curvature K using a cubic Bézier curve 1o Continuous points less than or equal to the curvature threshold, and with respect to the first curvature K. 1o Outliers exceeding the curvature threshold are subjected to mean filtering and fitting to form the initial outline of the dead tree.
[0030] Using the associated point pairs as the connection benchmark, the transition edge points between the associated point pairs are supplemented based on the point density and using linear difference, and the transition edge points are fitted with the tree root edge points by a quadratic Bézier curve to form the tree root outline.
[0031] The initial outline of the dead tree body is aligned with the outline of the tree root by coordinates, and overlapping edge points are removed to obtain the complete initial shape of a single tree. The preset sampling interval and preset distance threshold vary with the resolution.
[0032] Preferably, the transition edge points between associated point pairs are supplemented based on point density and using linear interpolation, including:
[0033] Based on point density D1 and point density D2, determine the number of insertion points between corresponding associated point pairs. Where r is half of the straight-line distance d1 between the corresponding associated point pairs, and r = d1 / 2, and d0 is a preset distance threshold; It is a rounding function;
[0034] Based on the number of insertion points Nc, the coordinates of the two edge points involved in the corresponding associated point pair, the pixel grayscale values of the two edge points, and the pixel information of the eight neighbors of each edge point in the corresponding associated point pair, the coordinates and grayscale values of each insertion point are obtained. The insertion point is the transition edge point.
[0035] Preferably, the initial morphology of the single tree is optimized based on the length sequence of the same cluster points and the corresponding cluster analysis results, including:
[0036] Extract the same cluster points from the length sequence based on a first subsequence in one of the remaining directions and a second subsequence in another of the remaining directions;
[0037] Simultaneously, the number of intra-cluster points Mh of the cluster analysis results for the same cluster point is obtained;
[0038] Sort the first subsequence and the second subsequence by size respectively to obtain the third subsequence and the fourth subsequence;
[0039] Calculate the first volatility coefficient and first trend slope of the third subsequence, and the second volatility coefficient and second trend slope of the fourth subsequence, respectively;
[0040] If Mh is less than the quantity threshold N0, then N0-Mh points are inserted within the edge range of the clustering analysis result of the same cluster point; otherwise, the corresponding clustering analysis result remains unchanged.
[0041] If there is a case where the volatility coefficient is greater than the volatility threshold V0, the corresponding subsequence is smoothed; otherwise, the corresponding subsequence remains unchanged.
[0042] If the absolute value of the difference between the trend slope and the base slope is greater than the slope threshold, determine the corresponding deviation direction, and perform elastic deformation processing on the points in the inserted cluster analysis results according to the single tree growth law along the deviation direction; otherwise, keep the inserted cluster analysis results unchanged.
[0043] The initial shape of a single tree is optimized based on all processing results.
[0044] Preferably, the pre-trained image recognition model includes a basic feature extraction layer, an intermediate feature fusion layer, a multi-scale feature enhancement layer, and a temporal fusion layer.
[0045] This invention provides a forestry dead tree identification system based on image recognition, comprising:
[0046] The coefficient determination module is used to acquire remote sensing area maps of forestry areas, and to perform coarse analysis and regional division on the remote sensing area maps to obtain several sub-regions, the regional boundary lines of each sub-region, and coarse deadwood coefficients.
[0047] The frame splitting module is used to set the frame splitting frequency for each sub-region according to the region edge line and the coarse deadwood coefficient, and to split the regional image of the corresponding sub-region according to the frame splitting frequency to obtain several split frames.
[0048] The dot marking module is used to mark the first dot of the dead tree body in each split frame and mark the second dot of the dead tree roots in each split frame, and to construct the initial shape of a single tree based on the outer edge distribution of the first and second dot markings.
[0049] The sequence construction module is used to perform cluster analysis on the initial shape of the single tree according to the first threshold in the horizontal direction, the second threshold in the vertical direction, and the direction of the centerline of the outer edge marked by the second point, respectively, to lock the cluster points based on different directions, and to construct the length sequence of the same cluster point in each direction and each cluster point in the other two directions.
[0050] The morphology optimization module is used to optimize the initial morphology of the single tree based on the length sequence of the same cluster point and the corresponding cluster analysis results, so as to obtain the current morphology of the single tree.
[0051] The model recognition module is used to input all the current single tree forms of the corresponding sub-region into the pre-trained image recognition model in the order of their positions to obtain the dead tree recognition results of the corresponding sub-region. The order of their positions is from left to right and from top to bottom according to the geographical coordinates of the sub-region.
[0052] Compared with the prior art, the beneficial effects of this application are as follows:
[0053] By dynamically setting the frame splitting frequency based on the edge features and deadwood density of sub-regions, the system ensures detailed capture of areas with dense deadwood and complex edges while avoiding wasted computing power in sparse deadwood areas. Through integrated labeling of deadwood bodies and roots, multi-directional clustering analysis, and morphological optimization, the accuracy of individual tree morphology is significantly improved, and contour distortion is reduced. By combining the sequential input of sub-region geographical coordinates into the pre-trained model, efficient and accurate identification of deadwood in large-scale forest areas is achieved, effectively reducing the false negative and false positive rates of deadwood detection and significantly improving the intelligence and refinement of forestry management.
[0054] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0055] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0056] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0057] Figure 1This is a flowchart of a forestry dead tree identification method based on image recognition, as described in an embodiment of the present invention.
[0058] Figure 2 This is a structural diagram of a forestry dead tree identification system based on image recognition, as described in an embodiment of the present invention.
[0059] Figure 3 This is a structural diagram of a pre-trained image recognition model in an embodiment of the present invention. Detailed Implementation
[0060] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0061] This invention provides a method for identifying dead trees in forestry based on image recognition, such as... Figure 1 As shown, it includes:
[0062] Step 1: Obtain a remote sensing map of the forestry area, and perform coarse analysis and regional division on the remote sensing map to obtain several sub-regions, the regional boundary line of each sub-region, and the coarse deadwood coefficient;
[0063] Step 2: Set the frame splitting frequency for each sub-region according to the region edge line and the coarse deadwood coefficient, and split the region image of the corresponding sub-region according to the frame splitting frequency to obtain several split frames;
[0064] Step 3: Mark the first point of the dead tree body in each split frame and mark the second point of the dead tree roots in each split frame. Based on the distribution of the outer edges of the first and second point marks, construct the initial shape of a single tree.
[0065] Step 4: Perform cluster analysis on the initial shape of the single tree according to the first threshold in the horizontal direction, the second threshold in the vertical direction, and the direction of the centerline of the outer edge marked by the second point, respectively, lock the cluster points based on different directions, and construct the length sequence of the same cluster point in each direction and each cluster point in the other two directions.
[0066] Step 5: Optimize the initial morphology of the single tree based on the length sequence of the same cluster point and the corresponding cluster analysis results to obtain the current morphology of the single tree;
[0067] Step 6: Input all the current single tree forms of the corresponding sub-region into the pre-trained image recognition model in the order of their positions to obtain the dead tree recognition results of the corresponding sub-region. The order of their positions is from left to right and from top to bottom according to the geographical coordinates of the sub-region.
[0068] In this embodiment, the remote sensing area map refers to a high-resolution image covering a target forestry area, acquired by imaging equipment carried by a remote sensing satellite or drone. It contains visual information such as trees, terrain, and vegetation in the area. For example, a remote sensing image of a provincial forest farm with an area of 500 square kilometers, with a resolution of 0.5 meters, can clearly show the outline features of a single tree.
[0069] In this embodiment, coarse analysis and region division are processes that extract and analyze the features of pixels in the remote sensing image, and then divide the image into multiple small regions with similar features. Specifically, the OpenCV library in Python is used to extract features such as vegetation spectrum and dead tree texture from the image pixels. Then, the K-means clustering algorithm is used to divide the region based on feature similarity. For the remote sensing image of the aforementioned 500 square kilometers of forest, it is divided into 100 initial regions of 5 square kilometers each, based on a pixel comprehensive feature similarity of ≥0.75 (clustering threshold). Finally, by calculating the feature difference rate between adjacent initial regions, 98 effective sub-regions are determined.
[0070] In this embodiment, the region edge line is the boundary line separating different sub-regions. It is formed by connecting pixels where the pixel features of adjacent sub-regions change abruptly. Specifically, the difference rate of the comprehensive feature values of pixels in adjacent sub-regions is calculated. When the difference rate changes abruptly from ≤10% to ≥40%, the pixels at these abrupt changes are connected in sequence to form the region edge line. For example, if sub-regions A01 and A02 are adjacent and located near 110.1° East longitude, the difference rate of the comprehensive feature values of pixels changes abruptly from 8% to 45%. Connecting the pixels on this line forms the region edge line between A01 and A02.
[0071] In this embodiment, the coarse deadwood coefficient is a quantitative parameter that reflects the distribution density and feature significance of deadwood in a sub-region. It is calculated by the proportion of deadwood texture pixels in the sub-region, the comprehensive feature value of pixels, and related normalization.
[0072] In this embodiment, the frame splitting frequency is the frequency at which a continuous regional image of a sub-region is split into a static image, and its magnitude is determined by the region edge line and the coarseness coefficient of the sub-region.
[0073] In this embodiment, the regional imagery is a continuous dynamic imagery collected separately for each sub-region, which can completely record the morphological characteristics of trees within the sub-region. By using a drone equipped with a high-definition camera (4K resolution), the drone can cruise and shoot each sub-region to obtain continuous video images. For example, for sub-region A01, the drone cruises at a speed of 5 meters per second and captures continuous regional images with a duration of 2 hours and a resolution of 4K.
[0074] In this embodiment, the split frame is a static image obtained by splitting continuous regional images according to the frame splitting frequency. Each split frame can be used individually for subsequent dead tree marking and morphological construction. For example, the regional image of sub-region A01 for 2 hours is split into 1960 split frames.
[0075] In this embodiment, the dead tree body refers to the main trunk of the dead tree, including the trunk and main branches with a diameter of ≥5 cm. It is the most prominent morphological feature of the dead tree. For example, the trunk of a dead pine tree has a diameter of 20 cm and a height of 8 meters. Three main branches with diameters of 8 cm, 6 cm and 5 cm respectively constitute the main body of the dead tree.
[0076] In this embodiment, the first point marking is a number of edge points collected and marked along the outer edge of the dead tree body at a preset sampling interval. The LabelMe image annotation tool is used to determine the sampling interval according to the resolution of the remote sensing image. The marking points are clicked sequentially along the outer edge of the dead tree body, and the coordinates and pixel gray values of each marking point are recorded.
[0077] In this embodiment, dead tree roots refer to the root system of dead trees that is close to or partially exposed above the ground. They are usually ≥3 cm in diameter and are an important part of the dead tree's morphology. For example, the three roots of a dead pine tree that are exposed near the ground have diameters of 4 cm, 3.5 cm, and 3 cm, and lengths of 1.2 m, 1 m, and 0.8 m, respectively.
[0078] In this embodiment, the second point marker is a number of edge points collected and marked along the outer edge of the dead tree root at the same sampling interval as the first point marker. The principle is similar to that of the first point marker, and will not be described again here.
[0079] In this embodiment, the outer edge distribution refers to the positional distribution, point density, and curvature of adjacent points of the two types of marker points in the split frame.
[0080] In this embodiment, the initial shape of a single tree is a preliminary shape of the dead tree constructed by combining the outline of the main body of the dead tree and the outline of the tree root through curve fitting and outline alignment. The overlapping points are found and deleted using Python's collection operations, and the outlines of the two are merged. For example, the overlapping point between the bottom of the main body outline and the top of the tree root outline, such as the point with coordinates (210, 280), is removed, and finally the initial shape of a single tree with the trunk and roots naturally connected is formed.
[0081] In this embodiment, the first threshold in the horizontal direction is the distance threshold used to determine whether two points belong to the same cluster when clustering points on the initial shape of a single tree in the horizontal direction. That is, when the difference in coordinates of two points in the horizontal direction (x-axis direction) is less than or equal to the threshold, they are classified into the same cluster. For example, the first threshold is set to 5 pixels based on a remote sensing resolution of 1 meter. That is, when the difference in x-coordinates of two points in the horizontal direction is less than or equal to 5 pixels, they are determined to be in the same horizontal cluster.
[0082] In this embodiment, the second threshold in the vertical direction is the distance judgment criterion for vertical clustering. When the difference in coordinates of two points in the vertical direction (y-axis direction) is less than or equal to the threshold, they are classified into the same vertical cluster. For example, if the second threshold is set to 4 pixels, when the difference in y-coordinates of two points in the vertical direction is less than or equal to 4 pixels, they are judged to be in the same vertical cluster.
[0083] In this embodiment, the direction of the centerline of the outer edge of the second mark refers to the direction of the extension of the centerline of the curve formed by the outer edge mark point (second mark) of the dead tree root. Specifically, the outer edge curve of the second mark is first fitted with a polynomial, and then the distance from each point on the curve to a certain straight line is calculated. The straight line with the smallest total distance is taken as the centerline, and the direction of the straight line is the direction of the centerline. For example, the fitted curve of the second mark of the dead pine tree root is a curve from the lower left to the upper right, where the angle between the line and the horizontal direction is 35°, that is, the direction of the centerline is the direction at a 35° angle with the horizontal.
[0084] In this embodiment, cluster analysis is the process of dividing all points on the initial form of a single tree into multiple clusters according to thresholds in three directions: horizontal, vertical, and midline. Specifically, the DBSCAN clustering algorithm is used, with a neighborhood radius of 5 pixels for the first threshold in the horizontal direction, 4 pixels for the second threshold in the vertical direction, and 6 pixels for the midline direction. For example, the 43 points (25 main points + 18 root points) on the initial form of a dead pine tree are clustered into 3 horizontal clusters, 4 vertical clusters, and 2 midline direction clusters after cluster analysis.
[0085] In this embodiment, cluster points in different directions refer to the set of points formed in each direction after cluster analysis, consisting of several adjacent points. Each cluster point has similar directional location characteristics. For example, cluster point 1 in the horizontal direction contains 6 points, concentrated in the x-coordinate range of 150-180 pixels; cluster point 2 in the vertical direction contains 6 points, concentrated in the y-coordinate range of 350-370 pixels.
[0086] In this embodiment, the length sequence refers to the numerical sequence formed by arranging the Euclidean distances between a certain cluster point in each direction and all cluster points in the other two directions in order. For example, the distances between cluster point 1 (H1) in the horizontal direction and the four cluster points in the vertical direction are 12, 18, 25, and 30 pixels, respectively, and the distances between cluster point 1 and the two cluster points in the midline direction are 15 and 22 pixels, respectively. Then the length sequence corresponding to H1 is {12,18,25,30,15,22}. It should be noted that the distances between the coordinates of the geometric center point of cluster point 1 in the horizontal direction and the coordinates of the geometric center points of the corresponding cluster points in the other directions constitute the length sequence.
[0087] In this embodiment, the initial shape of a single tree is optimized by adjusting the outline of the initial shape of the single tree according to the fluctuation characteristics of the length sequence, the number of cluster points, and the growth pattern of the single tree to obtain the current shape of the single tree.
[0088] In this embodiment, from left to right, longitude is from smallest to largest, and from top to bottom, latitude is from largest to smallest. For example, sub-regions A01 (L=110.0°, B=30.5°), A02 (L=110.1°, B=30.5°), and A03 (L=110.0°, B=30.4°) are located in the order A01→A02→A03.
[0089] In this embodiment, all current single-tree forms in the corresponding sub-region refer to the set of current single-tree forms obtained after optimization of all dead trees in each sub-region. For example, 20 dead trees were identified in the A01 sub-region, corresponding to 20 current single-tree forms.
[0090] In this embodiment, the pre-trained image recognition model is a model that has been trained in advance with a large amount of forestry dead tree data and has the ability to recognize dead trees.
[0091] In this embodiment, the dead tree identification result refers to the information such as tree species, degree of decay, and geographical coordinates of dead trees in the sub-region after the model analyzes the current single tree morphology. Specifically, all current single tree morphologies in the sub-region are input into the pre-trained model in order of location. The model identifies and outputs the results one by one, and finally summarizes them to obtain the overall dead tree identification result of the sub-region. For example, the dead tree identification result of the A01 sub-region is: a total of 20 dead trees, including 12 dead pines (7 with slight decay and 5 with moderate decay) and 8 dead poplars (4 with moderate decay and 4 with severe decay). The geographical coordinates of all dead trees are between 110.0° and 110.1° east longitude and 30.4° and 30.5° north latitude.
[0092] The beneficial effects of the above technical solution are as follows: By dynamically setting the frame splitting frequency according to the edge features and deadwood density of the sub-region, it ensures the capture of details in dense deadwood and complex edge areas while avoiding the waste of computing power in sparse deadwood areas; by integrating the deadwood body and tree roots with labeling, multi-directional clustering analysis and morphological optimization, the accuracy of single tree morphology is greatly improved and contour distortion is reduced; by combining the geographic coordinates of the sub-regions with the pre-trained model, efficient and accurate identification of deadwood in large-scale forest areas is achieved, effectively reducing the false detection rate and false detection rate of deadwood, and significantly improving the level of intelligence and refinement of forestry management.
[0093] This invention provides a method for identifying dead trees in forestry based on image recognition, which includes coarse analysis and region division of the remote sensing area map, comprising:
[0094] Extract the vegetation spectral features, dead tree texture features, and spatial neighborhood features of each pixel in the remote sensing area map to obtain the comprehensive feature value of each pixel; (all of which need to be normalized coefficients).
[0095] Based on the fact that the similarity of the comprehensive feature values is greater than or equal to the clustering threshold, the standard remote sensing image is divided into several initial sub-regions. The difference rate of the comprehensive feature values of adjacent initial sub-regions is calculated, and the pixel line connecting the points where the comprehensive feature values change abruptly is used as the region edge line to obtain several sub-regions and corresponding region edge lines.
[0096] The percentage of pixels in each sub-region whose deadwood texture features meet the preset conditions is counted, and the coarse deadwood coefficient X is obtained by combining the comprehensive feature value of the corresponding sub-region.
[0097] and
[0098] Among them, K min K is the minimum value among all subregions corresponding to K; max The maximum value among all sub-regions corresponding to K; K is the initial deadwood coefficient of the corresponding sub-region; (K min_out ,K max_out ) represents the target interval for the output coefficients; eR represents the normalized interval. Information entropy; eW is the normalized value. The information entropy; R is the pixel percentage of the corresponding sub-region; Rmin is the minimum value of R among all sub-regions; Rmax is the maximum value of R among all sub-regions; Wi is the comprehensive feature value of the i-th pixel in the corresponding sub-region; N represents the number of pixels in the corresponding sub-region, which is a variable; Wmin is the minimum value among the average feature values of all sub-regions; Wmax is the maximum value among the average feature values of all sub-regions.
[0099] In this embodiment, the spectral characteristics of vegetation are calculated using the Normalized Difference Vegetation Index (NDVI), which is: NDVI = (NIR - Red) / (NIR + Red), where NIR is the near-infrared reflectance and Red is the red reflectance. After obtaining this index, normalization is performed to obtain the normalization coefficient, which is a prior art technique. It should be noted that the overall NDVI range is 0.1 to 0.8. Specifically, the NDVI of non-vegetated areas such as bare soil and rocks is usually close to 0.1, while the NDVI of healthy, dense forest vegetation (such as mature trees) can reach around 0.8. The NDVI of deadwood, due to chlorophyll degradation, falls between that of bare soil / rock and healthy vegetation. Therefore, the overall NDVI range of 0.1-0.8 represents the typical NDVI distribution range for vegetation (including deadwood) and atypical vegetation coverage pixels within forestry areas, determined based on statistical patterns from measured remote sensing data.
[0100] The gray-level co-occurrence matrix of pixels was calculated using the OpenCV library to extract the contrast of dead wood texture features. Through the extraction and statistics of texture features from a large number of forestry remote sensing images (including dead wood samples), the contrast of dead wood texture is mainly distributed in the range of 20 to 200. After normalization, the normalization coefficient of texture features can be obtained.
[0101] Spatial neighborhood features are achieved using the vegetation cover continuity index within a 5×5 window, which is the coefficient of variation of the proportion of vegetation pixels within the window. This coefficient is then normalized to the [0,1] interval through linear transformation. Based on the feature distribution statistics of actual forestry image windows, the typical dispersion range of dead tree areas (and transition areas) is determined to be 0.1-0.6.
[0102] The comprehensive feature value can then be obtained by weighting the three normalization coefficients mentioned above. Among them, the contribution of vegetation spectrum, dead tree texture and spatial neighborhood features of a large number of dead tree identification samples is quantified. The dead tree texture feature has the largest contribution to the differentiation of dead trees, so it is assigned a weight of 0.4; the contribution of vegetation spectrum feature is relatively second, and each is assigned a weight of 0.3.
[0103] In this embodiment, Where W1 and W2 are the average comprehensive characteristic values of adjacent sub-regions.
[0104] In this embodiment, the texture features of a large number of dead tree samples are statistically analyzed to determine thresholds, namely: texture entropy ≥ 0.6 after normalization and gray-level co-occurrence matrix contrast ≤ 0.3 after normalization. For example, if a pixel has a texture entropy of 0.65 and a contrast of 0.25 after normalization, it meets the preset conditions.
[0105] In this embodiment, (K) min_out ,K max_out = (0.2, 0.8).
[0106] The beneficial effects of the above technical solution are as follows: by extracting and normalizing three types of features—vegetation spectrum, deadwood texture, and spatial neighborhood—to obtain comprehensive feature values, and then clustering and dividing the initial sub-regions based on the similarity of the comprehensive feature values, the region boundary lines are determined by combining feature mutations, and finally, the coarse deadwood coefficient is calculated by fusing statistics and information entropy, thereby achieving accurate quantitative division of sub-regions and deadwood distribution density in forestry areas and improving the targeting and accuracy of subsequent deadwood identification.
[0107] This invention provides a forestry deadwood identification method based on image recognition, which sets a frame splitting frequency for each sub-region according to the region edge line and the coarse deadwood coefficient, including:
[0108] The edge curvature of each sub-region's edge line is quantified as C = L / L0, where L is the actual pixel length of the corresponding region's edge line, and L0 is the perimeter of the minimum bounding rectangle of the corresponding sub-region.
[0109] Based on the area S of the corresponding sub-region and the resolution Rs of the remote sensing area map, the fundamental frequency is set. Where ∝ represents the initial frequency;
[0110] Based on the coarse wood coefficient X and the edge tortuosity C, the base frequency of the corresponding sub-region is corrected to obtain the frame splitting frequency f = fb × (1 + β × X + γ × (C - 1)), and fmin ≤ f ≤ fmax, where β is the coarse wood coefficient weighting factor; γ is the edge complexity weighting factor, and fmin is the upper and lower limits of the frequency.
[0111] In this embodiment, the length unit of the perimeter L0 is pixels, and the unit of the actual pixel length is pixels.
[0112] In this embodiment, resolution is an inherent property of remote sensing images and can be directly read from the remote sensing image metadata.
[0113] In this embodiment, β = 0.3 and γ = 0.2 were determined through experimental optimization to achieve the highest recognition accuracy. A balance between computing power and accuracy was achieved by setting ∝ = 0.01. Units are frames per hour, S is in square meters, and Rs is... 2 The unit is square meters.
[0114] In this embodiment, (fmin, fmax) is determined based on hardware and accuracy requirements. For example, tests have shown that when the frequency is below 300 frames per hour, the rate of missing details of dead trees increases, while above 1500 frames per hour, computing power is wasted and the accuracy improvement is limited. Therefore, (fmin, fmax) = (300 frames per hour, 1500 frames per hour).
[0115] The beneficial effects of the above technical solution are: by dynamically correcting the frame splitting frequency, a balance is achieved between accurate capture of details and efficient utilization of computing power, providing more suitable image data for subsequent construction and recognition of dead tree morphology.
[0116] This invention provides a forestry deadwood identification method based on image recognition, which constructs an initial morphology of a single tree based on the outer edge distribution of a first point marker and a second point marker, including:
[0117] The first point is marked by collecting several edge points P along the outer edge of the dead tree body at a preset sampling interval. 1o Let o = 1, 2, 3, ..., n, where n is the number of the first point markers, and record the edge points P of each main body. 1o coordinates (x) 1o ,y 1oand pixel grayscale value G 1o ;
[0118] The second point is marked as several root edge points P collected along the outer edge of the tree root at the same sampling interval. 2u u = 1, 2, 3, ..., m, where m is the number of second point markers, and the root edge points P of each tree are recorded. 2u coordinates (x) 2u ,y 2u and pixel grayscale value G 2u ;
[0119] Calculate the point density D1 = n / S1 at the outer edge of the first mark and the point density D2 = m / S2 at the outer edge of the second mark, where S1 is the minimum circumscribed circle area of the dead tree body and S2 is the minimum circumscribed circle area of the tree root.
[0120] Calculate the first curvature of adjacent body edge points At this point, o = 2, 3, ..., n-1. Simultaneously, the second curvature of the adjacent root edge points is calculated. At this point, u = 2, 3, ..., m-1;
[0121] Calculate each body edge point P 1o With all tree root edge points P 2u The Euclidean distance dou is used to filter point pairs that are less than or equal to a preset distance threshold, which are then considered as associated point pairs;
[0122] Connect the first curvature K using a cubic Bézier curve 1o Continuous points less than or equal to the curvature threshold, and with respect to the first curvature K. 1o Outliers exceeding the curvature threshold are subjected to mean filtering and fitting to form the initial outline of the dead tree.
[0123] Using the associated point pairs as the connection benchmark, the transition edge points between the associated point pairs are supplemented based on the point density and using linear difference, and the transition edge points are fitted with the tree root edge points by a quadratic Bézier curve to form the tree root outline.
[0124] The initial outline of the dead tree body is aligned with the outline of the tree root by coordinates, and overlapping edge points are removed to obtain the complete initial shape of a single tree. The preset sampling interval and preset distance threshold vary with the resolution.
[0125] Preferably, the transition edge points between associated point pairs are supplemented based on point density and using linear interpolation, including:
[0126] Based on point density D1 and point density D2, determine the number of insertion points between corresponding associated point pairs. Where r is half of the straight-line distance d1 between the corresponding associated point pairs, and r = d1 / 2, and d0 is a preset distance threshold; It is a rounding function;
[0127] Based on the number of insertion points Nc, the coordinates of the two edge points involved in the corresponding associated point pair, the pixel grayscale values of the two edge points, and the pixel information of the eight neighbors of each edge point in the corresponding associated point pair, the coordinates and grayscale values of each insertion point are obtained. The insertion point is the transition edge point.
[0128] In this embodiment, the preset sampling interval, preset distance threshold, and clustering threshold all change with the resolution, and are directly retrieved and used based on a pre-established resolution-core parameter table, as shown in Table 1:
[0129] Table 1 Resolution - Core Parameters
[0130] Remote sensing resolution Rs Sampling interval (pixels) Distance threshold (pixels) Clustering threshold Rs≤0.1m 8 30 0.85 0.1m<Rs≤1m 12 40 0.75 Rs>1m 15 50 0.65
[0131] In this embodiment, the minimum circumcircle of the dead tree body and roots is obtained using the minEnclosingCircle function of OpenCV, and the area of the circle is calculated.
[0132] In this embodiment, the curvature of adjacent main body edge points and tree root edge points is calculated using the three-point method. The coordinate difference of the three adjacent points is calculated using Python's NumPy library, and then substituted into the curvature formula to obtain the curvature.
[0133] In this embodiment, the formula for Euclidean distance is:
[0134] In this embodiment, a cubic Bézier curve is used to connect continuous subject edge points with a first curvature less than or equal to a curvature threshold, fitting the initial contour of the dead tree subject. The curve is generated using OpenCV's bezierCurve function. For outliers, a 3×3 mean filter is applied using OpenCV's blur function before fitting. For example, the K value of subject edge points P11 to P15 is used. 1o All values ≤ 0.3; connect them with cubic Bézier curves to form a smooth outline of the upper half of the tree trunk; P16 K 1o =0.4, after filtering, it is fitted with surrounding points and integrated into the contour.
[0135] In this embodiment, by combining the coordinates, grayscale, and eight neighboring pixel information of the associated point pair, linear interpolation is used to obtain the transition edge points. Then, by combining the coordinates (P125(220,250), P25(215,300)), grayscale (25, 28), and the average grayscale of the eight neighboring points of the associated point pair, linear interpolation is used to obtain 11 insertion points (e.g., the coordinates of the 5th insertion point are approximately (217.5,275), and the grayscale is approximately 26.5). These insertion points are the transition edge points.
[0136] Let the two edge points of the associated point pair be A(x1, y1) and B(x2, y2). Nc transition points need to be inserted. These insertion points divide the line segment between A and B into Nc+1 equal segments. The coordinates of the k0th insertion point are calculated using a linear interpolation formula:
[0137]
[0138] Let the gray level of associated point A be G1 and the gray level of associated point B be G2. The initial gray levels are obtained through linear interpolation:
[0139] Adjustment is performed by combining the grayscale values of the eight neighboring regions: find the eight adjacent pixels around the insertion point (top, bottom, left, right, top left, top right, bottom left, and bottom right), and calculate the average grayscale value G. 邻域均值 Then, linear interpolation is used to obtain G. 初 With G 邻域均值 G is integrated according to a certain weight. 最终 =0.8×G 初 +0.2×G 邻域均值 This makes the grayscale more closely match the local texture features of the image. In particular, through testing a large number of forestry dead tree image samples (covering dead trees of different tree species, degrees of decay, and lighting conditions), the combination of weights of 0.8 and 0.2 was used in multiple experiments to make the grayscale distribution of the single tree shape match the texture features of the actual dead tree the most, and the transition effect the most natural.
[0140] In this embodiment, a quadratic Bézier curve is used to fit the tree root contour: using the transition edge points and the tree root edge points as control points, the BezierCurve function of OpenCV is used to fit the tree root contour. For example, the transition edge points and the tree root edge points are fitted together to form a natural contour of the tree root extending outward from the junction with the main body.
[0141] The beneficial effects of the above technical solution are as follows: by marking the edge points of the dead tree body and the tree roots respectively, and by combining curvature, point density and Euclidean distance to screen related point pairs, and by using Bézier curve fitting and supplementing transition points, the initial shape of the single tree body and the tree roots are obtained, making the shape outline of the dead tree more complete and providing a more accurate morphological basis for subsequent dead tree identification.
[0142] This invention provides a forestry deadwood identification method based on image recognition, which optimizes the initial morphology of individual trees based on the length sequence of the same cluster points and the corresponding clustering analysis results, including:
[0143] Extract the same cluster points from the length sequence based on a first subsequence in one of the remaining directions and a second subsequence in another of the remaining directions;
[0144] Simultaneously, the number of intra-cluster points Mh of the cluster analysis results for the same cluster point is obtained;
[0145] Sort the first subsequence and the second subsequence by size respectively to obtain the third subsequence and the fourth subsequence;
[0146] Calculate the first volatility coefficient and first trend slope of the third subsequence, and the second volatility coefficient and second trend slope of the fourth subsequence, respectively;
[0147] If Mh is less than the quantity threshold N0, then N0-Mh points are inserted within the edge range of the clustering analysis result of the same cluster point; otherwise, the corresponding clustering analysis result remains unchanged.
[0148] If there is a case where the volatility coefficient is greater than the volatility threshold V0, the corresponding subsequence is smoothed; otherwise, the corresponding subsequence remains unchanged.
[0149] If the absolute value of the difference between the trend slope and the base slope is greater than the slope threshold, determine the corresponding deviation direction, and perform elastic deformation processing on the points in the inserted cluster analysis results according to the single tree growth law along the deviation direction; otherwise, keep the inserted cluster analysis results unchanged.
[0150] The initial shape of a single tree is optimized based on all processing results.
[0151] In this embodiment, the growth pattern of a single tree is a pre-defined constraint for different tree species, which can be matched from the tree species-constraint lookup table. For example, the trunk curvature of pine trees is 0.5-0.7 and the angle between the root system and the trunk is 30°-60°; the trunk curvature of poplar trees is 0.3-0.5 and the angle between the root system and the trunk is 45°-75°.
[0152] In this embodiment, subsequences (such as the horizontal-vertical subsequence [12,18,25,30] and the horizontal-midline subsequence [15,22] of H1) are first extracted from the length sequence, sorted, and the fluctuation coefficient (the ratio of standard deviation to mean) and trend slope are calculated. If the number of points Mh in a cluster is less than the number threshold N0 (e.g., N0 = 8, Mh = 6 for H1), then N0 - Mh = 2 points are inserted within the edge range of the cluster (coordinates are based on linear interpolation of adjacent points, and gray values are referenced from eight neighboring pixels). If the fluctuation coefficient is greater than the fluctuation threshold V0 (e.g., V0 = 0.4, H1...), then... If the horizontal-vertical subsequence fluctuation coefficient is 0.35 (no processing required), then smoothing is performed; if the absolute value of the difference between the trend slope and the base slope (e.g., the trend slope of the horizontal cluster point of the pine tree is 4) is greater than the slope threshold (e.g., 1.5, H1 trend slope is 3.8, difference is 0.2, no processing required), then elastic deformation is performed according to the growth law of individual trees; finally, all adjustments are integrated to obtain the optimized form. For example, the number of H1 cluster points of the above-mentioned dead pine tree increases from 6 to 8, the outline is smoother, and the connection angle between the tree root and the main body is adjusted to 45° (in line with the growth law of pine tree roots), forming the current form of individual trees.
[0153] In this embodiment, the cluster analysis result refers to the detailed information of all clusters obtained after clustering the initial morphology of a single tree in three directions, including the cluster number, the coordinates of the pixels contained in each cluster, and the number of points within the cluster.
[0154] In this embodiment, the number of points within a cluster, Mh, refers to the actual number of pixels contained in the same cluster. Taking H1 as an example, it contains 6 pixels, so Mh = 6; if V2 in the vertical direction contains 8 pixels, then Mh for V2 = 8.
[0155] In this embodiment, sorting by size refers to rearranging the values in the first and second subsequences in ascending order. For example, the first subsequence [12,18,25,30] is already sorted in ascending order and remains unchanged after sorting; if the second subsequence is [22,15], it becomes [15,22] after sorting.
[0156] In this embodiment, the volatility coefficient is a quantitative indicator that reflects the degree of dispersion of the sequence values. It is calculated by dividing the standard deviation of the sequence by the mean.
[0157] In this embodiment, the trend slope refers to the slope of the straight line between the sequence value and the sequence index (or position) fitted by linear regression.
[0158] In this embodiment, the quantity threshold N0 refers to the minimum standard for the number of points within a pre-set cluster, used to determine whether the number of points within the cluster is sufficient to describe the morphological details of a single tree. It needs to be determined based on the complexity of the single tree's morphology and the remote sensing resolution. By testing multiple sets of deadwood samples of different tree species and resolutions, the correspondence between the number of points within a cluster and the integrity of the outline was statistically analyzed to determine the value of N0. At a resolution of 1 meter, tests showed that when N0 = 8, more than 90% of the clusters could completely describe the corresponding morphological parts.
[0159] In this embodiment, the edge range refers to the outer boundary region of a cluster point in the initial shape of a single tree. It is the limited range for inserting new points and is usually determined by extending outward by 5-10 pixels from the extreme values of the coordinates of all points within the cluster. Specifically, the extreme values of the x and y coordinates of the points within the cluster are extracted from the cluster analysis results, and the edge range is determined by ±5 pixels of the extreme values.
[0160] In this embodiment, the insertion of points refers to adding N0-Mh new points within the edge range of the cluster when the number of points Mh in the cluster is less than N0, in order to improve the morphological details of the cluster. The coordinates of the new points are calculated by linear interpolation, and the gray level is referenced to the average gray level of the eight neighborhoods of the existing points within the edge range.
[0161] In this embodiment, the fluctuation threshold V0 refers to the maximum allowable value of the pre-set fluctuation coefficient, used to determine whether the fluctuation of the cluster distance sequence exceeds the normal range, and needs to be determined according to the characteristics of the cluster points in different directions. By statistically analyzing the cluster fluctuation coefficients of a large number of normal single-tree morphologies, the maximum value of the fluctuation coefficient of 95% of normal samples is taken as V0. Statistically, it was found that the fluctuation coefficient of 95% of horizontal cluster points is ≤0.4, so V0 = 0.4 is set.
[0162] In this embodiment, smoothing refers to reducing the sequence fluctuation by using methods such as moving average or Gaussian filtering when the fluctuation coefficient is greater than V0. Specifically, the window size of the moving average needs to be determined according to the sequence length, which can be achieved by using the pandas.Series.rolling() function in Python.
[0163] In this embodiment, the basic slope refers to the standard value of the trend slope of the cluster distance sequence that conforms to the growth law of a single tree. The basic slope is different for different tree species and different directions. It is directly obtained based on the pre-established tree species-direction-basic slope reference table. For example, the basic slope of the horizontal direction cluster point of pine deadwood is set to 5.0; the basic slope of the horizontal direction cluster point of poplar is 4.5.
[0164] In this embodiment, the slope threshold refers to the maximum allowable deviation between the pre-set trend slope and the base slope, used to determine whether the trend slope deviates from the normal range. It is usually set to 20%-30% of the base slope. For example, if the base slope of the pine tree in the horizontal direction is 5.0, the slope threshold is 1.5 (i.e., the absolute value of the deviation ≤ 1.5 is normal, and > 1.5 needs to be processed); when the base slope is 4.0, the threshold is 1.2.
[0165] In this embodiment, the deviation direction refers to the type of deviation between the trend slope and the base slope, which is divided into a larger slope (trend slope > base slope + slope threshold) and a smaller slope (trend slope < base slope - slope threshold), used to determine the direction of subsequent deformation adjustment.
[0166] In this embodiment, elastic deformation processing refers to fine-tuning the coordinates of points within a cluster based on the deviation direction and the growth pattern of individual trees when the trend slope deviation exceeds a threshold. This ensures the trend slope is close to the base slope while maintaining the adjusted shape in line with the growth pattern. Taking the example of a large slope in H1 (8.0 > 5.0 + 1.5), the deviation direction indicates the distance sequence is growing too rapidly. The growth trend needs to be slowed by reducing the y-coordinate value: the y-coordinate of each point within the H1 cluster is uniformly reduced by 0.8 pixels. After adjustment, the trend slope of the third sub-sequence is recalculated to approximately 5.5. Simultaneously, it is necessary to ensure the adjusted trunk curvature remains within the pine tree's range of 0.5-0.7. Specifically, the coordinate adjustment range needs to be determined through trial and error to avoid excessively large adjustments that could lead to morphological distortion. For example, elastic deformation is achieved based on a species-specific offset Δx, specifically: Δx = 0.1 × |θz - θref|, where θz is the corresponding trend slope; θref is the base slope.
[0167] The processing result refers to the final output of the three stages of insertion, smoothing, and elastic deformation processing mentioned above, including the adjusted intra-cluster point coordinates, the smoothed subsequence, and the corrected trend slope. For example, the processing result of H1 is: the number of intra-cluster points increases from 6 to 8, the smoothed third subsequence is [12,18.33,24.33,30], the trend slope is corrected from 8.0 to 5.5, and all parameters meet the threshold requirements.
[0168] The beneficial effects of the above technical solution are as follows: by extracting the cluster point distance subsequence and analyzing its fluctuations and trends, and combining the supplementation of the number of points within the cluster, sequence smoothing and elastic deformation adjustment, it can accurately correct problems such as incomplete outline caused by insufficient cluster points in the initial form of a single tree, unstable form caused by large fluctuations in the distance sequence, and inconsistent growth patterns caused by trend deviation. The optimized form of the single tree obtained is more in line with the structural characteristics of the actual dead tree, which effectively improves the recognition accuracy of the subsequent image recognition model for the form of dead trees.
[0169] This invention provides a method for identifying dead trees in forestry based on image recognition, such as... Figure 3As shown, the pre-trained image recognition model includes a basic feature extraction layer, an intermediate feature fusion layer, a multi-scale feature enhancement layer, and a temporal fusion layer. Among them, on large-scale unlabeled multi-source forestry data, the basic feature extraction layer of the pre-trained model is trained using a mask autoencoder task. The autoencoder prioritizes masking the decayed texture regions of dead trees with gray values ≤30 and texture entropy ≥5, with a masking ratio of 15%. It learns the underlying features of the general texture, contour, and three-dimensional structure of trees. For example, for an unlabeled image containing dead pine trees, the model can distinguish the underlying texture patterns of dead trees and healthy trees by learning the pixels around the masked decayed bark regions.
[0170] On a multispectral forestry image dataset with weakly labeled categories, an intermediate feature fusion layer of a pre-trained model using a contrastive learning task is employed. The contrastive learning temperature coefficient is 0.1, and the feature dimension is 256. This enhances the ability to distinguish the morphological features of trees of different species and growth stages in the multispectral dimension. For example, after inputting multispectral images (including red and near-infrared bands) of healthy pine trees and dead pine trees, the model can strengthen the feature differences between the two in the multispectral dimension through contrastive learning, making them easier to distinguish in subsequent identification.
[0171] On a high-resolution forestry image dataset with small-scale fine annotation, a multi-scale feature enhancement layer of a pre-trained model for feature alignment and boundary constraint tasks is employed. This multi-scale feature enhancement layer uses a multi-branch residual structure and dense connection mechanism to perform cross-scale feature interaction and fusion on the input single-tree morphology image. Fine annotation refers to the precise labeling of the location, species, and growth status of each tree.
[0172] On a dataset containing time-series data of individual tree growth, a time-series fusion layer of a model pre-trained using a time-series feature consistency learning task is employed. This time-series fusion layer uses a sliding time window and attention weights. By fusing temporal features, the model learns the evolutionary patterns of dead tree morphology, where t is the current time and t0 is the current time step; σ = 2 is the time decay coefficient. For example, for a pine tree photographed once a year, the temporal fusion layer uses a sliding time window to assign higher attention weights to images from recent time points (recent morphological changes are more critical for current recognition). After fusion, the model can learn the evolutionary patterns of dead tree bark, such as the gradual expansion of decay from local to overall decay, which helps in judging the degree of decay during recognition.
[0173] In this embodiment, the basic feature extraction layer uses the first 8 layers of ResNet-18; the intermediate feature fusion layer uses a channel attention mechanism; in the 3-branch residual structure of the multi-scale feature enhancement layer, 1×1 convolution is used for channel dimensionality reduction, and 3×3 and 5×5 convolutions are used for multi-scale spatial feature extraction; the attention weights of the temporal fusion layer are normalized by Softmax, specifically, 3×3 convolution captures medium-scale crack textures in the trunk, and 5×5 convolution captures large-scale morphology of the root system or crown.
[0174] In this embodiment, the final model achieves a dead tree recognition accuracy of over 92%. The model takes the current single-tree morphology of a dead tree as input and outputs the recognition results of tree species, degree of decay, and location. For example, tree species: dead pine, degree of decay: moderate, location: 110.05°E, 30.52°N.
[0175] The beneficial effects of the above technical solution are as follows: through multi-stage and multi-task pre-training, accurate identification of forest dead trees is achieved, with the final dead tree identification accuracy rate reaching over 92%; after inputting a single tree morphology image, results such as tree species, degree of decay, and geographical coordinates can be output, improving the accuracy and generalization of dead tree identification, capturing the dynamic evolution law of dead tree morphology, and providing efficient and reliable technical support for the monitoring of forest dead trees.
[0176] This invention provides a forestry dead tree identification system based on image recognition, such as... Figure 2 As shown, it includes:
[0177] The coefficient determination module is used to acquire remote sensing area maps of forestry areas, and to perform coarse analysis and regional division on the remote sensing area maps to obtain several sub-regions, the regional boundary lines of each sub-region, and coarse deadwood coefficients.
[0178] The frame splitting module is used to set the frame splitting frequency for each sub-region according to the region edge line and the coarse deadwood coefficient, and to split the regional image of the corresponding sub-region according to the frame splitting frequency to obtain several split frames.
[0179] The dot marking module is used to mark the first dot of the dead tree body in each split frame and mark the second dot of the dead tree roots in each split frame, and to construct the initial shape of a single tree based on the outer edge distribution of the first and second dot markings.
[0180] The sequence construction module is used to perform cluster analysis on the initial shape of the single tree according to the first threshold in the horizontal direction, the second threshold in the vertical direction, and the direction of the centerline of the outer edge marked by the second point, respectively, to lock the cluster points based on different directions, and to construct the length sequence of the same cluster point in each direction and each cluster point in the other two directions.
[0181] The morphology optimization module is used to optimize the initial morphology of the single tree based on the length sequence of the same cluster point and the corresponding cluster analysis results, so as to obtain the current morphology of the single tree.
[0182] The model recognition module is used to input all the current single tree forms of the corresponding sub-region into the pre-trained image recognition model in the order of their positions to obtain the dead tree recognition results of the corresponding sub-region. The order of their positions is from left to right and from top to bottom according to the geographical coordinates of the sub-region.
[0183] The beneficial effects of the above technical solution are as follows: By dynamically setting the frame splitting frequency according to the edge features and deadwood density of the sub-region, it ensures the capture of details in dense deadwood and complex edge areas while avoiding the waste of computing power in sparse deadwood areas; by integrating the deadwood body and tree roots with labeling, multi-directional clustering analysis and morphological optimization, the accuracy of single tree morphology is greatly improved and contour distortion is reduced; by combining the geographic coordinates of the sub-regions with the pre-trained model, efficient and accurate identification of deadwood in large-scale forest areas is achieved, effectively reducing the false detection rate and false detection rate of deadwood, and significantly improving the level of intelligence and refinement of forestry management.
[0184] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for identifying dead trees in forestry based on image recognition, characterized in that, include: Step 1: Obtain a remote sensing map of the forestry area, and perform coarse analysis and regional division on the remote sensing map to obtain several sub-regions, the regional boundary line of each sub-region, and the coarse deadwood coefficient; Step 2: Set the frame splitting frequency for each sub-region according to the region edge line and the coarse deadwood coefficient, and split the region image of the corresponding sub-region according to the frame splitting frequency to obtain several split frames; Step 3: Mark the first point of the dead tree body in each split frame and mark the second point of the dead tree roots in each split frame. Based on the distribution of the outer edges of the first and second point marks, construct the initial shape of a single tree. Step 4: Perform cluster analysis on the initial shape of the single tree according to the first threshold in the horizontal direction, the second threshold in the vertical direction, and the direction of the centerline of the outer edge marked by the second point, respectively, lock the cluster points based on different directions, and construct the length sequence of the same cluster point in each direction and each cluster point in the other two directions. Step 5: Optimize the initial morphology of the single tree based on the length sequence of the same cluster point and the corresponding cluster analysis results to obtain the current morphology of the single tree; Step 6: Input all the current single tree forms of the corresponding sub-region into the pre-trained image recognition model in the order of their positions to obtain the dead tree recognition results of the corresponding sub-region. The order of their positions is from left to right and from top to bottom according to the geographical coordinates of the sub-region.
2. The forestry dead tree identification method based on image recognition according to claim 1, characterized in that, A coarse analysis and regional division of the remote sensing area map are performed, including: The vegetation spectral features, dead tree texture features, and spatial neighborhood features of each pixel in the remote sensing area map are extracted to obtain the comprehensive feature value of each pixel; Based on the fact that the similarity of the comprehensive feature values is greater than or equal to the clustering threshold, the standard remote sensing image is divided into several initial sub-regions. The difference rate of the comprehensive feature values of adjacent initial sub-regions is calculated, and the pixel line connecting the points where the comprehensive feature values change abruptly is used as the region edge line to obtain several sub-regions and corresponding region edge lines. The percentage of pixels in each sub-region whose deadwood texture features meet the preset conditions is counted, and the coarse deadwood coefficient X is obtained by combining the comprehensive feature value of the corresponding sub-region. and Among them, K min K is the minimum value among all subregions corresponding to K; max The maximum value among all sub-regions corresponding to K; K is the initial deadwood coefficient of the corresponding sub-region; (K min_out ,K max_out ) represents the target interval for the output coefficients; eR represents the normalized interval. Information entropy; eW is the normalized value. The information entropy; R is the pixel percentage of the corresponding sub-region; Rmin is the minimum value of R among all sub-regions; Rmax is the maximum value of R among all sub-regions; Wi is the comprehensive feature value of the i-th pixel in the corresponding sub-region; N represents the number of pixels in the corresponding sub-region, which is a variable; Wmin is the minimum value among the average feature values of all sub-regions; Wmax is the maximum value among the average feature values of all sub-regions.
3. The forestry dead tree identification method based on image recognition according to claim 2, characterized in that, According to the region edge line and the coarse deadwood coefficient, the frame splitting frequency is set for each sub-region, including: The edge curvature of each sub-region's edge line is quantified as C = L / L0, where L is the actual pixel length of the corresponding region's edge line, and L0 is the perimeter of the minimum bounding rectangle of the corresponding sub-region. Based on the area S of the corresponding sub-region and the resolution Rs of the remote sensing area map, the fundamental frequency is set. Where ∝ represents the initial frequency; Based on the coarse wood coefficient X and the edge tortuosity C, the base frequency of the corresponding sub-region is corrected to obtain the frame splitting frequency f = fb × (1 + β × X + γ × (C - 1)), and fmin ≤ f ≤ fmax, where β is the coarse wood coefficient weight factor; γ is the edge complexity weight factor; and (fmin, fmax) is the upper and lower limits of the frequency.
4. The forestry dead tree identification method based on image recognition according to claim 1, characterized in that, Based on the outer edge distribution of the first and second point markers, the initial shape of a single tree is constructed, including: The first point is marked by collecting several edge points P along the outer edge of the dead tree body at a preset sampling interval. 1o Let o = 1, 2, 3, ..., n, where n is the number of the first point markers, and record the edge points P of each main body. 1o coordinates (x) 1o ,y 1o and pixel grayscale value G 1o ; The second point is marked as several root edge points P collected along the outer edge of the tree root at the same sampling interval. 2u u = 1, 2, 3, ..., m, where m is the number of second point markers, and the root edge points P of each tree are recorded. 2u coordinates (x) 2u ,y 2u and pixel grayscale value G 2u ; Calculate the point density D1 = n / S1 at the outer edge of the first mark and the point density D2 = m / S2 at the outer edge of the second mark, where S1 is the minimum circumscribed circle area of the dead tree body and S2 is the minimum circumscribed circle area of the tree root. Calculate the first curvature of adjacent body edge points At this point, o = 2, 3, ..., n-1. Simultaneously, the second curvature of the adjacent root edge points is calculated. At this point, u = 2, 3, ..., m-1; Calculate each body edge point P 1o With all tree root edge points P 2u The Euclidean distance dou is used to filter point pairs that are less than or equal to a preset distance threshold, which are then considered as associated point pairs; Connect the first curvature K using a cubic Bézier curve 1o Continuous points less than or equal to the curvature threshold, and with respect to the first curvature K. 1o Outliers exceeding the curvature threshold are subjected to mean filtering and fitting to form the initial outline of the dead tree body. Using the associated point pairs as the connection benchmark, the transition edge points between the associated point pairs are supplemented based on the point density and using linear difference, and the transition edge points are fitted with the tree root edge points by a quadratic Bézier curve to form the tree root outline. The initial outline of the dead tree body is aligned with the outline of the tree root by coordinates, and overlapping edge points are removed to obtain the complete initial shape of a single tree. The preset sampling interval and preset distance threshold vary with the resolution.
5. The forestry dead tree identification method based on image recognition according to claim 4, characterized in that, Based on point density and using linear interpolation to supplement transition edge points between associated point pairs, including: Based on point density D1 and point density D2, determine the number of insertion points between corresponding associated point pairs. Where r is half of the straight-line distance d1 between the corresponding associated point pairs, and r = d1 / 2, and d0 is a preset distance threshold; It is a rounding function; Based on the number of insertion points Nc, the coordinates of the two edge points involved in the corresponding associated point pair, the pixel grayscale values of the two edge points, and the pixel information of the eight neighbors of each edge point in the corresponding associated point pair, the coordinates and grayscale values of each insertion point are obtained. The insertion point is the transition edge point.
6. The forestry dead tree identification method based on image recognition according to claim 1, characterized in that, The initial morphology of the individual tree is optimized based on the length sequence of the same cluster points and the corresponding clustering analysis results, including: Extract the same cluster points from the length sequence based on a first subsequence in one of the remaining directions and a second subsequence in another of the remaining directions; Simultaneously, the number of intra-cluster points Mh of the cluster analysis results for the same cluster point is obtained; Sort the first subsequence and the second subsequence by size respectively to obtain the third subsequence and the fourth subsequence; Calculate the first volatility coefficient and first trend slope of the third subsequence, and the second volatility coefficient and second trend slope of the fourth subsequence, respectively; If Mh is less than the quantity threshold N0, then N0-Mh points are inserted within the edge range of the clustering analysis result of the same cluster point; otherwise, the corresponding clustering analysis result remains unchanged. If there is a case where the volatility coefficient is greater than the volatility threshold V0, the corresponding subsequence is smoothed; otherwise, the corresponding subsequence remains unchanged. If the absolute value of the difference between the trend slope and the base slope is greater than the slope threshold, determine the corresponding deviation direction, and perform elastic deformation processing on the points in the inserted cluster analysis results according to the single tree growth law along the deviation direction; otherwise, keep the inserted cluster analysis results unchanged. The initial shape of a single tree is optimized based on all processing results.
7. The forestry dead tree identification method based on image recognition according to claim 1, characterized in that, The pre-trained image recognition model includes a basic feature extraction layer, an intermediate feature fusion layer, a multi-scale feature enhancement layer, and a temporal fusion layer.
8. A forestry dead tree identification system based on image recognition, characterized in that, include: The coefficient determination module is used to acquire remote sensing area maps of forestry areas, and to perform coarse analysis and regional division on the remote sensing area maps to obtain several sub-regions, the regional boundary lines of each sub-region, and coarse deadwood coefficients. The frame splitting module is used to set the frame splitting frequency for each sub-region according to the region edge line and the coarse deadwood coefficient, and to split the regional image of the corresponding sub-region according to the frame splitting frequency to obtain several split frames. The dot marking module is used to mark the first dot of the dead tree body in each split frame and mark the second dot of the dead tree roots in each split frame, and to construct the initial shape of a single tree based on the outer edge distribution of the first and second dot markings. The sequence construction module is used to perform cluster analysis on the initial shape of the single tree according to the first threshold in the horizontal direction, the second threshold in the vertical direction, and the direction of the centerline of the outer edge marked by the second point, respectively, to lock the cluster points based on different directions, and to construct the length sequence of the same cluster point in each direction and each cluster point in the other two directions. The morphology optimization module is used to optimize the initial morphology of the single tree based on the length sequence of the same cluster point and the corresponding cluster analysis results, so as to obtain the current morphology of the single tree. The model recognition module is used to input all the current single tree forms of the corresponding sub-region into the pre-trained image recognition model in the order of their positions to obtain the dead tree recognition results of the corresponding sub-region. The order of their positions is from left to right and from top to bottom according to the geographical coordinates of the sub-region.