Chips & architecture · Research feature

A Tree Crown Segmentation Approach for Unmanned Aerial Vehicle Remote Sensing Images on Field Programmable Gate Array (FPGA) Neural Network Accelerator

A study demonstrates a lightweight neural network model that accurately segments tree crowns in UAV images and runs efficiently on an FPGA-based platform.

Adapted from research by Ma J, Yan L, Chen B and colleagues.

Journal publication · 2025-04-25 · Attribution & reuse
In this article
Editorial illustration of processor die.

Editor’s introduction

The research focuses on tree crown segmentation in mixed coniferous and broad-leaved forests using UAV imagery from Jingyue Ecological Forest Farm in Beijing. The model achieves 85% accuracy in classifying and segmenting crown regions for Pinus tabuliformis and Salix matsudana. The study measures speedup of 31 times over the ZYNQ hard core and 1.3 times over an Intel Core i9-10900K, while consuming less than 20% of the SoC’s hardware resources and 2.127 W of power.

Introduction

The application of automatic tree crown detection in high-resolution forest remote sensing images has been a topic attracting extensive attention over the last ten years. Tree crown detection is the utmost and essential part of almost all methods of forest resource inventory and management based on remote sensing data. A lot of work on forest resource inventory and crown delineation by using remote sensing data has been proposed, which has achieved good results in both the individual level and classification accuracy. Among these methods, tree crown detection is an indispensable key step, and its results play a decisive role in research. However, window-based filters are used in much of the work to find local maxima as potential tree crowns. It is theoretically feasible, but the implementation might fall short of expectations. A suitable filter size for various tree crowns is usually difficult to find, even if the adaptive filter method is adopted.

Recently, convolutional neural networks using deep learning technology have been applied in image classification, target detection, image segmentation, etc.. Different from the traditional method of using filters for feature determination, the application of the convolution neural network performs better in learning advanced semantic information from training samples. In the aspect of tree crown detection, the convolutional neural network performs better in different scenes than the adaptive filters as the accuracy of supervised machine learning is usually high.

With the constant increase in the data amount and collection speed, more remote sensing data processing work based on board has been put forward. In order to eliminate the delay between data collection and processing as much as possible and also to reduce the amount of data transmitted from satellites to the ground, FPGA has become one of the most popular on-board remote sensing data processing platforms among many high-performance platforms and graphics processors. The reasons are as follows: Firstly, compared with high-performance platforms and graphics processors, FPGA is usually smaller in size and weight and has the inherent reprogramming ability. Secondly, compared with graphics processors, FPGA consumes less power and generates less heat due to its characteristics for hardware programming. Apart from that, FPGA has the advantages of parallel computing and low delay in the optimization of neural networks. After being accelerated by FPGA hardware, the neural network algorithm can obtain faster computation speed and lower power consumption than on MCU or PC by controlling multiple accelerators through the assembly line to conduct computation, reuse RAM resources, make floating-point number hardware-oriented to reduce the number of instructions, and reduce the operation accuracy.

Therefore, FPGA is widely used in remote sensing detection. In hyperspectral remote sensing, since more hyperspectral applications require real- or near-real-time processing capabilities, reconfigurable hardware solutions such as field-programmable gate arrays have been consolidated during the last years as one of the standard choices for the fast processing of hyperspectral remotely sensed image. Due to the power limitation of (on-board space platforms) (spaceborne or airborne), the ultra-low power consumption of FPGA is widely welcomed by researchers. In some scenes with high demand for real-time processing and computing performance, such as natural disaster prediction, one of the solutions is to process the data using FPGA. With the increasing complexity of remote sensing image analysis algorithms, researchers will also tend to use FPGA for hardware acceleration to pursue higher computing performance.

Data

The orthophoto image of the forest area utilized was acquired from the unmanned aerial vehicle (UAV) orthophoto imagery employed in Chong Zhang et al.’s study. The UAV aerial images were taken on the morning of 26 May 2023, under subdued sunlight and gentle wind conditions, which were conducive to remote sensing image data collection.

The deep learning model utilized in this study is supervised learning, necessitating the manual annotation of input images prior to model training. The Labelme annotation tool, based on the Anaconda3 virtual environment, was employed for classifying and annotating the segmentation of tree crown amplitude in images. Using the polygon creation tool, we manually delineated the canopy boundaries of each tree on the RGB images, assigned corresponding tree labels based on species information, and created a standard dataset for canopy segmentation in accordance with the PASCAL-VOC2012 dataset format.

The Improved Model U-Net-Light

In selecting the backbone network, this paper adopts the classic VGG16 as the feature extraction module, replacing the decoder structure in the original U-Net. Compared to more complex backbone networks such as ResNet and DenseNet, VGG16 features a concise structure that is deployment-friendly, making it particularly suitable for applications on embedded devices or edge platforms. Its consecutive 3 × 3 convolutional structure performs stably in capturing image details, while the network’s clear layering and controllable parameter distribution facilitate engineering optimization and model compression. Although ResNet excels in image classification tasks through the use of residual connections, its original design is more suited for global feature extraction rather than the detail restoration tasks required by the U-Net decoder. While residual connections can alleviate the vanishing gradient problem, they also increase model complexity and complicate FPGA deployment. For instance, ResNet-50 has approximately 25.6 M parameters, which does not align with the objective of lightweight design. The Inception series of networks is renowned for its multi-branch structures, which are capable of capturing multi-scale features; however, they exhibit significant disadvantages regarding computational complexity and parameter count. For instance, the FLOPS of Inception V3 are typically higher than those of VGG16, imposing greater demands on the computational capabilities of FPGAs. Additionally, their intricate multi-branch designs increase the difficulty of model implementation and hinder the goal of lightweight design. In contrast, MobileNet achieves lightweight architecture through depthwise separable convolution, resulting in a relatively small number of parameters (e.g., MobileNet V1 has approximately 4.2 M parameters), making it seemingly suitable for edge deployment. However, this architecture compromises feature extraction capabilities, particularly in tasks such as canopy segmentation that require high-edge clarity and spatial detail, often leading to blurred boundaries and inaccurate localization. Considering these factors, VGG16 offers a more favorable balance between semantic expression capability, computational complexity, and deployment feasibility, and is, therefore, selected as the backbone network structure for the lightweight model in this study.

Based on the original structure of U-Net, the U-Net-light model reduces the number of convolutional feature graph channels to 1/4 of the original one. According to Formula (1), the number of parameters at this time decreases to 1/16 of the original, that is, 1.81 MB. At the same time, the backbone of VGG16 is used to replace the original decoder structure, and the extraction ability of image feature information is improved by increasing the number of convolutional layers, and the impact of the reduction in the number of feature maps on the extraction of deep semantic information is reduced. In addition, the backbone structure of VGG16 is used to split a feature graph with 256 channels into two feature graphs with 128 channels at the bottom of the U-shaped network model, and the number of parameters is further reduced to 1.56 MB.

The U-Net-light model uses the filling strategy in all the convolution layers. Before the convolution operation, 0 values are filled in the edge of the feature graph to ensure that the length and width of the feature graph after convolution remain unchanged. At the same time, the size of the input image is fixed to 256 pixels (or 128 or 64) to ensure that it is an integer multiple of 8, which is convenient for byte alignment when storing the feature map.

The input image format is changed from grayscale to RGB three-color 24-bit color map to retain more information about remote sensing images. The Softmax activation function is used instead of the Sigmoid activation function to output the segmentation results of multiple tree species, which is suitable for the classification scenario of an artificial block mixed forest in a forest farm.

Model Transformation

After the PyTorch model is trained, the parameter file of the model is stored in. pth format, which must be opened under the PyTorch framework to read, and the weight value cannot be directly exported. Therefore, this paper studies the conversion of the trained PyTorch model into the ONNX model using the function package ONNX 1.12.0. ONNX is an open source format for machine learning models that supports interoperability across framework models. At the same time, ONNX can be visualized with the help of Netron’s online website to facilitate the export of model parameters and the construction of the calculation process.

Evaluation Index

In order to study the inference effect of neural network model on tree classification and crown width segmentation, pixel accuracy rate (PA), class pixel accuracy rate (CPA), class average pixel accuracy rate (MPA), intersection ratio (IoU), and average intersection ratio (MIoU) were used as the quantitative evaluation indices of semantic segmentation.

C++ Algorithm Implementation

The neural network built using Python language has been trained and verified through testing, proving that the network has achieved the expected function. The next step is code migration. Neural network models designed directly by high-level programming languages (such as Python) cannot be directly deployed to platforms such as FPGA. Hardware description language (HDL) is usually used for RTL-level code writing and comprehensive burning to the FPGA platform. However, the development cycle of FPGA using HDL is long and difficult. Therefore, this study chooses the HLS development method, writes the RTL logic through C/C++, and realizes the RTL-level code directly and comprehensively. The tools provided by Xilinx, such as Vitis HLS, are used to realize the comprehensive conversion of C source code and the compatibility of FPGA hardware.

On the other hand, Python language built-in library functions can directly achieve multidimensional matrix addition and multiplication operations, while C/C++ does not have the tools to directly complete matrix operations, so it is necessary to use the underlying language to analyze and rewrite its model implementation process, comprehensive use of sequence structure, selection structure, and loop structure to complete process-oriented programming and to achieve core operational functions. Programming at the C/C++ level is designed to aid hardware design, further analyze functionality, and more efficiently target code refactoring for the forward inference process. Based on this, this paper implements three common algorithms of neural networks on the Visual Studio 2019 integrated development environment, including all the operators used in the U-Net-light model, and designs data structures, that can set specific values such as convolution kernel size, sliding step size, filling mode, input and output image resolution, etc., to improve the reusability of code modules.

Kernel: Accelerator

The findings from the C++ operations indicate that the convolution operation is the lengthiest and most prominent layer within the network structure. As a result, the focus of accelerator design is on expediting convolution operations. This paper’s designed convolutional accelerator has been tailored to accommodate a maximum input image size of 128 × 128, with a focus on enhancing operational efficiency and minimizing resource overhead.

In the hardware implementation described above, the C code loop structure is configured using pragma, with the inner loop being expanded by unroll. The operation of the 3 × 3 convolution kernel is transformed into a combination of logic for multiplication and accumulation, allowing for the simultaneous calculation of 32 convolutions. During the convolution calculation process, it is necessary to read feature graph values and weight bias values from BRAM to registers, perform calculations, and then write back the results to BRAM. A three-level pipeline calculation is achieved using pipeline parameters. Bias value stacking is completed before writing back to BRAM at the end of the calculation. The row buffer array in BRAM has been unfolded using cyclic expansion mode partitioning and stored in 8 blocks, respectively, to increase memory read/write interfaces and resolve issues related to read/write conflicts and data dependency within the pipeline.

Run Time

In this study group, guest ZYNQ7100 SoC designs are verified on the FPGA development board and tested to verify the forward reasoning results and test the acceleration of the SoC effect in order to reflect the rationality of the design of SoC, and at the same time in 20 core cpus (Intel CoreTM i9 CPU-10900 k, The U-Net-light software (Python: 3.8.8, PyTorch: 1.7.1, CUDA: 11.0, ONNX: 1.12.0) calculation was implemented on the 3.70 GHz and ARM single-core (Cortex-A9, 800 MHz) as a reference.

Practical Implications and Challenges in Real-World Applications

The proposed U-Net-light model and FPGA-based SoC architecture hold significant potential for real-world applications beyond the studied forest farm. For instance, in environmental conservation, this system could monitor deforestation or track biodiversity changes by segmenting tree crowns in protected areas. In precision agriculture, it could assess interspersed crop health alongside tree vitality, offering a dual-purpose solution for agroforestry management. Urban planners might leverage this technology to evaluate green space distribution in cities, ensuring compliance with sustainability goals.

However, deploying this method in diverse environments presents challenges. Variability in tree species, particularly in tropical or mixed forests with overlapping canopies, may reduce segmentation accuracy. Seasonal changes, such as leaf shedding in deciduous trees, could further complicate model performance. Additionally, UAV-based data collection is sensitive to weather conditions (e.g., fog and rain), which may necessitate robust preprocessing pipelines or adaptive algorithms. Scalability is another concern—processing high-resolution imagery across vast forested regions demands optimized data transmission and storage strategies, especially in remote areas with limited connectivity.

Conclusions

This paper focuses on the Jingyue Ecological Forest Plantation in Changping District, Beijing, and presents the design and training of a lightweight convolutional neural network, U-Net-light, tailored for embedded platforms and FPGAs. Based on the U-Net and VGG16 models, U-Net-light is optimized for crown width segmentation in mixed forests with a parameter count of just 1.56 MB. The model successfully classifies trees and segments crown widths for Pinus tabuliformis and Salix matsudana, achieving a reasoning accuracy of 85%. Deployed on the Xilinx ZYNQ 7100 programmable SoC platform, the U-Net-light model processes 128 × 128 pixel RGB tree crown images in just 2.69 s. The accelerator IP core designed in this study delivers a 31-fold acceleration compared to the ZYNQ PS end core, and the SoC architecture achieves a 1.3-fold acceleration compared to the high-end Intel Core™ i9-10900K CPU. In terms of hardware resource usage, the system consumes less than one-quarter of the target platform’s resources, with a total on-chip power consumption of only 2.127 W.

This paper proposes a lightweight deep learning model, U-Net-light, for tree canopy segmentation and tree species recognition. The study presents an SoC architecture and neural network accelerator IP core that enable the deployment of the U-Net-light model, achieving notable acceleration and demonstrating high platform versatility. In conclusion, this study holds significant theoretical value and promising practical applications.

The U-Net-light model and its FPGA-based SoC implementation exhibit certain limitations that require further refinement. The model’s generalization capability remains insufficient, evidenced by reduced pixel accuracy when handling image scaling and transformations, which limits its robustness in diverse forest environments such as complex canopy structures, varying light conditions, or seasonal changes. Additionally, performance degradation occurs in high-density canopy segmentation, making it challenging to accurately identify individual tree canopies in tropical or mixed forests. The dependence on manual annotations for training hinders scalability across large datasets. On the hardware side, while HLS development methods improve development efficiency, they deliver lower real-time performance compared to Verilog and other HDLs, especially with complex models. Current accelerators are optimized for convolution operations but lack adaptability to diverse network architectures, and system scalability is limited by data transmission bottlenecks, storage constraints, and environmental factors like weather conditions. Future improvements could focus on: optimizing accelerator designs for complex models, exploring hybrid HLS-HDL approaches, introducing data augmentation and semi-supervised learning to enhance generalization and reduce annotation dependency, and improving on-chip memory management to address environmental challenges.

This study provides theoretical methods and practical cases for the integration of lightweight deep learning models with edge computing. Its characteristics of low power consumption and high energy efficiency ratio have direct application value in fields such as dynamic forest resource monitoring and smart agriculture. In the future, through interdisciplinary collaboration and hardware iteration, this technology can be further advanced from laboratory validation to engineering implementation.