1. Introduction
Wood identification is helpful for curbing illegal logging and protecting rare wood species, which play an essential role in timber trade activities. It can also help consumers protect their rights when buying rare and valuable wood products. China is the largest importer of timber in the world; as a result, wood species inspection is a heavy task. The traditional wood species identification methods depend on human expertise; it is inefficient because it is manually performed.
For the purpose of improving the efficiency of wood identification, researchers attempted to identify the wood species using computer technology. Because the cross-section images contain most of the identification features, most of them use the wood cross-section image to identify the species. The previous research works fell mainly into two kinds, the first is based on the traditional machine learning algorithm, and the second is based on the deep learning algorithm.
The first kind of method uses the traditional machine learning algorithm to identify the wood species. For example, Andrade employed support vector machines (SVM) to classify 21 wood species and the accuracy reached 97% [
1]. Mujahid Mohamad proposed a method using e-nose with K-Nearest Neighbors (KNN) analysis to classify two kinds of agarwood in two mediums with 94.5% accuracy [
2]. Xutai CUI proposed using machine learning classification methods including partial least squares-discrimination analysis (PLS-DA), random forest (RF), and other traditional methods to classify spectral data of eight wood species, with the highest correct classification rate (CCR) achieving 98.55% [
3]. Hang-jun Wang proposed a new Gabor-based wood recognition method to classify 24 wood species, with the highest recognition rate of 97.3% [
4].
The second kind of method is using a deep learning algorithm to identify the wood species. For example, Prabu Ravindran proposed a VGG16-based [
5] wood cross-section images classification model trained by transfer learning to identify the wood species of 10 neotropical trees with the highest accuracy of 89.8% [
6]. Fabijańska Anna adopted an approach of using a residual convolutional encoder network in a sliding window setting to classify 14 European tree species, and the correct recognition rate reached 93% [
7]. Xinjie Tang proposed a method, the minified Squeeze-Network method, used for transfer learning, which is trained to identify 100 commonly trading wood types found in Malaysia with Top-1 accuracy of 78% [
8]. Liu presented a split-shuffle-residual (SSR)-based convolutional neural network (CNN) that can extract features automatically from wood images for real-time classification of rubber wood boards and had an accuracy of 94.86% [
9].
Although these two kinds of methods reduced the requirements of the operators and succeeded in some species, it is still hard to use in some rare and valuable wood species because the number of rare woods is stubbornly small. Furthermore, these methods cannot be used to identify the unknown wood species that do not take part in the model training. Any unknown species will be erroneously classified into one of the trained species. It affects the trust in the wood identification system seriously.
One-class classification (OCC) algorithms only require positive samples to train models and can filter unknown species with small training datasets. For example, Lukas Ruff proposed a new deep one-class classification method named deep support vector data description (Deep-SVDD). The experimental results on the MNIST and CIFAR-10 image datasets show the effectiveness of the performance of the Deep-SVDD method [
10]. Paul Bergmann proposed an uninformed student-based one-class learning network and applied it to anomaly detection and one-class classification and improved over state-of-the-art methods on many datasets [
11]. Wenpeng Hu proposed a new one-class classification method called HRN (H Regularization with 2-Norm instance-level normalization) and applied it to one-class classification. The experimental results show that HRN significantly outperforms the existing state-of-the-art deep or Non-deep learning models [
12]. Although these methods have achieved good performance on public datasets, they do not have good generalization, and these public datasets are highly distinguishable and easy to identify [
13].
In this article, we propose a new method that is based on the OCC method, which is able to distinguish the unknown species. It extracts the image features using the VGG16 model and recognizes the species with the OCC method. The object of this study is to classify cross-sectional images of wood. Not only are the macro-wood characteristics normally distributed, but also the distribution of many image features is normal [
14,
15,
16]. Therefore, we also propose a normal distribution test method as a feature selector to improve the recognition performance. In the experiment on five rare wood species, the results showed that this method reached good accuracy. In the testing on a public wood image dataset, it displaced a good generalization performance.
The highlights of our article are as follows.
We created a “Wood Image” dataset containing 585 images of rare and precious wood species from the Herbarium of Southwest Forestry University, and we have removed blurry and unclear images. The wood cross-section images in the dataset contain wood ray and tube hole distributions and color information for wood cross-sections. Annotation of these images is performed by experienced experts with specialized knowledge. This dataset does not just serve as a benchmark to evaluate the performance of the proposed method, but also provide a reference for follow-up research.
In this paper, we first proposed a model combining a deep learning feature extractor based on transfer learning and a feature filter based on the normal distribution test with a one-class classification algorithm and applied it to the field of wood recognition. Our model can automatically extract features from wood cross-sectional images and quickly classify rare and valuable wood species.
The classification performance on the “Wood Images” dataset shows that the proposed wood identification method based on one-class algorithm outperforms other traditional one-class classification methods and classic deep one-class classification methods. Tested on the public datasets, our model has a good generalization and can recognize the wood species which is untrained and put it into unknown wood species.
4. Results and Discussions
The proposed method was used to build models for each wood species, and the models were tested separately. For each test, we split the samples into two parts, the first part was marked as the positive sample, which contains the specified wood species. Furthermore, the second part was marked as the negative sample, which contains the other wood species. For each model, the number of the positive sample around is 100, and the number of the negative sample approximate is 485.
Table 2 is the recognition results of five wood species using our method, and it showed that our proposed method is a feasible one-class wood species classification. The mean accuracy of models is 0.848, the mean of recall of models is 0.848, the mean precision of models is 0.896, and the mean of F1-score of models is 0.856.
The recall is an appropriate evaluation criterion for recognizing special species, and the positive recall indicates the ability of the model picked the positive sample from the amassed and mixed samples set.
Table 3 is the recall of the positive sample, in which, the mean of recall reached 0.842, and the recall of four in five species reached 0.90. It implied that our method has a good ability to pick up the assigned wood species from mixed samples.
The advantage of one-class classification is that it has the ability to reject negative samples. For the purpose of evaluating the model performance of rejecting the negative samples, around 585 images were tested in the experiments. The negative recall is the best measurement for rejecting negative samples, as
Table 3 shows. The results show that the mean of negative recall is 0.842, for
Dalbergia tucurensis, the negative recall is as high as 0.99, which means the
Dalbergia tucurensis model has good accuracy in rejecting the sample faking as
Dalbergia tucurensis. These results provide evidence that our proposed method has a good ability to reject negative samples.
Considering both the positive recall and the negative recall, it supports the idea that the pre-trained VGG16 neural network has the ability to extract similar features from similar wood images. The notable finding is that the model was trained only by one species. It not only recognized the positive samples but also rejected the negative samples. This study represented a new approach that recognizes the wood species only use the positive samples and do not need to collect a mass of negative samples. It saves time and labor because the species of the tree are huge, and it is hard to collect all species samples.
4.1. The Comparsion of Classifier
Three different classifiers were compared in the experiments, and the results showed that our method has the best performance in accuracy, precision, recall, and F1-score.
Figure 6,
Figure 7,
Figure 8 and
Figure 9 illustrated the difference between them. It is easy to find that our method performance is higher than OCSVM and IF and LOF, and the previous study also displayed this phenomenon [
38,
39].
In previous work, Local Binary Pattern (LBP), Fourier descriptor, Gabor filter and the Wavelet descriptor were used to extract the image feature, and the F1-score reached 0.81 [
40,
41]. Our method used a pre-trained neural network (VGG16) instead of these extractors and obtained a similar F1-score of 0.87. It was shown that the pre-trained neural network is an organic structure that can find common features from similar images.
OCSVM divides the dataset with a hyperplane, it is suitable for the sparse features with robustness [
42]. LOF calculates the class boundary using a distance, it is also based on the hypersphere to determine whether a data belongs to a group. Previous one-class classification research has succeeded in many fields; for instance, it was used to detect the anomaly signal in the diffusion process of semiconductor manufacturing [
43], was used to classify condition monitoring of marine machinery systems [
44], and has good accuracy. However, another study reported that the LOF is not very good for classifying the cyanobacterial fluorescence signals. Furthermore, the author said the performance of the LOF is low due to the small distance between the normal data and the outlier [
45]. This implied that the features of wood are sparse.
4.2. Comparison with Deep-SVDD
The Deep-SVDD is a one-class method based on the deep neural network, and it had good performance in open datasets [
10]. For comparison with Deep-SVDD, we add negative images in each species around 10%, and split the dataset into a training sub-dataset and a testing sub-dataset with a ratio of 8:2. The results of the testing dataset are shown in
Figure 10; it shows that the accuracy of our method is higher than Deep-SVDD in majority species, especially in the fifth species, our method is far higher than Deep-SVDD. Furthermore, it shows that the Deep-SVDD is not suitable for all wood species, indicating that Deep-SVDD’s generalization performance is not as good as our method.
We split the training dataset and testing dataset randomly 10 times, and obtained the mean results in
Table 4. It not only presented the difference in the accuracy but also presented the difference in the precision, recall, and F1-score. A significant difference is that the precision, recall, and F1-score is 0 in the fifth wood species. Formulas (
12)–(
14) indicate that the variable TP is 0, which means the Deep-SVDD model does not have the ability to recognize the fifth wood species.
This comparison shows that our method is better than the Deep-SVDD for three reasons. First, our method does not need the negative samples, but it is necessary for the Deep-SVDD. Second, the measurements of our method are higher than the Deep-SVDD in the majority of species. Third, the generalization performance of our method is better than the Deep-SVDD.
4.3. Features of Wood
Because we acquired images with 20X magnification, a cross-section image cannot contain all anatomical features that are used to distinguish the wood species. We can easily find the difference between the images in
Figure 11, in which the distributions of the pore are significantly different. For example,
Figure 11a has a three-pore feature,
Figure 11b has a two-pore feature, and
Figure 11c has a fewer pore feature in it.
Figure 11d–f are
Dalbergia stevensonii and
Figure 11g–i are
Diospyros crassiflora,
Figure 11j–l are
Millettia stuhlmannii,
Figure 11m–o are
Cassia siamea, and they all have different features in different image, especially the feature of pore distribution as above.
It can be seen that most of the features marked on the image are sparse, so we choose the classification method that is suitable for sparse features.
Figure 6,
Figure 7,
Figure 8 and
Figure 9 show the experimental results of our method compared with three conventional methods. It is obvious that the proposed method outperformed the others in accuracy, precision, recall, and F1-score. The experimental results proved that our method is suitable for sparse features and works best.
For other wood species images, they all have different anatomy and texture features in different images. In the majority, the features of the wood species are sparse. In the real laboratory, wood species identification often needs multiple slice images at the same magnification because one slice image has not concluded all anatomy features. Thus, using multiple images to classify and using voting to determine the wood species is a feasible solution.
4.4. Feature Filtering
Feature filtering is necessary before the one classification due to the features from the neural network being a vast dataset. Some of them are species features and some of them are noise that has interference when training the one classifier model. A normal distribution test method was used in experiments, which picked responses from the locations which have a similar output for species from fully connected layers.
The pre-trained VGG16 network was trained by the ImageNet dataset, which contains 1000 categories and generates similar outputs for the same category, and it indicates that giving the VGG16 model similar input will obtain similar output. Wood images from the same species often are similar and theoretically, the outputs also are similar.
Table 5 demonstrated the feature number of VGG16 and the number of filtered
t ⩾ 0.05, it shows that the feature was shrunk significantly.
The resolve is will obtain when r = 0.75 which is the worst recall in experiments.
Figure 12,
Figure 13,
Figure 14 and
Figure 15 show that the filtered feature data obtains better experimental performance than the original feature data in wood species of the 2–5. When identifying tree species 1, the filtered feature dimension is reduced a lot, which greatly reduces the amount of computation with almost no loss of accuracy.
The Dalbergia tucurensis has more filtered features than others, it implied that the majority of features of this species are centered in a small area, which can easily be acquired by a single magnification. Other species have more features after being filtered, which means their features spread over a wide area and are often distributed in different magnified images.
For the purpose of obtaining a certain result, a feasible approach is to use nine images from different positions of the same sample to identify wood species and treat the sample as a specific species when more than five images are classified as the same species. Define the recall is
r and image number is
n, then final recall
R can be represented as Formula (
15).
4.5. Generalization for Negative Samples
We tested our built models on a public dataset [
40], which contains 440 images from 11 wood species.
Figure 16 is the sample images of the public dataset. All images also acquired by magnifying glass.
The wood recognition models are not trained from these species, they all are negative samples for the models. The test results showed that our models have a high negative recall to pick them out, as shown in
Table 6. There is strong evidence that our method has good generalization performance for unknown species, and has a good recognition ability to pick up the assigned species in the complex environment. It is inferred that this method has a better ability to extract common features from the wood species, and it is a feasible approach for wood recognition in real application.