Urea detection analysis method and device based on near-infrared modeling

文档序号:1919783 发布日期:2021-12-03 浏览:16次 中文

阅读说明:本技术 基于近红外建模的尿素检测分析方法及装置 (Urea detection analysis method and device based on near-infrared modeling ) 是由 鲁冰 丁焰 杜彪 尹航 吉喆 朱云鹏 裴修尧 周玉山 于 2021-07-29 设计创作,主要内容包括:本公开提供一种基于近红外建模的尿素检测分析方法及装置,能够根据尿素样品的近红外检测值以及各个成分的湿化学值进行结合关联,进而构建对应的数据库,形成近红外分析模型,这样,就可以利用近红外分析模型对待检测的尿素的各项成分含量数据进行检测分析,使得检测得到的各成分含量的准确度得到有效提高。(The invention provides a urea detection and analysis method and device based on near-infrared modeling, which can be used for carrying out combined association according to a near-infrared detection value of a urea sample and a wet chemical value of each component so as to construct a corresponding database and form a near-infrared analysis model, so that each component content data of urea to be detected can be detected and analyzed by using the near-infrared analysis model, and the accuracy of each detected component content is effectively improved.)

1. A urea detection and analysis method based on near-infrared modeling is characterized in that urea is vehicle urea, and the method comprises the following steps:

s1, obtaining a urea sample;

s2, acquiring the near infrared spectrum of each urea sample by using near infrared equipment;

s3, detecting the components of each urea sample by a wet chemical method to obtain wet chemical values corresponding to the components of each urea sample;

s4, inputting the near infrared spectrum and the wet chemical value of the urea sample into a pre-constructed area selection neural network model, wherein after the trained gasoline urea area selection neural network model and the diesel urea area selection neural network model are integrated in advance, a judgment layer is added at the front end, and the area selection neural network model is formed after a data integration layer is added at the rear end;

s5, the judgment layer determines the type of the urea sample according to the wet chemical value, selects a corresponding target region selection neural network model from a gasoline urea region selection neural network model and a diesel urea region selection neural network model according to the determined type, and sends the near infrared spectrum of the urea sample to the target region selection neural network model for processing; wherein the classes of urea samples include: gasoline urea and diesel urea;

s6, the target area selection neural network processes the near infrared spectrum of the urea sample, an area with the largest correlation of information quantity is selected from the near infrared spectrum of the urea sample as a near infrared spectrum area, and the near infrared spectrum area is used as a processing result and sent to a data integration layer;

s7, the data integration layer integrates the processing result and the category corresponding to the target area selection neural network and outputs the integrated result;

s8, collecting the near infrared spectrum regions of the gasoline urea as gasoline near infrared spectrum regions, and collecting the near infrared spectrum regions of the diesel urea as diesel near infrared spectrum regions;

s9, performing first derivative processing on the gasoline near infrared spectrum region or the diesel near infrared spectrum region, and performing multiple linear regression processing to obtain a gasoline near infrared detection value or a diesel near infrared detection value;

s10, correlating the gasoline near-infrared detection value with the corresponding wet chemical value, or correlating the diesel near-infrared detection value with the corresponding wet chemical value by using partial least square operation processing to obtain correlated gasoline data or diesel data of the urea sample;

s11, calculating a gasoline root mean square error between a gasoline near-infrared detection value and a corresponding wet chemical value in the gasoline data, and deleting the gasoline data of which the gasoline root mean square error is greater than a gasoline error threshold, or calculating a diesel root mean square error between a diesel near-infrared detection value and a corresponding wet chemical value in the diesel data, and deleting the diesel data of which the diesel root mean square error is greater than a diesel error threshold;

s12, constructing a gasoline database by using the residual gasoline data, and taking the gasoline database as a gasoline near-infrared analysis initial model, or constructing a diesel database by using the residual diesel data, and taking the diesel database as a diesel near-infrared analysis initial model;

s13, performing cross inspection on the gasoline near-infrared analysis initial model by using a gasoline urea sample to obtain a gasoline near-infrared analysis model, or performing cross inspection on the diesel near-infrared analysis initial model by using a diesel urea sample to obtain a diesel near-infrared analysis model;

s14, combining the gasoline near-infrared analysis model and the diesel near-infrared analysis model to form a near-infrared analysis model;

s15, acquiring a corresponding near infrared spectrum to be analyzed by using infrared equipment for urea to be detected, and processing the urea to be detected by using a humidification method to obtain a wet chemical value to be analyzed corresponding to the components of the urea to be detected;

s16, inputting the near infrared spectrum to be analyzed of the urea to be detected and the corresponding wet chemical value to be analyzed into the near infrared analysis model, determining the category of the urea to be detected by using the near infrared analysis model, and inputting the near infrared spectrum to be analyzed and the corresponding wet chemical value to be analyzed in the urea to be detected into the gasoline near infrared analysis model or the diesel near infrared analysis model of the corresponding category to process so as to obtain the content data of each component of the urea to be detected.

2. The method of claim 1, wherein the constructing of the region-selective neural network model comprises:

SA1, constructing a deep neural network having one input layer, a plurality of hidden layers, and one output layer;

SA2, acquiring a predetermined number of urea samples, acquiring near infrared spectrums of the urea samples by using near infrared equipment, marking target areas in the spectrum area with the maximum correlation in each near infrared spectrum, and taking the near infrared spectrums of the urea samples with the predetermined number after marking as training samples;

SA3, classifying the training samples into gasoline training samples and diesel training samples according to the types of the urea samples;

SA4, extracting gasoline training samples, inputting the gasoline training samples to an input layer of the deep neural network, preprocessing the gasoline training samples by using the input layer, and sending the preprocessed training samples to a hidden layer for processing;

SA5, the hidden layer sends the processing result to the output layer, and the output layer arranges the processing result into a corresponding spectrum region result for output;

SA6, judging whether the output spectrum region result is the same as the corresponding target region mark, if so, selecting the next gasoline training sample for training, otherwise, calculating a loss function between the output spectrum region result and the corresponding target region mark, calculating a loss value by using the loss function, and adjusting parameters of each hidden layer corresponding to the target class in the deep neural network according to the loss value until the output spectrum region result is the same as the corresponding target region mark;

SA7, continuously repeating the steps SA5 to SA7 until the gasoline training samples are completely trained to obtain a gasoline urea region selection neural network model;

SA8, extracting a diesel training sample, inputting the diesel training sample to an input layer in the gasoline urea region selection neural network model, repeating the process from the step SA5 to the step SA7 to continuously train the gasoline urea region selection neural network model until all the diesel training samples are completely trained, and taking the finally obtained neural network as the diesel urea region selection neural network model;

SA9, after integrating the gasoline urea region selection neural network model and the diesel urea region selection neural network model, adding a judgment layer at the front end, and adding a data integration layer at the rear end to form the region selection neural network model.

3. The method of claim 1, wherein the constructing of the region-selective neural network model comprises:

SB1, acquiring a predetermined number of urea samples, acquiring near infrared spectrums of the urea samples by using near infrared equipment, marking target areas in the spectrum area with the maximum correlation in each near infrared spectrum, and taking the near infrared spectrums of the urea samples with the predetermined number after marking as training samples;

SB2, classifying the training samples into gasoline training samples and diesel training samples according to the types of the urea samples;

SB3, constructing two deep neural networks with an input layer, a hidden layer and an output layer, namely a first deep neural network and a second deep neural network;

SB4, extracting gasoline training samples, and training the first deep neural network by using the gasoline training samples to obtain a first neural network initial model capable of identifying the spectral region with the maximum correlation of the near infrared spectrum of gasoline urea;

SB5, extracting diesel training samples, and training the second deep neural network by using the diesel training samples to obtain a second neural network initial model capable of identifying the spectral region with the maximum correlation of the near infrared spectrum of the diesel urea;

SB6, integrating the first neural network initial model and the second neural network initial model, adding a judgment layer before the first neural network initial model and the second neural network initial model, and adding a data integration layer after the first neural network initial model and the second neural network initial model, thereby obtaining the region selection neural network model.

4. The method according to claim 3, wherein step SB4 specifically comprises:

SB41, inputting the gasoline training samples into an input layer of a first deep neural network, preprocessing the gasoline training samples by using the input layer, and sending the preprocessed gasoline training samples to a hidden layer for processing;

SB42, the hidden layer sends the processing result to the output layer, and the output layer arranges the processing result into the corresponding spectrum region result for output;

SB43, judging whether the output spectrum region result is the same as the corresponding target region mark, if so, selecting the next gasoline training sample for training, otherwise, calculating a loss function between the output spectrum region result and the corresponding target region mark, calculating a loss value by using the loss function, and adjusting the parameters of the hidden layer in the first deep neural network according to the loss value until the output spectrum region result is the same as the corresponding target region mark;

and SB44, continuously repeating the steps from SB41 to SB43 until the gasoline training samples are completely trained to obtain a first neural network initial model.

5. The method according to any one of claims 1 to 4, wherein step S13 specifically comprises:

s13-1, sorting N gasoline/diesel urea samples N1,N2……NnSelecting from n gasoline/diesel urea samplesN1Taking gasoline/diesel urea samples as test samples, and taking the rest gasoline/diesel urea samples as modeling samples;

s13-2, utilizing the modeling sample to construct a gasoline/diesel near-infrared analysis initial model again on the constructed near-infrared analysis initial model according to the scheme of the steps S2 to S12;

s13-3, acquiring a corresponding inspection near infrared spectrum of an inspection sample by using infrared equipment, processing the inspection sample by using a humidification method to obtain inspection wet chemical values corresponding to various components, inputting the inspection wet chemical values into a reconstructed gasoline/diesel near infrared analysis initial model for processing, outputting content data of various components of the inspection sample, and comparing the output content data of various components of the inspection sample with real data of the inspection sample to obtain inspection accuracy;

s13-4, sequentially selecting the next gasoline/diesel urea sample as a test sample according to the sequence, taking the rest gasoline/diesel urea samples as modeling samples, and repeating the schemes of the steps S13-2 and S13-3 until the n gasoline/diesel urea samples are respectively taken as test samples to obtain the accuracy rate p of corresponding test1,p2……pn

S13-5, calculating the accuracy rate p of the test1,p2……pnAnd judging whether P is larger than or equal to P, if so, taking the finally obtained gasoline/diesel near-infrared analysis initial model as a gasoline/diesel near-infrared analysis model, otherwise, obtaining a new gasoline/diesel urea sample again, repeating the processes from S13-1 to S13-4 by using the new gasoline/diesel urea sample until the obtained P is larger than or equal to P, and taking the finally obtained gasoline/diesel near-infrared analysis initial model as the gasoline/diesel near-infrared analysis model, wherein P is an accuracy threshold value.

6. The method according to any one of claims 1-5, wherein after step S13, the method further comprises:

s13', acquiring a gasoline/diesel urea samples as a correction set, acquiring b gasoline/diesel urea samples as a verification set, reconstructing a gasoline/diesel near-infrared analysis verification model on the constructed gasoline/diesel near-infrared analysis model by using the gasoline/diesel urea samples in the correction set according to the scheme of the steps S2 to S12, sequentially inputting the gasoline/diesel urea samples in the verification set into the gasoline/diesel near-infrared analysis verification model to output verification results, and comparing the verification results with the real results of the gasoline/diesel urea samples in the verification set to determine the verification accuracy;

and S13 ', judging whether the verification accuracy exceeds a verification threshold value, if so, taking the obtained gasoline/diesel near-infrared analysis and verification model as a final gasoline/diesel near-infrared analysis model, otherwise, obtaining a new correction set and a new verification set, repeating the scheme of the step S13' until the obtained verification accuracy exceeds the verification threshold value, and taking the obtained gasoline/diesel near-infrared analysis and verification model as the final gasoline/diesel near-infrared analysis model.

7. The method according to claim 1, wherein the multiple linear regression processing procedure in step S9 specifically includes:

multiplying at least one principal component spectrum in the gasoline/diesel near-infrared spectrum region after the first derivative processing by a corresponding principal component score coefficient to obtain corresponding principal component spectrum data, and constructing at least one principal component matrix according to the at least one principal component spectrum data;

and constructing at least one main linear function according to at least one main component matrix, and performing linear regression processing on the at least one main linear function to obtain the corresponding gasoline/diesel near-infrared detection value.

8. The method according to claim 7, wherein the operation processing procedure of the partial least squares method in step S10 specifically includes:

constructing a corresponding spectrum matrix according to near-infrared detection values of gasoline/diesel, constructing a main wet chemical matrix according to a main wet chemical value in the wet chemical values, correlating the spectrum matrix with the main wet chemical matrix, and calculating a prediction linear relation function of the two matrixes;

step S12, specifically, it is: and constructing a gasoline/diesel database by utilizing a predicted linear relation function obtained by each residual gasoline/diesel urea sample, and taking the gasoline/diesel database as a gasoline/diesel near-infrared analysis initial model.

9. A urea detection and analysis device based on near-infrared modeling is characterized in that urea is automobile-used urea, and the device comprises:

the acquisition module is used for acquiring and acquiring a urea sample;

the near-infrared acquisition module is used for acquiring the near-infrared spectrum of each urea sample by using near-infrared equipment;

the wet chemical treatment module is used for detecting the components of each urea sample by using a wet chemical method to obtain a wet chemical value corresponding to the components of each urea sample;

the neural network processing module is used for inputting the near infrared spectrum and the wet chemical value of the urea sample into a pre-constructed region selection neural network model, determining the type of the urea sample according to the wet chemical value by the judgment layer, selecting a corresponding target region selection neural network model from the gasoline urea region selection neural network model and the diesel urea region selection neural network model according to the determined type, and sending the near infrared spectrum of the urea sample into the target region selection neural network model for processing; the target area selection neural network is used for processing the near infrared spectrum of the urea sample, an area with the largest correlation of information quantity is selected from the near infrared spectrum of the urea sample to be a near infrared spectrum area, and the near infrared spectrum area is used as a processing result and is sent to a data integration layer; the data integration layer integrates the processing result and the category corresponding to the target area selection neural network and outputs the integrated result; after a trained gasoline urea regional selection neural network model and a diesel urea regional selection neural network model are integrated in advance, a judgment layer is added at the front end, and the regional selection neural network model is formed after a data integration layer is added at the rear end, wherein the urea sample comprises the following categories: gasoline urea and diesel urea;

the collecting module is used for collecting the near infrared spectrum regions of the gasoline urea as gasoline near infrared spectrum regions and collecting the near infrared spectrum regions of the diesel urea as diesel near infrared spectrum regions;

the mathematical processing module is used for performing first derivative processing on the gasoline near infrared spectrum region or the diesel near infrared spectrum region and then performing multiple linear regression processing to obtain a gasoline near infrared detection value or a diesel near infrared detection value;

the correlation processing module is used for correlating the gasoline near-infrared detection value with the corresponding wet chemical value or correlating the diesel near-infrared detection value with the corresponding wet chemical value by utilizing partial least square operation processing to obtain correlated gasoline data or diesel data of the urea sample;

the deleting module is used for calculating the root mean square error of gasoline between the near infrared detection value of gasoline in the gasoline data and the corresponding wet chemical value, and deleting the gasoline data of which the root mean square error is larger than the gasoline error threshold value, or calculating the root mean square error of diesel between the near infrared detection value of diesel in the diesel data and the corresponding wet chemical value, and deleting the diesel data of which the root mean square error of diesel is larger than the diesel error threshold value;

the building module is used for building a gasoline database by using the residual gasoline data, and using the gasoline database as a gasoline near-infrared analysis initial model, or building a diesel database by using the residual diesel data, and using the diesel database as a diesel near-infrared analysis initial model;

the cross inspection module is used for carrying out cross inspection on the gasoline near-infrared analysis initial model by using a gasoline urea sample to obtain a gasoline near-infrared analysis model, or carrying out cross inspection on the diesel near-infrared analysis initial model by using a diesel urea sample to obtain a diesel near-infrared analysis model;

the combination module is used for combining the gasoline near-infrared analysis model and the diesel near-infrared analysis model to form a near-infrared analysis model;

the pretreatment module to be detected is used for acquiring a corresponding near infrared spectrum to be analyzed from urea to be detected by using infrared equipment, and processing the urea to be detected by using a humidification method to obtain a wet chemical value to be analyzed corresponding to the components of the urea to be detected;

the detection analysis module is used for inputting the near infrared spectrum to be analyzed of the urea to be detected and the corresponding wet chemical value to be analyzed into the near infrared analysis model, determining the category of the urea to be detected by using the near infrared analysis model, and inputting the near infrared spectrum to be analyzed and the corresponding wet chemical value to be analyzed in the urea to be detected into the gasoline near infrared analysis model or the diesel near infrared analysis model of the corresponding category to be processed to obtain the content data of each component of the urea to be detected.

10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 8 when executing the program.

Technical Field

The disclosure relates to the technical field of oil product detection, in particular to a urea detection analysis method and device based on near-infrared modeling.

Background

The near infrared spectrum analysis method is widely applied to oil property analysis, and compared with the traditional laboratory test method, the method has the advantages of high analysis speed, high precision, low consumption and the like.

However, in the near infrared spectroscopy analysis in the prior art, only the near infrared spectrum of urea is generally analyzed, and the content of each component of urea or corresponding data indexes is determined according to the near infrared spectrum. The single-near infrared spectrum analysis may cause the detection of each index of urea to be inaccurate, and the detection precision is not high.

Disclosure of Invention

In view of the above, the present disclosure is directed to a method and an apparatus for urea detection and analysis based on near infrared modeling, which can solve or partially solve the above technical problems.

In view of the above, the disclosure provides, in a first aspect, a method for detecting and analyzing urea based on near-infrared modeling, where the urea is vehicle urea, and the method includes:

s1, obtaining a urea sample;

s2, acquiring the near infrared spectrum of each urea sample by using near infrared equipment;

s3, detecting the components of each urea sample by a wet chemical method to obtain wet chemical values corresponding to the components of each urea sample;

s4, inputting the near infrared spectrum and the wet chemical value of the urea sample into a pre-constructed area selection neural network model, wherein after the trained gasoline urea area selection neural network model and the diesel urea area selection neural network model are integrated in advance, a judgment layer is added at the front end, and the area selection neural network model is formed after a data integration layer is added at the rear end;

s5, the judgment layer determines the type of the urea sample according to the wet chemical value, selects a corresponding target region selection neural network model from a gasoline urea region selection neural network model and a diesel urea region selection neural network model according to the determined type, and sends the near infrared spectrum of the urea sample to the target region selection neural network model for processing; wherein the classes of urea samples include: gasoline urea and diesel urea;

s6, the target area selection neural network processes the near infrared spectrum of the urea sample, an area with the largest correlation of information quantity is selected from the near infrared spectrum of the urea sample as a near infrared spectrum area, and the near infrared spectrum area is used as a processing result and sent to a data integration layer;

s7, the data integration layer integrates the processing result and the category corresponding to the target area selection neural network and outputs the integrated result;

s8, collecting the near infrared spectrum regions of the gasoline urea as gasoline near infrared spectrum regions, and collecting the near infrared spectrum regions of the diesel urea as diesel near infrared spectrum regions;

s9, performing first derivative processing on the gasoline near infrared spectrum region or the diesel near infrared spectrum region, and performing multiple linear regression processing to obtain a gasoline near infrared detection value or a diesel near infrared detection value;

s10, correlating the gasoline near-infrared detection value with the corresponding wet chemical value, or correlating the diesel near-infrared detection value with the corresponding wet chemical value by using partial least square operation processing to obtain correlated gasoline data or diesel data of the urea sample;

s11, calculating a gasoline root mean square error between a gasoline near-infrared detection value and a corresponding wet chemical value in the gasoline data, and deleting the gasoline data of which the gasoline root mean square error is greater than a gasoline error threshold, or calculating a diesel root mean square error between a diesel near-infrared detection value and a corresponding wet chemical value in the diesel data, and deleting the diesel data of which the diesel root mean square error is greater than a diesel error threshold;

s12, constructing a gasoline database by using the residual gasoline data, and taking the gasoline database as a gasoline near-infrared analysis initial model, or constructing a diesel database by using the residual diesel data, and taking the diesel database as a diesel near-infrared analysis initial model;

s13, performing cross inspection on the gasoline near-infrared analysis initial model by using a gasoline urea sample to obtain a gasoline near-infrared analysis model, or performing cross inspection on the diesel near-infrared analysis initial model by using a diesel urea sample to obtain a diesel near-infrared analysis model;

s14, combining the gasoline near-infrared analysis model and the diesel near-infrared analysis model to form a near-infrared analysis model;

s15, acquiring a corresponding near infrared spectrum to be analyzed by using infrared equipment for urea to be detected, and processing the urea to be detected by using a humidification method to obtain a wet chemical value to be analyzed corresponding to the components of the urea to be detected;

s16, inputting the near infrared spectrum to be analyzed of the urea to be detected and the corresponding wet chemical value to be analyzed into the near infrared analysis model, determining the category of the urea to be detected by using the near infrared analysis model, and inputting the near infrared spectrum to be analyzed and the corresponding wet chemical value to be analyzed in the urea to be detected into the gasoline near infrared analysis model or the diesel near infrared analysis model of the corresponding category to process so as to obtain the content data of each component of the urea to be detected.

A second aspect of the present disclosure provides a urea detection and analysis device based on near-infrared modeling, where the urea is vehicle urea, and the device includes:

the acquisition module is used for acquiring and acquiring a urea sample;

the near-infrared acquisition module is used for acquiring the near-infrared spectrum of each urea sample by using near-infrared equipment;

the wet chemical treatment module is used for detecting the components of each urea sample by using a wet chemical method to obtain a wet chemical value corresponding to the components of each urea sample;

the neural network processing module is used for inputting the near infrared spectrum and the wet chemical value of the urea sample into a pre-constructed region selection neural network model, determining the type of the urea sample according to the wet chemical value by the judgment layer, selecting a corresponding target region selection neural network model from the gasoline urea region selection neural network model and the diesel urea region selection neural network model according to the determined type, and sending the near infrared spectrum of the urea sample into the target region selection neural network model for processing; the target area selection neural network is used for processing the near infrared spectrum of the urea sample, an area with the largest correlation of information quantity is selected from the near infrared spectrum of the urea sample to be a near infrared spectrum area, and the near infrared spectrum area is used as a processing result and is sent to a data integration layer; the data integration layer integrates the processing result and the category corresponding to the target area selection neural network and outputs the integrated result; after a trained gasoline urea regional selection neural network model and a diesel urea regional selection neural network model are integrated in advance, a judgment layer is added at the front end, and the regional selection neural network model is formed after a data integration layer is added at the rear end, wherein the urea sample comprises the following categories: gasoline urea and diesel urea;

the collecting module is used for collecting the near infrared spectrum regions of the gasoline urea as gasoline near infrared spectrum regions and collecting the near infrared spectrum regions of the diesel urea as diesel near infrared spectrum regions;

the mathematical processing module is used for performing first derivative processing on the gasoline near infrared spectrum region or the diesel near infrared spectrum region and then performing multiple linear regression processing to obtain a gasoline near infrared detection value or a diesel near infrared detection value;

the correlation processing module is used for correlating the gasoline near-infrared detection value with the corresponding wet chemical value or correlating the diesel near-infrared detection value with the corresponding wet chemical value by utilizing partial least square operation processing to obtain correlated gasoline data or diesel data of the urea sample;

the deleting module is used for calculating the root mean square error of gasoline between the near infrared detection value of gasoline in the gasoline data and the corresponding wet chemical value, and deleting the gasoline data of which the root mean square error is larger than the gasoline error threshold value, or calculating the root mean square error of diesel between the near infrared detection value of diesel in the diesel data and the corresponding wet chemical value, and deleting the diesel data of which the root mean square error of diesel is larger than the diesel error threshold value;

the building module is used for building a gasoline database by using the residual gasoline data, and using the gasoline database as a gasoline near-infrared analysis initial model, or building a diesel database by using the residual diesel data, and using the diesel database as a diesel near-infrared analysis initial model;

the cross inspection module is used for carrying out cross inspection on the gasoline near-infrared analysis initial model by using a gasoline urea sample to obtain a gasoline near-infrared analysis model, or carrying out cross inspection on the diesel near-infrared analysis initial model by using a diesel urea sample to obtain a diesel near-infrared analysis model;

the combination module is used for combining the gasoline near-infrared analysis model and the diesel near-infrared analysis model to form a near-infrared analysis model;

the pretreatment module to be detected is used for acquiring a corresponding near infrared spectrum to be analyzed from urea to be detected by using infrared equipment, and processing the urea to be detected by using a humidification method to obtain a wet chemical value to be analyzed corresponding to the components of the urea to be detected;

the detection analysis module is used for inputting the near infrared spectrum to be analyzed of the urea to be detected and the corresponding wet chemical value to be analyzed into the near infrared analysis model, determining the category of the urea to be detected by using the near infrared analysis model, and inputting the near infrared spectrum to be analyzed and the corresponding wet chemical value to be analyzed in the urea to be detected into the gasoline near infrared analysis model or the diesel near infrared analysis model of the corresponding category to be processed to obtain the content data of each component of the urea to be detected.

A third aspect of the present disclosure proposes an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of the first aspect when executing the program.

From the above, the urea detection and analysis method and device based on near-infrared modeling provided by the disclosure can perform combination and association according to the near-infrared detection value of the urea sample and the wet chemical value of each component, further construct the corresponding database, and form the near-infrared analysis model, so that each component content data of urea to be detected can be detected and analyzed by using the near-infrared analysis model, and the accuracy of each detected component content is effectively improved.

Drawings

In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings needed to be used in the description of the embodiments or related technologies are briefly introduced below, and it is obvious that the drawings in the following description are only embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

FIG. 1 is a schematic flow diagram of a method for urea detection and analysis based on near-infrared modeling according to an embodiment of the disclosure;

FIG. 2 is a schematic structural diagram of a urea detection and analysis device based on near-infrared modeling according to an embodiment of the disclosure;

fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.

Detailed Description

For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.

It is to be noted that technical terms or scientific terms used in the embodiments of the present disclosure should have a general meaning as understood by those having ordinary skill in the art to which the present disclosure belongs, unless otherwise defined. The use of "first," "second," and similar terms in the embodiments of the disclosure is not intended to indicate any order, quantity, or importance, but rather to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

As shown in fig. 1, in the method for detecting and analyzing urea based on near-infrared modeling proposed in this embodiment, the vehicle urea is placed in a urea tank of a vehicle, when nitrogen oxide is found in an exhaust pipe of the vehicle, a liquid of the vehicle urea is automatically sprayed from the urea tank, and the liquid of the vehicle urea and the nitrogen oxide undergo an oxidation-reduction reaction in a catalytic reaction tank, so that pollution-free nitrogen gas and water vapor are generated and exhausted.

The method specifically comprises the following steps:

and S1, obtaining a urea sample.

And S2, acquiring the near infrared spectrum of each urea sample by using a near infrared device.

After step S2, spectral regions in the obtained near infrared spectrum in which the absorbance exceeds the light absorption threshold are deleted, and noise regions in each near infrared spectrum are deleted.

To avoid interference in the near infrared spectrum in regions of the spectrum where absorbance exceeds the absorbance threshold, they are deleted, as well as regions of the spectrum where noise is greater. This makes the near infrared spectrum more distinctive.

Since the absorption threshold corresponding to the absorbance of each spectrum may change continuously, however, one absorption threshold cannot be set every time a near infrared spectrum is acquired, which wastes time and reduces the overall efficiency.

Therefore, a large number of labeled near infrared spectrums with corresponding light absorption threshold values and noise threshold values are selected, the labeled near infrared spectrums are used for training the deep neural network, and after the training is finished, the deep neural network can be used for performing drying removal treatment on various near infrared spectrums. Because the deep neural network has the function of relearning, the identification precision can be continuously improved in the process of denoising treatment.

And S3, detecting the components of each urea sample by using a wet chemistry method to obtain a wet chemistry value corresponding to the components of each urea sample.

Wherein the wet-chemical process used comprises at least one of: liquid phase deposition, electrochemical deposition, sol-gel. The wet chemical values of all components in the urea can be accurately determined by using a wet chemical method.

And S4, inputting the near infrared spectrum and the wet chemical value of the urea sample into a pre-constructed area selection neural network model, wherein after the trained gasoline urea area selection neural network model and the diesel urea area selection neural network model are integrated in advance, a judgment layer is added at the front end, and a data integration layer is added at the rear end to form the area selection neural network model.

S5, the judgment layer determines the type of the urea sample according to the wet chemical value, selects a corresponding target region selection neural network model from a gasoline urea region selection neural network model and a diesel urea region selection neural network model according to the determined type, and sends the near infrared spectrum of the urea sample to the target region selection neural network model for processing; wherein the classes of urea samples include: gasoline ureas and diesel ureas.

And S6, the target area selection neural network processes the near infrared spectrum of the urea sample, an area with the maximum correlation of information quantity is selected from the near infrared spectrum of the urea sample as a near infrared spectrum area, and the near infrared spectrum area is used as a processing result and sent to a data integration layer.

And S7, integrating the processing result and the category corresponding to the target area selection neural network by the data integration layer and outputting the integrated result.

And S8, collecting the near infrared spectrum regions of the gasoline urea as gasoline near infrared spectrum regions, and collecting the near infrared spectrum regions of the diesel urea as diesel near infrared spectrum regions. Based on the above steps, since the vehicle urea is generally classified into gasoline urea and diesel urea, the composition of the two types of urea is different, and the spectral region having the largest correlation with the corresponding information amount is also different. Therefore, the present disclosure employs a region-selective neural network model that is constructed by integrating a gasoline urea region-selective neural network model and a diesel urea region-selective neural network model. And then classification screening can be carried out on the judgment section in advance, and then a neural network model is selected in a gasoline urea region or a diesel urea region corresponding to the classification for processing, so that the obtained near infrared spectrum region can be ensured to be more accurate, and the screening precision and accuracy are effectively improved.

And S9, performing first derivative processing on the gasoline near infrared spectrum region or the diesel near infrared spectrum region, and performing multiple linear regression processing to obtain a gasoline near infrared detection value or a diesel near infrared detection value.

The first derivative processing is carried out for the purposes of reducing the influence of low-frequency noise and drift of the near-infrared spectrogram, improving the resolution, facilitating accurate positioning of the peak position and amplifying high-frequency noise.

And S10, correlating the gasoline near-infrared detection value with the corresponding wet chemical value, or correlating the diesel near-infrared detection value with the corresponding wet chemical value by using partial least square operation processing to obtain correlated gasoline data or diesel data of the urea sample.

S11, calculating the root mean square error of gasoline between the near infrared detection value of gasoline in the gasoline data and the corresponding wet chemical value, and deleting the gasoline data of which the root mean square error is larger than the gasoline error threshold value, or calculating the root mean square error of diesel between the near infrared detection value of diesel in the diesel data and the corresponding wet chemical value, and deleting the diesel data of which the root mean square error of diesel is larger than the diesel error threshold value.

S12, constructing a gasoline database by using the residual gasoline data, and taking the gasoline database as a gasoline near-infrared analysis initial model, or constructing a diesel database by using the residual diesel data, and taking the diesel database as a diesel near-infrared analysis initial model;

s13, performing cross inspection on the gasoline near-infrared analysis initial model by using a gasoline urea sample to obtain a gasoline near-infrared analysis model, or performing cross inspection on the diesel near-infrared analysis initial model by using a diesel urea sample to obtain a diesel near-infrared analysis model;

s14, combining the gasoline near-infrared analysis model and the diesel near-infrared analysis model to form a near-infrared analysis model;

s15, acquiring a corresponding near infrared spectrum to be analyzed by using infrared equipment for urea to be detected, and processing the urea to be detected by using a humidification method to obtain a wet chemical value to be analyzed corresponding to the components of the urea to be detected;

s16, inputting the near infrared spectrum to be analyzed of the urea to be detected and the corresponding wet chemical value to be analyzed into the near infrared analysis model, determining the category of the urea to be detected by using the near infrared analysis model, and inputting the near infrared spectrum to be analyzed and the corresponding wet chemical value to be analyzed in the urea to be detected into the gasoline near infrared analysis model or the diesel near infrared analysis model of the corresponding category to process so as to obtain the content data of each component of the urea to be detected.

Through the scheme, the near-infrared detection value of the urea sample and the wet chemical value of the corresponding component can be combined and associated, and then the corresponding database is constructed to form the near-infrared analysis model, so that the near-infrared analysis model can be used for detecting and analyzing the content data of each component of the urea to be detected, and the accuracy of the content of each component obtained through detection is effectively improved.

In some embodiments, the building process of the region selection neural network model comprises:

SA1, constructing a deep neural network having one input layer, a plurality of hidden layers, and one output layer;

SA2, acquiring a predetermined number of urea samples, acquiring near infrared spectrums of the urea samples by using near infrared equipment, marking target areas in the spectrum area with the maximum correlation in each near infrared spectrum, and taking the near infrared spectrums of the urea samples with the predetermined number after marking as training samples;

SA3, classifying the training samples into gasoline training samples and diesel training samples according to the types of the urea samples;

SA4, extracting gasoline training samples, inputting the gasoline training samples to an input layer of the deep neural network, preprocessing the gasoline training samples by using the input layer, and sending the preprocessed training samples to a hidden layer for processing;

SA5, the hidden layer sends the processing result to the output layer, and the output layer arranges the processing result into a corresponding spectrum region result for output;

SA6, judging whether the output spectrum region result is the same as the corresponding target region mark, if so, selecting the next gasoline training sample for training, otherwise, calculating a loss function between the output spectrum region result and the corresponding target region mark, calculating a loss value by using the loss function, and adjusting parameters of each hidden layer corresponding to the target class in the deep neural network according to the loss value until the output spectrum region result is the same as the corresponding target region mark;

SA7, continuously repeating the steps SA5 to SA7 until the gasoline training samples are completely trained to obtain a gasoline urea region selection neural network model;

SA8, extracting a diesel training sample, inputting the diesel training sample to an input layer in the gasoline urea region selection neural network model, repeating the process from the step SA5 to the step SA7 to continuously train the gasoline urea region selection neural network model until all the diesel training samples are completely trained, and taking the finally obtained neural network as the diesel urea region selection neural network model;

SA9, after integrating the gasoline urea region selection neural network model and the diesel urea region selection neural network model, adding a judgment layer at the front end, and adding a data integration layer at the rear end to form the region selection neural network model.

In the steps, as the vehicle urea components of gasoline and diesel are similar, the parameter information of each layer of the neural network model is directly selected along with the gasoline region, the training time of the diesel urea region selection neural network model obtained by continuously learning and training can be reduced, and meanwhile, the accuracy can be ensured.

In addition, a gasoline regional selection neural network model obtained by firstly training a diesel urea regional selection neural network model and then continuously learning and training the diesel urea regional selection neural network model can be selected.

In either case, the two models need to be integrated into one area selection neural network model in the manner of step SA 9.

Through the scheme, the area selection neural network model is used for identifying the near infrared spectrum area with the maximum correlation of information quantity, the identification precision and accuracy can be effectively improved compared with the prior art, and the area selection neural network model has the relearning function, so that the subsequent identification process can be continuously and automatically learned, and the identification precision and accuracy are further improved continuously.

In some embodiments, in addition to the construction scheme of the area selection neural network model in the above process, the area selection neural network model may be constructed by the following process:

SB1, obtaining a predetermined number of urea samples, obtaining the near infrared spectrum of each urea sample by using near infrared equipment, marking the target area in the spectral area with the maximum correlation in each near infrared spectrum, and taking the near infrared spectrum of the urea samples with the predetermined number after marking as a training sample.

And SB2, classifying the training samples into gasoline training samples and diesel training samples according to the types of the urea samples.

SB3, two deep neural networks with an input layer, a hidden layer, and an output layer are constructed, a first deep neural network and a second deep neural network, respectively.

SB4, extracting gasoline training samples, and training the first deep neural network by using the gasoline training samples to obtain a first neural network initial model capable of identifying the spectral region with the maximum correlation of the near infrared spectrum of gasoline urea.

Wherein the step SB4 specifically includes:

SB41, will gasoline class training sample input is to the input layer of first deep neural network, utilizes the input layer is right gasoline class training sample carries out the preliminary treatment to gasoline class training sample after will the preliminary treatment sends hidden layer and handles.

SB42, the hidden layer sends the processing result to the output layer, and the output layer arranges the processing result into the corresponding spectrum region result for output.

SB43, judging whether the output spectrum region result is the same as the corresponding target region mark, if so, selecting the next gasoline training sample for training, otherwise, calculating a loss function between the output spectrum region result and the corresponding target region mark, calculating a loss value by using the loss function, and adjusting the parameters of the hidden layer in the first deep neural network according to the loss value until the output spectrum region result is the same as the corresponding target region mark.

And SB44, continuously repeating the steps from SB41 to SB43 until the gasoline training samples are completely trained to obtain a first neural network initial model.

SB5, extracting diesel training samples, and training the second deep neural network by using the diesel training samples to obtain a second neural network initial model capable of identifying the spectral region with the maximum correlation of the near infrared spectrum of the diesel urea.

The specific training process of the second neural network initial model is the same as the training process of the first neural network initial model, and is not described here again.

SB6, integrating the first neural network initial model and the second neural network initial model, adding a judgment layer before the first neural network initial model and the second neural network initial model, and adding a data integration layer after the first neural network initial model and the second neural network initial model, thereby obtaining the region selection neural network model.

The judgment layer is connected with the input layers of the two neural network initial models, and the finishing layer is connected with the output layers of the two neural network initial models.

Through the scheme, the two trained neural network initial models are integrated to form a total region selection neural network model, so that the condition of confusion can be avoided in the process of identifying the urea of the gasoline/diesel oil category, the probability of identification errors is reduced, and the identification effect is improved. Because the area selection neural network model has the function of relearning, autonomous learning can be continuously carried out in the subsequent identification process, and the identification precision and accuracy are further continuously improved.

In some embodiments, the multiple linear regression processing procedure in step S9 specifically includes:

and S91, multiplying at least one principal component spectrum in the gasoline/diesel near-infrared spectrum region after the first derivative processing by the corresponding principal component score coefficient to obtain corresponding principal component spectrum data, and constructing at least one principal component matrix according to the at least one principal component spectrum data.

S92, constructing at least one main linear function according to the at least one main component matrix, and performing linear regression processing on the at least one main linear function to obtain the corresponding gasoline/diesel near-infrared detection value.

In the scheme, effective information of a sample spectrum is fully extracted by analyzing main components of the near infrared spectrum of gasoline/diesel, the problem of linear correlation is solved, and the internal relation between a spectrum matrix and a sample component matrix is considered, so that a near infrared analysis model constructed based on the method is more stable, and the method is suitable for a complex analysis system.

In some embodiments, the operation process of the partial least squares method in step S10 specifically includes:

constructing a corresponding spectrum matrix according to near-infrared detection values of gasoline/diesel, constructing a main wet chemical matrix according to a main wet chemical value in the wet chemical values, correlating the spectrum matrix with the main wet chemical matrix, and calculating a prediction linear relation function of the two matrixes;

step S12, specifically, it is: and constructing a gasoline/diesel database by utilizing a predicted linear relation function obtained by each residual gasoline/diesel urea sample, and taking the gasoline/diesel database as a gasoline/diesel near-infrared analysis initial model.

In some embodiments, step S13 specifically includes:

s13-1, sorting N gasoline/diesel urea samples N1,N2……NnSelecting N from N gasoline/diesel urea samples1Gasoline/diesel urea samples were used as test samples, and the remaining gasoline/diesel urea samples were used as modeling samples.

And S13-2, utilizing the modeling sample to construct the gasoline/diesel near-infrared analysis initial model again on the constructed near-infrared analysis initial model according to the scheme of the steps S2 to S12.

S13-3, acquiring a corresponding inspection near infrared spectrum of the inspection sample by using infrared equipment, processing the inspection sample by using a humidification method to obtain inspection wet chemical values corresponding to various components, inputting the inspection wet chemical values into the reconstructed gasoline/diesel near infrared analysis initial model for processing, outputting content data of various components of the inspection sample, and comparing the output content data of various components of the inspection sample with real data of the inspection sample to obtain inspection accuracy.

S13-4, sequentially selecting the next gasoline/diesel urea sample as a test sample according to the sequence, taking the rest gasoline/diesel urea samples as modeling samples, and repeating the schemes of the steps S13-2 and S13-3 until the n gasoline/diesel urea samples are respectively taken as test samples to obtain the accuracy rate p of corresponding test1,p2……pn

S13-5, calculating the accuracy rate p of the test1,p2……pnAnd judging whether P is larger than or equal to P, if so, taking the finally obtained gasoline/diesel near-infrared analysis initial model as a gasoline/diesel near-infrared analysis model, otherwise, obtaining a new gasoline/diesel urea sample again, repeating the processes from S13-1 to S13-4 by using the new gasoline/diesel urea sample until the obtained P is larger than or equal to P, and taking the finally obtained gasoline/diesel near-infrared analysis initial model as the gasoline/diesel near-infrared analysis model, wherein P is an accuracy threshold value.

In the scheme, the obtained near-infrared analysis initial model is tested in a cross-testing mode, and each urea sample can be guaranteed to be used for testing and modeling, so that a model with relatively high accuracy can be constructed even if the number of samples is limited, and the modeling efficiency is improved.

In some embodiments, after step S13, the method further comprises:

s13', acquiring a gasoline/diesel urea samples as a correction set, acquiring b gasoline/diesel urea samples as a verification set, reconstructing a gasoline/diesel near-infrared analysis verification model on the constructed gasoline/diesel near-infrared analysis model by using the gasoline/diesel urea samples in the correction set according to the scheme of the steps S2 to S12, sequentially inputting the gasoline/diesel urea samples in the verification set into the gasoline/diesel near-infrared analysis verification model to output verification results, and comparing the verification results with the real results of the gasoline/diesel urea samples in the verification set to determine the verification accuracy;

and S13 ', judging whether the verification accuracy exceeds a verification threshold value, if so, taking the obtained gasoline/diesel near-infrared analysis and verification model as a final gasoline/diesel near-infrared analysis model, otherwise, obtaining a new correction set and a new verification set, repeating the scheme of the step S13' until the obtained verification accuracy exceeds the verification threshold value, and taking the obtained gasoline/diesel near-infrared analysis and verification model as the final gasoline/diesel near-infrared analysis model.

In the above scheme, in order to further ensure the accuracy of the near-infrared model, the correction set is used to construct a corresponding near-infrared verification model on the basis of the near-infrared verification model obtained in the above step S13-5, and then the sample in the verification set is used to verify the near-infrared verification model.

Further, the near-infrared verification model may be further verified by performing the above-described steps S13' to S13 "with the calibration set as the verification set and the verification set as the correction set.

And the near-infrared verification model after verification is used as a final near-infrared analysis model, so that the analysis precision of the finally obtained near-infrared analysis model is further improved.

It should be noted that the method of the embodiments of the present disclosure may be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In such a distributed scenario, one of the devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the devices may interact with each other to complete the method.

It should be noted that the above describes some embodiments of the disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

Based on the same inventive concept, corresponding to the method of any embodiment, the disclosure also provides a urea detection and analysis device based on near infrared modeling.

Referring to fig. 2, the urea detection and analysis device based on near infrared modeling includes:

an obtaining module 201, configured to obtain a urea sample.

A near-infrared acquisition module 202, configured to acquire a near-infrared spectrum of each urea sample by using a near-infrared device.

And the wet chemical processing module 203 is configured to detect the components of each urea sample by using a wet chemical method, and obtain a wet chemical value corresponding to the components of each urea sample.

The neural network processing module 204 is configured to input the near infrared spectrum and the wet chemical value of the urea sample into a pre-constructed region selection neural network model, determine the type of the urea sample according to the wet chemical value, select a corresponding target region selection neural network model from the gasoline urea region selection neural network model and the diesel urea region selection neural network model according to the determined type, and send the near infrared spectrum of the urea sample into the target region selection neural network model for processing; the target area selection neural network is used for processing the near infrared spectrum of the urea sample, an area with the largest correlation of information quantity is selected from the near infrared spectrum of the urea sample to be a near infrared spectrum area, and the near infrared spectrum area is used as a processing result and is sent to a data integration layer; the data integration layer integrates the processing result and the category corresponding to the target area selection neural network and outputs the integrated result; after a trained gasoline urea regional selection neural network model and a diesel urea regional selection neural network model are integrated in advance, a judgment layer is added at the front end, and the regional selection neural network model is formed after a data integration layer is added at the rear end, wherein the urea sample comprises the following categories: gasoline ureas and diesel ureas.

And the collecting module 205 is used for collecting the near infrared spectrum regions of the gasoline urea as gasoline near infrared spectrum regions and collecting the near infrared spectrum regions of the diesel urea as diesel near infrared spectrum regions.

And the mathematical processing module 206 is configured to perform first derivative processing on the gasoline near infrared spectrum region or the diesel near infrared spectrum region, and then perform multiple linear regression processing to obtain a gasoline near infrared detection value or a diesel near infrared detection value.

And the correlation processing module 207 is configured to correlate the gasoline near-infrared detection value with the corresponding wet chemical value, or correlate the diesel near-infrared detection value with the corresponding wet chemical value by using partial least squares operation, so as to obtain correlated gasoline data or diesel data of the urea sample.

The deleting module 208 is configured to calculate a root mean square error of the gasoline between the near-infrared detection value of the gasoline in the gasoline data and the corresponding wet chemical value, and delete the gasoline data in which the root mean square error of the gasoline is greater than a gasoline error threshold, or calculate a root mean square error of the diesel between the near-infrared detection value of the diesel in the diesel data and the corresponding wet chemical value, and delete the diesel data in which the root mean square error of the diesel is greater than a diesel error threshold.

The building module 209 is configured to build a gasoline database by using the remaining gasoline data, and use the gasoline database as a gasoline near-infrared analysis initial model, or build a diesel database by using the remaining diesel data, and use the diesel database as a diesel near-infrared analysis initial model.

The cross inspection module 210 is configured to perform cross inspection on the gasoline near-infrared analysis initial model by using a gasoline urea sample to obtain a gasoline near-infrared analysis model, or perform cross inspection on the diesel near-infrared analysis initial model by using a diesel urea sample to obtain a diesel near-infrared analysis model.

And the combination module 211 is used for combining the gasoline near-infrared analysis model and the diesel near-infrared analysis model to form a near-infrared analysis model.

And the pre-treatment module to be detected 212 is used for acquiring the corresponding near infrared spectrum to be analyzed from the urea to be detected by using infrared equipment, and processing the urea to be detected by using a humidification method to obtain the wet chemical value to be analyzed corresponding to the components of the urea to be detected.

The detection analysis module 213 is configured to input a near-infrared spectrum to be analyzed of the urea to be detected and a corresponding wet chemical value to be analyzed into the near-infrared analysis model, determine a category of the urea to be detected by using the near-infrared analysis model, and input the near-infrared spectrum to be analyzed and the corresponding wet chemical value to be analyzed in the urea to be detected into the gasoline near-infrared analysis model or the diesel near-infrared analysis model of the corresponding category to process the near-infrared spectrum and the corresponding wet chemical value to be analyzed to obtain content data of each component of the urea to be detected.

In some embodiments, the apparatus further comprises a first training module for constructing the region selection neural network model.

The first training module is specifically configured to:

constructing a deep neural network having an input layer, a plurality of hidden layers, and an output layer;

the method comprises the steps of obtaining a preset number of urea samples, obtaining near infrared spectrums of the urea samples by using near infrared equipment, marking a target area in a spectrum area with the maximum correlation in each near infrared spectrum, and taking the near infrared spectrums of the urea samples with the preset number after marking as training samples;

classifying the training samples into gasoline training samples and diesel training samples according to the types of the urea samples;

extracting gasoline training samples, inputting the gasoline training samples into an input layer of the deep neural network, preprocessing the gasoline training samples by using the input layer, and sending the preprocessed training samples to a hidden layer for processing;

the hidden layer sends the processing result to the output layer, and the output layer arranges the processing result into a corresponding spectrum region result to be output;

judging whether the output spectrum region result is the same as the corresponding target region mark, if so, selecting the next gasoline training sample for training, otherwise, calculating a loss function between the output spectrum region result and the corresponding target region mark, calculating a loss value by using the loss function, and adjusting the parameters of each hidden layer corresponding to the target class in the deep neural network according to the loss value until the output spectrum region result is the same as the corresponding target region mark;

continuously repeating the process until the gasoline training samples are completely trained to obtain a gasoline urea region selection neural network model;

extracting a diesel training sample, inputting the diesel training sample to an input layer in the gasoline urea region selection neural network model, repeating the process to continuously train the gasoline urea region selection neural network model until all the diesel training samples are trained completely, and taking the finally obtained neural network as the diesel urea region selection neural network model;

after the gasoline urea region selection neural network model and the diesel urea region selection neural network model are integrated, a judgment layer is added at the front end, and a data integration layer is added at the rear end to form the region selection neural network model.

In some embodiments, the apparatus further comprises a second training module for constructing the region selection neural network model.

The second training module is specifically configured to:

the method comprises the steps of obtaining a preset number of urea samples, obtaining near infrared spectrums of the urea samples by using near infrared equipment, marking target areas in spectrum areas with the maximum correlation in each near infrared spectrum, and taking the near infrared spectrums of the preset number of marked urea samples as training samples.

And classifying the training samples into gasoline training samples and diesel training samples according to the types of the urea samples.

And constructing two deep neural networks with an input layer, a hidden layer and an output layer, namely a first deep neural network and a second deep neural network.

Extracting a gasoline training sample, inputting the gasoline training sample into an input layer of a first deep neural network, preprocessing the gasoline training sample by using the input layer, and sending the preprocessed gasoline training sample to a hidden layer for processing.

The hidden layer sends the processing result to the output layer, and the output layer arranges the processing result into a corresponding spectrum region result to be output.

And judging whether the output spectrum region result is the same as the corresponding target region mark, if so, selecting the next gasoline training sample for training, otherwise, calculating a loss function between the output spectrum region result and the corresponding target region mark, calculating a loss value by using the loss function, and adjusting the parameters of the hidden layer in the first deep neural network according to the loss value until the output spectrum region result is the same as the corresponding target region mark.

And continuously repeating the processes until the gasoline training samples are completely trained to obtain a first neural network initial model.

And extracting a diesel training sample, and training the second deep neural network by using the diesel training sample to obtain a second neural network initial model capable of identifying the spectral region with the maximum correlation of the near infrared spectrum of the diesel urea.

Integrating a first neural network initial model and a second neural network initial model, adding a judgment layer before the first neural network initial model and the second neural network initial model, and adding a data integration layer after the first neural network initial model and the second neural network initial model to obtain a region selection neural network model.

In some embodiments, cross-checking module 210 is specifically configured to:

sequencing N for N gasoline/diesel urea samples1,N2……NnSelecting N from N gasoline/diesel urea samples1Taking gasoline/diesel urea samples as test samples, and taking the rest gasoline/diesel urea samples as modeling samples;

utilizing the modeling sample to construct a gasoline/diesel near-infrared analysis initial model again on the constructed near-infrared analysis initial model according to the scheme of the steps S2 to S12;

acquiring a corresponding inspection near infrared spectrum of an inspection sample by using infrared equipment, processing the inspection sample by using a humidification method to obtain inspection wet chemical values corresponding to various components, inputting the inspection wet chemical values into a reconstructed gasoline/diesel near infrared analysis initial model for processing, outputting content data of various components of the inspection sample, and comparing the output content data of various components of the inspection sample with real data of the inspection sample to obtain inspection accuracy;

sequentially selecting the next gasoline/diesel urea sample as a test sample according to the sequence, taking the rest gasoline/diesel urea samples as modeling samples, and repeating the schemes of the steps S13-2 and S13-3 until the n gasoline/diesel urea samples are respectively taken as test samples to obtain the accuracy rate p of corresponding test1,p2……pn

Calculating the accuracy p of the test1,p2……pnJudging whether P is more than or equal to P, if so, taking the finally obtained gasoline/diesel near-infrared analysis initial model as a gasoline/diesel near-infrared analysis model, and if not, acquiring new gasoline/diesel againAnd (3) repeating the processes from S13-1 to S13-4 by using a new gasoline/diesel urea sample until the obtained P is more than or equal to P, and taking the finally obtained gasoline/diesel near-infrared analysis initial model as a gasoline/diesel near-infrared analysis model, wherein the P is an accuracy threshold.

In some embodiments, the apparatus further comprises: the verification module is specifically configured to:

and (2) acquiring a gasoline/diesel urea samples as a correction set, acquiring b gasoline/diesel urea samples as a verification set, reconstructing a gasoline/diesel near-infrared analysis and verification model on the constructed gasoline/diesel near-infrared analysis model by using the gasoline/diesel urea samples in the correction set according to the scheme of the steps S2 to S12, sequentially inputting the gasoline/diesel urea samples in the verification set into the gasoline/diesel near-infrared analysis and verification model to output verification results, and comparing the verification results with the real results of the gasoline/diesel urea samples in the verification set to determine the verification accuracy.

And judging whether the verification accuracy exceeds a verification threshold value, if so, taking the obtained gasoline/diesel near-infrared analysis and verification model as a final gasoline/diesel near-infrared analysis model, otherwise, obtaining a new correction set and a new verification set, repeating the scheme of the step S13' until the obtained verification accuracy exceeds the verification threshold value, and taking the obtained gasoline/diesel near-infrared analysis and verification model as the final gasoline/diesel near-infrared analysis model.

In some embodiments, the math processing module 206 is specifically configured to:

and multiplying at least one principal component spectrum in the gasoline/diesel near-infrared spectrum region after the first derivative processing by the corresponding principal component score coefficient to obtain corresponding principal component spectrum data, and constructing at least one principal component matrix according to the at least one principal component spectrum data.

And constructing at least one main linear function according to at least one main component matrix, and performing linear regression processing on the at least one main linear function to obtain the corresponding gasoline/diesel near-infrared detection value.

In some embodiments, the association processing module 207 is specifically configured to:

and constructing a corresponding spectrum matrix according to the near-infrared detection values of gasoline/diesel, constructing a main wet chemical matrix according to a main wet chemical value in the wet chemical values, correlating the spectrum matrix and the main wet chemical matrix, and calculating a prediction linear relation function of the two matrixes.

The constructing module 209 is further configured to construct a gasoline/diesel database by using the predicted linear relationship function obtained from the remaining gasoline/diesel urea samples, and use the gasoline/diesel database as a gasoline/diesel near-infrared analysis initial model.

For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the various modules may be implemented in the same one or more software and/or hardware implementations of the present disclosure.

The device of the above embodiment is used for implementing the corresponding urea detection and analysis method based on near-infrared modeling in any one of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.

Based on the same inventive concept, corresponding to the method of any embodiment, the present disclosure further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the method for urea detection and analysis based on near-infrared modeling according to any embodiment is implemented.

Fig. 3 is a schematic diagram illustrating a more specific hardware structure of an electronic device according to this embodiment, where the electronic device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.

The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.

The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.

The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.

The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).

Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.

It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.

The electronic device of the above embodiment is used to implement the corresponding near-infrared modeling-based urea detection and analysis method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.

Based on the same inventive concept, corresponding to any of the above-described embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the near-infrared modeling-based urea detection analysis method according to any of the above embodiments.

Computer-readable media of the present embodiments, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

The storage medium of the above embodiment stores computer instructions for causing the computer to execute the method for urea detection and analysis based on near-infrared modeling according to any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.

Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of the present disclosure, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of brevity.

In addition, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown in the provided figures for simplicity of illustration and discussion, and so as not to obscure the embodiments of the disclosure. Furthermore, devices may be shown in block diagram form in order to avoid obscuring embodiments of the present disclosure, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the embodiments of the present disclosure are to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that the embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.

While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.

The disclosed embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalents, improvements, and the like that may be made within the spirit and principles of the embodiments of the disclosure are intended to be included within the scope of the disclosure.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于近红外建模的汽油/柴油检测分析方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!