**6. Exemplar industrial applications**

The quality control in industrial applications is used to monitor and to guarantee the quality of the processes.

Fuzzy Inference Systems Applied to Image Classification in the Industrial Field 253

Two features are selected to be fed as inputs to the fuzzy system namely the vehicle weight and speed. The output of the fuzzy system is a weighting factor which is used to modify the

Triangular membership functions have been defined to represent each linguistic value. Finally the fuzzy rule basis have been created with the help of expert's heuristic knowledge,

> Slow Very light Zero Medium Very light Negative small Fast Very light Negative big Slow Light Positive small Medium Light Zero Slow Medium Positive big Medium Medium Positive small Fast Medium Zero Slow Heavy Positive big Medium Heavy Positive big Fast Heavy Positive small

On the basis of the rules the output of the fuzzy system is evaluated through an inference system of Mandani type (Mandani, 1974) and a defuzzification operation. Finally the

where *LM* is the modified length, *L* represents the measured length and *WF* is the weighting factor in output from the fuzzy system. The modified length is used as input to a classifier in order to obtain the vehicle classification. Experimental results demonstrate that the proposed algorithm using fuzzy approach significantly outperforms the conventional vehicle classification algorithm (Kim et al., 1998; Kim et al., 1999). The classification error using a conventional algorithm is 12.78% (74 errors on 579 vehicles analysed), while adopting the proposed fuzzy approach the classification error decreases to 6.56% (38 errors

Borselli et al. (Borselli et al., 2011) propose a fuzzy-based classification in order to classify a particular class of defects that can be present on the surface of some flat steel products. In the steelmaking industry a lot of steel rolling mills are equipped with an Automatic

*LM = L \* [1 + (WF /100)]* (3)

**Speed Weight Length Modification** 

length value. Inputs and output are interpreted as linguistic values in this manner:



which is described in Tab.1.

Table 1. Rule basis

on 579 vehicles).


modified vehicle length is calculated as follows:

**6.2 Classification of surface defects on flat steel products** 

Actually many industries have adopted vision systems for improve the quality control of products (Amiri & Shanbehzadeh, 2009; Ferreira et al., 2009). The quality control includes the ability tackling problems of several scientific areas, such as signal acquisition, signal processing, features extraction, classification and so on. Many approaches have been proposed in order to design intelligent signal and visual inspection systems for the quality control using fuzzy theory, that has been recognized in the literature as a good tool to achieve these goals. In the following a description of some exemplar fuzzy-based methods is proposed.

#### **6.1 Vehicle classification exploiting traffic sensors**

Kim et al. (Kim et al., 2001) propose an algorithm for vehicle classification based on fuzzy theory. Many approaches have been proposed in order to identify vehicles through traffic sensors; one of the most typically adopted technologies for vehicle classification is the combined loop and piezoelectric sensor system (Kim et al., 1998; Kim et al., 1999). A heuristic knowledge about vehicle speed or shape, once the vehicle length is known, is available, but in the loop/piezo detector there is not a precise mathematic association between the vehicle length and speed or shape. Also this heuristic knowledge could be well formalised using the *if-then* fuzzy rules.

The main idea of the proposed method is to modify the output length value from the loop sensor and use it to classify each vehicle. The general scheme of the proposed algorithm is shown in Fig.4.

Fig. 4. Scheme of the system for vehicles classification.

Two features are selected to be fed as inputs to the fuzzy system namely the vehicle weight and speed. The output of the fuzzy system is a weighting factor which is used to modify the length value. Inputs and output are interpreted as linguistic values in this manner:


252 Fuzzy Inference System – Theory and Applications

Actually many industries have adopted vision systems for improve the quality control of products (Amiri & Shanbehzadeh, 2009; Ferreira et al., 2009). The quality control includes the ability tackling problems of several scientific areas, such as signal acquisition, signal processing, features extraction, classification and so on. Many approaches have been proposed in order to design intelligent signal and visual inspection systems for the quality control using fuzzy theory, that has been recognized in the literature as a good tool to achieve these goals. In

Kim et al. (Kim et al., 2001) propose an algorithm for vehicle classification based on fuzzy theory. Many approaches have been proposed in order to identify vehicles through traffic sensors; one of the most typically adopted technologies for vehicle classification is the combined loop and piezoelectric sensor system (Kim et al., 1998; Kim et al., 1999). A heuristic knowledge about vehicle speed or shape, once the vehicle length is known, is available, but in the loop/piezo detector there is not a precise mathematic association between the vehicle length and speed or shape. Also this heuristic knowledge could be well

The main idea of the proposed method is to modify the output length value from the loop sensor and use it to classify each vehicle. The general scheme of the proposed algorithm is

the following a description of some exemplar fuzzy-based methods is proposed.

**6.1 Vehicle classification exploiting traffic sensors** 

Fig. 4. Scheme of the system for vehicles classification.

formalised using the *if-then* fuzzy rules.

shown in Fig.4.


Triangular membership functions have been defined to represent each linguistic value. Finally the fuzzy rule basis have been created with the help of expert's heuristic knowledge, which is described in Tab.1.


Table 1. Rule basis

On the basis of the rules the output of the fuzzy system is evaluated through an inference system of Mandani type (Mandani, 1974) and a defuzzification operation. Finally the modified vehicle length is calculated as follows:

$$\text{LIM} = \text{L}^\* \left\{ 1 + \left( \text{V} \text{F} / 100 \right) \right\} \tag{3}$$

where *LM* is the modified length, *L* represents the measured length and *WF* is the weighting factor in output from the fuzzy system. The modified length is used as input to a classifier in order to obtain the vehicle classification. Experimental results demonstrate that the proposed algorithm using fuzzy approach significantly outperforms the conventional vehicle classification algorithm (Kim et al., 1998; Kim et al., 1999). The classification error using a conventional algorithm is 12.78% (74 errors on 579 vehicles analysed), while adopting the proposed fuzzy approach the classification error decreases to 6.56% (38 errors on 579 vehicles).

#### **6.2 Classification of surface defects on flat steel products**

Borselli et al. (Borselli et al., 2011) propose a fuzzy-based classification in order to classify a particular class of defects that can be present on the surface of some flat steel products. In the steelmaking industry a lot of steel rolling mills are equipped with an Automatic

Fuzzy Inference Systems Applied to Image Classification in the Industrial Field 255

The output is a fuzzy set, called probability of LPI defect, which can assume two values: *low*

**Small** High High Small Or low **High** Small Small High Or high

All the considered membership functions are Gaussian and are tuned by exploiting the data, as the adopted FIS is an Adaptive Neuro-Fuzzy Inference System (ANFIS) (Jang,

In order to demonstrate the effectiveness of the proposed method a comparison with other common classifiers has been made. The tested classifiers are: a Multi Layer Perceptron (MLP) classifier (Werbos, 1974), a Decision Tree (DT) (Argentiero et al., 1982) based on C4.5 algorithm (Quinlan, 1993), a Support Vector Machine (SVM) (Yan et al., 2009), a Learning Vector Quantization-based (LVQ) classifier (Elsayad, 2009). The method has also been compared to a previous system developed by the same authors (Borselli et al., 2010), which

The experimental data involve 212 images provided by an Italian steelmaking industry which have been randomly divided in two groups: a training set which includes the 75% of

> μ = <sup>∑</sup> ���(�) � ���

� = �<sup>∑</sup> (���(�)��) � � ���

where *Acc(i)* is the accuracy calculated during test *i-*th. *N* is the number of tests (in this

Results show that the proposed ANFIS-based approach outperforms the other approaches providing the highest accuracy (94.4%) and a low standard deviation values (2.1 %). This approach outperforms the other ones mainly because it is based on the knowledge of the

exploits a non-adaptive FIS whose parameters have been heuristically tuned.

The performance has been quantified in terms of average accuracy

, that are calculated on 30 tests and are defined as follows:

**Shape Brigthness Operator Probability** 

� (4)

� (5)

and standard deviation

**of LPI defect** 

The classification is based on a FIS. Four fuzzy sets are considered:

The inference rules that have been adopted are described in Table 2.


> **Maximum Width**

data and a validation set with the remaining 25%.


and *high*.

**Number of regions** 

Table 2. Rules

1991; Jang, 1993).

example *N=30*).

technical personnel.

Inspection System (ASIS) (Stolzenberg & Geisler, 2003). Such system contains a lighting system to illuminate the two faces of the moving strip and a set of cameras catch the images related to the steel surface each time a potential defect is detected. The defect is classified, when possible, and the images are stored in a database. Due to large amount of images and to the time constraints, often an on line classifier can misclassify some defects or it is not able to classify particular defects. An offline analysis of the non classified defects through more powerful although time-consuming techniques concerning this class of defects can greatly enhance the quality monitoring. In (Borselli et al., 2011) an off line classifier is proposed, that is capable to distinguish two types of particular defects called *Large Population of Inclusions* (LPI) and *Rolled In*, which are very similar. Before classification process an image cleaning is carried out through two filtering operations in order to improve the image quality. In particular a Sobel filter (Weng & Zhong, 2008) and a binarization are applied. Sobel filter is used to detect the edge while the binarization is a filter used to point out the regions having a different lightness with respect to the background. The two filters are independently applied to the original image and then the resulting images are summed in order to achieve a binary image where relevant defects are more visible. Depending on the nature of the considered defects, four features are extracted from the image which are: number of the regions where a defect is focused, the maximum width, the shape and the brightness of the considered regions. The four features are fed as inputs to classifier and the output, a value lying in the range [0,1], represents the probability that the analyzed defect is effectively a LPI defect. Finally a threshold comparison determines whether the defect belong to the LPI class or to the Rolled In class. The threshold is set to 0.5 and output values greater than 0.5 are considered LPI defects, Rolled In otherwise. The general scheme of the proposed approach is shown in Fig.5.

Fig. 5. Diagram of the proposed approach.

The classification is based on a FIS. Four fuzzy sets are considered:


254 Fuzzy Inference System – Theory and Applications

Inspection System (ASIS) (Stolzenberg & Geisler, 2003). Such system contains a lighting system to illuminate the two faces of the moving strip and a set of cameras catch the images related to the steel surface each time a potential defect is detected. The defect is classified, when possible, and the images are stored in a database. Due to large amount of images and to the time constraints, often an on line classifier can misclassify some defects or it is not able to classify particular defects. An offline analysis of the non classified defects through more powerful although time-consuming techniques concerning this class of defects can greatly enhance the quality monitoring. In (Borselli et al., 2011) an off line classifier is proposed, that is capable to distinguish two types of particular defects called *Large Population of Inclusions* (LPI) and *Rolled In*, which are very similar. Before classification process an image cleaning is carried out through two filtering operations in order to improve the image quality. In particular a Sobel filter (Weng & Zhong, 2008) and a binarization are applied. Sobel filter is used to detect the edge while the binarization is a filter used to point out the regions having a different lightness with respect to the background. The two filters are independently applied to the original image and then the resulting images are summed in order to achieve a binary image where relevant defects are more visible. Depending on the nature of the considered defects, four features are extracted from the image which are: number of the regions where a defect is focused, the maximum width, the shape and the brightness of the considered regions. The four features are fed as inputs to classifier and the output, a value lying in the range [0,1], represents the probability that the analyzed defect is effectively a LPI defect. Finally a threshold comparison determines whether the defect belong to the LPI class or to the Rolled In class. The threshold is set to 0.5 and output values greater than 0.5 are considered LPI defects,

Rolled In otherwise. The general scheme of the proposed approach is shown in Fig.5.

Fig. 5. Diagram of the proposed approach.


The output is a fuzzy set, called probability of LPI defect, which can assume two values: *low* and *high*.

The inference rules that have been adopted are described in Table 2.


Table 2. Rules

All the considered membership functions are Gaussian and are tuned by exploiting the data, as the adopted FIS is an Adaptive Neuro-Fuzzy Inference System (ANFIS) (Jang, 1991; Jang, 1993).

In order to demonstrate the effectiveness of the proposed method a comparison with other common classifiers has been made. The tested classifiers are: a Multi Layer Perceptron (MLP) classifier (Werbos, 1974), a Decision Tree (DT) (Argentiero et al., 1982) based on C4.5 algorithm (Quinlan, 1993), a Support Vector Machine (SVM) (Yan et al., 2009), a Learning Vector Quantization-based (LVQ) classifier (Elsayad, 2009). The method has also been compared to a previous system developed by the same authors (Borselli et al., 2010), which exploits a non-adaptive FIS whose parameters have been heuristically tuned.

The experimental data involve 212 images provided by an Italian steelmaking industry which have been randomly divided in two groups: a training set which includes the 75% of data and a validation set with the remaining 25%.

The performance has been quantified in terms of average accuracy and standard deviation , that are calculated on 30 tests and are defined as follows:

$$
\mu = \frac{\sum\_{l=1}^{N} Acc(l)}{N} \tag{4}
$$

$$
\sigma = \sqrt{\frac{\sum\_{l=1}^{N} (Acc(l) - \mu)^2}{N}} \tag{5}
$$

where *Acc(i)* is the accuracy calculated during test *i-*th. *N* is the number of tests (in this example *N=30*).

Results show that the proposed ANFIS-based approach outperforms the other approaches providing the highest accuracy (94.4%) and a low standard deviation values (2.1 %). This approach outperforms the other ones mainly because it is based on the knowledge of the technical personnel.

Fuzzy Inference Systems Applied to Image Classification in the Industrial Field 257

In order to limit the number of membership functions and rules the classification task is developed through two different fuzzy systems operating parallel. The first fuzzy classification system is used to provide a percentile index of acceptability of the weld, while the second fuzzy system detects the simultaneous signal patters directly connected with a specific defect. The first FIS gives a real time estimate of the quality of each weld, also for each time-window the system analyzes the indices through a rule-based method. Firstly a partition of the range of each observed input three fuzzy set is been made basing on the set of reference welds used as training set. The three introduced fuzzy sets are referred to quality: Optimal (OPT), acceptable (ACC) and unacceptable (UNA) and the membership functions have a trapezoidal shape. Finally the fuzzy system uses the welding time (*Time*) as an input to let the classification ignore the first seconds of process when the welding equipment is warming up. To describe the time interval a single linear piecewise increasing membership function regime (*REG*) is introduced. The output is represented by three membership functions as well. In this case the membership function are represented by

Once the membership functions have been defined, a few generic rules are introduced. The first rules refer to obvious conditions; then, each time, another rule is included and the overall classification performance is evaluated in order to adjust membership function and rule weights. The output is so defined as an index of weld quality, in particular 0% (UNA) indicates the occurrence of defect while 100% (OPT) represents an optimal weld, values in the range 0-100% represent intermediate acceptability. Subsequently a threshold of acceptability is introduced in order to convert the fuzzy degree of quality in a binary

*2. If Time is REG, NSO (IR) is OPT and CNSO (IR) is OPT and RSN (IR) is OPT and NSO (UV) is OPT and CNSO (UV) is OPT and RSN (UV) is OPT and NSO (VIS) is OPT and CNSO (VIS) is OPT and RSN (VIS) is OPT and NSO (Te) is OPT and CNSO (Te) is OPT* 

*3. If NSO (IR) is UNA or CNSO (IR) is UNA or RSN (IR) is UNA or NSO (UV) is UNA or CNSO (UV) is UNA or RSN (UV) is UNA or NSO (VIS) is UNA or CNSO (VIS) is UNA or RSN (VIS) is UNA or NSO (Te) is UNA or CNSO (Te) is UNA or RSN (Te) is UNA then the* 

*4. If NSO (IR) is ACC or CNSO (IR) is ACC or RSN (IR) is ACC or NSO (UV) is ACC or CNSO (UV) is ACC or RSN (UV) is ACC or NSO (VIS) is ACC or CNSO (VIS) is ACC or RSN (VIS) is ACC or NSO (Te) is ACC or CNSO (Te) is ACC or RSN (Te) is ACC then the* 

*5. If Time is REG, NSO (IR) is ACC and CNSO (IR) is ACC and RSN (IR) is ACC and NSO (UV) is ACC and CNSO (UV) is ACC and RSN (UV) is ACC and NSO (VIS) is ACC and CNSO (VIS) is ACC and RSN (VIS) is ACC and NSO (Te) is ACC and CNSO (Te) is ACC* 

The fuzzy rules used by the quality estimation system can be described as follow:

three singletons as follows:

decision: good or defective weld.

*OUTPUT is UNA. (weigth =0.1).* 

*OUTPUT is ACC. (weigth =0.2).* 

*1. If Time is not REG then the output is OPT. (weigth=1).* 

*and RSN (Te) is OPT then the OUTPUT is OPT. (weigth =1).* 

*and RSN (Te) is ACC then the OUTPUT is ACC. (weigth =0.8).* 

