Summary of the invention
The object of the present invention is to provide a kind of solid wood board knot form inversion method based on near-infrared spectrum analysis, with
Knot is accurately depicted using near-infrared spectral analysis technology in the form of wood internal, and then to solid wood board mechanical property
Accurate Prediction and identification are carried out with defect classification.
The technical solution adopted by the present invention to solve the above technical problem is:
A kind of solid wood board knot form inversion method based on near-infrared spectrum analysis, the realization process of the method
Are as follows:
Training process:
The defect borderline region that solid wood board upper and lower surfaces knot is extracted first with image processing techniques is found out up and down
The center of corresponding boundary point and knot blemish surface on face knot defect boundary obtains one table of solid wood board
On knot defect boundary point A, the point place corresponding central point O of blemish surface and another surface corresponding to this point on face
The boundary point inclination angle OAA ' that is constituted of defect boundary point A ',
Using the spectral information at near-infrared spectrometers acquisition defect boundary point inclination angle, the spectral information is carried out pre-
Effective training set is obtained after processing;
It is effectively extracted with spectral information of the ISOMAP to the defects of training set boundary point inclination angle, with lacking for extraction
The spectral effective feature for falling into boundary point inclination angle is input, using defect boundary point tilt angles as output, constructs Wavelet Neural Network
Network is to obtain the Nonlinear Mapping relationship between spectral effective feature and boundary point inclination angle OAA;
Detection process:
The defect borderline region that a certain face knot of solid wood board is extracted first with image processing techniques, finds out the surface
Multiple boundary points on knot defect boundary;
The spectral information of the multiple boundary point is acquired using near-infrared spectrometers, and carries out baseline drift and denoising
Processing, the validity feature for extracting each spectrum input to trained wavelet neural network, obtain each defect boundary point and incline
Angle angle is presented using these tilt angles by the three-dimensional of Solidworks software realization knot vertebral model.
In the training process to the spectral information carry out pretreatment include: first carry out baseline drift and denoising, then
With principal component in conjunction with mahalanobis distance rejecting abnormalities spectrum, then using K-S divide calibration samples collection.
It is effectively extracted with spectral information of the ISOMAP to the defects of training set boundary point inclination angle, process are as follows:
When using Isomap algorithm to plate defect edge spectral signature dimensionality reduction, dimensionality reduction number range d is set as 1~15,
The range of neighbour k is 2~20, and the various combination for choosing d and k tests Data Dimensionality Reduction effect, works as k=19, when d=12,
It is 12.53 with the smallest SECV value, defect angle prediction related coefficient R is 0.83, and prediction relation analysis error RPD is
1.80。
12 dimension data of validity feature of each spectrum after Isomap is optimized is exported as input as 1 dimension data, use
Wavelet-neural network model predicts plate defect angle, sets 14 for the hidden layer node of wavelet neural network, wavelet neural
The wavelet basis function of network uses Morlet function, the learning rate of setting, anticipation error, study number be respectively 0.01,
0.001,1000, it is pre- for boundary point inclination angle to be trained to obtain trained wavelet-neural network model with 103 samples
It surveys.
First carry out the process of baseline drift and denoising are as follows:
It carries out first derivative to the near infrared spectrum of defect sample first to handle to obtain derivative spectrum, first derivative spectrum is pre-
Processing method is as follows:
In formula, xtFor the discrete spectrum at wavelength t, g is window width;
Then, spectrum high-frequency noise is removed using S-G smoothing processing, improves signal-to-noise ratio, calculate it is smoothed at wavelength t after
Mean Value Formulas is as follows:
In formula, xt,smoothIt is the numerical value at smooth rear wavelength t, hiFor S-G smoothing factor, H is normalization factor, and w is flat
Sliding window size;
With the process of principal component rejecting abnormalities spectrum in conjunction with mahalanobis distance are as follows:
Defect Edge point sample spectrum is considered as exception with the averaged spectrum sample that similarity is low in principal component space, is led to
It crosses and different weight coefficient e values is selected to carry out size adjustment to threshold range, and using model prediction result come rejecting abnormalities
It is as follows to calculate threshold range existing for unusual sample for sample:
In formula, AtFor threshold range,The geneva matrix for being near infrared spectrum data to averaged spectrum in principal component space
Average value;σ is the standard deviation of A;E is the weight coefficient for adjusting threshold range;
The spectroscopic data of Defect Edge point sample i is Ai, work as Ai-AtIt is worth smaller, both shows that similarity is higher;Otherwise also
So.Therefore, e value is bigger, and similarity increases therewith;Conversely, similarity is lower;
The process of calibration samples collection is divided using K-S are as follows:
(1) in defect spectrum samples n, calibration set number of samples m is set;
(2) the Euclidean distance l between spectrum is calculatedij, select lijMaximum sample n1And n2Into calibration set;
(3) remaining spectrum is calculated separately at a distance from calibration set spectrum, and is minimized and is constituted set l, l=min (l1v,
l2v,,…,lqv), wherein 1~q indicates the number for being selected into calibration set sample, and v indicates the number of remaining sample to be selected;
(4) it chooses the corresponding sample of maximum value in l and enters calibration set, which is that distance has the farthest sample of calibration samples
This;
(5) it is repeated in and carries out step (3), (4), until calibration set number of samples reaches preset number m.
The wavelet neural network replaces the activation primitive of BP network hidden layer, wavelet neural network using wavelet basis function
Input parameter be characteristic wavelength point that defect sample point preferably goes out, the prediction output of wavelet neural network is that defect point being inclined
Angle;It is x in input signal sequenceiWhen (i=1,2 ..., k), the hidden layer of wavelet neural network exports calculation formula are as follows:
In formula, h (j) is the output of j-th of node of hidden layer of wavelet neural network, wijFor the input of wavelet neural network
The connection weight of layer and hidden layer, hjFor wavelet basis function, bjFor hjShift factor, ajFor hjContraction-expansion factor;
Shown in the calculation formula of wavelet neural network output layer such as formula (5):
In formula, wikFor the connection weight of hidden layer to output layer, h (i) is the output of i-th of hidden layer node, and l is implicit
Node layer number, p are output layer number of nodes.
The beneficial effects of the present invention are: defect morphological analysis of the primary study of the present invention based on near-infrared spectral analysis technology
Method, the knot three-dimensional oblique cone model proposed using Pablo[13], by acquiring the near infrared light spectrum information of Defect Edge, structure
The numerical value spectrum for building defect oblique cone incidence angle Yu defect composition transfer utilizes the multiple spot angle information quantitative forecast defect at edge
Form inside solid wood board, so for the quantitative forecast containing defective solid wood board mechanical property provide theories integration and
With reference to.
A kind of solid wood knot inversion method based on near-infrared spectrum analysis proposed by the present invention, it is anti-to give knot defect
The basic step drilled.Method calculates respective center position first with the defect area of image zooming-out face knot;Then,
The multiple spot position for extracting knot Defect Edge, acquires the spectral information of these marginal points and carries out baseline drift and denoising;
With principal component in conjunction with mahalanobis distance rejecting abnormalities spectrum, using K-S divide calibration samples collection, and with ISOMAP to defect
Spectral information characteristics are effectively extracted;Finally, the relationship between knot edge spectrum and the inclination angle is established using wavelet network,
And it is presented using the three-dimensional of Solidworks software realization knot vertebral model.Experiment is using the conduct pair of larch solid wood board
As 160 groups of spectroscopic datas of 40 knots being chosen and acquiring, by measuring the relative tertiary location of upper and lower surfaces knot, meter
Calculate the true value at each point inclination angle.The experimental results showed that using S-G it is smooth+first derivative carries out Pretreated spectra, this method obtains
The spectral profile arrived is apparent, and absorption peak becomes apparent from;Using Isomap dimension reduction method, Nonlinear Dimension Reduction number d=12, neighbour are chosen
Number k=19, SECV are minimum, and method eliminates the redundant data of spectral information;The knot inclination angle established using wavelet neural network
Nonlinear model, prediction related coefficient 0.88, prediction standard difference are 7.65, and relation analysis error is 2.14.
Specific embodiment
As shown in Figure 1 to 11, the solid wood board knot form described in present embodiment based on near-infrared spectrum analysis
The realization process of inversion method is as follows:
1 materials and methods
1.1 experimental materials and experiment flow
For the external morphology of defect, the three-dimensional knot model proposed using Pablo, i.e., knot ideal at oblique circle
Cone[13], defect form is as shown in Figure 1, the basic model needs 3 parameters to determine, respectively O, A and θ.Wherein, O is defect
In the ellipse center location that solid wood board surface is presented;A is the marginal point of solid wood board surface defect, and OA distance can pass through
Image processing techniques is calculated;θ is the inclination angle of A point on Defect Edge.Physically, can by defect on solid wood board,
The relative position of lower surface calculates the external morphology of defect, and then calculates the θ value on marginal point, and the value is as data sample
True value is associated with near infrared spectrum data foundation, completes the prediction at Defect Edge point inclination angle.Theoretically, with Defect Edge information
The increase of acquisition, defect form are more approached with actual conditions.
Experiment selects larch (Larix gmelinii) that plate is made afterwards through processing, therefrom selects containing defect, nothing
Obvious 40, color difference sample is simultaneously numbered.With NIRQuest512 type light-near infrared optical fiber spectrograph and
The near infrared light spectrum information of 4 points of SpectraSuite software collection Defect Edge obtains 160 groups of data.In order to improve modeling
Precision, using exceptional sample rejecting, sample set division, the baseline drift of spectral information and denoising, spectral signature wavelength
The pre-treatment steps such as extraction;When Defect Edge inclination angle is predicted, using wavelet neural network establish spectroscopic data and degree of tilt it
Between relationship;It is presented finally, completing the three-dimensional of data using SolidWorks, completes defect morphological Simulation.Detailed process is as schemed
2。
The near infrared spectrum of 1.2 defect sample pre-processes
1.2.1 spectral information baseline drift, denoising
In order to eliminate baseline drift existing for the near infrared spectrum at plate defect edge and spectra overlapping, and then can be obvious
The variation tendency of spectrum is found out on ground, carries out first derivative to the near infrared spectrum of defect sample first and handles to obtain derivative spectrum,
First derivative spectrum preprocess method is as follows:
In formula, xtFor the discrete spectrum at wavelength t, g is window width.
Then, spectrum high-frequency noise is removed using S-G smoothing processing, improves signal-to-noise ratio, calculate it is smoothed at wavelength t after
Mean Value Formulas is as follows:
In formula, hiFor S-G smoothing factor, H is normalization factor.
1.2.2 sample set divides
For defect spectrum samples unevenly distributed, intermediate sample is easy to cause prediction result to deviate true value, presents
" equalization " phenomenon out divides here, completing calibration set using K-S method.Defect spectrum samples collection division methods based on K-S
It is as follows:
(1) in defect spectrum samples n, calibration set number of samples m is set;
(2) the Euclidean distance l between spectrum is calculatedij, select lijMaximum sample n1And n2Into calibration set;
(3) remaining spectrum is calculated separately at a distance from calibration set spectrum, and is minimized and is constituted set l.L=min (l1v,
l2v,,…,lqv), wherein 1~q indicates the number for being selected into calibration set sample, and v indicates the number of remaining sample to be selected;
(4) it chooses the corresponding sample of maximum value in l and enters calibration set, which is that distance has the farthest sample of calibration samples
This;
(5) it is repeated in and carries out step (3), (4), until calibration set number of samples reaches preset number m.
1.2.3 exceptional sample is rejected
The predictive ability of model can be improved in the rejecting of abnormal defect sample, herein using principal component in conjunction with mahalanobis distance
Method complete exceptional sample rejecting[14].Defect Edge point sample spectrum is similar in principal component space to averaged spectrum
It spends low sample and is considered as exception, size adjustment is carried out to threshold range by selecting different weight coefficient e values, and use mould
Type prediction result carrys out rejecting abnormalities sample.It is as follows that this method calculates threshold range existing for unusual sample:
In formula, AtFor threshold range,The geneva square for being near infrared spectrum data to averaged spectrum in principal component space
Battle array average value;σ is the standard deviation of A;E is the weight coefficient for adjusting threshold range.
The spectroscopic data of Defect Edge point sample i is Ai, work as Ai-AtIt is worth smaller, both shows that similarity is higher;Otherwise also
So.Therefore, e value is bigger, and similarity increases therewith;Conversely, similarity is lower.
1.2.4 characteristic wavelength extracts
Spectroscopic data pretreatment after, in order to improve the accuracy of model, need to collected near infrared light spectrum information into
Row characteristic wavelength extracts, and deletes the redundancy of information.Early-stage study shows that Isomap algorithm has good Nonlinear Dimension Reduction energy
Power[12], extracted herein using the characteristic wavelength that Isomap carries out Defect Edge sample point.Isomap algorithm is broadly divided into three steps
It is rapid: firstly, setting dimensionality reduction number d and neighbour number k, obtains approximate geodesic distance by the shortest path in the data neighborhood figure of building
From;Then, d dimension data is found out using MDS;Finally, effectively output low-dimensional insertion, using d dimension data and angle true value as model
Input, obtains characteristic wavelength by seeking minimal error.
The 1.3 plate defect angle prediction models based on wavelet network
Wavelet network, instead of the activation primitive of BP network hidden layer, is mentioned using wavelet basis function so that wavelet network has
The advantages of taking local message completes the weight of BP network and the optimization of threshold value, overcomes BP network vulnerable to local extremum shadow
It rings[15].The network structure of wavelet neural network is as shown in Figure 3.
In Fig. 3, X1,X2,…,XkThe input parameter of wavelet neural network, i.e., defect sample point preferably go out characteristic wavelength
Point, Y are the prediction output of wavelet neural network, and numerical value is the inclination angle of defect point.It is x in input signal sequencei(i=1,
2 ..., k) when, the hidden layer of wavelet neural network exports calculation formula are as follows:
In formula, h (j) is the output of j-th of node of hidden layer of wavelet neural network, wijFor the input of wavelet neural network
The connection weight of layer and hidden layer, hjFor wavelet basis function, bjFor hjShift factor, ajFor hjContraction-expansion factor.
Shown in the calculation formula of wavelet neural network output layer such as formula (5):
In formula, wikFor the connection weight of hidden layer to output layer, h (i) is the output of i-th of hidden layer node, and l is implicit
Node layer number, p are output layer number of nodes.
Wavelet neural network uses the weight and wavelet basis function parameter of gradient modification method corrective networks, is calculated by the amendment
The amendment of method approaches wavelet neural network prediction output gradually with desired output, and error between the two is smaller and smaller.
2 experimental results
The near infrared spectrum of 2.1 defect sample pre-processes
It is pre-processed using near infrared spectrum of the method that first derivative, S-G are smoothly combined to plate defect sample,
As a result see Fig. 4 and Fig. 5.S-G is smooth+and the major absorbance peak of first derivative treated spectrogram becomes apparent from, while having filtered out more
More high-frequency noise bring interference, spectral profile are more clear, smoothly.
To collected 160 plate defect samples, the ratio between calibration set number and forecast set number are set using K-S method
For 3:1, obtaining calibration set sample is 120, and forecast set sample is 40;Weight coefficient is taken using principal component combination mahalanobis distance
E is 1.25, rejects 19 abnormal defect sample altogether, 17 exceptional samples are wherein eliminated in calibration set, eliminate 2 in forecast set
A exceptional sample, rejecting abnormalities sample results are as shown in Figure 6.
When using Isomap algorithm to plate defect edge spectral signature dimensionality reduction, dimensionality reduction number range d is set as 1~15,
The range of neighbour k is 2~20, and the various combination for choosing d and k tests Data Dimensionality Reduction effect, and model selection is traditional
As a result PLS is shown in Fig. 7.As shown in Figure 7, work as k=19, when d=12, there is the smallest SECV value, SECV 12.53, at this point, lacking
Falling into angle prediction related coefficient R is 0.83, and prediction relation analysis error RPD is 1.80.
2.2 wavelet neural networks predict plate defect angle
12 dimension datas after Isomap is optimized are exported as input as 1 dimension data, pre- using wavelet-neural network model
Plate defect angle to be surveyed, sets 14 for hidden layer node, wavelet basis function uses Morlet function, the learning rate of setting,
Anticipation error, study number are respectively 0.01,0.001,1000, are trained with 103 samples, after network convergence, to 38
A sample is predicted that prediction result is as shown in Figure 8.At this point, Prediction Parameters R, SEP, RPD are respectively 0.89,7.65,2.14.
Fig. 9 is the wavelet network prediction result under all-wave length effect, and Prediction Parameters R, SEP, RPD are respectively 0.41,19.33,1.09.
Parameter comparison shows more accurate based on wavelet network prediction result of the ISOMAP feature after preferred.
In order to verify the superiority of wavelet network, PLS, BP network and wavelet network prediction result is selected to carry out respectively
Compare, the relevant parameter of 3 models is as shown in table 1.The prediction phase relation of wavelet-neural network model prediction plate defect angle
Number R, RPD are above the prediction result of PLS and BP model, and SEP is minimum.Experiment shows that near infrared spectrum data is inclined with defect
There is certain non-linear spectrum between angle, wavelet neural network prediction result is better than PLS linear model;Since BP network needs to save
Point setting and optimization, therefore, neural network forecast is low compared with wavelet network precision of prediction.
Prediction result of the different modeling methods of table 1 to defect angle
Table.1 The prediction comparison of defect angle based on different
models
2.3 plate defect three-dimensional configuration invertings
Defect sample picture is as shown in Figure 10, and 4 spectroscopic datas of sheet material measurement Defect Edge are obtained by model prediction
Corresponding defect inclination angle, specific number are as shown in table 2.By the spatial information of 4 defect points and inclination data input
The form of defect is finally inversed by SolidWorks2016 software, as shown in figure 11.
2 defect morphological parameters of table
Table.2 The parameters of defect shape
3 conclusions of the invention
The present invention applies near-infrared spectrum analysis and mode identification technology in Wood Defects Testing, is plate defect shape
State detection provides a kind of new feasible method, provides reference frame to sheet mechanical property influence for quantitative analysis defect.
The experimental results showed that smooth, single order is led the method combined and pre-processed near infrared spectrum data using S-G, can obtain
To relatively sharp, smooth spectrum;Effective extraction that characteristic wavelength is realized using Isomap Method of Nonlinear Dimensionality Reduction, is improved
The modeling accuracy at defect inclination angle;Effective modeling at Defect Edge inclination angle is realized using wavelet network non-linear modeling method, benefit
Go out the corresponding oblique cone of plate defect with SolidWorks2016 Software on Drawing, realizes the simulation to defect form.It builds
In mold process, due to that can have certain measurement error in Defect Edge positioning, the error of training set will affect defect inclination angle
Prediction models the robustness at the precise positioning of primary study Defect Edge and defect inclination angle in the research of follow-up phase.
The bibliography that the present invention quotes is as follows:
[1]Ruz,G.A.,Estévez,P.A.and Ramirez,P.A.International Journal of
Systems Science,2009,40(2):163
[2]Zhang Yizhuo,Xu Chao,Li Chao,et.al.Journal of forestry research,
2015,26(3):745.
[3]Zhang Yizhuo,Liu Sijia,Cao Jun,et.al.Wood Science and Technology,
2016,50(3):297.
[4] Machado, J.S., Sardinha, R.A., Cruz, H.P.Wood Science and Technology,
2004,38:277.
[5] Zhang Houjiang, Shen Shijie, Cui Yingying, et.al (Zhang Houjiang, Shen Shijie, Cui Ying
Grain husk, etc.) .Journal of Beijing Forestry University (Beijing Forestry University's journal), 2005,27 (6):
91.[6]Olsson,A.,Oscarsson,J.,Serrano,E.et al.European Journal of Wood
Products.2013,71(3):319.
[7]Jungkwon O,Kugbo S,Kwangmo K,et al.Journal of Wood Science,2009,55
(4):264.[8]Hittawe M M,Sidibe D,Meriaudeau F.Proceedings of SPIE-The
International Society for Optical Engineering,2015,9534.
[9] Liang Hao, Cao Jun, Lin Xue, et al (Liang Hao, Cao Jun, Lin Xue, etc.) .Spectroscopy
And Spectral Analysis (spectroscopy and spectrum analysis), 2017,37 (7): 2041.
[10] Yang Zhong, Zhang Mao Mao, Chen Ling, et al.Bioresources, 2015,10 (2):
3314.
[11] Zhang Yizhuo, Su Yaowen, Li Chao, et al (Zhang Yizhuo, Su Yaowen, Li Chao, etc.)
.Journal of Forestry Engineering (Forestry Engineering journal), 2016,1 (6): 17.
[12] Zhang Yizhuo, Su Yaowen, Li Chao, et al (Zhang Yizhuo, Su Yaowen, Li Chao, etc.)
.Journal of Beijing Forestry University (Beijing Forestry University's journal), 2016,38 (8): 99.
[13]Pablo Guindos,Manuel Guaita.Wood Science and Technology,2013,47
(3):585.
[14] Zhang Lingshua, Wang Weidong, Gu Yunhon, et al (Zhang Lingshuai, Wang Weidong, Gu Yunhong,
Deng) .Spectroscopy and Spectral Analysis (spectroscopy and spectrum analysis), 2011,31 (5): 1254.
[15] Song Rushun (Song Rushun) .Control and Decision (control and decision), 2000,15 (6):
765.