<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JCC</journal-id><journal-title-group><journal-title>Journal of Computer and Communications</journal-title></journal-title-group><issn pub-type="epub">2327-5219</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jcc.2019.712015</article-id><article-id pub-id-type="publisher-id">JCC-97454</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  Classification of 3D Film Patterns with Deep Learning
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>John</surname><given-names>Mlyahilu</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Youngbong</surname><given-names>Kim</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Jongnam</surname><given-names>Kim</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of IT Convergence and Application Engineering, Pukyong National University, Busan, Korea</addr-line></aff><pub-date pub-type="epub"><day>28</day><month>11</month><year>2019</year></pub-date><volume>07</volume><issue>12</issue><fpage>158</fpage><lpage>165</lpage><history><date date-type="received"><day>10,</day>	<month>December</month>	<year>2019</year></date><date date-type="rev-recd"><day>24,</day>	<month>December</month>	<year>2019</year>	</date><date date-type="accepted"><day>27,</day>	<month>December</month>	<year>2019</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  
    Researches on pattern recognition have been tremendously performed in various fields because of its wide use in both machines and human beings. Previously, traditional methods used to study pattern recognition problems were not strong enough to recognize patterns accurately as compared to optimization algorithms. In this study, we employ both traditional based methods to detect the edges of each pattern in an image and apply convolutional neural networks to classify the right and wrong pattern of the cropped part of an image from the raw image. The results indicate that edge detection methods were not able to detect clearly the patterns due to low quality of the raw image while CNN was able to classify the patterns at an accuracy of 84% within 1.5 s for 10 epochs. 
  
 
</p></abstract><kwd-group><kwd>Patterns</kwd><kwd> Recognition</kwd><kwd> Accuracy</kwd><kwd> CNN</kwd><kwd> Edge Detection</kwd><kwd> Classifications</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Before the rise of researches in pattern recognition field, images of objects and other structures were traditionally represented by vector spaces [<xref ref-type="bibr" rid="scirp.97454-ref1">1</xref>]. This was easily presented by the use of front, left, right and rear elevation views [<xref ref-type="bibr" rid="scirp.97454-ref2">2</xref>]. Generally, the traditional ways to represent objects usually oversimplify the nature, shape and size of the objects. Substantially, objects are made by patterns that can be simply observed physically and or hardly observed by applying different mathematical algorithms. In this context, we define pattern recognition as the process of data classification based on the statistical information extracted from the objects’ representation [<xref ref-type="bibr" rid="scirp.97454-ref3">3</xref>]. As per its essence in solving classification and clustering problems, pattern recognition is widely applied in various fields including natural language processing, medical diagnosis, image and video processing, document recognition, a list is too long to mention as referenced in [<xref ref-type="bibr" rid="scirp.97454-ref4">4</xref>] and [<xref ref-type="bibr" rid="scirp.97454-ref5">5</xref>].</p><p>Within all the fields of application mentioned thereof, a pattern recognition problem uses raw data which are processed to a format that a machine can comprehend. Pattern recognition problems are practically solved by different approaches including discriminant analysis, statistical decision theory, structural pattern recognition, combinatorial approaches, support vector machines and syntactic pattern recognition [<xref ref-type="bibr" rid="scirp.97454-ref6">6</xref>]. As its essence has been outlined in the previous paragraphs of this work, we introduce a pattern recognition problem that involves detection of wrong and right patterns and classification of the detected patterns with faults using Convolutional Neural Networks.</p></sec><sec id="s2"><title>2. Related Works</title><p>Several works have employed Laplacian, Sobel and Canny edge detectors [<xref ref-type="bibr" rid="scirp.97454-ref7">7</xref>] as preliminary steps for pattern recognition. In this work, we apply Laplacian edge detector because it uses kernel or filter and calculates the second order derivatives in a single pass of an image intensity. The Laplacian of an image is given by the following equation.</p><p>L ( x , y ) = ∂ 2 I ∂ x 2 + ∂ 2 I ∂ y 2 (1)</p><p>where I ( x , y ) is the intensity of an image in reference.</p><p>We employed Sobel operator that performs a 2-D operator spatial gradient measurement on an Image that emphasizes the regions of high spatial frequency that correspond to the edges.</p><p>| G | = G x 2 + G y 2 (2)</p><p>where G x and G y is the rotation and magnitude of the gradient respectively.</p><p>We lastly employed Canny edge detection which is a multi-step algorithm that can detect edges with noise suppressed at the same time. This process involves smoothing, gradient computing, thresholding M, suppressing non-maxima pixels and linking the edge segments to form continuous edges. The following are the procedures for canny edge detection.</p><p>• Define the Gaussian filter G σ = 1 2 π σ 2 exp ( − m 2 + n 2 2 σ 2 ) to reduce noise and unwanted details and textures.</p><p>• Smoothen the image with the Gaussian filter g ( m , n ) = G σ ( m , n ) ∗ f ( m , n ) .</p><p>• Compute gradient of g ( m , n ) using any of the gradient operators (Roberts, Sobel, Prewitt, etc) to get M ( m , n ) = g m 2 ( m , n ) + g m 2 ( m , n ) and θ ( m , n ) = tan − 1 [ g n ( m , n ) / g m ( m , n ) ] .</p><p>• Determine the minimum threshold M, mathematically defined as M T ( m , n ) = { M ( m , n )   i f   M ( m , n ) &gt; T 0   o t h e r w i s e } .</p><p>If the above simple techniques do not perform better, some machine learning methods can be introduced to serve the purpose. Machine learning metric measures are used to validate whether the images are suitable for pattern recognition and segmentation [<xref ref-type="bibr" rid="scirp.97454-ref8">8</xref>] and [<xref ref-type="bibr" rid="scirp.97454-ref9">9</xref>]. The precise measures for thresholding are F<sub>1</sub>-Score and Mathew Correlation Coefficient (MCC) that uses the original and predicted edges of an image.</p><p>We define a confusion matrix with two elements as Foreground and Background for each edge cases of the image to be recognized and segmented from the raw image. The following are the edge cases that considered during the calculation of the thresholding measurements.</p><p>From <xref ref-type="table" rid="table1">Table 1</xref> we define the accuracy, F<sub>1</sub>-score and MCC measure of the classification as Equation (3), (4) and (5) respectively.</p><p>Accuracy = T P + T N T P + T N + F P + F N (3)</p><p>F 1 -score = 2 ∗ T P 2 ∗ T P + F P + F N (4)</p><p>MCC = T P ∗ T N − F P ∗ F N ( T P + F T ) ( T P + F N ) ( T N + F P ) ( T N + F N ) (5)</p><p>F<sub>1</sub>-score ranges from 0 to 1 showing that the higher the score close to 1 the better the prediction for the edges, while MCC lies between −1 and +1. MCC has double meaning whereby −1 states the negative correlation between the original edges and the detected edges (mismatching) while +1 shows the relationship between the predicted and original edges also known as absolute matching [<xref ref-type="bibr" rid="scirp.97454-ref9">9</xref>].</p>Selecting a Template<p>The figure below represents workflow that indicates the procedures on how to obtain the expected results using the proposed algorithms. The figure describes the process from raw image data to the measure of performance of the Convolutional Neural Networks model.</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref> indicates that the colored image will be converted to gray scale by either open CV or matplot python libraries and then edge detection methods will be applied. Depending on the nature of the image, if the edge detection methods will not perform better then machine learning metrics will be applied for thesholding process. When the accuracy achieved will be smaller than 75% as described in [<xref ref-type="bibr" rid="scirp.97454-ref9">9</xref>] and [<xref ref-type="bibr" rid="scirp.97454-ref12">12</xref>], then the process goes back to the initial step for cropping different patterns for binary classification processing in CNN. Otherwise, the algorithm produces clear output for the raw image with faults.</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Confussion matrix</title></caption><table><tbody><thead><tr><th align="center" valign="middle"  rowspan="4"  >Predicted Edges</th><th align="center" valign="middle" ></th><th align="center" valign="middle"  colspan="2"  >Original Edges</th></tr></thead><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" >Foreground(255)</td><td align="center" valign="middle" >Background(0)</td></tr><tr><td align="center" valign="middle" >Foreground(255)</td><td align="center" valign="middle" >True Positive (TP)</td><td align="center" valign="middle" >False Positive (FP)</td></tr><tr><td align="center" valign="middle" >Background(0)</td><td align="center" valign="middle" >False Negative (FN)</td><td align="center" valign="middle" >True Negative (TN)</td></tr></tbody></table></table-wrap></sec><sec id="s3"><title>3. Methodology and Experiments</title><p>Input data was obtained as an image with two different patterns and with non-uniform intensity. The image used was 383 by 676 in pixels and 324.7 KB where traditional methods were applied to detect the similar patterns in the colored image. We applied the pattern detection algorithm based on the patterns and the color intensity of the image. We also used template matching method to determine the patterns on the image where we were able to detect different patterns on the colored image. The methods used for edge detections are Laplacian, Sobel and Canny edge detectors.</p><p>We used the cropped template in <xref ref-type="fig" rid="fig2">Figure 2</xref> and OpenCV library for image manipulation. Based on that template we were able to detect the matched patterns as shown in the following figure.</p><p><xref ref-type="fig" rid="fig3">Figure 3</xref> shows matched templates when the maximum matching threshold was set to 0.7 to avoid overwriting of matched templates on the colored image. From the colored image in <xref ref-type="fig" rid="fig3">Figure 3</xref>, we cropped different patterns of which some have wrong and right patterns. We had 700 images whose sizes were different because of cropping process and some of the images were rotated at an angle of 10˚. The images were resized to 40 by 40 pixels in order to be compatible with CNN. The data set was divided into training set and test sets whereby the former had 450 images and the later had 250 images respectively. We employed Convolutional Neural Network to classify the binary classification problem and determine the efficiency of our model. The CNN architecture accomplished both feature extraction and classification activities for the images.</p><p>The CNN architecture shown in <xref ref-type="fig" rid="fig4">Figure 4</xref> was implemented in Python using Keras and Tensorflow libraries with GPU having two convolution layers with 32 and 64 nodes respectively. Two maximum pooling layers were put after every convolution layer to reduce the number of parameters in order to control overfitting and computational costs. The activation function for convolution layers was ReLU, applied for the sake of converting all negative pixel values to zero and for the last fully connected layer was Softmax that normalizes the probabilities to the interval [0, 1]. We used “adam” as the optimization function because it computes individual learning rates for different parameters [<xref ref-type="bibr" rid="scirp.97454-ref13">13</xref>].</p></sec><sec id="s4"><title>4. Results and Discussion</title><p>The results are presented as obtained by edge detectors’ methods, thresholding metric measures and Convolutional Neural Networks. With these three algorithms, the results were displayed in a figure where all the algorithms are applied. To obtain precise and accurate results, images must of high quality, detectable background and foreground, and uniform intensity. As shown in <xref ref-type="fig" rid="fig2">Figure 2</xref> the original image was colored however, its intensity was not uniform. <xref ref-type="fig" rid="fig5">Figure 5</xref> shows all the methods used to determine patterns in the original image as explained in the methodology and experiment section.</p><sec id="s4_1"><title>4.1. Results from Edge Detection Methods</title><p>The following figure presents the results obtained by using the edge detection methods that are introduced in section two of the study.</p><p><xref ref-type="fig" rid="fig5">Figure 5</xref> indicates that Sobel edge detectors can detect the pattern edges but has many noises along the horizontal and vertical gradients. The Combined Sobel detects edges with a little noise compared to its individual gradients. Laplacian edge detector is somehow cleaner than Sobel even though its results cannot surpass the results obtained by Canny edge detectors when L1 norm is allowed.</p></sec><sec id="s4_2"><title>4.2. Machine Learning Thresholding Metrics</title><p>Given that, the results in Section 4.1 were not clearly observed that the edges were not clearly detected, then the ML thresholding metrics were employed to determine whether the colored image was suitable for segmentation and further processing. The Machine learning thresholding metrics were applied and accuracy was 45% smaller than the criterion mentioned in [<xref ref-type="bibr" rid="scirp.97454-ref9">9</xref>] and [<xref ref-type="bibr" rid="scirp.97454-ref10">10</xref>]. When the accuracy is small, this means that, there is no background pixels that were detected while F<sub>1</sub> score was approximately equal to 1.41 &#215; 10<sup>−5</sup> that recommends the use of other sophisticated thresholding methods. The value of MCC was −0.035 indicating that there is a negative correlation of pixels in an image due to high noise and non-uniform color intensity [<xref ref-type="bibr" rid="scirp.97454-ref9">9</xref>].</p></sec><sec id="s4_3"><title>4.3. Convolution Neural Networks Results</title><p>As introduced in the methodology part, CNN was used to classify and determine the efficiency of the training model used for classification. The efficiency of the model was inversely proportional to the learning rate i.e. when the learning rate is small then model efficiency increased even though the computational time was almost similar [<xref ref-type="bibr" rid="scirp.97454-ref11">11</xref>]. We started with a batch 200 increasing to 700 images, the accuracy ranged from 45.6% to 84% while the execution time was 1.5 s for 10 epochs. The following figure shows the predicted templates were wrong as shown in <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p></sec></sec><sec id="s5"><title>5. Results and Discussion</title><p>Even though the edge detection methods were not able to detect the patterns accurately because of low quality and poor intensity of the raw image but CNN was able to classify the images that have right and wrong with faulty patterns.</p><p>The model used revealed the truth that the more increase in the input mages, the more accurately the classification problem is handled. We conclude that, the expected results could be precise and accurate for both edge detection methods and CNN if the quality of the raw image is maintained.</p></sec><sec id="s6"><title>Acknowledgements</title><p>This research was supported by the Ministry of Trade, Industry and Energy for its financial support of the project titled “the establishment of advanced marine industry open laboratory and development of realistic convergence content”, PKNU LINC+ Project, and SMTECH Innovation Startup Project.</p></sec><sec id="s7"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s8"><title>Cite this paper</title><p>Mlyahilu, J., Kim, Y. and Kim, J. (2019) Classification of 3D Film Patterns with Deep Learning. Journal of Computer and Communications, 7, 158-165. https://doi.org/10.4236/jcc.2019.712015</p></sec></body><back><ref-list><title>References</title><ref id="scirp.97454-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Szeliski, R. (2010) Computer Vision: Algorithms and Applications. Springer, London, UK.</mixed-citation></ref><ref id="scirp.97454-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Shin, D., Fowlkes, C.C. and Hoiem, D. (2018) Pixels, Voxels, and Views: A Study of Shape Representations for Single Vie 3D Object Shape Prediction. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 3061-3069. arXiv:1804.06032  
https://doi.org/10.1109/CVPR.2018.00323</mixed-citation></ref><ref id="scirp.97454-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Dutt, V., Chaudhry, V. and Khan, I. (2012) Pattern Recognition: An Overview. American Journal of Intelligent Systems, 2, 23-27.</mixed-citation></ref><ref id="scirp.97454-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Wojcik, W., Gromaszek, K. and Junisbekov, M. (2016) Face Recognition: Issues, Methods and Alternative Applications. Face Recognition-Semisupervised Classification, Subspace Projection and Evaluation Methods, 7-28.  
https://doi.org/10.5772/62950</mixed-citation></ref><ref id="scirp.97454-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Verma, B. and Blumenstein, M. (2008) Pattern Recognition Technologies and Applications: Recent Advances. Information Science Reference, USA.  
https://doi.org/10.4018/978-1-59904-807-9</mixed-citation></ref><ref id="scirp.97454-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Jain, A.K., Duin, R. and Mao, J. (2000) Statistical Pattern Recognition: A Review. IEEE Transactions on Pattern Analysis and Machine Intelligence, 22, 4-37.  
https://doi.org/10.1109/34.824819</mixed-citation></ref><ref id="scirp.97454-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Rosebrock, A. (2019) Historically-Nested Edge Detection with OpenCV and Deep Learning. https://www.pyimagesearch.com/2019/03/04/</mixed-citation></ref><ref id="scirp.97454-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Bhargavi, K. and Jyothi, S. (2012) A Survey on Thresholding Based Segmentation Technique in Image Processing. International Journal of Innovative Research &amp; Development, 3, 234-239.</mixed-citation></ref><ref id="scirp.97454-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Vemuri, P.V.N. (2019) Image Segmentation with Python.  
https://kite.com/blog/python/image-segmentation-tutorial/</mixed-citation></ref><ref id="scirp.97454-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Boughorbel, S., Jarray, F. and El-Anbari, M. (2017) Optimal Classifier for Imbalanced Data Using Mathews Correlation Coefficient Metric. PLoS ONE, 12, 1-17.  
https://doi.org/10.1371/journal.pone.0177678</mixed-citation></ref><ref id="scirp.97454-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Weng, S. (2019) Auto-mating Breast Cancer Detection with Deep Learning with Deep Learning.  
https://blog.insightdatascience.com/automating-breast-cancer-detection-with-deep-learning-d8b49da17950</mixed-citation></ref><ref id="scirp.97454-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">.Bhamare, D. and Suryawanshi, P. (2019) Review on Reliable Pattern Recognition with Machine Learning Techniques. Fuzzy Information and Engineering, 1-16.  
https://doi.org/10.5013/IJSSST.a.20.02.08</mixed-citation></ref><ref id="scirp.97454-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Kingma, D.P. and Ba, J. (2015) Adam: A Method for Stochastic Optimization. Conference Paper at the 3rd International Conference for Learning Representations, San Diego, 2015. arXiv:1412.6980ss</mixed-citation></ref></ref-list></back></article>