A method of laser microprobe nicety of grading is improved using characteristics of image
Technical field
The invention belongs to laser microprobe constituent analysis correlative technology fields, utilize characteristics of image more particularly, to a kind of
The method for improving laser microprobe nicety of grading.
Background technique
Laser microprobe technology, that is, laser induced breakdown spectroscopy (laser-induced breakdown
Spectroscopy, abbreviation LIBS) be it is a kind of be radiated at sample surfaces using superlaser and generate plasma, then pass through spectrum
Instrument plasma spectrum is acquired and analyzes a kind of element analysis technology to determine sample elemental composition and content.LIBS
The advantages that technology is in situ with its, quick, pollution-free has been widely used for metal detection, agricultural product are traced to the source and ore is explored etc.
In the sample identification and classification of numerous areas.
Existing LIBS classification method is generally based on the realization of multiline intensity, such as multiline Peak Intensity Method (Muti-line
Peak Intensity Method, MPIM) and full spectrometry (Full Spectrum Method, FSM).However, multiline peak value
The classifying quality of method is affected by choice of spectrum method and spectral line effective quantity, and artificial route selection is in the presence of time-consuming, effect
Rate is low and is difficult to the problem of determining selected spectral line corresponding element.However, automatic route selection is generally required in conjunction with other calculations such as PLS, GA
Method carries out, and usually requires that PCA algorithm is combined to carry out dimensionality reduction after route selection, and assorting process is complex.Side based on full spectrum classification
Although method can be omitted route selection process, but due to introducing more interference spectral lines and approximate variable, be easy to cause eigenmatrix non-just
It is fixed, it can only be used in conjunction with complicated algorithms such as SVM or neural networks.Furthermore due to spectrometer wavelength range and spectral resolution
Limitation, the quantity and ratio that can characterize the validity feature spectral line of specific sample is all difficult to improve, and leads to point under special algorithm
Class performance is difficult to improve.
Currently, relevant technical staff in the field has done some researchs, such as paper " Discrimination of
biological and chemical threat simulants in residue mixtures on multiple
Substrates " (Anal Bioanal Chem (2011) 400:3289-3301) disclose using full spectrum model and route selection model
Classification and Identification is carried out to pure biochemical noxious residue respectively.In substrate of aluminum, the classification accuracy rate based on this two model reaches respectively
98.9% and 89.2%, it is respectively 54.8% and 47.4% based on the classification accuracy rate on composite substrate, and the document is by two kinds
Common classification method and PLS algorithm combine, although realizing simple more classification of unknown sample, assorting process is still
It is more complex and still relatively low to the discrimination of complex environment (such as more substrate conditions).For another example notification number is CN104483292A, public affairs
Announcement day is 01 day 04 year 2015, invention and created name is a kind of using multiline ratio method raising laser microprobe analysis accuracy
Method patent disclose it is a kind of using multiline ratio method improve laser microprobe analysis precision method, although this method can
To improve laser microprobe nicety of grading, but it is still unavoidable from the complex process of route selection and because of selected spectral line object or number
The phenomenon that mesh difference causes classification results different.Correspondingly, there is develop a kind of classification performance preferably and classification phase for this field
To the technical need of the simple method for improving laser microprobe nicety of grading using characteristics of image.
Summary of the invention
Aiming at the above defects or improvement requirements of the prior art, laser is improved using characteristics of image the present invention provides a kind of
It is preferable to study and devise a kind of classification performance the characteristics of classification based on existing laser microprobe for the method for probe nicety of grading
And the relatively simple method for improving laser microprobe nicety of grading using characteristics of image of assorting process.The image that the method uses
Feature is multidimensional spectral signature, has preferably characterization performance, which thereby enhances nicety of grading, and without manually or automatically selecting
Line and simplify assorting process.
To achieve the above object, the present invention provides a kind of sides that laser microprobe nicety of grading is improved using characteristics of image
Method, method includes the following steps:
S1, using the plasma spectrometry of spectra collection device acquisition sample, the plasma spectrometry is multidimensional spectrum;
S2 carries out image conversion processing to the plasma spectrometry to obtain 16 grayscale images;
S3 extracts characteristics of image based on the grayscale image, and described image feature is multidimensional spectral signature;
Described image feature is trained as the input of sorting algorithm to obtain based on described image feature by S4
Disaggregated model;
The characteristics of image of sample to be sorted is input to the disaggregated model by S5, the disaggregated model output category result,
Thus classification is completed.
Further, true according to effective wave band of the spectrometer of the spectra collection device and valid pixel in step S2
Determine total pixel of spectrum picture, then determines the row pixel number and column pixel number of spectrum picture;Later, by the spectrum of each pixel
Intensity is written in image file structure, and correspondence obtains the gray value of pixel.
Further, step S3 specifically includes following sub-step:
S31 calculates the horizontal direction of each pixel of spectrum picture and the gradient of vertical direction;
S32 calculates gradient magnitude and the side of each pixel according to the gradient of obtained horizontal direction and vertical direction
To value;
Spectrum picture is divided into multiple spectrum picture units to set pixel number, and counts each spectrum picture list by S33
The gradient direction value and gradient magnitude of each pixel in member, and using gradient magnitude as weighting coefficient, each spectrum picture unit is raw
The gradient orientation histogram for being NumBins at a port number, the corresponding HOG feature of a gradient orientation histogram, that is, scheme
As feature;
The spectrum picture unit is divided into BlockSize image block, according to block registration parameters by S34
BlockOverlap determines HOG eigenmatrix.
Further, the horizontal direction gradient G of pixel P (x, y)x(x, y) and vertical gradient Gy(x, y) is adopted respectively
It is calculated with formula (1) and formula (2), formula (1) and formula (2) are respectively as follows:
Gx(x, y)=H (x+1, y)-H (x-1, y) (1)
Gy(x, y)=H (x, y+1)-H (x, y-1) (2)
In formula, H (x, y) indicates the gray value of pixel P (x, y).
Further, pixel P (xij,yij) at gradient magnitude and gradient direction formula (3) and formula is respectively adopted
(4) it is calculated, formula (3) and formula (4) are respectively as follows:
In formula, G (x, y) is gradient magnitude matrix;α (x, y) is gradient direction matrix.
Further, the HOG feature is in the nature the gradient direction relationship of multidimensional spectrum.
Further, described image feature is any one of following characteristics: HOG feature, HAAR feature, LBP feature.
Further, the sorting algorithm is any one of following algorithm: algorithm of support vector machine, neural network are calculated
Method, Partial Least Squares algorithm.
Further, the spectra collection device includes laser, reflecting mirror, focus lamp, collection head, spectrometer, ICCD
Camera and computer, the laser and the reflecting mirror relative spacing are arranged, and the focus lamp is located under the reflecting mirror
Side;The laser is connected to the computer, and the computer is connected to the ICCD camera;The ICCD camera is adjacent to institute
State spectrometer setting;The spectrometer is connected to the collection head by optical fiber.
Further, the laser is used for for generating high energy density laser beam, the reflecting mirror to the laser
Shu Jinhang reflection, laser beam after reflection enter the condenser lens and after the condenser lens focusing ablation in sample table
To generate plasma spectrometry, the collection head is used to acquire the plasma light signal of plasma spectrometry, and will be described etc. in face
Ion optical signal is transferred to the spectrometer, and then the ICCD camera is used to the plasma optical signal being converted into spectrum
The computer is transferred to after signal.
In general, through the invention it is contemplated above technical scheme is compared with the prior art, benefit provided by the invention
It is mainly had the advantages that with the method that characteristics of image improves laser microprobe nicety of grading
1. extracting characteristics of image based on the grayscale image, described image feature is multidimensional spectral signature, and existing multispectral
Line Peak Intensity Method and full spectrometry are all based on one-dimensional spectral intensity and establish characteristic of division, more due to the weak stability of LIBS spectrum
Tieing up spectral signature has preferably characterization performance compared with one-dimensional spectral signature, to have higher nicety of grading.
Classify 2. this method is based on characteristics of image, classify relative to multiline Peak Intensity Method and full spectrometry, without artificial
Route selection or automatic route selection, assorting process is simpler, with strong applicability.
3. the collection head is used to acquire the plasma light signal of plasma spectrometry, and the plasma light signal is passed
It is defeated by the spectrometer, and then the ICCD camera after the plasma optical signal is converted into spectral signal for being transferred to
The computer, using image conversion information, data volume is smaller, is convenient for calculation process, improves efficiency.
4. described image feature is any one of following characteristics: HOG feature, HAAR feature, LBP feature;The classification
Algorithm is any one of following algorithm: algorithm of support vector machine, neural network algorithm, Partial Least Squares algorithm, it is seen that figure
As feature can also be combined with a variety of sorting algorithms using the acquisition modes of multi-purpose characteristics of image, be improved practicability,
Flexibility is preferable.
Detailed description of the invention
Fig. 1 is the method for improving laser microprobe nicety of grading using characteristics of image that better embodiment of the present invention provides
Flow diagram.
Fig. 2 is the spectra collection device that the method for improving laser microprobe nicety of grading using characteristics of image in Fig. 1 is related to
Schematic diagram.
Fig. 3 is the light for the characteristics of image that the method for improving laser microprobe nicety of grading using characteristics of image in Fig. 1 obtains
Spectrogram.
Fig. 4 is the ash for the characteristics of image that the method for improving laser microprobe nicety of grading using characteristics of image in Fig. 3 is related to
Degree figure.
Fig. 5 is to extract spectrum picture HOG using the method for improving laser microprobe nicety of grading using characteristics of image in Fig. 3
The principle and flow diagram of feature.
(a), (b) figure in Fig. 6 are to improve laser spy using characteristics of image using in existing full spectrometry and Fig. 3 respectively
The classification results schematic diagram that the method for needle nicety of grading obtains.
Fig. 7 is to improve the method for laser microprobe nicety of grading to plastics, steel, mine using characteristics of image using in Fig. 3
Stone and rock sample classified obtained by obtained result schematic diagram.
In all the appended drawings, identical appended drawing reference is used to denote the same element or structure, wherein 1- laser, 2-
Reflecting mirror, 3- focus lamp, 4- sample, 5- collection head, 6- spectrometer, 7-ICCD camera, 8- computer, 9- data line, 10- light
It is fine.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.As long as in addition, technical characteristic involved in the various embodiments of the present invention described below
Not constituting a conflict with each other can be combined with each other.
Fig. 1 and Fig. 2 is please referred to, what better embodiment of the present invention provided improves laser microprobe classification essence using characteristics of image
LIBS spectral translation is first 16 grayscale images, then extracts characteristics of image, established in conjunction with related algorithm by the method for degree
Disaggregated model, to realize the identification and classification of sample.
The method for improving laser microprobe nicety of grading using characteristics of image mainly comprises the steps that
S1, using the plasma spectrometry of spectra collection device acquisition sample, the plasma spectrometry is multidimensional spectrum.
Specifically, it gets out sample first, then, provides a spectra collection device, and fill using the spectra collection
It sets and the acquisition of multidimensional plasma spectrometry is carried out to the sample.Wherein, the spectra collection device includes laser 1, reflecting mirror
2, focus lamp 3, collection head 5, spectrometer 6, ICCD camera 7 and computer 8, the laser 1 and 2 relative spacing of reflecting mirror
Setting, the focus lamp 3 are located at the lower section of the reflecting mirror 2.Meanwhile the laser 1 is connected to the meter by data line 9
Calculation machine 8, the computer 8 are connected to the ICCD camera 7.The ICCD camera 7 is arranged adjacent to the spectrometer 6.The light
Spectrometer 6 is connected to the collection head 5 by optical fiber 10.
Reflecting mirror 2 described in the high energy density laser Shu Jing that the laser 1 generates enters the condenser lens after reflecting
3, laser beam after the condenser lens 3 focusing on 4 surface of sample to generate plasma spectrometry, adopt for ablation by the collection head 5
Collect the plasma light signal of plasma spectrometry, and the plasma light signal is transferred to the spectrometer 6, the ICCD phase
The plasma optical signal is converted into being transferred to the computer 8 after spectral signal again by machine 7.
S2 carries out image conversion processing to the plasma spectrometry to obtain 16 grayscale images.Referring to Fig. 3, specific
The following steps are included:
S21 determines the total pixel number of spectrum picture according to effective wave band of the spectrometer 6 and valid pixel.If described
The valid pixel number of spectrometer 6 is n, then its corresponding spectrum picture total pixel number is n.
S22 determines the row pixel number c and column pixel number w of spectrum picture, and c=n/w.It is rounded downwards when c is decimal,
I.e. image remainder province is slightly disregarded.
S23, by the spectral intensity write-in image file structure of each pixel, the pixel number of every width spectrum is n, therefore single width
The intensity data of spectrum is that 1x n ties up intensity matrix I, and data in the intensity matrix are sequentially written according to obtained ranks number
To obtain spectrum picture in image file structure.By taking the random point P (x, y) in spectrum picture as an example, gray value is intensity
The intensity value of matrix I (x*w+y) a spectral pixel.
S3 extracts characteristics of image based on the grayscale image, and described image feature is multidimensional spectral signature.Please refer to Fig. 4 and
Fig. 5, specifically includes the following steps:
S31 calculates the gradient of each pixel horizontal direction of spectrum picture and vertical direction, point P x, y) level side
To gradient Gx(x, y) and vertical gradient GyFormula (1) and formula (2) is respectively adopted to calculate in (x, y).Wherein, H (x, y) table
Show the gray value of the pixel, it can thus be concluded that gradient c x w both horizontally and vertically ties up matrix Gx、Gy。
Gx(x, y)=H (x+1, y)-H (x-1, y) (1)
Gy(x, y)=H (x, y+1)-H (x, y-1) (2)
Then, the gradient magnitude and direction value of each pixel, pixel P (x are calculatedij,yij) at gradient magnitude and ladder
Formula (3) is respectively adopted for degree direction and formula (4) is calculated, it can thus be concluded that gradient magnitude matrix G (x, y) and gradient direction square
Battle array α (x, y).
Later, spectrum picture is divided into floor (c/CellSize) * floor (w/ to set pixel number CellSize
CellSize) multiple spectrum picture units (floor () is downward bracket function), and count every in each spectrum picture unit
The gradient direction value and gradient magnitude of a pixel, finally using gradient magnitude as weighting coefficient, each spectrum picture unit is produced
The gradient orientation histogram that one port number is NumBins, the corresponding HOG feature of a gradient orientation histogram.
The spectrum picture unit is divided into BlockSize image block, according to block registration parameters by S32
BlockOverlap determines HOG eigenmatrix, and this feature matrix dimensionality is that 1*n ties up matrix, the matrix, that is, single width spectrum picture
HOG eigenmatrix.Wherein, n=BlockPerimage*BlockSize*NumBin, BlockPerimage=floor ((size
(I) ./CellSize-BlockSize)/(BlockSize-BlockOverlap)+1), wherein floor () is to be rounded downwards
Function;Size () is number of members statistical function in matrix.
Described image feature is trained as the input of sorting algorithm to obtain based on described image feature by S4
Disaggregated model.
Specifically, if sharing S sample, each sample acquires m width spectrum, and spectrum sum is k=s × m, it can thus be concluded that special
Sign image is k width, and using the odd numbered sequences image from 1 to k as training set image, even order is test set image, respectively with it
Characteristics of image establishes training set and test set, by the input algorithm training of gained training set image characteristic matrix to obtain based on image
The sorting algorithm model of feature.
The characteristics of image of sample to be sorted is input to the disaggregated model by S5, the disaggregated model output category result,
Thus classification is completed.
Embodiment 1
The method for improving laser microprobe nicety of grading using characteristics of image that first embodiment of the invention provides mainly is wrapped
Include following steps:
Step 1, preparation of samples and LIBS spectra collection.Present embodiment uses the rice of 24 kinds of different cultivars for experiment
Sample, each kind are cultivated by different research institutions respectively, and rice type includes Indica Hybrid Rice with Good-quality, round-grained rice type routine water
Rice, round-grained rice type routine early rice, the indica type three-line hybrid rice of indica type conventional early rice, the details of sample are as shown in table 1.
Step 2, the image procossing of spectrum.The actually active wave band of spectrometer 6 used by present embodiment is
200.331nm~894.514nm, the valid pixel number of every width spectrum are 24262.Present embodiment using from left to right, from upper
Conversion regime (ranks number is respectively set to 81 and 298) under, i.e., by the corresponding spectral intensity values of 24262 pixels with row
Column form is arranged successively (remainder province is slightly disregarded), is written in png image data structure with the related library function of Matlab, and protect
16 grayscale images of width png format are saved as, which is the corresponding gray level image of single width LIBS spectrum.It is shared in present embodiment
2400 width spectrum, can be to 2400 width spectrum pictures after image procossing.
1 24 kinds of rice variety information tables of table
Step 3 extracts characteristics of image.Present embodiment using obtained spectrum picture and HOG feature establish training set and
Test set.Meanwhile image HOG feature carries library function extractHOGFeatures () by Matlab to obtain.In this reality
Apply in mode, image characteristics extraction parameter is respectively set as follows: unit pixel number CellSize is set as 28;Unit number in block
BlokSize is set as 2;Block overlapping number BolckOverlap is set as 1;Histogram port number NumBins is set as 9 (i.e. by 0 °~180 °
Angular range is divided into 9 grades, and such as 0 °~20 °, 20 °~40 ° ... 160 °~180 ° etc., its absolute value is taken when angle is negative).
In addition, relevant parameter such as image line columns, elementary area pixel number CellSize that present embodiment is related in this process and
Details are not described herein for the parameter optimisation procedure of unit number BlockSize etc. in block.
Step 4, combination supporting vector machine algorithm (SVM) establish disaggregated model.Present embodiment is by image HOG feature
SVM algorithm is combined to realize LIBS classification.Specifically, the HOG eigenmatrix of 1-2400 width odd numbered sequences image is inputted
SVM algorithm carries out trained to generate the more disaggregated models of unknown sample based on spectrum picture HOG feature.
The HOG feature of the even order image of the above 2400 width spectrum picture is inputted the above disaggregated model, institute by step 5
State disaggregated model output category result.
The rice sample classification total result comparison of the method for the present invention (IFM) and full spectrometry (FSM) to 24 kinds of different cultivars
As shown in Figure 6, it is seen then that the prediction note of b figure and being overlapped for true note in Fig. 6 obtained using method provided by the invention
Rate is higher.The classification results of single sample are as shown in table 2.
2 characteristics of image method of table and full spectrometry classification results single sample contrast table
Using the rice of 24 kinds of different cultivars as in the classification experiments of sample, the overall classification accuracy of characteristics of image method is
82.5%, the overall classification accuracy of full spectrometry is 55.75%, and the classification performance of characteristics of image method has compared to the classification of full spectrometry
Apparent to improve, overall classification accuracy improves 27%.Wherein the discrimination of LJ7 sample is promoted to 90% from 20%, list
A sample maximum lift amplitude is 70%, remaining sample promotes amplitude and differs from 4%~44%.
Referring to Fig. 7, provided by the present invention smart using characteristics of image raising laser microprobe classification in order to further verify
The method of degree has carried out further class test to a variety of plastics, steel, ore and rock sample using method of the invention,
Wherein plastics, steel, rock and ore sample quantity are respectively 20 kinds, 18 kinds, 15 kinds and 16 kinds.Know from class test result,
Method provided by the invention all reaches 99% or more to the classification accuracy of plastics and steel, accurate to the classification of rock and ore
Rate has respectively reached 97.07% and 92.5%.Classify compared to full spectrometry, classification accuracy has obtained generally improving, and improves width
Degree is respectively 0.33%, 1.77%, 1.87% and 4%.In summary, classification method provided by the invention is not only to different cultivars
Rice sample have preferable classification performance, to plastics, steel, ore and rock sample also all have good classification performance,
With good universality and stability.
The method provided by the invention for improving laser microprobe nicety of grading using characteristics of image, this method are based on multidimensional image
Feature is classified, and assorting process is simplified, and improves nicety of grading, and have preferable applicability and stability, simultaneously
Improve the efficiency of product classification.
As it will be easily appreciated by one skilled in the art that the foregoing is merely illustrative of the preferred embodiments of the present invention, not to
The limitation present invention, any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should all include
Within protection scope of the present invention.