Iterative Next Boundary Detection for Instance Segmentation of Tree Rings in Microscopy Images of Shrub Cross Sections
CVPR 2023. Paper link
Python version: 3.7
. Other versions are known to cause issues.
#setup virtualenv
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
#download dataset
python fetch_dataset.py
#download pretrained models
python fetch_pretrained_models.py
#single imagefile
python main.py inference checkpoints/INBD_EH/model.pt.zip dataset/EH/inputimages/EH_0033.jpg
#list of imagefiles
python main.py inference checkpoints/INBD_EH/model.pt.zip dataset/EH/test_inputimages.txt
In Pinus taeda L. species, U-Net model do not segment the pith pixel correctly. In such species, pith can be model as a single pixel (see paper).
#single imagefile
python main.py inference checkpoints/UruDendro/model.pt.zip dataset/UruDendro4_1504/T0_B1_N32_A.png --cy 766 --cx 709
Where --cy
and --cx
are the y and x coordinates of the pith pixel in the image. Model checkpoints/UruDendro/model.pt.zip
was trained on the UruDendro dataset, which is a dataset of Pinus taeda L. tree rings (see dataset).
Image dataset/UruDendro4_1504/T0_B1_N32_A.png
is an example image from the UruDendro4 dataset (see dataset).
resized to 1504x1504 pixels. Image can be downloaded from link.
To run in a list of files, the input file should contain the image paths and the pith pixel coordinates.
#list of imagefiles
python main.py inference checkpoints/UruDendro/model.pt.zip dataset/UruDendro4_1504/test_inputimages.csv
Where test_inputimages.csv
is a CSV file with the following format:
Code, cx, cy
T0_B1_N32_A.png, 709, 766
#first, train the 3-class segmentation model
python main.py train segmentation \
dataset/EH/train_inputimages.txt \
dataset/EH/train_annotations.txt
#next, train the inbd network
python main.py train INBD \
dataset/EH/train_inputimages.txt \
dataset/EH/train_annotations.txt \
--segmentationmodel=checkpoints/segmentationmodel/model.pt.zip #adjust path
We introduce a new publicly available dataset: MiSCS (Microscopic Shrub Cross Sections)
The dataset and annotations can be downloaded via python fetch_dataset.py
or via the following links:
All images were acquired by Alba Anadon-Rosell.
If you have ecology-related questions, please contact a.anadon at creaf.uab.cat
If you want to use this dataset for computer vision research, please cite the publication as below.
@inproceedings{INBD,
title = "{Iterative Next Boundary Detection for Instance Segmentation of Tree Rings in Microscopy Images of Shrub Cross Sections}",
author = {Alexander Gillert and Giulia Resente and Alba Anadon‐Rosell and Martin Wilmking and Uwe von Lukas},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2023},
pages = {14540-14548}
}
License for the source code: MPL-2.0
License for the dataset: CC BY-NC-SA 4.0