The Classification of Industrial Sand-Ores by Image Recognition Methods Giuseppe Bonifazi, Paolo Massacci Dipartimento di Ingegneria Chimica, dei Materiali, delle Materie Prime e Metallurgia
Lucian0 Nieddu, Giacomo Patrizi Dipartimento di Statistica, Probabilith e Statistiche Applicate Universith degli Studi di Roma "La Sapienza" Piazzale Aldo Mor0 5,00185 Roma e-mail:
[email protected] .it Laboratory methods are accurate but take time to Abstract. execute. while classification based on experience is a rough and ready process, since it can be affected by lighting The chemical and physical composition of the feldsparconditions, relative humidity of the sand, size distribution quartz sand-ore differ from location to location in a given etc.. Both lead to inferior production, because of imperfect open pit mine mine and the utilisation of the raw-ore, as classification or delays. well as its resale value will depend on these properties. The aim of this paper is to formulate a pattern Thus. a very important aspect of the operation is to recognition algorithm to classify with a very low determine quickly and accurately the properties of the sand probability of error, samples of sand-ore in classes of given at a given location. physical and chemical composition. Such classification Laboratory methods are accurate but take time to should be performable quickly, on-line and in real-time, so execute, while relying on the experience of the mine that as the exploitation machine proceeds in its operation, foreman is often eclectic and may lead to unsatisfactory the knowledge of the type of sand-ore being received can results. be used to determine the production altematives. The aim of this paper is to formulate a pattern The problem has been studied extensively. In [ l ] the recognition algorithm to classify, with a very low methods and the theory of raw material homogenization are probability of error, samples of sand-ore of given classes. examined, while [2] treats the integration of the whole Such classification should be fast and on-line. so that the process and [3] examines the process when the raw ores are sand grabber can use the information automatically.. subject to extensive variability. The algorithm presented operates in two stages. In the Pattern recognition procedures have been used to first stage of operation. classification has been accurate classify ornamental stone slabs [41, for particle over 92%, while after the refinement stage, precision has recognition (51, [ 6 ] . [7],to predict judicial decisions, [SI reached on average 96%. With so few objects and for Library Management systems [9],[10]. misclassified, part of the remaining imprecision may be due The outline of the paper is the following: the algorithm to to uncertainties in the classification ascribed, as it will be capture the images of the sand-ore will be described and shown below. Details are given on how to implement this then the pattern recognition algorithm used together with algorithm on-line, to guide the actual production process. the new refinement phase. Experimental results are then given and the extensions for on-line, real-time classification 1: Introduction. system is described. Conclusions close the paper. The chemical and physical composition of the feldspar2: Capture of the images and the pre-processing stage. quartz sand-ore exploited in an open pit mine differ according to location. The utilisation of the raw-ore, as well The colour of the of sand-ore is tied to the chemical as its resale value depends on these properties, which composition of the mineral. Thus, white raw-ore is shnuld be determined as the exploitation is proceeding. so t h a t the sand-ore collected should be classified and sent to considered the purest and the quality of the sand-ore the appropriate 'quality' container for treatment. declines as the colour turns to yellow and then to red.
1015-4651/96$5.000 1996 IEEE Proceedings of ICPR '96
174
The sand was continuously sampled by selecting a thin layer of about 10 cm on a front of about 2 m. in regions with sand predominantly of white, yellow and red type. The samples were layered on an appropriate holder and then covered with an optical glass to ensure the planarity and continuity of the grain layer and images were taken of the surface, under standard conditions of lighting and focus by a 3CCD RGB colour camera connected with a digitising device, forming pixels of 24 bits and with a spatial resolution of 512X 512 pixels, in the C.I.E. spectral primary system: R , G. B, see [ I l l . The digitised image is then processed without any filtration or pre-processing to extract the individual R , G, B colour source distributions, yielding the frequency of pixels with a given value of the grey-levels ( 0 - 2 5 5 ) .Thus on each source a statistical distribution is derived and for each image a pattern vector of 769 elements is obtained, plus the assigned class of membership. The colour image is assumed to depend on the distribution of the grey levels, so the problem is to recognise the properties of the distribution of the pixels according to the levels of the R. G, B colour sources and hence the class of sand-quality considered.
a barycentre vector of another class. This feature vector is selected as a new barycentre for its class and the items of that class are reassigned to the increased barycentres of their class, according to distance. The formation of the new barycentre matrix is completed by recalculating the barycentres of each class on the basis of the reassignment just completed. The procedure continues until each feature vector is closer to a barycentre of its class than to a barycentre of another class. The structure diagram is specified in figure 4.1. The distance criterion used was the usual Euclidean distance, since the feature vectors had continuous elements, but discrete distance criteria, like the city-block is also used The algorithm converges, see [13]. [9] to a unique set of barycentres, if no identical feature vectors belong to different classes belong to the training set. This may occasionally occur, since the formation of the feature vector is surjective, even if the pattern vectors are coherent. To solve this, a set of suitable additional features can be chosen so that in the augmented space the two feature vectors will differ. Exactly the same procedure is followed if the inconsistency occurs in the pattern vectors. Convergent algorithm can still be formulated if there are items in the original data set whose class membership is uncertain. Thus suppose that the verification sample is selected by simple random sampling. If an item has been classified incorrectly and lies in the training set, then as the algorithm is convergent, the set of barycentres obtained will be formed, ensuring that the item considered is in fact nearer to a barycentre of its own (incorrect) class, than to a barycentre of another class. This may even be achieved by forming a singleton barycentre composed of just that element. This misclassification in the training set may cause errors in the verification sample. as other items. similar to the incorrect one. but attributed to their correct class, will be grouped in the same class of the incorrect element in the training set. On the other hand, if the incorrectly classified element occurs in the verification sample, it will be assigned to its correct class, but this will differ from the assigned class, so there will be an apparent deterioration of performance. In general. misclassifed items may occur because of random noise, in which case there is nothing that can be done to better the performance and the recognition result will vary randomly around an average level. they m a y occur because incorrectly classified item have appeared in the training set, or because they occur partly in the training
3: Pattern recognition algorithm and refinement phase. The algorithm. considers a training set, a verification set and a classification set, where items of unknown composition are considered. The feature selection process, consists in choosing specific quantiles for each colour source, or specific moments about the origin. The algorithm is based on an initial formulation presented in [ I l l , reformulated in [I21 where the convergence of the algorithm is proved. The random selection technique used to select the training set consists either of systematic sampling ( one in four) or simple random sampling without replacement. The choice of the second sampling procedure is due to a possible relationship between nearby items, which will render invalid the systematic sampling, see [ 141. The algorithm in the training mode proceeds in the following way. Given the training set, an initial barycentric matrix is formed by finding the average feature vector from all the feature vectors of the class. The distance of each feature vector from each barycentric vector of the data set is determined. All the feature vectors which are nearer to a barycentre of another class are selected and among these, that feature vector is selected, which results to be nearest to
175
and in the verification set, causing a systematic deterioration in performance. Under simple non repetitive random sampling, the incorrectly classified sample will tend always to be misclassified in the verification phase, except for those trials when a similar item, also incorrectly classified. is assigned to the training set. Thus, if an item has been misclassified in the verification set in the majority of trials, by reclassifying it, as belonging to that class which the verification algorithm assigned to it, with a high probability. the correct class will be chosen for it. Once the incorrectly classed item is reassigned to its proper class, it will behave like the majority of the items, whose classification is correct and give no more trouble. The refinement algorithm consists of such an implementation. A series of 230 trials are executed, drawing each time, by simple random sampling without replacement, a sample for verification. The training phase of the algorithm is performed and the verification effected. If an item results misclassified in 152 or more trials ( 66%) it is considered incorrectly classified and is reclassified in the class to which it was predominantly assigned by the verification algorithm. With these changes, the 230 trials are repeated and once more the correction is made. Under these conditions, the precision rate of the verification sample should increase, while if noise i s present the precision will oscillate randomly around the same rate. Thus, replications can be executed until the precision rate does not increase any more. At that moment, the classification of the data set may be considered correct and any residual error in classification can be considered the effect of noise.
4.1 Svstematic Samulins, The order of the data is given by the selection at the mine and since there are remainders in the selection process a slight bias is introduced. The results of the verification phase is shown in table 4.2, both for the quantile pattern vector and for the moment pattern vector, while for comparison purposes, recognition based on the k-nearest neighbour procedure, see [15], for k = 1 , 4 , 6 are given. The number of correctly classified items is of course a whole number, but since they are represented in percentages, which have been rounded to two figures. a slight approximation may have occurred. Feature vectors based on moments give better and more consistent results than the qua-ntiles version. This is expected, based purely on statistical reasoning, as moments tend to be more stable than quantiles, given any statistical distribution. Exactly the same argument is used to prefer the procedure described here, over the nearest neighbour method, since the 'barycentres' of the latter contain 1,4,6 elements, and, behave either as quantiles or small cluster. Moreover, since the barycentres obtained by this procedure are around 50 -60, while for the latter they are 330. the computational burden is much heavier on the latter. Thus the quantile feature selection method as well as the nearest neighbour method will not be considered any further. It should be noticed that the best results are obtained with 8 moments per distribution for each colour component. with a correct recognition of 98.18% or 108 out of 110 items to be verified.
4.2 Random Samuline Exueriments. T o construct a measure of the reliability of the algorithm and of the sampling procedures, a purely random sample of 110 images for verification was drawn from the data. These items were not always evenly distributed between the three classes, nor were they necessarily spread out within the class. The recognition algorithm was repeated 230 timcs and the misclassified images in the verification set at each trial was recorded. The performance. depicted in table 4.3 is extremely precise and robust. From the table, there is no evidence that the 8 moment pattern vector is preferable to the 16 moment pattern vector, but it is unlikely that the results will continue to improve, since the best results (column 4) do not improve as the number of moments considered increase, but only the worst case improves, as more
4 Experimental results. The experiment consists of 440 images from the three classes, as shown in table 4.1 and can be divided into 3 parts: 1) Recognition using quantile and moment feature vectors with a verification set of 110 items obtained by systematic sampling. 2) Recognition using moments and the verification set of 110 items drawn without replacement from the data set, repating this 230 times. 3) Recognition as in (2), in which the consistently mislabelled samples were reclassified according to their predominant class attribution by the algorithm and the process is repeated until convrgence.
176
,
information is brought to bear on the training and the verification. It is interesting to note that the best result of 98.18 % seems to coincide with the results of the other best experiments with 8 moments. The eventual statistical implications of such a relation if not spurious are unknown. The theoretical statistical distribution, which best approximates the empirical distribution is the Lognormal Distribution., A variate so distributed implies that the individual factors considered to generate the distribution are multiplicative. see [16]. Many multiplicative phenomena act on the result of one trial, rather than many additive phenomena ( the case of the Gaussian curve).
relabelling phase contributes an improvement i n precision. in the verification sample, and therefore in classification of about 4%. a not trivial improvement considering the high initial precision. This procedure can be implemented for an on-line operation. The camera and equipment can be assembled as a portable probe on the front of the exploiting machine, so that the images are taken and processed sufficiently fast to ensure that, when the sand from the conveyer reaches the dispatching point, the information on the class of the specimen is available. so the dispatcher can redirect the material to the appropriate of the multiple bins.
4.3Random Samuline and label correction.
5: Conclusions.
Those items that resulted misclassified in more than 2/3 of the trials were 27, in the previous experiment and these were selected and their label was changed to the most common label. This process was repeated 11 times. These images seem to cluster together which is confirmed by the file labels. Most of these items were classified in a stable way after a few replications. It is important to note that all the changes occur between contiguous classes. Thus, impurities are perhaps present in some items from the white region of the deposit, which converts them to the yellow type of ore and i n some items from the yellow region are more pure than it appears. so that they are classed in the white class. Similarly the only item incorrectly classified as a red specimen, results in fact a yellow specimen. Only 5 items did not converge to a stable classification, 3 items coming from one zone and 2 coming from another zone. The chemical analysis did not indicate any differences. From their respective grey-level frequency distribution for each colour source. 3 items seem to reflect bad lighting effects, while the for the other 2, no justification is apparent. The precision in the verification is shown in table 4.4. Here the mean precision over the 230 trials of each replication is given. For each replication the precision results that occurred in the worst and in the best case are also indicated. The results given in table 4.4, show a steady improvement i n the mean precision obtained in the verification sample and show that quite early. the best results yielded a precision of 100.00% . The results determined appear to be extremely robust. t h e variance of each replication is extremely low and the confidence limits around t h e mean are extremely close. Thus it can be concluded that this
An algorithm to recognise and classify images according to some property of the items considered has been described in this paper and it has been shown that good classification results can be obtained from it, both on its own and when adapted with a label correction technique. A completely correct classification in the training phase resulted, every time so the sample meets the conditions for consistency, which allows the consistency of a classification to be tested with this algorithm. There are many applications where this technique can be used to advantage. The algorithm provides a realisation of the human process of classification. recognition and learning. as indicated in [17].
6: References. [ l ] Massacci.. P., G. Raspa. C.Da Rold. M Di Callisto. Homegenization of Raw Material by Production Planning and Storage Systems, 19th International Symposium on the Applications of Computers and Operational Research in the Mineral Industry, APCOM, f'ennsyivania 121 Massacci.. P., G. Raspa. C.Da Rold. M Di Callisto, Modelling and Simulation of Integrated Prehomo- genization. Milling and Homogenization Systems. hoc. of the 1st World Congress on Particle Technology, Nurenberg. [3] Berry. P.. G. Bonifazi. P. Massacci. P. Piga. M. Pinzari. 0. Raspa. M. Sciotti. M. Violo. (1987). Optimization of Extraction Treatment Plant Solutions. Taking Account Raw Material Variability, 13th World Mining Congress, Stockholm. [4] Bonifazi. G., P. Massacci , G. Patrizi. (1990a). Pattern Recognition for Texture Classification of Ornamental Stone Slabs. I.E.E.E. International Conference on Image Processing, ICIP'89, ,Singapore.Conference Proceedings. v01.2.
177
(51 Bonifazi. G., P. Massacci , G. Patrizi, (1989). Alternative Feature Selection Procedures for Particle Classification by Pattem Recognition Techniques, in Cantoni, V.. S . Levialdi. H. Wolf (eds.). Recent Issues in Image Analysis, Lecture Notes in Computer Science, Springer Verlag. Berlin, vol. 399. pp. 365375. (61 Bonifazi. G.. P. Massacci G. Patrizi. (1990b). Alternative Pattern Extraction Procedures for Particle Classification by Pattern Recognition Techniques, h o c . of 2nd World Congress on Particle Technology, September 19 -22. Kyoto, Japan. 171 Bonifazi. G., P. Massacci , G. Patrizi. (1991). Hierarchical Properties of Particle Shape for the Recognition of Powdered Materials. Particle & Particle Systems Characterization. vol. 8, N" 2 (June). pp. 116 - 123. I8JPatrizi. 0.(1981). A Pattern Recognition Approach to Judicial Decisions (with reference to Industrial Property Controversies). European Journal of Operations Research, VOI. 7, vp. 133-142. (91 Calamassi. M., G. Patrizi. (1988), La Progettazione di un Sistema Bibliografico di Interrogazione: SIBILLA. in Associazione ltaiiana di Ricerca Operativa. Ricerca Operativa ed htelligenza Artificiale, Atti delle Giomate di Lavoro A.I.R.O.. 1988. Centm di Ricerca I.B.M..Pisa. pp. 589 -605. [IO] Patrizi. G . . (19993). SIBILLA: An Implementation of an Intelligent Library Management System. European Journal of Operations Research, vol. 64. n. 1, pp. 21-37. [ I 11Jain. A., K., (1989).Fundamentals of Digital Image Processing. Prentice-Hall,EnglewoodCliffs. 1121 Firschlein. 0..M. Fischler. (1963). Automatic Subclass Determination for Pattern Recognition Applications, I.E.E.E. Transactions on Electronic Computers, ~01.12.p. 137 -141. [ 131 Patrizi, G., (1979). Optimal Clustering Properties. Ricerca Operativa, 10. pp. 37 - 60. (141 Konijn, H., S.. (1973). Statistical Theory of Sample Survey Design and Analysis. North-Holland. Amsterdam. [IS] Duda, R.. 0..P. E. Hart. (1973). Pattern Classification and Scene Analysis, Wiley, New York. (161 Aitcheson. J., J. A. C. Brown, (1957). The Lognormat Distribution, University of Cambridge Dept. of Applied Economics, Monograph,no 5. Cambridge U. Press. Cambridge. [17] Watanabe. S.. (1985). Pattern Recognition: human and mechanical. Wiley. New York.
Figure 1: Structural Specification o f the Classification Algorithm. CLASSIFICATION ALGORITHM (Training mode):
DCL DCL
.
NN number of features in the vectors, T number of objects in the training set.
DCL DCL
MM(j) number of baryccntric vectors of class 1,
DCL
Data(if Vector of features of the object i.
DCL
NC number of classes Tracedj) baryccntric vector j.
Begin; For i = 1. ....T Do; For j = 1. ....MM(NC) Do; DDII) = Min. ( Distance [data(i), tracer(J)]l;
End; CLTC(i) = arg
Min. ( Distance [datali), tracer(j)] 1
End: For class-of{Data(i) 1 CLTC(i) Do: I* = argl maxi{ DDII)I I ; Tracer(MM(NC) + 1 ) = Data(I*) U class-of( DatatI*) 1; Sort( Tracer per class);
Update ( number of barycentres MM(J) j = I . ....NC);
Fori = I . ...,T Do: P = class-of( Data(i));
For j
= M M f P - I ) + l....,MM(P) Do;
I* = arg( minj ( Distance ( Data(i), Tracedj)) 1 I;
End; NTracer(J*) = [N(J*)*NTracer(J*) + Data(J*)]/((N(J*)+ I ) : N(J*)
=NU*)+ I ;
End: Tracer