Fuzzy Inference Systems Applied to Image Classification in the Industrial Field

The present chapter deals with the application of Fuzzy Inference Systems (FIS) for the classification of images, once they have been pre-processed through suitable algorithms. One of the main reasons for exploiting a FIS to this aim lies in the possibility of approaching the problem in a way similar to human reasoning. In fact a FIS allows:  To describe the problem in linguistic terms;  To translate the human experience (which is very often the reference starting point in industrial applications) through inference rules. The possibility of providing a methodological description in linguistic terms is a great advantage in problems that cannot be solved in terms of precise numerical relations, especially when only empirical a priori knowledge is available.  To perform an eventual further adaptation of the rules of the inference machine by exploiting the available data, as a neural training algorithm can be applied to tune some parameters of the fuzzy classifier.


Vision systems
In the last years the use of computer vision systems has enormously increased, especially in the industrial field, for several tasks (Malamas et al., 2003;Chin & Harlow, 1982;Nelson et al., 1996).
Traditionally human experts performed visual inspection and quality control and, in some cases, the human performance are better than the one provided by a machine.On the other hand, human operators are slower than machines, their performance is not constant through time and finding many expert operators is not easy for any industry.Moreover there are several applications where the job may be repetitive and boring (such as target training or robots guidance) or also difficult and dangerous (such as underwater inspection, nuclear industry, chemical industry ...).
Vision system are widely adopted in the control of robots for pick and place operations showing their power in very complex tasks (Sgarbi et al., 2010).
A vision system consists of electronic, optical and mechanical components and it is able to capture, record and process images.Typically it consists of one or more cameras, an optical system, a lighting system, an acquisition system and, finally, an image processing system.The object to be tested is placed in front of cameras and it is properly illuminated.The optical system forms an image on camera sensor which produces in output an electrical signal.Then this signal will be digitized and stored.Finally the image can be analysed with an appropriate software.A general scheme of a typical industrial vision system is shown in Fig. 1.The computational resources are exploited for processing the captured images through suitable analysis and classification software.One or more cameras acquire images under inspection and a lighting system is adopted to illuminate the scene in order to facilitate the acquisition of the image features (Malamas et al., 2003).
The prerequisites for the design and development of a good machine vision system depend on the application field and the task to be reached.An "universal" vision system, i.e. which is capable to fulfil any task in any application, does not exist; only after having established the requirements of the specific application the vision system can be designed.
In the last years computer and machine vision are been connected together for non invasive quality inspection.Machine vision allows to analyse video data, such as data coming from a video camera, in order to plan future operations.The automatic systems which carry out visual inspection by means of machine vision are often called Automatic Visual Inspection Systems (Jarvis, 1979).Artificial vision is defined as the set of computational techniques which aim to create an approximate model of the three-dimensional world from two-dimensional projections of it.A classic problem concerning artificial vision is to determine whether there are specific objects or activities in the image.Another problem, which is solved by vision systems, is to reconstruct a three dimensional model about the scene to be analysed, given one or more two-dimensional images of it (Klette et al., 1998).The optical techniques which are widely adopted can be divided in two approaches: active methods and passive methods.Active methods regard the case where the scene is radiated by appropriate electromagnetic radiation, while passive methods regard the case where the images of the scene are the real images.Active methods are more expensive than passive ones and they are not always applicable.In contrast, passive methods have lower resolutions than the active ones.Both approaches adopted the visual cues that are used by human vision system to retrieve the depth of the scene projection on the retina, such as blurring and other optical phenomena.
There are many applications of artificial vision in industrial field such as defect detection, robot placement, robot orientation and robot guidance (Lowe & Little, 2005), codes reading, classification.In the last decades the Artificial Vision has evolved into a mature science, which embraces different markets and applications becoming a vital component of advanced industrial systems (Lanzetta, 1998).Feature extraction tends to simplify the amount of property required to represent a large set of data correctly.A feature can be defined as a function concerning measurements which represent a property of a considered object (Choras, 2007).Features can be classified as lowlevel features and high level feature.
The low-level features are the features which can be extracted automatically from image without any information about the shape.A widely used approach is the so called edge detection, which is adopted in order to identify points in a digital image at which the image brightness changes brusquely, also edge detection highlights image contrast.The boundary of features within an image can be discover detecting contrast as the difference in intensity.Trucco & Verri (Trucco & Verri, 1998) identified three main steps to perform edge detection: noise smoothing, edge enhancement and edge localization.Noise smoothing, also called noise reduction, eliminates noise as much as possible without destroying the edges of the image.Edge enhancement produces images with large intensity values at edge pixels and low intensity levels elsewhere.Finally edge localization is used to decide which local maxima among the filter outputs are effectively edges and are not produced by noise (Roque et al., 2010).
The Sobel edge detection operator (Sobel, 1970) has been the most popular operator until the improvement of the edge detection techniques having a theoretical basis.It consists of two masks in order to identify the edges under a vector form.The inputs of the Sobel approach include an image I and a threshold t.Once the noise smoothing filters have been applied, the corresponding linear filter is carried out to the new smoothed image by using a pair of 3x3 convolution masks, one estimating the gradient in the x-direction (columns) and other estimating the gradient in the y-direction (rows).
The output of the two above defined masks is represented by two images I 1 and I 2 .Through equation (2) the degree of the intensity gradient is estimated for each pixel I(i,j).
Finally the pixels p(i,j) which are greater than the threshold t are identified as edges.
Canny edge detection operator (Canny, 1986) is probably the most popular edge detection technique at the moment.It is created by taking into account three main purposes:  best possible detection with no spurious responses;  good localisation with minimal distance between detected and effective edge position;  single response to delete multiple responses to a single edge.
The first requirement reduces the response to noise through an optimal smoothing.Canny demonstrated that Gaussian filtering is optimal concerning edge detection.The second requirement is introduced to improve the accuracy, in fact it is used to detect edges in the right position.This result is obtained by a process of non-maximum suppression (similar to peak detection) which maintains only the points that are located at the top of a crest of edge data.Finally the third requirement regards the position of a single edge point when a change in brightness occurs.
High-level features extraction is used to find shapes in computer images.To better understand this approach let us suppose that the image to be analyzed is represented by a human face.
If we want to automatically recognise the face, we can extract the component features, for example the eyes, mouth and the nose.To detect them we can exploit their shape information: for instance, we know that the white part of the eye is ellipsoidal and so on.Shape extraction includes finding the position, the orientation and the size.In many applications the analysis can be helped by the way the shape are placed.In face analysis we imagine to find eyes above and the mouth below the nose and so on.
Thresholding is a simple shape extraction technique.It is used when the brightness of the shape is known, in fact pixels forming the shape can be detected categorizing pixels according to a fixed intensity threshold.The main advantage lies in its simplicity and in the fact that it requires a low computational effort but this approach is sensitive to illumination change and this is a considerable limit.When the illumination level changes linearly, the adoption of a histogram equalization would provide an image which does not vary; unfortunately this approach is widely sensitive to noise rendering and again the threshold comparison-based approach is impracticable.An alternative technique consists in the subtraction of the image from the background before applying a threshold comparison; this approach requires the a priori knowledge of the background.Threshold comparison and subtraction have the main advantage to be simple and fast but the performances of both technique are sensitive to partial shape data, noise and variation in illumination.
Another popular shape extraction technique is the so called Template matching, which consists in matching a template to an image.The template is a sub-image that represents the shape to be found in the image.The template is centred on an image point and the number of points that match the points in the image are calculated; the procedure is repeated for the whole image and points which led to the best match are the candidates to be the point where the shape is inner the image.Template matching can be seen as a method of parameter estimation, where parameters define the position of the template but the main disadvantage of the proposed approach is the high computational cost.
Another popular technique which locates shapes in images is the Hough Transform (Hough, 1962).This method was introduced by Hough to find bubble tracks and subsequently Rosenfeld (Rosenfeld, 1969) understood its possible advantages as an image processing method.It is widely used to extract lines, circles and ellipses and its main advantage is that it is able to reach the same results than template matching approach but is it faster (Princen et al., 1992).The Hough Transform delineates a mapping from the image points into an accumulator space called Hough space; the mapping is obtained in a computationally efficient manner based on the function that represents the target shape.This approach requires considerable storage and high computational resources but much less than template matching approach.When the shape to be extracted is more complex than lines and circles or the image cannot be partitioned into geometric primitive a Generalised Hough www.intechopen.comFuzzy Inference System -Theory and Applications

248
Transform (GHT) approach can be used (Ballard, 1981).GHT can be implemented basing on the discrete representation given by tabular functions.

Industrial quality control
In the field of quality control there are two main elements which play an important role: the presence of sensors used to capture data, such as signals or images, and the adopted computational intelligence techniques (Piuri & Scotti, 2005).The quality monitoring includes the use of signal measurements or machine visual systems in order to allow a standardized and non-invasive control of industrial production processes.The computational intelligence techniques comprise the formalisation of the mechanism which allows the extraction of useful information from the images and its interpretation for the purposes the systems it is designed for; therefore it may also include components such as neural networks, fuzzy systems and evolutionary computer algorithms.A generic quality control system needs to manage techniques belonging to several scientific areas, such as depicted in Fig. 2.

Fig. 2. Generic scheme of quality control system
In the following, a brief explanation of all the blocks included in Fig. 2 is provided.

Data acquisition
The data acquisition is a typical problem concerning measurements systems.A lot of studies demonstrate how the computational intelligence techniques can improve the performance of sensors from both the static and the dynamic point of view (Ferrari & Piuri, 2003).The sensor modules can be able to self-calibrate and also reduce the unexpected non-linearities.Also eventual errors can be detected and, if necessary, corrected (Wandell et al., 2002).Images are usually acquired by cameras in digital format.

Data pre-processing
The main aim of signal pre-processing is to reduce the noise and to make use of inherent information provided by signals.In literature many conventional pre-processing techniques have been proposed (Proakis & Manolakis, 1996;Rabiner & Gold, 1975) including computational intelligence techniques; in this context a good survey of neural and fuzzy approaches for signal pre-processing is due to Widrow and Sterns (Widrow & Stern, 1985).
If the captured data consist of an image, pre-processing phase is used to correct image acquisition and not perfect source image conditions.In each system, which implements machine vision functionalities, a pre-processing phase is recommended in order to correct image acquisition errors or to improve characteristics for visual inspection.
Image pre-processing is a phase which, through several operations, improves the image by suppressing undesirable distortions or enhancing relevant features for the further analysis tasks.Note that image pre-processing does not add information content to the image (Haralik & Shapiro, 1992;Hlavak et al., 1998) but uses the redundancy basing on the concept that a real object has similar neighbouring pixels which correspond to a similar brightness value.A distorted pixel can be removed from the image and it can also be reinserted in the image having a value equal to the average of the neighbouring pixels.
The main operations included in the pre-processing image phase are resumed as follow: Cropping is introduced to remove some parts of the image in order to point out the regions of interest.
Image filtering exploits a small neighbourhood of a pixel belonging to the input image in order to provide a new brightness value in the output image.
Smoothing techniques are used to reduce noise or eventual fluctuations occurring in the image.To reach this task it is necessary to suppress high frequencies in the Fourier transform domain.
Brightness threshold is a fundamental operation to extract pertinent information.It consists in a gray scale transformation whose result is a binary image.This approach is based on the segmentation and separates objects from their background.
Edge Detection is a very important step in image pre-processing.Edges are pixels lying where the intensity of image charges roughly.In previous paragraph the edge detection method is treated in more details.

www.intechopen.com
Fuzzy Inference System -Theory and Applications 250

Features extraction and selection
With the previous operation all features that are processed by sensors have been fixed.Through feature extraction and selection the initial data can be reduced in order to diminish the computational complexity of the system.Moreover a reduction of features number simplifies both the pattern representation and the classifier structure; finally a reduction of features number solve the problem of "curse of dimensionality" (Roudys & Jain, 1991).The so-called curse of dimensionality problem consists in the fact that the number of instances for feature exponentially increases with the number of features itself; also in order to reduce the complexity of the computational intelligence modules under training, it is fundamental to limit the number of features to consider.Both feature extraction and feature selection are used for the reduction of the feature space.
The main difference between the two approaches is that the feature extraction approach generates new features based on transformation or combination of the original features while feature selection approach selects the best subset of the original feature set (Dalton, 1996).

Data fusion
This operation combines the available features in order to obtain more significant information concerning the quality of the industrial process under consideration.A widely used technique is the so called sensor fusion, which combines information of different type coming from several sensors.A lot of papers, concerning the use of intelligent techniques have been proposed, such as (Bloch, 1996;Filippidi et al., 2000;Xia et al., 2002;Benediktsson et al., 1997).Data fusion systems can be composed by several elements such as sensors, data-fusion nodes, data-fusion databases and expert knowledge databases.

Classification
Once the features are fixed, they are led in input to a classifier which outputs a value associated to the classification of the quality (integer value) or a quality index (real value).
The classification can be divided into two approaches: conventional classification and computational intelligence-based classification.The computational intelligence-based approach includes statistical approach (Fukunaga, 1972), neural networks (Haykin, 1999) and fuzzy systems (Bezdek, 1992).This last issue will be treated in the next section.

System optimization
Modules belonging to the quality control system contain parameters which need to be fixed in order to improve final accuracy, computational complexity, maximum possible throughput and memory exploitation.These parameters include, for instance, thresholds, filter coefficients and number of hidden neurons in the case of use of neural network.
In order to build a satisfactory quality control system it is important to integrate all the above cited activities.In order to obtain more accurate, adaptive and performing systems the use of computational intelligence techniques are recommended.

Fuzzy classifier
Fuzzy Logic has been introduced by Zadeh (Zadeh, 1965) and it is based on the concept of "partial truth", i.e. truth values between "absolutely true" and "absolutely false".Fuzzy Logic provides a structure to model uncertainty, the human way of reasoning and the perception process.Fuzzy Logic is based on natural language and through a set of rules an inference system is built which is the basis of the fuzzy computation.Fuzzy logic has many advantages, firstly it is essential and applicable to many systems, moreover it is easy to understand and mostly flexible; finally it is able to model non linear functions of arbitrary complexity.The Fuzzy Inference System (FIS) is one of the main concepts of fuzzy logic and the general scheme is shown in Fig. 3.

Fig. 3. FIS scheme
A FIS is a way of mapping input data to output data by exploiting the fuzzy logic concepts.
Fuzzification is used to convert the system inputs, which is represented by crisp numbers into fuzzy set through a fuzzification function.The fuzzy rule base is characterized in the form of if-then rules and the set of these fuzzy rules provide the rule base for the fuzzy logic system.Moreover the inference engine simulates the human reasoning process: through a suitable composition procedure, all the fuzzy subsets corresponding to each output variable, are combined together in order to obtain a single fuzzy for each output variable.Finally the defuzzification operation is used to convert the fuzzy set coming from the inference engine into a crisp value (Abraham, 2005).
Fuzzy classification is an application of fuzzy theory.In fuzzy classification an instance can belong to different classes with different membership degrees; conventionally the sum of the membership values of each single instance must be unitary.The main advantage of fuzzy classification based method includes its applicability for very complex processes.

Exemplar industrial applications
The quality control in industrial applications is used to monitor and to guarantee the quality of the processes.
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.

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. 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: -Speed : slow, medium, fast -Weight: very light, light, medium, heavy -Length mod: negative big, negative small, zero, positive small, positive big.
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.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:

Speed
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).

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 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)   The classification is based on a FIS.Four fuzzy sets are considered: -Number of regions: small, high -Maximum width: small, high -Shape: small, high -Brightness: low, high.
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.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).

Number of regions
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: 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.

www.intechopen.com
Fuzzy Inference System -Theory and Applications 256

On line defects detection in Gas Metal Arc Welding
Another fuzzy application used in industrial field is proposed by Naso & Turchiano (Naso & Turchiano, 2005), who propose the development of an intelligent optical sensor for on line defects detection in Gas Metal Arc Welding (GMAW).
GMAW (Li & Zhang, 2001) is a welding process widely used in industrial field (Bingul et al., 2000) which presents many advantages, such as low costs, high metal deposition rate and suitability to automation.Also the process monitoring and defect-detections methods are very important tasks in order to improve the weld quality reducing manufacturing costs.
The electro-optical sensor includes two main modules (sensor and telescope) which are interconnected with optical fibers.This equipment aims at filtering and splitting the measured radiation into four components: infrared (IR), ultraviolet (UV) and two radiations at visible wavelengths (VIS1, VIS2).Photodiodes convert the resulting beams in electrical signals.The wavelength of the two signals belonging to the visible spectrum is set to tolerate the computation of the electronic temperature (Te) of the plasma.If VIS1, VIS2, Te are interdependent, then only Te and VIS1 are taken into account to eliminate redundancies.
Before the on line classification operation, a signal pre-processing phase is necessary in order to improve the signal quality.The pre-processing phase includes two stages: signal filtering and extraction of the regularity indices.Signal filtering is a fundamental step in this context because a large amount of noise affects the observed signals.The Kalman filter (Brown & Hwang, 1992) has been adopted to this purpose, which provides efficient algorithms for estimating useful parameters in the stochastic environments.Regularity indices are extracted considering several factors: first of all, given a fixed configuration of the welding equipment, the signals associated to successful welding processes have the same behaviour; in contrast, signals observed during defective welds contain particularly features which are easily associable to the occurred defect.Also, it is possible to discover when the quality of the weld decreases, the cause of such downgrading and the type of defect.For the classification task the information describing the behaviour of the observed signal can be synthesized in three independent features: 1. Normalized Signal Offset (NSO), which is used to quantify the deviation of the signal from the expected value belonging to an ideal weld.2. Change of Normalized Signal Offset (CNSO), which measures the change in signal levels between two consecutive time windows.3. Residual Signal Noise (RSN), which represents the remain noise in the signal after the Kalman filtering.
The extracted features are fed as inputs into a classifier.In order to develop a classifier that directly exploits the experts knowledge a fuzzy system has been chosen.It must be noticed that signals belonging to different welds are different due to the stochastic nature of the phenomena under consideration; also the deviation of one or more indices from their expected behaviour often is due to the occurrence of a defect during the welding process.Fuzzy system, in this context, is the ideal classifier, as it is simple, it can directly use the knowledge of the experts and it can be easily reconfigured when new knowledge is available.
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 three singletons as follows: 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 decision: good or defective weld.
The fuzzy rules used by the quality estimation system can be described as follow: 1.If Time is not REG then the output is OPT.(weigth=1 The second fuzzy system is used to display messages which explain the occurred defect or the anomaly operation in the considered weld.The considered events for this aim are the common ones such as current increase, current decrease, voltage variation, gases assistance decrease, contamination of with materials having different thermal properties and occurrence of hole in the metal.The second FIS is similar to the first one working with analogous membership functions and rules and provides six outputs, one for each considered defect.It is evident that a single defect could be associated to one or more causes.Both Fuzzy Inference Systems are Mandani type and a general scheme of the proposed approach is shown in Fig. 6.
The proposed approach has been evaluated with 40 different welding processes, where the 70% of processes are non defective while the remaining 30% present particular defects voluntarily induced or a posteriori detected with an appropriate tool.Furthermore, 60% of data are used as training set and 40% as validation set.
In order to demonstrate the effectiveness of the proposed method a comparison with a stochastic approach (Sforza & DeBlasiis, 2002) is provided.It is important consider that stochastic approach is not able to indicate the type of defect and, in order to make the comparison, the fuzzy index of quality must be convert in a binary value, also a threshold is necessary.The obtained results show that the fuzzy classification system correctly classifies all considered welds while the stochastic approach misclassifies 14% of the welds.
Finally a sensitivity analysis in order to evaluate the robustness of the proposed approach, when membership function, rules and operating condition vary, is carried out.The sensitivity investigation on the several variation of parameters leads to the following conclusion: if a proper pre-processing signal phase and a correct identification of the important features are been carried out, then the proposed fuzzy classification system can be effectively built and tuned.

Detection of wafer defects
An interesting industrial application which exploits the advantages of the fuzzy theory is due to (Tong et al., 2003).The authors propose a process control chart which integrate both fuzzy theory and engineering experience in order to monitor the defects on a wafer which have been clustered.
The wafer manufacturing process contains many step, such as alignment, etch and deposition.It is a very complex process; the occurrence of defects on the wafer surface is unavoidable and decreases the wafer yield.
Typically Integrated Circuits (IC) manufacturers use c-charts to monitor wafer defects.This technique assumes that wafer defects are randomly and independently distributed so that the number of defects has a Poisson distribution.A limit of this approach is that the real defect clustering infringes this constraint creating a non acceptable occurrences of false alarms.A modified c-chart, introduced in order to solve this problem, is presented by Albin & Friedman (Albin & Friedman, 1991) and it is based on a Neyman Type-A distribution.
Unfortunately also this approach presents a considerable limit, as it can monitor only the variation in the number of defects but it is not able to detect variation located within the wafer.The authors demonstrate that applying fuzzy theory in combination with engineering experience it is possible to build a process control chart which is able to monitor the clustered defect and defect clustering simultaneously.The proposed algorithm is illustrated in Fig. 7.
The KLA 2110 wafer inspection system (Castucci et al., 1991) is adopted to obtain the wafer map.This system provides in-line wafer inspection information such as number of defects, size of defects, placement of defects and, finally, type of defects.The number of defects are determined and the cluster index is calculated.Some cluster indices are provide to calculate the extent of the clustering of the defects; an efficient cluster index is due to Jun et al. (Jun et al., 1999).This particular Cluster Index (CI) does not require any a-priori assumption concerning the defects distribution.CI is calculated in the following way: let us suppose that d represents the number of defects occurred on a wafer, and X i and Y i are the coordinates of the generic defect i (1≤i≤n) in a two dimensional plane.Fig. 7. Procedure of proposed approach Sorting X i and Y i in ascending order, we can define X (i) and Y (i) as the coordinates of the ith defect.Moreover the two follow intervals A i and B i are evaluated: Note that X (0) and Y (0) are considered null.
Finally CI can be defined as in equation ( 8) where µ A and µ B are the mean value of A i and B i respectively, while ϭ A and ϭ B are their standard deviation.CI=1 when the defect distribution is uniform, moreover if CI>1 then the defects are clustered.
Once CI is available, the membership functions corresponding to number of defects, CI and output of the system are evaluated.Number of defects and clustering are important characteristics which mainly determine the wafer yield.In this approach this two variables as input of the FIS, which is Mandani type, and the output of the process represents the output of the fuzzy system.In the proposed examples the number of defected can be classified in seven classes defined as follows: 1. very low 2. low 3. medium low 4. medium 5. medium high 6.high 7. very high Also, for each fuzzy set a triangular membership function is constructed accordingly.
Clustering phenomena is classified in ten classes and the output can be classified in ten levels as well.Finally, according to the process control a set of rules based on experts knowledge has been defined.It is important to consider that, when many defects are present, without clustering, the process is considered out of control, while when the number of defects is low clustering is significant and also under control.
The corresponding rules created to monitor the process can be written as follow: Subsequently a fuzzy system according to the rules and a fuzzy control chart can be designed also building eventual control limits.Once the defect data are stored, they are transformed into output of the fuzzy inference rules and a control chart which monitor both number of defects and clustering is constructed.The last important step is determine the rules which determine when the process is out of control.
The main advantages of the proposed approach include the possibility to incorporate within the fuzzy system the knowledge of experts and the experience of engineering.Moreover the proposed chart is easy and very helpful in judging real process conditions and, finally, it is simpler and more efficient respect to Poisson based c-chart and the Neyman-based c-chart.

Detection of defective products in the paper industry
A further application of a combination of vision systems and fuzzy inference is found in (Colla et al., 2009) and is related to a quality control task within the paper industry.
One of the main phases of the manufacturing of paper rolls for domestic consists in cutting a long semi-finished roll into rolls of standard length by means of an automatic machinery equipped with a fast-rotating circular blade.
These iterated cuts damage the blade of the machinery devoted to this operation due to the resistance of the paper roll.The performance of the damaged blade decreases the quality of the cut and can lead to surface defects on the roll section and on the contour of the roll itself, as shown in Fig. 8. Unfortunately, independently on the quality of the paper itself, the presence of these defects compromises the marketability of the final product, thus a quality control step is needed in order to perform the selection of the final product.Usually this latter control is manually performed by a human operator which assesses the quality of each product, one by one, taking into account the quantity, intensity and kind of defects that are present on the roll sections.The human operator decides not only if each single roll has to be discarded or put into market but also when to stop the machinery for the maintenance of the cutting blade.
Within this context it would be desirable to automate the process of quality control for different purposes: on one hand in order to avoid an alienating task for the human operator, on the other hand in order to speed-up the control and to increase the repeatability and standardise the performance of the control operations, as, obviously, the results of the quality check are heavily affected by the experience and skills of the human operators.For these reasons a fuzzy inference-based vision system has been developed for the quality control on the previously described process.
This automatic system is placed immediately after the cutting machinery, in order to examine the rolls as soon as they are produced, while in the laboratory experimental set up, the paper roll is manually placed in front of the camera.In the real industrial operating scenario, each time a new roll is cut, a belt or a robot should place it with its circular section in front of the camera that is part of the vision system.
The vision system exploits one single static analogical B/W camera which acquires the images and digitalizes them.The decision system directly operates on the digitalized grey scale image and, as a result, provides the decision concerning the destination (market or recycling) of the inspected product.
The main goal of the developed system is to evaluate the quality of single products on the basis of the defects that are eventually present on the internal part of the paper section, neglecting the irregularity of the contour, as this latter defect can be due also to other phases of the manufacture and does not compromise the marketability of the product.
The quality control system here described implements three subsequent processing stages, which are summarized in the flow chart depicted in Fig. 9.The first one performs some image processing operations which elaborate the grey scale image and aim to put into evidence those areas of the roll section that are affected by surface defects.At this stage, a combination of filters is used to highlight the grey level discontinuities on the images.These filters take into account the grey intensity of each specific point and of its neighbours for calculating the so-called gradient associated to each pixel, which is higher in correspondence of strong and abrupt variations of the image.This feature can indicate the presence of defects.In order to select only those points where the grey level change is particularly high and, by consequence, more probably belonging to a defect, a threshold operator which produces a binary image is used.

www.intechopen.com
Fuzzy Inference System -Theory and Applications

264
This latter operation, together with the faulty zones, puts into evidence the contour of the paper roll which has to be eliminated from the resulting image for the successive processing steps.For this reason the pixels corresponding to the borders of the roll are detected through a specific edge finding algorithm based on the Canny method (Canny, 1986) which achieves good results and is not sensitive to the noise present in the examined image.
The second step of the computation analyses the binary image through an ad-hoc developed clustering algorithm which groups the single potentially defective points into macro-defects which represent the potential final defects of the product.The clustering is necessary in order to perform a selection among all the highlighted points and in order to put into evidence some key feature of the potential defects.The result of the clustering is a set of clusters, each one representing a potential defect and characterized by the points it includes.A first selection among these candidate defects is performed by discarding those clusters formed by less than a predefined threshold of points.The remaining ones are passed to the third control stage for the final assessment.This final decision is taken by means of a FIS (Mandani type) which implements the same rationale adopted by the human operators currently performing this task.In general human operators take into account two main characteristics of the identified critical regions: their extensions and the linearity of their shapes, thus the developed FIS is based on the following two input variables: 1. defect extension which is measured in terms of the number of pixels belonging to a cluster.Three fuzzy sets correspond to this fuzzy variable and refer to the number of pixels in the cluster: low, medium and high.2. linearity is calculated as the mean square distance of pixels of the clusters from the bestfitting straight-line.Also for this variable three fuzzy sets are created: low, medium and high.
The output of the designed FIS is represented by a single variable, the so-called defectiveness, which reflects the decision about the final roll destination.This variable corresponds to three fuzzy sets: not defective, uncertain and defective.
The adopted membership functions are Gaussian and their domain depends on the universe where the corresponding fuzzy variable is defined (for instance, 0-200 points for the variable extension.
Seven fuzzy rules derived from the knowledge of expert human operators constitute the adopted inference system.The defectiveness index is evaluated for all the clusters eventually present on a single roll: if a paper roll contains at least one cluster whose defectiveness index is higher than a fixed threshold, it is discarded.
The adopted rules are expressed in Table 3.

High and Defective
High and Defective Table 3. Adopted Rules Several tests have been performed for evaluating the proposed quality control system.The value of the defectiveness discrimination threshold must meet two opposite requirements: on one hand the choice of high values of such threshold leads to a high number of missed detections (MD) of faulty rolls, on the other hand low values of the threshold rise several socalled false alarms (FA) which correspond to pauses on the process for the maintenance of the machinery.Both these situations must be avoided although, according to technical personnel, to avoid missed defect detections is more important, as the presence of faulty rolls can affect the commercial competitiveness of the product.
The results obtained by the proposed vision system are extremely good as, with the selected threshold, an extremely low number of defective products are missed and a satisfactory number of false alarms are risen.The best compromise is reached fixing the threshold to 0.70; with this threshold the error is percentage is 4.6, the percentage of false alarms is 3.7 and finally the missed detections percentage is 0.9.

Conclusions
In the last years Vision Systems in the industrial field have been widely adopted providing innovative solutions in the direction of industrial application.Vision systems improve the productivity and the quality monitoring becoming a competitive tool to industries which employ this technology.
In this chapter a brief description of vision system is provided and then the principles of industrial quality control have been treated.Several examples of use of fuzzy system in different industrial applications have been described.The results demonstrate how applicable the FISs are in industrial field: their flexibility and the simplicity make this approach an optimal solution to describe complex processes.

Fig. 1 .
Fig. 1.Scheme of a simple industrial vision system.
www.intechopen.comFuzzyInference System -Theory and Applications 2463.Feature extraction procedure from the imageImage processing belongs to the field of signal processing in which input and output signals are both images.

Fig. 4 .
Fig. 4. Scheme of the system for vehicles classification.
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. 9 .
Fig. 9. Flow diagram of the quality control system for the assessment of paper rolls.

Fig. 10 .
Fig. 10.The result of the image processing and clustering stage: single potentially defective points and clusters are highlighted.

Table 1 .
Rule basis