CN106932359A - 一种基于近红外光谱的苹果分类方法 - Google Patents
一种基于近红外光谱的苹果分类方法 Download PDFInfo
- Publication number
- CN106932359A CN106932359A CN201710121634.6A CN201710121634A CN106932359A CN 106932359 A CN106932359 A CN 106932359A CN 201710121634 A CN201710121634 A CN 201710121634A CN 106932359 A CN106932359 A CN 106932359A
- Authority
- CN
- China
- Prior art keywords
- apple
- near infrared
- infrared spectrum
- sample
- classification
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000002329 infrared spectrum Methods 0.000 title claims abstract description 35
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000004458 analytical method Methods 0.000 claims abstract description 5
- 238000012549 training Methods 0.000 claims description 9
- 235000013399 edible fruits Nutrition 0.000 claims description 8
- 238000004611 spectroscopical analysis Methods 0.000 claims description 8
- 238000012706 support-vector machine Methods 0.000 claims description 8
- 230000003595 spectral effect Effects 0.000 claims description 5
- 238000013145 classification model Methods 0.000 claims description 4
- 230000009467 reduction Effects 0.000 claims description 3
- 241000220225 Malus Species 0.000 abstract description 99
- 238000012360 testing method Methods 0.000 abstract description 9
- 238000001514 detection method Methods 0.000 abstract description 7
- 235000021016 apples Nutrition 0.000 abstract description 2
- 238000009659 non-destructive testing Methods 0.000 abstract description 2
- 235000010724 Wisteria floribunda Nutrition 0.000 description 10
- 238000001228 spectrum Methods 0.000 description 8
- 241000894007 species Species 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 238000009614 chemical analysis method Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 238000010521 absorption reaction Methods 0.000 description 1
- 238000000862 absorption spectrum Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000001066 destructive effect Effects 0.000 description 1
- 238000012850 discrimination method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000005283 ground state Effects 0.000 description 1
- 229910052739 hydrogen Inorganic materials 0.000 description 1
- 239000001257 hydrogen Substances 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 125000002496 methyl group Chemical group [H]C([H])([H])* 0.000 description 1
- 125000001997 phenyl group Chemical group [H]C1=C([H])C([H])=C(*)C([H])=C1[H] 0.000 description 1
- 238000002203 pretreatment Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012372 quality testing Methods 0.000 description 1
- 239000002994 raw material Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 238000001845 vibrational spectrum Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
- G01N21/31—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
- G01N21/35—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
- G01N21/359—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light using near infrared light
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
- G01N21/31—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
- G01N21/35—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
- G01N21/3563—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light for analysing solids; Preparation of samples therefor
Landscapes
- Physics & Mathematics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Investigating Or Analysing Materials By Optical Means (AREA)
Abstract
本发明是一种基于近红外光谱的苹果分类方法,其包括以下步骤:第一步,苹果近红外光谱的采集;第二步,用主成分分析方法对苹果的近红外光谱数据进行降维处理;第三步,记录苹果种类的标签值;第四步,利用处理后的近红外光谱数据、苹果种类的标签值结合支持向量机算法建立苹果品种分类模型,进而实现对苹果品种的分类和识别。本发明解决了苹果分类工作中消耗人力资源、时间较多的问题,并能够有效解决高质量苹果市场中以次充好的问题。本发明具有检测速度快,分类准确率高,分类效率高,无损检测等优点,可实现不同品种苹果的有效分类,给出测试苹果所属的类别。
Description
技术领域:
本发明涉及水果的近红外无损检测技术领域,具体涉及一种基于近红外光谱技术的苹果分类方法。
背景技术:
苹果是世界四大水果之一,也是中国第一大水果,我国苹果的总产量、栽培面积、人均占有量与出口量均居世界第一,已成为世界上最大的苹果生产和消费国,在果品的生成、消费和对外贸易中占有举足轻重的地位。苹果的采后处理、品质判断以及检测一直是农产品加工研究的重要课题。随着生活水平的日益提升,消费者对优秀品种的苹果需求越来越大,但市场上以次充好的现象屡禁不止,苹果品种的鉴别变得越来越重要。所以,研究一种快速、非破坏的苹果品种鉴别方法是非常必要的。
近红外光谱区是指波长在780-2526nm范围内的电磁波,是分子振动光谱倍频和合频吸收谱。近红外光谱主要是由于分子振动的非谐振性使得分子振动从基态向高能级跃迁时产生的,记录的主要是含氢基团振动的倍频和合频吸收。不同基团(如甲基、苯环等)或统一基团在不同化学环境中的近红外吸收波长与强度都有明显差别,近红外光谱具有丰富的结构和组成信息,非常适合用于碳氢有机物质的组成与性质的测量。
支持向量机是一种有监督的机器学习算法(Vapnik V N,Vapnik V.Statisticallearning theory[M].New York:Wiley,1998.),可用于模式分类和非线性回归。支持向量机的主要思想是建立一个分类超平面作为决策曲面,使得正例和反例之间的隔离边缘被最大化;支持向量机的理论基础是统计学习理论,更精确地说,支持向量机是结构风险最小化的近似实现。
目前,大多数水果内部品质的质量检测仍然沿用化学分析方法。化学分析方法具有较高的准确度与可靠性,但是,该类方法属于破坏性检测,消耗大量的人力且检测时间较长。
发明内容:
为了解决上述存在的问题,本发明提供了一种基于近红外光谱的苹果分类方法。该方法利用USB2000+VIS-NIR-ES微型光谱仪和OceanView光谱采集软件,在340-1022nm特征波段范围内,采用漫反射的模式,随机选取每个苹果样品的环赤道面上的15个点进行光谱采集,对每一个样本的15个采集点采集到的光谱数据求平均值,用主成分分析方法对平均之后的光谱数据进行降维处理。对于相同种类的苹果标记同一标签值,对于不同种类的苹果标记不同的标签值。利用处理后的光谱数据、苹果种类标签值以及支持向量机学习算法建立苹果品种的分类模型。本发明属于有监督学习方法,需要一定的学习样本,能够快速、无损地分类苹果。
本发明依据的原理:研究表明,苹果的近红外漫反射光谱中包含了苹果内部的物理化学性质的信息,例如:酸度、可溶性固形物等。品种不同的苹果所对应的近红外漫反射光谱也不同。利用一些样本信息以及支持向量机算法建立的模型能够有效实现不同苹果品种的分类。
根据上述原理,采用的技术方案包括一下步骤:
步骤1、物料准备:准备一批由不同种类的苹果组成的待测样品,需要保证样品中同一种类的苹果大小尺寸近似,并且确保苹果样品表面没有明显腐烂或霉变的现象发生。随机从每一个品种的苹果样本中挑选少量样品作为测试集,其余的苹果样品作为训练集。
步骤2、在室温环境(23-25℃)下,苹果样本近红外光谱的采集:针对不同品种的苹果样本,利用近红外光谱仪对苹果样品进行测量,通过OceanView软件获得苹果样本的近红外漫反射光谱数据。
步骤3、对苹果样本近红外光谱数据进行预处理:将得到的光谱文本数据统一整理输入Matlab R2014b软件,为了减少误差,需要随机测量苹果环赤道面上15个点的光谱数据,并对15组光谱数据求平均值,然后利用主成分分析方法(PCA)对平均光谱数据进行降维处理,并保存这些数据。
步骤4、获取不同种类苹果的标签值:对不同种类的苹果样品标记不同的标签值,对同一种类的苹果样品标记相同的标签值,记录所有苹果样品的标签值。
步骤5、分类模型的建立:利用经过预处理的训练集苹果样品的近红外光谱数据,训练集苹果样品的标签值以及支持向量机算法,建立苹果品种分类模型,利用该模型可以对不同品种的苹果进行分类。
所述步骤2中近红外漫反射光谱信息是指光谱范围为340-1022nm,采集到的每个苹果样本的光谱是2047维的数据。
所述步骤3中用主成分分析方法进行降维时,在满足主成份的累计可信度≥95%的条件下选取主成分个数。
本发明具有如下优点:利用近红外光谱技术实现了对于不同种类苹果的快速无损分类,通过测试集对苹果分类模型进行检验,分类准确率达到了96.67%。该试验平台操作方法简答、易于控制、检测精度高。本发明可用于苹果的在线分类检测。
附图说明:
通过参考附图能够更加清楚地了解本发明的特征,附图是示意性的而不应理解为对本发明进行任何限制,在附图中:
图1是本发明的流程图;
图2是苹果样本的近红外光谱图;
具体实施方式:
下面对本发明技术方案进行详细说明,但是本发明的保护范围不局限于所述实施例。所述方法如无特别说明均为常规方法。所述原料如无特别说明均能从公开商业途径获得。下述实施例每步骤的数据处理均通过美国MathWorks公司出售的科学计算软件MATLABR2014b编程处理,光谱数据的获取通过美国海洋光学公司出售的软件OceanView获取并转换出.txt格式的光谱数据。
本发明适用于不同种类苹果的品种分类,实施流程如图1所示,具体实施如下:
步骤一、物料准备:在当地市场购买富士、嘎啦、澳洲青苹以及国光等4个不同种类的苹果共213个,其中富士苹果57个,嘎啦苹果30个,国光苹果35个,澳洲青苹89个,购买时需要确保同一个种类中的样品大小尺寸接近,并且所有苹果样品的表面无明显的腐烂或霉变的现象发生。随机挑选嘎啦苹果5个,国光苹果5个,富士苹果10个,澳洲青苹10个共30个苹果作为测试集,其余苹果样本作为训练集。
步骤二、苹果样本近红外光谱的采集:在恒温恒湿的环境下,将近红外光谱检测设备连接,接通电源,将光源预热30分钟,待光源温度稳定后,采用漫反射模式采集所有苹果样品的近红外光谱,光谱范围为340-1022nm,采集到的每个样品的光谱是2047维的数据。对于每一个苹果样品,为减少误差,随机选择苹果环赤道面上的15个点进行扫描,获取这15个点的光谱数据后,取其平均值作为最终的实验数据,如表1。
表1、经过求平均值处理后的苹果样品近红外光谱数据表
步骤三、苹果样本近红外光谱数据的降维处理:采用主成分分析法将苹果样本的近红外光谱数据从2047维降到容易处理的低维数据。通过计算可知,近红外光谱数据经过处理后,前i个主成分的累计可信度如表2所示(累计可信度=前i个主成分特征值除以总的特征值之和)。若取前2个主成分,则累计可信度可达%;若取前个主成分,则累计可信度可达100%。
表2、主成分累计可信度
步骤四、获取苹果样品的种类标签值:人工标记苹果样品的种类标签值,对于不同种类的苹果样品标记不同的标签值,对于同一种类的苹果样品标记相同的标签值,并且记录所有苹果样品的标签值。
步骤五、苹果分类模型的建立:利用经过预处理的训练集苹果样品近红外光谱数据以及训练集苹果样品的标签数据作为实验数据,结合支持向量机算法,建立苹果分类模型。在本例中,支持向量机中的核函数使用径向基核函数,其余参数均使用默认值。对待测样本的近红外光谱数据预处理办法务必与建立分类模型时数据预处理办法相同,在完成数据输入,模型载入后可完成对待测苹果样品品种的分类及预测种类的读取。实例中试验以183个样本为训练集,建立苹果分类模型。再利用该分类模型对测试集30个样本进行预测,得到品种分类结果。
表3、测试集样本品种预测值与真实值统计表
编号 | 预测值 | 真实值 |
1 | 富士苹果 | 富士苹果 |
2 | 富士苹果 | 富士苹果 |
… | 富士苹果 | 富士苹果 |
21 | 富士苹果 | 嘎啦苹果 |
… | 嘎啦苹果 | 嘎啦苹果 |
29 | 国光苹果 | 国光苹果 |
30 | 国光苹果 | 国光苹果 |
表3为测试集30个苹果样品在分类模型下个苹果样本的品种预测值与真实值统计表,由表3可知,30个预测样本中,只有1个样本预测错误,分类准确率达到了96.67%。
如上所述,尽管参照特定的实施例已经表示和表述了本发明,但其不得解释为对本发明自身的限制。在不脱离所附权利要求定义的本发明的精神和范围的前提下,可对其在形式上和细节上作出各种变化。
Claims (6)
1.一种基于近红外光谱的苹果分类方法,其特征在于:需要保证样品中同一种类的苹果大小尺寸近似,并且确保苹果样品表面没有明显腐烂或霉变的现象发生。
2.如权利要求1所述的一种基于近红外光谱的苹果分类方法,其特征在于:在恒温恒湿的环境下,采用漫反射模式采集所有苹果样品的近红外光谱,光谱范围为340-1022nm,对于每一个苹果样品,为减少误差,随机选择苹果样品环赤道面上的15个点进行扫描,获取这15个点的光谱数据后,取其平均值作为最终的实验数据。
3.如权利要求2所述的一种基于近红外光谱的苹果分类方法,其特征在于:将得到的光谱数据统一整理输入MATLAB R2014b软件,采用主成分分析方法对苹果样品近红外漫反射光谱信息进行降维处理,在满足主成分累计可信度≥95%的条件下选取主成分个数,并保存降维后的苹果近红外光谱数据。
4.如权利要求3所述的一种基于近红外光谱的苹果分类方法,其特征在于:所述累计可信度为前i个主成分特征值除以总的特征值之和。
5.如权利要求4所述的一种基于近红外光谱的苹果分类方法,其特征在于:人工标记苹果样品的种类标签值,对于不同种类的苹果样品标记不同的标签值,对于同一种类的苹果样品标记相同的标签值,并且记录所有苹果样品的标签值。
6.如权利要求5所述的一种基于近红外光谱的苹果分类方法,其特征在于:利用经过预处理的训练集苹果样品近红外光谱数据以及训练集苹果样品的标签数据作为实验数据,结合支持向量机算法,建立苹果分类模型,利用该模型将不同品种的苹果进行分类,并且可以给出所检测苹果所述的类别。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710121634.6A CN106932359A (zh) | 2017-03-02 | 2017-03-02 | 一种基于近红外光谱的苹果分类方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710121634.6A CN106932359A (zh) | 2017-03-02 | 2017-03-02 | 一种基于近红外光谱的苹果分类方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106932359A true CN106932359A (zh) | 2017-07-07 |
Family
ID=59423277
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710121634.6A Pending CN106932359A (zh) | 2017-03-02 | 2017-03-02 | 一种基于近红外光谱的苹果分类方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106932359A (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113218889A (zh) * | 2020-01-21 | 2021-08-06 | 青岛海尔电冰箱有限公司 | 水果的检测方法、冰箱及存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103048273A (zh) * | 2012-11-09 | 2013-04-17 | 江苏大学 | 基于模糊聚类的水果近红外光谱分类方法 |
CN103646252A (zh) * | 2013-12-05 | 2014-03-19 | 江苏大学 | 一种基于优化的模糊学习矢量量化的苹果分类方法 |
CN103954582A (zh) * | 2014-04-11 | 2014-07-30 | 江苏大学 | 一种混合k调和聚类的苹果品种近红外光谱分类方法 |
-
2017
- 2017-03-02 CN CN201710121634.6A patent/CN106932359A/zh active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103048273A (zh) * | 2012-11-09 | 2013-04-17 | 江苏大学 | 基于模糊聚类的水果近红外光谱分类方法 |
CN103646252A (zh) * | 2013-12-05 | 2014-03-19 | 江苏大学 | 一种基于优化的模糊学习矢量量化的苹果分类方法 |
CN103954582A (zh) * | 2014-04-11 | 2014-07-30 | 江苏大学 | 一种混合k调和聚类的苹果品种近红外光谱分类方法 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113218889A (zh) * | 2020-01-21 | 2021-08-06 | 青岛海尔电冰箱有限公司 | 水果的检测方法、冰箱及存储介质 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107064047A (zh) | 一种基于近红外光谱的富士苹果品质无损检测方法 | |
Nandi et al. | A machine vision-based maturity prediction system for sorting of harvested mangoes | |
CN103235095B (zh) | 注水肉检测方法和装置 | |
CN103048273B (zh) | 基于模糊聚类的水果近红外光谱分类方法 | |
Villaseñor-Aguilar et al. | Fuzzy classification of the maturity of the tomato using a vision system | |
Ramos et al. | Non‐invasive setup for grape maturation classification using deep learning | |
Tripathi et al. | Optimized deep learning model for mango grading: Hybridizing lion plus firefly algorithm | |
CN103278467A (zh) | 一种植物叶片氮素丰缺快速无损高准确率的鉴别方法 | |
CN106918570A (zh) | 一种基于光谱的转基因稻谷智能分类器 | |
Pang et al. | Detection of early bruises on apples using hyperspectral imaging combining with YOLOv3 deep learning algorithm | |
Sarkar et al. | Supervised learning aided multiple feature analysis for freshness class detection of Indian gooseberry (Phyllanthus emblica) | |
Wang et al. | Extraction and classification of apple defects under uneven illumination based on machine vision | |
Tian et al. | Detection of soluble solid content in apples based on hyperspectral technology combined with deep learning algorithm | |
CN108489927A (zh) | 鱼类产地溯源方法、电子设备、存储介质及装置 | |
CN106932359A (zh) | 一种基于近红外光谱的苹果分类方法 | |
Liu et al. | Classification of early mechanical damage over time in pears based on hyperspectral imaging and transfer learning | |
Chen et al. | An improved GMM-based algorithm with optimal multi-color subspaces for color difference classification of solar cells | |
Xu et al. | Detection of apple varieties by near‐infrared reflectance spectroscopy coupled with SPSO‐PFCM | |
Yu et al. | Nondestructive testing of external defects on Nanguo pear | |
CN112782148B (zh) | 阿拉比卡和罗伯斯塔两种咖啡豆的快速鉴别方法 | |
Castro et al. | Using machine learning techniques and different color spaces for the classification of Cape gooseberry (Physalis peruviana L.) fruits according to ripeness level | |
Susnjak et al. | A decomposition machine-learning strategy for automated fruit grading | |
Wang et al. | A Research of Neural Network Optimization Technology for Apple Freshness Recognition Based on Gas Sensor Array | |
Yu et al. | Identification of Nanguo pear maturity based on information fusion | |
Song et al. | A Solution for Liquor Recognition Based on PCA-RF and Laser Induced Fluorescence |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170707 |
|
WD01 | Invention patent application deemed withdrawn after publication |