A kind of herbicide discrimination method based on least square method supporting vector machine
Technical field
The present invention relates to Terahertz Technology Non-Destructive Testing application, relate in particular to a kind of herbicide discrimination method based on least square method supporting vector machine.
Background technology
At present, the detection method of classes of herbicides agricultural chemicals is broadly divided into spectroscopic methodology, enzyme suppresses method and chromatography etc.The complex pretreatment of chromatography sample, requires highly to instrumentation personnel, cannot detect online; It is not high, affected by environment larger that enzyme suppresses method sensitivity, easily occurs undetected, flase drop.The present invention has overcome the shortcoming of classic method, utilizes terahertz time-domain spectroscopy apparatus system, and a kind of easy, workable, herbicide method that sense cycle is short is provided.
In recent years, Terahertz Technology development rapidly, has broad application prospects in fields such as communication, detection, spectrum, imagings.Terahertz (THz) ripple refers to the electromagnetic wave (1THz=10 of frequency within the scope of 0.1~10THz
12hz), it in electromagnetic wave spectrum between microwave and far infrared radiation.With respect to the electromagnetic wave of other kind, THz wave has its unique characteristic: 1., with respect to X ray, the energy of THz wave is low, can not damage human body, so its security is higher; 2. tera-hertz spectra can provide the vibration information of acting force, macro-radical etc. between material molecule, can be for the discriminating of material; 3. tera-hertz spectra detects the structure that can not destroy detected material itself, belongs to Non-Destructive Testing category.
In the time calculating the Terahertz absorption coefficient spectrum of herbicide, adopt the terahertz optics parameter extraction model being proposed by Dorney and Duvillaret, refer to list of references (Terahertz (THz) spectral investigation of Imidacloprid, spectroscopy and spectral analysis, Yan Zhigang, Hou Dibo, Cao Binghua, Zhang Guangxin, Zhou Zekui).
Conventional classification discrimination method has at present: Bayesian Method, radial neural network, support vector machine and least square method supporting vector machine.Radial neural network has used sample assumed condition, turns to principle with least risk, but this method is often not being met in actual applications.Support vector machine adopts inequality constrain condition, dimension equals the number of training sample, thereby make the number of matrix element be wherein training sample number square, but in the time that data scale acquires a certain degree, algorithm of support vector machine often cannot be dealt with problems.And least square method supporting vector machine adopts equality constraint, in conjunction with chunking algorithm etc., make up the some shortcomings of support vector machine, reduce to a certain extent solving difficulty, improve the speed of solving.
Summary of the invention
The object of the invention is to have overcome conventional matter detection method, such as the deficiency of liquid phase chromatography, enzyme inhibition method, provide a kind of herbicide discrimination method based on least square method supporting vector machine.
The step of the herbicide discrimination method based on least square method supporting vector machine is as follows:
1) select maleic acid hydrazide, 2 kinds of herbicides of 2-first-4-chloropropionic acid to prepare training sample sets and Prediction, wherein train in sample sets and contain 7 maleic acid hydrazide samples and 7 2-first-4-chloropropionic acid samples, in Prediction, contain 7 maleic acid hydrazide samples and 7 2-first-4-chloropropionic acid samples;
2) utilize terahertz time-domain spectroscopy system to detect training sample sets, obtain terahertz time-domain spectroscopy, and through Fourier transform and terahertz optics parameter extraction model, calculate the absorption coefficient spectrum of training sample sets, utilize partial least square method to extract validity feature vector to absorption coefficient spectrum, and to train the validity feature vector of sample sets as basis, set up herbicide and differentiate model database X;
3) set output vector Y, differentiate that taking herbicide model database X and output vector Y, as basis, utilize least square method supporting vector machine to set up herbicide and differentiate model;
4) utilize terahertz time-domain spectroscopy system to detect Prediction, obtain terahertz time-domain spectroscopy, and through Fourier transform and terahertz optics parameter extraction model, calculate the absorption coefficient spectrum of Prediction, utilize partial least square method to extract validity feature vector, using the validity feature vector of Prediction as forecast set Z;
5) finally by forecast set Z input, the herbicide based on least square method supporting vector machine is differentiated model, for verifying the discriminating accuracy of herbicide discriminating model.
Described training sample, prediction sample preparation method be: select polyethylene powders as experiment compressing tablet material respectively with maleic acid hydrazide, the former medicine of two kinds of herbicides of 2-first-4-chloropropionic acid mixes, by maleic acid hydrazide, two kinds of former medicines of herbicide of 2 first-4-chloropropionic acid and the polyethylene powders temperature with 80 DEG C in vacuum drying chamber is dried two hours, and mix with 1: 1 part by weight respectively, putting into clean agate mortar grinds evenly, finally by the maleic acid hydrazide of 160mg, two kinds of former medicines of herbicide of 2-first-4-chloropropionic acid and poly potpourri are pressed into the thin rounded flakes that diameter is 13mm under 20MPa pressure, as maleic acid hydrazide, 2-first-4-chloropropionic acid sample.
Described utilizes terahertz time-domain spectroscopy system to training sample sets, Prediction carries out detection method: to training sample sets, before Prediction detects, be filled with nitrogen toward terahertz time-domain spectroscopy system, make relative humidity in system be less than 4.0%, and indoor relative ambient humidity is controlled at below 50%, when terahertz time-domain spectroscopy system works, stepper motor stroke range is made as 0-2cm, sampling step length is made as 0.01cm, to train sample sets, Prediction is put into terahertz time-domain spectroscopy system and is detected, each sample detection three times, be averaged, eliminate stochastic error.
Described step 2) be: utilize partial least square method to extract validity feature vector to the absorption coefficient spectrum of training sample sets, set up herbicide and differentiate model database X and output vector Y, X, Y expression formula are as follows:
Y=[y
1?y
2?…?y
k?…?y
n]
T
In formula, m represents to train sample size in sample sets, and n represents to train the validity feature vector dimension of sample sets, wherein, and m=14, n=2.
Described step 3) be:
According to the discriminating model database X of input, by kernel function, herbicide is differentiated to model database X is mapped to higher dimensional space S, in S space, construct optimal classification face, the kernel function of employing is radial basis kernel function, formula is as follows:
In above formula, δ is kernel functional parameter, x
p, x
qthe validity feature vector of training sample sets, p, q ∈ [1, n].Optimal classification problem is converted into the minimum value of asking class interval φ (w, ε):
Constraint condition is:
y
k[(ψ(x
k)·w+b)]≥1-ε
k
Finally obtain herbicide by method of Lagrange multipliers and differentiate model:
Y in formula
kthe element in output vector Y, y
k=+1, and-1}, k ∈ [1, n], xk is the validity feature vector of training sample sets, and ε is error, and γ is error penalty factor, Ψ (x
k) be validity feature vector x
kat the mapping of feature space S, α
kbe Lagrange multiplier, b is that herbicide is differentiated the intercept of model optimal classification face at coordinate plane.
Terahertz time-domain spectroscopy system involved in the present invention, works at normal temperatures and pressures, and this system has very high signal to noise ratio (S/N ratio), can carry out online Non-Destructive Testing to herbicide sample, there will not be flase drop and undetected phenomenon.In addition, utilize least square method supporting vector machine succinct to two kinds of herbicide discrimination processes, fast, accurately, aspect the discriminating of medicine and analysis, having higher using value.
Brief description of the drawings
Fig. 1 is the identification result figure that two kinds of herbicides are differentiated model.
Embodiment
The step of the herbicide discrimination method based on least square method supporting vector machine is as follows:
1) select maleic acid hydrazide, 2 kinds of herbicides of 2-first-4-chloropropionic acid to prepare training sample sets and Prediction, wherein train in sample sets and contain 7 maleic acid hydrazide samples and 7 2-first-4-chloropropionic acid samples, in Prediction, contain 7 maleic acid hydrazide samples and 7 2-first-4-chloropropionic acid samples;
2) utilize terahertz time-domain spectroscopy system to detect training sample sets, obtain terahertz time-domain spectroscopy, and through Fourier transform and terahertz optics parameter extraction model, calculate the absorption coefficient spectrum of training sample sets, utilize partial least square method to extract validity feature vector to absorption coefficient spectrum, and to train the validity feature vector of sample sets as basis, set up herbicide and differentiate model database X;
3) set output vector Y, differentiate that taking herbicide model database X and output vector Y, as basis, utilize least square method supporting vector machine to set up herbicide and differentiate model;
4) utilize terahertz time-domain spectroscopy system to detect Prediction, obtain terahertz time-domain spectroscopy, and through Fourier transform and terahertz optics parameter extraction model, calculate the absorption coefficient spectrum of Prediction, utilize partial least square method to extract validity feature vector, using the validity feature vector of Prediction as forecast set Z;
5) finally by forecast set Z input, the herbicide based on least square method supporting vector machine is differentiated model, and for verifying the discriminating accuracy of herbicide discriminating model, identification result is good, and accuracy has reached 100%, sees Fig. 1.
Described training sample, prediction sample preparation method be: select polyethylene powders as experiment compressing tablet material respectively with maleic acid hydrazide, the former medicine of two kinds of herbicides of 2-first-4-chloropropionic acid mixes, by maleic acid hydrazide, two kinds of former medicines of herbicide of 2 first-4-chloropropionic acid and the polyethylene powders temperature with 80 DEG C in vacuum drying chamber is dried two hours, and mix with 1: 1 part by weight respectively, putting into clean agate mortar grinds evenly, finally by the maleic acid hydrazide of 160mg, two kinds of former medicines of herbicide of 2-first-4-chloropropionic acid and poly potpourri are pressed into the thin rounded flakes that diameter is 13mm under 20MPa pressure, as maleic acid hydrazide, 2-first-4-chloropropionic acid sample.
Described utilizes terahertz time-domain spectroscopy system to training sample sets, Prediction carries out detection method: to training sample sets, before Prediction detects, be filled with nitrogen toward terahertz time-domain spectroscopy system, make relative humidity in system be less than 4.0%, and indoor relative ambient humidity is controlled at below 50%, when terahertz time-domain spectroscopy system works, stepper motor stroke range is made as 0-2cm, sampling step length is made as 0.01cm, to train sample sets, Prediction is put into terahertz time-domain spectroscopy system and is detected, each sample detection three times, be averaged, eliminate stochastic error.
Described step 2) be: utilize partial least square method to extract validity feature vector to the absorption coefficient spectrum of training sample sets, set up herbicide and differentiate model database X and output vector Y, X, Y expression formula are as follows:
Y=[y
1?y
2?…?y
k?…?y
n]
T
In formula, m represents to train sample size in sample sets, and n represents to train the validity feature vector dimension of sample sets, wherein, and m=14, n=2.
Described step 3) be:
According to the discriminating model database X of input, by kernel function, herbicide is differentiated to model database X is mapped to higher dimensional space S, in S space, construct optimal classification face, the kernel function of employing is radial basis kernel function, formula is as follows:
In above formula, δ is kernel functional parameter, x
p, x
qthe validity feature vector of training sample sets, p, q ∈ [1, n].Optimal classification problem is converted into the minimum value of asking class interval φ (w, ε):
Constraint condition is:
y
k[(ψ(x
k)·w+b)]≥1-ε
k
Finally obtain herbicide by method of Lagrange multipliers and differentiate model:
Y in formula
kthe element in output vector Y, y
k=+1 ,-1}, k ∈ [1, n], x
kbe the validity feature vector of training sample sets, ε is error, and γ is error penalty factor, Ψ (x
k) be validity feature vector x
kat the mapping of feature space S, α
kbe Lagrange multiplier, b is that herbicide is differentiated the intercept of model optimal classification face at coordinate plane.