1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Automating quality control in manufacturing systems universität ( TQL)

132 21 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Automating Quality Control in Manufacturing Systems Combining Knowledge-Based and Rule Learning Approaches Masterarbeit im Studiengang Wirtschaftsinformatik der Fakultät Wirtschaftsinformatik und Angewandte Informatik der Otto-Friedrich-Universität Bamberg Verfasser: Thomas Hecker Themensteller: Prof Dr Ute Schmid Abgabedatum: 30.9.2007 Sperrvermerk: Diese Arbeit enthält zum Teil vertrauliche Informationen Jegliche Weitergabe an Dritte ist ohne Einwilligung des Fraunhofer Instituts für Integrierte Schaltungen strengstens untersagt Notice: Parts of this work contain confidential information Any disclosure to a third party without permission of Fraunhofer Institute for Integrated Circuits, Erlangen is hereby strictly prohibited ii Acknowledgments I would like to thank my thesis advisor, Prof Dr Ute Schmid, for her valuable input during the creation of this thesis and the patience and many encouragements she had for me during my entire time at Bamberg University Her teaching in the area of Cognitive Systems made this time a very rewarding experience I would also like to express my gratitude to Dr Christian Münzenmayer and Dipl.-Ing Klaus Spinnler, for enabling me to write part of my thesis at Fraunhofer Institute for Integrated Circuits, Erlangen This thesis would not have been possible without their assistance Also many thanks to Dr Thomas Wittenberg, who brought all the aforementioned people together, enabling this thesis in the first place Thomas Hecker Bamberg, Sept 2007 This document was typeset using a modified version of the i10 diploma thesis template made by Thorsten Karrer from the Media Computing Group at RWTH Aachen University iii Abstract This thesis explores the possibilities of using Machine Learning methods for automated quality control in the production process of cast iron workpieces In particular, rule induction methods are combined with existing domain knowledge to train classifiers from workpieces that are each described through a variable list of defects The research finds that most traditional learning approaches are too restricted to deal with this kind of data Instead, methods of Inductive Logic Programming show more flexibility in this domain Diese Arbeit behandelt die Möglichkeiten von Methoden des maschinellen Lernens für den Einsatz bei der Qualitätskontrolle in der industriellen Produktion von Gußeisenteilen Es wird insbesondere geprüft, wie Methoden der Regelinduktion in Kombination mit vorhandenem Domänenwissen zum Anlernen von Klassifikatoren verwendet werden können Die Klassifikatoren basieren hierbei auf Daten von Gußeisenteilen, welche durch eine variable Anzahl von Defekten beschrieben sind Die Ergebnisse der Arbeit zeigen, dass die traditionellen Lernmethoden zu limitiert sind, um mit dieser Art von Daten umgehen zu können Stattdessen scheinen Methoden der induktiven logischen Programmierung für diese Domäne besser geeignet iv Contents Abstract iii List of Figures ix List of Tables xii Introduction Context of this Work 2.1 Industrial Image Processing 2.2 Visual Quality Inspection in Cast Iron Production 2.2.1 The Problem of Pores in the Production Process 2.2.2 The Pore Class PK3 2.2.3 Problems Associated with the Standard 2.2.4 Structure of the Current System 2.3 Machine Learning 2.4 Knowledge Based Systems 2.5 Related Work 11 Contents v Description of the Data 13 3.1 Data Acquisition 13 3.1.1 Feature Extraction 13 3.1.2 The Labeling Process 15 3.2 Analysis of the Cleaned Datasets 16 3.3 Insights Gained from the Acquisition Process 17 Experiments: General Considerations 22 4.1 Experiment Setup 22 4.1.1 Environment 22 4.1.2 Evaluation Method 23 4.1.3 Parameter Tuning 25 4.2 Significance Testing 28 4.3 Initial Experiments 30 4.3.1 Description of the Static Model 31 4.3.2 Experiment 0.a: Static Model vs Default Classifier 32 4.3.3 Discussion 33 Experiments I – The Traditional Approach 36 5.1 Feature Extraction 37 5.2 Description of the Learning Algorithms 39 5.2.1 C4.5 40 5.2.2 CN2 42 Contents vi 5.2.3 PART 43 5.2.4 Remarks 45 5.3 Experiments 45 5.4 Discussion 46 Experiments II – Combining Fuzzy and Crisp Methods 50 6.1 A Short Introduction to Fuzzy Logic 51 6.2 Feature Extraction 53 6.2.1 The Fuzzification Process 53 6.2.2 Defuzzification to Symbolic Features 58 6.3 Experiments 58 6.4 Discussion 59 Experiments III – Learning Fuzzy Rules 63 7.1 The FuzzConRI Learner 63 7.2 Own Extensions to FuzzConRI 66 7.2.1 Certainty Factors 66 7.2.2 Non-Binary Defuzzification as Conflict Resolution Strategy 67 7.3 Experiments III.a - Initial Results 67 7.4 Adjusting Membership Functions with Genetic Algorithms 69 7.4.1 Initial Considerations 69 7.4.2 Genetic Algorithms 70 Contents 7.4.3 7.5 7.6 Representing Membership Functions for Genetic Algorithms 71 Experiments III.b - Tuning Membership Functions 73 7.5.1 Experiment Setup 73 7.5.2 Experiments 74 Discussion of the Results 78 Experiments IV – An Approach for Learning on Different Levels of Abstraction 82 8.1 Learning on Different Levels of Abstraction 84 8.1.1 General Considerations 84 8.1.2 A Prolog Framework for a PK3 Classifier 86 8.2 The FOIL Algorithm 88 8.3 Transformation of Predicates 90 8.4 Learning Strategy 91 8.5 Experiments – Learning Very Bad Pores 92 8.5.1 Experiments IV.a - Going the Most Obvious Way 92 8.5.2 Experiments IV.b - Using an Informed Search Strategy for more Examples 93 Experiments IV.c - Learning Location-Dependent Rules 95 Discussion of the Results 96 8.5.3 8.6 vii Discussion of the Overall Results 10 Conclusions and Further Work 100 102 Contents viii 10.1 Desired Extensions and Suggestions for Further Work 102 10.1.1 Noise-Robust FOIL 102 10.1.2 Beam-Search FOIL 103 10.1.3 Constraining Arguments of Predicates 103 10.1.4 Back to Fuzzy Logic 104 10.1.5 Growing Non-Rectangular Regions for Rules 104 10.1.6 Using Hierarchical Agglomerative Clustering Methods to Learn Location-Specific Rules 106 10.1.7 Incorporating Misclassification Costs 107 10.2 Summary 108 References 109 A Description of the Contents of the Accompanying DVD 113 B Prolog Framework and Ruleset for Multi-Level Classification of Workpieces 115 ix List of Figures 2.1 Hardware Set-up of an Industrial Image Processing System 2.2 Structure of the Quality Control System 2.3 Structure of an Expert System 10 3.1 Masking the Workpiece’s Region of Interest 15 3.2 An Artefact Resulting from an Incorrect Mask Overlay 18 3.3 Imprecise Measurement of Pore Distance to ROI Border 18 3.4 Imprecise Measurement of Pore Size: Underestimating Size 19 3.5 Imprecise Measurement of Pore Size: Overestimating Size 19 3.6 Images of F1100 (top) and F2000 (bottom) areas with critical edges marked 20 3.7 Distribution of Defects on Workpieces 21 3.8 Distribution of Pore Sizes on Workpieces 21 4.1 Different Treatment of Small Pores in F1100 and F2000 Areas 35 Overview of the C4.5 Algorithm 41 5.1 10.1 10.1.4 Desired Extensions and Suggestions for Further Work Back to Fuzzy Logic In Chapter it was shown that fuzzy logic can adequately deal with the imprecision in the data resulting from the errors in measurements and fuzzy decision boundaries which the experts use when labeling workpieces Hence there is reason to believe that also the ILP approach would benefit from fuzzy constraints on numeric features, —both during the learning and the on-line classification phase There are some approaches to combine fuzzy approaches with Prolog (Nikolopoulos, 1997; Martin, Baldwin, & Pilsworth, 1987), as well as combining ILP with fuzzy logic (Drobics, Bodenhofer, & Klement, 2003) 10.1.5 Growing Non-Rectangular Regions for Rules In Chapter 8, a method for constraining rules to certain areas was introduced which is simply based on testing the X and Y coordinates for certain thresholds The resulting area to which the rule is then confined to is characterized as a rectangle J Quinlan (1993) shows a problem with these kinds of attribute constraints: if the decision surface (here for example the contour of a critical edge) is non-rectangular, the learner tends the approximate the nonrectangular surface through many small rectangles Figure 10.1 shows the example used by Quinlan to illustrate the problem Since there is a rule associated with each rectangle (because disjunctions are not allowed), the overall model grows overly complex and becomes prone to overfitting To avoid this, a different representation for non-rectangular areas should be chosen Figure 10.2 illustrates one idea for this: An area is represented through a set of points These points are defects from the training set Each point is the center of a circle with radius ri Each circle must overlap with at least one other circle of the set, in a way that no group of circles is isolated (similarly to a weakly connected graph) Figure 10.2 illustrates this idea Now, to learn location-based rules, the following approach is chosen: 104 10.1 Desired Extensions and Suggestions for Further Work Figure 10.1: Approximating non-rectangular areas through rectangles The left image shows the instance space with a linear decision surface Right is shown the approximation through rectangles (Source: J Quinlan (1993)) start with the empty rule that covers all examples specialize the rule with the possible predicates/constraints (without location constraints) • now try to expand the radius for each positive examples that is covered by the rule, using some search strategy • if all positive examples are weakly connected and no (significant amount of) negative examples are covered by the area and the rule at the same time, then stop and return the rule with its associated area • otherwise, decide to either do: – go back to 2) and specialize the rule further – remove isolated positive examples from the set of covered instances and try again to grow a region – or both It is possible to learn areas that overlap with other areas When using the framework outlined in Chapter 8, no conflict resolution strategy needs to be used, because the three concepts that can be learned all classify a workpiece as bad However, if there will be subconcepts learned which not immediately lead to the rejection of a workpiece, then it depends on the fact whether these concepts are supposed to be disjunctive or not If they are disjunctive, then a conflict-resolution strategy might be adopted by measuring the distance to the next center of a circle to indicate the confidence with that the rule fires 105 10.1 Desired Extensions and Suggestions for Further Work Figure 10.2: Approximating areas through connected circles The centers of the circles correspond to positive training examples (indicated by "+") The nearby negative examples are either not covered by the rule that is associated with this area (indicated by a gray "-"), or they are covered by the rule but not by the area (indicated by a black "-") 10.1.6 Using Hierarchical Agglomerative Clustering Methods to Learn Location-Specific Rules All rule learning approaches used here so far had one thing in common: a rule was learned in a top-down, general-to-specific fashion, by first creating a rule that covers all examples and then specializing the rule to further exclude instances A different approach to learning might be to hierarchically cluster training examples bottom-up and then learn a rule at each cluster on each level: start with n clusters each containing only k = examples merge the most similar clusters (w.r.t some similarity metric based on the example features) • learn a rule that describes the elements in each cluster • try to grow areas from all positive examples in each cluster (like described in the last section), avoiding to cover any negative examples in the cluster 106 10.1 Desired Extensions and Suggestions for Further Work • return to 2), merging clusters to the next level k = k + stop clustering if only one cluster is left at the top of the tree pick the globally best rule/area from all clusters of the tree remove the examples covered by the rule from the training set and start over This approach might alleviate the effects of FOIL’s local greedy search by giving more weight to spatial proximity in the similarity metric However, since a whole hierarchical cluster must be built for each rule, the whole process may take very long On the other hand, it would be worth a try and could actually perform well with small data sets It will be a challenge though to find an adequate similarity metric that groups examples in a way that FOIL may still be able to learn a (relational) rule from these examples 10.1.7 Incorporating Misclassification Costs One fact that has been neglected all the time is that there are different costs associated with the misclassification of workpieces, depending on the predicted class It is obvious that missing a defective workpiece entails more cost than falsely rejecting a good one So far, the classifiers were all trained to maximize classification accuracy, not the expected cost for misclassifications If a learner has parameters that must be tuned, the cost criterion can be used instead of accuracy as optimization goal during the tuning process However, this may only influence the expected misclassification costs slightly, because most learners will still search hypotheses that maximize overall accuracy Some learners like the CAL5 decision tree learner (Unger & Wysotzki, 1981) can incorporate misclassification costs directly into the learning process Other approaches include ensemble classifiers that modify the training set to train different classifiers, each optimized to predict a certain class with high confidence and then using a weighted class vote to minimize 107 10.2 Summary expected costs (see for example Domingos (1999); Fan, Stolfo, Zhang, and Chan (1999)) To determine a good methodology for minimizing misclassification cost, whether be it through direct modification of the learner’s search heuristic or through external influences, poses yet another interesting challenge 10.2 Summary This thesis covered methods for automatic quality control in cast iron production In particular, several machine learning methods were tried in order to train prediction models for workpieces that are described through variable amounts of defects All trained models were compared to a static prediction model based on the authoritative quality standard for the workpieces in question Results showed that the trained models could predict good or bad workpieces with higher accuracy than the static model While fuzzy methods achieved the overall best performance, there were still deficiencies Another approach based on Inductive Logic Programming tries to combine traditional knowledge based methods with the induction of first-order rules This reuses more existing knowledge and thus makes more efficiently use of the available training data Also, there is no longer a restriction to represent training data by fixed-length feature vectors This approach is not fully explored yet, but initial results were very promising Finally, several suggestions were made to gain further improvements, including a method to approximate non-rectangular areas for learning location-specific rules It is believed that these suggestions—together with the unexplored potential of the ILP approach—will yield enough potential to challenge the traditional methods in the near future 108 109 References Adorni, G., Bianchi, D., & Cagnoni, S (1998) Ham quality control by means of fuzzy decision trees: a case study Fuzzy Systems Proceedings, 1998 IEEE World Congress on Computational Intelligence., The 1998 IEEE International Conference on, Al-Habaibeh, A., Shi, F., Brown, N., Kerr, D., Jackson, M., & Parkin, R (2004) A novel approach for quality control system using sensor fusion of infrared and visual image processing for laser sealing of food containers Measurement Science and Technology, 15(10), 1995– 2000 Bahlmann, C., Heidemann, G., & Ritter, H (1999) Artificial neural networks for automated quality control of textile seams Pattern Recognition, 32(6), 1049–1060 Behnke, S (2003) Hierarchical Neural Networks for Image Interpretation Springer Behnke, S., & Rojas, R (1998) Neural abstraction pyramid: a hierarchical image understandingarchitecture Neural Networks Proceedings, 1998 IEEE World Congress on Computational Intelligence The 1998 IEEE International Joint Conference on, Bellman, R (1961) Adaptive Control Processes: A Guided Tour Princeton University Press Bramer, M (2007) Principles of Data Mining London: Springer Chang, J., Han, G., Valverde, J., Griswold, N., Duque-Carrillo, J., & Sanchez-Sinencio, E (1997) Cork Quality Classification System Using a Unified Image Processing and Fuzzy-Neural Network Methodology Neural Networks, IEEE Transactions on, 8(4), 964– 974 Chou, P., Rao, A., Sturzenbecker, M., Wu, F., & Brecher, V (1997) Automatic defect classification for semiconductor manufacturing Machine Vision and Applications, 9(4), 201–214 Clark, P., & Boswell, R (1991) Rule induction with CN2: Some recent improvements Proceedings of the Fifth European Working Session on Learning, 482, 151–163 References Clark, P., & Niblett, T (1989) The CN2 induction algorithm Machine Learning, 3(4), 261–283 Cox, E (1994) The fuzzy systems handbook: a practitioner’s guide to building, using, and maintaining fuzzy systems Academic Press Professional, Inc San Diego, CA, USA Crosby, P (1979) Quality is Free: The Art of Making Quality Certain McGraw-Hill Demant, C., Streicher-Abel, B., & Waszkewitz, P (1999) Industrial Image Processing: Visual Quality Control in Manufacturing Springer Dietterich, T (1998) Approximate Statistical Tests for Comparing Supervised Classification Learning Algorithms Neural Computation, 10(7), 1895-1923 Domingos, P (1999) MetaCost: A General Method for Making Classifiers Cost-Sensitive In KDD ’99: Proceedings of the 5th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp 155–164) New York: ACM Press Drobics, M., Bodenhofer, U., & Klement, E (2003) FS-FOIL: an inductive learning method for extracting interpretable fuzzy descriptions International Journal of Approximate Reasoning, 32(2-3), 131– 152 Du, K., & Swamy, M (2006) Neural Networks in a Softcomputing Framework Springer Eriksen, C., & Hake, H (1955a) Absolute judgments as a function of stimulus range and number of stimulus and response categories Journal of Experimental Psychology, 49(5), 323–32 Eriksen, C., & Hake, H (1955b) Multidimensional stimulus differences and accuracy of discrimination Journal of Experimental Psychology, 50(3), 153–60 Fan, W., Stolfo, S., Zhang, J., & Chan, P (1999) AdaCost: Misclassification cost-sensitive boosting Proceedings of the Sixteenth International Conference on Machine Learning, 97–105 Frank, E., & Witten, I (1998) Generating accurate rule sets without global optimization Proc 15th International Conf on Machine Learning, 144–151 Hecker, T., & Mennicke, J (2006) Diagnosing cancerous abnormalities with decision tree learning Hennessey, K., Hahn, K., & Lin, Y (1991) Automated visual inspection using syntactic representation Circuits and Systems, 1991., Proceedings of the 34th Midwest Symposium on, 146–150 Järvelin, K., & Kekäläinen, J (2000) IR evaluation methods for retrieving highly relevant documents Proceedings of the 23rd annual international ACM SIGIR conference on Research and development in information retrieval, 41–48 110 References Jähne, B., Massen, R., Nickolay, B., & Scharfenberg, H (1995) Technische Bildverarbeitung – Maschinelles Sehen Kohavi, R (1995) A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection In Proceedings of the 14th International Joint Conference on Artificial Intelligence (IJCAI) (pp 1137–1145) Kohavi, R., Sommerfield, D., & Doughert, J (1996) Data Mining Using MLC++: A Machine Learning Library in C++ In Tools with Artificial Intelligence (pp 234–245) IEEE Computer Society Press Konig, A., Windirsch, P., Gasteier, M., & Glesner, M (1995) Visual inspection in industrial manufacturing Micro, IEEE, 15(3), 26–31 Kosko, B (1992) Neural Networks and Fuzzy Systems: A Dynamical Systems Approach to Machine Intelligence Prentice-Hall, Inc Upper Saddle River, NJ, USA Langley, P., & Simon, H (1995) Applications of machine learning and rule induction Communications of the ACM, 38(11), 54–64 Levine, M (1985) Vision in Man and Machine McGraw-Hill New York Martin, T., Baldwin, J., & Pilsworth, B (1987) The Implementation of FProlog - A Fuzzy Prolog Interpreter Fuzzy Sets and Systems, 23(1), 119–129 Melin, P., & Castillo, O (2005) Hybrid Intelligent Systems for Pattern Recognition Using Soft Computing: An Evolutionary Approach for Neural Networks and Fuzzy Systems Springer Michie, D., Spiegelhalter, D J., Taylor, C C., & Campbell, J (Eds.) (1994) Machine Learning, Neural and Statistical Classification Upper Saddle River: Ellis Horwood Mierswa, I., Wurst, M., Klinkenberg, R., Scholz, M., & Euler, T (2006) Yale: Rapid Prototyping for Complex Data Mining Tasks In Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2006) Mikut, R., Böhlmann, S., Cuno, B., Jäkel, J., Kroll, A., Rauschenberg, B., et al (n.d.) Fuzzy-Logik und Fuzzy Control-Begriffe und Definitionen Proc Workshop Fuzzy Control des GMA-UA, Miller, G (1956) The magical number seven, plus or minus two Psychological Review, 63(2), 81–97 Mitchell, T (1997) Machine Learning New York: McGraw-Hill Mitchell, T (2006) The Discipline of Machine Learning (Tech Rep.) Technical Report CMUML-06-108) Carnegie Mellon University Nikolopoulos, C (1997) Expert Systems: Introduction to First and Second Generation and Hybrid Knowledge Based Systems Marcel Dekker Njoroge, J., Ninomiya, K., Kondo, N., & Toita, H (2002) Automated fruit grading system using image processing SICE 2002 Proceedings of the 41st SICE Annual Conference, 111 References Nonaka, I., & Takeuchi, H (1995) The Knowledge-Creating Company Oxford University Press New York Perner, P (1994) A knowledge-based image-inspection system for automatic defect recognition, classification, and process diagnosis Machine Vision and Applications, 7(3), 135–147 Quinlan, J (1990) Learning logical definitions from relations Machine Learning, 5(3), 239–266 Quinlan, J (1993) C4.5: Programs for Machine Learning San Francisco: Morgan Kaufmann Quinlan, J R (1986) Induction of Decision Trees Machine Learning, 1(1), 81–106 Russell, S., & Norvig, P (1995) Artificial Intelligence: A Modern Approach (2 ed.) Upper Saddle River, NJ, USA: Prentice-Hall Russo, M (2000) Genetic Fuzzy Learning IEEE Transactions On Evolutionary Computation, 4(3), 259 Unger, S., & Wysotzki, F (1981) Lernfähige Klassifizierungssysteme Berlin: Akademie-Verlag Van Zyl, J., & Cloete, I (2004) An Inductive Algorithm for Learning Conjunctive Fuzzy Rules Proceedings of the 2004 International Conference on Machine Learning and Cybernetics, VDG (2002) Volumendefizite von Gußstücken aus Nichteisenmetallen Richtlinie des Verbands Deutscher Giessereifachleute VDG Düsseldorf Winston, P (1984) Artificial Intelligence Addison-Wesley Longman Publishing Co., Inc Boston, MA, USA Witten, I H., & Frank, E (2005) Data Mining: Practical machine learning tools and techniques (2nd ed.) San Francisco: Morgan Kaufmann Zadeh, L (1965) Fuzzy Sets Information and Control, 8(3), 338–353 Zadeh, L (1975) The Concept of a Linguistic Variable and Its Applications to Approximate Reasoning Part I Information Sciences, 8(3), 199–249 112 113 Appendix A Description of the Contents of the Accompanying DVD /datasets_cleaned/ Contains the cleaned datasets used for the experiments Please note that only the extracted features are contained on the DVD, not the original images, which are property of Fraunhofer IIS For the learning task, this does make no difference though /experiments/ Contains all RapidMiner experiment set-ups plus the results /java_code/ Contains all Java code that was written for the experiments: • java_code/FuzzyPores/ This contains most of the software developed, apart from the RapidMiner plugins Some notable programs are: – CrispifierApp Generates crisp numeric feature vectors – FuzzifierApp Generates the fuzzy-crisp feature vectors – MultiClassifier Allows to compare the output of multiple classifiers on a workpiece and its image Note that this program will expect the original workpiece images in the dataset directory 114 – LabelerGUI The program that was used to label the workpieces Note that this program will require the original workpiece images in the dataset directory • java_code/RapidMinderPlugins/ All RapidMiner operators that were developed for the experiments Note the operators.xml file that declares all these operators to RapidMiner • java_code/RapidMinerWrapper/ These are only a few Wrapper classes that are needed to call RapidMiner models from some of the FuzzyPores programs such as the MultiClassifier /perl_code/ Contains various smaller Perl programs associated to cleaning the datasets /perl_code/ Contains all prolog code: • prolog_code/PK3FixedModel/ contains the XPS-version of the static PK3 model • prolog_code/BadPoreLearner/ only minor changes to PK3FixedModel to use it for learning the very bad pore concept • prolog_code/FOIL/ contains the original and the altered FOIL source code /software/ All third-party software that is needed to run the experiments 115 Appendix B Prolog Framework and Ruleset for Multi-Level Classification of Workpieces The Code below contains the general Framwork for the PK3 classifier (File pore_classifier_framework.pl) The actual classification rules that are specific for a dataset are contained in a separate file As an example, the rules of the static PK3 model are listed here (File pk3_rules.pl) after the framework %declare fact predicates as dynamic :- dynamic workpiece/1 :- dynamic defects/2 :- dynamic size/2 :- dynamic border_dist/2 :- dynamic pore_dist/3 %:- include(’workpiece_facts.pl’) %load facts (for testing purposes only) %define additional rules for dynamic pore_dist predicate to limit number of necessary assertions pore_dist(X,X,0):-! %reflexivity pore_dist(X,Y,D):- (pdist(X,Y,D),!) ; (pdist(Y,X,D),!) %symmetry %%%%%%%%%%%% % classification rules %%%%%%%%%%%% %bad_workpiece/1 is the top level predicate that should be used to classify a workpiece %it calls lower level predicates that are defined in ’pk3_rules.pl’ bad_workpiece(W) :- is_overall_bad_workpiece(W), ! bad_workpiece(W) :- hasVeryBadPore(W), ! bad_workpiece(W) :- hasVeryBadPoreNest(W),! :-include(’pk3_rules.pl’) %load the actual pk3 rules %:- load_files(’pk3_rules.pl’,[all_dynamic(true)]) %load the actual pk3 rules (as dynamic predicates) %%%%%%%%%%%%%%%%%%%%%%%%%%%% % helper predicates %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 116 nest_hasMaxPoreSize(Nest, MaxSize) :- getMaxPoreSize(Nest,Size) , Size =< MaxSize countPoresWithMinSize(W, MinPSize, Count) :defects(W, Defects), findall( P, (member(P,Defects),size(P,PSize), PSize>=MinPSize), Pores), count(Pores,Count) %get the maximum pore size in a list of pores getMaxPoreSize([], _) :- fail getMaxPoreSize([X], MaxSize) :- size(X,MaxSize) getMaxPoreSize(Pores, MaxSize) :- Pores=[X|Rest], size(X,SizeX), getMaxPoreSize(Rest,RestMax), ((SizeX >= RestMax , SizeX=MaxSize) ; MaxSize=RestMax) %get the minimum distance between the pores in a list getMinPoreDist(Pores, MinDist) :count(Pores,Count), (Count>1 ; fail), findall( Dist, (member(X,Pores), member(Y,Pores), not(X=Y), pore_dist(X,Y,Dist) ) , DistList), %get a list of all mututal distances get_min(DistList, MinDist) %get the minimum getMinBorderDist([], _) :- fail getMinBorderDist([X],MinBDist) :- border_dist(X,MinBDist) getMinBorderDist([X|Rest],MinBDist) :- border_dist(X,DistX), getMinBorderDist(Rest,DistRest), ((DistX =< DistRest, DistX=MinBDist) ; MinBDist=DistRest) %counts the pore nests of a workpiece countPoreNests(W,NestCount,MinPSize,MinPDist) :- getPoreNests(W,Nests, MinPSize, MinPDist),count(Nests,NestCount) hasVeryBadPore(W) :- getVeryBadPores(W,VBPores), not(VBPores=[]) getVeryBadPores(W,VBPores) :- defects(W, Defs), findall( P, (member(P,Defs),very_bad_pore(P) ), VBPores),! hasVeryBadPoreNest(W) :- has_very_bad_nest(W),! hasPoreNest(W,Nest,MinPSize,MinPDist) :getPoreNests(W, Nests, MinPSize, MinPDist), member(OneNest,Nests), OneNest=Nest, !, permutation(OneNest,Nest) getPoreNests(W, Nests, MinPSize, MinPDist) :workpiece(W), defects(W,Defects), findall( [X,Y], ( member(X,Defects), member(Y,Defects), not(X=Y), directPoreNestPores(X,Y, MinPSize, MinPDist) ), NestCandidates), mergeOverlaps(NestCandidates,Nests),! mergeOverlaps( ListOfLists , Merged) :findall( [List1,List2] , ( %no overlaps can be found, list is already merged member(List1,ListOfLists), member(List2,ListOfLists), member(X,List1), member(X,List2), not(List1==List2) ), [] ), Merged=ListOfLists mergeOverlaps(ListOfLists,Merged) :list_to_set(ListOfLists, ListSet), select(List1,ListSet,ListSet1), select(List2,ListSet1,ListSet2), member(X,List1), member(X,List2), not(List1==List2), flatten([List1,List2],Flatlist), list_to_set(Flatlist, Newset), union([Newset],ListSet2,TempMerged), mergeOverlaps(TempMerged,Merged) %count the elements in a list count([],0) count([_],1) count([_|Rest],C) :- count(Rest,C1), C is + C1 117 %get the minimum of the elements in a list get_min([],_):-!,fail get_min([X],Min):- X=Min get_min([X|Rest],Min) :- get_min(Rest,RestMin), ((X= MinPSize The rules of the static PK3 model (File pk3_rules.pl): %pores that lead to immediate rejection very_bad_pore(P) :- size(P,Poresize), Poresize > 1.0 very_bad_pore(P) :- size(P,Poresize), Poresize > 0.4, border_dist(P,Dist), Dist < 0.0 %not actually relevant to PK3 %pore nest that leads to immediate rejection has_very_bad_nest(W) :- hasPoreNest(W,N,0.4,15), getMaxPoreSize(N,MaxPSize), MaxPSize>0.7 has_very_bad_nest(W) :- hasPoreNest(W,N,0.4,15), getMinPoreDist(N,Dist), Dist has_very_bad_nest(W) :- hasPoreNest(W,N,0.4,15), getMinBorderDist(N, MinBDist), MinBDist < 0.0 %not relevant to PK3 %these rules define bad workpieces, %where not a single nest or defect is responsible %for rejection, but the ’big picture’ is still bad though is_overall_bad_workpiece(W) :- countPoresWithMinSize(W, 0.7001, BigPores), BigPores > is_overall_bad_workpiece(W) :- countPoreNests(W,NestCount,0.4,15) , NestCount > Ich erkläre hiermit gemọò Đ 17 Abs APO, dass ich die vorstehende Masterarbeit selbständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe (Datum) (Unterschrift) ... Machine Learning methods for automating quality control in the production of cast iron parts, while also investigating how existing knowledge about the problem domain can be incorporated into... missing information 2.4 Knowledge Based Systems Knowledge Based Systems (KBS), or: Expert Systems (XPS), are not trained from observed data like it is done in machine learning Instead, expert systems. .. will be embraced in the upcoming experiments Machine Learning, and in particular: rule induction, has been successfully applied to many different domains, including quality control (for an overview,

Ngày đăng: 06/05/2020, 10:55

Xem thêm: