基于机器视觉形状特征参数的祁门红茶等级识别

2018-11-23 07:27:48谢汉垒宁井铭张正竹
农业工程学报 2018年23期
关键词:茶样矩形形状

宋 彦,谢汉垒,宁井铭,张正竹



基于机器视觉形状特征参数的祁门红茶等级识别

宋 彦1,谢汉垒1,宁井铭2※,张正竹2

(1. 安徽农业大学工学院,合肥 230000;2. 安徽农业大学茶树生物学与资源利用国家重点实验室,合肥 230000)

外形是评价茶叶质量的重要指标之一,目前主要依赖人工审评的方法,客观、准确的评价外形指标对茶叶加工、销售有重要的意义。该研究提出了一种基于形状特征直方图结合支持向量机的茶叶等级识别方法。以7个等级的祁门工夫红茶为研究对象,构建图像采集系统,标定相机参数,采集各等级的茶叶图像。对图像进行灰度化、二值化处理,提取叶片的6个绝对形状特征:长度、宽度、面积、周长、最小外接矩长、宽,在此基础上计算狭长度,矩形度2个相对形状特征,生成形状特征的直方图。以直方图分布为特征向量,构建了基于BP神经网络,极限学习机(extreme learning machine,ELM),支持向量机(support vector machine,SVM),最小二乘支持向量机(least squares support vector machine,LS-SVM)的等级识别模型,并对比了不同模型的识别效果。结果表明,该文构建的图像采集系统测量精度<0.3 mm,能够准确提取形状特征参数;基于形状特征直方图的LS-SVM模型识别效果最好,识别精度为95.71%,测试集决定系数为96.2%,具有算法复杂度低,易于求解的优点。研究结果为实现茶叶的客观、数字化等级鉴定,提供了试验数据和参考方法。

图像处理;模型;神经网络;祁门红茶;外形;等级识别;支持向量机

0 前 言

祁门红茶(Keemun black tea)主产于安徽省祁门县,是中国历史名茶。按照安徽省地方标准《祁门红茶》DB34/T1086-2009[1],将祁门工夫红茶分为7个等级:特茗、特级、一级、二级、三级、四级、五级。准确、客观、定量地鉴定茶叶等级在茶叶加工、销售过程中是不可缺少的。传统的等级鉴定往往依靠人工的感官判断,这一方法缺乏客观的量化依据,影响了茶叶的质量稳定性,而且技术人员培养困难。

目前,基于机器视觉[2-3]和波谱分析[4-5]的方法在农产品类别/真伪鉴别、化学成分检测[6]等领域得到了广泛应用。这一类方法相对于气相[7]和液相色谱[8]方法,具有快速、无损、简便的特点。

在茶叶类别识别领域,Huo等[9]采用电子舌鼻的技术方法,实现了对9种中国绿茶产地与等级的区分;Cai等[10]采用近红外光谱数据,建立了用于茶叶分类的自组织神经网络PLS(partial least squares)模型,相对于经典PLS模型,显著提高了分类准确率。李晓丽等[11]基于多光谱图像纹理特征识别4种不同种类的绿茶。在茶叶等级识别领域,Chen等[12]综述了常用的无损检测技术在茶叶等级、营养成分分析中的研究进展情况。王曼等[13]提出了基于近红外光谱的黄山毛峰鲜叶等级评价模型,基于该模型开发了茶叶品质分析仪。Dong等[14]构建了LED诱导荧光系统,提出了基于茶汤荧光光谱数据的等级识别方法。相对于茶叶类别识别,同类不同级别的茶叶外形、成分较为接近,识别难度显著增加,目前的研究成果大多基于光谱分析方法。但是,单纯基于光谱分析无法对茶叶外形做出准确评价。目前,也有一些学者采用茶叶的可见光图像或高光谱图像开展研究工作[15],如董春旺等[16]采用了颜色、纹理特征评价针芽型绿茶的外形品质,Gill等[17]采用了纹理信息识别红茶的等级,上述研究工作大多采用了颜色、纹理等图像特征,而忽略了叶片的形状特征。在红茶加工过程中,常采用筛分工艺,不同等级茶样外形、尺寸等参数分布在同一等级内部应该具有相似性,各等级之间应该具有差异性。基于这一假设,本文采用机器视觉为技术手段,构建祁门工夫红茶的形状特征空间,采用机器学习方法建立识别模型,这为茶叶等级的量化识别提供了新的方法。

1 材料与方法

1.1 试验材料

试验茶样来源于安徽省黄山市祁门源生茶叶有限公司提供的祁门工夫红茶,包含全部7个等级:特茗、特级、一级、二级、三级、四级和五级。

1.2 试验设计

本研究的试验设计:从每个等级茶样中,取出约150~200片的叶片作为样本,采用本文构建的图像采集系统,采集叶片在相互无遮挡条件下的图像,并提取若干形状特征的直方图,设计识别模型,实现对祁门工夫红茶的等级识别。每个等级茶叶采集80幅图像作为样本,以3∶1的比例随机选择其中的60幅作为训练集,20幅作为预测集。

1.3 图像采集系统和相机标定

1.3.1 图像采集系统构建

图像采集系统的结构如图1a所示,包括:工业相机、背光源、滚筒筛、直线位移模组、载物平台。滚筒筛结构如图1b所示,为单侧开孔,由电机驱动进行旋转,可以通过控制滚筒转动的角度、速度,调节茶叶的下落形式。载物平台由直线位移模组的电机驱动,平台上装有一块高透光率光学玻璃。系统工作流程如下:首先将茶样装入滚筒中,启动直线位移模组,载物平台从左向右运动,并控制滚筒筛转动使叶片从筛孔处下落。这样可以使大部分叶片以相互无遮挡的状态均匀散布在光学玻璃上,并分离少数重叠的叶片。最后控制载物平台运动到背光源上方,启动工业相机采集样本图像。相机选用的是型号为MV-U500的工业相机,其分辨率为2 592× 1 944,像元尺寸为2.2×2.2(m)。

图1 图像采集系统

1.3.2 相机标定

为测量叶片的形状参数,首先对相机进行几何标定。本文采用的标定方法为“张正友标定法”[18],标定板采用标准的30´30黑白棋盘格。标定后可得相机的内参矩阵。

(1)式中为相机焦距;d、d为像元尺寸;0、0为图像中心坐标。世界坐标系到图像坐标系[18]的计算公式如(2)所示。

为了检测图像采集系统的测量精度,设计了尺寸已知的2组测试图形—矩形组、不规则多边形组,对矩形组预设其长宽尺寸,不规则多边形组预设其外接矩形的长宽尺寸,采用本文构建的机器视觉系统测量测试图形的尺寸,分析机器视觉系统的测量精度。

1.4 图像预处理和形状特征提取

为准确识别茶叶等级,需要提取叶片的形状特征,本文提取的叶片特征有:宽度,长度,面积,周长,狭长度,矩形度。采用叶片的平均宽度作为叶宽,叶片图像的骨架线长度作为叶片长度,叶片所占像素点个数作为叶片面积,叶片外轮廓所占像素个数作为叶片周长。狭长度和矩形度为2个相对形状特征。

叶片特征提取算法的流程图如图2所示。相机采集的图像为JPG格式,需要对图像进行预处理[19-20]。将RGB图像转化为灰度图像,通过最大类间方差法[21]选取阈值,将灰度图像转化为二值图像,并通过中值滤波减少噪声[22]。通过上述处理,实现图像中叶片与背景的分离。

图2 图像处理算法流程

以狭长度=/表征单个叶片矩形程度,矩形度=/min表征对外接矩形填充程度,式中为叶片面积,min为叶片最小外接矩形面积。本文采用间隔旋转法求取叶片的最小面积外接矩形[24](minimum area bounding rectangle,MABR),其基本步骤[25]如下

1)对二值图像进行轮廓提取,得到由叶片形成的封闭区域;

2)构建图像中封闭区域轮廓的外接矩形,并记录外接矩形长度、宽度和面积;

3)将封闭区域逆时针旋转1°,重复步骤2,并在90°范围完成遍历后,转入步骤4;

4)比较每次旋转后的外接矩形面积值,得到最小外接矩形面积min=min×min,式中min为最小外接矩形的长度,mm;min为最小外接矩形的宽度, mm。

完成形状特征参数提取后,划分每个特征量的取值区间,并计算落在每个区间的频率[26],如表1所示,进一步生成形状特征的直方图,并将其作为样本特征。

表1 叶片形状特征区间划分

注:为区间上下边界。

Note:is boundaries of interval.

1.5 识别模型

本文设计了基于核函数的识别模型—支持向量机(support vector machine,SVM)、最小二乘支持向量机(least squares support vector machine,LS-SVM)、基于神经网络的识别模型—多层前馈神经网络[27]和极限学习机[28](extreme learning machine,ELM)。通过比较4种模型的识别效果,选取最优模型。

SVM[29]方法基于统计学习理论构建,在很多模式分类问题中表现出了良好的性能。其原理是寻找一个满足分类要求的最优超平面,其数学描述如下

对上述优化问题的求解可以转化为对应的对偶问题,该问题的解如(5)所示。

求解SVM问题是一个凸优化问题,当数据量大且维数高时,求解速度较慢。Suykens等[30]在标准SVM基础上提出了LS-SVM模型,该模型中的约束是等式约束,在目标函数中采用了误差平方和的形式。其数学描述如下

2 结果与分析

2.1 测量精度标定

将制作好的矩形组、不规则多边形组作为测试例,每组测试例包含10个图形,图像采集系统的测量误差分布如图3所示,矩形组和不规则多边形组的误差分布具有较高的一致性。矩形组在世界坐标系的方向和方向的误差均值分别是0.28和0.33 mm,如图3a、3b所示;而不规则多边形组在方向和方向的平均误差分别是0.30和0.28 mm,如图3c、3d所示。

综合上述误差分析,在和方向上的测量平均误差分别是0.29和0.30 mm,故当计算叶片的特征参数时,可在和方向进行误差补偿,使之具有更高的测量精度。

图3 矩形组和不规则形状组误差

2.2 图像预处理与形状特征提取

7个等级茶叶样本图像如图4所示。从图像中可以看出茶叶外形高度相似,均呈条索状。相邻等级的茶样之间表现出较高的近似度,但就单片茶叶而言,难以判断其所属等级。

根据图像预处理流程,将RGB图像转化为灰度图像,通过最大类间方差法计算阈值为0.75,将灰度图像转化为二值图像,并通过一个中值滤波器模板对二值图像进行降噪处理。降噪后,采用本文提出的特征提取方法,计算叶片的形状特征。

叶片宽度分布范围为0~5 mm,以0.5 mm为步长进行划分;叶片长度分布范围为0~21 mm,以1.5 mm为步长进行划分;叶片面积在0~3 500(像素)的范围内,以250像素为步长进行划分;叶片周长在0~480(像素)的范围内,以间隔30像素为步长进行划分;狭长度在1~25的范围内,以1.5为步长进行划分;矩形度在0~1的范围内,以0.1为步长进行划分。

划分特征量区间后,计算样本在各区间的频率,如图5所示,可以看出不同等级茶样在各个区间的分布均表现出一定的差异性,但是相邻等级在部分区间的差异性极小,难以采用在单一特征区间设定阈值的方法区分等级,若采用多个不同特征区间进行联合判断,随着特征的增加,会导致“维数灾”问题,需要调试的逻辑和阈值会变得极为复杂。

2.3 不同模型识别结果与比较

2.3.1 基于BP神经网络的识别结果

采用BP神经网络的识别结果如表2所示,首先从2个等级识别开始,逐渐增加待识别等级数量。采用遍历寻优的方法确定隐含层网络节点个数。对全部7个等级识别的混淆矩阵如表3所示。

a. 特茗 a. Super fineb. 特级 b. Special grade c. 一级 c. First graded. 二级 d. Second grade e. 三级 e. Third gradef. 四级 f. Fourth grade g. 五级 g. Fifth grade

综合表2~表3的结果可以发现:待识别等级数量低于5个等级时,BP神经网络能够保证一定的识别精度,但是需要识别7个等级时,识别精度迅速降低到50%左右,已不具备应用的可能。由混淆矩阵可以发现,误识别主要发生在相邻等级,主要原因是相邻等级的茶叶形态相似性很大。

2.3.2 基于极限学习机的识别结果

采用ELM做识别模型时,首先进行不同等级数量的识别试验,仍然采用遍历寻优的方法确定隐含层网络节点个数,激活函数采用Sigmoid函数,结果如表4所示。预试验对比了采用不同激活函数的识别效果,识别全部7个等级时,采用Sigmoid,Sine,Hardlim作为激活函数,识别精度分别为87.86%,85.71%,75.71%,可见采用Sigmoid作为激活函数的识别精度最高。采用Sigmoid函数识别7个等级茶样的识别混淆矩阵如表5所示。

图5 不同等级叶片形状特征直方图

综合表4~表5可以发现:随着识别等级数量的增加,ELM模型的识别性能有所下降,但并不明显。当识别等级数量为7个等级时,其识别精度达到了87.86%,相对于BP网络有显著提高。和BP神经网络类似,误识别主要发生在相邻等级。

2.3.3 基于SVM和LS-SVM的识别结果

对比BP和ELM模型的识别结果,SVM和LS-SVM模型的识别精度得到了很大的提高,其中LS-SVM的识别效果最好,正确率达到了95.71%。没有出现随着待识别等级数量的增加,识别模型的精度出现了下降的情况,模型误识别仍然发生在相邻等级。

表2 识别等级数量递增时BP神经网络的分级结果

表3 采用BP神经网络识别7个等级茶样的混淆矩阵

表4 识别等级数量递增时ELM模型的分级结果

2.4 识别模型比较

针对祁门工夫红茶的等级识别问题,SVM,LS-SVM模型的识别效果优于ELM模型的识别效果,ELM模型的识别效果优于BP神经网络模型,其中线性LS-SVM模型的识别精度最高,接近96%。由上述结果可以发现2点共性问题:1)随着待识别等级数量的增加,模型识别精度逐渐下降;2)通过观察各识别模型的混淆矩阵,发现识别错误大概率发生在相邻等级。上述问题出现的可能原因是:BP,ELM这一类神经网络识别方法,采用非线性函数形成的超平面在输入空间内进行分割。而各等级茶样在形状特征空间的分布是较为接近的,尤其是相邻等级的茶样,因此识别的难度较大,这也是误识别大概率出现在相邻等级的原因。而基于核函数的识别方法,将原始数据映射到一个更高维的数据空间,降低了构造超平面的难度,使得识别的正确率显著提高。LS-SVM方法相对于经典的SVM方法,都有较高的识别精度,且具有算法复杂度低,易于求解的优点,具备了开展应用研究的价值。

表5 采用ELM模型识别7个等级茶样的混淆矩阵

表6 采用SVM,LS-SVM模型的分级结果

注:s为核函数方差;为惩罚系数。

Note:sis variance of kernel function;is penalty coefficient.

表7 采用SVM模型识别7个等级茶样的混淆矩阵

表8 采用LS-SVM模型识别7个等级茶样的混淆矩阵

3 结 论

本文针对祁门工夫红茶等级识别问题,采用机器视觉的技术手段,提出了基于形状特征直方图的等级识别方法,研究结论如下:

1)提出一种基于茶叶形状特征直方图的祁门工夫红茶等级识别方法,采用叶片的6个形状特征:宽度、长度、面积、周长、狭长度和矩形度,描述叶片的外形,结果表明采用上述6个特征识别祁门工夫红茶的等级是有效的。

2)相对于神经网络识别模型,基于核函数的识别模型能够获得较高的识别率,其中LS-SVM的识别率最高为95.71%。这一方法克服了随着待识别等级数量的增加,模型识别精度下降、相邻等级易发生误识别的缺点,且具有模型求解简单的优点,表现出了较好的应用前景。

本研究为茶叶等级的客观、数字化鉴定提供了一种新的方法,在茶叶加工、销售领域具有较大的应用前景。

[1] 黄山市质量技术监督局,安徽省农业科学院茶叶研究所. 祁门红茶DB34/T1086—2009[S]. 合肥:安徽省质量监督局,2009:12

[2] 王红军,熊俊涛,黎邹邹,等. 基于机器视觉图像特征参数的马铃薯质量和形状分级方法[J]. 农业工程学报,2016,32(8):272-277. Wang Hongjun, Xiong Juntao, Li Zouzou, et al. Potato grading method of weight and shape based on imaging characteristics parameters in machine vision system[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2016, 32(8): 272-277. (in Chinese with English abstract)

[3] Sabzi S, Abbaspour-Gilandeh Y, Javadikia H. Machine vision system for the automatic segmentation of plants under different lighting conditions[J]. Biosystems Engineering, 2017, 161: 157-173.

[4] 刘燕德,肖怀春,孙旭东,等. 柑桔叶片黄龙病光谱特征选择及检测模型[J]. 农业工程学报,2018,34(3):180-187. Liu Yande, Xiao Huaichun, Sun Xudong, et al. Spectral feature selection and discriminant model building for citrus leaf Huanglongbing[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(3): 180-187. (in Chinese with English abstract)

[5] 张筱蕾,刘飞,聂鹏程,等. 高光谱成像技术的油菜叶片氮含量及分布快速检测[J]. 光谱学与光谱分析,2014,34(9):2513-2518. Zhang Xiaolei, Liu Fei, Nie Pengcheng, et al. Rapid detection of nitrogen content and distribution in oilseed rape leaves based on hyper spectral imaging[J]. Spectroscopy and Spectral Analysis, 2014, 34(9): 2513-2518. (in Chinese with English abstract)

[6] Maji S, Chakraborty P, Bhowmick M, et al. Diurnal variation in spectral properties of potato under different dates of planting and N-doses[J]. Environment & Ecology, 2015, 33(1): 478-483.

[7] Zhu Jiancai, Wang Lingying, Zuo Bingxiao, et al. Characterization of the key aroma compounds in mulberry fruits by application of gas chromatography–olfactometry (GC-O), odor activity value(OAV), gas chromatography- mass spectrometry (GC–MS) and flame photometric detection (FPD)[J]. Food Chemistry, 2017, 245 (15): 775-785.

[8] Asghari A, Fahimi E, Bazregar M, et al. Rapid determination of some psychotropic drugs in complex matrices by tandem dispersive liquid–liquid micro extraction followed by high performance liquid chromatography[J]. Journal of Chromatography B, 2017, 1052(1): 51-59.

[9] Huo Danqun, Wu Yu, Yang Mei, et al. Discrimination of Chinese green tea according to varieties and grade levels using artificial nose and tongue based on colorimetric sensor arrays[J]. Food Chemistry, 2013, 145 (15): 639-645.

[10] Cai Jianxiong, Wang Yuanfeng, Xi Xionggang, et al. Using FTIR spectra and pattern recognition for discrimination of tea varieties[J]. International Journal of Biological Macromolecules, 2015, 78: 439-446.

[11] 李晓丽,何勇,裘正军,等. 基于多光谱图像的不同品种绿茶的纹理识别[J]. 浙江大学学报:工学版,2008,42(12):2133-2138. Li Xiaoli, He Yong, Qiu Zhengjun, et al. Texture discrimination of different kinds of green tea based on multi-spectral imaging technique[J]. Journal of Zhejiang University Engineering Science, 2008, 42(12): 2133-2138. (in Chinese with English abstract)

[12] Chen Quansheng, Zhang Dongliang, Pan Wenxiu, et al. Recent developments of green analytical techniques in analysis of tea's quality and nutrition[J]. Trends in Food Science & Technology, 2015, 43(1): 63-82.

[13] 王曼,张正竹,宁井铭,等. 基于近红外光谱的黄山毛峰茶鲜叶品质分析及等级快速评价[J]. 食品工业科技,2014,35(22):57-64. Wang Man, Zhang Zhengzhu, Ning Jingming, et al. Study on quality analysis and class rapid evaluation of tea leaf materials based on near infrared technology[J]. Science and Technology of Food Industry. 2014, 35(22): 57-64. (in Chinese with English abstract)

[14] Dong Yongjiang, Liu Xuan, Mei Liang, et al. LED-induced fluorescence system for tea classification and quality assessment[J]. Journal of Food Engineering, 2014, 137(8): 95-100.

[15] Sandasi M, Chen Weiyang, Vermaak I, et al. Non-destructive quality assessment of herbal tea blends using hyper spectral imaging[J]. Phytochemistry Letters, 2018, 24: 94-101.

[16] 董春旺,朱宏凯,周小芬,等. 基于机器视觉和工艺参数的针芽形绿茶外形品质评价[J]. 农业机械学报,2017,48(9):38-45. Dong Chunwang, Zhu Hongkai, Zhou Xiaofen, et al. Quality evaluation for appearance of needle green tea based on machine vision and process parameters[J]. Transactions of the Chinese Society for Agricultural Machinery, 2017, 48(9): 38-45. (in Chinese with English abstract)

[17] Gill G S, Kumar A, Agarwal R. Nondestructive grading of black tea based on physical parameters by texture analysis[J]. Biosystems Engineering, 2013, 116(2): 198-204.

[18] Zhang Zhengyou. A flexible new technique for camera calibration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2000, 22(11): 1330-1334.

[19] Gonzalez R C, Woods R E. Digital Image Processing, Third Edition[M]. Upper Saddle River: Prentice Hall, 2001.

[20] Forsyth D A, Ponce J. Computer Vision: A Modern Approach, Second Edition[M]. Upper Saddle River: Prentice Hall, 2012.

[21] 李擎,唐欢,迟健男,等. 基于改进最大类间方差法的手势分割方法研究[J]. 自动化学报,2017,43(4):528-537. Li Qing, Tang Huan, Chi Jiannan, et al. Gesture segmentation with improved maximum between-cluster variance algorithm[J]. Acta Automatica Sinica, 2017, 43(4): 528-537. (in Chinese with English abstract)

[22] 王风云,封文杰,郑纪业,等. 基于机器视觉的双孢蘑菇在线自动分级系统设计与试验[J]. 农业工程学报,2018,34(7):256-263. Wang Fengyun, Feng Wenjie, Zheng Jiye, et al. Design and experiment of automatic sorting and grading system based on machine vision for white agaricusbisporus[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(7): 256-263. (in Chinese with English abstract)

[23] Sujaritha M, Annadurai S, Satheeshkumar J, et al. Weed detecting robot in sugarcane fields using fuzzy real time classifier[J]. Computers and Electronics in Agriculture, 2017, 134: 160-171.

[24] 张旭明,徐滨士,董世运. 用于图像处理的自适应中值滤波[J]. 计算机辅助设计与图形学学报,2005,17(2):295-299. Zhang Xuming, Xu Binshi, Dong Shiyun. Adaptive median filtering for image processing[J]. Journal of computer-aided design & computer graphics, 2005, 17(2): 295-299. (in Chinese with English abstract)

[25] 程鹏飞,闫浩文,韩振辉. 一个求解多边形最小面积外接矩形的算法[J]. 工程图学学报,2008,29(1):122-125. Cheng Pengfei, Yan Haowen, Han Zhenhui. An algorithm for computing the minimum area bounding rectangle of an arbitrary polygon[J]. Journal of Engineering Graphics, 2008,29(1): 122-125.

[26] 赵杰文,林颢. 食品、农产品检测中的数据处理和分析方法[M]. 北京:科学出版社,2012.

[27] 张德丰. MATLAB神经网络应用设计[M]. 北京:机械工业出版社,2009.

[28] Huang Guangbin, Zhu Qinyu, Siew C K. Extreme learning machine: Theory and applications[J]. Neurocomputing, 2006, 70(1): 489-501.

[29] 周志华. 机器学习[M]. 北京:清华大学出版社,2016.

[30] Suykens J A K, Vandewalle J. Least squares support vector machine classifiers[J]. Neural Processing Letters, 1999, 9(3): 293-300.

Grading Keemun black tea based on shape feature parameters of machine vision

Song Yan1, Xie Hanlei1, Ning Jingming2※, Zhang Zhengzhu2

(1.230000,; 2.230000,

Objective and accurate identification of tea grades is indispensable in tea processing and sales. Traditional grade identification often depends on human sensory judgments. This method is subjective, difficult to quantify, and has a certain error probability. The objective of this paper was to establish an objective and accurate method to identify the appearance grade of tea. In this paper, Keemun congou black tea was taken as the research object, and a SVM recognition method based on shape feature histogram multi-feature fusion was proposed. Firstly, the tea image acquisition system was built and the camera parameters were calibrated. Rectangular groups and irregular polygon groups of fix dimensions were used to test the measurement accuracy of the image acquisition system. The RGB image of tea leaves was greyed and its binary image was obtained. In order to obtain uniform shape feature parameters, the rotation of tea image was carried out with the minimum area of the leaf's outer rectangle as the constraint. Secondly, 6 absolute shape features - leaf length, leaf width, leaf area, leaf perimeter, the length and width of minimum area bounding rectangle, were extracted. On this basis, 2 relative shape features of length-width ratio and rectangularity were calculated. The histograms of different tea samples in different interval were further obtained, and the histogram distribution of the above characteristics was used as classifier inputs. Finally, the BP neural network, extreme learning machine (ELM), support vector machine (SVM) and least squares support vector machine (LS-SVM) were used as classifiers to classify tea samples. This result showed that the measurement accuracy of the image acquisition system constructed in this paper was less than 0.3 mm, and the shape feature parameters could be accurately extracted. When identifying all seven grades of tea samples, the recognition accuracy of BP neural network was 53.6%, the recognition accuracy of ELM was 87.86%, the recognition accuracy of SVM was 94.29% and the recognition accuracy of LS-SVM was 95.71%. The details of BP neural network classifier were as below: When 2 grades were classified, the recognition accuracy was 100% and the determination coefficient of the test set was 100.00%. When four grades were classified, the recognition accuracy was 97.5% and the determination coefficient of the test set was 93.19%. When all 7 classes were classified, the determination coefficient of test set was 53.6%. The details of ELM classifier were as below: When three grades were classified, the recognition accuracy was 90.00% When five grades were classified, the recognition accuracy was 88.00%.When SVM classifier with linear kernel function was used to identify 7 grades, the determination coefficient of test set was 86.10%. When LS-SVM classifier with linear kernel function was used to identify 7 grades, the determination coefficient of test set was 96.20%. It could be seen that the classifier based on LS-SVM had higher recognition accuracy and the best effect. There were two types of problems in the classification process: One was as the misidentification rate increased with samples amount increasing in the classification model, the second was the misidentification largely happened in adjacent classes. These problems were discussed in this paper. Through the above research, it was verified that the shape feature could be used to identify the appearance grade of Keemun congou black tea. This paper provided detailed experimental data and reference methods for the objective and digital grade identification of Keemun congou black tea.

image processing; models; neural networks; keemun black tea; appearance; identify grade; support vector machine

宋 彦,谢汉垒,宁井铭,张正竹. 基于机器视觉形状特征参数的祁门红茶等级识别[J]. 农业工程学报,2018,34(23):279-286.doi:10.11975/j.issn.1002-6819.2018.23.036 http://www.tcsae.org

Song Yan, Xie Hanlei, Ning Jingming, Zhang Zhengzhu. Grading Keemun black tea based on shape feature parameters of machine vision[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(23): 279-286. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2018.23.036 http://www.tcsae.org

2018-06-21

2018-10-11

国家重点研发计划项目(2017YFD0400800);国家自然科学基金-青年基金项目(61503363);国家重点实验室开放基金项目(安徽农业大学茶树生物学与资源利用国家重点实验室开放基金资助项目SKLTOF20170118)联合资助

宋彦,副教授,研究方向为智能农业技术与装备。 Email:songyan@ahau.edu.cn

宁井铭,教授,研究方向为茶叶加工与品质分析及光谱技术在茶叶品质分析中应用。Email:ningjm@ahau.edu.cn

10.11975/j.issn.1002-6819.2018.23.036

TP391.4

A

1002-6819(2018)-23-0279-08

猜你喜欢
茶样矩形形状
挖藕 假如悲伤有形状……
六盘水蟠龙镇古茶树试制不同茶类的品质分析
喷灌、遮阴对夏季绿茶干茶色泽、汤色的影响研究
茶叶(2021年2期)2021-07-19 04:07:54
两矩形上的全偏差
化归矩形证直角
宜昌绿茶和宜昌宜红感官品质研究
茶叶通讯(2018年4期)2019-01-15 07:09:24
你的形状
从矩形内一点说起
看到的是什么形状
几种信阳毛尖茶的化学成分研究