Next Article in Journal
Investigation of Transfer Learning Method for Motor Fault Detection
Previous Article in Journal
Correction: Saadah et al. Developing Robust Safety Protocols for Radiosurgery within Patient Positioning System Framework. Machines 2024, 12, 106
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

MATLAB Application for User-Friendly Design of Fully Convolutional Data Description Models for Defect Detection of Industrial Products and Its Concurrent Visualization †

1
Graduate School of Engineering, Sanyo-Onoda City University, Yamaguchi 756-0884, Japan
2
Future Robotics Lab., Okayama University, Okayama 700-8530, Japan
3
Mechanical Engineering Department, School of Sciences and Engineering, The American University in Cairo, New Cairo 11835, Egypt
4
Faculty of Manufacturing & Mechatronic Engineering Technology, Universiti Malaysia Pahang Al-Sultan Abdullah, Pekan Pahang 26600, Malaysia
*
Author to whom correspondence should be addressed.
This paper is an extended version of our paper published in F. Nagata, S. Sakata, H. Kato, K. Watanabe, M.K. Habib, Defect Detection and Visualization of Understanding Using Fully Convolutional Data Description Models. In Proceedings of the 16th IIAI International Congress on Advanced Applied Informatics Conference, Takamatsu, Japan, 6–12 July 2024; pp. 78–83.
Machines 2025, 13(4), 328; https://doi.org/10.3390/machines13040328
Submission received: 18 March 2025 / Revised: 14 April 2025 / Accepted: 16 April 2025 / Published: 17 April 2025
(This article belongs to the Section Machines Testing and Maintenance)

Abstract

:
In this paper, a fully convolutional data description (FCDD) model is applied to defect detection and its concurrent visualization for industrial products and materials. The authors’ propose a MATLAB application that enables users to efficiently and in a user-friendly way design, train, and test various kinds of neural network (NN) models for defect detection. Models supported by the application include the following original designs: convolutional neural network (CNN), transfer learning-based CNN, NN-based support vector machine (SVM), convolutional autoencoder (CAE), variational autoencoder (VAE), fully convolution network (FCN) (such as U-Net), and YOLO. However, FCDD is not yet supported. This paper includes the software development of the MATLAB R2024b application, which is extended to be able to build FCDD models. In particular, a systematic threshold determination method is proposed to obtain the best performance for defect detection from FCDD models. Also, through three different kinds of defect detection experiments, the usefulness and effectiveness of FCDD models in terms of defect detection and its concurrent visualization are quantitatively and qualitatively evaluated by comparing conventional transfer learning-based CNN models.

1. Introduction

Recently, image data-based deep learning models such as convolutional neural network (CNN), support vector machine (SVM), convolutional autoencoder (CAE), variable autoencoder (VAE), and fully convolution network (FCN) (such as U-Net) models, as well as others, have been applied to defect detection for various kinds of industrial products and materials. For example, after some defect is detected in the inspection process using a CNN model, gradient-weighted class activation mapping (Grad-CAM) or Occlusion Sensitivity is applied to make possible the visualization process of the defect areas on which the CNN is focused. This means that the defect detection process and visualization have to be separately employed in the production line.
In this paper, a fully convolutional data description (FCDD) approach [1] is applied to defect detection and its concurrent visualization for two kinds of industrial products and an industrial material. As for FCDD, Jang and Bae proposed an anomaly detection system that was understood through FCDD trained only using OK samples to provide related users with details such as detection results of abnormal defect patterns, defect size, and location of defect patterns on a wafer bin map [2]. The effectiveness was analyzed using an open dataset, providing promising results of the proposed anomaly detection system. Also, Yasuno et al. obtained accurate and explainable results demonstrating experimental studies on concrete damage and steel corrosion in civil engineering [3]. In addition, to develop a more robust application, they applied their method to another outdoor domain that contained complex and noisy backgrounds using natural disaster datasets collected using various devices. Moreover, they proposed a valuable solution of deeper FCDDs focusing on other powerful backbones such as VGG16, ResNet101, and Inceptionv3 to improve the performance of damage detection and to implement ablation studies on disaster datasets.
MATLAB is a powerful development environment for efficiently and stably building machine learning models, and also allows for easily designing graphical user interfaces. As for the medical field, for example, Bora et al. proposed a lung cancer recognition system running on MATLAB, in which segmentation and optimization techniques are used to focus on the lung cancer images to improve performance. Their study aimed to detect lung cancer at early stages by using a neuro-fuzzy classification algorithm and image processing technique [4]. Subbarayudu et al. introduced a case study for enhancing glaucoma screening and early treatments by using MATLAB software, in which techniques based on image processing and deep CNN were applied [5]. Also, Makhunga et al. considered advanced methodologies and techniques in facial recognition technology, focusing on preprocessing and classification using a CNN based on the GoogleNet architecture and utilizing transfer learning. The system was trained and tested using MATLAB, achieving an accuracy of 91.59% by utilizing a labeled faces dataset of Steve Harvey and Cristiano Ronaldo [6]. Dioses et al. tried to apply deep learning methods, more specifically the RESNET50 architecture, to the image-based classification of sugarcane illnesses [7]. A transfer learning CNN model based on RESNET50 was proposed and evaluated in the MATLAB environment, and accuracy rates above 90% were achieved in classifying test images into Yellow, Rust, RedRot, and Mosaic illnesses. Furthemore, SivaramKrishnan et al. proposed the Anti-Interference Dynamic Integral Neural Network (AIDINN) to minimize energy consumption and greenhouse gas, as well as fuel, emissions in hybrid electric vehicles (HEVs) [8]. AIDINN predicted the speed and style of EVs so that proper utilization of energy resources with limited energy waste and the enhancement of the vehicle efficiency were ensured. It is reported that this technique was implemented on MATLAB and achieved an efficiency of 98.7%, a fuel consumption rate of 115 mL, and emissions of 0.7 g/km, which indicates the superiority of AIDINN in optimizing EM in retrofitted HEVs, effectively reducing fuel consumption and emissions while maximizing overall efficiency. In addition to these, there are many other practical studies on implementing machine learning models such as CNNs designed on MTALAB; however, it seems that there are few applications that can deal with FCDDs.
As for technology for visualizing the bases of recognition used by deep learning models, Grad-CAM [9] seems to be commonly used. Mehadjbia and Slaoui-Hasnaoui applied deep learning models such as modified NasNetMobile, MobileNetV2, InceptionV3, and RensNet50 models to a surface defect detection task for metal images, while using the Grad-CAM algorithm for visualizing the regions that were the basis for the detection [10]. Testing results of their model on external images showed its ability to identify and localize defect regions on wind turbine surfaces and other metal panel types. Agrawal et al. investigated how deep learning techniques may be used to detect manufacturing flaws in digital images. Their research results showed that considerable advancements in manufacturing quality control are possible by using a diversified dataset and a tailored CNN architecture, in which Grad-CAM visualization is considered in order to help in decision-making and process optimization [11]. Also, Lee et al. utilized three pre-trained CNN models—GoogleNet, ResNet101, and VGG19—to identify contamination defects of different steps, sizes, and components in the semiconductor fabrication process, so that the results indicated that the recognition accuracy mostly exceeded 85%. In addition, it was reported that the models could accurately identify contaminated areas by Grad-CAM [12]. Although there seem to be few cases where FCDD has been applied, Moupojou et al. proposed a model ensemble solution for the accurate identification and classification of plant diseases using field images. The model uses the Segment Anything Model to efficiently circumscribe all identifiable objects in the image, in which background objects are separated from actual leaf objects using FCDD; the model is known as an explainable deep one-class classification model for anomaly detection [13].
Our developed MATLAB application for building defect detection models has already allowed users to efficiently design, train, and test various kinds of models, such as originally designed CNNs, transfer learning-based CNNs, SVMs, CAEs, VAEs, FCNs, and YOLO; however, FCDD is not yet supported. This paper includes the software development of a MATLAB application extended to flexibly build FCDD models [14], in which a desirable CNN model can be easily chosen as the backbone of an FCDD model to be designed. Also, in order to be able to quantitatively apply trained FCDD models for defect detection of industrial products or materials, the threshold value, which is the distance from the center of the hyper-sphere, must be statistically determined analyzing the distribution of anomaly scores obtained with the training dataset.
Through the paper, the usefulness and effectiveness of FCDD models in terms of defect detection and their concurrent visualization of understanding are quantitatively and qualitatively evaluated by comparing conventional transfer learning-based CNN models.

2. FCDD (Fully Convolutional Data Description)

2.1. Deep One-Class Classification

Liznerski et al. proposed FCDD models, in which the concept of a hyper-sphere classifier (HSC) [15] is employed. In this subsection, the objective function of HSC is reviewed. The objective function of HSC is designed as
min W , c 1 n i = 1 n 1 y i h ϕ ( X i ; W ) c y i log 1 exp h ϕ ( X i ; W ) c
where X 1 , X 2 , , X n denote a collection of sample images, and n is the number of training images. W = { W 1 , , W L } are the weights of the network ϕ : R c × h × w R d , where L N is the number of hidden layers, and c, h, and w are the channel, height, and width of the images, respectively. Also, y 1 , y 2 , , y n are labels where y i = 1 denotes an anomaly image, and y i = 0 denotes a normal image. Furthermore, c R d is the center of the hyper-sphere, and h ϕ ( X i ; W ) c is the pseudo-Huber loss [16] given by
h ( a ) = a 2 + 1 1
which approximates to a 2 / 2 for small values of a and a straight line with slope 1 for large values of a, so that interpolation from quadratic to linear penalization can be performed. Due to HSC loss, normal samples and anomalous ones are mapped near c and away from the center c, respectively. The first term of Equation (1) becomes effective when the label of a training image is negative, i.e., y i = 0 . This is the pseudo-Huber loss h ( ϕ ( X i ; W ) c ) based on the distance ϕ ( X i ; W ) c , which quantifies how far the output of the network is from the center of hyper-sphere c. As can be guessed, the closer the output of the network and c are, the smaller the value of first term becomes. On the other hand, the second term becomes effective when the label of a training image is positive, i.e., y i = 1 . The larger ϕ ( X i ; W ) c is, i.e., the farther the output of the network is from c, the closer exp h ϕ ( X i ; W ) c approaches 0. Consequently, log 1 exp h ϕ ( X i ; W ) c approaches log 1 , i.e., 0. It is expected from the above validation results of the two terms that the network will be trained so that normal images without a defect are mapped near the center c, whereas anomalous images with a defect are located far from the center.

2.2. Fully Convolutional Data Description Model

Figure 1 illustrates the overall network structure of the authors’ designed FCDD model. In this subsection, the concept of FCDD [1] and its loss function in training are described in detail. In FCDD implementation, the center c corresponds to the bias term in the last layer of the networks—i.e., is included in the network, which is why c is omitted in the FCDD objective function. In Liznerski’s paper, an FCN model ϕ employed in the former part performs ϕ : R c × h × w R u × v , by which a feature map ϕ ( X ; W ) downsized into u × v is generated from an input image X. A heat map of defective regions can be produced based on the feature map. The pseudo-Huber loss A ( X ) in terms of an output matrix from the FCN part, i.e., a feature map, is given by
A ( X ) = ϕ X ; W 2 + 1 1
where the calculation is carried out with element-wise operations, i.e., pixel-wisely, to be able to form a heat map. The object function in training an FCDD model is given by
min W 1 n i = 1 n 1 y i 1 u · v A ( X i ) 1 y i log 1 exp 1 u · v A ( X i ) 1
With the same solution about Equation (1), the first term has a valid value in case the label of a training image is negative, i.e., y i = 0 , where L1 norm A ( X i ) 1 is divided by the total pixels u · v of a feature map. The value can be considered the average per one pixel. Therefore, when normal images are given to the network in training, the weights are adjusted so that each pixel forming a heat map can approach to 0.
On the other hand, the second term becomes effective when the label of a training image is anomalous ( y i = 1 ), and exp ( · ) has a value close to 0 with the increase in the average loss per one pixel, so that the value of the log function log ( · ) also approaches to 0 with the lapse of training time. It is confirmed from the above discussion that Equation (4) using Equation (3) enables both to minimize the sum of the averages of A ( X i ) 1 of non-defective images and to maximize those of defective images.

2.3. How to Determine Threshold Value for Prediction by FCDD

The main dialogue developed in the MATLAB environment, as shown in Figure 2, has been extended so that FCDD models can be trained, tested, and built in a user-friendly way. Figure 3 shows examples of training results. (a) is a completely trained case, in which normal and anomaly samples in the training dataset are completely separated. (b) is a not-completely trained case, in which overlaps of normal and anomaly bins are seen. We usually face two such training result cases according to the difficulty of the given defect detection tasks. Also, it is observed from the distributions that anomaly images tend to have more variety in their features than normal ones.
If a test image X i is given to a trained FCDD model, then the FCDD outputs a distance D ( X i ) from the center of the hyper-sphere. D ( X i ) is also an anomaly score given by
D ( X i ) = 1 u · v A ( X i ) 1
In order to predict whether this image is normal or abnormal, a threshold value has to be determined on the horizontal axes in Figure 3a or Figure 3b. In this subsection, two threshold determination methods are proposed according to (a) the completely trained case and (b) the not-completely trained case. In the case of (a), the threshold T h is simply determined by
T h = 1 2 D max { N N } + D min { N A }
where N N and N A are the numbers of normal images and anomalous ones, and D max { N N } and D min { N A } are the maximum value of D ( X i ) ( i = 1 , , N N ) and the minimum value of D ( X i ) ( i = 1 , , N A ) , respectively. On the other hand, in the case of (b), the threshold T h is determined by each weighted mean value including overlapped bins, given by
T h = 1 2 D mean { N N } + D mean { N A }
where D mean { N N } and D mean { N A } are the mean values of D ( X i ) ( i = 1 , , N N ) and D ( X i ) ( i = 1 , , N A ) , respectively.
The threshold value discussed in this subsection can be automatically set through the main dialogue. It is expected by applying trained FCDD models to the quality control process of industrial products and materials that defect detection and its clearer visualization of understanding can be concurrently conducted.

3. Comparison of Transfer Learning-Based CNN and FCDD

In this section, comparison in terms of classification accuracy and its visualization of understanding is conducted between two types of models by applying them to three kinds of tasks, i.e., two industrial products and one industrial material. The first model is a well-known transfer learning-based CNN model that has been applied to various kinds of defect inspection systems in industrial fields. The second model is the authors’ interesting FCDD model introduced in the previous section. As for the dataset for training and tests, casting manufacturing product images for quality inspection were downloaded from the Kaggle database [17]. Figure 4 and Figure 5 show examples of brake rotors without and with defects, respectively. In the following experiments, a VGG19-based CNN model and a VGG19-based FCDD model are evaluated and compared in terms of defect detection and its visualization.

3.1. In Case of Transfer Learning-Based CNN Model Based on VGG19

The authors applied several kinds of transfer learning-based CNN models, as shown in the drop-down menu in Figure 2, to defect inspection for industrial products and materials [18]. It has been empirically confirmed from classification experiments of test images that VGG19-based transferred CNN models could always perform with a highly accurate detection ability; thus, the same design approach is employed in this experiment for the comparison.
The numbers of images used were 400 OKs and 400 NGs for the training dataset, and 100 OKs and 100 NGs for test dataset. After the training through 10 epochs while applying the stochastic gradient decent momentum (SGDM) optimizer [19] and a cross-entropy loss function, the VGG19-based CNN was evaluated using the test dataset. Table 1 shows the classification result of the test dataset. As can be seen, this binary classification task of images as shown in Figure 4 and Figure 5 seems to be not difficult for the CNN model, in which only one image named ‘cast_def_0_571.jpeg’ shown in Figure 6 is misclassified as normal (OK). However, this false negative actually looks like a normal product since almost no defect or damage can be observed in the image. There may have been a human labeling error when the dataset was organized.
Then, visualization of the model’s understanding, i.e., looking at where the CNN is focused during classification, was generated using Grad-CAM [9] and Occlusion Sensitivity [20]. Figure 7 and Figure 8 show examples of visualization results. The superiority of Occlusion Sensitivity can be confirmed by comparing these two results—i.e., defect regions are identified more clearly and properly in the heat maps. Note that in this experiment, the two parameters of mask size and stride, which are required for Occlusion Sensitivity, were set to 45 and 22, respectively.

3.2. In Case of FCDD

Our designed FCDD model consists of 36 layers, in which layers from the 1st to 28th layers in the original VGG19 model are extracted with their powerfully tuned weights and deployed in the encoder part of the FCDD, i.e., the FCN part, for a feature extractor to produce 28 × 28 × 512-sized feature maps. In training the FCDD using the same training dataset that was used in the previous subsection, the Adam (Adaptive moment estimation) optimizer [21] is applied to tune the weight parameters mainly in the 29th, 32nd, and 35th convolution layers and 30th and 33rd batch normalization layers in the FCDD, i.e., to minimize the object function given by Equation (4). After training the FCDD model through 10 epochs, its generalization ability is simply evaluated using the same test dataset as that used in the previous subsection, so that almost the same result is obtained, as shown in Table 2. One image misclassified as false negative is checked, so that, in this case also, ‘cast_def_0_571.jpeg’ is confirmed. It is interesting that both the VGG19-based CNN and the FCDD could properly identify the ‘cast_def_0_571.jpeg’ as normal in spite of being labeled as an anomaly in the test dataset. Actually, since ‘cast_def_0_571.jpeg’ looks like a normal product without a defect, it can be guessed that this image was probably labeled incorrectly by human error, i.e., as a labeling noise, when the dataset was organized.
Next, the visualization ability for understanding the basis of classification is evaluated using the same images as shown in Figure 7 and Figure 8. In the case of the FCDD model, superior and distinct heat maps as shown in Figure 9 can be obtained without separately and additionally applying Grad-CAM or Occlusion Sensitivity.

4. Further Comparisons of CNN and FCDD

Two kinds of further comparisons similar to the experiment in the previous section are conducted to deeply evaluate the superiority of the FCDD model using different datasets of a fibrous industrial material and a wrap film product.

4.1. Defect Detection and Visualization of Fibrous Industrial Material

Figure 10 and Figure 11 show examples of fibrous industrial materials without and with defects, respectively. Undesirable shape deformation defects such as frayed tips and split ends can be seen.

4.1.1. In Case of Transfer Learning-Based CNN Model Based on VGG19

As evaluated in the previous section, classification experiments were conducted using a VGG19-based transfer learning CNN model. The numbers of images used were 187 OKs and 214 NGs for the training dataset, and 46 OKs and 55 NGs for the test dataset. After training for 300 epochs, we evaluated the VGG19-based CNN using the test dataset. Table 3 shows the classification result of the test dataset, in which 10 images are misclassified. The defect detection accuracy is 90.1%. Note that the original images with the large resolution of 2590 × 1942 had to be downsized to 224 × 224 as shown in Figure 12, which is the resolution of the input layer of VGG19, so that unfortunately minute features of defects seem to have been lost in some degree.
Next, two visualization tools, Grad-CAM and Occlusion Sensitivity, were applied to identify the areas where the CNN is focused during classification. Figure 13 and Figure 14 show examples of the visualization results. Similar to the results in the previous section, the superiority of Occlusion Sensitivity is observed; however, the thin split-hair defect was not properly identified, as shown in the left photo.

4.1.2. In Case of FCDD

Similarly, after training the FCDD model for 300 epochs, its generalization ability was evaluated using the same test dataset as in the previous subsection. Table 4 shows the classification result of the test dataset. As can be seen, in the case of the FCDD model also, complete defect detection was difficult due to the same cause of the decay of minute defect features, as described in the previous subsection. The classification accuracy is 89.1%.
Visualization images showing the basis of each classification are shown in Figure 15. In the case of the FCDD model, superior and distinct heat maps as shown in Figure 15 can be obtained without separately and additionally applying Grad-CAM or Occlusion Sensitivity.

4.2. Defect Detection and Visualization of Wrap Film Product

Up to now, research on systematically detecting defective wrap film products as shown in Figure 16 has been exclusively the focus of inspectors and engineers. However, there are still problems, and sufficient detection performance cannot be obtained even if commercially available image detectors are used. The undesirable dislocation of the transparent film and the light reflection from the film seem to make defect detection more difficult. The authors of [22] researched SVM models for defect detection based on a VAE model or CNN model, and tried to apply these methods to detecting defective wrap film products.
In the third test trial, wrap film products are used for comparison. Figure 16 shows non-defective and defective images on the production line, in which typical defects such as a long core, deviation of rolling, protrusion of film, deformation of core, and taper-shaped rolling are seen. The wrap film products are constantly fed with the same orientation through the automation line, and the snapshots of target film areas are regularly captured by a fixed camera, so that the template matching technique to crop the images to the target film area is easy to apply [22].
The dataset for training was composed of 118 OK and 158 NG images. Also, the dataset for testing contained 468 OK and 628 NG images. All the images were cropped in advance by using the template matching method.

4.2.1. In Case of Transfer Learning-Based CNN Model Based on VGG19

After training a transfer learning-based CNN model based on VGG19, the generalization ability was evaluated using the test dataset. The results are tabulated in the confusion matrix shown in Table 5, in which the detection accuracy is 98.3%. Also, Figure 17 and Figure 18 show the visualization results using Grad-CAM and Occlusion Sensitivity, respectively, when each defective image is predicted by the CNN model. As can be seen, it seems that it is not easy for these two visualizers to validly produce heat maps catching the defective areas surrounded with red dotted lines.

4.2.2. In Case of FCDD

Then, after training a VGG19-based FCDD model, the generalization ability was evaluated using the same test dataset. The results are tabulated in the confusion matrix shown in Table 6, in which the detection accuracy is 98.3%. Also, Figure 19 shows the visualization results that could be concurrently produced with defect detection. As can be seen, it was observed that the FCDD model can generate more valid and clear heat maps compared to those by Grad-CAM and Occlusion Sensitivity.

5. Conclusions

Our developed MATLAB application for building defect detection models allows users to efficiently design, trainm and test various kinds of models, such as an originally designed CNNs, transfer learning-based CNNs, SVMs, CAEs, VAEs, FCNs, and YOLO; however, FCDD models are not yet supported. This paper describes the software development of an extension to flexibly build FCDD models, under which any desirable CNN model can be easily selected for the backbone of FCDD. In this paper, VGG19-based FCDD models are built and applied to defect detection tasks of two industrial products and one industrial material, then their detection and visualization abilities are experimentally evaluated while comparing conventional transfer learning-based CNN models with Grad-CAM and Occlusion Sensitivity.
As for the generalization ability for defect detection, both models exhibit almost the same classification ability; however, for example, the visual features of several minute defects are lost due to the downsizing of images. On the other hand, as for visualization of the model’s understanding, the superiority of three FCDD models is experimentally confirmed due to their concurrent and more distinct visualization performances.
One of the attractive functions of our developed FCDD designer is the flexible selection of a backbone CNN to be incorporated in the former part of FCDD model. In this paper, only VGG19 is selected for the backbone due to our past empirical knowledge; thus, performances of other combinations, in which other powerful CNN models such as AlexNet, GoogleNet, NASNET-Large, ResNet50, DarkNet-53, and so on are used for the backbone, have not been evaluated. In the future, therefore, FCDD models incorporating such CNN models can be compared with each other in terms of both detection accuracy and visualization of understanding.

Author Contributions

Conceptualization, F.N. and K.W.; methodology, F.N. and S.S.; software, F.N. and S.S.; validation, F.N. and S.S.; formal analysis, F.N. and S.S.; investigation, F.N. and S.S.; resources, F.N. and S.S.; data curation, F.N.; writing—original draft preparation, F.N. and M.K.H.; writing—review and editing, F.N., M.K.H. and K.W.; visualization, F.N. and A.S.A.G.; supervision, F.N. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by JSPS KAKENHI, Grant Number JP25K07532.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ADAMAdaptive Moment Estimation Optimizer
CAEConvolutional AutoEncoder
CNNConvolutional Neural Network
FCDDFully Convolutional Data Description
FCNFully Convolution Network
Grad-CAMGradient-Weighted Class Activation Mapping
HSCHyper Sphere Classifier
SGDMStochastic Gradient Decent Momentum Optimizer
SVMSupport Vector Machine
VAEVariational AutoEncoder

References

  1. Liznerski, P.; Ruff, L.; Vandermeulen, R.A.; Franks, B.J.; Kloft, M.; Muller, K.R. Explainable Deep One-Class Classification. In Proceedings of the International Conference on Learning Representations 2021, Vienna, Austria, 4 May 2021; pp. 1–25. [Google Scholar]
  2. Jang, S.J.; Bae, S.J. Detection of Defect Patterns on Wafer Bin Map Using Fully Convolutional Data Description (FCDD). J. Soc. Korea Ind. Syst. Eng. 2023, 46, 1–12. [Google Scholar] [CrossRef]
  3. Yasuno, T.; Okano, M.; Fujii, J. One-class Damage Detector Using Deeper Fully Convolutional Data Descriptions for Civil Application. Artif. Intell. Mach. Learn. 2023, 3, 996–1011. [Google Scholar] [CrossRef]
  4. Bora, D.J.; Sravani, E.; Tharun, K.; Sushma, K. Lung Cancer Recognition using CNN Algorithm and MATLAB. In Proceedings of the 2024 10th International Conference on Communication and Signal Processing (ICCSP), Melmaruvathur, India, 12–14 April 2024; pp. 475–480. [Google Scholar] [CrossRef]
  5. Subbarayudu, B.; Yadalam, H.; Seepiri, J.; Bhogathi, J. Glaucoma Detection through Synergistic Combination of Image Processing and Deep CNN using MATLAB. In Proceedings of the 2024 5th International Conference for Emerging Technology (INCET), Belgaum, India, 24–26 May 2024; pp. 1–6. [Google Scholar] [CrossRef]
  6. Makhunga, N.; Ngong, M.S.P.; Iktide, U.O. Design and Modelling of a Machine Learning Based Face Recognition Model for Access Control in an Electrical Plant Control Room. In Proceedings of the 2025 33rd Southern African Universities Power Engineering Conference (SAUPEC), Pretoria, South Africa, 29–30 January 2025; pp. 1–6. [Google Scholar] [CrossRef]
  7. Dioses, I.A.M.; Mariano, J.L.; Peña, G.C.D.; Santiago, P.N.M.; Macaso, J.A.; Lucas, T.J. Performance of Transfer Learning Method in Classification of Saccharum Officinarum Diseases. In Proceedings of the 2024 IEEE 12th Conference on Systems, Process & Control (ICSPC), Malacca, Malaysia, 6–7 December 2024; pp. 125–130. [Google Scholar] [CrossRef]
  8. SivaramKrishnan, M.; Palpandian, P.; Mahieshwar, J.; Mohanraj, V.; Vimal, K.K. Anti-Interference Dynamic Integral Neural Network for Optimizing Energy Management in Retrofitted Hybrid Electric Vehicles. In Proceedings of the 2024 3rd International Conference on Automation, Computing and Renewable Systems (ICACRS), Pudukkottai, India, 4–6 December 2024; pp. 1648–1654. [Google Scholar] [CrossRef]
  9. Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017; pp. 618–626. [Google Scholar]
  10. Mehadjbia, A.; Slaoui-Hasnaoui, F. Metal Structural Defect Detection Based-On Deep Learning and Grad-Cam. In Proceedings of the 2024 International Conference on Circuit, Systems and Communication (ICCSC), Fez, Morocco, 28–29 June 2024; pp. 1–6. [Google Scholar] [CrossRef]
  11. Agrawal, B.P.; Nair, P.S.; Babu, S.B.G.T.; Rajprabu, R.; Pesaru, P.R.; Natrayan, L. Deep Learning Methods for Detecting ImageBased Defects in Manufacturing Processes. In Proceedings of the 2024 Ninth International Conference on Science Technology Engineering and Mathematics (ICONSTEM), Chennai, India, 4–5 April 2024; pp. 1–5. [Google Scholar] [CrossRef]
  12. Lee, T.C.; Hung, W.C.; Tsai, M.C.; Lin, C.C.; Hsiao, F.L. Defect Detection of Optical Microscope Images in Semiconductor Fabrication Process Based on Pre-trained Convolution Neural Network. In Proceedings of the IET International Conference on Engineering Technologies and Applications (ICETA 2024), High Tatras, Slovakia, 24–25 October 2024; pp. 102–103. [Google Scholar] [CrossRef]
  13. Moupojou, E.; Retraint, F.; Tapamo, H.; Nkenlifack, M.; Kacfah, C.; Tagne, A. Segment Anything Model and Fully Convolutional Data Description for Plant Multi-Disease Detection on Field Images. IEEE Access 2024, 12, 102592–102605. [Google Scholar] [CrossRef]
  14. Nagata, F.; Sakata, S.; Kato, H.; Watanabe, K.; Habib, M.K. Defect Detection and Visualization of Understanding Using Fully Convolutional Data Description Models. In Proceedings of the 16th IIAI International Congress on Advanced Applied Informatics, Takamatsu, Japan, 6–12 July 2024; pp. 78–83. [Google Scholar]
  15. Ruff, L.; Vandermeulen, R.A.; Franks, B.J.; Muller, K.R.; Kloft, M. Rethinking assumptions in deep anomaly detection. arXiv 2020, arXiv:2006.00339. [Google Scholar]
  16. Huber, P.J. Robust Estimation of a Location Parameter. Ann. Math. Stat. 1964, 35, 73–101. [Google Scholar] [CrossRef]
  17. Kaggle: San Francisco, CA, USA. 2020. Available online: https://www.kaggle.com/datasets/ravirajsinh45/real-life-industrial-dataset-of-casting-product?resource=download-directory (accessed on 20 March 2025).
  18. Arima, K.; Nagata, F.; Shimizu, T.; Otuka, A.; Kato, H.; Watanabe, K.; Habib, M.K. Improvements of Detection Accuracy and Its Confidence of Defective Areas by YOLOv2 Using a Dataset Augmentation Method. In Artificial Life and Robotics; Springer: Berlin/Heidelberg, Germany, 2023; Volume 28, pp. 625–631. [Google Scholar]
  19. Murphy, K.P. Machine Learning: A Probabilistic Perspective; The MIT Press: Cambridge, MA, USA, 2012. [Google Scholar]
  20. Zeiler, M.D.; Fergus, R. Visualizing and Understanding Convolutional Networks. In Computer Vision—ECCV 2014, Proceedings of the 13th European Conference, Proceedings, Part III (Lecture Notes in Computer Science, 8691), Zurich, Switzerland, 6–12 September 2014; Springer: Berlin/Heidelberg, Germany, 2014; pp. 818–833. [Google Scholar]
  21. Kingma, D.; Ba, J. Adam: A Method for Stochastic Optimization. In Proceedings of the 3rd International Conference on Learning Representations (ICLR 2015), San Diego, CA, USA, 7–9 May 2015; 15p. Available online: https://arxiv.org/pdf/1412.6980.pdf (accessed on 15 February 2024).
  22. Shimizu, T.; Nagata, F.; Habib, M.K.; Armina, K.; Otsuka, A.; Watanabe, K. Advanced Defect Detection in Wrap Film Products: A Hybrid Approach with Convolutional Neural Networks and One-Class Support Vector Machines with Variational Autoencoder-Derived Covariance Vectors. Machines 2024, 12, 603. [Google Scholar] [CrossRef]
Figure 1. Network structure of VGG19-based FCDD model.
Figure 1. Network structure of VGG19-based FCDD model.
Machines 13 00328 g001
Figure 2. Main dialogue of FCDD modeling application developed on MATLAB R2024b, through which the desired backbone CNN model is easily selected.
Figure 2. Main dialogue of FCDD modeling application developed on MATLAB R2024b, through which the desired backbone CNN model is easily selected.
Machines 13 00328 g002
Figure 3. Examples of training results. (a) is completely trained case, in which normal and anomaly samples in training dataset are completely separated. (b) is not-completely trained case, in which overlaps of normal and anomaly bins are seen.
Figure 3. Examples of training results. (a) is completely trained case, in which normal and anomaly samples in training dataset are completely separated. (b) is not-completely trained case, in which overlaps of normal and anomaly bins are seen.
Machines 13 00328 g003
Figure 4. Examples of brake rotors without defects [17].
Figure 4. Examples of brake rotors without defects [17].
Machines 13 00328 g004
Figure 5. Examples of brake rotors with defects [17], in which typical defect parts are marked with red boxes.
Figure 5. Examples of brake rotors with defects [17], in which typical defect parts are marked with red boxes.
Machines 13 00328 g005
Figure 6. Only one misclassified image named ‘cast_def_0_571.jpeg’ (false negative).
Figure 6. Only one misclassified image named ‘cast_def_0_571.jpeg’ (false negative).
Machines 13 00328 g006
Figure 7. Heat maps generated by Grad-CAM.
Figure 7. Heat maps generated by Grad-CAM.
Machines 13 00328 g007
Figure 8. Heat maps generated by Occlusion Sensitivity.
Figure 8. Heat maps generated by Occlusion Sensitivity.
Machines 13 00328 g008
Figure 9. More reasonable and clearer heat maps generated by FCDD than Grad-CAM and Occlusion Sensitivity.
Figure 9. More reasonable and clearer heat maps generated by FCDD than Grad-CAM and Occlusion Sensitivity.
Machines 13 00328 g009
Figure 10. Examples of original images (upper) and enlarged ones (lower) of fibrous industrial material without defects. They are processed as OK products.
Figure 10. Examples of original images (upper) and enlarged ones (lower) of fibrous industrial material without defects. They are processed as OK products.
Machines 13 00328 g010
Figure 11. Examples of original images (upper) and enlarged ones (lower) of fibrous industrial product with defects. In enlarged figures, defects such as split hairs and frays are indicated by arrow and rectangle marks. They are processed as NG products.
Figure 11. Examples of original images (upper) and enlarged ones (lower) of fibrous industrial product with defects. In enlarged figures, defects such as split hairs and frays are indicated by arrow and rectangle marks. They are processed as NG products.
Machines 13 00328 g011
Figure 12. Downsizing process to fit the input layer of VGG19. There is a concern that features of small and thin defects may be lost.
Figure 12. Downsizing process to fit the input layer of VGG19. There is a concern that features of small and thin defects may be lost.
Machines 13 00328 g012
Figure 13. Heat maps generated by Grad-CAM, in which the split-end-type defect was not heatmapped.
Figure 13. Heat maps generated by Grad-CAM, in which the split-end-type defect was not heatmapped.
Machines 13 00328 g013
Figure 14. The heat maps generated by Occlusion Sensitivity appear to be better than those in Figure 13; however, the split-hair type defect in the left photo was still not heatmapped.
Figure 14. The heat maps generated by Occlusion Sensitivity appear to be better than those in Figure 13; however, the split-hair type defect in the left photo was still not heatmapped.
Machines 13 00328 g014
Figure 15. Heat maps generated by FCDD, in which even the split-hair-type defect is successfully heatmapped.
Figure 15. Heat maps generated by FCDD, in which even the split-hair-type defect is successfully heatmapped.
Machines 13 00328 g015
Figure 16. Image samples of wrap films on production line before extraction by template matching, in which defect areas are marked with red boxes.
Figure 16. Image samples of wrap films on production line before extraction by template matching, in which defect areas are marked with red boxes.
Machines 13 00328 g016
Figure 17. Heat maps generated by Grad-CAM, in which target defect areas are marked with dotted red boxes.
Figure 17. Heat maps generated by Grad-CAM, in which target defect areas are marked with dotted red boxes.
Machines 13 00328 g017
Figure 18. Heat maps generated by Occlusion Sensitivity.
Figure 18. Heat maps generated by Occlusion Sensitivity.
Machines 13 00328 g018
Figure 19. Heat maps generated by FCDD.
Figure 19. Heat maps generated by FCDD.
Machines 13 00328 g019
Table 1. Classification result by VGG19-based CNN.
Table 1. Classification result by VGG19-based CNN.
PredictedAnomaly (NG)Normal (OK)
True
Anomaly (NG)991
Normal (OK)0100
Table 2. Classification result by FCDD model (threshold = 0.53).
Table 2. Classification result by FCDD model (threshold = 0.53).
PredictedAnomaly (NG)Normal (OK)
True
Anomaly (NG)991
Normal (OK)0100
Table 3. Classification result using VGG19-based CNN.
Table 3. Classification result using VGG19-based CNN.
PredictedAnomaly (NG)Normal (OK)
True
Anomaly (NG)505
Normal (OK)541
Table 4. Classification result by FCDD model (threshold = 1.30).
Table 4. Classification result by FCDD model (threshold = 1.30).
PredictedAnomaly (NG)Normal (OK)
True
Anomaly (NG)505
Normal (OK)640
Table 5. Classification result using VGG19-based CNN.
Table 5. Classification result using VGG19-based CNN.
PredictedAnomaly (NG)Normal (OK)
True
Anomaly (NG)61810
Normal (OK)23445
Table 6. Classification result using FCDD model (threshold = 1.50).
Table 6. Classification result using FCDD model (threshold = 1.50).
PredictedAnomaly (NG)Normal (OK)
True
Anomaly (NG)6208
Normal (OK)11457
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Nagata, F.; Sakata, S.; Watanabe, K.; Habib, M.K.; Ghani, A.S.A. MATLAB Application for User-Friendly Design of Fully Convolutional Data Description Models for Defect Detection of Industrial Products and Its Concurrent Visualization. Machines 2025, 13, 328. https://doi.org/10.3390/machines13040328

AMA Style

Nagata F, Sakata S, Watanabe K, Habib MK, Ghani ASA. MATLAB Application for User-Friendly Design of Fully Convolutional Data Description Models for Defect Detection of Industrial Products and Its Concurrent Visualization. Machines. 2025; 13(4):328. https://doi.org/10.3390/machines13040328

Chicago/Turabian Style

Nagata, Fusaomi, Shingo Sakata, Keigo Watanabe, Maki K. Habib, and Ahmad Shahrizan Abdul Ghani. 2025. "MATLAB Application for User-Friendly Design of Fully Convolutional Data Description Models for Defect Detection of Industrial Products and Its Concurrent Visualization" Machines 13, no. 4: 328. https://doi.org/10.3390/machines13040328

APA Style

Nagata, F., Sakata, S., Watanabe, K., Habib, M. K., & Ghani, A. S. A. (2025). MATLAB Application for User-Friendly Design of Fully Convolutional Data Description Models for Defect Detection of Industrial Products and Its Concurrent Visualization. Machines, 13(4), 328. https://doi.org/10.3390/machines13040328

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