Next Article in Journal
BLE-Based Indoor Tracking System with Overlapping-Resistant IoT Solution for Tourism Applications
Next Article in Special Issue
Intelligent Decision-Making of Scheduling for Dynamic Permutation Flowshop via Deep Reinforcement Learning
Previous Article in Journal
Optimal Trajectory Planning for Wheeled Mobile Robots under Localization Uncertainty and Energy Efficiency Constraints
Previous Article in Special Issue
Real-Time Monitoring for Hydraulic States Based on Convolutional Bidirectional LSTM with Attention Mechanism
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Letter

Online Color Classification System of Solid Wood Flooring Based on Characteristic Features

College of Mechanical and Electronic Engineering, Nanjing Forestry University, Nanjing 210037, China
*
Author to whom correspondence should be addressed.
Sensors 2021, 21(2), 336; https://doi.org/10.3390/s21020336
Submission received: 10 December 2020 / Revised: 31 December 2020 / Accepted: 1 January 2021 / Published: 6 January 2021

Abstract

:
Solid wood flooring has good esthetic properties and is an excellent material for interior decoration. To meet the artistic effects of specific interior decoration requirements, the color of solid wood flooring needs to be coordinated. Thus, the color of the produced solid wood flooring needs to be sorted to meet the individual needs of customers. In this work, machine vision, deep learning methods, and ensemble learning methods are introduced to reduce the cost of manual sorting and improve production efficiency. The color CCD camera was used to collect 108 solid wood floors of three color grades provided by the company and obtained 108 18,000 × 2048 pixel wood images. A total of 432 images were obtained after data expansion. Deep learning methods, such as VGG16, DenseNet121, and XGBoost, were compared. After using XGBoost to filter the features, the accuracy of solid wood flooring color classification was 97.22%, the training model time was 5.27 s, the average test time for each picture was 51 ms, and a good result was achieved.

1. Introduction

Solid wood flooring is made of natural wood. It has the functions of adjusting temperature and controlling air humidity. It has no pollution release during use. In addition, its natural texture and color can bring a strong sense of comfort, which is excellent for indoor decoration [1]. As early as the European Baroque art period, solid wood flooring has become a decorative material that wealthy people prefer to use. People process different colors of natural bark into artistic patterns that meet specific interior decoration needs to enhance decorative effect and grade. With the current increase in the demand for wood, improving the production efficiency and yield of solid wood flooring has become a requirement for flooring companies. The manual color sorting of solid wood floors has low production efficiency and high labor costs. Thus, the introduction of machine vision technology to sort the colors of solid wood floors can improve the automation and intelligence level of the solid wood floor production process and efficiency greatly.
Classification algorithms have always been a hotspot in data mining research [2]. The color classification and classification prediction of solid wood flooring are processes of mining feature information in image data.
At present, the color classification of wood usually begins from two directions: one is to extract better feature values, and the other is to select a more accurate classifier. Some studies have designed better color characteristics to describe the wood color [3,4,5,6]. Barmpoutis [7] proposed a method to enable the representation of wood images as concatenated histograms of higher-order linear dynamical systems produced by vertical and horizontal image patches; Hiremath [8] proposed an efficient multiresolution method for texture classification based on anisotropic diffusion and local directional binary patterns (LDBP). Some studies used more accurate classification algorithms for classification [9,10]. Nasir [11] compared and evaluated the performance of artificial neural networks (ANN), SVM, and naive Bayes (NB) classifiers for thermowood classification and obtained the conclusion that the SVM and NB models can be used for online quality control. Nasir [12] used the “adaptive neuro-fuzzy inference system” (ANFIS), “Group Method of Data Handling” (GMDH), and “multilayer perceptron” (MLP) neural networks for predicting the wood properties and found that the ANFIS and GMDH neural network are better than MLP. With the development of machine learning, deep learning methods have also been used in the non-destructive testing of solid wood [13]. Li [14] presented a split-shuffle-residual (SSR)-based CNN that can learn features automatically from wood images for real-time classification of rubber wood boards.
Many methods can be used for detecting and classifying wood surface colors using machine vision [15]. However, only few color classifications for the entire board are currently available. The SVM algorithm is sensitive to missing data, and there is no general solution to the nonlinear model; the convolutional neural network algorithm input image size is constrained, the required training set data are large, and the training time is long; and Bayesian classification needs to know the prior probability, and the classification error exists. The KNN algorithm is a lazy learning method with slow calculation speed, weak interpretability of the output, and difficulty in determining the K value. Meanwhile, K-means [16] is an unsupervised learning method. Like the KNN method, the K value is not easy to select, and a local optimal solution is obtained, which is sensitive to noise. The classification effect is greatly affected by the selection of the initial clustering center. XGBoost uses regularization to prevent overfitting, can customize the loss function, uses parallel optimization, and has high efficiency. It also supports column sampling, which can reduce overfitting and calculation. This paper extracted the color features of a wood surface and then used XGBoost [17] (eXtreme Gradient Boosting) for classification. Subsequently, the importance of each color feature value on the final classification result was calculated to screen for achieving the effect of using the least feature values to make the best prediction.
The innovations of this paper are as follows: (a) introducing the XGBoost classification model in the color classification of solid wood flooring; and (b) removing features with low variance to select the most important features in wood color classification. The contributions of this paper are (a) color classification of the whole piece of solid wood flooring; and (b) classification and screening of the importance of the color features of solid wood flooring and finding the most important color features to improve the speed and accuracy of color classification.

2. Materials and Methods

2.1. Imaging

In the actual production, performing color classification on the image of the solid wood flooring processed through several processes is necessary. The structure of the image acquisition system built in this article is shown in Figure 1. The acquisition system mainly includes four components, namely, the transmission device, CCD camera, camera fixing device, and control device.
The core device of the CCD camera used in the image acquisition system was the Linea LA-GC-02K05B color line scan camera from Teledyne DALSA. The specific parameters of this device are shown in Table 1. The camera adopts high-sensitivity complementary metal–oxide–semiconductor (CMOS) technology, and the line frequency can reach up to 26 KHz, with high acquisition speed, low noise, high single-line resolution, and high sensitivity. To reduce the influence of light conditions on the acquisition effect during the data acquisition process, ensuring uniform illumination and minimizing the light reflection in the data acquisition area are necessary to improve the imaging quality of the acquired image. Therefore, the linear light source LCOL-300-25 was selected to meet the requirement of uniform illumination in the single-line area required by the linear CCD camera. When collecting data, the scanning frequency is set to 1280 lines for processing once, and after collecting data on the front of each sheet, a 2048 × 18,000 pixel image of a solid wood board with a depth of 8 bits can be obtained.

2.2. Preprocessing Images

The solid wood flooring enterprises provided 36 pieces of flooring of each color, making a total of 108 pieces. Example of each color of flooring is shown in Figure 2. After scanning each piece of flooring, the initial dataset was obtained. The distribution of the initial dataset is shown in Table 2.
After graying the three-channel color image in the BMP format collected by the camera, morphological operations, such as corrosion and expansion, were performed. The canny operator was used to obtain the boundary and extract the solid wood flooring image from the black background to reduce the impact of the background. The obtained result is shown in Figure 1. Then, the solid wood floor image, which was removed from the background, was converted into three color spaces. The original image of the three-channel RGB (Red, Green, Blue) was converted into HSV (Hue, Saturation, Value). The laboratory color space, which is based on an international standard for color measurement established by the Commission International Eclairage (CIE) in 1931 and improved in 1976, was used to extract the color features.
The general description methods for color features include color histograms, color moments, color aggregation vectors, and color correlation graphs. This article selects the use of low-order color moments (e.g., first-order and second-order color moments) and the peak of the color histogram as the color features to describe the solid wood flooring. The first-order color moment μ i and the second-order color moment σ i are mathematically defined as follows:
μ i = 1 N j = 1 N p i , j
σ i = ( 1 N j = 1 N ( p i , j μ i ) 2 ) 1 2
where p i , j is the pixel value at the image coordinate, and its actual meaning represents the pixel mean and variance of a picture.
The average value of wood image pixels can be used as a better feature to describe the overall color distribution of wood images. The variance describes the uniformity of the image distribution in the color domain. The color of common wood images will not change greatly. Thus, the second-order color moments can stand for the texture feature in some degree. Generally, the judgment of which color grade solid wood flooring belongs to is often determined by its background color rather than the color of its texture. The background color is often the color with the largest proportion of colors on a solid wood floor. The color histogram of three types of wood board images is shown in Figure 3. The peaks of the color histograms of different colors of solid wood flooring are quite different. Therefore, the peak of the color histogram was selected to represent the background color of the solid wood flooring as a feature of solid wood flooring color classification. Finally, it was planned to use the currently extracted 27 color features to classify the color of the solid wood flooring.

2.3. Color Classification Algorithm for Solid Wood Flooring

Common classification models include SVM, multilayer perceptron (MLP), extreme gradient boosting (XGBoost), and deep learning methods. MLP is a forward-structured neural network, and the hidden nodes of the network need to be determined by themselves. The classic SVM algorithm usually performs two classification operations. If multi-classification is performed, then it will increase the training time and computational cost. XGBoost is derived from the gradient boosting framework, but it is more efficient. The algorithm can be calculated in parallel and is effective for sparse data. The processing and memory usage optimization are 10 times faster than the existing gradient boost implementation.
Extreme gradient boosting (XGBoost) [18,19,20] is a tree ensemble model. For a given n of data with m features, the sum of K trees is used as the prediction result.
y i ^ = ϕ ( x i ) = k = 1 K f k ( x i ) ,   f k
where = { f ( x ) = w q ( x ) } ( q : m T , w T ) represents the space of the regression tree, T represents the number of leaves of the tree, each f k ( x ) corresponds to the tree structure q and the weight of the leaf w ,   x i represents the i t h sample, and y i represents the i t h category label.
Establish the loss function:
( ϕ ) = i l ( y i ^ , y i ) + k Ω ( f k ) ,
where
Ω ( f ) = γ T + 1 2 λ w 2 ,
where l represents the difference between y i ^ and y i , and Ω is the penalty function on the complexity of the model. The optimization parameter of ( ϕ ) is a model, which cannot be optimized by traditional methods. Therefore, the method of addition is used during training, and f t is added in the t round to minimize the following goals:
( t ) = i = 1 n l ( y i , y ^ i ( t 1 ) + f t ( x i ) ) + Ω ( f t )
Carry out the Taylor expansion of the objective function, take the first three terms, and ignore the infinitesimal terms, and obtain
( t ) i n [ l ( y i , y ^ ( t 1 ) ) + g i f t ( x i ) + 1 2 h i f t 2 ( x i ) ] + Ω ( f t ) ,
when g i = y ^ ( t 1 ) l ( y i , y ^ ( t 1 ) ) ,   h i =   y ^ ( t 1 ) 2 l ( y i , y ^ ( t 1 ) ) .
After solving the objective function, the optimal leaf node score is obtained,
w j * = i I j g i i I j h i + λ .
Substitute the leaf node scores into the objective function and obtain
˜ ( t ) ( q ) = 1 2 j = 1 T ( i I j g i ) 2 i I j h i + λ + γ T .
Under normal circumstances, enumerating all and selecting the best possible tree structures are impossible. Thus, a greedy algorithm is used instead: starting from a single leaf node that is iteratively split to add nodes to the tree, I L , I R are the set of left and right nodes after splitting. Then, the loss function after node segmentation is
s p l i t = 1 2 [ ( i I L g i ) 2 i I L h i + λ + ( i I R g i ) 2 i I R h i + λ ( i I g i ) 2 i I h i + λ ] λ .
The tree learning model needs to find the optimal segmentation point. The basic precise greedy algorithm can be used to enumerate all possible partitions of all features to find the optimal segmentation point. When the amount of data is large, an approximate algorithm can be used. This can be used to obtain the percentile, propose n candidate segmentation points, and then map the sample to the two corresponding adjacent segmentation points to form a block, and the objective function can be transformed into
˜ ( t ) = i = 1 n 1 2 h i ( f t ( x i ) g i h i ) 2 + Ω ( f t ) + c o n s t a n t .
The algorithm flow chart is shown in Figure 4:
As shown in Figure 4, the XGBoost algorithm, at first, initializes the mapping relationship between the sample and position of the tree node, then it initializes the list of leaf nodes, and after that, it calculates the weight, gain, and gradient of the leaf nodes. If the depth of the tree is reached, it calculates the weight for the final leaf node. If not, it assigns samples to the new left and right leaf nodes based on the split point, then it initializes a new list of leaf nodes to be split and calculates the weight, gain, and gradient of the leaf nodes.

3. Results

We extracted the first-order color moment, the second-order color moment, and the peak of the color histogram from the nine color channels of R, G, B, L, a, b, H, S, and V of the solid wood flooring image. Subsequently, XGBoost was used for classification. The XGBoost parameters are presented as follows: the learning rate was 0.001, the number of trees was 1000, the depth of the tree was 3, the minimum weight of the leaf node was 0.1, the penalty term coefficient was 0.2, and Softmax was used as the loss function.
All the codes of the wood color classification were written in Python, using the machine learning package scikit-learn, which includes the API for XGBoost. The deep learning network used in this paper is the deep learning framework PyTorch to define the network calculation graph. The software, hardware, and compilation environment configuration of this experiment is detailed in Table 3:
The 108 solid wood flooring images obtained by scanning were divided into test and training sets according to 1:3. The accuracy rate of the test set was 97.22%. The confusion matrix of the test results is shown in Figure 5:
The classification accuracy of dark and light colors is high and can be fully recognized, whereas the division of medium colors is fuzzier, which is consistent with the human senses. The reason is that the color classification boundaries of light and medium colors are more obvious. The classification boundary between medium and dark color is blurred, which is related to the color classification standard provided by the manufacturer. Thus, being confused between medium color and dark color is inevitable. The color feature importance value of each of the solid wood flooring images in the XGBoost classification model is calculated, and the feature importance map is sorted. In Figure 6, labels 1, 2, and m on the x-axis in the graph represent the first-order moment, second-order moment, and peak value of the color histogram of the corresponding channel. For example, a1 represents the first-order moment of channel “a” in the Lab color space, a2 represents the second-order moment of channel “a” in the Lab color space, and am represents the peak value of the color histogram of channel “a” in the Lab color space.
The first-order moment of the L, S, and V channels; second-order moment of the S, V, L, and R channels; and the color histogram peak value of the S, H, a, L, and V channels have no impact on the classification result. The importance score of the S and V channels is zero, indicating that the saturation value has no effect on the color classification of solid wood flooring. It also indicates the robustness of the model under different lighting conditions. The first-order moments of the a, B, H, G, and b channels have a great influence on the final classification effect. The reason is that the laboratory color space is a color model established on the basis of the human perception of color. The decorativeness of solid wood flooring often depends on human senses, and the color tone of the solid wood flooring is mainly yellowish [21], thereby reflecting the importance of the B and G channels. Table 4 can be obtained by feature screening over a defined threshold:
Table 4 shows that after the first-order moments of the L, S, and V channels; the second-order moments of the S, V, L, and R channels; and the color histogram peaks of the S, H, a, L, and V channels are removed, the color classification can still be performed with 97.22% accuracy, although from Table 4, at least three feature values, namely, the color first moments of the a, B, and H channels, can be used for color classification. However, for the stability of the model, the color feature whose contribution is not zero is still used for prediction. After re-extracting 15 valid features, a new XGBoost model was re-established. After the new classification model was retrained, the classification accuracy rate of 97.22% was still obtained in the test set.

4. Discussion

At present, with the development of image classification technology, deep learning technology is used in many image processing works. Common deep learning networks include vgg16, Resnet, and Densenet. The process of extracting eigenvalues can be skipped by using deep learning technology. The structure of some deep learning networks is shown in Table 5 and Table 6.
In order to improve the training effect of deep learning, the left–right symmetry, top–down symmetry, and diagonal symmetry of the removed background image were used to obtain the expanded dataset. The expanded dataset is divided into the test set and training set according to 1:3. The distribution of the dataset is shown in Table 7.
The deep learning model was trained under the following parameters: the loss function is cross-entropy, the optimizer is SGD, the learning rate is 0.01, the batch size is 16, and the number of epochs is 50. In order to speed up the model training, the pretrained model on the Imagenet dataset is used for transfer learning. The loss curves of deep learning models is shown in Figure 7.
The comparison of using color features for prediction and convolutional neural network effects is presented as follows. To use XGBoost, we need to extract image features first, then train the classification model for the extracted features, so the time used for the two tasks is calculated respectively.
Table 8 shows that the classification method based on feature values can obtain higher classification accuracy with less training time. The classification accuracy of the deep learning classification model increases with depth. The time used by the XGBoost classification model is much shorter than that of the convolutional neural network method. Given that XGBoost uses regularization terms to prevent overfitting and considers the case where the training data are sparse values, the impact of missing data on the model can be ignored. In addition, the model can be obtained faster and is more suitable for training small samples because the XGBoost model is faster than the deep learning training models, such as VGGNet16 and Densenet121. Therefore, online learning can be realized, and the daily influence of external factors on the color classification of solid wood flooring can be reduced during actual production.
In this study, the image resolution obtained by the CCD line scan camera is relatively large and the data volume of the whole solid wood flooring image is large. Therefore, the feature extraction of the solid wood flooring image takes a long time and consumes a large memory space, thereby affecting the speed of online detection to a certain extent. Therefore, designing an efficient feature extraction algorithm is necessary.

5. Conclusions

In this study, the first-order color moments, the second-order moments of the nine color channels, and the peak value of the color histograms of R, G, B, L, a, b, H, S, and V of the solid wood flooring image were extracted and then classified using the XGBoost model to complete the coloring of the target solid wood flooring. After dividing the 108 pictures obtained by scanning into test and training sets according to a 1:3 ratio, the average accuracy rate of the 27 test set pictures after testing was 97.2%. The classification accuracy for dark and light colors can reach 100%, the classification accuracy for medium colors was 91.7%, and the average classification time for a single solid wood floorboard was 51 ms. After comparing the XGBoost classification model with the classification effects of different deep learning networks, such as VGG16 and Densenet121, XGBoost has great advantages in terms of model training and model classification speed. In particular, the training speed required to obtain the classification model is several orders of magnitude faster, as well as the classification accuracy, than that of the deep learning model.

Author Contributions

Conceptualization, Z.Z. and Y.L.; methodology, Z.Z.; software, Z.Z.; validation, Z.W. and F.D.; resources, F.D. and Z.Z.; writing—original draft preparation, Z.Z.; writing—review and editing, Y.L.; project administration, Y.L.; funding acquisition, Y.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the 2019 Jiangsu Province Key Research and Development Plan by the Jiangsu Province Science and Technology under grant BE2019112.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data are not publicly available due to the company requirements.

Acknowledgments

In addition to the funds we received, we would also like to thank China Jiangsu Jiangjia Machinery Co., Ltd. for providing us with materials and support for the image collection.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Jafarian, H.; Demers, C.M.H.; Blanchet, P.; Landry, V. Impact of Indoor Use of Wood on the Quality of Interior Ambiances under Overcast and Clear Skies: Case Study of the Eugene H. Kruger Building, Quebec City. Bioresources 2016, 11, 1647–1663. [Google Scholar] [CrossRef] [Green Version]
  2. Li, M.D.; Chen, Q.W.; Huang, P.L.; Zhou, J.; Gong, W.K. A Review of Classification Algorithms for Data Mining; Clausius Scientific Pr Inc.: Ottawa, ON, Canada, 2019; pp. 364–370. [Google Scholar]
  3. Navarro, C.F.; Perez, C.A. Color-Texture Pattern Classification Using Global-Local Feature Extraction, an SVM Classifier, with Bagging Ensemble Post-Processing. Appl. Sci. 2019, 9, 3130. [Google Scholar] [CrossRef] [Green Version]
  4. Sousa, W.; Barbosa, L.D.; Soares, A.A.V.; Goulart, S.L.; Protasio, T.D. Wood colorimetry for the characterization of amazonian tree species: A subsidy for a more efficient classification. Cerne 2019, 25, 451–462. [Google Scholar]
  5. Lee, J.; Cai, X.; Lellmann, J.; Dalponte, M.; Malhi, Y.; Butt, N.; Morecroft, M.; Schonlieb, C.-B.; Coomes, D.A. Individual Tree Species Classification From Airborne Multisensor Imagery Using Robust PCA. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2016, 9, 2554–2567. [Google Scholar] [CrossRef] [Green Version]
  6. Hiremath, P.S.; Bhusnurmath, R.A. Multiresolution LDBP descriptors for texture classification using anisotropic diffusion with an application to wood texture analysis. Pattern Recognit. Lett. 2017, 89, 8–17. [Google Scholar] [CrossRef]
  7. Barmpoutis, P.; Dimitropoulos, K.; Barboutis, I.; Grammalidis, N.; Lefakis, P. Wood species recognition through multidimensional texture analysis. Comput. Electron. Agric. 2018, 144, 241–248. [Google Scholar] [CrossRef]
  8. Hiremath, P.S.; Bhusnurmath, R.A. Industrial Applications of Colour Texture Classification Based on Anisotropic Diffusion. In Proceedings of the 1st International Conference on Recent Trends in Image Processing and Pattern Recognition (RTIP2R), Karnatak Arts Sci & Commerce Coll, Bidar, India, 16–17 December 2016. [Google Scholar]
  9. Fernandes, D.D.D.; de Almeida, V.E.; Fontes, M.M.; de Araujo, M.C.U.; Veras, G.; Diniz, P. Simultaneous identification of the wood types in aged cachacas and their adulterations with wood extracts using digital images and SPA-LDA. Food Chem. 2019, 273, 77–84. [Google Scholar] [CrossRef] [PubMed]
  10. Stevek, J.; Katuscak, S.; Dubinyova, L.; Fikar, M. An Automatic Identification of Wood Materials from Color Images. In Proceedings of the 28th International Conference on Cybernetics and Informatics (K and I), Levoca, Slovakia, 2–5 February 2016. [Google Scholar]
  11. Nasir, V.; Nourian, S.; Avramidis, S.; Cool, J. Classification of thermally treated wood using machine learning techniques. Wood Sci. Technol. 2019, 53, 275–288. [Google Scholar] [CrossRef]
  12. Nasir, V.; Nourian, S.; Zhou, Z.; Rahimi, S.; Avramidis, S.; Cool, J. Classification and characterization of thermally modified timber using visible and near-infrared spectroscopy and artificial neural networks: A comparative study on the performance of different NDE methods and ANNs. Wood Sci. Technol. 2019, 53, 1093–1109. [Google Scholar] [CrossRef]
  13. Shi, J.; Li, Z.; Zhu, T.; Wang, D.; Ni, C. Defect Detection of Industry Wood Veneer Based on NAS and Multi-Channel Mask R-CNN. Sensors 2020, 20, 4398. [Google Scholar] [CrossRef]
  14. Li, S.; Jiang, W.; Wu, L.; Wen, H.; Liu, M.; Wang, Y. Real-Time Classification of Rubber Wood Boards Using an SSR-Based CNN. IEEE Trans. Instrum. Meas. 2020, 69, 8725–8734. [Google Scholar] [CrossRef]
  15. Peng, Z.; Yue, L.; Xiao, N. Simultaneous Wood Defect and Species Detection with 3D Laser Scanning Scheme. Int. J. Opt. 2016, 2016, 7049523. [Google Scholar] [CrossRef]
  16. Lin, Y.; Chen, D.; Liang, S.; Xu, Z.; Qiu, Y.; Zhang, J.; Liu, X. Color Classification of Wooden Boards Based on Machine Vision and the Clustering Algorithm. Appl. Sci. 2020, 10, 6816. [Google Scholar] [CrossRef]
  17. Chen, T.Q.; Guestrin, C.; Assoc Comp, M. XGBoost: A Scalable Tree Boosting System; Assoc Computing Machinery: New York, NY, USA, 2016; pp. 785–794. [Google Scholar]
  18. Parsa, A.B.; Movahedi, A.; Taghipour, H.; Derrible, S.; Mohammadian, A. Toward safer highways, application of XGBoost and SHAP for real-time accident detection and feature analysis. Accid. Anal. Prev. 2020, 136, 8. [Google Scholar] [CrossRef] [PubMed]
  19. Ma, J.; Ding, Y.X.; Cheng, J.C.P.; Jiang, F.F.; Tan, Y.; Gan, V.J.L.; Wan, Z.W. Identification of high impact factors of air quality on a national scale using big data and machine learning techniques. J. Clean Prod. 2020, 244, 13. [Google Scholar] [CrossRef]
  20. Nguyen, H.; Bui, X.N.; Bui, H.B.; Cuong, D.T. Developing an XGBoost model to predict blast-induced peak particle velocity in an open-pit mine: A case study. Acta Geophys. 2019, 67, 477–490. [Google Scholar] [CrossRef]
  21. Santos, W.A.; Garcia, R.A. Effect of density and color on the surface wettability of eucalypt woods. Sci. For. 2019, 47, 245–255. [Google Scholar]
Figure 1. Image acquisition device. 1. Transmission device, 2. Transmission belt, 3. Control panel, 4. CCD camera holder, 5. CCD camera, 6. Sample solid wood flooring, 7. Photoelectric sensor, 8. Pressure wheel.
Figure 1. Image acquisition device. 1. Transmission device, 2. Transmission belt, 3. Control panel, 4. CCD camera holder, 5. CCD camera, 6. Sample solid wood flooring, 7. Photoelectric sensor, 8. Pressure wheel.
Sensors 21 00336 g001
Figure 2. Solid wood floors in three colors.
Figure 2. Solid wood floors in three colors.
Sensors 21 00336 g002
Figure 3. Color histogram of three wood colors in the (A) RGB, (B) HSV, and (C) Lab spaces.
Figure 3. Color histogram of three wood colors in the (A) RGB, (B) HSV, and (C) Lab spaces.
Sensors 21 00336 g003
Figure 4. XGBoost algorithm flow.
Figure 4. XGBoost algorithm flow.
Sensors 21 00336 g004
Figure 5. XGBoost classification confusion matrix.
Figure 5. XGBoost classification confusion matrix.
Sensors 21 00336 g005
Figure 6. Importance of color features to the classification result ranking diagram.
Figure 6. Importance of color features to the classification result ranking diagram.
Sensors 21 00336 g006
Figure 7. Loss curves of deep learning models.
Figure 7. Loss curves of deep learning models.
Sensors 21 00336 g007
Table 1. Specific parameters of the CCD camera.
Table 1. Specific parameters of the CCD camera.
Parameter NameParameterParameter NameParameter
ModelLinea LA-GC-02K05BSpectrumColor
Sensor TechnologyCMOSOperating Temperature0 °C–65 °C
Resolution2048 × 2Pixel Depth8-bit
Pixel Size7.04 × 7.04 µmHorizontal FrequencyUp to 26 KHz
Table 2. Distribution of the initial dataset.
Table 2. Distribution of the initial dataset.
ColorLightMediumDark
Quantity363636
Table 3. Software and hardware environment configuration table.
Table 3. Software and hardware environment configuration table.
NameParameter
SystemWindows 10 × 64
CPUInter Core [email protected]
GPUNvidia GeForce GTX 2060 SUPER(8G)
Environment configurationPyCharm + Pytorch1.2.0 + Python3.7.7 + skcikitlearn0.23.1 Cuda10.0 + cudnn7.6 + tensorboardX2.1.0
Table 4. Classification accuracy threshold obtained by using different color feature numbers.
Table 4. Classification accuracy threshold obtained by using different color feature numbers.
ThresholdFeature NumberAccuracy (%)
02797.22
0.012111597.22
0.0180691497.22
0.018281397.22
0.0205151297.22
0.0232941197.22
0.030681097.22
0.031688997.22
0.031797897.22
0.075192797.22
0.094652697.22
0.114261597.22
0.127119497.22
0.129506397.22
0.135398294.44
0.137441169.44
Table 5. VGG16 construction.
Table 5. VGG16 construction.
LayersOutput SizeDensnet121
Convolution224 × 2243 × 3 conv-64
3 × 3 conv-64
Pooling112 × 112max pool
Convolution112 × 1123 × 3 conv-128
3 × 3 conv-128
Pooling56 × 56max pool
Convolution56 × 563 × 3 conv-256
3 × 3 conv-256
3 × 3 conv-256
Pooling28 × 28max pool
Convolution28 × 283 × 3 conv-512
3 × 3 conv-512
3 × 3 conv-512
Pooling14 × 14max pool
Convolution14 × 143 × 3 conv-512
3 × 3 conv-512
3 × 3 conv-512
Classification Layer1 × 1max pool
4096D fully connected
4096D fully connected
1000D fully connected, softmax
Table 6. Densenet121 construction.
Table 6. Densenet121 construction.
LayersOutput SizeDensnet121
Convolution112 × 1127 × 7conv, stride 2
Pooling56 × 563 × 3 max pool, stride 2
Dense Block (1)56 × 56×6
Transition Layer (1)56 × 561 × 1 conv
28 × 282 × 2 average pool, stride 2
Dense Block (2)28 × 28×12
Transition Layer (2)28 × 281 × 1 conv
14 × 142 × 2 average pool, stride 2
Dense Block (3)14 × 14× 24
Transition Layer (3)14 × 141 × 1 conv
7 × 72 × 2 average pool, stride 2
Dense Block (4)7 × 7×16
Classification Layer1 × 17 × 7 global average pool
1000D fully connected, softmax
Table 7. Distribution of the expanded dataset.
Table 7. Distribution of the expanded dataset.
Test SetTraining Set
Dark36108
Medium36108
Light36108
Table 8. Effect of different classification methods for the same test set.
Table 8. Effect of different classification methods for the same test set.
Classification MethodClassification Accuracy (%)Training Time (s)Classification Time (s)
VGG160.771002.6672.43
Densenet1210.941069.112.11
XGBoost0.97Image Feature Extraction Time: 4.08Image Feature Extraction Time: 1.044
Training Time: 0.19Training Time: 0.09
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Zhuang, Z.; Liu, Y.; Ding, F.; Wang, Z. Online Color Classification System of Solid Wood Flooring Based on Characteristic Features. Sensors 2021, 21, 336. https://doi.org/10.3390/s21020336

AMA Style

Zhuang Z, Liu Y, Ding F, Wang Z. Online Color Classification System of Solid Wood Flooring Based on Characteristic Features. Sensors. 2021; 21(2):336. https://doi.org/10.3390/s21020336

Chicago/Turabian Style

Zhuang, Zilong, Ying Liu, Fenglong Ding, and Zhengguang Wang. 2021. "Online Color Classification System of Solid Wood Flooring Based on Characteristic Features" Sensors 21, no. 2: 336. https://doi.org/10.3390/s21020336

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop