A Fast Instance Segmentation Technique for Log End Faces Based on Metric Learning

The diameter of the logs on a vehicle is a critical part of the logistics and transportation of logs. However, the manual size-checking method is inefficient and affects the efficiency of log transportation. The example segmentation methods can generate masks for each log end face, which helps autom...

Full description

Bibliographic Details
Main Authors: Hui Li, Jinhao Liu, Dian Wang
Format: Article
Language:English
Published: MDPI AG 2023-04-01
Series:Forests
Subjects:
Online Access:https://www.mdpi.com/1999-4907/14/4/795
_version_ 1797605434118373376
author Hui Li
Jinhao Liu
Dian Wang
author_facet Hui Li
Jinhao Liu
Dian Wang
author_sort Hui Li
collection DOAJ
description The diameter of the logs on a vehicle is a critical part of the logistics and transportation of logs. However, the manual size-checking method is inefficient and affects the efficiency of log transportation. The example segmentation methods can generate masks for each log end face, which helps automate the check gauge of logs and improve efficiency. The example segmentation model uses rectangle detection to identify each end face and then traverses the rectangular boxes for mask extraction. The traversal of rectangular boxes increases the time consumption of the model and lacks separate handling of the overlapping areas between rectangular boxes, which causes a decline in mask extraction accuracy. To address the above problems, we propose a fast instance segmentation method for further improving the efficiency and accuracy of log-checking diameter. The method uses a convolutional neural network to extract the mask image, rectangular frame prediction image, and embed the vector image from the input image. The mask image is used to extract the log end face region, and the rectangular frame prediction image generates an enveloping rectangular frame for each log, which in turn divides the log end face region into instances. For the overlapping regions of rectangular boxes, a metric learning paradigm is used to increase the embedding vector distance between pixels located in different logs and decrease the embedding vector distance between pixels of the same log, and finally the mask pixels of the overlapping regions of rectangular boxes are instantiated according to the pixel embedding vectors. This method avoids repeated calls to the contour extraction algorithm for each rectangular box and enables fine delineation of pixels in the overlapping rectangular box region. To verify the efficiency of the proposed algorithm, the log working pile is photographed in different scenes using a smartphone to obtain the end face recognition database and divide the training set, validation set, and test set according to 8:1:1. Secondly, the proposed model is used to obtain log end face masks, and the log end face ruler diameter is determined by an edge-fitting algorithm combined with a ruler. Finally, the practicality of the algorithm is evaluated by calculating the check-rule diameter error, running speed, and the error of wood volume calculation under different national standards. The proposed method has 91.2% and 50.2 FPS of mask extraction accuracy and running speed, respectively, which are faster and more accurate than the mainstream instance segmentation model. The relative error of the proposed method is −4.62% for the check-rule diameter and −4.25%, −5.02%, −6.32%, and −5.73% for the wood volume measurement under the Chinese, Russian, American, and Japanese raw wood volume calculation standards, respectively. Among them, the error of the calculated timber volume according to our standard is the smallest, which indicates that the model in this paper is more suitable for application in domestic log production operations.
first_indexed 2024-03-11T05:01:03Z
format Article
id doaj.art-555b211a74d54712abf8e74dd478b597
institution Directory Open Access Journal
issn 1999-4907
language English
last_indexed 2024-03-11T05:01:03Z
publishDate 2023-04-01
publisher MDPI AG
record_format Article
series Forests
spelling doaj.art-555b211a74d54712abf8e74dd478b5972023-11-17T19:18:00ZengMDPI AGForests1999-49072023-04-0114479510.3390/f14040795A Fast Instance Segmentation Technique for Log End Faces Based on Metric LearningHui Li0Jinhao Liu1Dian Wang2School of Technology, Beijing Forestry University, Beijing 100083, ChinaSchool of Technology, Beijing Forestry University, Beijing 100083, ChinaSchool of Technology, Beijing Forestry University, Beijing 100083, ChinaThe diameter of the logs on a vehicle is a critical part of the logistics and transportation of logs. However, the manual size-checking method is inefficient and affects the efficiency of log transportation. The example segmentation methods can generate masks for each log end face, which helps automate the check gauge of logs and improve efficiency. The example segmentation model uses rectangle detection to identify each end face and then traverses the rectangular boxes for mask extraction. The traversal of rectangular boxes increases the time consumption of the model and lacks separate handling of the overlapping areas between rectangular boxes, which causes a decline in mask extraction accuracy. To address the above problems, we propose a fast instance segmentation method for further improving the efficiency and accuracy of log-checking diameter. The method uses a convolutional neural network to extract the mask image, rectangular frame prediction image, and embed the vector image from the input image. The mask image is used to extract the log end face region, and the rectangular frame prediction image generates an enveloping rectangular frame for each log, which in turn divides the log end face region into instances. For the overlapping regions of rectangular boxes, a metric learning paradigm is used to increase the embedding vector distance between pixels located in different logs and decrease the embedding vector distance between pixels of the same log, and finally the mask pixels of the overlapping regions of rectangular boxes are instantiated according to the pixel embedding vectors. This method avoids repeated calls to the contour extraction algorithm for each rectangular box and enables fine delineation of pixels in the overlapping rectangular box region. To verify the efficiency of the proposed algorithm, the log working pile is photographed in different scenes using a smartphone to obtain the end face recognition database and divide the training set, validation set, and test set according to 8:1:1. Secondly, the proposed model is used to obtain log end face masks, and the log end face ruler diameter is determined by an edge-fitting algorithm combined with a ruler. Finally, the practicality of the algorithm is evaluated by calculating the check-rule diameter error, running speed, and the error of wood volume calculation under different national standards. The proposed method has 91.2% and 50.2 FPS of mask extraction accuracy and running speed, respectively, which are faster and more accurate than the mainstream instance segmentation model. The relative error of the proposed method is −4.62% for the check-rule diameter and −4.25%, −5.02%, −6.32%, and −5.73% for the wood volume measurement under the Chinese, Russian, American, and Japanese raw wood volume calculation standards, respectively. Among them, the error of the calculated timber volume according to our standard is the smallest, which indicates that the model in this paper is more suitable for application in domestic log production operations.https://www.mdpi.com/1999-4907/14/4/795log rulermonocular visioninstance segmentationmetric learning
spellingShingle Hui Li
Jinhao Liu
Dian Wang
A Fast Instance Segmentation Technique for Log End Faces Based on Metric Learning
Forests
log ruler
monocular vision
instance segmentation
metric learning
title A Fast Instance Segmentation Technique for Log End Faces Based on Metric Learning
title_full A Fast Instance Segmentation Technique for Log End Faces Based on Metric Learning
title_fullStr A Fast Instance Segmentation Technique for Log End Faces Based on Metric Learning
title_full_unstemmed A Fast Instance Segmentation Technique for Log End Faces Based on Metric Learning
title_short A Fast Instance Segmentation Technique for Log End Faces Based on Metric Learning
title_sort fast instance segmentation technique for log end faces based on metric learning
topic log ruler
monocular vision
instance segmentation
metric learning
url https://www.mdpi.com/1999-4907/14/4/795
work_keys_str_mv AT huili afastinstancesegmentationtechniqueforlogendfacesbasedonmetriclearning
AT jinhaoliu afastinstancesegmentationtechniqueforlogendfacesbasedonmetriclearning
AT dianwang afastinstancesegmentationtechniqueforlogendfacesbasedonmetriclearning
AT huili fastinstancesegmentationtechniqueforlogendfacesbasedonmetriclearning
AT jinhaoliu fastinstancesegmentationtechniqueforlogendfacesbasedonmetriclearning
AT dianwang fastinstancesegmentationtechniqueforlogendfacesbasedonmetriclearning