Académique Documents
Professionnel Documents
Culture Documents
Original paper
School of Electrical and Electronic Engineering, Engineering Campus, Universiti Sains Malaysia, 14300 Penang, Malaysia
Faculty of Information Sciences and Technology, Universiti Kebangsaan Malaysia, 43600 Bangi Selangor, Malaysia
c
Department of Electrical Engineering, Faculty of Engineering, Chulalongkorn University, 10330 Bangkok, Thailand
b
a r t i c l e
i n f o
Article history:
Received 10 April 2010
Received in revised form 8 September 2010
Accepted 17 October 2010
Keywords:
Biscuit
Discriminant analysis
Machine vision
Multi-core processor
Image segmentation
Support vector machine
a b s t r a c t
An intelligent system for colour inspection of biscuit products is proposed. In this system, the state-ofthe-art classication techniques based on Support Vector Machines (SVM) and Wilks analysis were
used to classify biscuits into one of four distinct groups: under-baked, moderately baked, over-baked,
and substantially over-baked. The accuracy of the system was compared with standard discriminant
analysis using both direct and multi-step classications. It was discovered that the radial basis SVM
after Wilks was more precise in classication compared to other classiers. Real-time implementation
was achieved by means of multi-core processor with advanced multiple-buffering and multithreading
algorithms. The system resulted in correct classication rate of more than 96% for stationary and moving biscuits at 9 m/min. It was discovered that touching and non-touching biscuits did not signicantly
interfere with accurate assessment of baking. However, image processing of touching biscuits was considerably slower compared to non-touching biscuits, averaging at 36.3 ms and 9.0 ms, respectively. The
decrease in speed was due to the complexity of the watershed-based algorithm used to segment touching
biscuits. This image computing platform can potentially support the requirements of the high-volume
biscuit production.
2010 Elsevier B.V. All rights reserved.
1. Introduction
The bakery sector can be considered to be one of the most important sectors in food industry. Real-time inspection is very desirable
in this industrial sector since food products like biscuits are being
produced by millions each day. Like other manufacturing processes,
quality evaluation and sorting are two essential operations performed routinely in biscuit production. Among the many tests that
need to be carried out on biscuits is the measurement of colour
as colour indicates quality and defect. Colour is also an important
guide as biscuits will appear more appetising when its appearance
is optimised. Consumers expect to nd a constant colour for a same
brand of biscuit. Obtaining identical biscuits are difcult even
during a short baking period. This is due to the complexity of the
baking process where biochemical reactions and physical transformations give rise to biscuits with different shades of colours
(Moore, 1991). Therefore biscuit colour inspection occupies a major
role in the biscuit manufacturing, from raw dough to nished products. Commonly, in this industry, quality evaluation is being carried
out by human vision of some trained inspectors who make subjec-
148
Fig. 1. Example of (a) non-touching and (b) touching biscuits. In both cases, top left is under-baked, top right is moderately baked, bottom left is over-baked and bottom
right is substantially over-baked.
149
BNC Cable
Iron holder
1. Under-baked
2. Moderately baked
3. Over-baked
4. Substantially over-baked
3-CCD
Camera
Illumination
system
Biscuit
samples
Industrial HP
Workstation
Industrial conveyor
Frame
grabber
h=
h=
360 cos
255
360
or
cos
(R G)2 (R B)(G B)
If B G
1
0.5[(R G) + (R B)]
0.5[(R G) + (R B)]
(R G)2 (R B)(G B)
(1)
255
360
If B < G
(2)
Eqs. (1) and (2) yield normalised hue values in the interval [0, 255].
The equation of hue can also be expressed using trigonometry identity, but Eqs. (1) and (2) are easier to visualise and superior in terms
of hardware implementation.
150
Support vectors
Start
Margin
Grab image
Auto thresholding
Class (+1)
Area > T
Non-touching No
objects
Morphological
erosion
Yes
Touching
objects
Hyperplane
Edge detection of
original image
Watershed
transformation
Morphological
erosion
Count number of
objects and calculate
centre of gravity
Class (-1)
Image cropping
End
Fig. 3. Image processing for touching and non-touching biscuits. The threshold
value T was set to 40,000 pixel square.
Fig. 4. SVM uses hyperplane margin to separate positive from negative classes.
, y ), where h
is the hue and y {+1, 1} indicates the
vectors (h
i
i
i
i
class label. The classication of biscuit samples can be considered
y using
as the task of determining a classication function f : h
i
i
training data. Subsequently, the classication function f is used to
) > 0, the input vector h
classify the unseen test data set. If f (h
i
i
is assigned to the class yi = +1, otherwise class yi = 1. This technique can be extended to classication involving more than two
groups using SVM algorithm such as the Directed Acyclic Graph
(Platt et al., 2000). Essentially, this algorithm works by rstly collecting the data from each classier, and secondly, assembling these
data to form a graph or a tree comprising of several nodes with each
node representing result from each binary classier. Therefore, it is
theoretically plausible to perform more than 2-class classication
by expanding and adding more nodes to the tree. The details are
described in Section 2.7.
For the linearly separable training vectors, the classication
function f has the following form:
+ b)
) = sgn(w
Th
f (h
i
(3)
i = 1, . . . , l
(4)
(5)
and
) = exp
,h
k(h
i
j
h
||2
||h
i
j
2 2
(6)
= sgn
f (h)
1
2
3
4
, h)
+b
i yi k(h
i
(7)
151
1. Under-baked
2. Moderately baked
3. Over-baked
4. Substantially over-baked
1vs4
not 1 not 4
i=1
2
3
4
l
i=1
1
,h
)
yi yj k(h
i
j
i j
2
l
not 2
3
4
1
2
3
2vs4
not 4
2
3
3vs4
1vs3
not 3
not 1
1
2
2vs3
1vs2
(8)
i=1 j=1
Fig. 5. The acyclic graph for 4-group classication via DAG strategy. Here 1 indicates under-baked, 2 moderately baked, 3 over-baked and 4 substantially
over-baked. The abbreviation vs stands for versus.
yi i = 0
(9)
i=1
152
Grab 2
Grab 1
Processing 1
Task 1
Thread 1
Task 2
Task 3
Thread 2
Thread 3
Frame
grabber
Buffer 1
Processing 1
Camera
Buffer n-1
Processing n-1
Buffer n
Processing n
Fig. 6. Block diagram of the multiple-buffering strategy for real-time grabbing and
image processing.
Grab n
Processing 2
Task 4
Thread 4
Processing n
Task 1
Thread 1
Task 2
Task 3
Thread 2
Thread 3
Fig. 7. Structure of queuing tasks of the inspection system and with four SVMs threads.
Task 4
Thread 4
153
Start
Grab image
3.1. Colour inspection
If no. of
object 1
No
Yes
Master thread crops the
grabbed image into sub-images
Master thread forks several
threads one for each object
Each thread picks a task and
processes the sub-image
Each thread writes result into
memory
Free buffer
No
Stop
grading
Yes
End
post-processing like dimensionality reduction and object recognition. Results are assembled by the master thread and displayed on
the monitor screen or written into a text le if necessary. After
completion of the image inspection task, the master thread frees
all buffers and the threads. Then, it enters a stand-by mode and
ready to process next image. The owchart in Fig. 8 summarises
154
Fig. 9. Segmented biscuits and their centres of gravity corresponding to image in Fig. 1: (a) non-touching biscuits and (b) touching biscuits. Here a(i) and b(i) are edge images
after auto thresholding; b(ii) is the edge image after watershed-based segmentation; a(ii) and b(iii) are the centres of gravity of a(i) and b(ii), respectively.
(10)
155
Fig. 10. Hue distributions of four different groups of biscuits averaged over 50 samples for each group category.
Table 1
Real time classication results of independent test samples corresponding to different conveyor speeds using SVM-R classier with Wilks method.
Conveyor speeds
Classication results
Under-baked
10 m/min
9 m/min
8 m/min
Moderately baked
94%
96%
96%
98%
98%
98%
Over-baked
Substantially over-baked
90%
88%
90%
Average accuracy
100%
100%
100%
95.5%
95.5%
96%
Table 2
Total processing time of non-touching biscuits comparing sequential and parallel processing for different classiers.
Classiers Sequential processing
Parallel processing
Wilks method
Direct method
Wilks method
Direct method
No. of samples Processing time (ms) No. of samples Processing time (ms) No. of samples Processing time (ms) No. of samples Processing time (ms)
SVM-R
SVM-P
DA
4
4
4
29.44
29.51
24.14
4
4
4
28.26
28.19
24.10
Functions 1 and 2 in this gure refer to the canonical discriminant functions derived from the canonical correlation analysis
which were used to examine the relationship between the variables
(Morison, 2005).
This graph clearly demonstrates the formation of four major
groups. It shows the existence of the hyperplane which strongly
4
4
4
9.68
9.70
8.87
4
4
4
9.34
9.30
8.25
Table 3
Total processing time of touching biscuits comparing sequential and parallel processing for different classiers.
Classiers Sequential processing
Parallel processing
Wilks method
Direct method
Wilks method
Direct method
No. of samples Processing time (ms) No. of samples Processing time (ms) No. of samples Processing time (ms) No. of samples Processing time (ms)
SVM-R
SVM-P
DA
4
4
4
62.44
62.48
58.28
4
4
4
61.35
61.30
58.22
4
4
4
36.70
36.86
36.20
4
4
4
36.50
36.43
35.93
156
Fig. 11. Discrimination separations by four biscuit groups produced by using Wilks
method. Data are averaged from 50 samples of each group.
Fig. 12. Classication results of training samples comparing SVM and DA classiers
by using Wilks and direct methods.
Fig. 13. Classication results of independent test samples comparing SVM and DA
classiers by using Wilks and direct methods.
4. Conclusion
Quality evaluation of bakery products has a major role in food
industry. In this study a colour-based inspection system has been
proposed and shown to have a good potential to classify biscuit
samples using SVM and DA classiers. Results from this study indicate that SVM generally performs better than DA for both direct
and Wilks classications. It was discovered that the SVM-R
after Wilks resulted in correct classication of 96.5% which is
the highest compared to other classiers. Parallel processing was
implemented based on Matroxs multiple-buffering technique and
multithreading programming. These features combined provide
an efcient communication scheme, resulting in the increased in
image processing speedups by a factor of 3. There was no noticeable change in the accuracy when the system was used to inspect
moving biscuits. Like the stationary case, the highest classication
157
was recorded by SVM-R at a speed of 10 m/min. This articial classier has a potential for use in routine inspection of biscuits and other
bakery products. This articial classier has a potential to increase
inspection speeds beyond human operators when implemented on
a multi-core processor. It is suitable for use in high volume production like biscuit processing considered in this example.
Acknowledgements
This work has been supported by the Universiti Sains Malaysia
Research University Grant 814012. The authors also would like to
acknowledge partial support of this research through the AUN-Seed
Net Program 449/USM/2009.
References
Abdullah, M.Z., Guan, L.C., Mohd-Azemi, B.M.N., 2001. Stepwise discriminant analysis for colour grading of oil palm using machine vision system. Transactions of
IChemE 79 (C), 223231.
Abdullah, M.Z., Guan, L.C., Mohamed, A.M.D., Noor, M.A.M., 2002. Colour vision
system for ripeness inspection of oil palm elaeis guineensis. Journal of Food
Processing and Preservation 26 (3), 213235.
Abdullah, M.Z., Rahman, A.S.A., Shakaff, A.Y.M., Noor, A.M., 2004. Discrimination
and classication of Eurycoma longifolia Jack in medical food by means of a
DSP-based electronic taste sensor. Transactions of the Institute of Measurement
and Control 26 (1), 1939.
Abdullah, M.Z., 2008. Quality evaluation of bakery products. In: Sun, D.-W. (Ed.),
Computer Vision Technology for Food Quality Evaluation. Elsevier, London, pp.
481522.
Ach, R., Luth, N., Techmer, A., 2008. Real-time detection of trafc signs on a multicore processor. In: Proceedings of the IEEE Intelligent Vehicles Symposium,
Eindhoven, The Netherlands, pp. 307312.
Adankon, M.M., Cheriet, M., 2009. Model selection for the LS-SVM application to
handwriting recognition. Pattern Recognition 42 (12), 32643270.
Blasco, J., Aleixos, N., Molt?, E., 2007. Computer vision detection of peel defects in
citrus by means of a region oriented segmentation algorithm. Journal of Food
Engineering 81 (3), 535543.
Camastra, F., Vinciarelli, A. (Eds.), 2008. Machine Learning for Audio Image and Video
Analysis Theory and Applications. SpringerVerlag, London.
Carter, R.M., Yan, Y., Tomlins, K., 2006. Digital imaging based classication and
authentication of granular food products. Measurement Science and Technology
17 (2), 235240.
Chen, X., Xun, Y., Li, W., Zhang, J., 2009. Combining discriminant analysis and neural
networks for corn variety identication. Computers and Electronics in Agriculture 71 (1), S48S53.
Chen, K., Sun, X., Qin, Ch., Tang, X., 2010. Colour grading of beef fat by using computer
vision and support vector machine. Computers and Electronics in Agriculture 70
(1), 2732.
Cortes, C., Vapnik, V., 1995. Support-vector network. Machine Learning 20 (3),
273297.
Gonzalez, R.C., Wintz, P.A. (Eds.), 1987. Digital Image Processing. Addison-Wesley,
Reading, MA, USA.
Hornberg, A. (Ed.), 2006. Handbook of machine vision. Wiley-VCH Verlag GmbH &
Co. KGaA, Germany.
Karimi, Y., Prasher, S.O., Patel, R.M., Kim, S.H., 2006. Application of support vector
machine technology for weed and nitrogen stress detection in corn. Computers
and Electronics in Agriculture 51 (12), 99109.
Kim, J.-Y., Oh, S.-J., Lee, S.-J., Kim, M.-S., Oh, J.-W., Yoo, H.-J., 2010. An attention
controlled multi-core architecture for energy efcient object recognition. Signal
Processing: Image Communication 25 (5), 363376.
Kyo, S., Okazaki, S., Koga, T., Hidano, F., 2008. A 100 GOPS in-vehicle vision processor
for pre-crash safety systems based on ring connected 128 4-way VLIW processing elements. In: Proceedings of the IEEE Symposium on VLSI Circuits, Hawaii,
USA, pp. 2829.
Moore, C.A. (Ed.), 1991. Automation in the Food Industry. Glasgow, Blackie, New
York.
Morison, D.F. (Ed.), 2005. Multivariate Statistical Methods. Thomson Brooks, California.
Nashat, S., Abdullah, M.Z., 2010. Multi-class colour inspection of baked foods featuring support vector machine and Wilks analysis. Journal of Food Engineering
101 (4), 370380.
Otsu, N., 1979. A threshold selection method from gray-level histograms. IEEE Transactions on Systems Man and Cybernetics 9 (1), 6266.
Paradkar, M.M., Sivakesra, S., Irudayaraj, J., 2002. Discrimination and classication of
adulterants in marple syrups with the use of infrared spectroscopic techniques.
Journal of Science of Food and Agriculture 83 (7), 714721.
Platt, J.C., 1999. Fast training of support vector machines using sequential minimal optimisation. In: Schkopf, B., Burges, C.J.C., Smola, A.J. (Eds.), Advances in
Kernel Methods: Support Vector Learning. MIT Press, Cambridge, MA, pp. 185
208.
158
Platt, J.C., Christiani, N., Shawe-Taylor, J., 2000. Large margin DAGs for multiclass
classication. Advances in Neural Information Processing Systems, vol. 12. MIT
Press, Cambridge, pp. 547553.
Rencher, A.C. (Ed.), 2002. Methods of Multivariate Analysis. John Wiley & Sons,
Canada.
Smith, M.A., Nakai, S., 1990. Classication of cheese varieties by multivariate analysis
of HPLC proles. Canadian Institute of Food Science and Technology Journal 23
(1), 5358.
Sobel, I.E., 1970. Camera Models and Machine Perception, AIM-21. Stanford Articial
Intelligence Lab, Palo Alto, USA.
Tao, Y., Heinemann, P.H., Varghese, Z., Morrow, C.T., Sommer, H.J., 1995. Machine
vision for colour inspection of potatoes and apples. Transactions of the American
Society of Agricultural Engineers 38 (5), 15551561.
Vapnik, V. (Ed.), 1998. Statistical Learning Theory. John Wiley & Sons, New York.
Vincent, L., Soille, P., 1991. Watersheds in digital spaces an efcient algorithm based
on immersion simulations. IEEE Transactions on Pattern Analysis and Machine
Intelligence 13 (6), 583598.
Zhang, Q., Chen, Y., Zhang, Y., Xu, Y., 2008. SIFT implementation and optimisation
for multi-core systems. In: Proceedings of the IEEE International Symposium on
Parallel and Distributed Processing IPDPS, FL, USA, pp. 18.
Zhao, J., Yang, Y.M., Li, G., 2009. Real-time image processing system based on
multi-core processor. In: Proceedings of the IEEE 3rd International Symposium
on Intelligent Information Technology Application IITA, Nanchang, China, pp.
329332.