Sei sulla pagina 1di 9

Journal of Cereal Science 88 (2019) 87–95

Contents lists available at ScienceDirect

Journal of Cereal Science


journal homepage: www.elsevier.com/locate/jcs

Colored rice quality inspection system using machine vision T


Shumian Chen, Juntao Xiong , Wentao Guo, Rongbin Bu, Zhenhui Zheng, Yunqi Chen,

Zhengang Yang, Rui Lin


College of Mathematics and Informatics, South China Agricultural University, Guangzhou, 510642, China

ARTICLE INFO ABSTRACT

Keywords: The machine vision-based quality evaluation of colored rice is an important component of achieving automatic
Colored rice rice production and processing. This study took red indica rice as the research object and developed a machine
Machine vision vision system for inspecting flawed rice kernels that are broken, chalky, damaged or spotted. Near infrared
Defect detection images of colored rice samples were collected by the machine vision system. A support vector machine (SVM)
Quality grading
classifier, with the input of the invariant moment ellipse major axis, was applied to identify the broken rice
kernels in the images. Then, the head rice images were obtained, and another SVM performed the gray-level
segmentation. The segmented areas were doubly examined using the centroid distance constraint and the pixel
search positioning method, which allowed the chalky areas to be accurately extracted. Finally, the damaged and
the spotted areas on the rice kernels were detected by using edge detection and morphological methods. The
experimental results show that the recognition accuracy for broken kernels, chalkiness, and damaged and
spotted areas reached 99.3%, 96.3% and 93.6%, respectively. In addition, the average running time of the
proposed method was 0.15 s, with four types of defects detected at one-time. Hence, it was concluded that the
proposed method has significant potential to be applied for rapid and accurate colored rice quality detection and
to provide technical support for the machine vision-based inspection of the automated grading of rice.

1. Introduction expert vision-based system to extract the color and shape characteristics
of rice and set a series of thresholds to detect broken, chalky, red
Rice (Oryza sativa L.) is one of the most important food crops spotted and black spotted rice kernels. Kaur and Singh (2013) used a
worldwide, and more than one third of the world's population considers multi-SVM (Multi-Class Support Vector Machine) to identify the chalky
it as their staple food. The market value of rice is greatly influenced by and broken kernels; however, the identification accuracy was not high,
the quality of its appearance and can be increased by quality grading. which only reached 86%. Zareiforoush et al. (2015) calculated the
The existing rice grading methods mainly depend on naked eye in- degree of milling (DOM) and percentage of broken kernels (PBK) by
spections, which are time-consuming and subjective, and the classifi- using gray-gradient co-occurrence matrices and kernel length features,
cation results are highly susceptible to the experience and state of the respectively, and the rice quality grade was output based on fuzzy logic.
operators. Machine vision could be a faster and more objective method Nevertheless, noise from the illumination system and the non-uni-
to determine rice quality, which could greatly assist humans in con- formity of kernels’ whiteness had great influences on the accuracy of
trolling the detection results and making them more reasonable. the algorithm, and the robustness of the algorithm has not yet been
Some current studies use machine vision to detect the quality of the verified.
appearance of rice. Wan et al. (2002) designed an automatic inspection These studies could detect multiple defects of rice, but the accuracy
system to quickly classify rice quality by extracting shape contours, for the different quality categories exhibited great differences.
colors and backlighting features. The test results showed that the Therefore, some studies focused on exploring inspection methods that
overall accuracy rate was 90.6%, but the recognition accuracies for the could more precisely detect one specific kind of defect. Yoshioka et al.
different quality categories greatly differed, and for some quality ca- (2007) proposed two methods, the chalkiness curve method and the
tegories, such as immature, cracked, off-type, damaged and broken, the portioning method, to calculate the degree and location of chalkiness,
detection accuracy was quite low. Payman et al. (2018) developed an respectively. The performance of two algorithms were analyzed and


Corresponding author.
E-mail addresses: 1035388024@qq.com (S. Chen), xiongjt2340@163.com (J. Xiong), 943696151@qq.com (W. Guo), boroby@stu.scau.edu.cn (R. Bu),
3424548943@qq.com (Z. Zheng), 601884968@qq.com (Y. Chen), 21818543@qq.com (Z. Yang), limyui@stu.scau.edu.cn (R. Lin).

https://doi.org/10.1016/j.jcs.2019.05.010
Received 30 January 2019; Received in revised form 17 May 2019; Accepted 20 May 2019
Available online 21 May 2019
0733-5210/ © 2019 Elsevier Ltd. All rights reserved.
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

Fig. 1. Layout of the image acquisition system: (a) Composition of the experimental devices, and (b) Environment of image acquisition.

compared, and the test results showed that the overall classification method for colored rice based on near infrared images. A machine vi-
accuracy of the chalkiness curve method and the portioning method sion system was designed for image acquisition and defect detection. A
were 85.4% and 90.2%, respectively. These proposed methods could detection method was developed using image processing techniques to
accurately recognize rice kernels with different locations and degrees of identify the defective areas. This study aims to realize rapid and ac-
chalkiness, but the accuracy for highly similar degrees of chalkiness curate quality detection of colored rice. The contribution of this work is
needed to be improved. Sun et al. (2014) proposed a convex point to provide referential and technical support for the quick quality
matching method to separate adherent rice kernels and used an SVM grading of colored rice on the sorting lines.
(Support Vector Machine) to calculate the location and degree of
chalkiness to determine the type of rice chalkiness. The proposed 2. Materials and methods
method had wider applications compared to the methods proposed by
Yoshioka et al. (2007). Adherent rice kernels could generally be sepa- 2.1. Vision inspection system
rated using morphological or curvature methods (Lin et al., 2014;
Shatadal et al., 1995; Wang and Paliwal, 2006), while broken rice could A vision inspection system consisting of a computer and an image
be distinguished from head rice using the geometric features of the rice, acquisition system was designed in this study. The image acquisition
such as the aspect ratio, perimeter, area and minimum enclosing rec- system includes a CCD (Charge-coupled Device) camera (Microvision
tangle. After classification, the rice quality grade and adulteration CO., Ltd., China; type: MV-300SC), a near infrared back light (LOTS
content could be determined with a recognition accuracy of over 99% Automation Technology Co., Ltd., China; type: LTS-2FT8080-IR850)
(Aggarwal and Mohan, 2010; Chen et al., 2012; Dalen, 2004). The and a power unit (Youshitai Electronics CO., Ltd., China; type: UST-
fissures of rice grains could be detected by combining image enhance- AP2U2CHT-24/500). The resolution of the colored rice images that are
ment and edge detection, but the detection accuracies had great dif- captured by the CCD camera is 1736 × 1532 pixels, the size of near
ferences for different sizes of rice grains (Lan et al., 2002). Furthermore, infrared back light is 94 × 94 × 17 mm and the peak wavelength of the
color features, geometric features and texture features were also widely near-infrared light can be adjusted from 850 nm to 940 nm. A mesh grid
used in studies on the detection of the rice milling degree, the calcu- with 7 × 7 unit grids was made by a 3D printer. The size of this grid is
lation of the percentage of filled rice grains and the identification of rice customized as 6 cm × 6 cm in order to adapt to the size of the near
varieties (Duan et al., 2011; Liu et al., 2016; Sakai et al., 1996; Wan and infrared backlight and the effective field of view of the camera. The
Long, 2011; Zareiforoush et al., 2016). mesh grid is used to avoid grain adhesion during image collection so
In summary, there are few systematic studies on rice quality de- that it can reduce the influence of the captured images on the algo-
tection. Actually, most of these studies concentrate on classifying par- rithm. The layout of the image acquisition system is shown as Fig. 1.
tial quality categories because it is difficult to achieve the compre- The computer controls the image acquisition system that collects the
hensive detection of rice quality due to the large number of quality colored rice images and subsequently processes these images.
categories. In some of these systematic studies, the classification ac- As a variety of colored rice, red indica rice was selected to be the
curacy often differs greatly for different kinds of defects. Furthermore, research object in this study. The red rice samples, which were pro-
specific studies that focused on certain quality categories may show duced in Bama, Guangxi, China, were collected in October 2018, and
relatively poor viability in practical applications. When determining the include broken kernels, chalky kernels, damaged kernels, spotted ker-
quality grades, it is necessary to comprehensively consider the existence nels and intact kernels, as shown in Fig. 2a–e. The images of the rice
and degree of different defects, and thus these methods may be difficult samples under near infrared light are shown in Fig. 2f–j.
to apply. Moreover, the real-time performance have not yet been tested
in most quality detection studies, and we think that this should be a
critical research issue for an efficient algorithm. 2.2. Visual detection method
Meanwhile, the research objects of current rice quality inspection
studies mainly focus on white rice, but they rarely focus on colored rice. After collecting an image, we first used the bicubic interpolation
Colored rice is an important special rice germplasm resource. Because method to reduce the size of the original gray image to 434 × 383 and
of its special medicinal value and higher nutritional value than ordinary 868 × 766. The 434 × 383 gray image was used to detect broken rice
white rice, colored rice has good economic value in the agricultural and chalkiness, while the 868 × 766 gray image was used to identify
products market (Itani et al., 2002; Ling et al., 2001; Toyokuni et al., the damaged and spotted areas. Then, the preprocessing of the red rice
2002; Xia et al., 2003; Yang et al., 1998). Since the pigment remains on near-infrared images was carried out. The median filter was used to
the epidermis of the colored rice, it is difficult to detect some defects of smooth the images, and the OTSU algorithm (Otsu, 2007) was used to
colored rice, such as its chalkiness and color spots, using general vision remove the background. Then, the invariant moment ellipses of the rice
inspection methods. Therefore, this study proposed a quality detection kernels were fit, and the major axis lengths of the ellipses were calcu-
lated. Based on this feature, broken kernels were identified using a

88
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

Fig. 2. Quality categories of red indica rice and the


near-infrared images of the rice samples: (a) Broken,
(b) Chalky, (c) Intact, (d) Damaged, (e) Spotted, (f)
Broken kernels, (g) Chalky kernels, (h) Intact kernels,
(i) Damaged kernels, and (j) Spotted kernels. (For
interpretation of the references to colour in this
figure legend, the reader is referred to the web ver-
sion of this article.)

trained SVM model (Cortes and Vapnik, 1995). Using image subtrac- et al., 2002; Yoshioka et al., 2007). Compared with white light, near
tion, the head rice image was obtained. Subsequently, the gray-level infrared light has stronger penetrating power for rice grains. Near in-
segmentation was performed by a second SVM classifier for the head frared light can enhance the partial chalky areas that are indiscernible
rice image. Some segmented areas were determined as being chalky under white light, making it possible to acquire more accurate and
after being doubly examined using the centroid distance constraint and objective detection results.
the pixel search positioning algorithm. Finally, Sobel edge detection As Fig. 2g-h shows, compared with normal areas, chalky areas have
and morphological processing were mainly applied to detect the da- lower brightness because of the poorer penetrability of near infrared
maged and spotted areas of the rice kernels. The specific flowchart of light. The brightness of the chalky areas changes within a certain range,
our method is shown in Fig. 3a. which is positively related to the looseness of the chalkiness. Based on
this characteristic, the gray values of the pixels in the head rice images
2.2.1. Broken kernels identification were extracted to train the SVM. The SVM performed the image seg-
As reported in some related studies, multiple geometric features mentation to roughly separate the chalky areas.
were often extracted to distinguish the broken kernels from the head Fig. 4a shows the gray value distribution of 8000 training samples,
rice (Aggarwal and Mohan, 2010; Chen et al., 2012; Dalen, 2004; including chalky area pixels and normal area pixels, and Fig. 4b is a
Zareiforoush et al., 2016). These geometric features mainly include the gray value boxplot of the training samples. It can be seen from Fig. 4
grain size, aspect ratio, perimeter, area and so on. Since the object of that the gray values of the chalky areas range from 59 to 110 and are
this study, red indica rice, is a single rice variety, we found that the concentrated in 79–98. Meanwhile, the gray values of the normal areas
width of the rice with different length is within the same range, which are greater, ranging from 108 to 145 and being concentrated in
may be an invalid feature to characterize broken rice. Additionally, the 119–125. The brightness distribution of these two classes have different
perimeter and area are related to the grain length. That is, the longer ranges and few overlaps, and so using the SVM to classify pixels can
the grain is, the larger its perimeter and area are. Hence, the perimeter separate candidate chalky areas, as shown in Fig. 3f.
or area may be redundant for identifying broken red rice kernels. For The image after SVM segmentation mainly included the candidate
this reason, in order to reduce the complexity of the model and accel- chalky areas and non-object areas. To accurately extract the chalky
erate the algorithm, we selected the grain length to identify broken areas, it was necessary to remove the embryo and embryo-aleurone
kernels. layer connection areas. According to the structure of rice grains and the
Because rice grain contours approximate an ellipse, this study pro- definition of chalkiness in botany, we know that chalky tissue forms in
posed a grain length estimation method to identify broken kernels. the endosperm, while the embryo and the aleurone layer are located in
First, the binary image of the rice grain was extracted using the OTSU another part of the rice grain. However, under near infrared light, the
method, and the equivalent ellipses based on the second order central embryo and embryo-aleurone layer connection areas are also darker
moments of the rice grains were fit, as shown in Fig. 3c. The second than most normal areas, thus causing confusion when detecting
order central moment represents the degree that a random variable chalkiness. To solve this problem, this study proposed a method based
fluctuates around the mean. For mechanical motion, it is regarded as on the centroid distance constraint and the pixel search positioning
the rotational inertia with the centroid being the axis of rotation. Ac- algorithm. For an image after SVM segmentation, a centroid distance
cordingly, it can form an ellipse with constant emissivity that is cen- constraint was applied to screen the embryos, and then the pixel search
tered on the region centroid. An equivalent ellipse has the advantages positioning algorithm was used to remove the embryo-aleurone layer
of translation invariance and rotation invariance. Therefore, this study connection areas.
also used the equivalent ellipse based on the second order central The algorithm of the centroid distance constraint is described as
moment to the ‘invariant moment ellipse’. The major axis length of the follows.
invariant moment ellipse could estimate the grain length. Therefore,
the major axis lengths were calculated to train the SVM. The detection Step 1 Let the number of candidate chalky areas be n, and calculate the
results of broken kernels are shown in Fig. 3d, in which the recognized centroid set C1 (xi , yi ) of each candidate chalky area and their
broken kernels were marked by rectangles, labeled with their length corresponding grain centroid set C2 (xj , yj ) (i = j = 1,2, …, n) .
and numbered in the original image. Step 2 Use the Euclidean distance formula, which is shown as follows,
to calculate the centroid distance of each element in set C1 and
the corresponding element in set C2 .
2.2.2. Chalkiness extraction
In related studies, white light illumination was often used to em-
distance = (x i xj )2 + (yi yj ) 2 (1)
phasize the chalky areas (Jinorose et al., 2010; Sun et al., 2014; Wan

89
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

Fig. 3. Flowchart, specific process and detection


results of color rice quality detection algorithm:
(a) Flowchart of the colored rice quality detection
algorithm; (b–d) Broken kernels recognition: (b)
Otsu segmentation, (c) Invariant moment ellipses
of rice grains, and (d) Results of broken kernels
identification; (e–j) Chalkiness detection: (e) Head
rice image, (f) SVM segmentation, (g) Small areas
removal, (h) After centroid distance constraint, (i)
After pixel search positioning, and (j) Results of
chalkiness detection; and (k–p) Detection of da-
maged and spotted areas: (k) Sobel edge detection,
(l) Grain contour, (m) Inner edge information, (n)
Morphological operations, (o) Small areas re-
moval, and (p) Results of defect detection. (For
interpretation of the references to colour in this
figure legend, the reader is referred to the web
version of this article.)

90
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

Fig. 4. Gray value feature analysis and centroid distance constraint: (a) Gray value distribution of samples, (b) Gray value boxplot of the training samples, and (c)
Graphic description of the centroid distance set.

Step 3 Divide the embryos and chalky areas by removing the areas with 2.2.3. Detection of damaged and spotted areas
a distance greater than 12 pixels. Since the shape of the damaged and the spotted areas were similar
under near infrared light, the same process was performed to detect
A graphic description of the distance set is shown in Fig. 4c, where them in the images. The Sobel gradient operator was used to detect the
the gray points represent the candidate chalky areas that are segmented edges in gray images, which simultaneously extracted the grain con-
by the SVM. The result after the centroid distance constraint is shown in tours and the edges of inner defects, as shown in Fig. 3k. To obtain the
Fig. 3h, from which we can see that the centroid distance constraint can inner defects, the grain contours should be removed. Thereupon, the
effectively remove the embryo areas. Since the embryo-aleurone layer Otsu segmentation results were used to detect and dilate the edges of
connection areas can satisfy the centroid distance constraint, it needs to grain contours, as shown in Fig. 3l. Then, the dilated grain contours
further locate the chalky areas using the pixel search positioning al- were subtracted from the edge detection results, and the obtained inner
gorithm. defects were shown in Fig. 3(m). Subsequently, in order to increase the
The pixel search positioning algorithm is given as follows. On the recognition area of defects, the dilation and close operations were
basis of the centroid distance constraint results, a 3 × 3 pixel neigh- successively applied to the extracted inner defects, as shown in Fig. 3n.
borhood is defined for each element in the grain centroid set C2 , and we At last small noises were filtered and pixels of broken and chalky areas
extract the values of the center pixel and its eight neighboring pixels to were removed. This study takes the structuring element ‘disk’ in all the
form a pixel matrix of C2 (xj , yj ) , which is given as follows. morphological operations, of which the radii for the grain contour di-
lation, inner defects dilation and close operation were 2, 1, and 2, re-
v1 v2 v3
spectively. The detected damaged and spotted areas were shown in
PixelValue = v4 C2 (x j , yj ) v6 Fig. 3(o). And the defective kernels were marked with blue rectangles
v7 v8 v9 (2) and scattered points in the original image, as shown in Fig. 3(p).
The class label flag for each candidate chalky area is given by the
following logic rules. For an arbitrary element in the PixelValue matrix 2.3. Model parameters setting
with a nonzero value, set flag = 1, and otherwise set flag = 0 .
Afterwards, the areas with flag = 0 are removed and the areas with Two SVM models, the broken kernels identification model and the
flag = 1 remain as the chalky areas. chalkiness segmentation model, were trained in this study. The selected
The result after using the pixel search positioning algorithm is training features of them are the major axis length of the invariant
shown in Fig. 3i, and the detected chalky areas are marked with red moment ellipse and the pixel gray value, respectively. The sample data
rectangles and numbered, as shown in Fig. 3j. were provided by an image acquisition experiment. The LIBSVM

91
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

Fig. 5. Linear fitting models and cases of incorrect detection: (a–c) Linear fitting model of different defect detection, (d–f) Results of broken kernels identification,
(g–i) Results of chalkiness detection, and (j–l) Results of damaged and spotted areas detection.

92
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

toolbox (Chang and Lin, 2011) was utilized for the training and pre- experiments were conducted to detect 50 mixed rice images in batches.
diction of the SVM model. In the LIBSVM toolbox, the available kernel The algorithm development software was MATLAB R2015a using a
functions include the linear, polynomial, RBF and sigmoid functions. computer containing an i7-8700 CPU with a clock speed of 3.20 GHz, a
Therefore, we mainly tested the K-CV accuracy of these four kernel GeForce GTX 1080 graphics card with 8 GB of memory, and the 64-bit
functions to determine the best kernel function. For the selection of the Windows 10 operating system. In this environment, each of the 50
SVM parameters, namely, the penalty parameter c and kernel para- mixed rice images would be detected repeatedly over 100, 200, 300,
meter g, we applied the grid search algorithm that assigned c and g 400, 500, and 600 iterations, respectively. The total running time of the
values within the range of 2-10 to 210, and then searched the optimal c algorithm was calculated, and the average running time for an image
and g. For each pair of c and g, the classification accuracy was calcu- was 0.15 s. This result demonstrates the viability of our method, which
lated using the K-Cross Validation method, and then the (c, g) pair with meets the requirements for the rapid quality detection of colored rice.
the highest accuracy is selected as the optimal parameters of the SVM
model. K was set as 10 in this study. A linear kernel with c = 1 was 3.3. Accuracy evaluation
selected as the parameters in the broken kernels identification model. In
addition, an RBF kernel with c = 128 and g = 0.03 were set as the Two recognition experiments, a linear fitting test and an accuracy
parameters of the chalkiness segmentation model. test, were designed to evaluate the detection of the proposed algorithm.
The performance of the algorithm was evaluated by analyzing the se-
3. Experimental design and results analysis parate detection results for broken kernels, chalky areas, damaged areas
and spotted areas. The linear fitting experiment was carried out to fit
3.1. Image acquisition linear equations to compare the detection results between the algorithm
and a human expert. The correlation coefficient R 2 (0 R2 1) reveals
The image acquisition experiment was designed to provide a data the relevance between the predicted value and the actual value. The
set for verifying the accuracy of our proposed method. There were 25 closer R 2 is to 1, the more reliable the algorithm is. The accuracy ex-
groups of mixed rice (including head rice and broken rice) and 50 periment assessed the confusion matrices according to the detection
groups of head rice that were prepared for the image acquisition, of results of different defects to verify the accuracy of the proposed al-
which each group of red rice samples contained 45 grains, which is the gorithm. In total, 150 images were used in the linear fitting test, and the
maximum capacity of grains in the effective field of view. The image accuracy experiment determined the confusion matrices on the test sets
acquisition method was as follows. A 7 × 7 mesh grid, as shown in that were allocated in section 3.1.
Fig. 1b, was placed upon the object plate of the near infrared back light.
Then, a grain of red indica rice was put into each grid (except for the 3.3.1. Recognition of broken kernels
four vertices because these areas are not within the effective field of Using the major axis length of the invariant moment ellipse for the
view), and the red rice images were captured in the image acquisition estimation of the grain length, the broken kernels could be accurately
box. The above steps were repeated twice for each group of samples identified. Fig. 5a shows the comparison of the broken kernels detection
with a total of 150 red rice images being collected, including 50 mixed results for manual counting and the proposed algorithm. The x-axis
rice images and 100 head rice images. The head rice images were used represents the actual number of broken kernels that were detected by
to train the chalkiness segmentation model and verify its accuracy, manual counting and the y-axis represents the estimated number of
while the mixed rice images were used to obtain the broken kernels broken kernels that were detected by the proposed algorithm. The fit
identification model and test the performance of the entire proposed linear equation was y = 0.86x + 0.29, and the correlation coefficient
algorithm. The allocation of the training sets and the testing sets are as was R 2= 0.95. The fit R 2 indicates a strong correlation between the
follows. The training set of the broken kernels identification model estimated value and the actual value. The confusion matrix of the
included the first 35 mixed rice images, and the remaining 15 images broken kernels identification is shown in Table 1, in which the Accu-
were used as the testing set. The training set of the chalkiness seg- racy, Recall and Precision are calculated by the following formulas.
mentation model included the first 80 head rice images, and the re- Recall = TP /(TP + FN ) (3)
maining 20 head rice images and 50 mixed rice images were used to-
gether as the training set. The algorithm for damaged and spotted Precision = TP /(TP + FP ) (4)
kernels detection did not need training, and so a total of 150 rice images
Accuracy = (TP + TN )/(TP + TN + FP + FN ) (5)
were used as the testing set.
There were 675 rice grains that were detected in the broken kernels
3.2. Performance analysis of the detection algorithm detection experiment; 670 grains were correctly identified, and 5 grains
were misidentified. The recognition accuracy, the precision rate and the
To analyze the efficiency of the proposed algorithm, 6 groups of recall rate were 99.3%, 100% and 90.7%, respectively. Some

Table 1
Detection results and accuracy of different quality categories.
Actual class Number of actual class Correct identification Wrong identification Precision (%) Recall (%) Accuracy (%)

TP TN FP FN Ratea Confidence intervalb

Broken kernel 54 49 – – 5 100 90.7 99.3 [99.29, 99.31]


Head rice 621 – 621 0 –
Chalky area 797 724 – – 73- 94.4 90.8 96.3 [96.29, 96.31]
Non chalky area 2353 – 2310 43 –
Damaged and spotted area 1964 1680 – – 284 94.8 91.7 93.6 [93.59, 93.61]
Non damaged and spotted area 4786 – 4702 84 –

Overall 10575 2453 7633 127 362 96.4 91.1 96.4 [96.04, 96.76]

a
Rate: Accuracy rate of the algorithm on the test set.
b
Confidence interval: The confidence interval of accuracy rate at the confidence level of 95%.

93
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

recognition results are shown in Fig. 5d–f. The green rectangles show rectangle in Fig. 5k.
correct identifications while the pink rectangles show missed identifi- In summary, the proposed method for colored rice quality detection
cations. The reasons for the low recall rate is that the length of a few can effectively identify different defects with a few misidentifications
broken kernels are close to some head rice that are much shorter than and missed identifications. To solve the existing problems, we will
its normal size, resulting in incorrect identifications. For example, as perform the following measures to improve the algorithm. (1) We will
shown in Fig. 5d-e, the broken kernels within pink rectangles (with improve the image acquisition devices by adding front white lighting,
lengths of 32.86, 35.18 and 38.93, respectively) were very similar to acquire red indica rice images under different light sources and detect
the head rice within pink rectangles (with the length being 32.69) in different defects under certain light sources to reduce the interference
Fig. 5f. The SVM outputs the incorrect class labels when analyzing these among the different defect detection results. (2) We will apply deep
broken kernels. learning methods to include more classification features and then train
a more robust recognition network that can optimize the existing al-
3.3.2. Chalkiness recognition gorithm. For example, this approach would allow the damaged areas
Using SVM segmentation, the centroid distance constraint and pixel and the spots to be distinguished, and the accuracy of the algorithm
search positioning, the chalkiness of red indica rice can be accurately should be improved.
extracted. The fit linear equation for chalkiness detection was
y = 0.91x + 0.60 , and the R2 = 0.95. As shown in Table 1, among the 4. Conclusion
3150 grains, 3034 grains were correctly identified while 116 grains
were incorrectly identified, and the recognition accuracy, precision rate Machine vision is a key technology to achieve the intelligent rice
and recall rate were 96.3%, 94.4% and 90.8%, respectively. This result production. A machine vision-based quality detection method for co-
proves the validity of our detection method for chalky areas. Fig. 5g–i lored rice based on near infrared images was proposed in this study, and
shows some results of chalkiness detection in which red rectangles re- the experiments were designed to verify the validity and feasibility of
present the recognized chalky areas. There were some incorrect iden- the proposed method.
tifications that were caused by the following reasons. (1) A connected
area was sometimes formed by the embryo and its adjacent spotted (1) Taking red indica rice as the research object, a machine vision
area, and it could meet the conditions of the centroid distance con- system for colored rice was designed, and image experiments were
straint and pixel search positioning. As a result, these areas were carried out in this study. The proposed algorithm detected the
identified as chalky, which are shown as the No. 8 red rectangle in broken kernels, chalkiness, damaged areas and spotted areas with
Fig. 5g and the No. 2 red rectangle in Fig. 5i. (2) A very few intact an average running time of 0.15 s, which could achieve rapid
kernels with thicker pericarps had lower brightness under near infrared quality detection of colored rice.
light, which is shown as the No. 8 red rectangle in Fig. 5i and were (2) The correlation coefficients R2 of the fit linear equations were all
incorrectly identified as chalky. (3) Since only the chalkiness in head greater than 0.87, which shows that the prediction of the algorithm
rice could be detected, some of the broken rice that was previously is reliable. The accuracy of broken kernels identification, chalkiness
omitted were misidentified as chalky, which is shown as the No. 3 red detection and the damaged and spotted areas detection were
rectangle in Fig. 5h. The blue rectangles in Fig. 5g show some missed 99.3%, 96.3% and 93.6%, respectively. The overall accuracy of the
identification cases. The reasons for the low recall rate are as follows. algorithm reached 96.4% on average. The experimental results
(1) Some areas with low chalkiness have brightness that is similar to demonstrate the good recognition performance of the proposed
normal areas, thus making them easy to be misrecognized, as shown by algorithm.
the No. 1 blue rectangle in Fig. 5g. (2) The chalky area that was located
far from the center of the grain and near the edge was removed during In conclusion, a fusion of near infrared imaging and machine vision
the centroid distance constraint and pixel search positioning opera- is included in the proposed method for colored rice quality detection.
tions, as shown by the No. 2 blue rectangle in Fig. 5g. The method based on near infrared images that is proposed in this
paper can provide technical support for the rapid quality inspection of
3.3.3. Damaged and spotted areas detection colored rice on the sorting lines. At the same time, the near-infrared
The damaged and spotted areas were detected mainly using edge detection method can also be applied to the quality detection of white
detection and morphological methods. The fit linear equation for the rice, and it can also provide referential values for other crops, such as
detection was y = 0.92x 1.07 , and the R2 = 0.87 . The recognition ac- soybeans and corn. In future work, we will design a double-light vision
curacy, precision rate and recall rate were 93.6%, 94.8% and 91.7%, system, improve the algorithm using a combination of deep learning
respectively. As Fig. 5j-l shows, most of the damaged and spotted areas and image processing techniques, and finally realize the real-time
could be correctly detected. However, some broken kernels, embryos quality detection and grading of colored rice on the sorting lines.
and chalkiness were misidentified, which are shown as the No. 8, No.
12 and No. 17 blue rectangles in Fig. 5k and the No. 4 and No. 21 blue Conflicts of interest
rectangles in Fig. 5l. The results are caused by the missing recognition
of broken kernels and the incomplete segmentation of the chalkiness. The authors declare no conflict of interest.
The yellow rectangles in Fig. 5j-k shows the grains with damaged and
spotted areas that were not correctly detected, and the reasons are as Author contributions
follows. (1) The color of some defective areas was not obvious or the
gradient of the gray value around the defective areas slightly varied, Chen, S and Xiong, J conceived and designed the experiments;
especially the spots at the grain edge, thus making it difficult to extract Chen, S. and Guo, W. and Zheng, Z. performed the experiments and
their edge information, as shown by the No. 1, No. 2, No. 4, and No. 5 analyzed the data; Chen, S and Xiong, J. and Bu, R. and Yang, Z. and
yellow rectangles in Fig. 5j. (2) A few spots were so small that they were Chen, Y. and Lin, R. wrote the paper.
removed as noises during the morphological process, as shown by the
No. 3 yellow rectangle in Fig. 5j. (3) The overlap of a spotted area and Acknowledgments
chalky area was detected as being chalky, as shown by the No. 1 yellow
rectangle in Fig. 5k. (4) A small number of damaged and spotted areas This work is supported by the National Natural Science Foundation
were previously mistakenly recognized as chalky areas, resulting in the of China (Nos. 31201135, 31571568), the Natural Science Foundation
removal of the related defect information, as shown by the No. 2 yellow of Guangdong (No. 2018A030313330), Science and Technology Plan

94
S. Chen, et al. Journal of Cereal Science 88 (2019) 87–95

Project of Guangzhou (201802020032). The authors wish to thank the Payman, S.H., Bakhshipour, A., Zareiforoush, H., 2018. Development of an expert vision-
useful comments of the anonymous reviewers to this paper. based system for inspecting rice quality indices. Qual. Assur. Saf. Crop Foods 10 (1),
103–114.
Sakai, N., Yonekawa, S., Matsuzaki, A., 1996. Two-dimensional image analysis of the
References shape of rice and its application to separating varieties. J. Food Eng. 27 (4), 397–407.
Shatadal, P., Jayas, D.S., Bulley, N.R., 1995. Digital image analysis for software separa-
tion and classification of touching grains: I disconnect algorithm. Trans. ASAE (Am.
Aggarwal, A.K., Mohan, R., 2010. Aspect ratio analysis using image processing for rice
Soc. Agric. Eng.) 38 (2), 635–643.
grain quality. Int. J. Food Eng. 6 (5), 55–60.
Sun, C.M., Liu, T., Ji, C.X., Jiang, M., Tian, T., Guo, D.D., Wang, L.J., Chen, Y.Y., Liang,
Chang, C.C., Lin, C.J., 2011. LIBSVM: a library for support vector machines. ACM Trans.
X.M., 2014. Evaluation and analysis the chalkiness of connected rice kernels based on
Intell. Syst. Technol. 2 (3), 1–27. https://doi.org/10.1145/1961189.1961199.
image processing technology and support vector machine. J. Cereal Sci. 60 (2),
Chen, X., Ke, S., Wang, L., Xu, H., Chen, W., 2012. Classification of rice appearance
426–432.
quality based on LS-SVM using machine vision. Communications in Computer &
Toyokuni, S., Itani, T., Morimitsu, Y., et al., 2002. Protective effect of coloured rice over
Information Science 307, 104–109.
white rice on Fenton reaction -based renal lipid peroxidation in rats. Free Radic. Res.
Cortes, C., Vapnik, V., 1995. Support-vector networks. Mach. Learn. 20 (3), 273–297.
35, 583–592.
Dalen, G.V., 2004. Determination of the size distribution and percentage of broken ker-
Wan, P., Long, C.J., 2011. An inspection method of rice milling degree based on machine
nels of rice using flatbed scanning and image analysis. Food Res. Int. 37 (1), 51–58.
vision and gray-gradient Co-occurrence matrix. In: Proceedings of the Fourth IFIP TC
Duan, L.F., Yang, W.N., Bi, K., Chen, S.B., Luo, Q.M., Liu, Q.A., 2011. Fast discrimination
12 Conference on Computer and Computing Technologies in Agriculture. CN,
and counting of filled/unfilled rice spikelets based on bi-modal imaging. Comput.
Nanchang.
Electron. Agric. 75 (1), 196–203.
Wan, Y.N., Lin, C.M., Chiou, J.F., 2002. Rice quality classification using an automatic
Itani, T., Tamaki, M., Arai, E., Horino, T., 2002. Distribution of amylose, nitrogen, and
grain quality inspection system. Transactions of the Asae 45 (2), 379–387.
minerals in rice kernels with various characters. J. Agric. Food Chem. 50 (19),
Wang, W., Paliwal, J., 2006. Separation and identification of touching kernels and
5326–5332. https://doi.org/10.1021/jf020073x.
dockage components in digital images. Can. Biosyst. Eng. 48 (7), 1–7.
Jinorose, M., Prachayawarakorn, S., Soponronnarit, S., 2010. Development of a computer
Xia, M., Ling, W.H., Ma, J., Kitts, D.D., Zawistowski, J., 2003. Supplementation of diets
vision system and novel evaluation criteria to characterize color and appearance of
with the black rice pigment fraction attenuates atherosclerotic plaque formation in
rice. Dry. Technol. 28 (9), 1118–1124.
apolipoprotein E deficient mice. J. Nutr. 133 (3), 744–751. https://doi.org/10.1093/
Kaur, H., Singh, B., 2013. Classification and grading rice using multi-class SVM.
jn/133.3.744.
International Journal of Scientific and Research Publications 3 (4), 1–5.
Yang, X., Ye, Z.Q., Shi, C.H., Zhu, M.L., Graham, R.D., 1998. Genotypic differences in
Lan, Y., Fang, Q., Kocher, M.F., Hanna, M.A., 2002. Detection of fissures in rice grains
concentrations of iron, manganese, copper, and zinc in polished rice grains. J. Plant
using imaging enhancement. Int. J. Food Prop. 5 (1), 205–215.
Nutr. 21 (7), 1453–1462. https://doi.org/10.1080/01904169809365495.
Lin, P., Chen, Y.M., He, Y., Hu, G.W., 2014. A novel matching algorithm for splitting
Yoshioka, Y., Iwata, H., Tabata, M., Ninomiya, S., Ohsawa, R., 2007. Chalkiness in rice:
touching rice kernels based on contour curvature analysis. Comput. Electron. Agric.
potential for evaluation with image analysis. Crop Sci. 47 (5), 2113–2120.
109, 124–133.
Zareiforoush, H., Minaei, S., Alizadeh, M.R., Banakar, A., 2015. A hybrid intelligent ap-
Ling, W.H., Cheng, Q.X., Ma, J., et al., 2001. Red and black rice decrease atherosclerotic
proach based on computer vision and fuzzy logic for quality measurement of milled
plaque formation and increase antioxidant status in rabbits. J. Nutr. 131, 1421–1426.
rice. Measurement 66, 26–34.
Liu, T., Wu, W., Chen, W., Sun, C.M., Chen, C., Wang, R., Zhu, X.K., Guo, W.S., 2016. A
Zareiforoush, H., Minaei, S., Alizadeh, M.R., Banakar, A., 2016. Qualitative classification
shadow-based method to calculate the percentage of filled rice grains. Biosyst. Eng.
of milled rice grains using computer vision and metaheuristic techniques. Journal of
150, 79–88.
Food Science and Technology-Mysore 53 (1), 118–131.
Otsu, N., 2007. A threshold selection method from gray-level histograms. IEEE
Transactions on Systems, Man, and Cybernetics 9 (1), 62–66.

95

Potrebbero piacerti anche