CN116879184A - Fruit and vegetable pesticide residue detection method and system based on hyperspectral image - Google Patents
Fruit and vegetable pesticide residue detection method and system based on hyperspectral image Download PDFInfo
- Publication number
- CN116879184A CN116879184A CN202310667493.3A CN202310667493A CN116879184A CN 116879184 A CN116879184 A CN 116879184A CN 202310667493 A CN202310667493 A CN 202310667493A CN 116879184 A CN116879184 A CN 116879184A
- Authority
- CN
- China
- Prior art keywords
- fruit
- vegetable
- hyperspectral
- image
- spectrum
- 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
- 235000012055 fruits and vegetables Nutrition 0.000 title claims abstract description 80
- 239000000447 pesticide residue Substances 0.000 title claims abstract description 33
- 238000001514 detection method Methods 0.000 title claims abstract description 31
- 238000001228 spectrum Methods 0.000 claims abstract description 57
- 239000000575 pesticide Substances 0.000 claims abstract description 43
- 238000000354 decomposition reaction Methods 0.000 claims abstract description 18
- 239000000126 substance Substances 0.000 claims abstract description 15
- 238000005457 optimization Methods 0.000 claims description 28
- 239000011159 matrix material Substances 0.000 claims description 26
- 238000001914 filtration Methods 0.000 claims description 10
- 235000013399 edible fruits Nutrition 0.000 claims description 7
- 238000005507 spraying Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 claims description 6
- 230000003190 augmentative effect Effects 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000000926 separation method Methods 0.000 claims description 5
- 238000009499 grossing Methods 0.000 claims description 4
- 238000007781 pre-processing Methods 0.000 claims description 4
- 238000010276 construction Methods 0.000 claims description 3
- 238000005336 cracking Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 238000003860 storage Methods 0.000 claims description 3
- 230000011218 segmentation Effects 0.000 claims description 2
- 238000000034 method Methods 0.000 abstract description 21
- 238000005516 engineering process Methods 0.000 abstract description 3
- 235000013305 food Nutrition 0.000 abstract description 3
- 239000000243 solution Substances 0.000 description 10
- 240000007124 Brassica oleracea Species 0.000 description 8
- 235000003899 Brassica oleracea var acephala Nutrition 0.000 description 8
- 235000011301 Brassica oleracea var capitata Nutrition 0.000 description 8
- 235000001169 Brassica oleracea var oleracea Nutrition 0.000 description 8
- 241000220225 Malus Species 0.000 description 8
- 235000021016 apples Nutrition 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 230000003595 spectral effect Effects 0.000 description 7
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 6
- 235000013311 vegetables Nutrition 0.000 description 5
- WCXDHFDTOYPNIE-RIYZIHGNSA-N (E)-acetamiprid Chemical compound N#C/N=C(\C)N(C)CC1=CC=C(Cl)N=C1 WCXDHFDTOYPNIE-RIYZIHGNSA-N 0.000 description 4
- 239000005660 Abamectin Substances 0.000 description 4
- 239000005875 Acetamiprid Substances 0.000 description 4
- TWFZGCMQGLPBSX-UHFFFAOYSA-N Carbendazim Natural products C1=CC=C2NC(NC(=O)OC)=NC2=C1 TWFZGCMQGLPBSX-UHFFFAOYSA-N 0.000 description 4
- 239000005906 Imidacloprid Substances 0.000 description 4
- 239000006013 carbendazim Substances 0.000 description 4
- JNPZQRQPIHJYNM-UHFFFAOYSA-N carbendazim Chemical compound C1=C[CH]C2=NC(NC(=O)OC)=NC2=C1 JNPZQRQPIHJYNM-UHFFFAOYSA-N 0.000 description 4
- YWTYJOPNNQFBPC-UHFFFAOYSA-N imidacloprid Chemical compound [O-][N+](=O)\N=C1/NCCN1CC1=CC=C(Cl)N=C1 YWTYJOPNNQFBPC-UHFFFAOYSA-N 0.000 description 4
- 229940056881 imidacloprid Drugs 0.000 description 4
- KAATUXNTWXVJKI-NSHGMRRFSA-N (1R)-cis-(alphaS)-cypermethrin Chemical compound CC1(C)[C@@H](C=C(Cl)Cl)[C@H]1C(=O)O[C@H](C#N)C1=CC=CC(OC=2C=CC=CC=2)=C1 KAATUXNTWXVJKI-NSHGMRRFSA-N 0.000 description 3
- PXMNMQRDXWABCY-UHFFFAOYSA-N 1-(4-chlorophenyl)-4,4-dimethyl-3-(1H-1,2,4-triazol-1-ylmethyl)pentan-3-ol Chemical compound C1=NC=NN1CC(O)(C(C)(C)C)CCC1=CC=C(Cl)C=C1 PXMNMQRDXWABCY-UHFFFAOYSA-N 0.000 description 3
- IBSREHMXUMOFBB-JFUDTMANSA-N 5u8924t11h Chemical compound O1[C@@H](C)[C@H](O)[C@@H](OC)C[C@@H]1O[C@@H]1[C@@H](OC)C[C@H](O[C@@H]2C(=C/C[C@@H]3C[C@@H](C[C@@]4(O3)C=C[C@H](C)[C@@H](C(C)C)O4)OC(=O)[C@@H]3C=C(C)[C@@H](O)[C@H]4OC\C([C@@]34O)=C/C=C/[C@@H]2C)/C)O[C@H]1C.C1=C[C@H](C)[C@@H]([C@@H](C)CC)O[C@]11O[C@H](C\C=C(C)\[C@@H](O[C@@H]2O[C@@H](C)[C@H](O[C@@H]3O[C@@H](C)[C@H](O)[C@@H](OC)C3)[C@@H](OC)C2)[C@@H](C)\C=C\C=C/2[C@]3([C@H](C(=O)O4)C=C(C)[C@@H](O)[C@H]3OC\2)O)C[C@H]4C1 IBSREHMXUMOFBB-JFUDTMANSA-N 0.000 description 3
- 239000005874 Bifenthrin Substances 0.000 description 3
- 235000010149 Brassica rapa subsp chinensis Nutrition 0.000 description 3
- 235000000536 Brassica rapa subsp pekinensis Nutrition 0.000 description 3
- 241000499436 Brassica rapa subsp. pekinensis Species 0.000 description 3
- 108090000790 Enzymes Proteins 0.000 description 3
- 102000004190 Enzymes Human genes 0.000 description 3
- 239000005839 Tebuconazole Substances 0.000 description 3
- 239000005842 Thiophanate-methyl Substances 0.000 description 3
- 235000010724 Wisteria floribunda Nutrition 0.000 description 3
- 229950008167 abamectin Drugs 0.000 description 3
- OMFRMAHOUUJSGP-IRHGGOMRSA-N bifenthrin Chemical compound C1=CC=C(C=2C=CC=CC=2)C(C)=C1COC(=O)[C@@H]1[C@H](\C=C(/Cl)C(F)(F)F)C1(C)C OMFRMAHOUUJSGP-IRHGGOMRSA-N 0.000 description 3
- 238000004587 chromatography analysis Methods 0.000 description 3
- 230000005764 inhibitory process Effects 0.000 description 3
- QGHREAKMXXNCOA-UHFFFAOYSA-N thiophanate-methyl Chemical compound COC(=O)NC(=S)NC1=CC=CC=C1NC(=S)NC(=O)OC QGHREAKMXXNCOA-UHFFFAOYSA-N 0.000 description 3
- 241000238631 Hexapoda Species 0.000 description 2
- OIPILFWXSMYKGL-UHFFFAOYSA-N acetylcholine Chemical compound CC(=O)OCC[N+](C)(C)C OIPILFWXSMYKGL-UHFFFAOYSA-N 0.000 description 2
- 229960004373 acetylcholine Drugs 0.000 description 2
- 239000012491 analyte Substances 0.000 description 2
- JLQUFIHWVLZVTJ-UHFFFAOYSA-N carbosulfan Chemical compound CCCCN(CCCC)SN(C)C(=O)OC1=CC=CC2=C1OC(C)(C)C2 JLQUFIHWVLZVTJ-UHFFFAOYSA-N 0.000 description 2
- 230000007830 nerve conduction Effects 0.000 description 2
- 239000003987 organophosphate pesticide Substances 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000004611 spectroscopical analysis Methods 0.000 description 2
- KXDHJXZQYSOELW-UHFFFAOYSA-M Carbamate Chemical compound NC([O-])=O KXDHJXZQYSOELW-UHFFFAOYSA-M 0.000 description 1
- 244000241235 Citrullus lanatus Species 0.000 description 1
- 235000012828 Citrullus lanatus var citroides Nutrition 0.000 description 1
- 240000008067 Cucumis sativus Species 0.000 description 1
- 235000010799 Cucumis sativus var sativus Nutrition 0.000 description 1
- 238000002965 ELISA Methods 0.000 description 1
- 230000005526 G1 to G0 transition Effects 0.000 description 1
- 240000008790 Musa x paradisiaca Species 0.000 description 1
- 235000018290 Musa x paradisiaca Nutrition 0.000 description 1
- 235000006596 Salacca edulis Nutrition 0.000 description 1
- 244000208345 Salacca edulis Species 0.000 description 1
- 244000061458 Solanum melongena Species 0.000 description 1
- 235000002597 Solanum melongena Nutrition 0.000 description 1
- 238000010811 Ultra-Performance Liquid Chromatography-Tandem Mass Spectrometry Methods 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 239000003905 agrochemical Substances 0.000 description 1
- 230000009418 agronomic effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- RRZXIRBKKLTSOM-XPNPUAGNSA-N avermectin B1a Chemical compound C1=C[C@H](C)[C@@H]([C@@H](C)CC)O[C@]11O[C@H](C\C=C(C)\[C@@H](O[C@@H]2O[C@@H](C)[C@H](O[C@@H]3O[C@@H](C)[C@H](O)[C@@H](OC)C3)[C@@H](OC)C2)[C@@H](C)\C=C\C=C/2[C@]3([C@H](C(=O)O4)C=C(C)[C@@H](O)[C@H]3OC\2)O)C[C@H]4C1 RRZXIRBKKLTSOM-XPNPUAGNSA-N 0.000 description 1
- 238000001574 biopsy Methods 0.000 description 1
- 210000003169 central nervous system Anatomy 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000010668 complexation reaction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 125000000524 functional group Chemical group 0.000 description 1
- 238000004817 gas chromatography Methods 0.000 description 1
- 238000002290 gas chromatography-mass spectrometry Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 238000004128 high performance liquid chromatography Methods 0.000 description 1
- 230000007062 hydrolysis Effects 0.000 description 1
- 238000006460 hydrolysis reaction Methods 0.000 description 1
- 238000003018 immunoassay Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000013178 mathematical model Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003647 oxidation Effects 0.000 description 1
- 238000007254 oxidation reaction Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 210000001428 peripheral nervous system Anatomy 0.000 description 1
- 239000012071 phase Substances 0.000 description 1
- 238000002310 reflectometry Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000011550 stock solution Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000006277 sulfonation reaction Methods 0.000 description 1
- 230000002195 synergetic effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000004809 thin layer chromatography Methods 0.000 description 1
- 231100000419 toxicity Toxicity 0.000 description 1
- 230000001988 toxicity Effects 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30128—Food products
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A40/00—Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
- Y02A40/10—Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in agriculture
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Chemical & Material Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Quality & Reliability (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Investigating Or Analysing Materials By Optical Means (AREA)
Abstract
The invention provides a fruit and vegetable pesticide residue detection method and system based on hyperspectral images, and belongs to the technical field of food safety detection. Firstly, collecting fruit and vegetable samples added with pesticides of different types and different concentrations by adopting a spectrometer, and constructing an overcomplete end member spectrum library of the fruits and vegetables. Secondly, constructing a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model with the space-spectrum synergy, and introducing an alternate direction multiplier method to realize quick solution of the hyperspectral fruit and vegetable image mixed pixel sparse decomposition model. And finally, analyzing chemical components and contents of residual pesticides in fruits and vegetables to be detected based on the solved abundance images, and rapidly evaluating the safety grade of the fruits and vegetables. The invention adopts the hyperspectral technology combined with the spectrum and the mixed pixel sparse decomposition theory to realize the detection of the pesticide residue of fruits and vegetables, and has the advantages of automation, no damage, no pollution, rapidness, high efficiency and the like.
Description
Technical Field
The invention relates to the technical field of food safety detection, and relates to a fruit and vegetable pesticide residue detection method and system based on hyperspectral images, in particular to a fruit and vegetable pesticide residue detection method and system based on a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model.
Background
Currently, pesticide residue detection of fruits and vegetables also mainly depends on chemical, physical, biological and other means (document 1), and the main detection methods include a spectroscopic method (document 2), an enzyme inhibition method (document 3) and a chromatographic method (document 4). (1) spectroscopy: according to certain functional groups or hydrolysis products in the organophosphorus pesticide and special color developing agents, chemical reactions such as oxidation, sulfonation, complexation and the like are carried out in a specific environment, and color reactions with specific wavelengths are generated for qualitative or quantitative determination; (2) enzyme inhibition method: according to the principle that organophosphorus and carbamate pesticides can inhibit the activity of acetylcholine in the central nervous system and the peripheral nervous system of insects, the accumulation of acetylcholine as a nerve conduction medium is caused, normal nerve conduction is influenced, and the toxicity and death of insects are caused; (3) chromatography: the separation is achieved according to the difference of partition coefficients of the analyte between the stationary phase and the mobile phase, the concentration of the analyte is converted into an electric signal (voltage, current, etc.) which is easy to measure, and then the electric signal is sent to a recorder for recording, and the method mainly comprises thin layer chromatography, gas chromatography and high performance liquid chromatography. In addition, scientists have also proposed techniques for rapidly detecting pesticide residues, such as chemical rapid detection (document 5), immunoassay (document 6), and biopsy (document 7). However, these methods do not get rid of the limitations of the traditional means such as chemical analysis and biological experiments, the detection result depends on sampling, and the problems of high cost, long time, low efficiency and the like exist, so that many inconveniences are brought to the supervision work of the agricultural products before, during and after delivery, and the real-time or near real-time monitoring requirement is difficult to meet (document 8).
Z.Xiu-ping,M.Lin,H.Lan-qi,C.Jian-Bo,and Z.Li,“The optimization and establishment of QuEChERS-UPLC–MS/MS method for simultaneously detecting various kinds of pesticides residues in fruits and vegetables,”Journal of Chromatography B,vol.1060,pp.281-290,2017.
D.Liu,Y.Han,L.Zhu,W.Chen,Y.Zhou,J.Chen,and Z.Dou,“Quantitative detection of isofenphos-methyl in corns using surface-enhanced Raman spectroscopy(SERS)with chemometric methods,”Food Analytical Methods,vol.10,no.5,pp.1202-1208,2017.
Zhang Dengke, hao Chenglie, zhong Kai, et al, "research on the production of immobilized enzyme tablets for rapid detection of pesticide residues on fruits and vegetables," Anhui agricultural science, vol.45, no.28, pp.81-84,2017.
Zhang Bolun, pang Guofang, feng Chun, et al, "solid phase extraction combined with gas chromatography-triple quadrupole mass spectrometry" for determining 48 pesticide residues in high acid fruits, "analytical test journal, vol.6, no.003,2018.
Shang Tong A comparative study of rapid test card method and enzyme inhibition method for rapid detection of pesticide residue in vegetables, "Anhui agricultural science, vol.45, no.1, pp.102-104,2017.
[6] Rubing, liu Ying, wang Shuangjie, et al, "chemiluminescent enzyme-linked immunoassay for simultaneous detection of 3 organophosphorus pesticide residues," agronomic report, vol.19, no.1, pp.37-45,2017.
[7] Zhang Wencheng, gong Hongjing "rapid detection of pesticide residues in fruits and vegetables" research progress, "food science, vol.29, no.12, pp.752-755,2008.
[8] Li, cai Yue, yang Shengqin, chancurd, huang Xiangrong, ji Wenfang, "improved QuEChERS method is matched with GPC-GC-MS on-line combination system to measure 31 pesticide residues in fruits and vegetables", journal of Chinese health inspection, vol.21, no.2, pp.277-279,2011.
Disclosure of Invention
The invention provides a fruit and vegetable pesticide residue detection method and system based on a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model, which aims to solve the problems of long time consumption, low efficiency and high cost in the detection process and belongs to the field of lossy detection in the detection method in the prior art.
The technical scheme adopted by the method is as follows: a fruit and vegetable pesticide residue detection method based on hyperspectral images comprises the following steps:
step 1: spraying pesticides with different types and different concentrations on fruits and vegetables, and preparing a fruit and vegetable sample after spraying the pesticides; carrying out typical spectrum acquisition on the prepared fruit and vegetable samples at random, calculating the average spectrum of each sample group, preprocessing spectrum data, and constructing a fruit and vegetable-pesticide overcomplete end member spectrum library;
step 2: based on the mapping relation between the hyperspectral image and the sparse expression theory, non-negative constraint, component sum as one constraint and TV total variation regularization constraint are integrated, and a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model with the empty-spectrum synergy is constructed;
step 3: adopting an alternating direction multiplication method ADMM, constructing an augmented Lagrangian function to convert a constraint problem into an unconstrained problem, decomposing a complex optimization problem into a series of simple sub-problems by using a separation variable, and alternately optimizing and repeatedly iterating until a convergence condition is reached, so as to solve a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model;
step 4: and analyzing chemical components and contents of residual pesticides in fruits and vegetables to be detected based on the solved abundance images.
Preferably, in step 1, the spectrum data preprocessing is to perform convolution smoothing filtering on the original spectrum data, and replace the original numerical value with the fitting value based on a least square fitting algorithm.
Preferably, in the step 2, the sparse decomposition model of the mixed pixels of the hyperspectral fruit and vegetable image with the synergistic effect of the space-spectrum is as follows:
wherein Y represents hyperspectral fruit and vegetable images to be processed, A represents a dictionary of an overcomplete end-member spectrum library of fruits and vegetables and pesticides, X is an abundance image, and the X is an abundance image, N is the model error and the noise contribution, I X I 1 X is more than or equal to 0 and is a non-negative constraint for sparse constraint,is a constraint; x is X i For the component information corresponding to the ith end member spectrum signal, N is the end member number, lambda TV The coefficients of the regularization term for the full variation of abundance are used to control the degree of smoothness of the abundance map segmentation. TV (X) is an abundance total variation regularization term:
wherein m and n are the length and width of the image, and p and q are the index values of the image rows and columns respectively; x is X p,q Representing the behavior p, the image features listed as q.
Preferably, the specific implementation of the step 3 comprises the following sub-steps:
step 3.1: taking the formula (1) as an original optimization problem (1), introducing a redundant variable matrix to perform equivalent conversion on the original optimization problem (1) to obtain an optimization problem (2):
wherein ,V1 ,V 2 ,V 3 ,V 4 ,V 5 And U is an auxiliary redundant variable matrix; lambda is a non-negative regularization parameter,Is an indication function if V 5 =0, then->Otherwise->H is a convolution matrix, and the discrete Fourier transform is utilized to convert the image from a space domain to a frequency domain for quick solution;
step 3.2: introducing auxiliary terms of each term as objective function cracking terms, and converting a constrained optimization problem (2) into an unconstrained problem (3):
wherein , and />The Lagrangian secondary penalty terms are adopted, the subscript F represents the F-norm of the matrix, and mu is the penalty factor; d (D) 1 ,D 2 ,D 3 ,D 4 ,D 5 Initialized to zero matrix equal to abundance diagram, U, V 1 ,V 2 ,V 3 ,V 4 ,V 5 Initializing to a zero matrix; so far, the construction of the augmented Lagrangian objective solution function based on the alternate direction multiplier strategy is completed;
step 3.3: the separation variable decomposes the complex optimization problem into a series of simple sub-problems using the following formula:
wherein H is a convolution matrix, the hyperspectral fruit and vegetable image is converted from a space domain to a frequency domain by using discrete Fourier transform to carry out quick solution, and k is the current iteration number;
iterative and alternate optimization of each target variable until reaching convergence condition GU (k) +BV (k) || F Epsilon or designated iteration number is less than or equal to epsilon
Stopping; wherein the convergence condition is thatEpsilon is a preset threshold;
finally solving the obtained abundance image, namely U in the optimization function; and analyzing the non-zero elements of the matrix U, and finding out an end member spectrum of the residual pesticide from a spectrum library according to the row labels of the non-zero elements in the matrix U, wherein the end member spectrum corresponds to chemical components of the residual pesticide in fruits and vegetables to be detected.
In the step 4, the safety level of the fruits and vegetables is further evaluated according to the obtained chemical components and content of the residual pesticides in the fruits and vegetables to be detected, a fruit and vegetable safety level evaluation lookup table corresponding to different chemical components and content of the pesticides is constructed, and then the safety level of the fruits and vegetables to be detected is rapidly evaluated by comparing the model solving result with the pesticide residue level lookup table.
The system of the invention adopts the technical proposal that: a fruit and vegetable pesticide residue detection system based on hyperspectral images comprises:
one or more processors;
and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the fruit and vegetable pesticide residue detection method based on the hyperspectral image.
The method adopts the hyperspectral technology combined with the spectrum and the mixed pixel sparse decomposition theory to realize the detection of the pesticide residues of the fruits and the vegetables, can be based on a sparse expression model and an alternative multiplier quick solving algorithm, can directly and quickly detect the pesticide residues of the fruits and the vegetables according to hyperspectral images, and has the advantages of automation, no damage, no pollution, rapidness, high efficiency and the like.
Drawings
The following examples, as well as specific embodiments, are used to further illustrate the technical solutions herein. In addition, in the course of describing the technical solutions, some drawings are also used. Other figures and the intent of the present invention can be derived from these figures without inventive effort for a person skilled in the art.
FIG. 1 is a block flow diagram of a method of an embodiment of the present invention.
FIG. 2 is a graph showing the comparison of the effects of the spectral data sets of fruits and vegetables before and after filtering, wherein (a) is Fuji, (b) is Gala, (c) is fructus Cnidii, (d) is yellow marshal, and (e) is Chinese cabbage;
FIG. 3 is a graph showing comparison of the effects of an agricultural chemical spectrum dataset I before and after filtration in an example of the present invention, wherein (a) is acetamiprid, (b) is carbendazim, (c) is imidacloprid, (d) is thiophanate-methyl, (e) is tebuconazole, (f) is beta-cypermethrin, (g) is bifenthrin, and (h) is abamectin.
Detailed Description
In order to facilitate the understanding and practice of the invention, those of ordinary skill in the art will now make further details with reference to the drawings and examples, it being understood that the examples described herein are for the purpose of illustration and explanation only and are not intended to limit the invention thereto.
Referring to fig. 1, the method for detecting pesticide residues on fruits and vegetables based on hyperspectral images provided by the invention comprises the following steps:
step S1: spraying pesticides with different types and different concentrations on fruits and vegetables, and preparing a fruit and vegetable sample after spraying the pesticides.
In this embodiment, fruits are exemplified by red Fuji apples, vegetables are exemplified by Chinese cabbage, and pesticide types are applicable to other fruits such as watermelon, banana and orange, and other vegetables such as cabbage, cucumber, eggplant, etc. The sprayed pesticide is commonly used in the market and comprises thiophanate-methyl, beta-cypermethrin, bifenthrin, tebuconazole, abamectin, imidacloprid, acetamiprid and carbendazim.
And cleaning apples and cabbages purchased in a supermarket for many times and naturally airing the apples and the cabbages, so that no pesticide remains on the surfaces of the apples and the cabbages. Respectively adding 50ml, 100ml, 150ml, 175ml, 200ml, 225ml and 250ml of water to dilute and prepare different pesticide concentrations, and uniformly spraying the pesticide concentrations on the surfaces of apples and cabbages. The corresponding concentration of the water addition amount of the pesticide used by the apples is shown in table 1, and the corresponding concentration of the water addition amount of the pesticide used by the cabbages is shown in table 2.
Table 1 table of the concentration of the pesticide used in apples
TABLE 2 lookup table of pesticide water addition amount to concentration for cabbage
Numbering device | Water adding quantity (ml) | Avermectin (%) | Imidacloprid (%) | Acetamiprid (%) | Carbendazim (%) |
1 | 50 | 0.0100 | 0.1400 | 0.0800 | 0.5000 |
2 | 75 | 0.0067 | 0.0933 | 0.0533 | 0.3333 |
3 | 100 | 0.0050 | 0.0700 | 0.0400 | 0.2500 |
4 | 125 | 0.0040 | 0.0560 | 0.0320 | 0.2000 |
5 | 150 | 0.0033 | 0.0467 | 0.0267 | 0.1667 |
6 | 175 | 0.0029 | 0.0400 | 0.0229 | 0.1429 |
7 | 200 | 0.0025 | 0.0350 | 0.0200 | 0.1250 |
8 | 225 | 0.0022 | 0.0311 | 0.0178 | 0.1111 |
9 | 250 | 0.0020 | 0.0280 | 0.0160 | 0.1000 |
Step S2: and carrying out typical spectrum acquisition on the prepared fruit and vegetable samples by utilizing a spectrometer, calculating the average spectrum of each sample group, and carrying out spectrum data pretreatment to construct a fruit and vegetable-pesticide overcomplete end member spectrum library.
In one embodiment, the spectral data is collected using an ASD FieldSpec 3 portable field clutter spectrometer provided by ASD Inc. (Analytical Spectral Devices) in the United states at a wavelength range of 1000-2500nm with a spectral spacing of 1.4nm between 350-1050nm and a spectral spacing of 2nm between 1000-2500 nm. The artificial light source matched with an ASD instrument is used for simulating sunlight, measurement is carried out in a darkroom, and the spectrum acquisition time is 18:30 to 22:30.
the specific spectrum acquisition process is as follows:
(1) Preheating the instrument for 15 minutes;
(2) Connecting a matched computer cable after preheating;
(3) Starting a computer;
(4) Opening an RS3 operation program;
(5) Setting a spectrum data storage position, a spectrum name and a starting number;
(6) Setting the lens type to be 5 degrees, and setting the spectrum, dark current and white board spectrum average times to be 20 times;
(7) The spectrometer is aligned to the whiteboard, the whiteboard is required to be filled with the view field of the lens, the Opt icon is clicked, and the spectrometer condition is optimized;
(8) Clicking a DC icon to collect dark current;
(9) Clicking on the WR icon. The instrument collects dark current again, then displays a straight line, and the reflectivity is 100%;
(10) Transferring the spectrometer to the measured target, and measuring the relative reflection spectrum curve of the target by the spectrometer.
And importing the spectrum data measured by the ASD spectrometer into ViewSpec Pro software, removing abnormal values, and then carrying out average value taking operation. Then, the data is imported into Matlab, a Savitzky-Golay filter is utilized to carry out convolution smoothing filtering on the original spectrum data, the basic principle is that fitting value is used to replace original numerical value based on least square fitting, the effects of removing high-frequency noise points, improving signal to noise ratio and smoothing original data sequences are achieved, and then the data are put in storage to construct an overcomplete end-member spectrum library.
Step S3: based on a sparse expression theory framework, the mapping relation between the hyperspectral image and the sparse expression theory is researched, the hyperspectral fruit and vegetable image mixed pixel sparse decomposition theory and method based on an overcomplete end member spectrum library are developed, and meanwhile, non-negative constraint, component sum 1 constraint and TV total variation regularization constraint are integrated, so that a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model with the air-spectrum synergy is constructed.
In one embodiment, the auxiliary effect of physical meaning of end member components and image space information on spectrum unmixing is fully considered, non-negative constraint, component sum is a constraint and TV total variation regularization constraint is added into a hyperspectral mixed pixel sparse decomposition model, a full constraint hyperspectral fruit and vegetable image mixed pixel sparse decomposition model and method with empty-spectrum synergy are constructed, and a mathematical model is shown in a formula (1):
wherein Y represents hyperspectral fruit and vegetable images to be processed, A represents a dictionary of an overcomplete end-member spectrum library of fruits and vegetables and pesticides, X is an abundance image, and the X is an abundance image, N is the model error and the noise contribution, I X I 1 X is more than or equal to 0 and is a non-negative constraint for sparse constraint,is a constraint. X is X i For the component information corresponding to the ith end member spectrum signal, N is the end member number, lambda TV Regularization term coefficient for full variation of abundance for controlling abundanceThe degree of smoothness of the graph segments. TV (X) is an abundance total variation regularization term:
wherein m and n are the length and width of the image, and p and q are the index values of the image rows and columns respectively; x is X p,q Representing the behavior p, the image features listed as q.
Step S4: the method comprises the steps of adopting an alternating direction multiplication method ADMM, constructing an augmented Lagrangian function to convert a constrained problem into an unconstrained problem, decomposing a complex optimization problem into a series of simple sub-problems by separating variables, and carrying out alternating optimization and repeated iteration until convergence conditions are reached, so that the rapid solution of the hyperspectral fruit and vegetable image mixed pixel sparse decomposition model is realized.
In one embodiment, equation (1) is taken as the original optimization problem (1) and a redundancy variable V is introduced 1 ,V 2 ,V 3 ,V 4 ,V 5 And U performs equivalent conversion on the original optimization problem (1) to obtain an optimization problem (2):
wherein ,V1 ,V 2 ,V 3 ,V 4 ,V 5 And U is an auxiliary redundant variable matrix; lambda is a non-negative regularization parameter,Is an indication function if V 5 =0, then->Otherwise->H is a convolution matrix, and the discrete Fourier transform is utilized to convert the image from a space domain to a frequency domain for quick solution;
then, aiming at the optimization problem (2), an alternate direction multiplier strategy is applied, auxiliary items corresponding to the items are introduced as objective function cracking items, and the objective function is optimized, so that the expanded extended Lagrangian function can be constructed as follows:
wherein , and />The Lagrangian secondary penalty terms are adopted, the subscript F represents the F-norm of the matrix, and mu is the penalty factor; d (D) 1 ,D 2 ,D 3 ,D 4 ,D 5 Initialized to zero matrix equal to abundance diagram, U, V 1 ,V 2 ,V 3 ,V 4 ,V 5 Initializing to a zero matrix; so far, the construction of the augmented Lagrangian objective solution function based on the alternate direction multiplier strategy is completed;
finally, decomposing the optimization problem (4) into a series of sub-problems to perform optimization solution one by one:
wherein H is a convolution matrix, the hyperspectral fruit and vegetable image is converted from a space domain to a frequency domain by using discrete Fourier change to carry out quick solution, and k is the current iteration number.
Iterative and alternate optimization of each target variable until reaching convergence condition GU (k) +BV (k) || F Epsilon or the appointed iteration times, wherein the convergence condition is thatEpsilon is a preset threshold value. And finally solving the obtained abundance image, namely the U in the optimization function.
Finally solving the obtained abundance image, namely U in the optimization function; and analyzing the non-zero elements of the matrix U, and finding out an end member spectrum of the residual pesticide from a spectrum library according to the row labels of the non-zero elements in the matrix U, wherein the end member spectrum corresponds to chemical components of the residual pesticide in fruits and vegetables to be detected. The row containing non-zero elements in the U is an abundance diagram corresponding to the end member, namely the content of different pesticide residues in the fruits and vegetables to be detected. In the abundance map, the area with lighter color indicates that the content of pesticide residue is larger, the area with darker color corresponds to the small content of pesticide residue, and the area with black color indicates that no pesticide residue exists.
Step S5: and analyzing chemical components and contents of residual pesticides in fruits and vegetables to be detected based on the solved abundance images, and rapidly evaluating the safety grade of the fruits and vegetables.
In one embodiment, firstly, a fruit and vegetable safety grade evaluation lookup table containing different pesticide chemical components and contents is constructed, and then the safety grade of fruits and vegetables to be detected is rapidly evaluated by comparing a model solving result with a pesticide residue level lookup table.
Please refer to fig. 2, which is a graph comparing effects before and after filtering of a fruit and vegetable spectrum data set in the embodiment of the present invention, wherein (a) is red Fuji, (b) is ga la, (c) is snake fruit, (d) is yellow marshal, and (e) is cabbage;
please refer to fig. 3, which is a diagram showing the comparison of the effects of the pesticide spectrum data set i before and after filtration in the embodiment of the present invention, wherein (a) is acetamiprid, (b) is carbendazim, (c) is imidacloprid, (d) is thiophanate-methyl, (e) is tebuconazole, (f) is beta-cypermethrin, (g) is bifenthrin, and (h) is abamectin.
In fig. 2 and 3, the abscissa indicates wavelength in nanometers, and the ordinate indicates reflectance in percent. For apples, three lines respectively correspond to the spectral curves of the bottom, surrounding and top areas of the fruits and vegetables; for Chinese cabbage, two lines correspond to the white region and the green leaf region, respectively; for pesticides, the nine lines correspond to the spectral curves of different concentrations of pesticide in the pesticide stock solution, diluted with water added in amounts of 0ml, 50ml, 100ml, 150ml, 175ml, 200ml, 225ml and 250ml, respectively. Wherein the left graph is before filtering, and the right graph is after filtering. The figure shows that the filtering can remove high-frequency noise points, improve the signal-to-noise ratio and smooth the original data sequence.
The invention adopts the hyperspectral technology combined with the spectrum and the mixed pixel sparse decomposition theory to realize the detection of the pesticide residue of fruits and vegetables, and has the advantages of automation, no damage, no pollution, rapidness, high efficiency and the like.
It should be understood that the foregoing description of the preferred embodiments is not intended to limit the scope of the invention, but rather to limit the scope of the claims, and that those skilled in the art can make substitutions or modifications without departing from the scope of the invention as set forth in the appended claims.
Claims (6)
1. The fruit and vegetable pesticide residue detection method based on hyperspectral images is characterized by comprising the following steps of:
step 1: spraying pesticides with different types and different concentrations on fruits and vegetables, and preparing a fruit and vegetable sample after spraying the pesticides; carrying out typical spectrum acquisition on the prepared fruit and vegetable samples at random, calculating the average spectrum of each sample group, preprocessing spectrum data, and constructing a fruit and vegetable-pesticide overcomplete end member spectrum library;
step 2: based on the mapping relation between the hyperspectral image and the sparse expression theory, non-negative constraint, component sum as one constraint and TV total variation regularization constraint are integrated, and a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model with the empty-spectrum synergy is constructed;
step 3: constructing an augmented Lagrangian function to convert a constrained problem into an unconstrained problem, decomposing a complex optimization problem into a series of simple sub-problems by using a separation variable, and alternately optimizing and repeatedly iterating until a convergence condition is reached, so as to solve a hyperspectral fruit and vegetable image mixed pixel sparse decomposition model;
step 4: and analyzing chemical components and contents of residual pesticides in fruits and vegetables to be detected based on the solved abundance images.
2. The hyperspectral image-based fruit and vegetable pesticide residue detection method as set forth in claim 1, wherein: in the step 1, the spectrum data preprocessing is to perform convolution smoothing filtering on the original spectrum data, and the fitting value is used for replacing the original numerical value based on a least square fitting algorithm.
3. The hyperspectral image-based fruit and vegetable pesticide residue detection method as set forth in claim 1, wherein: in the step 2, the sparse decomposition model of the mixed pixels of the hyperspectral fruit and vegetable image with the synergy of the space-spectrum is as follows:
wherein Y represents hyperspectral fruit and vegetable images to be processed, A represents a dictionary of an overcomplete end-member spectrum library of fruits and vegetables and pesticides, X is an abundance image, and the X is an abundance image, N is the model error and the noise contribution, I X I 1 X is more than or equal to 0 and is a non-negative constraint for sparse constraint,to sum as a constraint, X i For the component information corresponding to the ith end member spectrum signal, N is the end member number, lambda TV The coefficient of the regularization term of the full variation of the abundance is used for controlling the segmentation smoothness of the abundance map; TV (X) is an abundance total variation regularization term:
wherein m and n are the length and width of the image, and p and q are the index values of the image rows and columns respectively; x is X p,q Representing the behavior p, the image features listed as q.
4. The hyperspectral image-based fruit and vegetable pesticide residue detection method as set forth in claim 3, wherein: the specific implementation of the step 3 comprises the following sub-steps:
step 3.1: taking the formula (1) as an original optimization problem (1), introducing a redundant variable matrix to perform equivalent conversion on the original optimization problem (1) to obtain an optimization problem (2):
wherein ,V1 ,V 2 ,V 3 ,V 4 ,V 5 And U is an auxiliary redundant variable matrix; lambda is a non-negative regularization parameter,Is an indication function if V 5 =0, then->Otherwise->H is a convolution matrix, and the discrete Fourier transform is utilized to convert the image from a space domain to a frequency domain for quick solution;
step 3.2: introducing auxiliary terms of each term as objective function cracking terms, and converting a constrained optimization problem (2) into an unconstrained problem (3):
wherein ,andthe Lagrangian secondary penalty terms are adopted, the subscript F represents the F-norm of the matrix, and mu is the penalty factor; d (D) 1 ,D 2 ,D 3 ,D 4 ,D 5 Initialized to zero matrix equal to abundance diagram, U, V 1 ,V 2 ,V 3 ,V 4 ,V 5 Initializing to a zero matrix; to this end, a multiplier strategy based on alternating directionsThe construction of a slightly-augmented Lagrangian objective solution function is completed;
step 3.3: the separation variable decomposes the complex optimization problem into a series of simple sub-problems using the following formula:
wherein H is a convolution matrix, the hyperspectral fruit and vegetable image is converted from a space domain to a frequency domain by using discrete Fourier transform to carry out quick solution, and k is the current iteration number;
iterative and alternate optimization of each target variable until reaching convergence condition GU (k) +BV (k) || F Epsilon or less than or equal to the designated iteration times; wherein the convergence condition is thatEpsilon is a preset threshold;
finally solving the obtained abundance image, namely U in the optimization function; and analyzing the non-zero elements of the matrix U, and finding out an end member spectrum of the residual pesticide from a spectrum library according to the row labels of the non-zero elements in the matrix U, wherein the end member spectrum corresponds to chemical components of the residual pesticide in fruits and vegetables to be detected.
5. The hyperspectral image-based fruit and vegetable pesticide residue detection method as set forth in any one of claims 1 to 4, wherein: in step 4, the safety grade of the fruits and vegetables is further evaluated according to the obtained chemical components and content of the residual pesticides in the fruits and vegetables to be detected, a fruit and vegetable safety grade evaluation lookup table corresponding to different chemical components and content of the pesticides is constructed first, and then the safety grade of the fruits and vegetables to be detected is rapidly evaluated by comparing the model solving result with the pesticide residue level lookup table.
6. Fruit and vegetable pesticide residue detection system based on hyperspectral image, characterized by comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the hyperspectral image based fruit and vegetable pesticide residue detection method as set forth in any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310667493.3A CN116879184A (en) | 2023-06-06 | 2023-06-06 | Fruit and vegetable pesticide residue detection method and system based on hyperspectral image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310667493.3A CN116879184A (en) | 2023-06-06 | 2023-06-06 | Fruit and vegetable pesticide residue detection method and system based on hyperspectral image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116879184A true CN116879184A (en) | 2023-10-13 |
Family
ID=88268773
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310667493.3A Pending CN116879184A (en) | 2023-06-06 | 2023-06-06 | Fruit and vegetable pesticide residue detection method and system based on hyperspectral image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116879184A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117809070A (en) * | 2024-03-01 | 2024-04-02 | 唐山市食品药品综合检验检测中心(唐山市农产品质量安全检验检测中心、唐山市检验检测研究院) | Spectral data intelligent processing method for detecting pesticide residues in vegetables |
-
2023
- 2023-06-06 CN CN202310667493.3A patent/CN116879184A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117809070A (en) * | 2024-03-01 | 2024-04-02 | 唐山市食品药品综合检验检测中心(唐山市农产品质量安全检验检测中心、唐山市检验检测研究院) | Spectral data intelligent processing method for detecting pesticide residues in vegetables |
CN117809070B (en) * | 2024-03-01 | 2024-05-14 | 唐山市食品药品综合检验检测中心(唐山市农产品质量安全检验检测中心、唐山市检验检测研究院) | Spectral data intelligent processing method for detecting pesticide residues in vegetables |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101915744B (en) | Near infrared spectrum nondestructive testing method and device for material component content | |
Hoang | Wavelet-based spectral analysis | |
Gogé et al. | Optimization criteria in sample selection step of local regression for quantitative analysis of large soil NIRS database | |
Pollo et al. | Chemometrics, comprehensive two-dimensional gas chromatography and “omics” sciences: Basic tools and recent applications | |
Stilo et al. | Chromatographic fingerprinting by comprehensive two-dimensional chromatography: Fundamentals and tools | |
Cheng et al. | Predicting leaf gravimetric water content from foliar reflectance across a range of plant species using continuous wavelet analysis | |
Song et al. | Chlorophyll content estimation based on cascade spectral optimizations of interval and wavelength characteristics | |
Park et al. | Improved prediction of biomass composition for switchgrass using reproducing kernel methods with wavelet compressed FT-NIR spectra | |
Shafri et al. | Detection of stressed oil palms from an airborne sensor using optimized spectral indices | |
Berrier et al. | Advanced data handling in comprehensive two-dimensional gas chromatography | |
CN116879184A (en) | Fruit and vegetable pesticide residue detection method and system based on hyperspectral image | |
Baccolo et al. | From untargeted chemical profiling to peak tables–A fully automated AI driven approach to untargeted GC-MS | |
Fadock et al. | Visible-near infrared reflectance spectroscopy for nondestructive analysis of red wine grapes | |
Zhao et al. | Deep learning assisted continuous wavelet transform-based spectrogram for the detection of chlorophyll content in potato leaves | |
Liu et al. | Evaluating the characteristics of soil vis-NIR spectra after the removal of moisture effect using external parameter orthogonalization | |
Takahama et al. | Atmospheric particulate matter characterization by Fourier transform infrared spectroscopy: a review of statistical calibration strategies for carbonaceous aerosol quantification in US measurement networks | |
Ju et al. | Rapid Identification of Atmospheric Gaseous Pollutants Using Fourier‐Transform Infrared Spectroscopy Combined with Independent Component Analysis | |
Wang et al. | Simultaneous detection of different properties of diesel fuel by near infrared spectroscopy and chemometrics | |
Tan et al. | Mutual information-induced interval selection combined with kernel partial least squares for near-infrared spectral calibration | |
CN113686811A (en) | Spectral data processing method based on double sensors | |
Zhang et al. | Machine learning applications for multi-source data of edible crops: A review of current trends and future prospects | |
Zhang et al. | Hyperspectral model based on genetic algorithm and SA-1DCNN for predicting Chinese cabbage chlorophyll content | |
CN110887798B (en) | Nonlinear full-spectrum water turbidity quantitative analysis method based on extreme random tree | |
Yao et al. | Prediction of total nitrogen content in different soil types based on spectroscopy | |
Yu et al. | Ensemble calibration model of near-infrared spectroscopy based on functional data analysis |
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 |