Skip to main content

ORIGINAL RESEARCH article

Front. Plant Sci., 08 January 2024
Sec. Technical Advances in Plant Science

Tree ring segmentation using UNEt TRansformer neural network on stained microsections for quantitative wood anatomy

Miguel García-Hidalgo*Miguel García-Hidalgo1*ngel García-Pedrero,Ángel García-Pedrero2,3Vicente RozasVicente Rozas1Gabriel Sangüesa-BarredaGabriel Sangüesa-Barreda1Ana I. García-CervignAna I. García-Cervigón4Giulia Resente,Giulia Resente5,6Martin WilmkingMartin Wilmking5Jos Miguel OlanoJosé Miguel Olano1
  • 1iuFOR, EiFAB, Universidad de Valladolid, Soria, Spain
  • 2Department of Computer Architecture and Technology, Universidad Politécnica de Madrid, Madrid, Spain
  • 3Center for Biomedical Technology, Universidad Politécnica de Madrid, Madrid, Spain
  • 4Biodiversity and Conservation Area, Universidad Rey Juan Carlos, Móstoles, Spain
  • 5Institute of Botany and Landscape Ecology, University Greifswald, Greifswald, Germany
  • 6Department DISAFA, University of Torino, Torino, Italy

Forests are critical in the terrestrial carbon cycle, and the knowledge of their response to ongoing climate change will be crucial for determining future carbon fluxes and climate trajectories. In areas with contrasting seasons, trees form discrete annual rings that can be assigned to calendar years, allowing to extract valuable information about how trees respond to the environment. The anatomical structure of wood provides highly-resolved information about the reaction and adaptation of trees to climate. Quantitative wood anatomy helps to retrieve this information by measuring wood at the cellular level using high-resolution images of wood micro-sections. However, whereas large advances have been made in identifying cellular structures, obtaining meaningful cellular information is still hampered by the correct annual tree ring delimitation on the images. This is a time-consuming task that requires experienced operators to manually delimit ring boundaries. Classic methods of automatic segmentation based on pixel values are being replaced by new approaches using neural networks which are capable of distinguishing structures, even when demarcations require a high level of expertise. Although neural networks have been used for tree ring segmentation on macroscopic images of wood, the complexity of cell patterns in stained microsections of broadleaved species requires adaptive models to accurately accomplish this task. We present an automatic tree ring boundary delineation using neural networks on stained cross-sectional microsection images from beech cores. We trained a UNETR, a combined neural network of UNET and the attention mechanisms of Visual Transformers, to automatically segment annual ring boundaries. Its accuracy was evaluated considering discrepancies with manual segmentation and the consequences of disparity for the goals of quantitative wood anatomy analyses. In most cases (91.8%), automatic segmentation matched or improved manual segmentation, and the rate of vessels assignment to annual rings was similar between the two categories, even when manual segmentation was considered better. The application of convolutional neural networks-based models outperforms human operator segmentations when confronting ring boundary delimitation using specific parameters for quantitative wood anatomy analysis. Current advances on segmentation models may reduce the cost of massive and accurate data collection for quantitative wood anatomy.

1 Introduction

Forests are critical to terrestrial carbon fluxes and play a crucial role in the future evolution of atmospheric carbon dioxide concentration (Pan et al., 2011; Cabon et al., 2022). Therefore, it is of key importance to understand the responses of trees to environmental conditions for predicting their behavior in future climate scenarios (Seidl et al., 2017). Fortunately, forests can contribute to decipher these questions through the information stored in wood (Olano et al., 2021; Martinez del Castillo et al., 2022). Xylem anatomical adjustments to climate conditions at different time scales (García-Cervigón et al., 2020; Olano et al., 2022) provide basic information to understand the response of trees to climate change and its interaction with intrinsic processes (Piermattei et al., 2020). Tree xylem constitutes a temporal record of individual tree growth and provides a set of characteristics that store information on how environmental factors influenced wood formation. Therefore, studies of time-resolved information stored in annual tree rings have become a powerful tool to predict the impact of global change on terrestrial ecosystems (Wilmking et al., 2020; Sangüesa-Barreda et al., 2021).

The study of tree ring formation using dendrochronology involves a number of techniques to extract the information stored in the wood (Schweingruber, 1996). Recent technical advances in dendrochronological studies have improved data collection and processing using a wide range of tools, ranging from the traditional macroscopic to microscopic perspectives (von Arx et al., 2016; Garcia-Hidalgo et al., 2022). Initially, tree ring studies focused on observing wood samples using a stereoscopic set to determine total ring width and eventually early and latewood measurements, when this annual subdivision could be established, resulting in annually resolved time series of tree growth investment (Schweingruber et al., 2005). Advancements in microsectioning and wood staining along with the recent development of high-resolution digitization tools have facilitated the integration of the microscopic world into the digital realm. This has opened up new avenues of research that concentrate on identifying and quantifying xylem cells at the intraannual level, presenting a plethora of possibilities and research objectives (Fonti et al., 2010; Olano et al., 2013). The term quantitative wood anatomy (QWA) was coined to describe this approach, which gathers comprehensive data on xylem anatomy and provides exciting opportunities to explore intraannual variation and analyze xylem functional properties.

Specifically, QWA provides effective information from measurable features of conductive xylem vessels (e.g., lumen area, cell wall dimension, cell pattern), but also from other wood cells (parenchyma, fibers, resin ducts, etc.), and related properties (e.g., density fluctuations) (Anadon-Rosell et al., 2018; Arzac et al., 2018). By means of these anatomical features, QWA produces precise and valuable measurements, expanding dendrochronology to a deeper knowledge of functional tree traits, such as tree physiology or ecophysiology (Cuny et al., 2012; Pérez-de-Lis et al., 2022). Furthermore, these traits can be transformed into functional features (Hérault et al., 2011; Borghetti et al., 2020). As a time-resolved data, the precise assignment of tree growth to calendar years constrains the use of QWA. However, as secondary tree growth occurs sequentially, annual rings can usually be identified by the cessation of growth when a limiting season occurs. When rings are properly identified and dated, each measured wood feature can be related to extrinsic sources of time-resolved data (e.g, climatic features, environmental disturbances, water availability) (Takahashi et al., 2005; Zhang et al., 2021; Anderson-Teixeira et al., 2022).

Anatomical features in wood are currently studied using digital images obtained from wood-stained microsections according to standardized protocols (von Arx et al., 2016; Prislan et al., 2022). Software advances at QWA analyses allow the transition from measuring individual cell traits to semi-automated identification and quantification of large numbers of cells (e.g., 20, 600 xylem vessels in just one core), increasing the validity of the data obtained. Furthermore, some of the available software offers automatic ring boundary detection (Resente et al. in prep., von Arx & Carrer, 2014), but there is still ample room for improvement in this task. Currently, most implementations of automatic ring boundary segmentation compute the variation in pixel value through a selected path across the sample image and find the points that exceed an arbitrary threshold. This approach has been widely used for macroscopic wood samples (e.g., increment cores or wood slides) with satisfactory results (Fabijanska et al., 2017; Kim et al., 2023). However, these techniques are less accurate for wood microsections, and in most cases, thorough expert supervision is required. In fact, the low reliability associated with automatic segmentation forces most experts to segment ring boundaries from scratch due to time-consuming amendments.

The recent development of novel hardware (e.g., Graphic Processing Units, GPUs) facilitates the high computational tasks required for image segmentation and high-resolution image analysis, leading to remarkable applications for dendrochronological samples. Out of the wide range of techniques, convolutional neural networks (CNNs) are widely used for image segmentation and achieve remarkable results in different fields (Sultana et al., 2020; Singh et al., 2022). CNNs not only consider the individual pixel value, but also pixel positions and their relationships with the surrounding pixels. Thus, CNNs extract complex information throughout sequential processes (e.g., convolutions, pooling), allowing complex and more abstract information to segment images (Sultana et al., 2020).

CNNs methods accomplish a remarkable ring boundary detection rate for macroscopic samples (Fabijanska & Danek, 2018). Further developments in annual ring recognition and model validation for dendrochronological samples were recently addressed considering ring boundaries as polygons instead of polylines (Poláček et al., 2023) or tree rings as instance segmentations (Gillert et al., 2023). Although these approaches have yielded remarkable results in automated ring boundary segmentation for dendrochronological samples, QWA focuses on cellular and anatomical characteristics of tree rings and requires specific segmentation models and robust methods for model evaluation. Consequently, due to the large differences between diverse kinds of wood, specific models should take into account cell pattern characteristics to achieve high ring segmentation accuracy. Considering QWA purposes, ring boundary evaluation should follow specific criteria according to the image properties at microscopic scales, where discrepancies in segmentation could affect the general methods for segmentation evaluation.

To circumvent these limitations, we suggest investigating the opportunity of supervised learning methods in identifying ring boundaries in microsections of stained wood. However, CNNs have limited ability to capture global relationships between different image regions, as their operations are mainly local and translation-invariant. Recently, Visual Transformers addressed this limitation by introducing the transformer architecture into the visual domain (Khan et al., 2022). These transformers use self-attention mechanisms to capture long-range dependencies between elements in an image, and effectively model the global relationships (Lin et al., 2022).

To fill this gap in QWA, we aim to generate a neural network model (NN) for automatic ring boundary delimitation on stained microsections of wood using attention mechanisms to improve segmentation accuracy, and evaluate whether the validity of NN-based delineations for QWA analyses correspond with manually created delineations. Such an approach would significantly reduce the effort to obtain QWA data.

2 Materials and methods

European beech (Fagus sylvatica L.) is a deciduous tree species widespread throughout Europe, which represents the broadleaved tree with the highest economic importance for European forestry (Geßler et al., 2007). This species has attracted much interest in dendrochronological studies, including QWA (Sánchez de Dios et al., 2021; Zimmermann et al., 2021) due to the vast distribution range, its economical relevance (forestry) and the dieback that has recently affected this species. Rings usually show a semi-ring-porous vessel distribution i.e. the decreasing lumen diameter in xylem vessels across the annual ring, with distinct rings identifiable by a band of narrower fibers in this species (Figure 1).

Figure 1
www.frontiersin.org

Figure 1 Stained cross microsections from beech (Fagus sylvatica) wood cores. 4x image with three full tree rings (left) and 40x detail image with ring limit in yellow (right).

We developed a UNETR model trained using a collection of 214 transverse microsections of tree cores taken at different climate conditions and elevations derived from previous research (Olano et al., 2022). These microsections were stained with safranin and Alcian blue according to the standard procedures (Garcia-Pedrero et al., 2018) and digitized as RGB images using a Nikon D90 digital camera on a Nikon Eclipse 50i optical microscope at 40x magnification, resulting in a resolution of 1.63 µm per pixel. Individual images were stitched using PTGUI v8.3.10 Pro (New House Internet Services B.V., Rotterdam, The Netherlands).

Two different operators manually delineated ring boundaries on 214 digitized samples using ROXAS software in accordance with the general standards and guidelines for QWA (von Arx et al., 2016).

2.1 Data preprocessing

To feed the models, we cropped the images into 256 x 256 pixels, hereafter referred to as data patches. Data augmentation techniques were performed over these patches during training to increase data variability. These procedures included horizontal flipping operations (left-to-right flipping) and rotation with −20° and 20° angles. Furthermore, the patches were randomly blurred with a maximum and a minimum Gaussian kernel size of 3 and 10, respectively. Finally, each data patch was normalized in the range [0, 1]. Data augmentation was performed using the Albumentations library (Buslaev et al., 2020).

Finally, the delimited ring boundaries were binarized to obtain masks where the number 1 corresponded to the pixels belonging to the ring boundary and 0 to the pixels of the background. These masks were subjected to the same processes as the data patches, except for normalization, so that the lines matched the rings. Preprocessing steps are illustrated at Figure 2.

Figure 2
www.frontiersin.org

Figure 2 Data preprocessing sequential steps. After cropping the image into N patches of 256x256 pixels, data augmentation consisted of +20° and -20° patch rotation, and blurring using maximum and minimum kernel size of 3 and 10, respectively. The sample image was then normalized in the range [0,1] to train the model associated to the corresponding mask.

2.2 NN model

To distinguish whether a pixel belongs to the ring boundary or to the background, we considered the UNEt TRansformer (UNETR) semantic segmentation model (Hatamizadeh et al., 2022), which is a state-of-the-art neural network for semantic segmentation. Semantic segmentation assigns a class label (i.e., belonging to ring boundary or not) to each pixel and allows the detection of different regions in an image, in our case ring boundaries. UNETR combines the well-known UNET network (Ronneberger et al., 2015) with Visual Transformers (ViT) (preprint Dosovitskiy et al., 2020) (Figure 3). ViT outperforms the state-of-the-art CNNs in terms of accuracy and computational efficiency. It uses mechanisms of attention by differentially weighting the importance of each part of the image independently. Considering the small number of pixels belonging to ring border in the complete image of the sample, this self-attention mechanisms should be useful for tree ring boundary. Transformers consist of multiple layers of self-attention. The ViT self-attention layer (Vaswani et al., 2017) allows global embedding of information throughout the image. ViT divides an image into fixed-size patches, linearly embeds each of them, and adds position embedding as input to the Transformer Encoder. In this way, the model learns the training data to encode the relative position of the image patches and to reconstruct the full image structure.

Figure 3
www.frontiersin.org

Figure 3 UNETR architecture. Modified from (Ronneberger et al., 2015). The yellow block represents a 3x3 convolution layer, followed by a batch normalization and a ReLU layers. Green Block represents a 2x2 deconvolution layer, blue block represents a 2x2 deconvolution layer, followed by a 3x3 convolution, a batch normalization and a ReLU layers. Finally, the gray block represents a 1x1 convolution.

The transform encoder included three layers:

1. Multi-head Self-attention Layer: This layer linearly concatenates all attentional outputs into the appropriate dimensions. The numerous attention heads help to train the local and global dependencies of an image.

2. Multilayer Perceptron Layer (MLP): It contains two layers of neurons with a Gaussian error linear unit (GELU) (preprint by Hendrycks & Gimpel, 2016).

3. Norm Layer: It is added before each block as it contains no new dependencies between the training images. This helps to improve training time and overall performance.

In UNETR (Figure 3), input data is divided into a sequence of uniform, nonoverlapping patches and projected into an embedding space, using a linear layer, and projected into an embedding space by means of a linear layer. The sequence is then added with a positional embedding and used as input to a transformer model. The encoded representations of the different layers of the transformer are extracted and merged with a decoder through hopping connections to predict the final segmentation. The output sizes are given for a patch resolution P = 16 (for a total of 256 patches) and an embedding size K = 768.

To train the neural model, we used Focal Tversky Loss (Abraham & Khan, 2019) as the loss function given as follows:

(Y,Y^)=(1iyiyi^iyiyi^+αiyi(1yi^)+βi(1yi)yi^+ϵ)γ

where yi ∈ Y and ŷi ∈ Ŷ denote the ground truth and the predicted image of the ith pixels for the class C (c ∈ {ring, no ring}) respectively, α and β are the penalty parameters, and ϵ is a smoothing factor used to avoid zero division error. In this work, the following values were used: α = 0.7, β = 0.3, γ = 0.75, and ϵ = 1e−12. The network was trained over 25 epochs, cycles in which the complete training dataset was seen by the network.

2.3 Post-processing

Each high-resolution image was split into N small sub-images, each of the same size than a data patch, Figure 4. The sub-images were created using an overlap-tile strategy to an extent of 90% (Ma et al., 2018). To improve the detection of ring boundaries, a test-time-augmentation (TTA) strategy was applied (Gonzalo-Martín et al., 2021). Geometric transformations belonging to the dihedral group of order 4 were used as TTA augmentations, yielding eight different versions of the same sub-image. The probability that a pixel belongs to a ring boundary is found by computing the maximum response of the eight values that correspond to the location of the same pixel. This value is normalized to be in the range [0,1]. A pixel is considered to belong to a ring boundary if it exceeds a threshold of 0.2 (estimated experimentally).

Figure 4
www.frontiersin.org

Figure 4 Postprocessing procedures. Images were split into 256x256 pixel patches. Test Time Augmentation (Gonzalo-Martín et al., 2021) was then applied for each patch using an order 4 dihedral group before image normalization [0,1]. Pixels with P > 0.2 on each set of images were considered as boundary. The output segmentation was skeletonized to obtain thin boundaries.

Since prediction networks tend to draw thicker ring boundaries than manually drawn ones, a skeletonization process was performed. This process reduces binary objects to 1-pixel wide representations, providing more appropriate lines for ring boundary delineation (Zhang & Suen, 1984). Because skeletonization generally produces noisy or redundant branches (spurs), a pruning process was performed using the Discrete Skeleton Evolution (DSE) model to preserve only the “trunk” lines with much information (Bai & Latecki, 2007). DSE iteratively eliminates the last branches of the skeleton with less relevance according to their contribution to the shape reconstruction. In this work, branches with an area smaller than 100 pixels were removed. All experiments were performed using an NVIDIA RTX3090 GPU with 10,496 CUDA cores and 24 GB of memory.

2.4 Evaluation

To evaluate the results obtained by the segmentation model, a 3-fold cross-validation was performed. In this prospective evaluation, we selected 39 images with both objective and specialist-based analysis of ring boundary delineation. We analyzed 13 images from each fold, including varied parts of the tree trunk from pith to bark and varied lighting.

Ring boundary are linear paths of 1.63 µm width (1 pixel) delimiting tree rings of 1 110 ± 780 µm width. Thus, pixel by pixel, the discrepancies between the linear paths of ring delimitations severely degrade the results. For example, two complete, equally segmented lines 1 pixel apart result in a 0% match, although the range of error with manual segmentation is commonly larger and practical results for QWA would be equivalent. To enhance the accuracy of the validation method, we compared each ring boundary derived from manually segmented images with those segmented by the NN model according to four criteria (Figure 5). (1) We compared pixel coincidence between tree ring boundaries at the pixel level, according to standard image segmentation assessment methods. In a second step, (2) we calculated the mean position of each segmentation for each ring boundary and calculated their spacing. (3) We counted the number of mismatched vessels depending on the ring bordering strategy. Finally, (4) we counted with an expert on QWA to assess which of the ring delimitations performed better according to the ring growth with a trinomial criterion: 0 = better performance of manual delimitation, 1 = no differences, 2 = better performance of NN model delimitation.

Figure 5
www.frontiersin.org

Figure 5 Images of European beech (Fagus sylvatica) cross microsections with ring delineations using manual (green) and model (yellow) approaches. Right: Detailed image showing mean ring center (cross), distance between mean ring centers (stripped segment), and vessel with mismatched center (light yellow area with black contour).

3 Results

Two different operators manually segmented 5,928 ring boundaries on 214 images used to train and test the model. The test set correspond to 1,329 ring segmentations from 39 randomly selected images, with an image width of 1,468 ± 13.74 pixels (mean ± SE), and a mean height of 23,975 ± 48.61 pixels.

The comparison between segmented boundaries, considering pixel value match, revealed extremely low results (< 1%) as expected. However, the overall mean ring boundary position distance between manual and artificial segmentation was 35.85 ± 3.93 pixels, equivalent to 58.43 ± 6.4 μm. Such a small difference was reflected in the small discrepancy in vessel attribution between delimitation methods, with a mean discrepancy in vessel assignment between models of about a vessel per ring (1.18 ± 0.07 vessels). Expert assessment of the results revealed a solid performance of the NN prediction (Table 1), which was better than manual segmentation in 601 (45.22%) cases. In fact, manual segmentation improved the NN in only 108 (8.1%) of the ring delineations. Furthermore, the NN was able to segment 31 borders that were not manually segmented, while failing to detect 16 rings that were segmented by the operators.

Table 1
www.frontiersin.org

Table 1 Results of the analysis of discrepancies between segmentations according to expert classification of the best segmentation.

Discrepancy between the mean ring boundary centers was higher (41.8 ± 7.02) when the segmentations were considered similar by the expert. Meanwhile, ring boundary center difference was 34.97 ± 8.76 pixels when manual delimitation was considered better, and 21.89 ± 1.54 pixels when NN model was judged superior. The largest vessel mismatch between segmentations occurred when the NN model prediction was considered better. In these cases, the trained model included 1.9 ± 0.13 more vessels than manual segmentation. On the other hand, there was less than one vessel mismatch (0.97 ± 0.17) when manual segmentation was considered better.

A separate analysis by folds confirmed the best performance of the NN model segmentation in all the folds (Table 2). In fact, the higher performance of manual segmentation was marginal in all the folds, ranging from 6.06% to 9.4% of the segmented ring boundaries.

Table 2
www.frontiersin.org

Table 2 Deviations between tree ring boundaries for each fold in the evaluation.

4 Discussion

The application of NNs in the automation of QWA analyses has been progressive since the development of different cell delimitation models (Garcia-Pedrero et al., 2018, Garcia-Pedrero et al., 2019; Resente et al., 2021). The training and processing effort required of any operator makes it necessary to develop useful methods for ring boundary delimitation on images from microsections. Our model performed equal or better than manual tree ring boundary delimitation on stained wood microsections in 91.79% of the cases.

Beech ring boundaries are characterized by the presence of a band of narrower fibers at the end of the growing season, intersected by parenchyma rays that have less distinct borders. This boundary can be clearly delineated at first glance (at least for the fibers), but conventional manual ring boundary segmentation is not performed pixel by pixel following each cell wall limit, but rather using polylines consisting of segments connecting multiple points marked by the operator. Therefore, the ring boundaries differ slightly between operators, or even between different attempts of a given operator, depending on where the segment limits are placed. This is not a problem with most QWA approaches since most of the effort is based on the assignment of vessels to each ring. Furthermore, these differences are small in terms of percentage of ring or vessel adscription area and subsequently do not affect the robustness or reproducibility of QWA analyses. In this way, our results showed an average spacing of 35.85 (SE = 3.93) pixels with less than one vessel mismatch between manual and automatic delimitations.

The evaluation of a segmentation usually compares ground truth with the predicted boundary at pixel value level (boundary vs. non-boundary). However, this approach has not been widely used in dendrochronological studies, that focus just on tree ring boundary identification. The evaluations usually consider adequate ring boundary detection through visual assessment or partial intersection to identify tree ring boundary (Fabijanska and Danek, 2018). In this way, models achieve remarkable results when applied to macroscopic samples. Higher widening of tree ring border for model evaluation has been proposed as an advance (Poláček et al., 2023) to a finer analysis of segmentations through spatial overlap-based metrics (Taha & Hanbury, 2015).

The particularities of the QWA analysis reinforces the need of a more exhaustive evaluation method. Tree ring boundaries at a single point fix the boundary on a horizontal line, but ring boundaries rarely show this arrangement, resulting in a notable mismatch in the attribution of anatomical structures (vessels, fibers…) to actual rings, i.e. calendar years. On the other hand, comparisons at the exact pixel value can lead to a low evaluation of the results when model agreement at pixel level is not exact, even if there are neither vessel nor cell assignment differences. Moreover, a manual ring boundary is usually a polyline linking the different points marked by the operator, whereas the NN model defines boundaries that run through the image pixel by pixel. These contrasting ways of drawing the line, and the serious drawbacks of comparing lines pixel by pixel, requires the use of complementary approaches to evaluating ring boundary detection for QWA. Therefore, we considered the extraction of the mean position of the pixels belonging to each ring boundary as a valuable metric to compare manual and automatic segmentation but complemented with dendrochronological features.

The discrepancies between the predicted and the manually delineated tree ring boundaries were within the expected deviations between different delineations of the same ring, providing a valuable framework for QWA analysis, and allowing the study of tree responses to environmental conditions. The extremely small discrepancy in the number of vessels assigned to a ring (about 1 vessel center discrepancy on average), considering the average of 120 vessels per ring from this data set (Olano et al., 2022), means a very small divergence (<1%). Moreover, the NN was able to identify a significant number of rings that were missed by human experts, while a smaller number were missed.

Using NN-based models in stained images with similar characteristics of wood samples could be useful for broad QWA applications. NNs are sensitive to image properties, primarily resolution and pixel pattern, and require a considerable number of segmented images to learn and modulate the species-specific parameters to achieve optimal results. The growing datasets of wood microsections for QWA open the opportunity for accurate models to segment and, therefore, capture the wide range of cell patterns and wood ring characteristics, including the major anatomical patterns of wood (Wheeler et al., 1989). Furthermore, the differences in tree-ring delimitation between operators and the wide range of wood types highlight the importance of considering not only pixel value but also other relevant metrics for QWA, including expert examination. The compilation of different parameters proposed in this manuscript helps to confront different segmentation methods for QWA.

The proposed UNETR model was developed using beech images following standard microsectioning and data collection protocols. However, there are inherent disparities in image characteristics due to the individualities of trees or even core samples and, similarly, to image capture with a camera on a microscope. Thus, although we followed the standard protocol for QWA samples, NNs can show some degree of bias associated to the training data. In order to apply the proposed model with images different from those obtained for this experiment, we recommend to calibrate the model parameters with a subset of the samples.

Our results show that NNs provide results that have the same or even better accuracy than manual segmentation of ring boundaries, with a slight divergence in vessel mismatch in the marginal cases when NNs models are outperformed by the manual operator. The superior results of NNs can be partially explained by the inherent limitation of manual delineation by polylines, whereas NN can closely match annual tree-ring boundaries to pixel value and pattern. Nonetheless, the great development on the application of NNs at image segmentation in other areas (e.g. biomedical, remote sensing, on-field applications in agroforestry, etc.) reflects that there is still much room for improvement for more specific models according to the wood anatomical patterns, the staining procedures, and the different approaches to model evaluation (i.e., considering the complete ring between two limits as a polygon and examining differences in the segmented area), or even using retraining options with human-corrected results to improve model accuracy. Further advances through this avenue require the compilation of large data banks of images with delineated annual rings on a wide variety of microscopic wood samples.

5 Conclusions

CNN models can significantly reduce costs in QWA ring boundary segmentation and have the potential to outperform human operators. Advances in NNs application and the development of specific evaluation methods for wood ring boundary segmentation in QWA could enable the massive collection of accurate data on tree function and response to ongoing global change.

Data availability statement

The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

Author contributions

MG-H: Conceptualization, Data curation, Formal Analysis, Writing – original draft, Writing – review & editing. ÁG-P: Conceptualization, Formal Analysis, Methodology, Writing – original draft, Writing – review & editing. VR: Conceptualization, Funding acquisition, Project administration, Resources, Writing – original draft, Writing – review & editing. GS-B: Funding acquisition, Writing – original draft, Writing – review & editing. AG-C: Resources, Writing – original draft. GR: Writing – original draft. MW: Writing – original draft, Writing – review & editing. JO: Conceptualization, Funding acquisition, Project administration, Supervision, Writing – original draft, Writing – review & editing.

Funding

The author(s) declare financial support was received for the research, authorship, and/or publication of this article. This research was made possible by Grant CNS2022-135319 funded by MCIN/AEI/ 10.13039/501100011033 and by “European Union NextGenerationEU/PRTR”. Grant CGL2017-87309-P (PID2020-118444GA-100; PRE2018-084106) funded by MCIN/AEI/10.13039/501100011033, Grant PID2020-118444GA-100 and CNS2022-135319 by MCIN/AEI/10.13039/501100011033 and ESF “investing in your future” to MG-H; Universidad Politécnica de Madrid (RP200060107) to ÁG-P; Grant CNS2022-135319 funded by MCIN/AEI/10.13039/501100011033 and by “European Union Next GenerationEU/PRTR”, and PID2020-118444GA-100 funded by MCIN/ AEI/10.13039/501100011033 to GS-B. GR and MW have been supported by the European Social Fund (ESF) and the Ministry of Education, Science and Culture of Mecklenburg-Vorpommern (Germany), under the project “DigIT!” (ESF/14-BM-A55-0012/19). Junta de Castilla y León-Consejerı́a de Educación (IR2020-1-UVA08; VA171P20) and EU LIFE Soria Forest Adapt (LIFE19CCA/ES/001181) and UE FEDER Funds. Caja Rural de Soria (CeI Prize 2021) and FUNGE-UVa (26/04/2022 TCUE 2021-2023).

Acknowledgments

The authors thank Diego Muñoz-Garachana for his laboratory work, and Cristina Caetano-Sánchez for their contribution to the fieldwork.

Conflict of interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

Abraham, N., Khan, N. M. (2019). “A novel focal tversky loss function with improved attention U-net for lesion segmentation,” in 2019 IEEE 16th International Symposium on Biomedical Imaging (ISBI 2019). (IEEE. Venice, Italy) 683–687. doi: 10.1109/ISBI.2019.8759329

CrossRef Full Text | Google Scholar

Anadon-Rosell, A., Dawes, M. A., Fonti, P., Hagedorn, F., Rixen, C., von Arx, G. (2018). Xylem anatomical and growth responses of the dwarf shrub Vaccinium myrtillus to experimental CO2 enrichment and soil warming at treeline. Sci. Total Environ. 642, 1172–1183. doi: 10.1016/j.scitotenv.2018.06.117

PubMed Abstract | CrossRef Full Text | Google Scholar

Anderson-Teixeira, K. J., Herrmann, V., Rollinson, C. R., Gonzalez, B., Gonzalez-Akre, E. B., Pederson, N., et al. (2022). Joint effects of climate, tree size, and year on annual tree growth derived from tree-ring records of ten globally distributed forests. Global Change Biol. 28 (1), 245–266. doi: 10.1111/gcb.15934

CrossRef Full Text | Google Scholar

Arzac, A., Rozas, V., Rozenberg, P., Olano, J. M. (2018). Water availability controls Pinus pinaster xylem growth and density: A multi-proxy approach along its environmental range. Agric. For. Meteorol. 250–251, 171–180. doi: 10.1016/j.agrformet.2017.12.257

CrossRef Full Text | Google Scholar

Bai, X., Latecki, L. J. (2007). Discrete Skeleton Evolution. In: Yuille, A.L., Zhu, SC., Cremers, D., Wang, Y. (eds) Energy Minimization Methods in Computer Vision and Pattern Recognition. EMMCVPR 2007. Lecture Notes in Computer Science, vol 4679. Springer, Berlin, Heidelberg.

Google Scholar

Borghetti, M., Gentilesca, T., Colangelo, M., Ripullone, F., Rita, A. (2020). Xylem functional traits as indicators of health in mediterranean forests. Curr. Forestry Rep. 6 (3), 220–236. doi: 10.1007/S40725-020-00124-5

CrossRef Full Text | Google Scholar

Buslaev, A., Iglovikov, V. I., Khvedchenya, E., Parinov, A., Druzhinin, M., Kalinin, A. A. (2020). Albumentations: Fast and flexible image augmentations. Information 11 (2), 125. doi: 10.3390/info11020125

CrossRef Full Text | Google Scholar

Cabon, A., Kannenberg, S. A., Arain, A., Babst, F., Baldocchi, D., Belmecheri, S., et al. (2022). Cross-biome synthesis of source versus sink limits to tree growth. Science 376 (6594), 758–761. doi: 10.1126/science.abm4875

PubMed Abstract | CrossRef Full Text | Google Scholar

Cuny, H. E., Rathgeber, C. B. K., Lebourgeois, F., Fortin, M., Fournier, M. (2012). Life strategies in intra-annual dynamics of wood formation: Example of three conifer species in a temperate forest in north-east France. Tree Physiol. 32 (5), 612–625. doi: 10.1093/TREEPHYS/TPS039

PubMed Abstract | CrossRef Full Text | Google Scholar

Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., et al. (2020). An image is worth 16x16 words: Transformers for image recognition at scale. ArXiv Preprint ArXiv:2010.11929. doi: 10.48550/arXiv.2010.11929

CrossRef Full Text | Google Scholar

Fabijanska, A., Danek, M. (2018). DeepDendro—A tree rings detector based on a deep convolutional neural network. Comput. Electron. Agric. 150, 353–363. doi: 10.1016/j.compag.2018.05.005

CrossRef Full Text | Google Scholar

Fabijanska, A., Danek, M., Barniak, J., Piorkowski, A. (2017). Towards automatic tree rings detection in images of scanned wood samples. Comput. Electron. Agric. 140, 279–289. doi: 10.1016/j.compag.2017.06.006

CrossRef Full Text | Google Scholar

Fonti, P., von Arx, G., García-González, I., Eilmann, B., Sass-Klaassen, U., Gärtner, H., et al. (2010). Studying global change through investigation of the plastic responses of xylem anatomy in tree rings. New Phytol. 185 (1), 42–53. doi: 10.1111/j.1469-8137.2009.03030.x

PubMed Abstract | CrossRef Full Text | Google Scholar

García-Cervigón, A. I., Fajardo, A., Caetano-Sánchez, C., Camarero, J. J., Olano, J. M. (2020). Xylem anatomy needs to change, so that conductivity can stay the same: xylem adjustments across elevation and latitude in Nothofagus pumilio. Ann. Bot. 125, 1101–1112. doi: 10.1093/aob/mcaa042

PubMed Abstract | CrossRef Full Text | Google Scholar

Garcia-Hidalgo, M., Garcia-Pedrero, A., Colon, D., Sanguesa-Barreda, G., Garcia-Cervigon, A., Lopez-Molina, J., et al. (2022). CaptuRING: A do-it-yourself tool for wood sample digitization. Methods Ecol. Evol. 13 (6), 1185–1191. doi: 10.1111/2041-210X.13847

CrossRef Full Text | Google Scholar

Garcia-Pedrero, A., García-Cervigón, A., Caetano, C., Calderón-Ramírez, S., Olano, J. M., Gonzalo-Martín, C., et al. (2018). “Xylem vessels segmentation through a deep learning approach: A first look,” in 2018 IEEE International Work Conference on Bioinspired Intelligence (IWOBI). 1–9. doi: 10.1109/IWOBI.2018.8464184

CrossRef Full Text | Google Scholar

Garcia-Pedrero, A., García-Cervigón, A. I., Olano, J. M., García-Hidalgo, M., Lillo-Saavedra, M., Gonzalo-Martín, C., et al. (2019). Convolutional neural networks for segmenting xylem vessels in stained cross-sectional images. Neural Computing Appl. 32 (24), 17927–17939. doi: 10.1007/S00521-019-04546-6

CrossRef Full Text | Google Scholar

Geßler, A., Keitel, C., Kreuzwieser, J., Matyssek, R., Seiler, W., Rennenberg, H. (2007). Potential risks for European beech (Fagus sylvatica L.) in a changing climate. Trees 21 (1), 1–11. doi: 10.1007/s00468-006-0107-x

CrossRef Full Text | Google Scholar

Gillert, A., Resente, G., Anadon-Rosell, A., Wilmking, M., von Lukas, U. F. (2023). “Iterative next boundary detection for instance segmentation of tree rings in microscopy images of shrub cross sections,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 14540–14548. doi: 10.1109/CVPR52729.2023.01397

CrossRef Full Text | Google Scholar

Gonzalo-Martín, C., García-Pedrero, A., Lillo-Saavedra, M. (2021). Improving deep learning sorghum head detection through test time augmentation. Comput. Electron. Agric. 186, 106179. doi: 10.1016/j.compag.2021.106179

CrossRef Full Text | Google Scholar

Hatamizadeh, A., Tang, Y., Nath, V., Yang, D., Myronenko, A., Landman, B., et al. (2022). “Unetr: Transformers for 3d medical image segmentation,” in Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. 574–584. doi: 10.1109/WACV51458.2022.00181

CrossRef Full Text | Google Scholar

Hendrycks, D., Gimpel, K. (2016). Gaussian error linear units (gelus). ArXiv Preprint ArXiv:1606.08415. doi: 10.48550/arXiv.1606.08415

CrossRef Full Text | Google Scholar

Hérault, B., Bachelot, B., Poorter, L., Rossi, V., Bongers, F., Chave, J., et al. (2011). Functional traits shape ontogenetic growth trajectories of rain forest tree species. J. Ecol. 99 (6), 1431–1440. doi: 10.1111/J.1365-2745.2011.01883.X

CrossRef Full Text | Google Scholar

Khan, S., Naseer, M., Hayat, M., Zamir, S. W., Khan, F. S., Shah, M. (2022). Transformers in vision: A survey. ACM Comput. Surv. 54, 200. doi: 10.1145/3505244

CrossRef Full Text | Google Scholar

Kim, D., Ko, C., Kim, D. (2023). Method for detecting tree ring boundary in conifers and broadleaf trees using Mask R-CNN and linear interpolation. Dendrochronologia 79, 126088. doi: 10.1016/j.dendro.2023.126088

CrossRef Full Text | Google Scholar

Lin, T., Wang, Y., Liu, X., Qiu, X. (2022). A survey of transformers. AI Open 3, 111–132. doi: 10.1016/j.aiopen.2022.10.001

CrossRef Full Text | Google Scholar

Ma, B., Ban, X., Huang, H., Chen, Y., Liu, W., Zhi, Y. (2018). Deep learning-based image segmentation for al-la alloy microscopic images. Symmetry 10 (4), 107. doi: 10.3390/sym10040107

CrossRef Full Text | Google Scholar

Martinez del Castillo, E., Zang, C. S., Buras, A., Hacket-Pain, A., Esper, J., Serrano-Notivoli, R., et al. (2022). Climate-change-driven growth decline of European beech forests. Commun. Biol. 5 (1), 1–9. doi: 10.1038/s42003-022-03107-3

PubMed Abstract | CrossRef Full Text | Google Scholar

Olano, J. M., Arzac, A., García-Cervigón, A. I., von Arx, G., Rozas, V. (2013). New star on the stage: Amount of ray parenchyma in tree rings shows a link to climate. New Phytol. 198 (2), 486–495. doi: 10.1111/nph.12113

PubMed Abstract | CrossRef Full Text | Google Scholar

Olano, J. M., Garcia-Cervigon, A. I., Sanguesa-Barreda, G., Rozas, V., Munoz-Garachana, D., Garcia-Hidalgo, M., et al. (2021). Satellite data and machine learning reveal the incidence of late frost defoliations on Iberian beech forests. Ecol. Appl. 31 (3), e02288. doi: 10.1002/eap.2288

CrossRef Full Text | Google Scholar

Olano, J., Hernández-Alonso, H., Sangüesa-Barreda, G., Rozas, V., García-Cervigón, A., García-Hidalgo, M. (2022). Disparate response to water limitation for vessel area and secondary growth along Fagus sylvatica southwestern distribution range. Agric. For. Meteorol. 323, 109082. doi: 10.1016/j.agrformet.2022.109082

CrossRef Full Text | Google Scholar

Pan, Y., Birdsey, R. A., Fang, J., Houghton, R., Kauppi, P. E., Kurz, W. A., et al. (2011). A large and persistent carbon sink in the world’s forests. Science 333 (6045), 988–993. doi: 10.1126/science.1201609

PubMed Abstract | CrossRef Full Text | Google Scholar

Pérez-de-Lis, G., Rathgeber, C. B. K., Fernández-de-Uña, L., Ponton, S. (2022). Cutting tree rings into time slices: How intra-annual dynamics of wood formation help decipher the space-for-time conversion. New Phytol. 233 (3), 1520–1534. doi: 10.1111/nph.17869

PubMed Abstract | CrossRef Full Text | Google Scholar

Piermattei, A., Von Arx, G., Avanzi, C., Fonti, P., Gärtner, H., Piotti, A., et al. (2020). Functional relationships of wood anatomical traits in Norway spruce. Front. Plant Sci. 11, 683. doi: 10.3389/fpls.2020.00683

PubMed Abstract | CrossRef Full Text | Google Scholar

Poláček, M., Arizpe, A., Hüther, P., Weidlich, L., Steindl, S., Swarts, K. (2023). Automation of tree-ring detection and measurements using deep learning. Methods Ecol. Evol. 14, 2233–2242. doi: 10.1111/2041-210X.14183

CrossRef Full Text | Google Scholar

Prislan, P., del Castillo, E. M., Skoberne, G., Špenko, N., Gričar, J. (2022). Sample preparation protocol for wood and phloem formation analyses. Dendrochronologia 73, 125959. doi: 10.1016/j.dendro.2022.125959

CrossRef Full Text | Google Scholar

Resente, G., Gillert, A., Trouillier, M., Anadon-Rosell, A., Peters, R. L., von Arx, G., et al. (2021). Mask, train, repeat! Artificial intelligence for quantitative wood anatomy. Front. Plant Sci. 12 (November). doi: 10.3389/fpls.2021.767400

PubMed Abstract | CrossRef Full Text | Google Scholar

Ronneberger, O., Fischer, P., Brox, T. (2015). U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III 18 (pp. 234–241). Springer International Publishing.

Google Scholar

Sánchez de Dios, R., Gómez, C., Aullo, I., Cañellas, I., Gea-Izquierdo, G., Montes, F., et al. (2021). Fagus sylvatica L. Peripheral populations in the mediterranean iberian peninsula: Climatic or anthropic relicts? Ecosystems 24 (1), 211–226. doi: 10.1007/s10021-020-00513-8

CrossRef Full Text | Google Scholar

Sangüesa-Barreda, G., Di Filippo, A., Piovesan, G., Rozas, V., Di Fiore, L., García-Hidalgo, M., et al. (2021). Warmer springs have increased the frequency and extension of late-frost defoliations in southern European beech forests. Sci. Total Environ. 775, 145860. doi: 10.1016/j.scitotenv.2021.145860

PubMed Abstract | CrossRef Full Text | Google Scholar

Schweingruber, F. H. (1996) Tree rings and environment: Dendroecology. Available at: https://www.cabdirect.org/cabdirect/abstract/19980602476.

Google Scholar

Schweingruber, F. H., Poschlod, P., forêt, la neige et le paysage (Birmensdorf) I. fédéral de recherches sur la (2005). Growth rings in herbs and shrubs: Life span, age determination and stem anatomy Vol. 79 (Switzerland: Swiss Federal Research Institute WSL Birmensdorf).

Google Scholar

Seidl, R., Thom, D., Kautz, M., Martin-Benito, D., Peltoniemi, M., Vacchiano, G., et al. (2017). Forest disturbances under climate change. Nat. Climate Change 7 (6), 395–402. doi: 10.1038/nclimate3303

CrossRef Full Text | Google Scholar

Singh, S., Mittal, N., Thakur, D., Singh, H., Oliva, D., Demin, A. (2022). Nature and biologically inspired image segmentation techniques. Arch. Comput. Methods Eng. 29 (3), 1415–1442. doi: 10.1007/s11831-021-09619-1

CrossRef Full Text | Google Scholar

Sultana, F., Sufian, A., Dutta, P. (2020). Evolution of image segmentation using deep convolutional neural network: A survey. Knowledge-Based Syst. 201–202, 106062. doi: 10.1016/j.knosys.2020.106062

CrossRef Full Text | Google Scholar

Taha, A. A., Hanbury, A. (2015). Metrics for evaluating 3D medical image segmentation: analysis, selection, and tool. BMC Med. Imaging 15 (1), 1–28. doi: 10.1186/s12880-015-0068-x

PubMed Abstract | CrossRef Full Text | Google Scholar

Takahashi, K., Tokumitsu, Y., Yasue, K. (2005). Climatic factors affecting the tree-ring width of Betula ermanii at the timberline on Mount Norikura, central Japan. Ecol. Res. 20, 445–451. doi: 10.1007/s11284-005-0060-y

CrossRef Full Text | Google Scholar

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., et al. (2017). Attention is all you need. Adv. Neural Inf. Process. Syst. 30.

Google Scholar

von Arx, G., Carrer, M. (2014). ROXAS - A new tool to build centuries-long tracheid-lumen chronologies in conifers. Dendrochronologia 32 (3), 290–293. doi: 10.1016/j.dendro.2013.12.001

CrossRef Full Text | Google Scholar

von Arx, G., Crivellaro, A., Prendin, A. L., Čufar, K., Carrer, M. (2016). Quantitative wood anatomy—Practical guidelines. Front. Plant Sci. 7 (JUNE2016). doi: 10.3389/fpls.2016.00781

CrossRef Full Text | Google Scholar

Wheeler, E. A., Baas, P., Gasson, P. E. (1989). IAWA list of microscopic features for hardwood identification. IAWA J. 10, 219–332. doi: 10.1163/22941932-90000496

CrossRef Full Text | Google Scholar

Wilmking, M., Maaten-Theunissen, M., van der, Maaten, E., van der Scharnweber, T., Buras, A., Biermann, C., et al. (2020). Global assessment of relationships between climate and tree growth. Global Change Biol. 26 (6), 3212–3220. doi: 10.1111/GCB.15057

CrossRef Full Text | Google Scholar

Zhang, J., Shen, X., Wang, Y., Jiang, M., Lu, X. (2021). Effects of Forest changes on summer surface temperature in Changbai Mountain, China. Forests 12 (11), 1551. doi: 10.3390/f12111551

CrossRef Full Text | Google Scholar

Zhang, T. Y., Suen, C. Y. (1984). A fast parallel algorithm for thinning digital patterns. Commun. ACM 27 (3), 236–239. doi: 10.1145/357994.358023

CrossRef Full Text | Google Scholar

Zimmermann, J., Link, R. M., Hauck, M., Leuschner, C., Schuldt, B. (2021). 60-year record of stem xylem anatomy and related hydraulic modification under increased summer drought in ring-and diffuse-porous temperate broad-leaved tree species. Trees 35 (3), 919–937. doi: 10.1007/s00468-021-02090-2

CrossRef Full Text | Google Scholar

Keywords: image segmentation, neural networks, quantitative wood anatomy, tree ring, UNETR, xylem

Citation: García-Hidalgo M, García-Pedrero Á, Rozas V, Sangüesa-Barreda G, García-Cervigón AI, Resente G, Wilmking M and Olano JM (2024) Tree ring segmentation using UNEt TRansformer neural network on stained microsections for quantitative wood anatomy. Front. Plant Sci. 14:1327163. doi: 10.3389/fpls.2023.1327163

Received: 24 October 2023; Accepted: 14 December 2023;
Published: 08 January 2024.

Edited by:

Alex Charles Wiedenhoeft, Forest Service (USDA), United States

Reviewed by:

Patrick Fonti, Swiss Federal Institute for Forest, Snow and Landscape Research (WSL), Switzerland
Xiangjin Shen, Chinese Academy of Sciences (CAS), China

Copyright © 2024 García-Hidalgo, García-Pedrero, Rozas, Sangüesa-Barreda, García-Cervigón, Resente, Wilmking and Olano. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Miguel García-Hidalgo, miguel.garcia.hidalgo@uva.es

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.