A method and system for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy

Near-infrared spectroscopy with deep learning algorithms allows for rapid and accurate oil concentration detection in seawater, addressing the limitations of existing methods by providing real-time, cost-effective oil concentration analysis.

CN119780025BActive Publication Date: 2025-07-15YANTAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411877714.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-07-15
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The existing marine oil-spill oil-containing seawater detection methods cannot achieve real-time rapid detection, and the detection equipment is costly and difficult to maintain, so it cannot meet the on-site inspection needs. In particular, there is little research on trace oil detection technology, making it difficult to achieve accurate marine oil spill emergency control and ship sewage discharge monitoring.

Method used

The seawater oil-containing concentration detection method based on near-infrared absorption spectrum is adopted. By obtaining spectral samples of different oil samples, selecting characteristic bands, performing spectral data preprocessing and deep learning algorithm training, and using the Adam algorithm to fit the curve, the inversion of seawater oil-containing concentration is achieved.

Benefits of technology

It realizes universal detection of different oil concentrations, can distinguish the spectral intensity differences of trace oil, provides emergency monitoring of marine oil spills and concentration detection methods for ship oil-containing sewage discharge, with fast accuracy and economicality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119780025B_ABST
    Figure CN119780025B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of marine oil spill monitoring, and in particular to a method and system for detecting the oil content concentration in seawater based on near-infrared absorption spectroscopy. The method includes obtaining spectral samples of different concentrations of different oil samples; collecting the original near-infrared spectra of the spectral samples at different concentrations; selecting characteristic bands based on the intensity differences of the near-infrared spectra at different concentrations, and extracting spectral data within the characteristic bands; performing normalization preprocessing on the spectral data within the characteristic bands; training a deep learning model using the spectral data within the characteristic bands to obtain a concentration result; the present invention can effectively invert the oil content concentration in seawater, providing a new method for marine oil spill monitoring and concentration detection of oil-containing seawater discharged from ships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of marine oil spill monitoring, and in particular to a method and system for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy. Background Art

[0002] The traditional method for detecting oil-containing seawater in marine oil spills is to send the oil-seawater samples to be detected taken on-site to a testing laboratory. After a series of physical and chemical means of treatment, the oil content in the seawater is obtained through instrumental analysis of the experiment. Although this method of sampling online and detecting offline has high accuracy, it is not applicable to the on-site situation and has many disadvantages from a practical perspective: it requires a lot of time, manpower, and material resources, and cannot achieve real-time and rapid detection; in addition, the cost of the detection and analysis instruments is very high, the instruments and equipment are huge, and maintenance is difficult. It can only be carried out under laboratory conditions and cannot be used for on-site detection; at the same time, it must be detected by professionals with certain professional knowledge and technical basis, etc. At present, great progress has been made in the technical research and equipment implementation of the treatment of oil-containing seawater in marine oil spills, but there are still certain problems in the application of some new technical methods for treating oil-containing seawater in actual production, and it cannot meet the requirements of both technical feasibility (good treatment effect, low operating conditions requirements, easy to control, stable process) and economic feasibility (low equipment cost and operating cost). In summary, it is very necessary to quickly detect the concentration of oil-containing seawater. At present, most domestic and foreign research in this field focuses on the innovation of the detection method of oil-containing seawater, but there is less research on the rapid and accurate detection technology required for actual marine oil spills. Due to the difficulty of detection, most domestic and foreign research focuses on the environment with a large oil content, and there is less research on the micro-oil detection technology. Timely and accurately detecting whether the oil content in seawater exceeds the standard is a research that urgently needs to be carried out for marine oil spill emergency management and control and the reasonable discharge of ship oil-containing sewage. Summary of the Invention

[0003] In order to solve the above-mentioned problems, the present invention provides a method and system for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy. This technology can collect the near-infrared spectral data of oil-containing seawater on-site, preprocess the near-infrared spectrum, and extract the characteristic spectral bands and data screening. Then, further data deep learning algorithm training is carried out according to the results of the preprocessing and the selection of the characteristic bands. Through the deep learning Adam algorithm and curve fitting processing and analysis, the inversion of the oil concentration in seawater can be realized. This analysis method has universality for the detection of different oil concentrations. In actual application, the near-infrared spectral data can be used to distinguish the differences in the spectral intensities of micro-oil, and can effectively invert the concentration of oil-containing seawater, providing a new method for the emergency monitoring of marine oil spills and the concentration detection of ship oil-containing sewage discharge.

[0004] In a first aspect, a method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy provided by the present invention adopts the following technical solutions:

[0005] A method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy includes:

[0006] Obtaining spectral samples of different concentrations of different oil samples;

[0007] Collecting the original near-infrared spectra of the spectral samples at different concentrations;

[0008] Selecting characteristic bands based on the intensity difference of near-infrared spectra at different concentrations, and extracting spectral data within the characteristic bands;

[0009] Performing normalization preprocessing on the spectral data within the characteristic bands;

[0010] Training a deep learning model using the spectral data within the characteristic bands to obtain the concentration results;

[0011] Taking the average of the obtained oil concentration results under the four groups of characteristic bands, and finally outputting the oil concentration result in the sample.

[0012] Further, the obtaining of spectral samples of different concentrations of different oil samples includes using seawater as a solvent, and using crude oil, marine fuel oil, and refined oil as oil samples to prepare sample solutions representing oil-containing seawater in marine oil spills. Concentration gradients of 5 mg / L, 10 mg / L, 15 mg / L, 20 mg / L, and 100 mg / L are set for each oil sample.

[0013] Further, the collecting of the original near-infrared spectra of the spectral samples at different concentrations includes using an infrared light source as the emission light source to connect one end of the optical fiber connection device, and using a spectrometer as the near-infrared spectral data acquisition unit to connect the other end of the optical fiber to the sample carrier, and collecting the original near-infrared spectra of the spectral samples at different concentrations to obtain the intensity difference of near-infrared spectra at the same concentration.

[0014] Further, the selecting of characteristic bands based on the intensity difference of near-infrared spectra at different concentrations and the extraction of spectral data within the characteristic bands include traversing the intensity difference of near-infrared spectra of oil-containing seawater at different concentrations under the near-infrared spectral wavelengths, and selecting the bands with a difference greater than the set threshold as the characteristic bands for concentration inversion. Among them, the intensity difference of near-infrared spectra of n concentration oil-containing seawater samples is used as the parameter △F for selecting characteristic bands, and the near-infrared spectral intensity of oil-containing seawater at a certain concentration is x i , and the near-infrared spectral intensity of pure seawater is x0, then:

[0015] The wavelength band with |△F| greater than 500 is selected as the characteristic wavelength band. Among them, the method of direct interception is adopted to extract the near-infrared spectral data in the wavelength range of 930 - 970 nm in the near-infrared spectrum, and 930 - 940 nm, 940 - 950 nm, 950 - 960 nm, and 960 - 970 nm are divided into four characteristic wavelength bands.

[0016] Furthermore, the normalization preprocessing of the spectral data within the characteristic wavelength band includes adopting the maximum value normalization method, dividing the data points of each point in the near-infrared spectral curve by the data point of the maximum spectral intensity, so that the maximum spectral intensity value of the normalized spectral curve is 1, and the spectral intensity values of other data points are correspondingly less than 1.

[0017] Furthermore, the training of the deep learning model using the spectral data within the characteristic wavelength band includes building an Adam algorithm model based on adaptive differential hyperparameter optimization using the TensorFlow / Keras framework, in which an input layer, a hidden layer, an output layer, and an optimizer are respectively constructed; among them, the optimizer adopts the gradient-based Adam optimization algorithm, and the Adam optimization algorithm combines the dual characteristics of momentum method and RMSProp to optimize the model structure.

[0018] Furthermore, the optimization of the model structure by combining the Adam optimization algorithm with the dual characteristics of momentum method and RMSProp includes initializing the first-order momentum estimate and the second-order momentum estimate in sequence, calculating the gradient of the loss function with respect to the parameters, and performing bias correction after updating the first-order momentum estimate and the second-order momentum estimate, and updating the parameter θ according to the corrected momentum.

[0019] Furthermore, the training of the deep learning model using the spectral data within the characteristic wavelength band also includes optimizing and determining the learning rate v through the adaptive differential evolution algorithm JADE, where η ∈ [0.0001, 0.01]; searching for the optimal solution by simulating the changes of individuals in the population; the fitness of each individual is determined by its performance, and the differential evolution algorithm gradually optimizes the hyperparameters through natural selection. The ultimate goal is to find the hyperparameter combination that minimizes the loss; optimizing the parameters through the adaptive differential evolution algorithm JADE: θ = {η, n1, n2, batch_size}, batch_size ∈ [16, 128], to minimize the validation set loss function, expressed as:

[0020] θ * = arg min MSE val .

[0021] Further, the use of the Adam algorithm based on gradient optimization dynamically adjusts the learning rate by using the calculated gradient mean and squared mean of the near-infrared spectral data, including using the mean squared error (MSE) as the loss function to calculate the mean squared difference between the predicted value and the actual value of the near-infrared spectral intensity, and performing weight penalty on the errors greater than the set threshold, thereby improving the fitting ability and prediction accuracy of the model.

[0022] In a second aspect, an oil concentration detection system for seawater based on near-infrared absorption spectroscopy includes:

[0023] A data acquisition module configured to obtain spectral samples of different concentrations of different oil samples; collect the original near-infrared spectra of the spectral samples at different concentrations;

[0024] A feature extraction module configured to select characteristic bands based on the difference in near-infrared spectral intensities at different concentrations and extract the spectral data within the characteristic bands;

[0025] A preprocessing module configured to perform normalization preprocessing on the spectral data within the characteristic bands;

[0026] A model training module configured to train a deep learning model using the spectral data within the characteristic bands to obtain concentration results;

[0027] A calculation module configured to use the averaging method for the obtained oil concentration results under the four groups of characteristic bands and finally output the oil concentration result in the sample.

[0028] In a third aspect, the present invention provides a computer-readable storage medium storing multiple instructions, which are adapted to be loaded and executed by a processor of a terminal device for the oil concentration detection method for seawater based on near-infrared absorption spectroscopy.

[0029] In a fourth aspect, the present invention provides a terminal device including a processor and a computer-readable storage medium, where the processor is used to implement each instruction; the computer-readable storage medium is used to store multiple instructions, which are adapted to be loaded and executed by the processor for the oil concentration detection method for seawater based on near-infrared absorption spectroscopy.

[0030] In summary, the present invention has the following beneficial technical effects:

[0031] The present invention provides a seawater oil concentration detection system and method based on near-infrared absorption spectroscopy. According to the absorption characteristics of the X-H group in petroleum in the near-infrared spectral region of 800 nm to 2500 nm, it is proposed to use near-infrared spectroscopy to detect the oil concentration in seawater, and a fitting curve of near-infrared spectral intensity and oil concentration is established to achieve a rapid measurement method for the oil concentration in seawater. In the characteristic wavelength range, the near-infrared spectral intensity shows an obvious negative correlation with different oil types and different oil concentrations, and the correlation coefficient R < -0.8, which proves that this function can be used for the concentration inversion of seawater containing different oil types. This analysis method has universality for the detection of different oil concentrations. In practical applications, the near-infrared spectral data can be used to distinguish the differences in spectral intensities of trace oil, and can effectively invert the oil concentration in seawater, providing a new method for marine oil spill monitoring and the concentration detection of oil-containing seawater discharged from ships. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a schematic diagram of the method of Embodiment 1 of the present invention;

[0033] Figure 2 is a schematic diagram of the near-infrared absorption spectrum acquisition device of Embodiment 1 of the present invention;

[0034] Figure 3 is a fitting example diagram of the near-infrared spectrum preprocessing of seawater containing oil with different concentrations in the 930-970 nm band of Embodiment 1 of the present invention;

[0035] Figure 4 is a normalized spectrum example diagram of seawater containing oil with different concentrations in the 930-970 nm band of Embodiment 1 of the present invention;

[0036] Figure 5 is a fitting curve diagram of the near-infrared spectral intensity and oil concentration in four characteristic wavelength bands of 930-940 nm, 940-950 nm, 950-960 nm, and 960-970 nm of Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] The present invention will be further described in detail below with reference to the accompanying drawings.

[0038] Embodiment 1

[0039] Refer to Figure 1, a method for detecting the oil content concentration in seawater based on near-infrared absorption spectroscopy. The oil-containing seawater detection technology based on near-infrared absorption spectroscopy. According to the definition of the International Association for Testing Materials (ASTM), the wavelength range of the near-infrared spectral region is 780 - 2526 nm. Since the main components of petroleum and its products are various hydrocarbon compounds, the characteristic absorption peaks of different C-H groups such as methyl (913 nm), olefin (895 nm), methylene (934 nm), and aromatic hydrocarbon (875 nm) are present in the near-infrared region, and only the X-H group will absorb in the near-infrared spectral region of 800 nm - 2500 nm. The application of the near-infrared spectral absorption characteristics can be used to measure and determine the oil content concentration.

[0040] First, it is necessary to obtain spectral sample data of different concentrations of different oil samples. Select the band where the near-infrared spectral curve has obvious peak changes between 900 nm and 1100 nm. To facilitate the extraction of sample information, principal component analysis is performed on the spectral region of this band. Using the near-infrared spectral intensity difference of oil-containing seawater samples with different concentrations as the parameter for selecting the characteristic band, by traversing the near-infrared spectral intensity differences of oil-containing seawater with different concentrations at different near-infrared spectral wavelengths, the bands with obvious and large differences are selected as the characteristic bands for concentration inversion. Through analysis and calculation, the band ranges of 930 - 940 nm, 940 - 950 nm, 950 - 960 nm, and 960 - 970 nm are selected as the four characteristic bands, and the spectral intensity data within the characteristic band range are analyzed.

[0041] And perform normalization preprocessing on the original spectral sample data collected within the characteristic band, unify the basic measurement units of the near-infrared spectral data, eliminate the influence of the data dimension, unify the data range, and facilitate data analysis and model establishment.

[0042] The deep learning Adam algorithm, which combines the advantages of the momentum method and the adaptive learning rate, is used for training to perform concentration inversion. Its neural network model structure consists of an input layer, two hidden layers, and an output layer. The simple structure ensures that the data training and inversion speed can be completed relatively quickly. The mean square error is used as the loss function for optimization. At the four characteristic bands of 930 - 940 nm, 940 - 950 nm, 950 - 960 nm, and 960 - 970 nm, the fitting functions of the near-infrared spectral intensity and the oil content concentration in seawater are obtained respectively, and the correlation coefficient R is calculated. It is found that the near-infrared spectral intensity and the oil content concentration show a negative correlation, and at the four characteristic bands, the correlation coefficient R < -0.8, which proves that the fitting function can be used for the concentration inversion of oil-containing seawater of different oil types. This analysis method has universality for the detection of different oil concentrations.

[0043] By preprocessing the near-infrared spectrum, spectral band division and data screening are carried out. Then, further data processing is performed according to the results of the preprocessing. Through the fitting processing of experimental data and the training analysis of deep learning algorithms, it can be seen that the spectral curves of different oil types are significantly different. The concentration inversion is carried out for each oil sample respectively. This analysis method has universality for the detection of different oil concentrations. In practical applications, the near-infrared spectrum data can be used to distinguish the differences in the spectral intensities of trace oils, and can effectively invert the concentration of oil-containing seawater.

[0044] Based on the above principle, it includes the following steps:

[0045] Step 1: Obtain spectral samples of different concentrations of different oil samples;

[0046] Using seawater as a solvent, oil samples such as crude oil, marine fuel oil and refined oil are used to represent the oil-containing seawater of marine oil spills to prepare sample solutions. Each oil sample is set with concentration gradients such as 5mg / L, 10mg / L, 15mg / L, 20mg / L, 50mg / L and 100mg / L;

[0047] The infrared light source is used as the emission light source and is connected to one end of the optical fiber connection device. The spectrometer is used as the near-infrared spectrum data acquisition unit and is connected to the other end of the sample carrier through the optical fiber. The mixed solution is placed in a cuvette, and seawater is used as a reference for spectral scanning. The scanning is carried out 100 times, which is used as the original near-infrared spectrum of the experimental sample, as Figure 2 ;

[0048] Step 2: Collect the original near-infrared spectra of spectral samples at different concentrations;

[0049] Obtain the original near-infrared spectrum data of the experimental sample, carry out spectral band division and data screening on it, and select the band where the near-infrared spectrum curve has obvious peak changes between 900nm and 1100nm for the convenience of extracting sample information. Taking the near-infrared spectrum intensity difference of oil-containing seawater samples at different concentrations as the parameter for feature band selection, by traversing the near-infrared spectrum intensity differences of oil-containing seawater at different concentrations under different near-infrared spectrum wavelengths, the band with obvious and large differences is selected as the feature band for concentration inversion. Taking the near-infrared spectrum intensity differences of n concentration oil-containing seawater samples as the parameter △F for feature band selection, the near-infrared spectrum intensity of oil-containing seawater at a certain concentration is x i , and the near-infrared spectrum intensity of pure seawater is x0, then:

[0050]

[0051] Step 3: Select feature bands based on the near-infrared spectrum intensity differences at different concentrations, and extract the spectral data within the feature bands;

[0052] Among them, through analysis and calculation, the wavelength ranges of 930 - 940 nm, 940 - 950 nm, 950 - 960 nm, and 960 - 970 nm are selected as four characteristic wavelength bands. The spectral intensity data within the characteristic wavelength band range of 930 - 970 nm are subjected to fitting analysis, as Figure 3 .

[0053] Step 4: Denoise and normalize the spectral data within the characteristic wavelength band;

[0054] 1. Denoising. For the near-infrared spectral data within the characteristic wavelength band of 930 - 970 nm, different methods are used to remove noise, such as the Savitzky-Golay filter and the Moving Average method. Here, the Moving Average method is selected as the denoising method to reduce the random noise of the spectral data. Its calculation formula is:

[0055]

[0056] where MA n is the moving average value of the nth point, N is the window size, and x n-i is the (n - i)th data point.

[0057] 2. Normalization. For the near-infrared spectral data within the characteristic wavelength band of 930 - 970 nm, different preprocessing methods are compared, and the maximum value normalization is selected as the normalization method, that is, the spectral intensity value of each data point in the near-infrared spectral curve is divided by the maximum spectral intensity value within this wavelength band, so that the maximum spectral intensity value of the normalized spectral curve is 1, and the spectral intensity values of other data points are less than 1 accordingly. The obtained normalized near-infrared spectral curve is shown as Figure 3 .

[0058] The formula for maximum value normalization is as follows:

[0059]

[0060] where μ is the mean value and σ is the standard deviation.

[0061] Step 5: Use the original near-infrared spectra of samples at different concentrations collected as the original sample data, and divide the spectral data set within the characteristic wavelength band into three parts: the training set (60%), the validation set (20%), and the test set (20%) to verify the performance of the model during the training process.

[0062] Step 6: Construct a regression model based on the CNN time series algorithm with adaptive differential evolution (ADE) hyperparameter optimization, which specifically includes the following steps;

[0063] 1. Construction of the CNN time series model;

[0064] Build a CNN time series regression algorithm model based on the hyperparameter optimization of the Adaptive Differential Evolution (ADE) algorithm using the TensorFlow / Keras framework. The specific structure of the CNN time series model includes:

[0065] (1) Input Layer: Since the input data is "time" series data, a one-dimensional convolutional neural network (1D CNN) is used to process the local patterns and temporal features in the time series. Each spectral data sample is a sequence in the wavelength dimension, and the CNN can effectively capture these local features. Input a real number with a shape of (1,), representing a single wavelength value. The input variable x ∈ R is the wavelength, and its shape should be:

[0066] x = [x1, x2, x3…x n

[0067] (2) Convolution Layer: The convolution layer extracts local features from the time series by sliding the convolution kernel. The input data is the time series where N is the number of samples and T is the time step (i.e., the dimension of the spectral data or the number of wavelengths). The convolution operation is defined as:

[0068]

[0069] where W is the convolution kernel and b is the bias term. The convolution kernel slides in the time dimension to extract local features.

[0070] (3) Activation Layer: Use the activation function ReLU (Rectified Linear Unit):

[0071] ReLU(x) = max(0, x)

[0072] Using ReLU introduces non-linearity and improves the expressive power of the model.

[0073] (4) Pooling Layer: The pooling layer uses max pooling to reduce the dimension of the features and retain the most important features. In time series data, the max pooling operation is expressed as:

[0074] y t = max(X t , X t+1 , …, X t+k-1 )

[0075] where k is the size of the pooling window. The pooling operation can reduce the computational amount and enhance the generalization ability of the model.

[0076] ​(5) Fully Connected Layer: After convolution and pooling operations, the extracted features are usually mapped to the prediction results through one or more fully connected layers. The output after convolution and pooling is YY, and the calculation of the fully connected layer is as follows:

[0077]

[0078] where W f is the weight of the fully connected layer, b f is the bias, and is the predicted value.

[0079] 2. Use Adaptive Differential Evolution (ADE) to specifically optimize the hyperparameters of the CNN time series;

[0080] (1) Initialize the population: In the Differential Evolution algorithm (DE), a population is first initialized, and each individual represents a combination of hyperparameters of the CNN model. Each individual consists of the following hyperparameters:

[0081] ① Number of filters

[0082] ② Kernel size

[0083] ③ Stride

[0084] ④ Pool size

[0085] ⑤ Learning rate

[0086] ⑥ Dropout rate

[0087] ⑦ Batch size

[0088] ⑧ Number of epochs

[0089] (2) Fitness function evaluation: In each generation, the DE algorithm evaluates the fitness of each individual in the population. The fitness function is usually based on the validation error of the model, such as the Mean Squared Error (MSE) or R 2 , and the calculation method is as follows:

[0090]

[0091] where y i is the true value, is the predicted value of the model, and N is the number of samples in the validation set. The lower the fitness value of each individual, the better the corresponding combination of hyperparameters.

[0092] (3) Differential evolution operations: Mutation, crossover, and selection:

[0093] ① Mutation operation: The mutation operation in the differential evolution algorithm is used to generate candidate solutions. Each individual generates a new candidate individual v through differential mutation by selecting three random individuals (assumed to be x r 1, x r 2, x r 3) in the population:

[0094] v i = x r1 + F·(x r2 - x r3 )

[0095] where F is the mutation factor, which controls the mutation amplitude. Through the mutation operation, the candidate solutions will have a certain degree of difference, thus exploring potential better hyperparameter combinations.

[0096] ② Crossover operation: The crossover operation is used to generate a new candidate solution u by combining the candidate solution after the mutation operation and the current solution. Usually, a single-point or uniform crossover strategy is used:

[0097]

[0098] where CR is the crossover probability, which determines the proportion of the mutated solution and the current solution combined. A larger crossover probability can increase the diversity of the search space.

[0099] ③ Selection operation: The selection operation determines which solution is retained. For each individual, the fitness of its current solution x i and the candidate solution u i is compared. If the candidate solution u i is better (i.e., the fitness value is lower), then u i replaces x i , otherwise the original solution is retained:

[0100]

[0101] Here, f(·) is the fitness function.

[0102] (4) Adaptive differential evolution (ADE) adjustment:

[0103] ① Adaptive adjustment of the mutation factor FF: The mutation factor F controls the mutation step size. Adaptive differential evolution will dynamically adjust F according to the historical search process. For example:

[0104] F new = F old ·(1 - α)+ β

[0105] Among them, α and β are adaptive control parameters, and usually adjust F according to the change of fitness to accelerate convergence or increase diversity.

[0106] ② Adaptive adjustment of the crossover probability CR: The crossover probability CR controls the degree of fusion between the mutant solution and the original solution. The adaptive differential evolution algorithm can adjust CR according to the search progress of the current generation. For example:

[0107] CR new = CR old ·(1 - γ)+δ

[0108] Among them, γ and δ are adaptive adjustment parameters, aiming to dynamically adjust the crossover probability according to the stability of the search.

[0109] (5) Iterative optimization and convergence to finally select the best hyperparameters: Through multiple generations of iteration, the individuals in the population will gradually tend to the optimal solution. In each generation, the DE algorithm will evaluate the fitness of each individual and perform mutation, crossover, and selection operations according to the fitness value, so as to find the optimal combination of hyperparameters. Finally, the algorithm will converge to a stable combination of hyperparameters. After a certain number of iterations, the DE algorithm will select the optimal combination of hyperparameters, and these hyperparameters include: the number of convolutional kernels (Filters), the size of the convolutional kernel (Kernel Size), the stride (Stride), the size of the pooling window (Pool Size), the learning rate (Learning Rate), the Dropout rate, the batch size (Batch Size), and the number of training epochs (Epochs).

[0110] 3. Construct a regression model based on the CNN time series algorithm optimized by adaptive differential evolution (ADE) hyperparameters. After feature extraction by CNN, the obtained features are used as input variables and passed to the regression model for concentration training and prediction. Common regression models include support vector regression (SVR) and decision tree regression. Here, support vector regression is used. The SVR model aims to fit the data by minimizing the training error, and the loss function is:

[0111]

[0112] Among them, w is the weight of the support vector machine, φ(xi) is the feature mapping of the input data, and ∈ is the tolerated error.

[0113] Step 7: Use the spectral data in the feature bands of 930 - 940nm, 940 - 950nm, 950 - 960nm, and 960 - 970nm to train the regression model to obtain the light intensity - oil concentration results. Specifically, it includes:

[0114] 1. Train the CNN: Optimize the hyperparameters of the CNN (such as convolution kernel size, number of layers, pooling window size, etc.) through the adaptive differential evolution algorithm, and train the model. Use the training set data to optimize the weights of the convolutional neural network.

[0115] 2. Train the regression model: Pass the features extracted by the CNN to the support vector regression model (SVR), and optimize the parameters of the regression model through the training set.

[0116] Step 8, Cross-validation based on ADE. During each evaluation process of differential evolution, use cross-validation to evaluate the performance of each individual (hyperparameter combination). The fitness of each individual is calculated by the mean squared error (MSE) or R on the validation set through K-fold cross-validation. 2 Obtained.

[0117]

[0118] Among them, MSE k is the mean squared error of the k-th fold.

[0119] Step 9, Extract the result data obtained above, perform the inversion of light intensity - oil concentration, and finally fit to obtain the fitting functions of the four near-infrared spectral intensities and oil concentration under the characteristic bands of 930 - 940nm, 940 - 950nm, 950 - 960nm, and 960 - 970nm as follows:

[0120] y = -0.01 + 0.87 (930 - 940nm)

[0121] y = -0.01 + 0.83 (940 - 950nm)

[0122] y = -0.01 + 0.84 (950 - 960nm)

[0123] y = -0.01 + 0.86 (960 - 970nm)

[0124] Calculate the correlation coefficient between each characteristic band and the actual oil concentration to ensure that the selected bands have a high correlation (|R| > 0.8). The characteristic bands with high correlation can effectively reflect the change of oil concentration with the light intensity under near-infrared, and improve the ability of the model to predict oil concentration.

[0125] The fitting function curves of the near-infrared spectral intensity and oil concentration under the four characteristic bands are as Figure 5 .

[0126] As a further implementation method,

[0127] Near-infrared absorption spectrum acquisition device, which can collect the near-infrared absorption spectra of seawater containing oil spills at different concentrations, and pre-acquire the near-infrared spectral data of seawater samples containing common oil types in marine oil spills (such as crude oil, marine fuel oil, and refined oil, etc.) at different concentration gradients (set at 5mg / L, 10mg / L, 15mg / L, 20mg / L, and 100mg / L, etc.) as the sample training data for the concentration inversion method. An infrared light source is used as the emission light source, and a filter structure is designed to perform band-pass filtering on the required near-infrared characteristic bands; the sample solution to be measured is placed in a cuvette and loaded into a specific light-shielding device for measurement; a spectrometer is used to obtain the near-infrared spectral data of the seawater containing oil. Pure seawater is collected for spectral scanning as the reference near-infrared spectral data of the sample to be measured;

[0128] The near-infrared spectral data characteristic band selection unit connected to the above-mentioned near-infrared absorption spectrum acquisition device uses the near-infrared spectral intensity difference of seawater samples containing oil at different concentrations as the parameter for selecting characteristic bands. By traversing the near-infrared spectral intensity differences of seawater containing oil at different concentrations under the near-infrared spectral wavelengths, the bands with obvious and large differences are selected as the characteristic bands for concentration inversion.

[0129] The near-infrared spectral data preprocessing unit connected to the above-mentioned near-infrared spectral data characteristic band selection unit performs normalization preprocessing on the acquired original near-infrared spectral data to purify the spectral graph and extract characteristic information;

[0130] The characteristic spectral data deep learning algorithm unit connected to the above-mentioned near-infrared spectral data preprocessing unit uses the deep learning Adam algorithm to create a sample curve of oil concentration measurement data, and determines the oil concentration measurement result corresponding to the current near-infrared spectral intensity measurement data based on the created sample curve of oil concentration measurement data;

[0131] The rapid detection method for the oil content concentration of seawater containing marine oil spills connected to the characteristic spectral data deep learning algorithm unit can perform a summation and averaging operation on the oil concentration measurement results under the determined characteristic bands, and finally calculate the oil content concentration in the sample and display the corresponding measurement results.

[0132] Embodiment 2

[0133] This embodiment provides a seawater oil content concentration detection system based on near-infrared absorption spectrum, including:

[0134] The data acquisition module is configured to obtain spectral samples of different concentrations of different oil samples; collect the original near-infrared spectra of spectral samples at different concentrations;

[0135] The feature extraction module is configured to select characteristic bands based on the near-infrared spectral intensity difference at different concentrations and extract the spectral data within the characteristic bands;

[0136] A preprocessing module, configured to perform normalization preprocessing on spectral data within a characteristic band;

[0137] A model training module, configured to train a deep learning model using spectral data within a characteristic band to obtain a concentration result;

[0138] A calculation module, configured to use the averaging method for the obtained oil concentration results under four groups of characteristic bands and finally output the oil concentration result in the sample.

[0139] A computer-readable storage medium, in which multiple instructions are stored, and the instructions are adapted to be loaded and executed by a processor of a terminal device for the described method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy.

[0140] A terminal device, including a processor and a computer-readable storage medium, where the processor is used to implement each instruction; the computer-readable storage medium is used to store multiple instructions, and the instructions are adapted to be loaded and executed by the processor for the described method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy.

[0141] The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention shall be covered within the protection scope of the present invention.

Claims

1. A method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy, characterized in that, Including: Obtain spectral samples of different concentrations for different oil samples; Collect the original near-infrared spectra of spectral samples at different concentrations; Select characteristic bands based on the intensity difference of near-infrared spectra at different concentrations, and extract spectral data within the characteristic bands; Perform normalization preprocessing on the spectral data within the characteristic bands; Use the spectral data within the characteristic bands to train a deep learning model to obtain concentration results; For the obtained oil concentration results under the four groups of characteristic bands, use the averaging method to finally output the oil concentration result in the sample; The step of collecting the original near-infrared spectra of spectral samples at different concentrations includes using an infrared light source as the emission light source to connect one end of the optical fiber connection device, and using a spectrometer as the near-infrared spectral data acquisition unit to connect the other end of the sample carrier through the optical fiber to collect the original near-infrared spectra of spectral samples at different concentrations, and obtain the intensity difference of near-infrared spectra at the same concentration; Selecting characteristic bands based on the near-infrared spectral intensity differences at different concentrations, and extracting spectral data within the characteristic bands, including traversing the near-infrared spectral intensity differences of oil-containing seawater at different concentrations under near-infrared spectral wavelengths, and selecting the bands with differences greater than the set threshold as the characteristic bands for concentration inversion. Among them, n The near-infrared spectral intensity differences of oil-containing seawater samples at concentrations are used as parameters for selecting characteristic bands. x i The near-infrared spectral intensity of oil-containing seawater at a certain concentration is x 0 , and the near-infrared spectral intensity of pure seawater is , then: Bands greater than 500 are selected as characteristic bands. Among them, by using the direct truncation method, near-infrared spectral data in the wavelength range of 930 - 970 nm in the near-infrared spectrum is extracted, and 930 - 940 nm, 940 - 950 nm, 950 - 960 nm, and 960 - 970 nm are divided into four characteristic bands.

2. The method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy according to claim 1, wherein The step of obtaining spectral samples of different concentrations for different oil samples includes using seawater as a solvent, and using crude oil, marine fuel oil and refined oil as oil samples to configure sample solutions representing oil-containing seawater in marine oil spills. Concentration gradients of 5mg / L, 10mg / L, 15mg / L, 20mg / L and 100mg / L are set for each oil sample.

3. The method for detecting the oil content concentration in seawater based on near-infrared absorption spectroscopy according to claim 2, wherein The step of performing normalization preprocessing on the spectral data within the characteristic bands includes using the maximum value normalization method to divide the data points at each point in the near-infrared spectral curve by the data point of the maximum spectral intensity, so that the maximum spectral intensity value of the normalized spectral curve is 1, and the spectral intensity values of other data points are correspondingly less than 1.

4. The method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy according to claim 3, wherein, The step of using the spectral data within the characteristic bands to train a deep learning model includes using the TensorFlow / Keras framework to build an Adam algorithm model based on adaptive differential hyperparameter optimization, in which an input layer, a hidden layer, an output layer and an optimizer are respectively constructed; among them, the optimizer uses the gradient-based Adam optimization algorithm, and uses the dual characteristics of the Adam optimization algorithm combined with the momentum method and RMSProp to optimize the model structure.

5. The method for detecting the oil concentration in seawater based on near-infrared absorption spectrum according to claim 4, characterized in that, The step of using the dual characteristics of the Adam optimization algorithm combined with the momentum method and RMSProp to optimize the model structure includes sequentially initializing the first-order momentum estimate and the second-order momentum estimate, calculating the gradient of the loss function with respect to the parameters, and performing bias correction after updating the first-order momentum estimate and the second-order momentum estimate, and updating the parameter θ according to the corrected momentum.

6. The method for detecting the oil content concentration in seawater based on near-infrared absorption spectroscopy according to claim 5, wherein, Training the deep learning model using the spectral data within the characteristic band further includes determining the learning rate through optimization by the self-adaptive differential evolution algorithm JADE , wherein ; searching for the optimal solution by simulating the changes of individuals in the population; the fitness of each individual is determined by its performance, and the differential evolution algorithm gradually optimizes the hyperparameters through natural selection. The ultimate goal is to find the combination of hyperparameters that minimizes the loss; optimizing the parameters through the self-adaptive differential evolution algorithm JADE: , ∈[16, 128], minimizing the loss function of the validation set, expressed as: 。 7. The method for detecting the oil content concentration in seawater based on near-infrared absorption spectroscopy according to claim 6, characterized in that, Using the gradient-based Adam algorithm to dynamically adjust the learning rate by calculating the gradient mean and square mean of the near-infrared spectral data includes using the MSE mean square error as the loss function to calculate the mean square difference between the predicted value and the actual value of the near-infrared spectral intensity, and performing weight penalty on the error greater than the set threshold, so as to improve the fitting ability and prediction accuracy of the model.

Citation Information

Patent Citations

  • Oil species identification method by sea oil spill concentration auxiliary auxiliary parameter fluorescence spectrum

    CN101458213A

  • Rapid quantitative identification method for fuel oil and crude oil of offshore oil spill by fluorescence method

    CN106092981A