4
A two stage defect recognition method for parquet slab grading Hannu Kauppinen Machine Vision and Media Processing Unit Infotech Oulu, Department of Electrical Engineering P.O.Box 4500, FIN-90014 University of Oulu Abstract This paper demonstrates the use of a simple but effec- tive color-based inspection method in parquet slab grad- ing. The approach is to divide the image to small rectangular regions and calculate color percentile features from these areas. Classification is performed in two stages, defect detection and recognition. The recognition results are further used in determining the final grade for the par- quet slabs. Comparative results are also presented. 1. Introduction In parquet slab grading, the grade of a slab is deter- mined by measuring the sizes and the number of the defects, and the slab is assigned the best grade require- ments it fulfills. The grading is performed on several grades depending on the parquet type, for example to the grades: classic, harmony, variation and fire wood, or prime, standard, flamy, extra flamy and fire wood. However, human made grading seldom follows strict numerical rules, but is mostly based on observing the gen- eral visual appearance of the slabs. Important is also the ability to notice certain very small defects, like cracks or spots. Observation of the general visual appeareance is composed of defect shape and color observations and sur- face color and grain formation observation. Therefore, an approach not measuring the dimensions and locations of the defects, but rather creating an overview of the surface could be sufficient to this application. A partner of the ESPRIT - P21023 (CATIE) project, Junckers Industrier A/S, Denmark, was interested in test- ing the wood inspection methods developed by University of Oulu (called the UO method) for the parquet slab defect recognition. They were developing a new slab grading line having automated grading based on color machine vision. Earlier, they have been using grey-level machine vision in collaboration with DTU, the Technical University of Den- mark [1]. DTU was also participating the CATIE project, developing further their methods. From the comparisons of the methods of DTU and UO, Junckers established impor- tant information on the attainable defect recognition rates and grading accuracy, and also of the implementation com- plexity. The requirements by Junckers Industrier A/S for the machine vision system are grading of 3 slabs (70 mm x 625 mm) per second, about 0.08 mm (transversal) x 0.36 mm (longitudinal) imaging resolution, and a grading accu- racy better than 85%. 2. The inspection method The UO method is a two-stage non-segmenting method using color histogram percentile features and k-NN classi- fiers, proposed earlier in [2] and [3]. The non-segmenting method means ‘segmentation’ which does not try to decompose the image into meaningful regions, but makes the partitioning regardless of the contents of the image. In this experiment, the partitioning is made to non-overlap- ping rectangular regions of size 32x32 pixels. Features are calculated from each region and they are classified to rele- vant classes. Non-overlapping regions have been used by many researchers in wood surface inspection, for example, in [4], [5] and [6]. The first stage of the non-segmenting method performs defect detection and the second stage defect recognition. The defect detection stage classifies the rectangles into two classes: good and suspicious rectangles. The defect recog- nition classifies further the suspicious rectangles to the var- ious defect categories. The features used are RGB color histogram percentile features, proposed earlier in [2]. The percentiles are calculated from a cumulative histogram C k (x), which is defined as a sum of the normalised histogram P k (x) of color channel k of all the values that are smaller than x or equal to x. Finding a value for a percentile feature is finding the x, when C k (x) is known, requiring an inverse function of C k (x). Let us denote the percentile feature value with F k (y), we get the relation , (1) where y is a value of the cumulative histogram in the range [0%, 100%]. F k y (29 C k 1 y (29 x = = Proc. 15th International Conference on Pattern Recognition, September 3-8, Barcelona, Spain, 4:803-806.

A two stage defect recognition method for parquet slab grading · defect detection and recognition. The recognition results are further used in determining the final grade for the

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A two stage defect recognition method for parquet slab grading · defect detection and recognition. The recognition results are further used in determining the final grade for the

A two stage defect recognition method for parquet slab grading

Hannu KauppinenMachine Vision and Media Processing Unit

Infotech Oulu, Department of Electrical EngineeringP.O.Box 4500, FIN-90014 University of Oulu

Abstract

This paper demonstrates the use of a simple but effec-tive color-based inspection method in parquet slab grad-ing. The approach is to divide the image to smallrectangular regions and calculate color percentile featuresfrom these areas. Classification is performed in two stages,defect detection and recognition. The recognition resultsare further used in determining the final grade for the par-quet slabs. Comparative results are also presented.

1. IntroductionIn parquet slab grading, the grade of a slab is deter-

mined by measuring the sizes and the number of thedefects, and the slab is assigned the best grade require-ments it fulfills. The grading is performed on severalgrades depending on the parquet type, for example to thegrades: classic, harmony, variation and fire wood, orprime, standard, flamy, extra flamy and fire wood.

However, human made grading seldom follows strictnumerical rules, but is mostly based on observing the gen-eral visual appearance of the slabs. Important is also theability to notice certain very small defects, like cracks orspots. Observation of the general visual appeareance iscomposed of defect shape and color observations and sur-face color and grain formation observation. Therefore, anapproach not measuring the dimensions and locations ofthe defects, but rather creating an overview of the surfacecould be sufficient to this application.

A partner of the ESPRIT - P21023 (CATIE) project,Junckers Industrier A/S, Denmark, was interested in test-ing the wood inspection methods developed by Universityof Oulu (called theUO method) for the parquet slab defectrecognition. They were developing a new slab grading linehaving automated grading based on color machine vision.Earlier, they have been using grey-level machine vision incollaboration with DTU, the Technical University of Den-mark [1]. DTU was also participating the CATIE project,developing further their methods. From the comparisons ofthe methods of DTU and UO, Junckers established impor-tant information on the attainable defect recognition ratesand grading accuracy, and also of the implementation com-

plexity.The requirements by Junckers Industrier A/S for the

machine vision system are grading of 3 slabs (70 mm x625 mm) per second, about 0.08 mm (transversal) x 0.36mm (longitudinal) imaging resolution, and a grading accu-racy better than 85%.

2. The inspection methodThe UO method is a two-stagenon-segmenting method

using color histogram percentile features andk-NN classi-fiers, proposed earlier in [2] and [3]. The non-segmentingmethod means ‘segmentation’ which does not try todecompose the image into meaningful regions, but makesthe partitioning regardless of the contents of the image. Inthis experiment, the partitioning is made to non-overlap-ping rectangular regions of size 32x32 pixels. Features arecalculated from each region and they are classified to rele-vant classes. Non-overlapping regions have been used bymany researchers in wood surface inspection, for example,in [4], [5] and [6].

The first stage of the non-segmenting method performsdefect detection and the second stage defect recognition.The defect detection stage classifies the rectangles into twoclasses:good andsuspicious rectangles. The defect recog-nition classifies further the suspicious rectangles to the var-ious defect categories.

The features used are RGB color histogram percentilefeatures, proposed earlier in [2]. The percentiles arecalculated from a cumulative histogramCk(x), which isdefined as a sum of the normalised histogramPk(x) ofcolor channelk of all the values that are smaller thanx orequal to x. Finding a value for a percentile feature isfinding thex, whenCk(x) is known, requiring an inversefunction of Ck(x). Let us denote the percentile featurevalue withFk(y), we get the relation

, (1)

wherey is a value of the cumulative histogram in the range[0%, 100%].

Fk y( ) Ck1–

y( ) x= =

Proc. 15th International Conference on Pattern Recognition, September 3-8,Barcelona, Spain, 4:803-806.

Page 2: A two stage defect recognition method for parquet slab grading · defect detection and recognition. The recognition results are further used in determining the final grade for the

The feature vectors used in the classification are com-posed of selected sets of plain percentile features and dif-ferences of two percentile values either from the samecolor channel or from two different color channels.

3. Test setupThe method testing requires large amounts of manually

labelled images. Color images were taken with line-scancameras with several imaging arrangements during theproject. One of the first imaging arrangements for demon-strating the achievable image quality with a 12-bit colorline-scan camera is shown in Fig. 1.

The image set used consists of 150 images of beechwood slabs used for training and 360 images used for thegrading test. The training areas were marked by creatingpainted images, where the pixels belonging to the selectedtraining class are marked with colors by hand.

To evaluate the defect detection and recognition accu-racy, rectangular samples were collected from the trainingareas marked in the painted images. The number of rectan-gular samples obtained from the training images was26855, and their distribution to different classes can beseen from the all samples column in Table 1.

A set of 117 color percentile features was calculated forthe training samples. A feature selection algorithm wasused to find the best features for defect detection and rec-ognition. To carry out feature selection, subsets of thetraining samples were taken in order to obtain a roughlyequal number of samples for the classes to be separated.The number of samples for the subsets for defect detectionand defect recognition best feature selection are shown inTable 1.

3.1 Defect detectionFor the defect detection feature selection, the training

subset contains roughly equal numbers of samples of goodwood and of the group formed by all the defects together,as shown in Table 1.

The classification result of a defect detection test isshown in Fig. 2 in the form of a confusion matrix. Theclassification was made as a two-class classification, goodwood versus all defects, denoted with the class name other.The listing below the confusion matrix shows the numberof misclassifications of each defect class to the good woodclass, i.e., the error escapes.

In the classification, the defect detection subset wasused as a training set, and all samples were used for test-ing. Because the training set is a subset of the test set, dur-ing the classification it has to be assured that the samplesfrom the same image are never used at the same time in thetraining and test sets. This was achieved by removing thetraining samples originating from the same parquet slabimage than the tested sample during classification of eachsample. After classification, the removed training samplesare returned to the training set, and the same check is per-formed for the next test sample to be classified.

The confusion matrix indicates that the false alarm rate,classification from good wood to other, is only 2.0 %. Theerror escape rate is larger, almost 6 %. However, more thanhalf of the error escapes consists of areas manually labeledto the class grain, since grain is very close to the good

Fig. 1. An experimental setup for taking high quality colorimages from parquet slabs (printed with permission fromJunckers Industrier A/S).

Table 1. The number of parquet training samples totallyand in the subsets for best feature selection.

The number of samples

class all samples defectdetection

subset

defect rec-ognitionsubset

Good_wood 16027 763 100

Sknot (sound knot) 430 47 107

Bknot (black knot) 102 51 102

Rpith (red pith) 788 49 112

Bpith (black pith) 380 47 95

Bark_pocket 392 49 98

Grain 1129 51 102

Streak 12 12 12

Crack 1009 50 100

Split 73 73 73

Lhydrolysis (light hydrolysis) 1542 51 102

Dhydrolysis (dark hydrolysis) 1632 49 102

Discoloration 1737 51 102

Lglucose (light glucose spot) 215 53 107

Dglucose (dark glucose spot) 574 52 95

Water_stain 813 50 101

TOTAL 26855 1498 1510

Page 3: A two stage defect recognition method for parquet slab grading · defect detection and recognition. The recognition results are further used in determining the final grade for the

wood color and properties. It is important, that the cracksand splits are very well detected.

3.2 Defect recognitionThe subset of training samples for defect recognition

best feature selection consists of roughly an equal numberof samples from each defect class, as the last column ofTable 1 shows. Good wood is also included in the trainingset to be able to classify some of the false alarms back togood wood.

The classification result of the 10509 (=314+10195)samples detected as defects at the previous stage is shownas a confusion matrix in Fig. 3.

The confusion matrix shows that the overall correct rec-ognition rate was about 80%. The worst cases are the

remaining good wood samples, which are mostly confusedwith class grain and glucose. Not too many error escapesare caused at this stage. Streak has a relatively high errorpercentage, which is probably due to the small number ofsamples of this defect type. On the other hand, splits arewell classified although their number is small too. Lightand dark glucose spots (lglucose and dglucose) are mostlyconfused to each other.

Some recognition results are illustrated in Fig. 4. It canbe seen, that there are some clearly correct recognitions,but also cases that are not. Because the purpose is to havean overview of the board for grading, it is possible that avery accurate recognition is not necessary.

However, on this level it is very difficult to evaluate howgood grading accuracy can be achieved. It is very difficultto also compare the recognition results to the DTU methodbecause of different approaches for recognition. Imple-menting a higher level grading algorithm that can acceptthe recognition results from both methods was necessary.

Training set samples 1498Test set samples 26855kNN classifier, k=3, 13 features

Total error is 3.53 %

G o o d _ O w T o H o E d R Error

Good_wood 15713 314 2.0 % OTHER 633 10195 5.8 %

UNKNOWN -> Good_wood 0 of 0 samples ( 0.00%)Good_wood -> Good_wood 15713 of 16027 samples ( 98.04%)Sknot -> Good_wood 77 of 430 samples ( 17.91%)Bknot -> Good_wood 0 of 102 samples ( 0.00%)Rpith -> Good_wood 0 of 788 samples ( 0.00%)Bpith -> Good_wood 0 of 380 samples ( 0.00%)Bark_pocket -> Good_wood 0 of 392 samples ( 0.00%)Grain -> Good_wood 343 of 1129 samples ( 30.38%)Streak -> Good_wood 0 of 12 samples ( 0.00%)Crack -> Good_wood 4 of 1009 samples ( 0.40%)Split -> Good_wood 0 of 73 samples ( 0.00%)Lhydrolysis -> Good_wood 63 of 1542 samples ( 4.09%)Dhydrolysis -> Good_wood 0 of 1632 samples ( 0.00%)Discoloration -> Good_wood 2 of 1737 samples ( 0.12%)Lglucose -> Good_wood 69 of 215 samples ( 32.09%)Dglucose -> Good_wood 72 of 574 samples ( 12.54%)Water_stain -> Good_wood 3 of 813 samples ( 0.37%)

Fig. 2.Results of defect detection tests for the training mate-rial. A confusion matrix of good-defect classification, and adetailed listing of defects classified togood wood.

Training set samples 1510Test set samples 10509kNN classifier, k=3, 15 features

Total error is 20.06 % D i B L D s W a h h c a G r y y o t o k d d l L D e U o _ r r o g g r N d p S o o r l l _ K _ S B R B o G t C S l l a u u s N w k k p p c r r r p y y t c c t O o n n i i k a e a l s s i o o a W o o o t t e i a c i i i o s s i N d t t h h t n k k t s s n e e n

UNKNOWN . . . . . . . . . . . . . . . . . 0.0 % Good_wood . 35 41 . 2 . . 112 . . . 4 . . 83 35 2 88.9 % Sknot . 3 225 . 37 2 6 21 . 40 5 . . 4 2 4 4 36.3 % Bknot . . . 69 . 2 26 1 . 2 . . 2 . . . . 32.4 % Rpith . . 22 1 692 2 3 2 . 4 4 13 . 20 . 15 10 12.2 % Bpith . 1 . 2 1 272 20 . 5 13 31 14 2 15 4 . . 28.4 % Bark_pocket . . 1 77 . 54 242 2 . 7 1 . 2 6 . . . 38.3 % Grain . 9 59 . 11 8 . 601 2 7 4 13 . 24 33 15 . 23.5 % Streak . . . . . 2 . 3 6 1 . . . . . . . 50.0 % Crack . . 31 22 10 30 5 13 3 772 41 22 27 11 6 4 8 23.2 % Split . . . . 1 2 . . . 4 65 1 . . . . . 11.0 % Lhydrolysis . 1 . . 27 3 . 14 . 1 . 1396 2 17 . 18 . 5.6 % Dhydrolysis . . . 17 5 7 33 . . 7 1 45 1452 65 . . . 11.0 %Discoloration . . 11 2 127 71 15 47 2 5 15 40 10 1375 2 8 5 20.7 % Lglucose . 1 . . . . . . . . . . . . 115 30 . 21.2 % Dglucose . . . . 9 . . 1 . 1 . . . . 89 393 9 21.7 % Water_stain . . 10 3 13 . . 1 1 9 . 2 . 2 19 59 691 14.7 %

Fig. 3.Results of defect recognition tests for the trainingmaterial.

Fig. 4.Examples of the detected and recognized defects withthe non-segmenting method.

Page 4: A two stage defect recognition method for parquet slab grading · defect detection and recognition. The recognition results are further used in determining the final grade for the

3.3 Parquet grading resultsFor the grading test, 360 images consisting 120 images

from each of the three different grades,classic, harmonyandvariation, were used as the test material. Examples ofthe grades are illustrated in Fig. 5.

The grading of the slabs is performed by a grading algo-rithm implemented by DTU. The grading tests for the rec-ognition results of both the UO and DTU methods wereperformed by Junckers and DTU. The grading algorithmcalculates the distribution of the different recognizeddefect classes on a parquet slab, and judges the grade usinga CART (classification and regression tree) classifier. Thegrading results are presented as confusion matrices inTables 2 and 3.

There are only small differences between the results.The DTU method is better with the classic grade and theUO method with harmony grade. For further analysis, theeffect of the misgradings to the value of each grade shouldbe known.

4. ConclusionsThis experiment shows the results of the non-segment-

ing method for parquet grading. Further, comparativeresults with a method from DTU were presented. The non-segmenting method was suitable for parquet defect recog-nition, because the locations of the defects are not veryimportant in parquet sorting. The general appearance of aparquet slab is depicted by the distribution of the defectson which the slab grading is based on.

The performance level in the final grading was quitesimilar for the UO and DTU methods. Because of closecollaboration between DTU and Junckers, the DTUmethod was selected to be implemented in the inspectionsystem.

The images used in the experiments were of prelimi-nary quality and much better results were obtained byDTU and Junckers in later tests with the final qualityimages.

5. AcknowledgmentsThe support of EU ESPRIT programme is gratefully

acknowledged. Mr. Niels Schmidt from Junckers Indus-trier A/S and Mr. Johan Doré from Technical University ofDenmark are thanked for providing the test material andcomparative results.

6. References[1] Ersbøll BK & Conradsen K (1992) Automated grading of

wood slabs: The development of a prototype system. Indus-trial Metrology, 2: 219-236.

[2] Silvén O & Kauppinen H (1994) Color vision based meth-odology for grading lumber. The 12th International Confer-ence on Pattern Recognition, Jerusalem, Israel, 1: 787-790.

[3] Kauppinen H and Silven O (1995) A Color VisionApproach for Grading Lumber. In Theory & Applicationsof Image Processing II - Selected papers from the 9th Scan-dinavian Conference on Image Analysis (ed. G. Borgefors),World Scientific, 367-379.

[4] Conners RW, McMillin CW & Vasquez-Espinosa RE(1984) A prototype software system for locating and identi-fying surface defects in wood. 7th International Conferenceon Pattern Recognition, Montreal, Canada, 1: 416-419.

[5] Sobey PJ & Semple EC (1989) Detection and sizing visualfeatures in wood using tonal measures and a classificationalgorithm. Pattern Recognition, 22: 367-380.

[6] Yläkoski I & Visa A (1993) A two-stage classifier forwooden boards. 8th Scandinavian Conference on ImageAnalysis, Tromsø, Norway, 637-641.

Table 2. Grading result with the DTU method.

grade

classic harmony variation

gradeclassic 87.0 % 11.0 % 2.0 %

harmony 33.0 % 51.0 % 16.0 %

variation 3.0 % 19.0 % 79.0 %

Table 3. Grading result with the UO method.

grade

classic harmony variation

classic 78.0 % 20.0 % 2.0 %

grade harmony 22.0 % 58.0 % 20.0 %

variation 0.0 % 22.0 % 78.0 %

Fig. 5. Examples of parquet slab grades. The pairs from leftto right: classic, harmony and variation.