A near-infrared spectral analysis method and system based on spectral image feature fusion

By fusion of spectral image features and ORB algorithm, the near-infrared spectral analysis method is optimized, which solves the problems of lengthy and high redundancy of multi-instrument analysis process and realizes efficient and accurate near-infrared spectral analysis.

CN119296673BActive Publication Date: 2025-09-26EAST CHINA UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411208524.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-09-26
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Existing near-infrared spectroscopy analysis technology relies on multiple instruments, the analysis process is lengthy and costly, and there are problems of high redundancy and high dimensionality, which leads to difficulties in feature extraction and low classification accuracy.

Method used

A near-infrared spectral analysis method based on spectral image feature fusion is adopted, and the spectral features are extracted using the oriented rapid rotation brief feature (ORB) algorithm. The spectral feature fusion strategy is optimized through principal component analysis and regression model to reduce redundant information and improve analysis accuracy and intelligence.

Benefits of technology

It effectively reduces the complexity of model training, improves the analytical accuracy and intelligence level of near-infrared spectroscopy analysis, and enables more efficient and accurate quantitative analysis of complex samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296673B_ABST
    Figure CN119296673B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of near-infrared spectral analysis technology, and more specifically, to a near-infrared spectral analysis method and system based on spectral image feature fusion. The method comprises the following steps: obtaining the physical and chemical properties corresponding to a batch of samples, measuring the near-infrared spectra of the samples and forming a modeling sample set; arbitrarily selecting two near-infrared spectra from the sample set to construct a two-dimensional grayscale image; extracting near-infrared spectral features from the two-dimensional grayscale image, and pre-processing the near-infrared spectral features; using principal component analysis technology to process the near-infrared spectral features and generate feature vectors; constructing a regression model based on the feature vectors and the sample physical and chemical property data to fit the relationship between the feature vectors and the sample physical and chemical property data; inputting the feature vectors of the samples to be analyzed into the regression model, and outputting the predicted results of the physical and chemical properties of the samples to be analyzed. The present invention adopts directional rapid rotation brief feature image extraction technology to improve the accuracy of near-infrared spectral analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of near-infrared spectrum analysis, and more particularly to a near-infrared spectrum analysis method and system based on spectral image feature fusion. Background Art

[0002] Near-infrared spectroscopy is an important method for rapid sample analysis, offering advantages such as non-destructive, rapid, and multi-attribute analysis. Its principle is based on the sample's absorption, scattering, and reflection characteristics of near-infrared light. By acquiring spectral data associated with sample properties and utilizing chemometric methods to establish a correlation model between spectral data and sample properties, qualitative or quantitative analysis of sample properties can be achieved.

[0003] The Oriented Rotating Brief (ORB) feature is a widely used feature extraction algorithm in computer vision. It detects feature points in an image and generates feature descriptors that are independent of scale, rotation, and other transformations, exhibiting excellent scale and rotation invariance. Applying the ORB algorithm to near-infrared spectral images effectively extracts local features, providing strong support for subsequent image feature fusion.

[0004] By using a single near-infrared spectrometer with a variety of measurement accessories to obtain the sample's transmission, transflection, diffuse reflectance, diffuse transmission, diffuse transflection, and attenuated total reflectance near-infrared spectra, the team optimized the spectral local feature fusion strategy based on the differences between these different types of near-infrared spectra to reduce redundant information. However, existing near-infrared spectral analysis technologies often rely on multiple types of analytical instruments, resulting in a lengthy and costly analysis process. Furthermore, the fused data suffers from high redundancy and high dimensionality.

[0005] Therefore, there is an urgent need for a multi-spectral fusion near-infrared spectroscopy analysis technology with high analysis accuracy and intelligence to address the shortcomings of existing technologies. Summary of the Invention

[0006] The following is a brief summary of one or more aspects to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceivable aspects and is neither intended to identify key or critical elements of all aspects nor to define the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that will be provided later.

[0007] The purpose of the present invention is to provide a near-infrared spectral analysis method based on spectral image feature fusion, which is used to solve the problems of high dimension of near-infrared spectral data, difficulty in feature extraction, low classification accuracy, and difficulty in fusion method.

[0008] In order to achieve the above object, the present invention provides a near-infrared spectral analysis method based on spectral image feature fusion, comprising the following steps:

[0009] Step S1: obtaining the physical and chemical properties of a batch of samples, measuring the near-infrared spectra of the samples and forming a modeling sample set;

[0010] Step S2, randomly selecting two near-infrared spectra from the sample set to construct a two-dimensional grayscale image;

[0011] Step S3, using image processing technology to extract near-infrared spectral features from the two-dimensional grayscale image, and preprocessing the near-infrared spectral features;

[0012] Step S4: Processing the near-infrared spectrum features using principal component analysis technology to generate feature vectors;

[0013] Step S5: constructing a regression model based on the characteristic vector and the physical and chemical property data of the sample to fit the relationship between the characteristic vector and the physical and chemical property data of the sample;

[0014] Step S6: input the characteristic vector of the sample to be analyzed into the regression model, and output the prediction result of the physical and chemical properties of the sample to be analyzed.

[0015] In one embodiment, the step S1 further includes: the types of the near-infrared spectrum include transmission, transflection, diffuse reflection, diffuse transmission, diffuse transflection and attenuated total reflection spectrum.

[0016] In one embodiment, the step S2 further includes:

[0017] Step S21, selecting two different types of near-infrared spectra from the sample set, and multiplying the absorbance values ​​of the two near-infrared spectra at corresponding wavelengths to generate a data matrix;

[0018] Step S22: performing grayscale processing on the data matrix to generate a two-dimensional grayscale image.

[0019] In one embodiment, the step S3 further includes: extracting spectral features from the two-dimensional grayscale image using a directional rapid rotation brief feature method.

[0020] In one embodiment, the method further comprises the following steps:

[0021] Step S31: construct an image pyramid and use an integral image to perform feature point detection on the two-dimensional grayscale image;

[0022] Step S32: Calculate the gradient magnitude and direction of the pixels around each feature point and identify the main direction;

[0023] Step S33: applying a rotation matrix to adjust the pixel position in the descriptor pattern according to the main direction of each feature point;

[0024] Step S34: extracting feature descriptors;

[0025] Step S35, recording the spectrum wavelength region information, marking the covered spectrum wavelength region;

[0026] Step S36: Eliminate the spectral wavelength region covered by the feature points, and use the remaining spectral wavelengths as the extracted spectral features.

[0027] In one embodiment, step S34 further includes: extracting feature descriptors at feature points, finding main directions and auxiliary directions for feature points, generating feature descriptors, determining information such as direction, scale, and position of feature points, and returning dimension information of the descriptors.

[0028] In one embodiment, in step S3, preprocessing the near-infrared spectral features further includes using one or more combinations of first-order derivative, second-order derivative, wavelet transform, standard normal transform, SG smoothing, multivariate scattering correction, orthogonal signal correction, and scale scaling.

[0029] In one embodiment, the step S4 further includes the following steps:

[0030] Step S41, performing principal component analysis on the pre-processed near-infrared spectral features;

[0031] Step S42: selecting a number of principal components based on variance explanatory power and residual error, and performing principal component dimensionality reduction on the near-infrared spectral features;

[0032] Step S43: concatenate multiple sets of dimensionality-reduced data to obtain feature vectors of all samples.

[0033] In one embodiment, the step S41 further includes:

[0034] Normalize near-infrared spectral data;

[0035] A covariance matrix is ​​calculated, and eigenvalues ​​and eigenvectors of the covariance matrix are calculated.

[0036] In one embodiment, the step S42 further includes:

[0037] Select the principal components to construct the projection matrix;

[0038] The original data is linearly transformed through the projection matrix and mapped to a low-dimensional space.

[0039] In one embodiment, the regression model algorithm in step S5 includes multiple linear regression, principal component regression, support vector machine regression, partial least squares regression, local weight regression, and artificial neural network regression.

[0040] In one embodiment, the regression model algorithm in step S5 adopts a partial least squares regression algorithm, and further includes the following steps:

[0041] Step S51: data standardization processing;

[0042] Step S52: Calculate the correlation coefficient matrix between each sample in the training set;

[0043] Step S53: Find the direction in which the common variance between the independent variable and the dependent variable is the largest, and perform a linear combination of the independent variables;

[0044] Step S54: Maximize the common variance between the independent variable and the dependent variable to determine the eigenvector, and use the eigenvector to perform regression modeling.

[0045] In one embodiment, step S6 further includes:

[0046] The prediction results of near infrared spectroscopy analysis were tested by quantitative test indicators;

[0047] The quantitative test indicators include: determination coefficient formula (1), prediction standard deviation formula (2), and reference data standard deviation;

[0048] Coefficient of determination:

[0049]

[0050] Forecast standard deviation:

[0051]

[0052] where y i is the reference value of the i-th sample determined by the standard method, is the predicted value output by the model, and m is the total number of samples in the test set.

[0053] In order to achieve the above object, the present invention provides a near-infrared spectral analysis system based on spectral image feature fusion, comprising:

[0054] a memory for storing instructions executable by the processor;

[0055] A processor is configured to execute the instructions to implement any of the methods described above.

[0056] In order to achieve the above object, the present invention provides a computer-readable medium having computer instructions stored thereon, wherein when the computer instructions are executed by a processor, any of the above methods is executed.

[0057] This paper provides a near-infrared spectral analysis method and system based on spectral image feature fusion. This method uses directional rapid rotation of brief feature image extraction technology to effectively extract spectral features. Furthermore, based on the differences between different types of near-infrared spectra, it optimizes the spectral local feature fusion strategy, reduces redundant information, effectively reduces model training complexity, and improves the accuracy and intelligence of near-infrared spectral analysis technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The above features and advantages of the present invention will be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or characteristics may have the same or similar reference numerals.

[0059] Figure 1 A step diagram of a near-infrared spectral analysis method based on spectral image feature fusion according to an embodiment of the present invention is disclosed;

[0060] Figure 2 The original transmission spectrum of a sample according to one embodiment of the present invention is disclosed;

[0061] Figure 3 The original transmission and reflection spectrum of a sample according to one embodiment of the present invention is disclosed;

[0062] Figure 4 The original diffuse reflectance spectrum of a sample according to one embodiment of the present invention is disclosed;

[0063] Figure 5 A regression diagram of the true value and predicted value of a test sample according to an embodiment of the present invention is disclosed;

[0064] Figure 6 A principle block diagram of a near-infrared spectral analysis system based on spectral image feature fusion according to an embodiment of the present invention is disclosed. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the invention and are not intended to limit the invention.

[0066] In response to the shortcomings of existing near-infrared spectroscopy analysis technology in the analysis of complex samples (such as crude oil, hydrogenated tail oil, marine fuel oil, etc.), the present invention provides a near-infrared spectroscopy analysis method and system based on spectral image feature fusion, which is widely applicable to the fields of petrochemical industry, food, agriculture, etc.

[0067] This paper employs a spectral image feature fusion analysis method, utilizing only a single near-infrared spectrometer in conjunction with various measurement accessories to acquire multi-type near-infrared spectral data from samples. To address the high dimensionality of the fused data, the paper introduces an oriented rapid rotation profile (ORB) algorithm to improve spectral feature extraction. Furthermore, based on the differences between different types of near-infrared spectra, the paper optimizes the spectral feature fusion strategy, effectively reducing redundant information and establishing an analytical model for the physical and chemical properties of complex samples.

[0068] Therefore, this invention overcomes the limitations of single-spectral analysis of complex samples and significantly improves the accuracy and effectiveness of the analytical model. Furthermore, by introducing the ORB algorithm to enhance spectral feature extraction capabilities, it improves the intelligence level of near-infrared spectral modeling, effectively promoting the development of near-infrared spectral analysis technology in terms of analytical accuracy and intelligence.

[0069] Figure 1 The following discloses a step diagram of a near infrared spectroscopy analysis method based on image feature extraction according to an embodiment of the present invention. Figure 1 As shown, the near-infrared spectroscopy analysis method based on image feature extraction proposed by the present invention includes the following steps:

[0070] Step S1: obtaining the physical and chemical properties of a batch of samples, measuring the near-infrared spectra of the samples and forming a modeling sample set;

[0071] Step S2, randomly selecting two near-infrared spectra from the sample set to construct a two-dimensional grayscale image;

[0072] Step S3, using image processing technology to extract near-infrared spectral features from the two-dimensional grayscale image, and preprocessing the near-infrared spectral features;

[0073] Step S4: Processing the near-infrared spectrum features using principal component analysis technology to generate feature vectors;

[0074] Step S5: constructing a regression model based on the characteristic vector and the physical and chemical property data of the sample to fit the relationship between the characteristic vector and the physical and chemical property data of the sample;

[0075] Step S6: input the characteristic vector of the sample to be analyzed into the regression model, and output the prediction result of the physical and chemical properties of the sample to be analyzed.

[0076] The present invention proposes a near-infrared spectral analysis method based on spectral image feature fusion, which establishes an accurate and efficient quantitative analysis model by fusing features of multiple types of near-infrared spectra. The specific process is as follows: First, a grayscale image of the spectrum is constructed, and image feature extraction technology is used to extract key features in the spectrum. This process can effectively fuse the features of multiple types of near-infrared spectra and reduce dependence on manual experience. Next, the extracted spectral features are standardized, and feature vectors are constructed through dimensionality reduction and compression technology, thereby reducing the dimension of the data and the complexity of the model. Not only is the accuracy of the near-infrared spectral analysis model improved, but the intelligence level of the model is also enhanced, enabling it to perform quantitative analysis of complex samples more efficiently and accurately.

[0077] The above steps will be described in detail below. Within the scope of the present invention, the above-mentioned technical features of the present invention and the technical features specifically described below (such as embodiments) can be combined with each other and related to each other to form a preferred technical solution.

[0078] Step S1: Obtain a batch of samples, obtain their physical and chemical properties through chemical analysis, and use a near-infrared spectrometer equipped with various measurement accessories with different working principles to obtain multiple types of near-infrared spectra of the samples to form a modeling sample set, further comprising:

[0079] The working principles of the measurement accessories include but are not limited to transmission, transreflection, diffuse reflection, diffuse transmission, diffuse transreflection and attenuated total reflection, and the spectral types obtained using these measurement accessories include but are not limited to transmission, transreflection, diffuse reflection, diffuse transmission, diffuse transreflection and attenuated total reflection spectra.

[0080] Step S2, constructing a two-dimensional grayscale image from any two of the multi-type near-infrared spectra of the collected samples;

[0081] Furthermore, step 2 includes the following steps:

[0082] Step S21: For each sample in the sample set, take the absorbance values ​​of the corresponding wavelength points of two different types of near-infrared spectral data and multiply them two by two to generate a data matrix;

[0083] Step S22: for each sample, grayscale processing is performed on the obtained data matrix to generate a two-dimensional grayscale image;

[0084] In this embodiment, the data matrix is ​​normalized to the maximum and minimum values, and the values ​​are mapped to the range of [0, 1]. The normalized data are uniformly multiplied by p and rounded to the integer to obtain a gray value matrix. The gray value matrix is ​​converted into a gray image to generate a corresponding p-order gray image.

[0085] Step S3: Use image feature extraction means to extract spectral features and pre-process the extracted spectral features.

[0086] In this embodiment, a directional rapid rotation brief feature method is used to extract near-infrared spectral features.

[0087] Furthermore, the step S3 specifically includes the following steps:

[0088] Step S31: construct different scale spaces, perform Gaussian convolution on the grayscale image created in step S2, and create a Gaussian pyramid;

[0089] Step S32: thresholding is performed, using a scale-variable Gaussian function to compare the gradient of each pixel with the surrounding neighborhood pixels to detect scale-invariant feature points;

[0090] Step S33: Apply non-maximum suppression to the detected feature points to screen and adjust them to eliminate edge effects;

[0091] Step S34: extract feature descriptors at the feature points, find the main direction and auxiliary direction for the feature points, generate feature descriptors, determine the direction, scale, position and other information of the feature points, and return the dimension information of the descriptors;

[0092] Step S35, recording the spectral wavelength region information covered by the characteristic points of the directional rapid rotation brief characteristic, and marking the covered spectral wavelength region;

[0093] Step S36: Eliminate the spectral wavelength region covered by the feature points, and use the remaining spectral wavelengths as the extracted spectral features.

[0094] In this embodiment, step S36 further includes:

[0095] Initialize an array of length t to record the number of times each wavelength point is marked as a wavelength point to be removed;

[0096] Where t is the number of wavelength points in the original spectrum;

[0097] Furthermore, the wavelength points to be eliminated are determined by two groups of different types of spectral wavelength regions covered by the directional rapid rotation brief feature points extracted from each grayscale image obtained in the previous step S35.

[0098] In this embodiment, all wavelength points marked as eliminated wavelength points are eliminated, and the remaining wavelength points are retained, successfully achieving dimensionality reduction from t wavelength points to n wavelength points (n is less than t), and greatly retaining the characteristics of the data, obtaining multiple different types of near-infrared spectral features after feature extraction.

[0099] In this embodiment, the extracted spectral features are preprocessed, and the spectral preprocessing methods used include but are not limited to one of the first-order derivative, second-order derivative, wavelet transform, standard normal transform, multivariate scattering correction, SG smoothing, orthogonal signal correction, scale scaling and the like, or a combination of multiple methods.

[0100] Among them, the first-order derivative calculates the slope of the spectral data as the wavelength changes, that is, the rate of change of the spectral curve, which can effectively eliminate the interference of baseline and other backgrounds and improve resolution and sensitivity.

[0101] The second-order derivative calculates the slope of the first-order derivative as the wavelength changes, reflecting the change in the curvature of the spectral curve, further enhancing the resolution of the spectral peak, highlighting the subtle features in the spectrum, and reducing the impact of baseline drift, but it also amplifies the noise.

[0102] Wavelet transform is a signal processing method that decomposes spectral data into wavelet functions of different scales. It is used to decompose spectral signals and effectively extract features from multi-scale analysis. It is especially suitable for processing non-stationary signals.

[0103] The standard normal transformation is a spectral normalization method that subtracts the mean value of each spectral vector from each data point and divides it by its standard deviation to eliminate the spectral variability caused by the sample scattering effect. It is particularly suitable for processing reflectance spectrum data and can be used to correct the linear changes in the spectrum due to scattering.

[0104] Multivariate scatter correction (MSC) is a preprocessing method used to correct for variations in spectral data caused by scattering. By eliminating scattering and reducing nonlinear effects in the spectrum, the corrected spectrum more accurately reflects the chemical information of the sample and can be used to correct for linear variations in the spectrum caused by scattering.

[0105] Savitzky-Golay Smoothing (SG smoothing) is a filtering method that smoothes data by fitting a polynomial within a sliding window. By fitting the data within the moving window with a polynomial least squares method, the polynomial can effectively reduce the irregular random noise in the spectrum, and can also retain the detailed characteristics of the spectral signal while reducing the impact of noise. It is a commonly used spectral data smoothing technology.

[0106] Orthogonal signal correction is a preprocessing method that removes signal components (noise, background, etc.) in spectral data that are irrelevant to the target attributes and retains signal components related to the target attributes, thereby improving the correlation of spectral data and enhancing the predictive ability of the model.

[0107] Scaling refers to scaling the data so that the data can be compared at the same scale. Common scaling methods include maximum and minimum scaling and normalized scaling, which make the spectral data have the same importance in the model analysis, avoid the impact caused by the scale differences of different variables, and improve the stability of the model.

[0108] In one embodiment, the spectrum preprocessing is performed using a first-order derivative method, further comprising:

[0109] Divide the original data into q continuous wavelength segments according to the continuity of the spectral features extracted in step S36;

[0110] All q continuous wavelength bands are subjected to first-order derivative processing, and the first-order differences of the data points are calculated to eliminate the interference of baseline and background;

[0111] The processed subsets are concatenated column by column.

[0112] In this embodiment, the first-order derivative step further includes: the near-infrared spectrum data extracted by the characteristic wavelength in step S36 is divided into q continuous spectral features;

[0113] For multiple groups of different types of spectra, they are divided into continuous q-segment spectral features;

[0114] The q-segment spectral features divided by each type of spectrum are processed with the first-order derivative respectively and spliced ​​into new spectral features.

[0115] Step S4: performing principal component analysis on the spectral features to generate feature vectors;

[0116] In this embodiment, step S4 further includes:

[0117] Step S41, performing principal component analysis on the pre-processed multi-type near-infrared spectral features respectively;

[0118] Step S42: Select an appropriate number of principal components based on variance explanatory power and residual error, and perform principal component dimensionality reduction on multiple types of near-infrared spectral features;

[0119] Step S43: concatenate multiple sets of dimensionality-reduced data to obtain feature vectors of all samples.

[0120] In one embodiment, the step S41 further includes:

[0121] Normalize near-infrared spectral data;

[0122] Compute the covariance matrix and compute the eigenvalues ​​and eigenvectors of the covariance matrix.

[0123] In one embodiment, the step S42 further includes:

[0124] The projection matrix will be constructed by selecting the retained principal components;

[0125] The original data is linearly transformed through the projection matrix and mapped to a low-dimensional space.

[0126] In this embodiment, each type of spectral feature is further reduced from n dimensions to k dimensions through principal component analysis, thereby further reducing redundant information.

[0127] Step S5: establishing a regression model between the characteristic vector and the physical and chemical properties of the sample.

[0128] In this embodiment, the regression model algorithms used include but are not limited to multiple linear regression, principal component regression, support vector machine regression, partial least squares regression, local weight regression, artificial neural network regression and other algorithms.

[0129] Among them, in spectral analysis, multiple linear regression can be used to establish a relationship model between spectral data (independent variables) and sample attributes (dependent variables), thereby achieving quantitative prediction of sample attributes.

[0130] The principal component regression method uses the principal component analysis method in multivariate statistics. First, the near-infrared spectrum matrix is ​​decomposed, and then the principal component scores are selected to perform multivariate linear regression operations to obtain a quantitative model.

[0131] Partial least squares regression is a multiple regression method based on principal component regression. While decomposing the spectral array and concentration array, it introduces the information of the concentration array into the spectral matrix decomposition process. It is the most commonly used modeling method in near-infrared modeling analysis.

[0132] Artificial neural networks establish mathematical models of brain neural network activities by imitating the activities of human brain nerves. They have self-learning, self-organization, and self-adaptation capabilities, strong fault tolerance, and highly nonlinear expression capabilities.

[0133] Local weighted regression is an improved regression analysis method. For each predicted sample, weighted fitting is performed based on the weights of the data points near the predicted sample. This method performs better when the amount of data is small or the sample distribution is uneven.

[0134] In this embodiment, the regression model algorithm in step S5 adopts a partial least squares regression algorithm, and further includes the following steps:

[0135] Step S51: data standardization processing;

[0136] Step S52: Calculate the correlation coefficient matrix between each sample in the training set;

[0137] Step S53: Find the direction in which the common variance between the independent variable and the dependent variable is the largest, and perform a linear combination of the independent variables;

[0138] Step S54: Maximize the common variance between the independent variable and the dependent variable to determine the eigenvector, and use the eigenvector to perform regression modeling.

[0139] Step S6: For the sample to be analyzed, obtain a near-infrared spectrum of the same type as the modeled sample, use the above method to obtain a feature vector, and input it into the above regression model to predict the physical and chemical properties of the sample to be analyzed.

[0140] In this embodiment, the prediction results of near-infrared spectroscopy analysis are tested by quantitative test indicators;

[0141] The quantitative test indicators include: determination coefficient formula (1), prediction standard deviation formula (2), and reference data standard deviation.

[0142] Coefficient of determination:

[0143]

[0144] Forecast standard deviation:

[0145]

[0146] Among them, y i is the reference value of the i-th sample determined by the standard method, is the predicted value output by the model, and m is the total number of samples in the test set.

[0147] Although the above methods are illustrated and described as a series of acts for simplicity of explanation, it is to be understood and appreciated that these methods are not limited by the order of the acts, as some acts may occur in a different order and / or concurrently with other acts from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art according to one or more embodiments.

[0148] The following describes the near-infrared spectrum analysis method based on spectral image feature fusion proposed by the present invention through an embodiment.

[0149] In this embodiment, a batch of crude oil samples are used as test objects to specifically and in detail illustrate the near-infrared spectral image feature fusion analysis method.

[0150] Step S1: Obtain a batch of crude oil samples, obtain their density values ​​through chemical analysis, and use a near-infrared spectrometer equipped with various measurement accessories to obtain the transmission, transflection, and diffuse reflectance near-infrared spectra of the samples to form a modeling sample set. The specific process is as follows:

[0151] Figure 2The original transmission spectrum of a sample according to an embodiment of the present invention is disclosed. Figure 3 The original transmission and reflection spectrum of a sample according to an embodiment of the present invention is disclosed. Figure 4 The original diffuse reflectance spectrum of a sample according to an embodiment of the present invention is disclosed. Figure 2 、 Figure 3 、 Figure 4 As shown in the figure, the transmission, transflection and diffuse reflectance near-infrared spectral data strings of 61 samples were obtained by using a near-infrared spectrometer with transmission, transflection and diffuse reflectance measurement accessories. The number of data points (number of wavelengths) of each spectral data string is 647. These data strings are plotted into near-infrared spectral images, and the near-infrared spectral images are corresponded to the density values ​​in the laboratory analysis report.

[0152] Step S2: construct a two-dimensional grayscale image from any two of the collected sample's transmission, transflection, and diffuse reflectance near-infrared spectra. The specific process is as follows:

[0153] The transmission near-infrared spectrum and the transflection near-infrared spectrum, the transmission near-infrared spectrum and the diffuse reflection near-infrared spectrum, and the transflection near-infrared spectrum and the diffuse reflection near-infrared spectrum are selected respectively to construct three sets of two-dimensional grayscale images.

[0154] In this embodiment, three sets of 647*647 64-level grayscale images are constructed, where 647 is the number of wavelength points of the near-infrared spectrum data, and 64 levels is the set number of grayscales. The images generated by all samples are saved locally.

[0155] Step S3: extract spectral features using a directional rapid rotation brief feature extraction method, and preprocess the extracted spectral features using a first-order derivative method. The specific process is as follows:

[0156] In this embodiment, the grayscale images saved in step S2 are traversed in sequence, and the feature points of each image are extracted using the directional rapid rotation brief feature method;

[0157] Record the wavelength range of the data covered by each feature point, and use an array to count the number of times each wavelength point is covered by the feature point;

[0158] The wavelength points covered by the characteristic points are uniformly removed to remove the redundant information of the near-infrared spectrum and retain the characteristic wavelength points of the spectrum. The number of wavelength points of each near-infrared spectrum data is reduced from 647 to 279, and the spectral characteristics are obtained;

[0159] According to the continuity of the wavelength points in the extracted spectral features, each type of spectral feature can be divided into 4 continuous segments;

[0160] Perform first-order derivative processing on the four continuous wavelength segments, calculate the first-order difference of the data points, and highlight the data slope information;

[0161] The processed subsets are spliced ​​column by column to form new spectral features.

[0162] Step S4: perform principal component analysis on the spectral features to generate feature vectors. The specific process is as follows:

[0163] Based on the variance contribution rate and residual, as well as multiple experimental verifications, this embodiment selects 15 principal components for the transmission spectrum and 15 principal components for the transflection spectrum. The transmission and transflection spectrum data are concatenated, and the 30 dimensions form a feature vector.

[0164] Step S5: Establish a partial least squares regression model between the characteristic vector and the physical and chemical properties of the sample. The specific process is as follows:

[0165] A partial least squares regression model was established, and the optimal parameter selection was determined by grid search. The number of components retained was determined to be 9.

[0166] Step S6: For the crude oil sample to be analyzed, obtain a near-infrared spectrum of the same type as the modeled sample, use the above method to obtain a feature vector, input it into the above regression model, and predict the density value of the crude oil sample to be analyzed. The specific process is as follows:

[0167] 16 samples were obtained as a test set and input into the above regression model to obtain the density prediction value.

[0168] Figure 5 The regression diagram of the true value and predicted value of the test sample according to one embodiment of the present invention is disclosed. Figure 5 As shown, the horizontal axis is the measured value of the sample density standard test analysis method, and the vertical axis is the distribution of the predicted value of this method.

[0169] In this embodiment, the determination coefficient R 2 And the prediction standard deviation Rmsep evaluates the prediction results of the model.

[0170] Figure 5 The measured and predicted values ​​of the model test set are shown in Table 1.

[0171] Table 1 Prediction results of test set density

[0172]

[0173]

[0174] As shown in Table 1, the standard deviation of the model test set is 3.55, the Rmsep value of the predicted value of this model is 0.83, and the determination coefficient R 2 The value is 0.945. 2It is higher, indicating that the prediction effect of the method provided by the present invention is very good, the training error is small, Rmsep is lower than the standard deviation of the test set, and the value is small, further indicating that the prediction effect of this method is good.

[0175] Figure 6 The principle block diagram of the near infrared spectrum analysis system based on spectral image feature fusion according to an embodiment of the present invention is disclosed. Figure 6 As shown, the near-infrared spectroscopy analysis system based on spectral image feature fusion may include an internal communication bus 601, a processor 602, a read-only memory (ROM) 603, a random access memory (RAM) 604, a communication port 605, and a hard disk 607. The internal communication bus 601 enables data communication between the components of the near-infrared spectroscopy analysis system based on spectral image feature fusion. The processor 602 can make judgments and issue prompts. In some embodiments, the processor 602 can be composed of one or more processors.

[0176] Communication port 605 enables data transmission and communication between the near-infrared spectral analysis system based on spectral image feature fusion and external input / output devices. In some embodiments, the near-infrared spectral analysis system based on spectral image feature fusion can send and receive information and data from a network via communication port 605. In some embodiments, the near-infrared spectral analysis system based on spectral image feature fusion can transmit and communicate data with external input / output devices via input / output port 606 in a wired manner.

[0177] The near-infrared spectral analysis system based on spectral image feature fusion may also include various forms of program storage units and data storage units, such as a hard disk 607, a read-only memory (ROM) 603, and a random access memory (RAM) 604, capable of storing various data files used for computer processing and / or communication, as well as possible program instructions executed by the processor 602. The processor 602 executes these instructions to implement the main part of the method. The results of the processing by the processor 602 are transmitted to an external output device through a communication port 605 and displayed on the user interface of the output device.

[0178] For example, the implementation process file of the above-mentioned near-infrared spectral analysis method based on spectral image feature fusion can be a computer program, saved in the hard disk 607, and can be recorded in the processor 602 for execution to implement the method of the present application.

[0179] When the implementation process file of the near-infrared spectral analysis method based on spectral image feature fusion is a computer program, it can also be stored in a computer-readable storage medium as a product. For example, a computer-readable storage medium may include, but is not limited to, a magnetic storage device (e.g., a hard disk, a floppy disk, a magnetic strip), an optical disk (e.g., a compact disk (CD), a digital versatile disk (DVD)), a smart card, and a flash memory device (e.g., an electrically erasable programmable read-only memory (EPROM), a card, a stick, a key drive). In addition, the various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media (and / or storage media) that can store, contain, and / or carry code and / or instructions and / or data.

[0180] The near-infrared spectral analysis method and system based on spectral image feature fusion proposed in the present invention have the following effective effects:

[0181] 1) Compared with traditional chemometric applications that require data string preprocessing, baseline correction, spectral wavelength screening, etc., the present invention uses near-infrared spectral data to generate grayscale images and uses image processing technology to automatically extract spectral image feature information, thereby improving the intelligent level of spectral data processing;

[0182] 2) A multi-type near-infrared spectral feature fusion method is used to fuse multiple types of near-infrared spectral data, such as diffuse reflectance, transmission, transflection, diffuse transmission, and attenuated total reflectance, into pairs for feature analysis. This improves the accuracy of the model, effectively improves the problem of spectral data clutter, and reduces redundant information.

[0183] 3) The directional rapid rotation brief feature technology can fully extract the effective feature information of near-infrared spectral images. The low dimensionality of the feature information helps to accelerate the training speed of the prediction model. It has the advantages of strong adaptability and good fault tolerance, which can improve the prediction performance.

[0184] 4) This invention makes up for the lack of image quantitative and qualitative analysis technology in near-infrared spectroscopy work to a certain extent, and confirms the feasibility of applying computer vision technology in the field of near-infrared spectroscopy. The exploration and development of this image analysis technology provides a new opportunity to introduce new technologies into the field of near-infrared spectroscopy, which will help the development and application of near-infrared spectroscopy technology in a wider, more accurate and convenient direction.

[0185] Although the above methods are illustrated and described as a series of acts for simplicity of explanation, it is to be understood and appreciated that these methods are not limited by the order of the acts, as some acts may occur in a different order and / or concurrently with other acts from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art according to one or more embodiments.

[0186] As used in this application and the claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not intended to refer to the singular but may include the plural. Generally speaking, the terms "comprises" and "include" only indicate the inclusion of the steps and elements specifically identified, and these steps and elements do not constitute an exclusive list. A method or apparatus may also include other steps or elements.

[0187] Those skilled in the art will appreciate that information, signals, and data may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips cited throughout the foregoing description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.

[0188] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. A skilled person may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.

[0189] The various illustrative logic modules and circuits described in conjunction with the embodiments disclosed herein may be implemented or executed using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.

[0190] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read and write information from / to the storage medium. In an alternative, the storage medium may be integrated into the processor. The processor and storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and storage medium may reside in a user terminal as discrete components.

[0191] The above embodiments are provided to persons familiar with the art for implementing or using the present invention. Personnel familiar with the art may make various modifications or changes to the above embodiments without departing from the inventive concept of the present invention. Therefore, the scope of protection of the present invention is not limited to the above embodiments, but should be the maximum scope of the innovative features mentioned in the claims.

Claims

1. A near-infrared spectral analysis method based on spectral image feature fusion, characterized in that: The following steps are involved: Step S1: obtaining the physical and chemical properties of a batch of samples, measuring the near-infrared spectra of the samples and forming a modeling sample set; Step S2, randomly selecting two near-infrared spectra from the sample set to construct a two-dimensional grayscale image; Step S3, using image processing technology to extract near-infrared spectral features from the two-dimensional grayscale image, and preprocessing the near-infrared spectral features; Step S4: Processing the near-infrared spectrum features using principal component analysis technology to generate feature vectors; Step S5: constructing a regression model based on the characteristic vector and the physical and chemical property data of the sample to fit the relationship between the characteristic vector and the physical and chemical property data of the sample; Step S6: input the feature vector of the sample to be analyzed into the regression model, and output the prediction results of the physical and chemical properties of the sample to be analyzed; The step S2 further includes: Step S21, selecting two different types of near-infrared spectra from the sample set, and multiplying the absorbance values ​​of the two near-infrared spectra at corresponding wavelengths to generate a data matrix; Step S22: performing grayscale processing on the data matrix to generate a two-dimensional grayscale image; The step S3 further includes: extracting spectral features from the two-dimensional grayscale image using a directional rapid rotation brief feature method; Step S31: construct an image pyramid and use an integral image to perform feature point detection on the two-dimensional grayscale image; Step S32: Calculate the gradient magnitude and direction of the pixels around each feature point and identify the main direction; Step S33: applying a rotation matrix to adjust the pixel position in the descriptor pattern according to the main direction of each feature point; Step S34: extracting feature descriptors; Step S35, recording the spectrum wavelength region information, marking the covered spectrum wavelength region; Step S36: Eliminate the spectral wavelength region covered by the feature points, and use the remaining spectral wavelengths as the extracted spectral features; Step S34 further includes: extracting feature descriptors at the feature points, finding the main direction and auxiliary direction for the feature points, generating feature descriptors, determining the direction, scale, and position information of the feature points, and returning dimensional information of the descriptors.

2. The near-infrared spectral analysis method based on spectral image feature fusion according to claim 1 is characterized in that: The step S1 further includes: the types of the near-infrared spectrum include transmission, transflection, diffuse reflection, diffuse transmission, diffuse transflection and attenuated total reflection spectrum.

3. The near-infrared spectral analysis method based on spectral image feature fusion according to claim 1 is characterized in that: In step S3, preprocessing the near-infrared spectral features further includes using one or more combinations of first-order derivative, second-order derivative, wavelet transform, standard normal transform, SG smoothing, multivariate scattering correction, orthogonal signal correction, and scale scaling.

4. The near-infrared spectral analysis method based on spectral image feature fusion according to claim 1, characterized in that: The step S4 further includes the following steps: Step S41, performing principal component analysis on the pre-processed near-infrared spectral features; Step S42: selecting a number of principal components based on variance explanatory power and residual error, and performing principal component dimensionality reduction on the near-infrared spectral features; Step S43: concatenate multiple sets of dimensionality-reduced data to obtain feature vectors of all samples.

5. The near-infrared spectral analysis method based on spectral image feature fusion according to claim 4 is characterized in that: The step S41 further includes: Normalize near-infrared spectral data; A covariance matrix is ​​calculated, and eigenvalues ​​and eigenvectors of the covariance matrix are calculated.

6. The near-infrared spectral analysis method based on spectral image feature fusion according to claim 4 is characterized in that: The step S42 further includes: Select the principal components to construct the projection matrix; The original data is linearly transformed through the projection matrix and mapped to a low-dimensional space.

7. The near-infrared spectral analysis method based on spectral image feature fusion according to claim 1, characterized in that: The regression model algorithm in step S5 includes multiple linear regression, principal component regression, support vector machine regression, partial least squares regression, local weight regression, and artificial neural network regression.

8. The near-infrared spectral analysis method based on spectral image feature fusion according to claim 1 or 7, characterized in that: The regression model algorithm in step S5 adopts a partial least squares regression algorithm, and further includes the following steps: Step S51: data standardization processing; Step S52: Calculate the correlation coefficient matrix between each sample in the training set; Step S53: Find the direction in which the common variance between the independent variable and the dependent variable is the largest, and perform a linear combination of the independent variables; Step S54: Maximize the common variance between the independent variable and the dependent variable to determine the eigenvector, and use the eigenvector to perform regression modeling.

9. The near-infrared spectrum analysis method based on spectral image feature fusion according to claim 1, characterized in that: The step S6 further comprises: The prediction results of near infrared spectroscopy analysis were tested by quantitative test indicators; The quantitative test indicators include: a determination coefficient formula, a prediction standard deviation formula, and a reference to the standard deviation of the data itself.

10. A near-infrared spectral analysis system based on spectral image feature fusion, comprising: a memory for storing instructions executable by the processor; A processor, configured to execute the instructions to implement the method according to any one of claims 1 to 9.

11. A computer-readable medium having computer instructions stored thereon, wherein when the computer instructions are executed by a processor, the method according to any one of claims 1 to 9 is performed.

Citation Information

Patent Citations

  • Quantitative adulteration detection method for peanut oil based on multiple-source spectroscopic data fusion

    CN104807803A

  • Folium apocyni veneti total flavonoid near infrared super rapid detection method

    CN105784635A