Environmental pollution grading method, device, equipment and storage medium
1. An environmental pollution classification method, characterized in that the method comprises:
receiving waveform sampling data and early warning value domain data corresponding to the waveform sampling data, and sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data;
calculating a difference value between the iterative early warning data and corresponding early warning value domain data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network;
acquiring original concentration waveforms of various pollutants in a preset environment;
randomly generating fitting initial parameters, constructing an initial fitting function by using the fitting initial parameters, generating a fitting concentration waveform according to the initial fitting function, and establishing a target function by using the difference between the fitting concentration waveform and the original concentration waveform;
solving the partial derivative of the objective function, constructing an iterative formula according to the partial derivative of the objective function, and optimizing the fitting concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform;
and extracting waveform parameters of the target concentration waveform, performing pollution concentration grading processing on the waveform parameters by using the target neural network to obtain early warning data of the target concentration waveform, and obtaining pollution grading results of various pollutants according to the early warning data.
2. The environmental pollution classification method according to claim 1, wherein the weighting and activating processes are sequentially performed on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data, and the iterative early warning data comprises:
performing normalization operation on the waveform sampling data to obtain normalized sampling data;
inputting the normalized sampled data to the original neural network;
initializing layer weights of an input layer and a hidden layer of the original neural network to obtain an input layer iteration weight and a hidden layer iteration weight;
calculating a weighted summation value of the input layer iteration weight and the normalized sampling data to obtain an initial input summation value, and activating the initial input summation value by using a pre-constructed activation function to obtain initial hidden data;
and calculating a weighted summation value of the hidden layer iteration weight and the initial hidden data to obtain an initial hidden summation value, and activating the initial hidden summation value by using the activation function to obtain the iteration early warning data.
3. The environmental pollution classification method according to claim 2, wherein the calculating a difference value between the iterative early warning data and corresponding early warning value range data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network comprises:
calculating a difference value between the iterative early warning data and the early warning value domain data by using a pre-constructed error calculation formula;
if the difference value is larger than or equal to a preset training threshold value, calculating to obtain an output layer residual error of the original neural network by using the iteration early warning data and a preset first residual error formula;
calculating to obtain a residual sum value of each hidden layer of the original neural network by using the output layer residual and the hidden layer iteration weight;
calculating to obtain the residual errors of all hidden layers of the original neural network by using the residual error sum value, the initial hidden data and a preset second residual error formula;
obtaining a weight adjusting factor of an input layer of the original neural network according to the normalized sampling data, the hidden layer residual error and the pre-constructed learning rate, and obtaining an input layer target weight according to the weight adjusting factor of the input layer and the input layer iteration weight;
obtaining a weight adjusting factor of a hidden layer of the original neural network according to the initial hidden data, the residual error of an output layer and the learning rate, obtaining a target weight of the hidden layer according to the weight adjusting factor of the hidden layer and the iterative weight of the hidden layer, updating the iterative weight of the input layer by using the target weight of the input layer, and updating the iterative weight of the hidden layer by using the target weight of the hidden layer to obtain an iterative neural network;
inputting the normalized sampling data into the iterative neural network, calculating a weighted summation value of the input layer iteration weight and the normalized sampling data to obtain an iterative input summation value, and activating the iterative input summation value by using a pre-constructed activation function to obtain iterative hidden data;
calculating a weighted sum value of the hidden layer iteration weight and the iteration hidden data to obtain an iteration hidden sum value, activating the iteration hidden sum value by using the activation function to obtain target early warning data, and updating the iteration early warning data by using the target early warning data;
and returning to the step of calculating the difference value between the iterative early warning data and the early warning value domain data by using the pre-constructed error calculation formula until the difference value is smaller than the training threshold value to obtain the target neural network.
4. The environmental pollution classification method of claim 1, wherein the obtaining of the original concentration waveforms of the plurality of pollutants in the preset environment comprises:
establishing a time interval for collecting pollutant concentration data;
performing equidistant sampling on the pollutants according to the time interval to obtain pollutant concentration data;
and constructing a pollution concentration point set according to the pollutant concentration data, calculating an original function of the pollution concentration point set by using a pre-constructed interpolation formula, and generating the original concentration waveform according to the original function.
5. The method of grading environmental pollution according to claim 1, wherein said using the difference between said fitted concentration waveform and said original concentration waveform to establish an objective function comprises:
segmenting the original concentration waveform from the minimum value of the original concentration waveform to obtain an original concentration wavelet;
extracting the waveform parameters of the original concentration wave division to obtain original wave division parameters;
performing Taylor expansion on the initial fitting function at the original wave division parameter value to obtain a fitting expansion formula;
and constructing the objective function by using the fitting expansion formula.
6. The method for grading environmental pollution according to claim 1, wherein said solving the partial derivatives of the objective function and constructing an iterative formula based on the partial derivatives of the objective function comprises:
calculating a partial derivative of the target function to obtain a first order partial derivative and a second order partial derivative of the target function;
and constructing the iterative formula by using the first-order partial derivatives and the second-order partial derivatives.
7. The method for grading environmental pollution according to claim 1, wherein said optimizing said fitted concentration waveform using said iterative formula to obtain a target concentration waveform comprises:
optimizing the fitted concentration waveform by using the iterative formula to obtain an optimized analog waveform;
constructing a difference formula by using the optimized analog waveform and the original concentration waveform;
and when the value of the difference formula is less than or equal to a pre-constructed optimization threshold value, obtaining the target concentration waveform.
8. An environmental pollution classification device, characterized in that the device comprises:
the neural network training module is used for receiving waveform sampling data and early warning value range data corresponding to the waveform sampling data, sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data, calculating a difference value between the iterative early warning data and the corresponding early warning value range data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network;
the concentration waveform acquisition module is used for acquiring original concentration waveforms of various pollutants in a preset environment;
the target function establishing module is used for randomly generating fitting initial parameters, establishing an initial fitting function by using the fitting initial parameters, generating a fitting concentration waveform according to the initial fitting function, and establishing a target function by using the difference between the fitting concentration waveform and the original concentration waveform;
the objective function optimization module is used for solving the partial derivative of the objective function, constructing an iterative formula according to the partial derivative of the objective function, and optimizing the fitting concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform;
and the pollution result grading module is used for extracting the waveform parameters of the target concentration waveform, performing pollution concentration grading processing on the waveform parameters by using the target neural network to obtain early warning data of the target concentration waveform, and obtaining pollution grading results of various pollutants according to the early warning data.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the environmental pollution classification method of any one of claims 1 to 7.
10. A computer-readable storage medium comprising a storage data area storing created data and a storage program area storing a computer program; characterized in that the computer program, when being executed by a processor, implements the method for environmental pollution classification according to any one of claims 1 to 7.
Background
The prevention of adverse effects, due to unexpected negative impact of people on highly developed industries, leads to three global crises: resource shortage, environmental pollution and ecological destruction. Among them, environmental pollution refers to natural or artificial destruction, and the action of adding a certain substance to the environment exceeds the self-cleaning ability of the environment and causes harm. Environmental pollution may include, for example, river pollution, and the like.
At present, the measure for preventing and controlling the pollution of the river is to sample the pollutants flowing into the river from the sewage discharge port. At present, the pollutant concentration is displayed by mainly using the peak value and the mean value of a single pollutant for sampling data of a sewage outlet, and the method needs to analyze each pollutant independently and then summarize the analysis results of all pollutants. The separate analysis of each contaminant requires a large number of repeated measurement and analysis processes, and the detection of the contaminants is inefficient and inaccurate.
Disclosure of Invention
The invention provides an environmental pollution classification method, an environmental pollution classification device, electronic equipment and a computer readable storage medium, and aims to solve the problems of low detection efficiency and insufficient accuracy of pollutants.
In order to achieve the above object, the present invention provides an environmental pollution classification method, comprising:
receiving waveform sampling data and early warning value domain data corresponding to the waveform sampling data, and sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data;
calculating a difference value between the iterative early warning data and corresponding early warning value domain data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network;
acquiring original concentration waveforms of various pollutants in a preset environment;
randomly generating fitting initial parameters, constructing an initial fitting function by using the fitting initial parameters, generating a fitting concentration waveform according to the initial fitting function, and establishing a target function by using the difference between the fitting concentration waveform and the original concentration waveform;
solving the partial derivative of the objective function, constructing an iterative formula according to the partial derivative of the objective function, and optimizing the fitting concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform;
and extracting waveform parameters of the target concentration waveform, performing pollution concentration grading processing on the waveform parameters by using the target neural network to obtain early warning data of the target concentration waveform, and obtaining pollution grading results of various pollutants according to the early warning data.
Optionally, the weighting and activating processing is sequentially performed on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data, and the method includes:
normalizing the waveform sampling data to obtain normalized sampling data;
inputting the normalized sampling data into the original neural network, wherein the original neural network comprises an input layer and a hidden layer;
initializing layer weights of the input layer and the hidden layer to obtain an input layer iteration weight and a hidden layer iteration weight;
calculating a weighted summation value of the input layer iteration weight and the normalized sampling data to obtain an initial input summation value, and activating the initial input summation value by using a pre-constructed activation function to obtain initial hidden data;
and calculating a weighted summation value of the hidden layer iteration weight and the initial hidden data to obtain an initial hidden summation value, and activating the initial hidden summation value by using the activation function to obtain the iteration early warning data.
Optionally, the calculating a difference between the iterative early warning data and corresponding early warning value domain data, and iteratively adjusting the original neural network according to the difference to obtain a target neural network includes:
substituting the iteration early warning data into a pre-constructed error calculation formula to obtain a difference value between the iteration early warning data and the early warning value domain data;
if the difference value is larger than or equal to a preset training threshold value, calculating the residual error of each output layer by using the iteration early warning data and a preset first residual error formula;
calculating a residual sum value of each hidden layer by using the residual of the output layer and the iterative weight of the hidden layer;
calculating the residual error of each hidden layer by using the residual error sum value, the initial hidden data and a preset second residual error formula;
multiplying the normalized sampling data, the hidden layer residual error and the pre-constructed learning rate to obtain a weight adjusting factor of an input layer, and adding the weight adjusting factor of the input layer and the input layer iteration weight to obtain an input layer target weight;
multiplying the initial hidden data, the output layer residual error and the learning rate to obtain a weight adjusting factor of a hidden layer, adding the weight adjusting factor of the hidden layer and the iterative weight of the hidden layer to obtain a target weight of the hidden layer, updating the iterative weight of the input layer by using the target weight of the input layer, and updating the iterative weight of the hidden layer by using the target weight of the hidden layer to obtain an iterative neural network;
inputting the normalized sampling data into the iterative neural network, calculating a weighted summation value of the input layer iteration weight and the normalized sampling data to obtain an iterative input summation value, and activating the iterative input summation value by using a pre-constructed activation function to obtain iterative hidden data;
calculating a weighted sum value of the hidden layer iteration weight and the iteration hidden data to obtain an iteration hidden sum value, activating the iteration hidden sum value by using the activation function to obtain target early warning data, and updating the iteration early warning data by using the target early warning data;
and returning to the step of substituting the iteration early warning data into a pre-constructed error calculation formula, and stopping training until the difference value is smaller than the training threshold value to obtain the target neural network.
Optionally, the obtaining of the original concentration waveforms of the multiple pollutants in the preset environment includes:
establishing a time interval for collecting pollutant concentration data;
performing equidistant sampling on the pollutants according to the time interval to obtain pollutant concentration data;
and constructing a pollution concentration point set according to the pollutant concentration data, calculating an original function of the pollution concentration point set by using a pre-constructed interpolation formula, and generating the original concentration waveform according to the original function.
Optionally, the establishing an objective function by using a difference between the fitted concentration waveform and the original concentration waveform includes:
segmenting the original concentration waveform from the minimum value of the original concentration waveform to obtain an original concentration wavelet;
extracting the waveform parameters of the original concentration wave division to obtain original wave division parameters;
performing Taylor expansion on the initial fitting function at the original wave division parameter value to obtain a fitting expansion formula;
and constructing the objective function by using the fitting expansion formula.
Optionally, the solving the partial derivative of the objective function, and constructing an iterative formula according to the partial derivative of the objective function, includes:
calculating a partial derivative of the target function to obtain a first order partial derivative and a second order partial derivative of the target function;
and constructing the iterative formula by using the first-order partial derivatives and the second-order partial derivatives.
Optionally, the optimizing the fitted concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform includes:
optimizing the fitted concentration waveform by using the iterative formula to obtain an optimized analog waveform;
constructing a difference formula by using the optimized analog waveform and the original concentration waveform;
and when the value of the difference formula is smaller than or equal to a pre-constructed optimization threshold value, stopping optimization to obtain the target concentration waveform.
In order to solve the above problems, the present invention also provides an environmental pollution classifying device, including:
the neural network training module is used for receiving waveform sampling data and early warning value range data corresponding to the waveform sampling data, sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data, calculating a difference value between the iterative early warning data and the corresponding early warning value range data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network;
the concentration waveform acquisition module is used for acquiring original concentration waveforms of various pollutants in a preset environment;
the target function establishing module is used for randomly generating fitting initial parameters, establishing an initial fitting function by using the fitting initial parameters, generating a fitting concentration waveform according to the initial fitting function, and establishing a target function by using the difference between the fitting concentration waveform and the original concentration waveform;
the objective function optimization module is used for solving the partial derivative of the objective function, constructing an iterative formula according to the partial derivative of the objective function, and optimizing the fitting concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform;
and the pollution result grading module is used for extracting the waveform parameters of the target concentration waveform, performing pollution concentration grading processing on the waveform parameters by using the target neural network to obtain early warning data of the target concentration waveform, and obtaining pollution grading results of various pollutants according to the early warning data.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores computer program instructions executable by the at least one processor to cause the at least one processor to perform the environmental pollution classification method described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium including a storage data area and a storage program area, the storage data area storing created data, the storage program area storing a computer program; wherein the computer program, when executed by a processor, implements the environmental pollution classification method described above.
According to the environmental pollution classification method, the device, the electronic equipment and the computer readable storage medium, the original concentration waveform is decomposed into a more accurate target concentration waveform, and then the adjusted target neural network is used for performing pollutant concentration classification processing on the target concentration waveform to obtain pollution classification results of various pollutants, so that the problems of low detection efficiency and insufficient accuracy of the pollutants are solved.
Drawings
FIG. 1 is a schematic flow chart of environmental pollution classification according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of training a primitive neural network according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of obtaining an original concentration waveform according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating environmental pollution classification according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating an internal structure of an electronic device for environmental pollution classification according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides an environmental pollution grading method. The execution subject of the environmental pollution classification method includes, but is not limited to, at least one of electronic devices, such as a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, the environmental pollution classification method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to fig. 1, a schematic flow chart of environmental pollution classification according to an embodiment of the present invention is shown. In this embodiment, the environmental pollution classification method includes:
s1, receiving waveform sampling data and early warning value domain data corresponding to the waveform sampling data, and sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data;
in the embodiment of the invention, the waveform sampling data refers to waveform parameters of a single peak of the extracted pollutants, and the waveform parameters comprise a waveform peak value, a waveform center and a waveform half width. The early warning value range data refers to early warning range indexes defined according to the pollution degree of pollutants, such as: 0-0.2 for low risk, 0.2-0.4 for lower risk, 0.4-0.6 for medium risk, 0.6-0.8 for higher risk, 0.8-1.0 for high risk, etc. For example: 5 pieces of waveform sampling data for displaying ammonia nitrogen pollution data are provided, and the waveform peak values of the 5 pieces of waveform sampling data are respectively less than 0.5 mg/L; 0.5-1.0 mg/L; 1.0-3.0 mg/L; 3.0-5.0 mg/L; and if the frequency is more than 5.0mg/L, the 5 waveforms respectively correspond to low risk, medium risk, high risk and high risk in the early warning value domain data. Another example is: 5 pieces of waveform sampling data for displaying the suspended solid pollution data exist, and the waveform half widths of the 5 pieces of waveform sampling data are respectively less than 2 min; the half width of the waveform is 2-4 min; the half width of the waveform is 4-6 min; the half width of the waveform is 6-8 min; and if the half width of the waveform is more than 8min, the 5 waveforms respectively correspond to low risk, medium risk, high risk and high risk in the early warning value domain data. The iteration early warning data refers to data output by the original neural network in a continuous iteration adjustment process.
In the embodiment of the present invention, the original neural network may adopt a BP neural network, and includes an input layer, a hidden layer, and an output layer. The input layer contains a plurality of nodes responsible for receiving sampled data, each node receiving waveform sampled data of a contaminant, for example: the waveform peak value receiving nodes of the ammonia nitrogen pollutants and the waveform peak value receiving nodes of the suspended solid pollutants are 2 nodes at the moment. Another example is: the device comprises an ammonia nitrogen pollutant waveform half-width receiving node, a suspended solid pollutant waveform half-width receiving node and an oxygen content waveform half-width receiving node, wherein the number of input layer nodes is 3.
The hidden layer comprises a plurality of nodes for receiving the output data of the input layer, and the output data is subjected to weighted summation and is input to the output layer after being converted by a pre-constructed activation function. Too few nodes of the hidden layer can cause the original neural network not to be well trained, and the training precision can be influenced. Too many hidden layer nodes may result in an overfitting of the trained raw neural network processing data.
In the embodiment of the present invention, the number of hidden layer nodes may be obtained by using one of the following formulas:
l<n-1;
l=log2n,
wherein l is the number of hidden layer nodes, n is the number of input layer nodes, m is the number of output layer nodes, and a is a constant between 0 and 10.
The output layer comprises a plurality of nodes for receiving the output data of the hidden layer nodes, the output layer nodes can be set according to the early warning grade division requirement, and the number of the output layer nodes is divided into 5. Respectively a low risk node, a lower risk node, a medium risk node, a higher risk node and a high risk node. And the output layer node performs weighted summation on the output data of the hidden layer node, performs difference comparison on the output data and the early warning value domain data after the output data is converted by the activation function to obtain a difference value, and reversely adjusts the weight in the original neural network by using the difference value if the difference value is greater than a preset training threshold value. The input layer iteration weight and the hidden layer iteration weight refer to weights for performing weighted summation when data is transmitted among nodes of the hidden layer, the input layer and the output layer.
In the embodiment of the present invention, the obtaining of the iterative early warning data by sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network includes:
performing normalization operation on the waveform sampling data to obtain normalized sampling data;
inputting the normalized sampled data to the original neural network;
initializing layer weights of an input layer and a hidden layer of the original neural network to obtain an input layer iteration weight and a hidden layer iteration weight;
calculating a weighted summation value of the input layer iteration weight and the normalized sampling data to obtain an initial input summation value, and activating the initial input summation value by using a pre-constructed activation function to obtain initial hidden data;
and calculating a weighted summation value of the hidden layer iteration weight and the initial hidden data to obtain an initial hidden summation value, and activating the initial hidden summation value by using the activation function to obtain the iteration early warning data.
In the embodiment of the invention, the normalization sampling data is data which is obtained by normalizing the waveform sampling data and can be directly input into the original neural network.
S2, calculating a difference value between the iteration early warning data and corresponding early warning value domain data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network;
in one embodiment of the present invention, referring to fig. 2, the S2 includes:
s20, calculating a difference value between the iterative early warning data and the early warning value domain data by using a pre-constructed error calculation formula;
in this embodiment of the present invention, the error calculation formula is a formula for calculating a difference value between the iterative early warning data and the early warning value domain data, and may be:
Cdifference in=(D-YZ)2
Wherein, CDifference inAs difference values, D as iterative early warning data, YZIs the median value of the early warning value range; y isZmaxIs the value domain maximum value, Y, of the early warning value domain dataZmminIs the minimum value of the value range of the early warning value range data.
For example, when the warning value range data is 0.2-0.4, Y isZmaxIs 0.4, YZminIs 0.2. S21, judging whether the difference value is smaller than a preset training threshold value;
the preset training threshold refers to the maximum allowable difference value. If the difference value is greater than or equal to a preset training threshold value, executing S22, and calculating to obtain an output layer residual error of the original neural network by using the iteration early warning data and a preset first residual error formula;
in an embodiment of the present invention, the first residual equation may be:
Coutput layer residual=-(D-YZ)*D*(1-D)
Wherein, COutput layer residualIs said output layer residual, YZThe value is the median of the early warning value range.
S23, calculating to obtain a residual sum value of each hidden layer of the original neural network by using the residual of the output layer and the iterative weight of the hidden layer;
s24, calculating to obtain the residual error of each hidden layer of the original neural network by using the residual error summation value, the initial hidden data and a preset second residual error formula;
in an embodiment of the present invention, the second residual equation may be:
Chidden layer residual=-(YHidden residual sum)*CInitial/iterative hidden data*(1-CInitial/iterative hidden data)
S25, obtaining a weight adjusting factor of an input layer of the original neural network according to the normalized sampling data, the hidden layer residual error and the pre-constructed learning rate, and obtaining an input layer target weight according to the weight adjusting factor of the input layer and the input layer iteration weight;
the learning rate is a numerical value for controlling the iterative adjustment amplitude, and may be 0.6.
S26, obtaining a weight adjusting factor of a hidden layer of the original neural network according to the initial hidden data, the output layer residual error and the learning rate, obtaining a hidden layer target weight according to the weight adjusting factor of the hidden layer and the hidden layer iterative weight, updating the input layer iterative weight by using the input layer target weight, and updating the hidden layer iterative weight by using the hidden layer target weight to obtain an iterative neural network;
s27, inputting the normalized sampling data into the iterative neural network, calculating a weighted summation value of the input layer iteration weight and the normalized sampling data to obtain an iterative input summation value, and activating the iterative input summation value by using the activation function to obtain iterative hidden data;
s28, calculating the weighted sum of the iteration weight of the hidden layer and the iteration hidden data to obtain an iteration hidden sum, activating the iteration hidden sum by using the activation function to obtain target early warning data, updating the iteration early warning data by using the target early warning data, and returning to the step S20.
In the embodiment of the present invention, the activation function refers to a function for converting the weighted and summed data. The activation function of the invention can adopt an S-shaped curve formula, and the S-shaped curve formula is as follows:
in the embodiment of the present invention, the initial input summation value, the initial hidden summation value, the iterative input summation value or the iterative hidden summation value may all be activated by using the above S-shaped curve formula, and when the value of x is the initial input summation value, y is the initial hidden data; when the value of x is the initial hidden summation value, y is the iteration early warning data; when the value of x is the iteration input summation value, y is the iteration hidden data; and when the value of x is the iterative hidden summation value, y is the target early warning data.
And executing S29 and stopping training until the difference value is smaller than the training threshold value to obtain the target neural network.
S3, acquiring original concentration waveforms of various pollutants in the preset environment;
in the embodiment of the present invention, the preset environment refers to a preset environment for collecting pollution data, such as a factory sewage drain. And the original concentration waveform refers to a pollutant pollution data waveform obtained by performing preset interpolation calculation according to collected pollution data in the preset environment.
In an embodiment of the present invention, referring to fig. 3, the S3 includes:
s30, setting a time interval for collecting pollutant concentration data;
s31, performing equidistant sampling on the pollutants according to the time interval to obtain pollutant concentration data;
s32, constructing a pollution concentration point set according to the pollution concentration data, calculating an original function of the pollution concentration point set by using a pre-constructed interpolation formula, and generating the original concentration waveform according to the original function.
In the embodiment of the present invention, the interpolation formula is:
wherein, f (x) refers to the data of the concentration of the detected pollutant at the time point of x. x is the number of0,x1,…,xnRefers to the time points of data acquisition set according to the time intervals. For the time interval, n is the number of samples. f (x)0,x1,...,xn) Is the quotient of the respective step differences of f (x).
For example: f (x)0,x1) In order to obtain the first-order difference quotient,f(x0,x1,x2) In order to obtain a second-order difference quotient,and so on.
In the embodiment of the invention, the time interval is set according to the actual situation, and when the time interval sets the acquisition time point to be x0,x1,…,xnCorresponding to said contaminant concentration data as f (x)0),f(x1),…,f(xn)。
S4, randomly generating fitting initial parameters, constructing an initial fitting function by using the fitting initial parameters, generating a fitting concentration waveform according to the initial fitting function, and establishing a target function by using the difference between the fitting concentration waveform and the original concentration waveform;
in the embodiment of the invention, the fitting initial parameters are waveform peak values, waveform half widths and waveform centers which are randomly generated, and a random fitting concentration waveform can be generated according to the fitting initial parameters. In the embodiment of the present invention, the initial fitting function is:
wherein A isk、μk、ωkRespectively represent the waveform peak of the kth component wave in the fitted concentration waveform,the waveform center and the waveform half width. N refers to the number of partial waves of the fitted concentration waveform. x represents a time parameter.
In this embodiment of the present invention, the establishing an objective function by using a difference between the fitted concentration waveform and the original concentration waveform includes:
segmenting the original concentration waveform from the minimum value of the original concentration waveform to obtain an original concentration wavelet; extracting the waveform parameters of the original concentration wave division to obtain original wave division parameters; performing Taylor expansion on the initial fitting function at the original wave division parameter value to obtain a fitting expansion formula; and constructing the objective function by using the fitting expansion formula.
In the embodiment of the present invention, the original wavelength division parameter refers to a waveform peak value, a waveform half width and a waveform center of the original concentration wavelength division.
In the embodiment of the present invention, the fitting expansion formula is:
wherein P represents the peak value of the original concentration partial wave to be obtained, the center of the wave and the half width of the wave, and P can be represented as P (P)1,p2,p3,…,p4) And m is 3 × N, wherein N refers to the number of original concentration components. m refers to the number of total waveform parameters of all the original concentration waveforms. f (x)iAnd P) refers to the fitting expansion formula. x is the number ofiRefers to the splitting wave of the ith original concentration waveform.Respectively refer to the values of the waveform peak value, the waveform center and the waveform half width of the first original concentration sub-wave of the original concentration waveform,the values of the waveform peak value, the waveform center and the waveform half width of the second original concentration sub-wave of the original concentration waveform are respectively referred, and the like. p is a radical of1,p2,p3Respectively refer to the peak value, center and half width of the first fitted concentration waveform, p4,p5,p6The values of the waveform peak value, the waveform center and the waveform half width of the second fitting concentration waveform are respectively referred to, and the rest is done in the same way.
In the embodiment of the present invention, the objective function is:
wherein, yiAnd the concentration value of the ith original concentration component is referred, and lambda is a preset fitting parameter, so that the objective function is more robust. p is a radical ofjRefers to the jth waveform parameter of the fitted concentration waveform,refers to the jth waveform parameter of the original concentration waveform.
S5, solving the partial derivative of the objective function, constructing an iterative formula according to the partial derivative of the objective function, and optimizing the fitting concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform;
in this embodiment of the present invention, the solving the partial derivative of the objective function, and constructing an iterative formula according to the partial derivative of the objective function includes:
calculating a partial derivative of the target function to obtain a first order partial derivative and a second order partial derivative of the target function;
and constructing the iterative formula by using the first-order partial derivatives and the second-order partial derivatives.
In the embodiment of the present invention, the iterative formula is:
P=p0+[H(x,p0)+λE]-1JT(x,p0)[y-f(x,p0)]
wherein p is0Refers to the waveform parameters of the original concentration waveform, J is represented by the f (x)iP) of the first partial derivatives of P) of the signal. H is original toF (x)iP), the sea plug matrix is replaced by a pseudo sea plug matrix for practical calculation and feasibility considerations, namely: h ═ JTJ. E is an identity matrix and λ is an adjustment factor, and when the adjustment is too fast, the value of λ is appropriately decreased, and when the adjustment is too slow, the value of λ is appropriately increased.
In an embodiment of the present invention, the optimizing the fitted concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform includes:
optimizing the fitted concentration waveform by using the iterative formula to obtain an optimized analog waveform;
constructing a difference formula by using the optimized analog waveform and the original concentration waveform;
and when the value of the difference formula is smaller than or equal to a pre-constructed optimization threshold value, stopping optimization to obtain the target concentration waveform.
In the embodiment of the present invention, the difference formula is:
wherein epsilon is the optimization threshold value and can be set according to the environmental protection standard. n refers to the number of the original concentration components. f (x)i) Refers to the concentration value of the fitted concentration waveform. y isiRefers to the concentration value of the original concentration component.
S6, extracting waveform parameters of the target concentration waveform, performing pollution concentration grading processing on the waveform parameters by using the target neural network to obtain early warning data of the target concentration waveform, and obtaining pollution grading results of various pollutants according to the early warning data.
In the embodiment of the invention, the waveform parameters of the target concentration waveform are divided according to the preset input layer node types to obtain classified waveform parameters; and inputting the classified waveform parameters to corresponding input layer nodes, and utilizing the target neural network to sequentially carry out weighting and activation on the classified waveform parameters to obtain early warning data of the target concentration waveform.
In the embodiment of the present invention, the classification waveform parameter refers to a parameter obtained by classifying different pollution indexes of different pollutants, for example: the waveform peak value of the nitrogen pollutant and the waveform half width of the ammonia nitrogen pollutant belong to different indexes of the same pollutant, such as: the half width of the waveform of the suspended solid pollutant and the half width of the waveform of the oxygen content belong to different indexes of different pollutants.
According to the embodiment of the invention, the original concentration waveform is decomposed into a more accurate target concentration waveform, and then the adjusted target neural network is used for carrying out pollutant concentration grading treatment on the target concentration waveform to obtain the pollution grading results of various pollutants, so that the problems of low pollutant detection efficiency and insufficient precision are solved.
Fig. 4 is a schematic block diagram of the environmental pollution classifying device according to the present invention.
The environmental pollution classifying device 100 of the present invention may be installed in an electronic apparatus. According to the realized functions, the environmental pollution grading device 100 can include a neural network training module 101, a concentration waveform obtaining module 102, an objective function establishing module 103, an objective function optimizing module 104, and a pollution result grading module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the neural network training module 101 is configured to receive waveform sampling data and early warning value range data corresponding to the waveform sampling data, sequentially perform weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data, calculate a difference value between the iterative early warning data and the corresponding early warning value range data, and iteratively adjust the original neural network according to the difference value to obtain a target neural network;
the concentration waveform obtaining module 102 is configured to obtain original concentration waveforms of multiple pollutants in a preset environment;
the target function establishing module 103 is configured to randomly generate fitting initial parameters, establish an initial fitting function by using the fitting initial parameters, generate a fitting concentration waveform according to the initial fitting function, and establish a target function by using a difference between the fitting concentration waveform and the original concentration waveform;
the objective function optimization module 104 is configured to solve the partial derivative of the objective function, construct an iterative formula according to the partial derivative of the objective function, and optimize the fitted concentration waveform by using the iterative formula and the original concentration waveform to obtain a target concentration waveform;
the pollution result grading module 105 is configured to extract a waveform parameter of the target concentration waveform, perform pollution concentration grading processing on the waveform parameter by using the target neural network, obtain early warning data of the target concentration waveform, and obtain a pollution grading result of a plurality of pollutants according to the early warning data.
Each module in the environmental pollution classification device 100 provided in the embodiment of the present invention can use the same means based on the processing method for the environmental pollution classification, and the specific implementation steps are not repeated herein, and the technical effect generated by the function of each module/unit is the same as the technical effect of the processing method for the complaint text, that is, the problem that each pollutant needs to be analyzed independently in a large number of repeated measurement and analysis processes, and the detection efficiency of the pollutant is not high and is not high enough in accuracy is solved.
Fig. 5 is a schematic structural diagram of an electronic device for implementing environmental pollution classification according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as an environmental pollution classification program, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., executing an environmental pollution classification program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of an environmental pollution classification program, etc., but also to temporarily store data that has been output or will be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 5 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 5 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the electronic device may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The environmental pollution classification program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs, which when executed in the processor 10, can implement:
receiving waveform sampling data and early warning value domain data corresponding to the waveform sampling data, and sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data;
calculating a difference value between the iterative early warning data and corresponding early warning value domain data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network;
acquiring original concentration waveforms of various pollutants in a preset environment;
randomly generating fitting initial parameters, constructing an initial fitting function by using the fitting initial parameters, generating a fitting concentration waveform according to the initial fitting function, and establishing a target function by using the difference between the fitting concentration waveform and the original concentration waveform;
solving the partial derivative of the objective function, constructing an iterative formula according to the partial derivative of the objective function, and optimizing the fitted concentration waveform by using the iterative formula to obtain a target concentration waveform;
and extracting waveform parameters of the target concentration waveform, performing pollution concentration grading processing on the waveform parameters by using the target neural network to obtain early warning data of the target concentration waveform, and obtaining pollution grading results of various pollutants according to the early warning data.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
receiving waveform sampling data and early warning value domain data corresponding to the waveform sampling data, and sequentially performing weighting and activation processing on the waveform sampling data by using a pre-constructed original neural network to obtain iterative early warning data;
calculating a difference value between the iterative early warning data and corresponding early warning value domain data, and iteratively adjusting the original neural network according to the difference value to obtain a target neural network;
acquiring original concentration waveforms of various pollutants in a preset environment;
randomly generating fitting initial parameters, constructing an initial fitting function by using the fitting initial parameters, generating a fitting concentration waveform according to the initial fitting function, and establishing a target function by using the difference between the fitting concentration waveform and the original concentration waveform;
solving the partial derivative of the objective function, constructing an iterative formula according to the partial derivative of the objective function, and optimizing the fitted concentration waveform by using the iterative formula to obtain a target concentration waveform;
and extracting waveform parameters of the target concentration waveform, performing pollution concentration grading processing on the waveform parameters by using the target neural network to obtain early warning data of the target concentration waveform, and obtaining pollution grading results of various pollutants according to the early warning data.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying claims should not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种室内天然光照度建模方法