Accepted at International Conference on Image Analysis and Processing (ICIAP) 2025 Arxiv
DeepCS-TRD, a Deep Learning-based Cross-Section Tree Ring Detector in Macro images. It substitutes the edge detection step of CS-TRD by a deep-learning-based approach (U-Net), which allows the application of the method to different image domains: microscopy, scanner or smartphone acquired, and species (Pinus taeda, Gleditsia triachantos and Salix glauca). In addition, two publicly available annotated datasets are introduced to the community. The proposed method outperforms state-of-the-art approaches in macro images (Pinus taeda and Gleditsia triacanthos) while showing slightly lower performance in microscopy images of Salix glauca. To our knowledge, this is the first work that studies automatic tree ring detection for such different species and acquisition conditions. Dataset is available here.
Run app
streamlit run app.py
Delineation of tree rings in the forest capturing images with a smartphone camera. Images from the Douglas fir dataset.
conda env create -f environment.yml
conda activate deep_cstrd
apt-get install git-lfs
git lfs pull
python setup.py install
pip install -r requirements.txt
- CS-TRD
git clone https://github.com/hmarichal93/cstrd_ipol.git
cd cstrd_ipol/
python setup.py install
cd ..
- UruDendro
git clone https://github.com/hmarichal93/uruDendro.git
cd uruDendro/
python setup.py install
Results should appear in the output/F02c folder
python main.py inference
python main.py inference --input input/urudendro/F02c.png --cy 1264 --cx 1204 --output_dir ./output --root ./ --weights_path ./models/deep_cstrd/256_pinus_v1_1504.pth
Go to the APD repository and follow the instructions to install the automatic pith detector.
python main.py train --dataset_dir DATASET_PATH --logs_dir SAVE_DIR
Where DATASET_PATH is the path to the dataset folder containing the images and the annotations, and SAVE_DIR is the path to the directory where the models are going to be saved
Training can be monitored using tensorboard
tensorboard --logdir=SAVE_DIR
Annotation were made using the Labelme tool marking tree ring boundaries as polylines.
python main.py evaluate --dataset_dir DATASET_PATH --results_path RESULT_PATH
Where DATASET_PATH is the path to the dataset folder containing the images and the annotations, and RESULT_PATH is the path to the directory where the results are going to be saved.