Quality Control in Automated Manufacturing Processes – Combined Features for Image Processing

In production processes the use of image processing systems is widespread. Hardware solutions and cameras respectively are available for nearly every application. One important challenge of image processing systems is the development and selection of appropriate algorithms and software solutions in order to realise ambitious quality control for production processes. This article characterises the development of innovative software by combining features for an automatic defect classification on product surfaces. The artificial intelligent method Support Vector Machine (SVM) is used to execute the classification task according to the combined features. This software is one crucial element for the automation of a manually operated production process.


Introduction
The vision and image processing systems are widely employed in current manufacturing processes.These kinds of systems provide measures to inspect and control the manufacturing process of the producing location.In addition, the vision systems make automatic inspection and process examination possible with the help of "intelligent" software components.The project, on which this paper is based, is initiated in such a circumstance in order to associate and simplify the qualtiy control of free-form surface manufacturing, specially shining water taps in sanitary industries.
The first stage in the fabrication of water taps is the casting of the rough part.The material that is mainly used is brass.After the casting process some other machining processes, like drilling, milling and threading are carried out.Then the water tap is ground and polished sequentially in order to obtain high surface quality.Finally, the end product is finished by electroplating.It is crucial to find out the potential defects existing on the workpiece surface after grinding and polishing before the final electroplating.If a defect is found on a part after electroplating, manufacturer has to painfully discard this part or remove the electroplated coating.In this case removing the coating is a very expensive process because its harmful to the evironment.Therefore cost will be saved if the defects can be detected at an early stage.In addition, it is always useful to find out which type of a defect has been identified.Once the type of a defect is known, the decision can be made whether the part is discarded or can be retouched with proper compensatory engineering processes and if an adjustment of a previous machining process is necessary.
So far the tasks of defect inspection and categorization are performed by human operators in a traditional "see and evaluation" way.It is a labour-intensive and therefore also cost-intensive job.This process is necessarily automated to improve the efficiency of defects inspection, releasing worker from unpleasant working environments, and finally reducing the overall manufacture cost, specially in the countries where wages are high.To automate the defects inspection and classification, a vision system is installed and integrated into the manufacturing chain.In our project, the inspection process takes place after the end of the grinding and polishing pro-cesses.If no defects are found on the surface, the workpiece is accepted for the next processing step.Otherwise, it is classified automatically in order to determine if a removal of the defect is possible or the workpiece should be rejected directly.
The vision system consists of a carrier, a camera system, a lighting system, other accessories and the software.The system hardware is responsible to provide a constant lighting enviroment and obtain the digital images under this constant circumstance.The software provides the solution to examine the images from the camera system, locating and classifing the defects on workpiece surfaces.
The challenge in our project now is to characterise and determine the type of defects from predefined categories and additional foulings (which are called pseudo-defects in our project) on the surface.To this end, this paper presents measures and considerations regarding both theoretical and practical aspects, to efficiently classify all defects as well as a separation of real-defects from pseudo defects.

Defects definition
The defects have been generally divided into 15 classes according to their physical attributes and the consequent handling operations.Fig. 1. gives samples for all defect categories.All defects mainly can be split up into two major categories, real-defects and pseudo-defects that are actually foulings, like dust or oil, on the surface or shades caused by uneven lighting on the free-form surfaces.The first ten defects in Fig. 1. are real-defects and the last five are pseudo--defects.The pseudo-defects are causing no quality problem; while the real-defects should be critically picked out because they not only spoil the aesthetic aspect but sometimes also result in malfunction of final products.The vision system considers both kinds as failures at first and distinguish them in the classification phase.Therefore, two indice have to be taken into account, the overall right classficaition ratio and wrong classification ratio between the real-defects and pseudo-defect.In addition, the wrong classification ratio from real-to pseudo-defects is more crucial than that from pseudo-to real-defects.In the previous case, a product with real-

Introduction
The use of computers is essential in modern design processes.Computer Aided Design (CAD) is extensively applied in a wide range of industrial branches.However, there is a body of opinion that the benefits of applying CAD are below expectations.The development of CAD systems and their applications in engineering practice have been greatly influenced in the last decade by rapid increases in the performance of computer hardware.Emphasis has been laid on the implementing numerical methods and computer graphics.Hence, CAD still concentrates rather too much on providing a means for representing the final form of design, whereas designers also need a continual stream of advice and information.
Design problems are known to be "ill-defined".The problem statement usually sets a goal, some constraints within which the goal must be archived, and some criteria by which a successful solution might be recognised.The solution is unknown, and there is no certain way of proceeding from the statement of the problem to a statement of the solution.Moreover, many design constraints and criteria also remain unknown and existing CAD approaches, based on conventional programming methods, are not able to help the designer in dealing with uncertainty and inconsistencies.Thus, the quality of design solutions still depends mostly on the designer's skill and experience.
It can be argued that not many successful intelligent systems are known to be applied in engineering domains, especially not in the field of design optimisation.Until recently, engineering (design) problems were indeed considered as well-defined mathematically-formulated problems, that can be managed with the computer aids based on numeric representation and computer graphics, without 'interference' from artificial intelligence.However, it is becoming more and more evident that adding intelligent behaviour to the existing CAD tools [1] can lead to significant improvements in the effective and reliable performance various engineering tasks, including design optimisation.
In this paper, we will present three different intelligent modules to be applied within a design process to enable more intelligent and less experience-dependent design optimisation.A computer-aided geometric modeller and a structural analysis package are basic CAD tools within the proposed optimisation cycle.The design cycle begins with the initial design and problem definition.The first intelligent module is applied to support the preparation of the numerical model for structural analysis.After the analysis, the second intelligent module is provided to support evaluation of the "expert" results, upon which the most appropriate design optimisation steps are defined.The final design is usually reached after several structural analyses, and each run involves appropriately adjusted input data, including design changes if necessary.The third intelligent module addresses more specific design issues related to ergonomic and aesthetic aspects of the design.This will be used by the designer when specifying the outer geometric shape and appearance of the product.

Design optimisation
Design optimisation is a very complex iterative process.In many cases, the basic parameters for the optimising process are the results of structural engineering analysis.Finite Element Analysis (FEA) [2] is the most frequently used numerical method for simulation and verification of the conditions in the structure.If the structure does not satisfy given criteria, certain optimisation steps, such as redesign, use of other materials, etc., have to be taken.The initial design is made in a geometric modeller, analysed by FEA or some other method for engineering analysis and then re-designed in the modeller.This optimisation loop is repeated until the final design, that satisfying the given criteria, is developed.
Since existing CAD tools fail to provide functional advice, the quality of the initial design, analyses and re-design actions, and also the number of iterative steps needed to reach the final solution depend mainly on the designer's experience.Design experts can efficiently perform structural design optimisation.They have built up their experience over time by working on design and analysis problems for various products.Their strategy when dealing with a design problem is based mainly on heuristics or rules of thumb.But what about less experienced designers?Is it possible to avoid trial--error behaviour and help them to perform computer-aided design optimisation more efficiently?Evidently, traditional design optimisation systems that concentrate on numerical aspects of design process are not successful in integrating numerical parts with human expertise [3].

Intelligent design optimisation cycle
In order to make thee design optimisation process more intelligent and less experience-dependent, existing CAD systems should be supplemented with some intelligent modules that will provide advice when needed.In the last decade, various Artificial Intelligence (AI) applications to engineering design have been reported.The book edited by D. T. Pham [1] is a good collection of early examples related to this area.It is evident that AI applications to design are now the subject of intensive development and implementations.Fig. 1 shows our proposal for an intelligent design optimisation cycle, based on interaction between a geometric modeller and an FEA package.
The idea is to encode the knowledge and the experience required in dealing with engineering design optimisation into a Knowledge Base (KB) that can be used by a computer system.The proposed intelligent KB modules should help the user to reach a final design that will fulfil the structural and other specific design criteria.The optimisation cycle begins with the problem definition and initial design.The first KB module is applied to support the user in the process of setting the Finite Element (FE) mesh parameters.After the initial FEA is performed, the second intelligent module is involved to perform an evaluation of the "expert" results.For every iterative analysis, the input data is corrected and/or the structure is re-meshed before a new analysis is performed.If the geometry of the structure needs to be optimised, design changes are also performed before returning to the pre-processing phase of the analysis.
A special group of intelligent KB modules is envisaged to support the various design tasks in the geometric modeller in order to satisfy more specific design criteria, such as manufacturability, appropriateness for assembly, ergonomics, aesthetics, etc.
As is shown in Fig. 1, the idea is to link the existing FEA package and geometric modeller with the proposed KB modules into an integrated intelligent software environment for design optimisation.In addition, for proper integration leading to a transparent and user-friendly optimisation tool, several interfaces need to be developed to ensure that the data is always converted to the format used in the next step of optimisation.Now we will discuss in greater detail, three KB modules that are important composite parts of the proposed intelligent design optimisation cycle.Two of them are strongly related to the structural analysis part of the optimisation process, while the third KB module contains more specific knowledge to support the designer in setting the ergonomic and aesthetic value of the new product.All three intelligent systems mentioned here are under of research and development in our laboratory.

KB module for finite element mesh design
Within FEA, a number of different mesh models usually need to be created until the right one is found.The trouble is that each mesh has to be analysed, since the next mesh is generated with respect to the results derived from the previous mesh.Considering that one FEA can take from a few © Czech Technical University Publishing House minutes to several hours and even days of computer time, there is obviously a strong motivation to design "optimal" finite element mesh models more efficiently -in the first step or at least with minimum trials.As an alternative to the conventional "trial-and-error" approach to this problem, we have developed the Finite Element Mesh Design Expert System named FEMDES [4].The system was designed to help the user to define the appropriate finite element mesh model more easily, more rapidly, and with less dependence on experience.
FEA has been applied extensively for more than 30 years.However, there is no clear and satisfactory formalisation of the mesh design know-how.Finite element design is still a mixture of art and experience, which is hard to describe explicitly.However, many resorts have been published in terms of problem definition, an adequate finite element mesh (chosen after several trials), and results of the analysis.These reports were used as a source of training examples for machine learning algorithms to construct more than 1700 rules for finite element mesh design by generalising given examples.The way in which inductive logic programming techniques were applied to develop the KB in this particular case is presented in detail in [5].
Fig. 2 shows how FEMDES is to be applied within the FEA pre-processing phase.The user has to define the problem (geometry, loads, and supports).The data about the problem needs to be converted from the FEA pre-processor format into the symbolic qualitative description to be used by the KB module.FEMDES' task is to propose the appropriate types of finite elements and to determine the mesh resolution values.A command file for the mesh generator can be constructed according to the results obtained by the intelligent system.
For FEMDES, we have built our own program to gain the most efficient correlation between the knowledge and the program part of the system.Like the KB, the shell is also written in Prolog.This enables the proper use of the KB for FE mesh design (inference engine), and also communication between the user and the system (user interface).A very important and useful feature of the user interface is its capability to explain the inference process, by answering the questions "Why?" and "How?"A complete source code of the program, together with explanations of the algorithms performed by the program, can be found in [6].
The user has to prepare the input data file before running the system.The structure that is to be analysed needs to be described in exactly the same way as the training examples were presented to the learning algorithm in the knowledge acquisition phase.This can be done automatically by using the geometric model of the structure.Guidelines for automatic transformation from numeric form to symbolic qualitative description are presented in [6].However, FEMDES is not yet integrated with any commercial FEA pre-processor.Thus, the problem description currently needs to be made manually.This takes some time, especially for structures that are more complex.However, following a few simple algorithms the task does not require special knowledge and experience.
To simplify the learning problem, the training set used for developing of the knowledge base was designed with the aim of being representative of a particular type of structures.The following limitations were taken into account: l all structures were cylindrical, l only forces and pressure were considered as loads, l highly local mesh refinement was not required.
However, FEMDES can also be applied as a general tool for determining the mesh resolution values for real-life three--dimensional structures outside the scope of these limitations.The results of the system have to be adjusted subsequently, according to the specific requirements of the particular analysis.Furthermore, they can always serve as a basis for an initial FE mesh, which is subject to further adaptations considering the results of the numerical analyses.It is very important to choose a good initial mesh and to minimise the number of iterative steps leading to an appropriate mesh model.Thus, FEMDES can be very helpful to inexperienced users, especially through its ability to explain the inference process.

KB module for structural analysis-based design improvements
The post-processing phase of the engineering analysis represents a synthesis of the whole analysis and is therefore of special importance.It concludes with the final report of the analysis, where the results are quantified and evaluated with respect to the next design steps, which have to follow, the analysis in order to find an optimal design solution.The sources for post-processing are numerical results of the computation performed in the previous phase of the analysis.The data is stored in a computer file.In spite of the fact that the records are quite well ordered, the numerical figures are hard to follow in the case of a complex real-life problem, when the data file is usually complex and extensive.Nowadays FEA software is very helpful at this point, as it offers adequate computer graphics support in terms of reasonably clear pictures showing the distribution of the unknown parameters inside the body of the structure.Acta Polytechnica Vol.46 No. 5/2006 Fig. 2: FEMDES application within the FEA pre-processing phase However, the user still has to answer many questions and solve many dilemmas in order to conclude the analysis and compose the report.The designer has to be able to judge whether the results of the analysis are correct and reliable, and also to decide what kind of design changes are needed, if any.Most users need "intelligent" advice to interpret the analysis of the results adequately.Unfortunately, this kind of help cannot be expected from the present software.Traditional systems tend concentrate on numerical aspects of the analysis and are not successful in integrating the numerical parts with human expertise.
In order to overcome this bottleneck, we decided to collect and encode the knowledge and experience needed to propose appropriate design actions that may lead to design improvement.In this way the prototype of the intelligent consultative system PROPOSE for supporting design decisions considering the results of a prior stress/strain or thermal analysis was developed [7].PROPOSE provides a list of redesign recommendations that should be considered in order to optimise a certain critical area within the structure.
Fig. 3 shows that, as a result of applying PROPOSE the user may expect a list of redesign recommendations, based on the expert interpretation of the results of the prior numerical analysis.As a rule, several redesign steps are possible for design improvement.The selection of one or more redesign steps to be performed in a certain case depends on requirements, possibilities and wishes.
The proposed system was developed in several steps.The most important step was to develop the knowledge base, where knowledge acquisition was the most crucial task [8].Theoretical and practical knowledge about design and redesign actions were investigated and collected.A wide range of different knowledge is needed to explore possible design actions that should follow the engineering analysis.Knowledge acquisition was carried out in three different ways: from a literature survey, from examinations of old engineering analyses and from interviews with human experts.That was not an easy task.Recommendations on redesign are scarce, and are dispersed in many different design publications.Many reports on analyses contain confidential data and cannot be used.On the other hand, interviews and examination of existing redesign elaborations depend on cooperation with experts, and can be time-consuming.Therefore, the scope of the results is greatly limited by the experts.
Production rules were selected as an appropriate formalism for encoding knowledge, because they are quite similar to the actual rules used in the design process.Each rule proposes a list of recommended redesign actions that should be taken into consideration, while dealing with a certain problem, taking into account some specific design limits.The rules are generalised, and do not refer only to the examples that were used during the knowledge acquisition process.They can be used whenever the problem and the limits match with those in the head of the rule.In such a case, applying of the appropriate rule will result in a list of recommended redesign actions for dealing with the given problem.
When using the PROPOSE system, the user has to answer some questions stated by the system in order to describe the results of the engineering analysis.In addition, critical areas within the structure need to be qualitatively described to the system.This input data is then compared with the rules in the knowledge base, and the most appropriate redesign changes to be taken into account in a given case are determined and recommended to the user.The system provides constant support to the user's decisions in terms of explanations and advice.Finally, the user receives an explanation of how the proposed redesign changes were selected and also some more precise information on how to implement a certain redesign proposal, including some pictorial explanations.Fig. 4 shows an example of such an explanation for the proposed design action: "add smaller relief holes in the line of loads on both sides of the problem hole".
The abstract description of the problem area should be as general as possible, in order to cover most the problem areas, instead of addressing only very specific products, which is characteristic of some recent research projects in this field Acta Polytechnica Vol.46 No. 5/2006 Fig. 3: PROPOSE application within the FEA post-processing phase Fig. 4: Example of a pictorial explanation of a redesign action recommended by PROPOSE [9][10][11].For this reason, the number of predefined attributes is relatively small.However, by answering some additional questions, the problem can be defined in a more refined manner.
In cases when the problem area can be described to the system in different ways, it is advisable to run the system several times, each time with a different description.Thus, the system will be able to propose more design actions, at the expense of only a few more minutes at the console.The larger number of proposals may confuse the user, who will probably need help in the form of explanations of the proposals.On the other hand, more proposals will provide more options for design improvements.
The PROPOSE system was evaluated in two ways.First, experts who had already been involved in the knowledge acquisition process evaluated the system.Then some real-life examples were used to test the performance of the system.The experts that participated in the evaluation process are practising designers and some academics.They individually evaluated the system from two points of view.First, they analysed the performance of the system using some real-life examples.They also evaluated the user interface by inspecting how well the system helps and guides the user, or even enables him or her to acquire some new knowledge.The suitability, clearness and sufficiency of the redesign proposals were also evaluated.All comments, critiques and suggestions presented by the experts were taken into consideration and led to numerous corrections and adjustments of the system.

KB module for ergonomic and aesthetic design
In order to deliver suitable design solutions, designers have to consider a wide range of influential factors.Ergonomics and aesthetics are certainly among the most complex considerations.Less experienced designers could meet several problems in the design stage.Some computer tools are available to be used for evaluating of the ergonomic condition of the product [12].However, much experience and knowledge in the field of ergonomics is required in order to choose and carry out the appropriate redesign actions to improve the ergonomic value of the product within a reasonable time.On the other hand, the aesthetic design phase still depends mainly on the skill and experience of the designer and is not supported by any computer tool of any practical value.
In this context, we decided to develop an intelligent consultative system that will be able to support the designer through the decision making process when defining the ergonomic and aesthetic parameters of the product [13].Expert advice is clearly often needed, and it could be very useful to apply the intelligent advisory system.Moreover, since the aesthetic and ergonomic properties of the product are established in the early phases of product development, the intelligent advisory system should be able to support this process with minimum data requirements.The ergonomic analysis and aesthetic evaluation should be performed on the CAD model.After that, the intelligent system can be used again to advise the user which design changes are possible or even necessary in order to improve the ergonomic and/or aesthetic value of the product.
In order to improve the ergonomic and aesthetic value of the product, the design recommendations will be proposed to the user by using the expert knowledge collected in the KB of the system and the case-specific data given by the user.For proper control over each part of the system, we decided to build two separate knowledge bases, containing the theoretical and practical knowledge about the design and redesign actions, one for the ergonomic part and the other for the aesthetic part of the system.If the user applies only one part of the system, the inference engine will be able to use the separate KB that belongs to that part.On the other hand, if the complete system is used, both knowledge bases will be used, while some special rules will be applied to harmonise the ergonomic and aesthetic design recommendations, when necessary (Fig. 5).
The KB module for ergonomic and aesthetic design, discussed in this section, is still under intensive research and development.Currently we are working on development the KB for the ergonomic part of the system, where we have limited the target area to hand tool design.In this context, the global hand tool ergonomic design goals [14] that need to be followed by the designer of the hand tool in order to meet health, safety and efficiency requirements, have been specified.The following are some of the goals recognised as most important: l consider the anthropometrical data to define the dimensions and configurations; l maintain the wrist in the neutral straight position; l avoid tissue compression; l reduce the excessive forces; l protect against vibration, heat, cold and noise; l ensure that the task can be performed at the appropriate height; l reduce the static load; l consider cognitive ergonomics.
The KB that is being developed will contain rules on how to realise these goals within the hand tool design.

Conclusions
Engineering design is obviously much more than just analysis and modelling, and existing CAD systems need to be further explored to be able to assist in the other aspects of design as well.Future research and development of CAD systems will require radical re-thinking, considering some new approaches that have not been taken properly into account in the past.The application of AI techniques in design is certainly an approach that is becoming more and more important.
Design optimisation is a part of the development process for almost every new product.It plays a very important role in the modern high-tech world, where only optimal solutions can win the game on the market.However, developing optimal design solutions is a very complex domain that cannot be treated adequately by using conventional CAD tools, unless the user possesses special skills and experience.Thus, many research activities are aimed at making the design optimisation process more intelligent and less experience-dependent.Many experts share the opinion that this can be achieved by supplementing existing CAD systems with some intelligent modules that will provide advice when needed.The intelligent modules discussed in this paper are important parts of the overall intelligent design optimisation cycle and are now under intensive research and development in our laboratory.
Design data is not always well formulated, and almost never complete.Humans can deal with such data reasonably easily, while even the most "intelligent" programs have great difficulties.Designers are also reluctant to assign responsibility for decisions to computer programs, no matter how competent they may appear.it can also be argued that an encoded design KB does not allow designers to express their creative ideas.All these and many other factors constrain the application of intelligent systems in design.Therefore, it is likely that no single technology will be adequate by itself.The designer will have available a toolkit of techniques, including intelligent modules, for information and well-defined advice for making decisions and judgements.Our research presented here takes a step or two forward on the way intelligent support for the design process.