Near-infrared absorption spectrum-based seawater oil concentration detection method and system
Through deep learning methods based on near-infrared absorption spectrum, the existing marine oil-containing seawater detection methods cannot achieve real-time rapid detection and insufficient trace oil detection, and achieve rapid and accurate detection of seawater oil-containing concentrations, providing new detection methods for marine oil-spill emergency monitoring and ship oil-containing sewage discharge.
Patent Information
- Application Number
- CN202411877714.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The existing marine oil-spill oil-containing seawater detection methods have problems such as time, large investment in manpower and material resources, inability to achieve real-time rapid detection, high cost of testing equipment and difficulty in maintenance. Especially in the detection of trace oil, it is difficult to meet the needs of marine oil-spill emergency monitoring and ship oil-containing sewage discharge detection.
The seawater oil-containing concentration detection method based on near-infrared absorption spectrum is adopted. By obtaining spectral samples of different concentrations of different oil samples, the original near-infrared spectrum is collected, the characteristic bands are selected, data preprocessing and normalization is performed, and the deep learning Adam algorithm and curve fitting are used to achieve the inversion of seawater oil-containing concentration.
It realizes rapid and accurate detection of seawater oil-containing concentrations, can distinguish the spectral intensity differences of trace oil, is suitable for the detection of different oil concentrations, and provides new methods for emergency monitoring of marine oil spills and ship oil-containing sewage discharge.
Smart Images

Figure CN119780025A_ABST
Abstract
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 of detecting oily seawater from marine oil spills is to send the oily seawater samples to be tested to the testing laboratory, and after a series of physical and chemical treatments, use the experimental instruments to analyze the oil content in the seawater. Although this method of online sampling and offline testing has high accuracy, it is not suitable for the field. From a practical point of view, it has many disadvantages: it requires a lot of time, manpower and material resources, and cannot achieve real-time rapid detection; in addition, the cost of the detection and analysis instruments is very high, the equipment is large, and maintenance is difficult. It can only be carried out under laboratory conditions and cannot be tested on site; at the same time, professionals with certain professional knowledge and technical foundations must be involved in the detection, etc. At present, the treatment of oily seawater from marine oil spills has made great progress in technical research and equipment realization, but some new technologies and methods for treating oily seawater still have certain problems in the actual production application, and cannot meet the requirements of both technical feasibility (good treatment effect, low operating conditions, easy control, stable process) and economic feasibility (low equipment cost and operating cost). In summary, rapid detection of oil-containing seawater concentration is very necessary. At present, most domestic and foreign research in this field focuses on the innovation of oil-containing seawater detection methods, but there is less research on rapid and accurate detection technology required for actual marine oil spills. Due to the difficulty of detection, most domestic and foreign research is concentrated in environments with high oil content, and there is less research on trace oil detection technology. Timely and accurate detection of whether the oil content in seawater exceeds the standard is an urgent research in marine oil spill emergency management and rational discharge of ship 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 near-infrared spectral data of oil-containing seawater on site, preprocess the near-infrared spectrum, and extract characteristic spectral bands and data screening. Further data deep learning algorithm training is then carried out based on the results of preprocessing and characteristic band selection. Through deep learning Adam algorithm and curve fitting processing and analysis, the inversion of the oil concentration in seawater can be achieved. This analysis method is universal for the detection of different oil concentrations. In actual application, the difference between the spectral intensities of trace oil can be distinguished by using near-infrared spectral data, and the concentration of oil-containing seawater can be effectively inverted, which provides a new method for emergency monitoring of marine oil spills and concentration detection of oily wastewater discharged from ships.
[0004] In the first aspect, the present invention provides a method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy, which adopts the following technical solution:
[0005] A method for detecting oil concentration in seawater based on near infrared absorption spectroscopy, comprising:
[0006] Obtain spectral samples of different concentrations of different oil samples;
[0007] Collect the original near-infrared spectra of spectral samples at different concentrations;
[0008] Select characteristic bands based on the intensity difference of near-infrared spectra at different concentrations, and extract spectral data within the characteristic bands;
[0009] Perform normalization preprocessing on the spectral data in the characteristic band;
[0010] The deep learning model is trained using the spectral data in the characteristic band to obtain the concentration results;
[0011] The oil concentration results under the four sets of characteristic bands are averaged and the oil concentration results in the samples are finally output.
[0012] Furthermore, the method of obtaining spectral samples of different concentrations of different oil samples includes using seawater as a solvent, using crude oil, marine fuel and refined oil as oil samples to represent marine oil spill-containing seawater to prepare a sample solution, and setting a concentration gradient of 5 mg / L, 10 mg / L, 15 mg / L, 20 mg / L and 100 mg / L for each oil sample.
[0013] Furthermore, the method of collecting original near-infrared spectra of spectral samples at different concentrations includes using an infrared light source as an emitting light source through one end of an optical fiber connecting device, and a spectrometer as a near-infrared spectral data acquisition unit through the other end of a sample carrier to collect original near-infrared spectra of spectral samples at different concentrations, thereby obtaining the intensity difference of near-infrared spectra at the same concentration.
[0014] Furthermore, the characteristic band is selected based on the near-infrared spectrum intensity difference of different concentrations, and the spectral data in the characteristic band is extracted, including traversing the near-infrared spectrum intensity difference of oil-containing seawater with different concentrations under the near-infrared spectrum wavelength, and the band with a difference greater than a set threshold is selected as the characteristic band for concentration inversion, wherein the near-infrared spectrum intensity difference of oil-containing seawater samples with n concentrations is used as the parameter △F for characteristic band selection, and the near-infrared spectrum intensity of oil-containing seawater at a certain concentration is x i , the near-infrared spectrum intensity of pure seawater is x0, then:
[0015] The bands with |△F| greater than 500 are selected as characteristic bands, wherein the near-infrared spectrum data within the wavelength range of 930-970nm in the near-infrared spectrum are extracted by direct interception method, and 930-940nm, 940-950nm, 950-960nm and 960-970nm are divided into four characteristic bands.
[0016] Furthermore, the normalization preprocessing of the spectral data in the characteristic band includes adopting a maximum normalization method to divide the data of each point in the near-infrared spectral curve by the data point with 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 deep learning model is trained using spectral data in the characteristic band, including using the TensorFlow / Keras framework to build an Adam algorithm model based on adaptive differential hyperparameter optimization, wherein an input layer, a hidden layer, an output layer and an optimizer are constructed respectively; wherein the optimizer adopts a gradient-based Adam optimization algorithm, and optimizes the model structure by utilizing the dual characteristics of the Adam optimization algorithm combined with the momentum method and RMSProp.
[0018] Furthermore, the Adam optimization algorithm is combined with the dual characteristics of the momentum method and RMSProp to optimize the model structure, including initializing the first-order momentum estimation and the second-order momentum estimation in sequence, calculating the gradient of the loss function with respect to the parameters, and performing bias correction after updating the first-order momentum estimation and the second-order momentum estimation, and updating the parameter θ according to the corrected momentum.
[0019] Furthermore, the method of training the deep learning model using spectral data in the characteristic band also includes optimizing and determining the learning rate v by using the adaptive differential evolution algorithm JADE, wherein η∈[0.0001,0.01]; searching for the optimal solution by simulating individual changes 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, and the ultimate goal is to find a hyperparameter combination that minimizes the loss; optimizing the parameters by using the adaptive differential evolution algorithm JADE: θ={η,n1,n2,batch_size}, batch_size∈[16,128], so that the validation set loss function is minimized, which is expressed as:
[0020] θ * = arg min MSE val .
[0021] Furthermore, the Adam algorithm based on gradient optimization is used to dynamically adjust the learning rate using the calculated gradient mean and square mean of the near-infrared spectral data, including using the MSE mean square error as a loss function to calculate the average square difference between the predicted value and the actual value of the near-infrared spectral intensity, and imposing a weight penalty on errors greater than a set threshold, thereby improving the model's fitting ability and prediction accuracy.
[0022] In a second aspect, a system for detecting oil concentration in seawater based on near infrared absorption spectroscopy comprises:
[0023] The data acquisition module is configured to acquire spectral samples of different concentrations of different oil samples; collect original near-infrared spectra of spectral samples at different concentrations;
[0024] The feature extraction module is configured to select a feature band based on the difference in near-infrared spectral intensity at different concentrations and extract spectral data within the feature band;
[0025] The preprocessing module is configured to perform normalization preprocessing on the spectral data in the characteristic band;
[0026] The model training module is configured to train the deep learning model using the spectral data in the characteristic band to obtain the concentration result;
[0027] The calculation module is configured to use an averaging method to obtain the oil concentration results under the four sets of characteristic bands and finally output the oil concentration results in the sample.
[0028] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, for example, a method for detecting oil concentration in seawater based on near-infrared absorption spectroscopy.
[0029] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded by the processor and executing the method for detecting oil concentration in seawater based on near-infrared absorption spectroscopy.
[0030] In summary, the present invention has the following beneficial technical effects:
[0031] The present invention proposes a seawater oil concentration detection system and method based on near-infrared absorption spectroscopy. According to the absorption characteristics of XH groups in petroleum in the near-infrared spectral region of 800nm to 2500nm, the present invention proposes to detect the seawater oil concentration by using near-infrared spectroscopy, and establishes a near-infrared spectral intensity and oil concentration fitting curve to realize a rapid measurement method of seawater oil concentration. Within the characteristic band range, the near-infrared spectral intensity and different oil concentrations of different oil types show an obvious negative correlation, and the correlation coefficient R<-0.8 proves that the function can be used for the concentration inversion of oil-containing seawater of different oil types. The analysis method has universal applicability for the detection of different oil concentrations. In actual application, the difference between the spectral intensities of trace oil can be distinguished by using near-infrared spectral data, and the concentration of oil in seawater can be effectively inverted, which provides a new method for marine oil spill monitoring and 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 a near-infrared absorption spectrum acquisition device according to Example 1 of the present invention;
[0034] Figure 3 This is a diagram showing an example of near-infrared spectrum preprocessing and fitting of oil-containing seawater at different concentrations in the 930-970 nm band according to Example 1 of the present invention;
[0035] Figure 4 This is an example diagram of normalized spectrum of oil-containing seawater of different concentrations in the 930-970nm band of Example 1 of the present invention;
[0036] Figure 5 It is a fitting curve diagram of near infrared spectrum intensity and oil concentration in four characteristic bands of 930-940nm, 940-950nm, 950-960nm and 960-970nm in Example 1 of the present invention. DETAILED DESCRIPTION
[0037] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0038] Example 1
[0039] Reference Figure 1In the present embodiment, a method for detecting the oil content in seawater based on near-infrared absorption spectroscopy is provided. According to the definition of the International Association for Testing Materials (ASTM), the wavelength range of the near-infrared spectrum region is 780-2526 nm. Since petroleum and its products are mainly composed of various hydrocarbon compounds, the different CH group information such as methyl (913 nm), olefin (895 nm), methylene (934 nm) and aromatic hydrocarbon (875 nm) contained therein have characteristic absorption peaks in the near-infrared region, and only the XH group will absorb in the near-infrared spectrum region of 800 nm to 2500 nm. The absorption characteristics of the near-infrared spectrum can be used to measure and determine the oil content.
[0040] First, it is necessary to obtain spectral sample data of different concentrations of different oil samples, select the band with obvious peak changes between 900nm and 1100nm of the near-infrared spectrum curve, and perform principal component analysis on the spectral region of this band to facilitate the extraction of sample information. The near-infrared spectrum intensity difference of oil-containing seawater samples with different concentrations is used as the parameter for selecting the characteristic band. By traversing the near-infrared spectrum intensity difference of oil-containing seawater with different concentrations under the near-infrared spectrum wavelength, the band with obvious and large difference is selected as the characteristic band for concentration inversion. After analysis and calculation, the band ranges of 930-940nm, 940-950nm, 950-960nm, and 960-970nm are selected as four characteristic bands, and the spectral intensity data within the characteristic band range is analyzed.
[0041] The original spectral sample data collected in the characteristic band is normalized and preprocessed to 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 building.
[0042] The deep learning Adam algorithm combining the advantages of momentum method and adaptive learning rate is used for training to invert the concentration. The neural network model structure is composed 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 quickly, and the mean square error is used as the loss function for optimization. In the four characteristic bands of 930-940nm, 940-950nm, 950-960nm, and 960-970nm, the fitting functions of the near-infrared spectrum intensity and the oil concentration in seawater are obtained respectively, and the correlation coefficient R is calculated. It is found that the near-infrared spectrum intensity is negatively correlated with the oil concentration, and the correlation coefficient R<-0.8 in the four characteristic bands, which proves that the fitting function can be used for the concentration inversion of oil-bearing seawater of different oil species. This analysis method is universal for the detection of different oil concentrations.
[0043] By preprocessing the near-infrared spectrum, dividing the spectral bands and screening the data, further data processing is performed based on the preprocessing results. Through the fitting of experimental data and the training analysis of the deep learning algorithm, it can be seen that the spectral curves of different oil types are obviously different. The concentration of the oil samples is inverted. This analysis method is universal for the detection of different oil concentrations. In practical applications, the near-infrared spectral data can distinguish the differences between the spectral intensities of trace oils and can effectively invert the concentration of oil-bearing seawater.
[0044] Based on the above principles, the following steps are included:
[0045] Step 1, obtaining spectrum samples of different concentrations of different oil samples;
[0046] The sample solution was prepared using seawater as solvent and crude oil, marine fuel oil and refined oil as representatives of marine oil spill-containing seawater. Each oil sample was set to a concentration gradient of 5 mg / L, 10 mg / L, 15 mg / L, 20 mg / L, 50 mg / L and 100 mg / L.
[0047] The infrared light source is connected to one end of the device through an optical fiber as the emission light source, and the spectrometer is connected to the other end of the sample carrier through an optical fiber as the near-infrared spectrum data acquisition unit. The mixed solution is placed in a cuvette, and the spectrum is scanned with seawater as a reference. The scan is performed 100 times as the original near-infrared spectrum of the experimental sample, such as Figure 2 ;
[0048] Step 2, collecting original near-infrared spectra of spectral samples at different concentrations;
[0049] The original near-infrared spectral data of the experimental samples were obtained, and the spectral bands were divided and data was screened. The near-infrared spectral curve was selected with obvious peak changes between 900nm and 1100nm to facilitate the extraction of sample information. The near-infrared spectral intensity difference of oil-containing seawater samples with different concentrations was used as the parameter for selecting the characteristic band. By traversing the near-infrared spectral intensity difference of oil-containing seawater with different concentrations under the near-infrared spectral wavelength, the band with obvious and large difference was selected as the characteristic band for concentration inversion. The near-infrared spectral intensity difference of oil-containing seawater samples with n concentrations was used as the parameter △F for selecting the characteristic band. The near-infrared spectral intensity difference of oil-containing seawater samples with n concentrations was used as the parameter △F for selecting the characteristic band. The near-infrared spectral intensity of oil-containing seawater at a certain concentration is x. i , the near-infrared spectrum intensity of pure seawater is x0, then:
[0050]
[0051] Step 3, selecting a characteristic band based on the intensity difference of near-infrared spectra of different concentrations, and extracting spectral data within the characteristic band;
[0052] Among them, after analysis and calculation, the band ranges of 930-940nm, 940-950nm, 950-960nm, and 960-970nm are selected as four characteristic bands, and the spectral spectrum intensity data within the characteristic band range of 930-970nm are fitted and analyzed, such as Figure 3 .
[0053] Step 4: De-noise and normalize the spectral data in the characteristic band;
[0054] 1. Denoising. Different methods are used to remove noise from near-infrared spectral data in the characteristic band of 930-970nm, such as Savitzky-Golay filter and moving average method. Here, the moving average method is selected as the denoising method to reduce the random noise of the spectral data. The calculation formula is:
[0055]
[0056] Among them, MA n is the moving average of the nth point, N is the window size, x n-i is the nith data point.
[0057] 2. Standardization. Different preprocessing methods were used to compare the near-infrared spectral data in the characteristic band of 930-970nm, and the maximum value normalization was selected as the standardization method, that is, the spectral intensity value of each data point in the near-infrared spectral curve was divided by the maximum value of the spectral intensity in the 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 correspondingly less than 1. The obtained standardized near-infrared spectral curve is as follows: Figure 3 .
[0058] The maximum normalization formula is as follows:
[0059]
[0060] Here, μ is the mean and σ is the standard deviation.
[0061] Step 5: The original near-infrared spectra of each sample at different concentrations collected are used as original sample data, and the spectral data set within the characteristic band is divided into three parts: training set (60%), validation set (20%) and test set (20%), so as 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 hyperparameter optimization using adaptive differential evolution (ADE), which specifically includes the following steps:
[0063] 1. CNN time series model construction;
[0064] The TensorFlow / Keras framework is used to build a CNN time series regression algorithm model based on the hyperparameter optimization of the adaptive difference algorithm (ADE). The CNN time series model structure specifically 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 local patterns and temporal features in the time series. Each spectral data sample is a sequence in the wavelength dimension, and CNN can effectively capture these local features. Input a real number with a shape of (1,) to represent a single wavelength value. The input variable x∈R is the wavelength, and the shape should be:
[0066] x=[x1,x2,x3…x n ]
[0067] (2) Convolution Layer: The convolution layer extracts local features on the time series by sliding the convolution kernel. The input data is a time series. Where N is the number of samples, T is the time step (i.e. the dimension or number of wavelengths of the spectral data), and the convolution operation is defined as:
[0068]
[0069] Where W is the convolution kernel, b is the bias term, and 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] ReLU is used to introduce nonlinear characteristics and improve the expressiveness of the model.
[0073] (4) Pooling Layer: The pooling layer uses maximum pooling to reduce the dimension of features and retain the most important features. In time series data, the maximum 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 amount of computation 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:
[0077]
[0078] Where W f is the weight of the fully connected layer, b f is the bias, is the predicted value.
[0079] 2. Use adaptive differential evolution (ADE) to specifically optimize CNN time series hyperparameters;
[0080] (1) Initialize the population: In the differential evolution algorithm (DE), a population is first initialized, and each individual represents a hyperparameter combination of the CNN model. Each individual consists of the following hyperparameters:
[0081] ①Number of convolution kernels (Filters)
[0082] ② Kernel Size
[0083] ③Convolution stride
[0084] ④Pool Size
[0085] ⑤Learning Rate
[0086] ⑥Dropout rate
[0087] ⑦Batch Size
[0088] ⑧ Number of training rounds (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 mean square error (MSE) or R 2 , calculated 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 hyperparameter combination.
[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 selects three random individuals from the population (assuming x r 1,x r 2,x r 3) Perform differential mutation to generate a new candidate individual v:
[0094] v i =x r1 +F·(x r2 -x r3 )
[0095] Where F is the mutation factor, which controls the amplitude of the mutation. Through the mutation operation, the candidate solutions will have certain differences, thus exploring potential better hyperparameter combinations.
[0096] ②Crossover: The crossover operation is used to generate a new candidate solution u by combining the candidate solution after the mutation operation with the current solution. Usually a single point or uniform crossover strategy is used:
[0097]
[0098] CR is the crossover probability, which determines the ratio of the mutation solution to the current solution. 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, compare its current solution x i and candidate solution u i If the candidate solution u i is better (i.e., the fitness value is lower), then use u i Replace x i , otherwise keep the original solution:
[0100]
[0101] Here f(·) is the fitness function.
[0102] (4) Adaptive Differential Evolution (ADE) adjustment:
[0103] ① Adaptive adjustment of mutation factor FF: The mutation factor F controls the duration of the mutation. Adaptive differential evolution will dynamically adjust F based on the historical search process, for example:
[0104] F new =F old (1-α)+β
[0105] Among them, α and β are adaptive control parameters, and F is usually adjusted according to the change of fitness to accelerate convergence or increase diversity.
[0106] ② Adaptive adjustment of crossover probability CR: The crossover probability CR controls the degree of integration between the variant 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] Where γ and δ are adaptive adjustment parameters, which aim to dynamically adjust the crossover probability according to the stability of the search.
[0109] (5) Iterative optimization and convergence to ultimately select the best hyperparameters: Through multiple generations of iterations, individuals in the population will gradually tend toward the optimal solution. In each generation, the DE algorithm evaluates the fitness of each individual and performs mutation, crossover, and selection operations based on the fitness value to find the optimal hyperparameter combination. Eventually, the algorithm converges to a stable hyperparameter combination. After a certain number of iterations, the DE algorithm will select the optimal hyperparameter combination, which includes: number of convolution kernels (Filters), convolution kernel size (Kernel Size), stride (Stride), pooling window size (Pool Size), learning rate (Learning Rate), dropout rate, batch size (Batch Size), and number of training rounds (Epochs).
[0110] 3. Construct a regression model based on the CNN time series algorithm with hyperparameter optimization using adaptive differential evolution (ADE). After feature extraction, CNN passes the obtained features as input variables to the regression model for concentration training and prediction. Common regression models include support vector regression (SVR) and decision tree regression. Support vector regression is used here. The SVR model aims to fit the data by minimizing the training error. The loss function is:
[0111]
[0112] Among them, w is the weight of the support vector machine, φ(xi) is the feature map of the input data, and ∈ is the tolerable error.
[0113] Step 7: Use the spectral data in the characteristic bands of 930-940nm, 940-950nm, 950-960nm, and 960-970nm to train the regression model and obtain the light intensity-oil concentration results. Specifically include:
[0114] 1. Training CNN: Optimize the hyperparameters of CNN (such as convolution kernel size, number of layers, pooling window size, etc.) through the adaptive differential evolution algorithm, train the model, and 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 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. In each differential evolution evaluation process, cross-validation is used to evaluate the performance of each individual (hyperparameter combination). The fitness of each individual is calculated by K-fold cross-validation on the validation set by calculating its mean square error (MSE) or R 2 get.
[0117]
[0118] Among them, MSE k is the mean square error of the k-th fold.
[0119] Step 9, extract the result data obtained above, make an inversion of light intensity-oil concentration, and finally fit the fitting functions of the four near-infrared spectral intensities and oil concentrations in the characteristic bands of 930-940nm, 940-950nm, 950-960nm, and 960-970nm:
[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 band has a high correlation (|R|>0.8). Characteristic bands with high correlation can effectively reflect the change of oil concentration with the intensity of light in the near infrared, and improve the model's ability to predict oil concentration.
[0125] The near infrared spectrum intensity and oil concentration fitting function curves in four characteristic bands are as follows: Figure 5 .
[0126] As a further embodiment,
[0127] The near-infrared absorption spectrum acquisition device can collect the near-infrared absorption spectra of oily seawater with different concentrations of marine oil spills, and pre-acquire the near-infrared spectrum data of oily seawater samples with different concentration gradients (set to 5mg / L, 10mg / L, 15mg / L, 20mg / L and 100mg / L, etc.) of common oil types (crude oil, marine fuel and refined oil) in marine oil spills as 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 bandpass filtering on the required near-infrared characteristic bands; the sample solution to be tested is placed in a cuvette and loaded into a specific shading device for measurement; a spectrometer is used to obtain the near-infrared spectrum data of the oily seawater. Pure seawater is collected for spectral scanning as the reference near-infrared spectrum data of the sample to be tested;
[0128] The near-infrared spectrum data characteristic band selection unit connected to the near-infrared absorption spectrum acquisition device uses the near-infrared spectrum intensity difference of the oil-containing seawater samples with different concentrations as the parameter for characteristic band selection, and traverses the near-infrared spectrum intensity difference of the oil-containing seawater with different concentrations under the near-infrared spectrum wavelength, and selects the band with obvious and large difference as the characteristic band for concentration inversion.
[0129] A near infrared spectrum data preprocessing unit connected to the near infrared spectrum data characteristic band selection unit performs normalization preprocessing on the acquired raw near infrared spectrum data and purifies the spectrum to extract characteristic information;
[0130] The characteristic spectrum data deep learning algorithm unit connected to the near-infrared spectrum data preprocessing unit adopts the deep learning Adam algorithm to create an oil concentration measurement data sample curve, and determines the oil concentration measurement result corresponding to the current near-infrared spectrum intensity measurement data based on the created oil concentration measurement data sample curve;
[0131] A rapid detection method for oil concentration in marine oil spill seawater connected to a characteristic spectral data deep learning algorithm unit can sum and average the oil concentration measurement results under the determined characteristic bands, and finally calculate the oil concentration in the sample and display the corresponding measurement results.
[0132] Example 2
[0133] This embodiment provides a seawater oil concentration detection system based on near infrared absorption spectroscopy, comprising:
[0134] The data acquisition module is configured to acquire spectral samples of different concentrations of different oil samples; collect original near-infrared spectra of spectral samples at different concentrations;
[0135] The feature extraction module is configured to select a feature band based on the difference in near-infrared spectral intensity at different concentrations and extract spectral data within the feature band;
[0136] The preprocessing module is configured to perform normalization preprocessing on the spectral data in the characteristic band;
[0137] The model training module is configured to train the deep learning model using the spectral data in the characteristic band to obtain the concentration result;
[0138] The calculation module is configured to use an averaging method to obtain the oil concentration results under the four sets of characteristic bands and finally output the oil concentration results in the sample.
[0139] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a method for detecting the oil concentration in seawater based on near-infrared absorption spectroscopy.
[0140] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor for a method for detecting oil concentration in seawater based on near-infrared absorption spectroscopy.
[0141] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting oil concentration in seawater based on near infrared absorption spectroscopy, characterized in that: include: Obtain spectral samples of different concentrations of 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 in the characteristic band; The deep learning model is trained using the spectral data in the characteristic band to obtain the concentration results; The oil concentration results under the four sets of characteristic bands are averaged and the oil concentration results in the samples are finally output.
2. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 1, characterized in that: The method of obtaining spectral samples of different concentrations of different oil samples includes using seawater as a solvent, using crude oil, marine fuel and refined oil as oil samples to represent marine oil spill-containing seawater to prepare sample solutions, and setting a concentration gradient of 5 mg / L, 10 mg / L, 15 mg / L, 20 mg / L and 100 mg / L for each oil sample.
3. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 2, characterized in that: The method for collecting the original near-infrared spectra of spectral samples at different concentrations includes using an infrared light source as an emitting light source through one end of an optical fiber connecting device, and a spectrometer as a near-infrared spectral data acquisition unit connected to the other end of a sample carrier through an 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.
4. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 3 is characterized in that: The method selects a characteristic band based on the difference in near-infrared spectrum intensity of different concentrations, extracts spectral data in the characteristic band, and traverses the near-infrared spectrum intensity difference of oil-containing seawater with different concentrations under the near-infrared spectrum wavelength, and selects the band with a difference greater than a set threshold as the characteristic band for concentration inversion, wherein the near-infrared spectrum intensity difference of oil-containing seawater samples with n concentrations is used as the parameter △F for characteristic band selection, and the near-infrared spectrum intensity of oil-containing seawater at a certain concentration is x. i , the near-infrared spectrum intensity of pure seawater is x0, then: The bands with |△F| greater than 500 are selected as characteristic bands, wherein the near-infrared spectrum data within the wavelength range of 930-970nm in the near-infrared spectrum are extracted by direct interception method, and 930-940nm, 940-950nm, 950-960nm and 960-970nm are divided into four characteristic bands.
5. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 4, characterized in that: The normalization preprocessing of the spectral data in the characteristic band includes adopting a maximum normalization method to divide the data of each point in the near-infrared spectral curve by the data point with 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.
6. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 5, characterized in that: The method of training a deep learning model using spectral data in a characteristic band includes using a TensorFlow / Keras framework to build an Adam algorithm model based on adaptive differential hyperparameter optimization, wherein an input layer, a hidden layer, an output layer, and an optimizer are constructed respectively; wherein the optimizer adopts a gradient-based Adam optimization algorithm, and optimizes the model structure by utilizing the dual characteristics of the Adam optimization algorithm combined with the momentum method and RMSProp.
7. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 6, characterized in that: The Adam optimization algorithm is combined with the dual characteristics of the momentum method and RMSProp to optimize the model structure, including initializing the first-order momentum estimation and the second-order momentum estimation in sequence, calculating the gradient of the loss function with respect to the parameters, and performing deviation correction after updating the first-order momentum estimation and the second-order momentum estimation, and updating the parameter θ according to the corrected momentum.
8. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 7, characterized in that: The method of training the deep learning model using the spectral data in the characteristic band also includes optimizing and determining the learning rate η through the adaptive differential evolution algorithm JADE, where η∈[0.0001,0.01]; searching for the optimal solution by simulating individual changes 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, and the ultimate goal is to find a hyperparameter combination that minimizes the loss; optimizing the parameters through the adaptive differential evolution algorithm JADE: θ={η,n1,n2,batch_size}, batch_size∈[16,128], so that the validation set loss function is minimized, which is expressed as: i * =arg min MSE val 。 9. The method for detecting oil concentration in seawater based on near infrared absorption spectroscopy according to claim 8, characterized in that: The Adam algorithm based on gradient optimization is used to dynamically adjust the learning rate using the calculated gradient mean and square mean of near-infrared spectral data, including using the MSE mean square error as a loss function to calculate the average square difference between the predicted value and the actual value of the near-infrared spectral intensity, and performing a weight penalty on errors greater than a set threshold, thereby improving the model's fitting ability and prediction accuracy.
10. A seawater oil concentration detection system based on near infrared absorption spectroscopy, characterized in that: include: The data acquisition module is configured to acquire spectral samples of different concentrations of different oil samples; collect original near-infrared spectra of spectral samples at different concentrations; The feature extraction module is configured to select a feature band based on the difference in near-infrared spectral intensity at different concentrations and extract spectral data within the feature band; The preprocessing module is configured to perform normalization preprocessing on the spectral data in the characteristic band; The model training module is configured to train the deep learning model using the spectral data in the characteristic band to obtain the concentration result; The calculation module is configured to use an averaging method to obtain the oil concentration results under the four sets of characteristic bands and finally output the oil concentration results in the sample.
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
Lubricating oil component pollution and carbon reduction detection method based on near infrared spectrum and boundary balance generative adversarial network
CN118130423A
Near infrared spectrum multi-cuvette fusion-based ammonia nitrogen concentration detection method for biogas slurry
CN118624560A
Cited By
AI technology-based oil-in-water spectrum analysis and data transmission system
CN120427549A