TLS2trees : A scalable tree segmentation pipeline for TLS data

1. Above-ground biomass (AGB) is an important metric used to quantify the mass of carbon stored in terrestrial ecosystems. For forests, this is routinely estimated at the plot scale (typically 1 ha) using inventory measurements and allometry. In recent years, terrestrial laser scanning (TLS) has appeared as a disruptive technology that can generate a more accurate assessment of tree and plot scale AGB; however, operationalising TLS methods has had to overcome a number of challenges. One such challenge is the segmentation of individual trees from plot level point clouds that are required to estimate woody volume, this is often done manually (e.g. with interactive point cloud editing software) and can be very time consuming. 2. Here we present TLS2trees , an automated processing pipeline and set of Python command line tools that aims to redress this processing bottleneck. TLS2trees consists of existing and new methods and is specifically designed to be horizontally scalable. The processing pipeline is demonstrated on 7.5 ha of TLS data captured across 10 plots of seven forest types; from open savanna to dense tropical rainforest. 3. A total of 10,557 trees are segmented with TLS2trees : these are compared to 1281 manually


| INTRODUC TI ON
Above-ground biomass (AGB) is an important metric that quantifies the amount of carbon stored in terrestrial ecosystems, and as such has been identified as an essential climate variable (ECV).However, accurate quantification of forest AGB is a significant and ongoing challenge owing to a number of factors, including systematic errors when applying allometry to inventory data (Burt et al., 2020).
To improve the accuracy of AGB quantification in forests, groups such as the International Panel on Climate Change (IPCC) and the Committee on Earth Observing Satellites (CEOS) have identified terrestrial laser scanning (TLS) as a disruptive technology (Duncanson et al., 2019;Ogle et al., 2019).
The benefits of TLS based methods are that they are non-destructive, capture tree plasticity particularly of large trees (Burt et al., 2021) and are (mostly) free from errors and assumptions associated with allometric modelling (Chave et al. in Duncanson et al., 2019).When compared to destructive harvest, TLS has been shown to be more accurate than the application of existing allometries, particularly for larger trees that contribute disproportionately to plot-level AGB (Demol, Verbeeck, et al., 2022).However, operationalising a plot-level (i.e.≥1 ha) TLS workflow as a "turn-key" solution to produce an AGB product has yet to be fully realised (Martin-Ducup et al., 2021).
A TLS survey of a forest plot to estimate AGB typically involves: (1) capturing scan data from multiple fixed positions across a plot, (2) co-register scans to produce a single plot-level point cloud P, (3) instance segmentation of P into a set of point clouds that represent individual trees S, (4) semantic segmentation of s ∈ S into wood and leaf point classes, (5) estimate of woody volume for s ∈ S, for example using a Quantitative Structure Model (QSM) approach, and (6) conversion of volume to AGB via an estimate of wood basic density.
Steps 1-2 have been largely been solved with improvements in scanner technology and standardised scanning protocols (Calders et al., 2020;Wilkes et al., 2017).There are also a number of existing methods for semantic segmentation (Vicari et al., 2019;Wang et al., 2020) and QSM generation, where s ∈ S are enclosed in a geometric primitives, for example a set of cylinders (Hackenberg et al., 2015;Raumonen et al., 2013;Stovall et al., 2017).Conversion of volume to mass is an ongoing challenge for all non-destructive methods of AGB estimation as wood density varies greatly within and between trees and geographic regions (Phillips et al., 2019).
Therefore, it is suggested, that from a TLS workflow perspective at least, the most significant remaining challenge to operational plot level AGB estimation is the instance segmentation in step 3, that is P is encoded with geometric information of whole-tree structure, for all trees in the surveyed area regardless of size.If P is of sufficient density and quality then S can be accurately segmented and an unbiased assessment of plot-level AGB, with associated uncertainties, can be produced (Burt et al., 2021;Calders et al., 2015;Momo Takoudjou et al., 2018).Currently, the most accurate method for S ⊂ P is to manually segment individual trees from their neighbours and other vegetation using interactive point cloud editing software (Brede et al., 2022;Disney et al., 2020;Gonzalez de Tanago et al., 2018;Momo Takoudjou et al., 2018).Manually segmenting trees increases tree-and plot-level estimation accuracy by a factor of 10 and 3 respectively, compared to existing automated TLS pipelines (Martin-Ducup et al., 2021).However, manual segmentation can be very time consuming (10's of minutes per tree) as well as sub- Automated whole-tree instance segmentation methods have been previously demonstrated (Burt et al., 2019;Krisanski, Taskhiri, Gonzalez Aracil, Herries, & Turner, 2021;Martin-Ducup et al., 2021;Tao et al., 2015;Wang et al., 2021).Tao et al. (2015) presented a method where a graph is constructed through clustered P, then using a Dijkstra shortest-path method (Dijkstra, 1959) clusters are mapped to a base node resulting in segmented S. They applied their method to TLS data collected in three forest patches and reported high accuracy for number of trees correctly identified and completeness of extracted trees.Subsequent methods have built upon these graph based methods and have been applied in different forest types such as Schelorphyll, coniferous and tropical forests (Martin-Ducup et al., 2021;Wang et al., 2021).Burt et al. (2019) presented a rule constrained clustering with proximity testing to segment trees in a tropical forest plot; this method also requires an allometric assumption of DBH to crown height and extent.The Forest Structure Complexity Tool (FSCT) (Krisanski, Taskhiri, Gonzalez Aracil, Herries, Muneri, et al., 2021) is an endto-end workflow that generates plot level estimates of structure parameters from laser scanning data.FSCTs innovative approach combines deep-learning powered semantic segmentation which is followed by a rule constrained cluster based instance segmentation.These methods have shown promise in demonstration plots, this paper aims to build on these and present a method that is scalable and is applicable across forest types.
There are a number of challenges that can hinder achieving sufficient quality of S ⊂ P with an automated workflow (Demol, Verbeeck, et al., 2022).These include factors attributable to scanning protocol and scanner specification, such as scanner type and optics (Calders et al., 2020;Newnham et al., 2015), sufficient sampling density to minimise occlusion (Wilkes et al., 2017), co-registration accuracy and co-alignment errors (Demol, Wilkes, et al., 2022) and post-processing computational constraints, for example large data volumes (data volumes are typically >65 Gb ha −1 ).Further, automated segmentation also needs to be sensitive to forest demography and composition where trees in a plot can range in size (height, diameter, etc.) over orders of magnitude, neighbouring crowns may intersect, parasite species such as lianas could be present (Moorthy et al., 2019) and understorey vegetation maybe dense.
To address the interoperability and scalability challenges of automated tree segmentation from plot-level point clouds, we present TLS2trees.TLS2trees is a set of Python command line tools that are free and open-source software (FOSS) and are specifically designed to be horizontally scalable (Kissling et al., 2022)

| Data acquisition
The TLS data used here were captured from 10 plots across seven different forest types (Table 1).At each plot, data were acquired with a RIEGL VZ-400 scanner (RIEGL Laser Measurement Systems GmbH, Horn, Austria) where a set of scans I were captured on a regular grid (Kissling et al., 2022) or, for RUSH plots, in a star formation (Calders et al., 2015).At each scan position two scans were acquired where the scanner rotation axis was orientated perpendicular then parallel to the ground surface.Manually-placed reflectors were used as tie points between each scan position to aid co-registration.Postprocessing was done using RiSCAN Pro software (versions 2.1-2.9)where individual scans were co-registered to a common coordinate system on a per plot basis.Once registration was complete, a set of 4 × 4 transformation matrices M were exported for each plot.

| TLS2trees
The TLS2trees software package consists of a set of Python command line tools.TLS2trees can be considered Free and Open Source Software (FOSS) and is licensed under Creative Commons BY 4.0 (https:// creat iveco mmons.org/ licen ses/ by/4.0/ ).Processing is horizontally scalable, that is can be scaled across multiple computing nodes (Kissling et al., 2022) where this is achieved using a tile-based workflow.The workflow is also modular so new or additional methods can be added or existing steps replaced.For more information and code see Wilkes et al. (2023).
This section presents a detailed description of the workflow.As is shown in Figure 1, a coregistered global point cloud P is passed through the TLS2trees pipeline to generate a set of segmented tree point clouds S. The pipeline is presented in three steps: (1) pre-processing (Section 2.2.1), (2) semantic segmentation (Krisanski, Taskhiri, Gonzalez Aracil, Herries, & Turner, 2021) where points are classified into different components (Section 2.2.2), and (3) an instance segmentation where P is segmented to a set of individual trees S (Section 2.2.3).Once S ⊂ P, structure traits, such as total woody volume, are computed via TreeQSM (Section 2.4).Exposed workflow parameters for each step are listed in the Appendix 0. It should be noted that, although data processed for this manuscript was only captured with a RIEGL scanner, the workflow can be adapted to other scanner types, for example Wielgosz et al. (2023).

| Step 1. Preprocessing
The workflow starts at the point of a set of individual scans I and corresponding rotation matrices M; the first step is (I, M) ↦ P.During (I, M) ↦ P, I are clipped to the plot extent determined by M, plus a 10 m buffer (Martin-Ducup et al., 2021).The buffer is required to capture the crowns of trees that have germinated inside the plot but As is inherent with TLS data, objects closer to the scanner are over sampled whereas objects further away (e.g. the top of the canopy, or at the edge of a scanned region) can be undersampled (Burt et al., 2019).To mitigate the impact of this difference and to reduce file size, P is downsampled to a common point density using PDAL's Voxel Center Nearest Neighbour method (PDAL Contributors, 2020) where here a voxel edge length of 0.02 m is used.

| Step 2: Semantic segmentation
Semantic segmentation is the process of labelling points into homogeneous groups; here this is into classes of different biophysical components, for example ground, leaf, wood and so forth.
Previous workflows have classified points simultaneously with or after instance segmentation (Vicari et al., 2019;Wang, 2020;Wang et al., 2020).However, instance segmentation can be hampered by the presence of leaves that reduce gaps between tree crowns, or cause neighbouring crowns to intersect.
Using a pre-trained model, P is classified into 4 classes; ground (G), woody (W), leaf (L) or coarse woody debris (X) (Figure 1b and The semantic segmentation is applied to t + t b ∈ T, b refers to neighbouring tiles used to generate a 5 m buffer that mitigates any edge effect; once the semantic segmentation is complete only the class label for t are retained.It should be noted that the pre-trained model has not been modified since its initial release by Krisanski, Taskhiri, Gonzalez Aracil, Herries, and Turner (2021), that is the model is not trained for forest types specific to Table 1.

| Step 3: Instance segmentation
Instance segmentation is the process of identifying and segment- Here, a new two step process is presented where (1) P W are grouped into a set of individual woody stems S (Figure 3c), then (2) P L are assigned to s ∈ S (Figure 3d).
Both steps use a Dijkstra's shortest path method (Dijkstra, 1959) where a graph G = (N, E) is constructed; N are a set of nodes and (1) c Malhi et al. (2021).
e Graham (2006).or more tree crown envelopes intersect, the shortest path could be to the base of a smaller suppressed tree, resulting in a poor instance segmentation (Figure 3).To solve this, a different approach is taken to compute w.
To define a graph G W for wood classified points P W , a set of nodes of c ∈ C W is used to determine intersection.RANSAC cylinder fitting is then used to identify stem bases from noise such as small branches or misclassified leaves (Burt et al., 2019).It is important to attempt to identify all stems, regardless of diameter, otherwise smaller stems can be erroneously included into larger neighbouring stems; here a lower limit of � = 0.05 m is used for stem detection.
Once the graph G W is generated, the Dijkstra shortest path method is used where multiple source nodes n b can be defined.The output of the shortest path analysis is a disjoint union of undirected acyclic graphs.Then N W ↦ C W and therefore P W can be mapped to a set of individual stems S.
Once step 1 is complete, another graph G L is created that maps leaf classified points P L (and P W that are not attributed to a stem) to To run the instance segmentation, each t ∈ T is buffered by neighbouring tiles (see Table 2 for example buffer size).Once complete, S is pruned so that only trees whose germination point is within t are retained; further, a first-pass filter to remove trees where DBH <0.1 m (as determined by the RANSAC cylinder fitting) is applied.

| Manually segmented trees
A total of 1281 trees have been manually segmented in previous studies (Table 1).Methods for selecting trees to manually segment from P differed for each plot.For RUSH plots, trees were selected by the Victorian State Government to update statewide AGB allometry, where a subset of trees were harvested across a range of sizes and species (Calders et al., 2015;Murphy et al., 2014).For WYT, all trees within a central 1 ha plot were segmented from a larger 6 ha scanned area, this reduces edge effects inherent at other plots.
Individual tree point clouds were also split into >1 tree if bifurcation occurred <1.3 m (Calders et al., 2018).All trees were segmented from NOU where DBH >0.2 m (Burt et al., 2019) and KOG where DBH >0.1 m.For AEP and MLA plots, tree species that comprised 80% of total basal area were selected and a 2-3 trees from each species were segmented (Shenkin et al., 2020).It should be noted no trees have been specifically manually segmented or modified for this manuscript, that is trees were segmented before the inception of this method.
Trees from plots RUSH, MLA, AEP and KOG were manually segmented from the plot-level point cloud using either RiSCAN Pro or CloudCompare v2.X (https:// www.danie lgm.net/ cc/ ).Data from WYT (Calders et al., 2018(Calders et al., , 2022)), NOU (Burt et al., 2019) and CALI (Disney et al., 2020) were first segmented with treeseg (Burt et al., 2019), after which trees were modified manually, for example removing overlapping crowns.During this process all trees were manually verified for commission and omission errors by an experienced operator.
After segmentation, all tree point clouds underwent a semantic segmentation into leaf and wood points using the TLSeparation Python package (Vicari et al., 2019); the exception being WYT where data were captured in leaf-off conditions.Using the wood classified point cloud only, per tree structural traits were then modelled using TreeQSM (see Section 2.4).

| Quantitative structure models
Quantitative Structure Model (QSM) methods enclose the woodonly point clouds in a set of geometric primitives, for example a cylinder.This allows for the estimation of morphological and topological traits such as volume, length and surface area metrics (Raumonen et al., 2013).TreeQSM (version 2.3.1,Raumonen, 2019) is used to generate a QSM for all manually and automatically segmented trees.

F I G U R E 2
A comparison of methods for the construction of graphs through point clouds.Displayed are clusters (vertically orientated) along a stem, adjacent clusters have been exploded so connections between clusters are clearly visible.For the "Euclidean" method, edge weights (values to the right) are calculated as the Euclidean distance between cluster centres; this is synonymous with path length (Tao et al., 2015).For the "Convex hull" method, edge weights are calculated as the distance between the vertices of neighbouring convex hulls (i.e.connectivity).and PatchDiam2Max = 0.15, 0.17, …,0.25 .TreeQSM is run in Octave (Eaton et al., 2020) where, for each parameter set permutation 5 models are generated.This results in a total of 625 models per segmented tree.An optimal model is then selected by minimising the point to cylinder surface distance (Burt et al., 2019;Martin-Ducup et al., 2021).

| Comparing tree pairs
To assess the accuracy of segmentation, a corresponding pair of trees is identified in the manually and TLS2trees segmented sets.
Pairs are identified by firstly taking a slice through all segmented trees between 2 and 3 m and computing the centroid of the slice.
Tree pairs are then matched by selecting a tree from the TLS2trees data set that mostly closely matches the position of a manually segmented tree.Trees where more than one target tree is within 1 m of the reference tree or where a match is >2 m from the reference tree are disregarded from further analysis.
For matched tree pairs, QSM and point cloud metrics are compared.QSM metrics include total woody volume (m 3 ), trunk volume (m 3 ), total branch length (m) and DBH (m).Point cloud metrics include leaf-on crown height (m), leaf-on projected crown area (m 2 ), wood/ leaf point classification ratios and Jaccard Index metrics.The Jaccard Index (Jaccard, 1912) is a measure of spatial concordance; values range from 0%-100% where 0% and 100% indicate no overlap and complete overlap of point clouds accordingly (Brede et al., 2022).
A Weighted Jaccard Index is calculated here by first voxelising the segmented point clouds with an edge length of 0.5 m, a weight w is then assigned to each voxel corresponding to the number of points per voxel.Then for each tree pair the weighted intersection and union of voxel sets is computed using Python's sklearn (Pedregosa et al., 2011) jaccard_index method.
Owing to the unbalance in number of segmented trees per plot, when deriving metrics for all matched pairs, a bootstrap sampling approach is taken where for each iteration a sample of 10 trees per plot is drawn.

| Computing infrastructure and software
Insufficient computing infrastructure can be a bottle neck to processing large geospatial data sets, such as point cloud data.TLS data can generate particularly large data sets for relatively small regions of interest when compared to other laser scanning instruments, for example airborne.Therefore, for a new TLS data processing pipeline to be operationalised it would ideally be capable of being horizontally scaled.
Horizontal scaling is achieved in the semantic and instance segmentation steps of TLS2trees by mapping P to a set of tiles T; then t ∈ T are run independently and in parallel.To process the plots in  Leaf points identified in Panel a using TLSeparation (Vicari et al., 2019).
(see Wilkes et al. (2023) for full list) which are managed with the conda package and environment manager.In addition, the pre-processing step also uses the PDAL library (PDAL Contributors, 2020), semantic segmentation uses PyTorch libraries (version 1; Fey & Lenssen, 2019) and instance segmentation uses Networkx (Hagberg et al., 2008).

| Plot wide segmentation
A total of 10,557 trees were segmented from 10 plots, of which 3908 trees were inside the plot boundary and have a DBH >0.1 m (Table 3).The tallest tree segmented is a 78.9 m dipterocarp from MLA and the largest tree by volume is a 211 m 3 coastal redwood from CALI (CALI-A, Figure 3).Trees from WYT have far longer total branch length where the longest is 8.5 km, this compares to the longest tropical branch length of <2 km.This could be as a result of a trees ontogeny, for example repeated pollarding followed by abandonment, or a systematic method bias where aggressive semantic segmentation misclassifies smaller branches as leaves for evergreen trees.
Estimated segmented stem density ranges from 247 stems ha −1 at the RUSH plots to 761 stems ha −1 at the AEP plot (Table 3). 1) these are ±10% for RUSH, WYT, NOU and MLA; larger discrepancies are evident at AEP (−25%), KOG (+39%).Fujimori (1977) reported a large interval for stem density in CALI-type (coastal redwood) plots as a function of succession; values reported here fall within that range.

Compared to reported stem density values (Table
Figure 4 shows per plot the largest segmented tree point clouds (by total woody volume); for each tree, both wood and leaf points are displayed (and coloured accordingly).The Supplementary Material presents all trees segmented for plots where TreeQSM computed DBH >0.1 m.In general, tree crowns appear complete with only small omission and commission errors evident, for example small twigs/ branches from neighbouring trees.The crowns of large tropical trees (plots MLA and NOU) are well segmented, even capturing the idiosyncrasies of crown morphology, for example tree MLA-Q has broken and repsprouted (top row Figure 4).Along the length of some tree stems there are erroneous leaf points that are either attributable to lianas or crowns of smaller mid and understorey trees (e.g.trees NOU-A and MLA-B in Figure 4).As described in Section 2.2.3, leaf points P L are connected to a stem via branch tips, this would suggest that graph connections have been made to branch points surrounding the stem.It should be noted that P L are not used to model volume.
TreeQSM appears to have overestimated the total volume of a few trees (e.g.trees KOG-B, RUSH-AG, AEP-H, AEP-J and NOU-L in Figure 4).This is a result of TLS2trees derived commission errors where small disconnected woody structures (e.g.shrubs) have inflated the size of cylinders used to estimate volume, particularly at the base.Further, a number of trees in the KOG plot have numerous smaller stems at the base of each tree (see Section 4).TA B L E 2 Processing steps and benchmark times.

| Comparison with manually segmented trees
A total of 1053 segmented trees were successfully paired to a manually segmented tree, this represents a match rate of 82% (Table 4).For the majority of plots a corresponding tree pair is found for >90% of trees and for all plots a pair is found for all segmented trees that constitute the largest 50% of total segmented volume.The lowest rates are observed at WYT: see Section 4 for discussion.
Scatter plots that compare key QSM and point cloud metrics are presented in Figure 5 However, when considering the largest trees that constitute 50% of total woody volume, %RMSE of per-tree woody volume reduces to 60%.
Presented in Figure 6 is a comparison of per plot summed total volume; summed volume from TLS2trees segmented trees were ±10% that of manually segmented trees for all plots.The exception is the RUSH and KOG plots where an 18% and 30% overestimate in total woody volume is evident.
If using an existing allometric equation to estimate tree volume or AGB then other structure metrics are important, for example DBH and tree height.Tree height is estimated with an %RMSE of 27% where the largest errors were at the tall tree sites (MLA and CALI) as well as AEP.For AEP, tree height is underestimated owing to semantic segmentation errors near the base of trees where wood points were classified as leaf, this also impacted estimates of DBH.Crown area is consistently overestimated by TLS2trees segmented trees with a bias of 20 m 2 .DBH is also overestimated by TLS2trees segmented trees with a bias of 0.04 m and an %RMSE of 100%, this reduced to <40% when considering the cohort of largest trees.Inflation of crown area and DBH by TLS2trees segmented trees are attributed to outlier points that increase projected area; it is suggested that a method to filter outlier points could improve results.
Segmented tree pair similarity is tested using the Jaccard Index (see Section 2.5).Mean Jaccard Index results for all trees is 75%; this indicates that a pair of trees shared 75% of the voxel space (weighted by point density; Table 4).Differences were predominantly caused by the foliage around stems (e.g.top row Figure 4).Considering all points, a Jaccard Index of >90% is evident at 3 the least densely stocked plots the sites.Jaccard index values increase for all plots when considering only the largest trees that comprise 50% of total woody volume and are generally greater than 75% (except CALI plots; Table 4).Trees at AEP performed poorly when considering Jaccard Index values, with a median score of 13% increasing to 75% when considering the 7 largest trees; it is suggested this is again due to a poor semantic segmentation.TA B L E 3 Summary of TLS2trees segmented trees, only trees that are within the plot boundary and DBH Considering wood and leaf point voxel occupancy (Table 4), the Jaccard Index values were lower than for all-points values.
This indicates that there is a mismatch between wood/leaf point segmentation methods.For example, at MLA 67% of points were classified as leaf using TLSeparation whereas 91% of points were classified as leaf using the deep-learning segmentation (Table 4).This also impacts total branch length (Figure 5e) where TLS2trees significantly underestimates length compared to manually segmented trees.

| DISCUSS ION
TLS methods are capable of generating accurate estimates of tree and forest AGB.Operationalising TLS workflows could therefore have implications for activities including National Forest Inventories (NFI) (Liang et al., 2018); measurement, reporting and verification (MRV) protocols; benchmarks; and reference datasets for AGB focused satellite missions (e.g.BIOMASS and GEDI; Chave et al., 2019) and new or updating allometry (Disney et al., 2020;Stovall et al., 2017).However, achieving operationalisation of TLS methods has proved challenging for a number of reasons.In particular, and the focus of this work, is the labour-intensive and time-consuming effort to accurately segment individual trees from plot-level point clouds which have caused a significant processing bottleneck.To address this issue, here we have presented TLS2trees, a FOSS and horizontally scalable Python-based pipeline for segmenting individual trees from plot-scale TLS point clouds.
Manually segmenting trees from plot-level point clouds is currently regarded as the most accurate method, and it is suggested The largest trees (by volume) segmented using TLS2trees for different forest types.Points are coloured leaf or wood components as classified during the semantic segmentation step.that this is unlikely to change.However, such approaches are not reproducible and lack the traceability or transparency that would be required for carbon accounting and reporting programmes.
Manual segmentation is also not scalable, where, along with issues of subjectivity, operator fatigue may degrade results.An automated approach, such as TLS2trees, aims to address these issues of reproducibility, subjectivity and scalability.However, routinely segmenting many hundreds of trees per hectare presents additional challenges, for example, quality assurance (QA).As seen here, different forest types present different challenges in terms of generating an accurate result and therefore an application focused QA strategy is suggested.For example, if the metric of interest is AGB, a strategy of sampling the largest trees, that disproportionately contribute to plot level AGB, as well as a subset of smaller trees across the AGB range should identify systematic issues.
TLS2trees performs well across a range of forest types, from open savanna (KOG) to tall tropical rainforest (MLA), the workflow also performs well within plots segmenting trees across a range of sizes (Table 3).This is despite the fact the semantic segmentation base model is only trained on a small area of Australian and New Zealand forest (Krisanski, Taskhiri, Gonzalez Aracil, Herries, & Turner, 2021) and TLS2trees model parameters were not adjusted for forest type (Appendix 0).Retraining the semantic segmentation model to be forest type or sensor specific has yielded improved results (Wielgosz et al., 2023); however, we suggest that using the FSCT base model is sufficient for a first pass.We would also like to stress that TLS2trees is a work in progress and there are a number of aspects of TLS2trees that could be improved.We hope this can be achieved through a user community (e.g.see Wielgosz et al., 2023) and have made the source code open-source to facilitate this.
The success of each step presented in Figure 3 depends on the success of the previous step.For example, as seen at the AEP plot, misclassification of wood points as leaf points around the base of trees caused errors in the instance segmentation.Similarly, QSM methods such as TreeQSM require a "clean" point cloud with minimal noise (Raumonen et al., 2013) and this is not always achieved, for example inclusion of small neighbouring stems leads to volume inflation.Model parameterisation will be forest type and scanner specific, for example, the height at which --find-stems-boundary (Appendix 0) is taken will differ depending on tree height and height and density of the understorey.It is therefore suggested that improved results can be achieved through an optimisation (Wielgosz et al., 2023) or heuristic approach where model parameters are tested on individual tiles before scaling up.Another approach could be to test different parameterisation in a simulated forest, for example a comparison of semantic segmentation methods (Morel et al., 2020).
One particular aspect where TLS2trees performed poorly is with the segmentation of smaller trees.Example errors include commission errors where multiple stems are grouped into a single tree or omission errors where smaller stems are missed.Again, a different parameterisation of TLS2trees may improve performance.An example is presented in Figure 7 where a change in TA B L E 4 Matched tree pair point clouds comparison between manually and TLS2trees (T2t) segmented trees.--maximum-cumulative-gap reduces the number of erroneous stems at the base of the tree; however, if the parameters is reduced too far then portions of the crown are removed.Instrument limitations should also to considered when resolving smaller features, where laser beam and scanning characteristics can limit capability (Demol, Wilkes, et al., 2022).An example of the impact of the smallest trees is evident at WYT where total volume %RMSE is 2000% when compared to manually segmented trees.However, if considering only the largest trees that contributed 90% and 50% to total volume, %RMSE reduced to 50% and 25% respectively.
Further, matching pairs of trees was a challenge at WYT where coppiced stools that forked below 1.3 m were often regarded as a single tree by TLS2trees; whereas they were manually extracted as individuals by Calders et al. (2018).A suggested solution to improving instance segmentation for small, forked trees is to perform a further instance segmentation based upon topological information derived Considering the scalability of TLS2trees there may be a number of options for improving code and routine efficiency.For example, a 10 m x 10 m processing unit (see Section 2.2.1) was chosen to allow high compute parallelisation of 1 ha plots; however, this may not be optimal for all forest types and processing architectures.Further, a high tile edge length to area ratio increases the likelihood of duplicate segmented trees.Other options for improved efficiency include larger vertical slice (and therefore reduced number of clusters) in the instance segmentation step (see Section 2.2.3) may improve compute times.Here, TLS2trees was run on a state-of-the-art computing facility that may not be available to all groups.An alternative option would be to run on a commercially available cloud computing service (e.g.Amazon Web Service or Microsoft Azure), to facilitate this we have provided a containerised version of TLS2trees.
Lastly, although the name TLS2trees implies the workflow is limited to the processing of just TLS data, we suggest that the framework presented here could be applied to other laser scanning modes.
The horizontal scalability functionality, built in to TLS2trees, is well suited to the large area acquisitions possible with airborne platforms.

| CON CLUS ION
There is an estimated 260 ha of plot-level TLS data collected from jective and difficult to reproduce or validate.These factors have limited the number (and provenance) of segmented trees, where total DBH ≤10 cm; a number of reasons are suggested including performance of semantic segmentation step.4. The volume and scale of TLS data captured in forest plots is increasing.It is suggested that to fully utilise this data for activities such as monitoring, reporting and verification or as reference data for satellite missions an automated processing pipeline, such as TLS2trees, is required.To facilitate improvements to TLS2trees, as well as modification for other laser scanning modes (e.g.mobile and UAV laser scanning), TLS2trees is a free and open-source software.K E Y W O R D S above-ground biomass, Forest, FOSS, segmentation, terrestrial laser scanning 2041210x, 0, Downloaded from https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.14233by University College London UCL Library Services, Wiley Online Library on [25/10/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons Licensesegmented trees is limited to 10's (and only in rare cases 100's) of trees per hectare.

2041210x, 0 ,
Downloaded from https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.14233by University College London UCL Library Services, Wiley Online Library on [25/10/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License where the crown overhangs the plot boundary.P is then projected onto a 10 m × 10 m grid to produce a set of tiled point clouds T where individuals tiles t ∈ T are the processing unit for subsequent steps.A tile index of T is also generated to map the spatial location of neighbouring tiles.

2041210x, 0 ,
Downloaded from https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.14233by University College London UCL Library Services, Wiley Online Library on [25/10/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License E are a set of edges that connect N. A path p can be defined that connects two nodes n, n k ∈ N, where p = n, n 1 , n 2 , … n k ; for each n, n k pair there are multiple solutions to p.To determine the shortest path between the pair n, n k a weight function w: E → ℝ is defined (Equation 2; Tao et al., 2015).Previous methods have constructed graphs where N is a set of vertices in ℝ 3 and w are the Euclidean distances between N(Brede et al., 2022;Tao et al., 2015;Vicari et al., 2019;Wang et al., 2021).Therefore the shortest path min w(p): n → n k is analogue to a vascular system(Tao et al., 2015; Figure 2 left).However, experimentation found that if one N W are first generated.To do this, P W is sliced horizontally (relative to ground normalised height calculated from P G ) at intervals of 0.2 m; slicing is required to regularise the distance between clusters.Then for each slice,DBSCAN (Ester et al., 1996)  is used to map P W to a set of clusters C W (Figure2).DBSCAN parameters are dependent on acquisition and point cloud characteristics; after downsampling an eps value of 0.1 m and minimum _ sample of 20 points are used here.For each cluster c ∈ C W , a convex hull is computed generating a set of hull vertices V W where V W ⊂ C W ⊂ P W (Figure 2 right).A convex hull retains information on the occupation of space and proximity to neighbouring clusters, whereas collapsing a cluster to a single vertex does not.A k-nearest neighbour search is then performed on V W to identify vertices in neighbouring clusters; within cluster connections are disregarded.The Euclidean distance where min dist V W cx , V W cy is used as the edge weight function w (Figure 2 right).w(p) is therefore determined by distance between cluster edges (i.e.connectivity) as opposed to distance between cluster centroids (i.e.path length).A parameter is available to set allowable maximum distance between V W cx and V W cy (Appendix 0).Dijkstra shortest path analysis requires a subset of source nodes n b ⊂ N W from which to calculate distance from.Here n b are generated by taking a slice through C W z 1 , z 2 ; z 1 and z 2 are upper and lower bounds of the slice relative to ground height and the median height(2) w(p) = k ∑ i=1 w n i−1 , n i F I G U R E 1 TLS2trees applied to a 70 m × 20 m strip of forest in plot RUSH where (a) P is coloured by calibrated reflectance, (b) semantic segmentation into four classes using a method adopted from FSCT Wielgosz et al. (2023), (c) instance segmentation where only points classified as wood are displayed and segmented trees are coloured randomly and (d) instance segmentation where leaf points are attributed to individual stems.
N L are computed by first mapping P L to a set of voxels C L with an edge length of 0.5 m; C L is equivalent to the clusters C W above.A set of 6 vertices are generated for c ∈ C L where a vertex is assigned to the centroid of each voxel facet; this results in V L which are equivalent to V W above. E L and corresponding w are determined by calculating the Euclidean distances to neighbouring v ∈ V L .A set of source nodes n b ⊂ N W are taken from G W where n ∈ N W have no children, that is n is a branch tip; n b are already associated with s ∈ S. Shortest path analysis is again used to connect N L with n b and therefore assign P L to s ∈ S.

2041210x, 0 ,
Downloaded from https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.14233by University College London UCL Library Services, Wiley Online Library on [25/10/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License Since the version of TreeQSM and iterated parameter space may differ from previously published versions, it should be noted that modelled values for manually segmented trees may also differ.A set of TreeQSM parameters control the overall fit of cylinders, following Raumonen et al. (2013) three parameters are iterated over here; PatchDiam1 = 0.20, 0.22, … , 0.3 , PatchDiam2Min = 0.5, 0.7, … , 0.15 Acquisition and Analysis Service (NEODAAS) MAssive GPU for Earth Observation (MAGEO) cluster were used.The JASMIN facility (https:// jasmin.ac.uk/ ) is designed for data intensive computing and comprises a large volume of storage combined with general purpose batch computing capability.The MAGEO cluster (https:// www.neoda as.ac.uk/ ) is a specialised system designed for earth observation data and comprises 40 GPUs, 200 GPU cores and 0.5 PB of fast storage.Data processing requirements and times for a subset of plots are presented in Table 2.All steps use Python as a base programming language, this includes common scientific libraries such as Numpy, Scipy and Pandas F I G U R E 3 A tree segmented using (a) manual segmentation by Calders et al. (2015) (b) segmented using the convex hull method of TLS2trees and (c) segmented using a Euclidean distance method.Grey boxes A and B highlight branches that have been wrongly attributed to Trees 2 and 3, respectively [black points in (c)].Trees 2 and 3 (c) can be seen at the base of the manually segmented tree [(grey points in (a)].

.
TLS2trees derived point clouds result in TreeQSM total woody volume estimates (a precursor for estimating AGB) with a per plot bias of ±0.4 m 3 and RMSE of 0.5-3 m 3 .The exception being CALI where total woody volume bias and RMSE are −1.4 and 16.7 m 3 (%RMSE = 70%) respectively.Segmentation of smaller trees by TLS2trees is less accurate, this results in a TreeQSM derived per tree total woody volume %RMSE of >1000%.
>0.1 m are considered.99th percentile is used to remove outliers.Downloaded from https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.14233by University College London UCL Library Services, Wiley Online Library on [25/10/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License

F
I G U R E 5 A comparison of manually and TLS2trees segmented tree pairs for metrics (a) tree height, (b) crown area, (c) total volume, (d) trunk volume, (e) total branch length and (f) DBH.Smaller panels are zoomed into the lower 50th percentile of tree pairs.The "boostrap" line represents a mean regression line for all plots, the grey shaded area is a 99% confidence interval for the regression.2041210x, 0, Downloaded from https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.14233by University College London UCL Library Services, Wiley Online Library on [25/10/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License from the QSM.The output from TLS2trees is a point cloud file for each individually segmented tree; therefore any tree can be manually edited using software such as CloudCompare (https:// www.danie lgm.net/ cc/ ).
forests across the globe (pers.comm.Dr. Atticus Stovall, NASA, 22nd November 2022); processing this data archive could yield upwards of 260,000 individuals trees.The biophysical and ecological insight that could be drawn from this data, including and beyond the estimation of AGB, could be significant.Further, there are a number of other potential uses for this data, including accurate 3D representations of forest plots in radiative transfer Calders et al. (2018) or other large area modelling approaches.However, much of this data remains unprocessed (to individual tree level) owing to instance segmentation bottlenecks, a problem we suggest is one of the remaining hurdles to operationalising TLS protocols.Here we have presented TLS2trees, a workflow F I G U R E 6 A comparison of per plot summed woody volume for manually and TLS2trees segmented trees.F I G U R E 7 An example of different outcomes when altering model parameters.The parameter --maximum-cumulative-gap alters the maximum cumulative gap between node and a base node.In this example, a low value segments the base well but removes smaller branches at the top of the canopy whereas a higher value results in small stems around the base being included.The value used for this manuscript is --maximum-cumulative-gap = 2 m.

2041210x, 0 ,
Downloaded from https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.14233by University College London UCL Library Services, Wiley Online Library on [25/10/2023].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License and processing pipeline to segment point clouds of individual trees from plot-level TLS point clouds, that we hope will begin to redress this issue.

Table 1 ,
the UK's Natural Environment Research Council's (NERC) JASMIN computing facility and the NERC Earth Observation Data