Efficacy of the Image Augmentation Method using CNN Transfer Learning in Identification of Timber Defect

—This paper discusses the efficacy of the data augmentation method deployed in many Convolutional Neural Network (CNN) algorithms for determining timber defect in four timber species from Malaysia. A sequence of morphological transformation, involving x-reflection and rotation, was executed in the timber defect augmentation dataset for aiding CNN model training and generating the finest CNN models which offer the best classification performance in determining timber defect. For further assessing the CNN algorithms’ classification performance, several deep learning hyperparameters were tried on the Merbau timber species by utilising epoch as well as learning rate. A comparison of the classification performance was then done between other timber classes, namely KSK, Meranti, and Rubberwood. According to the results, the ResNet50 algorithm, which has its basis in the transfer learning methodology, outclasses other CNN algorithms (ShuffleNet, AlexNet, MobileNetV2, NASNetMobile, and GoogLeNet) with the best classification accuracy of 94.59% using the data augmentation method. Furthermore, the outcomes indicate that utilising an augmentation methodology not just addresses the issue of a limited dataset but also enhances CNN classification output by 5.78% with the support of T-test that demonstrates a significant difference across all CNN algorithms except for Alexnet. Our study on hyperparameter optimisation by utilising learning rate as well as epoch is sufficient to infer that a greater number of epoch and learning rate does not deliver superior precision in CNN classification. The experimental findings suggest that the proposed methods improved CNN algorithms classification performance in identification of timber defect while tackling the imbalanced and limited dataset challenges.


I. INTRODUCTION
Of late, a multiple integration of the artificial intelligence algorithm and image processing approach has been studied for determining timber defects as the image segmentation methodology single-handedly cannot precisely categorise such defects. Even though many machine learning algorithms have shown considerable recognition rates for different kinds of timber defects [1] [2] [3], the present manual feature extraction procedure executed in machine learning is considered quite taxing due to its vulnerability to multiple feature attributes within the distinctive appearance of the timber. Therefore, the convolutional neural network (CNN) is deployed for addressing the complex procedure of feature extraction in machine learning as deep learning algorithms not just offer superior classification performance but also provide an automatic feature extraction process which is tailored to the imminent problem during the training procedure. CNN is a deep learning algorithm which blends hierarchical and multilayer network architectures. Its distinctive architecture allows the algorithm to mine diverse abstract representations on the basis of a designated level of features while aiding CNN to imbibe the complex matter with an improved feature set [4]. CNN has exhibited its competence by outclassing traditional computer algorithms when it comes to object identification and image-based classification. Even though such computer algorithms have been utilised for scrutinising actual images in various fields since the 1970s, these pre-fabricated texture algorithms have to be built based on image domain specificities, which is a major issue [5]. CNN demonstrated its ability when DenseNet was able to attain a classification precision of 98.75% while [6] assessing the performance of four novel CNN architectures with pre-determined texturing techniques in the timber domain. Jung et al. [7] made a comparison of the performance of three CNN architecture depths by categorising into four kinds of defect classes. The outcomes indicated that deep CNN attained the best classification precision of 99.8% in determining timber defect, albeit with greater computational time because of the deeper network architecture. Although the precision of the architectures varies a bit, this shows that they are both viable solutions to the issues of timber classification.
Thus, the deep learning methodology presents a good ability for data mining and knowledge breakthrough in the domain of timber defect detection. However, one of the significant challenges in execution of deep learning is data disparity. On one hand, raw data is now more and more accessible; on the other hand, most datasets have unbalanced distributions with some object classes exhibiting plentiful representation and others possessing inadequate representations, like timber defects. Data disparity in deep learning could trigger inadvertent errors with possibly substantial consequences, particularly in classification tasks in which the lopsided distribution of class instances compels classification algorithms to trigger inductive bias with regards to the majority class. This causes a substandard classification performance because of lesser detection of the minority www.ijacsa.thesai.org samples [8] [9]. For dealing with the challenges associated with imbalanced datasets, data augmentation was generally deployed to produce supplementary samples as shown by [10] in their study on imbalanced toxic comments classification by utilising deep learning as well as data augmentation. Moreover, Hu et al. [11] noted that deep learning approaches are not much deployed in the timber industry because of the inadequate quantity of defect datasets necessary for CNN training. Other aspects contributing to the dearth of timber defect images are the outlay incurred for gathering such images and the rigorous manual labelling procedure. One of the effectual techniques for utilising CNNs on minor datasets is espousing transfer learning that encompasses dropping a pre-trained CNN's classifier layer and adjusting it for the target dataset [12]. Thus, the transfer learning and data augmentation approaches might be the solution for addressing class disparity and limited-data problems in timber defect datasets.
This study advocated the use of deep learning approaches, in this case a Convolutional Neural Network (CNN) algorithm to address the complex procedure of feature extraction in machine learning as deep learning algorithms itself not only offer superior classification performance but also provide an automatic feature extraction process which is tailored to the imminent problem during the training procedure. In order to utilize the advantage and capabilities of CNN, both transfer learning and data augmentation technique are used to cater for imbalanced and limited size timber defect dataset. The data augmentation technique employed in this study would involve implementation of various morphological transformation during the image pre-processing process to increase the diversity of timber defect dataset, while the proposed transfer learning method will be applied to several CNN algorithms (ShuffleNet, AlexNet, MobileNetV2, ResNet50, NASNetMobile, and GoogLeNet) in search of highest CNN classification performance across the timber species via multiple combinations of learning rate and epoch parameters.
In addition, both transfer learning and data augmentation technique proposed in this research is necessary to avoid overfitting during the training of deep learning algorithm and achieve greater accuracy for timber defect identification. Besides studying the efficacy of these two methodologies, this research assesses the performance of several CNN algorithms across the four timber classes from Malaysia.

A. Overview of Approach
This portion elaborates the research approach devised to assess transfer learning and data augmentation efficacy based on numerous CNN algorithms to determine timber defects for four species in Malaysia. The initial timber pictures are labelled and classified using species and timber defect categories. The timber defect dataset provided by the Universiti Teknikal Melaka Malaysia (UTeM) is used for this research [13]. Meranti, Rubberwood, Kembang Semangkuk (KSK), and Merbau species were used for this study. Data augmentation approaches were applied to the images representing timber defects to assess process efficacy for CNN classification. Original and enhanced images were sized using the inputs corresponding to the CNN techniques. Subsequently, ShuffleNet, AlexNet, MobileNetV2, ResNet50, NASNetMobile, and GoogLeNet were used for testing the transfer learning approach. The techniques were further assessed to determine hyperparameter configurations for optimal CNN classification effectiveness of timber defects. Lastly, the enhanced dataset was tested for classification efficacy using several deep learning hyperparameter settings for different timber specimens; data were gathered and assessed.

B. Data Augmentation
Data augmentation is regarded as the standard approach in deep learning, specifically when there are fewer data samples. The study considered the Meranti, Merbau, KSK, and Rubberwood timber species; experimental specimens were created using 1600 images representing timber defects. The dataset comprises eight timber defect categories (brown stain, blue stain, knot, borer holes, rot, bark pocket, wane, and split), along with one set of clear timber specimens. The dataset was enhanced using the augmentation technique that allowed data maximisation by processing original images. Several morphological changes (x-reflection and rotation) and different orientations of the original images were used to augment the dataset and enhance CNN timber defect detection accuracy. Researchers [14] assert that several morphological changes also reduce overfitting challenges associated with deep learning by allowing additional variations of the original information. Defect images were represented using 10-degree rotation versions to comprehensively depict defects as they appear on timber surfaces based on the direction of feeding. Image enhancement and other pre-processing approaches helped enhance the original dataset to ten times its initial size, i.e., comprising 16000 timber defect images. CNN architecture training and testing were based on the original and enhanced datasets. Table I presents some information concerning the morphological changes implemented during the image addition pre-processing steps to enhance dataset diversity.

C. Transfer Learning using Convolutional Neural Network (CNN) Algorithms
Using transfer learning for CNN is an effective and practical approach to train deep learning models during labelled specimen scarcity. Transfer learning offers the versatility to change initially-trained systems and tune them using domain-based information. A model trained using a broader dataset is used, and specific weights are preferred over initial model training. Transfer learning acts as a potent approach for enhancing learning speed for image categorization and identification jobs. Higher speeds are possible because previous training jobs are employed, and knowledge is reused to enhance learning speed for new or relatively difficult data models [15]. Further, [16] established that transfer learning was usable for VGG16, AlexNet, and ResNet152 to identify timber defects. ResNet provided 80.6% accuracy when contrasted against the speedier R-CNN framework and other previously-trained transfer learning systems. Moreover, transfer learning is a vital approach to reduce overfitting when training deep learning models [17]. For CNN systems, transfer learning is implemented by assigning convolutional layer weights equal to the starting values for fresh classification problems than the complete network comprising fully-connected layers. Moreover, this approach is specifically beneficial to address the difficulty concerning learning classifiers where strong performance is required, but training samples are limited [18].
 AlexNet is among the initial noteworthy CNN system used for the ImageNet dataset to classify objects [19].
The system consists of five and three convolutional and fully-connected layers, 500,000 neurons, and 58 million parameters. A SoftMax classifier is used after the fullyconnected layers; it outputs the likelihood values for a relevant class [16].
 ShuffleNet works under computational capability constraints, and this deep learning architecture is tuned for mobile devices. The system comprises convolutional and maximum pooling layers, 3 ShuffleUnit elements, global pooling, and fullyconnected layers [20]. The model comprises point-by-point pairing convolution and shuffles channels to maximise classification effectiveness while controlling the need for higher computational abilities [21].
 GoogLeNet is a differentiated neural network framework implementing a novel organisational system called "Inception Module". This module implements several convolution operations along with filter concatenation for subsequent layers. Overall, the system comprises 27 layers (pooling layers included). There are 9 inception elements having maxpooling and convolution processes [22].
 ResNet50 is short for residual network (ResNet) and it comprises 50 layers. Contrasting to other CNN algorithms that amass manifold convolutional layers within their architectures, the ResNet50 architecture comprises diverse sets of identical layers and ascertains blocks which are utilised for signifying the usage of prior layers in the network [23]. Even though the network architecture is quite deeper, the quantity of parameters is quite smaller as against other equivalents [24].
 NASNetMobile is a neural architecture search net (NASNet) variation which emphasises on the mobile and embedded platforms. The architecture's central structure utilises data-led and intelligent methodologies to construct network frameworks which are optimised through reinforcement learning. It generates a feature map by deploying repeated operations on either convolutional cells (reduction cell and normal cell) throughout the architecture [25]. The architecture comprises 12 cells having 5.3 million parameters [26].
 The MobileNetV2 architecture is enhanced for mobile computing. It decreases consumption of memory and delivers speed at a lower cost while removing overfitting on minor datasets [27]. The inverted residual and depth wise separable convolution are two of the main aspects in the MobileNetV2 architecture that comprises 32 entirely convolutional filters and 19 residual bottleneck layers [28]. MobileNetV2 has 3.47 million parameters [26]. www.ijacsa.thesai.org In this research, transfer learning is implemented by altering the output class of both fully connected layer and classification layer of the CNN algorithms according to the number of classes in the timber defect dataset (9 classes). However, the other important CNN layer such as convolutional layer, activation function (ReLu), pooling layer are kept in their original algorithm architecture. Furthermore, all six CNN algorithms were fine-tuned to match the data in this article by retraining the weightage of each CNN layer. For model finetuning, each of the CNN algorithm was trained 48 times using different combinations of learning rate and epoch parameters across multiple timber species. While other training options such as stochastic gradient descent with momentum (SGDM) optimizer and batch size (10) were used and maintained throughout the training. Even though a decent predictive performance entails a huge number of annotated datasets, transfer learning is frequently utilised to adjust for data paucity. As per the observations by [29], the limited dataset will be sufficient for the remaining layers for learning the features in the pertinent domains, since the architecture had attained vital features like corners in their initial few layers. Thus, transfer learning has been seen to be a mostly effective technique for training neural networks having a limited dataset, and offers a significant promise in the domain of classifying timber defects.

D. Hyperparameter Optimization
Hyperparameter optimisation is a primary constituent essential in deep learning training for enhancing the CNN algorithms' performance. Even though the procedure is quite tough as well as time-consuming, the fine-tuning is necessary to warrant the high classification performance of these algorithms since these are the variables which the model is unable to learn independently. While there exist many proposals on automatic optimisation methods, each has its own merits and demerits when implemented for diverse kinds of problems [30]. Batch size, learning rate, and training epochs are few of the hyperparameters which are adjusted as per the intricacy of the problems or datasets because the model has to possess adequate capability for prediction tasks while evading over-fitting [31]. The learning rate is a vital hyperparameter in deep learning since it outlines the step size at every iteration for the objective function to congregate [32]. The learning rate is augmented by a superior learning rate; however, the gradient might fluctuate around a local minimum value or perhaps fail to congregate. A minor learning rate would congregate smoothly but with a substantial rise in model training time because of supplementary training epochs. Notably, in case the gradient is trapped at local minima, visible progress is achieved at the expense of computational outlay [33]. With a proper rate of learning, the objective function has to be able to congregate to a global minimum within a decent period of time. Conversely, the number of epochs can be ascertained by the size of the training set and has to be adjusted by progressively raising its value till validation precision starts to fall, signifying model overfitting. The deep learning model typically congregates in a few epochs and the following epochs might drive supplementary execution time as well as overfitting. This can be evaded through an early halting approach. This approach is a kind of regularisation wherein the model training is halted beforehand when the validation precision does not enhance following a specific number of successive epochs. To sum up, ascertaining the apt hyperparameters is vital for warranting the utmost performance of learning algorithms, thus creating a model timber defect identification setup in this study. We adjust the learning rate (0.001 and 0.0001) and the quantity of training epochs (50, 100 and 200) to ascertain the top CNN classification performance for determining timber defect.

III. RESULT AND DISCUSSION
In this paper, multiple CNN classification performance was examined via analysis of the concerning classification accuracy measures. With the accuracy signifying the measure pertaining to true defects versus the predicted defects, this study focuses on highlighting the classification performance pertaining to the put forward augmentation method via comparison versus those six CNN algorithms. Again, comparison was performed for the detailed classification performance with regards to the put forward feature versus four Malaysia timber species, namely Merbau, Meranti, Rubberwood and KSK. By employing both epochs and learning rate, multiple tuning pertaining to both hyperparameters were evaluated to identify the best CNN training optimisation and determine timber defect. Table II displays the classification accuracy with regards to various CNN algorithms across both non-augmented and augmented timber defect dataset along with hyperparameter tuning. While the classification accuracy pertaining to both MobileNetV2 and ResNet50 was seen to enhance considerably, ResNet50 was introduced to show a better performance at 0.01 learning rate and 100 epochs. Thus, this signifies that the highest accuracy rate is displayed by 94.59% classification rate from augmented Rubberwood dataset versus other timber species as well as CNN algorithms. The greatest effect was cast by the augmented dataset with synthetic data on the Rubberwood dataset, wherein accuracy enhanced by almost 10.37% from 82.96% to 93.33%, while Merbau dataset displayed the lowest impact, displaying reduced accuracy to 86.74% from 89.63%. The highest classification accuracy of 94.07% was achieved via GoogLeNet employing 0.001 learning rate and 200 epochs in Meranti dataset. Based on the tables, it can be seen that augmented Rubberwood dataset distinctly had the highest accuracy enhancement at 11.11% from 81.48% to 92.59% with 0.001 learning rate and 50 epochs. Even though Merbau is regarded to be the most ineffective augmented dataset, which reduced the classification accuracy to 75.85% from 84.44%, the overall classification accuracy pertaining to GoogLeNet algorithm encompassing four different types of timber species was seen to rise by 3.18%. With regards to AlexNet, the highest classification performance was achieved at 92.81% by employing the Rubberwood dataset that had hyperparameters of 0.0001 learning rate and 50 epochs. Using data augmentation was seen to enhance the classification accuracy of the algorithm by 22.87%, i.e., from 68.69% to 91.56%. However, the augmentation technique also comes along with adverse impact, wherein the augmented dataset pertaining to the KSK species made the algorithm to overfit in the training. Even though our experiment results in AlexNet algorithm becoming overfit, the overall classification performance displayed that the accuracy with the augmentation technique was seen to enhance by 1.08%. In ShuffleNet, applying the augmentation technique in the Rubberwood dataset was seen to improve the accuracy by 13.48% with 0.0001 learning rate and 100 epochs, as displayed in Table II. However, ShuffleNet showed the highest classification performance with regards to the Rubberwood dataset (93.79%), wherein the overall accuracy increased by 4.11% across the timber species by employing data augmentation. Next, the best result of 94.3% was achieved via NASNetMobile by employing 0.001 learning rate and 100 epochs. With regards to the different epoch as well as learning rate combinations, the average classification accuracy can be enhanced by 5.78% by employing the algorithm across the timber species. Most of the defect datasets can achieve accuracy of greater than 94% in NASNetMobile aside from Merbau dataset that can reach just 89.33%. In line with other data augmentation studies, few augmented datasets could cast an adverse impact on CNN classification performance, like Meranti augmented dataset, which can decrease the performance by 3.03%. With regards to the augmented Rubberwood dataset, MobileNetv2 displayed high classification accuracy enhancement of 12.96% employing 0.001 learning rate and 200 epochs. With the Rubberwood dataset (92.67%), the highest accuracy was displayed, specifying that the algorithm classification performance is enhanced by the augmentation method. After training with 0.0001 learning rate setting, the MobileNetV2 showed decrease in performance in Merbau augmented dataset, similar to the performance of AlexNet. In the Meranti dataset, a majority of performance accuracy degradation was observed from 91.11% www.ijacsa.thesai.org to 89.41% employing 0.0001 learning rate and 200 epochs. However, the overall algorithm performance employing the augmentation method demonstrated enhancement in classification accuracy by 3.63%. Fig. 1 lists out the overall performance pertaining to multiple CNN algorithms employing both non-augmented and augmented timber defect datasets. These experiments demonstrated that with the help of the augmentation technique, the small dataset issue [34] can be addressed as well as the CNN classification results can be enhanced. Even though all the analysed models demonstrated enhancement in classification performance, the NASNetMobile model gave the best improvement (5.8%). By employing data augmentation, performance enhancement in the range of 1.08-5.78% was demonstrated across the CNN algorithms along with certain fine-tuning with regards to epoch as well as learning rate hypermeters. Employing the augmentation technique with regards to timber defect identification also increased the average accuracy across the timber species i.e., from 87.78% to 91.84%. The ResNet50 was seen to function well across the timber species giving an average accuracy of 91.84% along with high performance in terms of defect recognition, when compared with the results pertaining to other CNN algorithms in the timber defect dataset. Fig. 2 on the other hand, displays the validation loss curve of highest accuracy CNN models finetuned by two different hyperparameters (learning rate and epoch). Besides, it can be seen from the loss curve that ResNet50 can converge quickly compared to other CNN models. Referring to the t-test in Table III, the CNN classification performance in augmented dataset are significantly better compared to the original dataset with the results demonstrating statistically significant differences between the two datasets except for AlexNet. This evidently displays that the augmentation technique cannot be regarded as a domain specific technique and can be applied for other unexplored timber defect identification domain. Besides, CNN algorithms allow achieving high defect identification performance, which can be leveraged to develop automatic visual inspection system in real-world secondary wood industry processing facilities for optimisation of grading as well as cutting for timber.

IV. CONCLUSION
This study is aimed at evaluating the effectiveness pertaining to data augmentation technique by using multiple CNN algorithms to identify timber defects across four timber species. The research employs CNN algorithms by implementing transfer learning on ResNet50, GoogLeNet, MobileNetV2, ShuffleNet, NASNetMobile and AlexNet. Evaluation of both data augmentation as well as transfer learning methods was done with various learning rate and epochs to identify the best CNN classification performance for timber species. The result showed data augmentation and transfer learning techniques can be effectively used for searching defect across timber species. The best accuracy could be achieved by employing the ResNet50 model (94.59%) along with optimisation of hyperparameters at learning rate 0.001 and 100 epochs. Our results demonstrate that the augmentation technique can deal with the limited dataset issue as well as enhance the average CNN classification performance by almost 5.78% with regards to the NASNetMobile model. Also, our research study has employed different combination of learning rate as well as epoch, suggesting that a higher number of learning rate and epoch does not necessarily give higher accuracy for CNN model classification. Besides, the research outcomes show that data augmentation as well as CNN algorithms methods with regards to timber defect identification can be used for cutting optimisation as well as industrial timber grading. Also, to further enhance the results, exploring of more complex data augmentation as well as transfer learning framework can be done. The method includes limitations with regards to the requirement of manually adjusting the orientation pertaining to the timber defect images to carry out data augmentation as well as manually label the images pertaining to training CNN algorithms, which may not be regarded as error-free. Future work may include using deep learning for analysis of various kinds of timber defects across different timber species.