CN112801133A - Spectrum identification and classification method based on keras model - Google Patents
Spectrum identification and classification method based on keras model Download PDFInfo
- Publication number
- CN112801133A CN112801133A CN202011606774.0A CN202011606774A CN112801133A CN 112801133 A CN112801133 A CN 112801133A CN 202011606774 A CN202011606774 A CN 202011606774A CN 112801133 A CN112801133 A CN 112801133A
- Authority
- CN
- China
- Prior art keywords
- model
- spectrum
- steps
- classification
- following
- 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
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000001228 spectrum Methods 0.000 title claims abstract description 47
- 239000011159 matrix material Substances 0.000 claims abstract description 17
- 238000012360 testing method Methods 0.000 claims abstract description 16
- 230000003595 spectral effect Effects 0.000 claims description 17
- 210000002569 neuron Anatomy 0.000 claims description 15
- 230000004913 activation Effects 0.000 claims description 13
- 238000005457 optimization Methods 0.000 claims description 4
- 238000010521 absorption reaction Methods 0.000 claims description 3
- 238000010606 normalization Methods 0.000 claims description 3
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000013145 classification model Methods 0.000 abstract description 2
- 230000000694 effects Effects 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 29
- 238000010801 machine learning Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013501 data transformation Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention belongs to the technical field of information classification methods, and particularly relates to a spectrum identification classification method based on a keras model. The invention comprises the following steps: step 1: establishing a standard sample library for the sample set; step 2, randomly dividing a standard sample library into a training sample set and a testing sample set; step 3, constructing a model; step 4, compiling the model; step 5, training a model; and 6, outputting a classification result. According to the invention, the spectrum text file is converted into a two-dimensional matrix, and a classification model is built to perform high-precision spectrum identification and classification, so that the model structure can be continuously optimized to improve the classification effect; the invention classifies and identifies the spectrum through the algorithm, reduces manual intervention and improves the classification efficiency.
Description
Technical Field
The invention belongs to the technical field of information classification methods, and particularly relates to a spectrum identification classification method based on a keras model.
Background
At present, the traditional ground object spectrum identification is generally based on professional software such as envi and the like. However, as the amount of data increases and the complexity of the data increases, conventional spectral identification has been insufficient for classification tasks in the context of complex large-scale data. And the steps are various, manual intervention is needed, and high requirements are provided for professional knowledge of spectrum classification personnel, so that the background environment of the current big data cannot be met.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a spectrum identification and classification method based on machine learning, which carries out high-precision spectrum identification and classification by converting a spectrum text file into a two-dimensional matrix and building a classification model, and can continuously optimize the model structure and improve the classification effect; the invention classifies and identifies the spectrum through the algorithm, reduces manual intervention and improves the classification efficiency.
The technical scheme adopted by the invention is as follows:
a spectrum identification and classification method based on a keras model comprises the following steps:
step 1: establishing a standard sample library for the sample set; step 2, randomly dividing a standard sample library into a training sample set and a testing sample set; step 3, constructing a model; step 4, compiling the model; step 5, training a model; and 6, outputting a classification result.
The step 1 comprises the following steps: step 1.1, data normalization; step 1.2 data tagging.
The step 1.1 comprises the following steps: the collected spectral data were resampled to a spectral range of 2000 and 2500 nm.
The step 1.2 comprises the following steps: and opening the spectrum through remote sensing data processing software, and performing lithology marking on the spectral data of the standard sample library by comparing the absorption peaks of the spectral curves of the standard spectral library.
The step 2 comprises the following steps: step 2.1, test data are constructed: and (3) adding the following components in percentage by weight of 5: 1, randomly dividing the standard sample library spectrum into a training sample set and a testing sample set; step 2.2 data conversion: and converting the standard sample library spectrum and the test sample library spectrum into a two-dimensional matrix.
The step 3 comprises the following steps:
step 3.1, add first layer network
Adding a full connection layer by an add method, wherein the layer defines 64 neurons, inputting X elements, wherein the X elements are the number of spectrums in a training sample library, and adding an activation function relu function by the add method;
step 3.2, adding a second layer network
Adding a full connection layer by an add method, wherein the layer defines 32 neurons and inputs 900 elements, the 900 elements are values output by a relu function in a first layer network, and adding an activation function relu function by the add method;
step 3.3, add third tier network
Adding a full connection layer by an add method, wherein the layer defines 16 neurons and inputs 200 elements, 200 elements are values output by a relu function in a second layer network, and an activation function relu function is added by the add method;
step 3.4, add layer four network
And adding a full connection layer by an add method, wherein the layer defines 8 neurons, dividing training results into 10 classes, and adding an activation function relu function by the add method.
The step 4 comprises the following steps: and compiling the model generated in the step 3 by adopting an SGD optimization function.
The step 5 comprises the following steps:
step 5.1, reading a two-dimensional matrix generated by the spectrum of the standard sample library in the step 2.2;
step 5.2, reading the two-dimensional matrix read in the step 5.1 into the step 3.1;
step 5.3, importing the result generated in the step 3.2 into the step 3.3;
step 5.4, importing the result of the step 3.3 into the step 3.4;
step 5.5, step 3.4 generating key parameters;
step 5.6, reading a two-dimensional matrix generated by the spectrum of the test sample library in the step 2.2;
step 5.7, reading the two-dimensional matrix into step 3.1;
step 5.8, inputting the key parameters in the step 5.5 into a model;
and 5.9, repeating the step 5.3 to the step 5.4.
Compared with the prior art, the invention has the beneficial effects that:
(1) the invention provides a spectrum identification and classification method based on machine learning to realize classification of large-scale ground feature spectra.
(2) The method solves the problems of large workload and high requirement on the professional technical level of the classification personnel of the traditional remote sensing spectrum identification classification method, and well solves the spectrum classification problem under the current complex big data background.
Drawings
FIG. 1 is a flow chart of a machine learning-based clustering method of the present invention;
fig. 2 is a constructed model structure.
Detailed Description
The spectrum identification and classification method based on the keras model provided by the invention is further described in detail with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, the spectral identification and classification method based on a keras model provided by the present invention includes the following steps:
step 1: building a standard sample library for a sample set
Step 1.1 data normalization
The collected spectral data were resampled to a spectral range of 2000 and 2500 nm.
Step 1.2 data tagging
And opening the spectrum through remote sensing data processing software such as ENVI and the like, and performing lithology marking on the spectral data of the standard sample library by comparing the absorption peaks of the spectral curve of the standard spectral library.
Step 2, randomly dividing the standard sample library into a training sample set and a testing sample set
Step 2.1 construction of test data
And (3) adding the following components in percentage by weight of 5: a scale of 1 randomly divides the standard sample library spectra into a training sample set and a test sample set.
Step 2.2 data transformation
Converting the standard sample library spectrum and the test sample library spectrum into a two-dimensional matrix;
step 3, constructing a model
Step 3.1 Add first layer network as described in FIG. 2
Adding a full connection layer by an add method, defining 64 neurons in the layer, inputting X elements, wherein the X elements are the number of spectrums in a training sample library, adding an activation function relu function by the add method, calculating the X elements and the 64 neurons in the step respectively, filtering and outputting a result by the relu activation function, wherein the relu function has the function of outputting 0 when the X elements and the neurons input negative numbers after calculation, and outputting the relu function when the calculation result is any positive number. (ii) a
A neuron is a model, a model that includes input, output, and computational functions
Step 3.2 Add layer two network
Adding a full connection layer by an add method, wherein the layer defines 32 neurons and inputs 900 elements, the 900 elements are values output by a relu function in a first layer network, and adding an activation function relu function by the add method;
step 3.3 Add layer three network
Adding a full connection layer by an add method, wherein the layer defines 16 neurons and inputs 200 elements, 200 elements are values output by a relu function in a second layer network, and an activation function relu function is added by the add method;
step 3.4 Add layer four network
Adding a full connection layer by an add method, wherein the layer defines 8 neurons, dividing training results into 10 types, and adding an activation function relu function by the add method;
step 4, compiling the model
The optimization function is SGD, and the learning rate is set to be 0.03; the SGD is also called as random gradient descent, and is one of the commonly used optimization algorithms, and a random iteration loss function, although the loss function obtained by each iteration is not in the global optimal direction, the large overall direction is in the global optimal solution, and the final result is often near the global optimal solution.
Step 5, training the model
Step 5.1, reading a two-dimensional matrix generated by the spectrum of the standard sample library in the step 2.2;
step 5.2, reading the two-dimensional matrix read in the step 5.1 into the step 3.1;
step 5.3, importing the result generated in the step 3.2 into the step 3.3;
step 5.4, importing the result of the step 3.3 into the step 3.4;
step 5.5, step 3.4 generating key parameters;
step 5.6, reading a two-dimensional matrix generated by the spectrum of the test sample library in the step 2.2;
step 5.7, reading the two-dimensional matrix into step 3.1
Step 5.8, inputting the key parameters in the step 5.5 into the model
Step 5.9, repeat step 5.3-step 5.4
And 6, outputting a classification result.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the technical scope of the present invention.
Claims (8)
1. A spectrum identification and classification method based on a keras model is characterized in that: the method comprises the following steps:
step (1): establishing a standard sample library for the sample set; step (2), randomly dividing a standard sample library into a training sample set and a testing sample set; step (3), constructing a model; step (4), compiling the model; step (5), training a model; and (6) outputting a classification result.
2. The method for spectrum identification and classification based on a keras model as claimed in claim 1, wherein: the step (1) comprises the following steps: step (1.1) data normalization; and (1.2) marking data.
3. The method for spectrum identification and classification based on a keras model as claimed in claim 2, wherein: the step (1.1) comprises the following steps: the collected spectral data were resampled to a spectral range of 2000 and 2500 nm.
4. The method for spectrum identification and classification based on a keras model as claimed in claim 3, wherein: the step (1.2) comprises the following steps: and opening the spectrum through remote sensing data processing software, and performing lithology marking on the spectral data of the standard sample library by comparing the absorption peaks of the spectral curves of the standard spectral library.
5. The method for spectrum identification and classification based on a keras model as claimed in claim 4, wherein: the step (2) comprises the following steps: step (2.1) constructing test data: and (3) adding the following components in percentage by weight of 5: 1, randomly dividing the standard sample library spectrum into a training sample set and a testing sample set; step (2.2) data conversion: and converting the standard sample library spectrum and the test sample library spectrum into a two-dimensional matrix.
6. The method for spectrum identification and classification based on a keras model as claimed in claim 5, wherein: the step (3) comprises the following steps:
step (3.1), adding the first layer network
Adding a full connection layer by an add method, wherein the layer defines 64 neurons, inputting X elements, wherein the X elements are the number of spectrums in a training sample library, and adding an activation function relu function by the add method;
step (3.2), adding a second layer network
Adding a full connection layer by an add method, wherein the layer defines 32 neurons and inputs 900 elements, the 900 elements are values output by a relu function in a first layer network, and adding an activation function relu function by the add method;
step (3.3), adding a third layer network
Adding a full connection layer by an add method, wherein the layer defines 16 neurons and inputs 200 elements, 200 elements are values output by a relu function in a second layer network, and an activation function relu function is added by the add method;
step (3.4), adding a fourth layer network
And adding a full connection layer by an add method, wherein the layer defines 8 neurons, dividing training results into 10 classes, and adding an activation function relu function by the add method.
7. The method for spectrum identification and classification based on a keras model as claimed in claim 6, wherein: the step (4) comprises the following steps: compiling the model generated in the step (3) by adopting an SGD optimization function.
8. The method as claimed in claim 7, wherein the method comprises the following steps: the step (5) comprises the following steps:
step (5.1), reading a two-dimensional matrix generated by the spectrum of the standard sample library in the step (2.2);
step (5.2), reading the two-dimensional matrix read in step (5.1) into step (3.1);
step (5.3), importing the result generated in the step (3.2) into the step (3.3);
step (5.4), importing the result of the step (3.3) into the step (3.4);
generating key parameters in the steps (5.5) and (3.4);
step (5.6), reading a two-dimensional matrix generated by the spectrum of the test sample library in the step (2.2);
step (5.7), reading the two-dimensional matrix into step (3.1);
step (5.8), inputting the key parameters in the step (5.5) into a model;
and (5.9) repeating the steps (5.3) to (5.4).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011606774.0A CN112801133A (en) | 2020-12-30 | 2020-12-30 | Spectrum identification and classification method based on keras model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011606774.0A CN112801133A (en) | 2020-12-30 | 2020-12-30 | Spectrum identification and classification method based on keras model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112801133A true CN112801133A (en) | 2021-05-14 |
Family
ID=75804304
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011606774.0A Pending CN112801133A (en) | 2020-12-30 | 2020-12-30 | Spectrum identification and classification method based on keras model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112801133A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016091017A1 (en) * | 2014-12-09 | 2016-06-16 | 山东大学 | Extraction method for spectral feature cross-correlation vector in hyperspectral image classification |
CN109344891A (en) * | 2018-09-21 | 2019-02-15 | 北京航空航天大学 | A kind of high-spectrum remote sensing data classification method based on deep neural network |
CN110031414A (en) * | 2019-04-29 | 2019-07-19 | 北京航空航天大学 | A kind of multi-layer perception (MLP) high spectrum mineral classification method based on spectral absorption index |
CN110298396A (en) * | 2019-06-25 | 2019-10-01 | 北京工业大学 | Hyperspectral image classification method based on deep learning multiple features fusion |
CN110516596A (en) * | 2019-08-27 | 2019-11-29 | 西安电子科技大学 | Empty spectrum attention hyperspectral image classification method based on Octave convolution |
CN111985543A (en) * | 2020-08-06 | 2020-11-24 | 西北大学 | Construction method, classification method and system of hyperspectral image classification model |
-
2020
- 2020-12-30 CN CN202011606774.0A patent/CN112801133A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016091017A1 (en) * | 2014-12-09 | 2016-06-16 | 山东大学 | Extraction method for spectral feature cross-correlation vector in hyperspectral image classification |
CN109344891A (en) * | 2018-09-21 | 2019-02-15 | 北京航空航天大学 | A kind of high-spectrum remote sensing data classification method based on deep neural network |
CN110031414A (en) * | 2019-04-29 | 2019-07-19 | 北京航空航天大学 | A kind of multi-layer perception (MLP) high spectrum mineral classification method based on spectral absorption index |
CN110298396A (en) * | 2019-06-25 | 2019-10-01 | 北京工业大学 | Hyperspectral image classification method based on deep learning multiple features fusion |
CN110516596A (en) * | 2019-08-27 | 2019-11-29 | 西安电子科技大学 | Empty spectrum attention hyperspectral image classification method based on Octave convolution |
CN111985543A (en) * | 2020-08-06 | 2020-11-24 | 西北大学 | Construction method, classification method and system of hyperspectral image classification model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111062282B (en) | Substation pointer instrument identification method based on improved YOLOV3 model | |
CN109492748B (en) | Method for establishing medium-and-long-term load prediction model of power system based on convolutional neural network | |
CN111401156B (en) | Image identification method based on Gabor convolution neural network | |
CN111008224B (en) | Time sequence classification and retrieval method based on deep multitasking representation learning | |
CN113688869B (en) | Photovoltaic data missing reconstruction method based on generation countermeasure network | |
CN112860904B (en) | External knowledge-integrated biomedical relation extraction method | |
CN112613536A (en) | Near infrared spectrum diesel grade identification method based on SMOTE and deep learning | |
CN107704883A (en) | A kind of sorting technique and system of the grade of magnesite ore | |
CN112732921B (en) | False user comment detection method and system | |
CN113609488B (en) | Vulnerability detection method and system based on self-supervised learning and multichannel hypergraph neural network | |
CN105868796A (en) | Design method for linear discrimination of sparse representation classifier based on nuclear space | |
CN112766283A (en) | Two-phase flow pattern identification method based on multi-scale convolution network | |
CN114331122A (en) | Key person risk level assessment method and related equipment | |
CN114978613A (en) | Network intrusion detection method based on data enhancement and self-supervision feature enhancement | |
Wang et al. | Learning to group and label fine-grained shape components | |
CN112559741B (en) | Nuclear power equipment defect record text classification method, system, medium and electronic equipment | |
CN113987910A (en) | Method and device for identifying load of residents by coupling neural network and dynamic time planning | |
CN109164794A (en) | Multivariable industrial process Fault Classification based on inclined F value SELM | |
CN114295967A (en) | Analog circuit fault diagnosis method based on migration neural network | |
CN117132831A (en) | Depth residual error network model for coal gangue identification, coal gangue identification method and system | |
CN116975634A (en) | Micro-service extraction method based on program static attribute and graph neural network | |
CN108898157B (en) | Classification method for radar chart representation of numerical data based on convolutional neural network | |
CN114818681B (en) | Entity identification method and system, computer readable storage medium and terminal | |
CN112801133A (en) | Spectrum identification and classification method based on keras model | |
CN116342939A (en) | Composite star spectrum classification method based on CNN and LSTM |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210514 |
|
RJ01 | Rejection of invention patent application after publication |