Disclosure of Invention
Aiming at the problems that the accuracy and generalization capability of a traditional air quality index contribution rate quantitative evaluation model are low, the convergence speed of the model is low, the characteristic contribution rate evaluation capability is weak and the model robustness is weak, the scheme captures the dependency relationship between the characteristics by introducing a self-attention layer, improves the accuracy and generalization capability of the model, designs a progressive stable activation function, introduces residual connection to a hidden layer, designs a contribution rate calculation layer and a loss function aiming at the characteristic contribution rate, accelerates the convergence speed of the model, improves the accuracy evaluation capability of the characteristic contribution rate of the model, improves the robustness of the model, and aims at the problems that the traditional evaluation model has incorrect super-parameter selection, the model tuning efficiency is low, the super-parameter tuning efficiency and effect are improved by designing an optimized guide function, designing a mixed amplitude optimized search function, and the super-parameter tuning performance is poor by designing an optimized guide function, designing an optimized mixed amplitude optimized search function, and the super-parameter tuning efficiency is improved by designing an optimized search function.
The technical scheme adopted by the invention is as follows, the quantitative assessment method for the AQI contribution rate based on ML and DM provided by the invention comprises the following steps:
 Step S1, data collection;
 S2, preprocessing data;
 S3, creating an air quality index contribution rate quantitative evaluation model;
 s4, optimizing a contribution rate quantitative evaluation model;
 And S5, quantitatively evaluating the air quality index contribution rate.
Further, in step S1, the data collection is collecting air quality monitoring data including fine particulate matter, inhalable particulate matter, sulfur dioxide, nitrogen dioxide, concentration data of ozone and carbon monoxide, meteorological data including temperature, humidity, wind speed, wind direction and air pressure, emission source data including plant number, vehicle flow, fertilizer usage frequency and incineration activity frequency, geographical location data including land utilization type, geographical location and population density, and air quality index.
Further, in step S2, the data preprocessing specifically includes the following steps:
 S21, data cleaning, namely filling the missing value by using the median of the feature corresponding to the missing value, observing and drawing a box diagram of the air quality monitoring data, identifying the feature of the abnormal value and replacing the feature by using the median of the feature corresponding to the abnormal value;
 S22, processing data skewness, carrying out logarithmic transformation on the characteristics with the skewness, and adjusting the skewed characteristics into average neighbor values;
 Step S23, performing correlation analysis on the data, evaluating the degree of correlation between the data and the air quality index, and taking the data highly correlated with the air quality index as an input characteristic of the model according to the result of the correlation analysis;
 step S24, data standardization, unifying units and ranges of numerical data in air quality monitoring data, meteorological data, emission source data, geographic position data and time data;
 step S25, setting a label and setting an air quality index as label data.
Further, in step S3, the creating the quantitative evaluation model of the air quality index contribution rate specifically includes the following steps:
 s31, designing a model overall architecture, wherein the model comprises an input layer for receiving input characteristic data, a self-attention layer for capturing the dependency relationship between the characteristics, a hidden layer with M sub-layers, introducing residual connection, an output layer for predicting an air quality index, and a contribution rate calculation layer for evaluating the air quality index contribution rate;
 Step S32, designing an input layer, and receiving characteristic data of quantitative evaluation of the air quality index contribution rate;
 Step S33, designing a self-attention layer, mapping input features to different attention heads, calculating correlation scores between the input features and the attention heads through dot product operation, converting the scores into probability distribution by using a normalized exponential function and using the probability distribution as attention weights, and carrying out weighted summation on the attention weights and the original features to obtain output of the self-attention layer, wherein the output is expressed as follows:
;
 Wherein,Representing the output of the self-attention layer, softmax (·) representing the normalized exponential function, Z being the dimension of the key, Q representing the query matrix, G representing the key matrix, V representing the value matrix, T representing the transposed symbol of the matrix;
 step S34, designing a progressive stable activation function, and introducing a gradient stability coefficient to relieve the gradient disappearance problem, wherein the gradient stability coefficient is expressed as follows:
;
 Wherein,Representing a progressively stabilizing activation function, x representing an input of the progressively stabilizing activation function,Representing the gradient stability coefficient;
 step S35, designing a hidden layer, and introducing residual connection, wherein the residual connection is represented as follows:
;
 wherein i represents the layer number index of the hidden sub-layer,Representing the output of the i-th hidden sub-layer,Representing the output of the i-1 th hidden sub-layer,Representing the weight of the i-th hidden sub-layer,Representing the input of the i-th hidden sub-layer,Representing the bias of the ith hidden sub-layer;
 Step S36, designing an output layer, wherein the design output layer is expressed as follows:
;
 Wherein,Representing the output of the output layer(s),Representing the input of the output layer,AndRespectively representing the weight and bias of the output layer;
 Step S37, designing a contribution rate calculation function, wherein the weight and gradient reflect the influence degree of the feature on the model output, and the contribution rate is represented by calculating the weight and gradient of the feature from the hidden layer to the output layer, and is represented as follows:
;
 Wherein,Represents a contribution rate calculation function, k represents an index of output layer neurons, w is the total number of output layer neurons,Representing the weight of the kth neuron of the output layer,Representing the gradient of the kth neuron of the output layer with respect to the input,Representing modulo symbols;
 step S38, designing a contribution rate calculation layer, wherein the contribution rate calculation layer is expressed as follows:
;
 wherein CR represents the contribution rate,Representing a contribution rate calculation function;
 Step S39, calculating entropy of the contribution rate, wherein the entropy is expressed as follows:
;
 wherein, n represents the index of the feature, D represents the number of features,The contribution rate of the nth feature is represented,Entropy representing the contribution rate of the feature;
 Step S310, designing a loss function, designing a loss term based on the rationality of the characteristic contribution rate distribution, and calculating the difference between the entropy of the characteristic contribution rate and the historical reference entropy value to measure the rationality of the contribution rate, wherein the rationality is expressed as follows:
;
 Wherein,For the weight and bias parameters of the model,Representing the loss function, c representing the index of the samples, U representing the number of samples,Representing the actual air quality index value of the c-th sample,Representing a predicted value of the air quality index for the c-th sample,The entropy weight is represented by a weight of the entropy,Representing a historical reference entropy value;
 step S311, designing a gradient adjustment strategy, which is expressed as follows:
;
 Where j represents the number of model parameter training times,Representing the gradient of the loss function at the jth model parameter training,Representing a gradient threshold;
 step S312, designing adaptive momentum parameters, which are expressed as follows:
;
 Wherein,The momentum parameter in the j-th model parameter training is min (the) which takes the minimum value, max (the) which takes the maximum value,Momentum parameters during the j-1 model parameter training,The step size of the momentum parameter is represented,AndRepresenting the maximum and minimum values of the momentum parameter respectively,Representing the model performance variation, obtained by calculating the accuracy variation value of the model,Representing a momentum parameter adjustment threshold;
 step S313, designing gradient momentum, which is expressed as follows:
;
 Wherein,Represents the gradient momentum at the jth model parameter training,Representing the gradient momentum of the j-1 model parameter training;
 step S314, training model parameters, which is expressed as follows:
;
 Wherein,Represents model parameters at the j-1 th model parameter training,The learning rate at the time of the j-th model parameter training is represented.
Further, in step S4, the contribution ratio quantitative evaluation model tuning specifically includes the following steps:
 Step S41, creating a super-parameter optimization search space, wherein the optimized super-parameters comprise a learning rate, a gradient threshold value, a gradient momentum parameter, an entropy weight and a gradient stability coefficient;
 Step S42, creating an optimization effect evaluation index, and setting the accuracy of the model as the optimization effect evaluation index of the super-parameter individual;
 Step S43, initializing search space, creating an initial search point cluster, setting maximum search iteration times and setting an optimization effect evaluation index threshold;
 step S44, designing an optimized guide function, wherein the optimized guide function is expressed as follows:
;
 Wherein,Representing the optimized boot function,Represents an initial optimization guide factor, rn represents a random number obeying a standard normal distribution, t represents the number of search iterations, and Tmax represents the maximum number of search iterations
Step S45, designing an optimized amplitude function, wherein the optimized amplitude function is expressed as follows:
;
 Wherein,Represents an optimized amplitude function, x (t) represents a position obtained by searching at the time of the t-th parameter searching,The average value of the positions searched by the search point cluster in the t-th search, bu represents the upper bound of the search space, bl represents the lower bound of the search space,Representing a zero removal factor, xbest representing a position where the current optimization effect evaluation index is maximum;
 Step S46, designing a mixed amplitude optimization search function, wherein the mixed amplitude optimization search function is expressed as follows:
;
 Wherein,Representing the position searched during the t+1st parameter search;
 Step S47, super-parameter searching, namely calculating an optimization effect evaluation index for an initial search point cluster to obtain a position with the maximum optimization effect evaluation index, carrying out parameter optimization searching of a mixed amplitude optimization search function for the search point cluster, calculating the optimization effect evaluation index for the searched position, updating the position with the maximum optimization effect evaluation index, increasing the iteration number once, outputting the parameter of the position with the maximum current optimization effect evaluation index if the optimization effect evaluation index of the searched position is larger than the optimization effect evaluation index threshold, stopping searching, carrying out searching initialization if the maximum iteration number is reached, and carrying out searching again, otherwise, continuing searching.
Further, in step S5, the quantitative evaluation of the air quality index contribution rate is to collect data of an evaluation area, input the data into an air quality index contribution rate quantitative evaluation model, predict the air quality index of the area by the model, output the contribution value of each characteristic factor to the air quality index, thereby knowing the influence degree of each characteristic factor to the air quality index, formulate corresponding management and control measures, and continuously update the model according to the model result and feedback data.
By adopting the scheme, the beneficial effects obtained by the invention are as follows:
 (1) Aiming at the problems of low accuracy and generalization capability, low convergence rate of the model, weak characteristic contribution rate evaluation capability and weak model robustness of the traditional air quality index contribution rate quantitative evaluation model, the method and the device capture the dependency relationship between the characteristics by introducing the self-attention layer, improve the accuracy and generalization capability of the model, design a progressive stable activation function, introduce residual connection by a hidden layer, design a contribution rate calculation layer and a loss function aiming at the characteristic contribution rate, accelerate the convergence rate of the model, improve the accurate evaluation capability of the model on the characteristic contribution rate and improve the robustness of the model.
(2) Aiming at the problems of improper super-parameter selection, low model tuning efficiency and poor model performance of the traditional evaluation model, the super-parameter search is carried out by designing an optimized guide function, an optimized amplitude function and a mixed amplitude optimized search function, so that the super-parameter tuning efficiency and effect are improved, and the model performance is improved.
Detailed Description
The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
In the description of the present invention, it should be understood that the terms "upper," "lower," "front," "rear," "left," "right," "top," "bottom," "inner," "outer," and the like indicate orientation or positional relationships based on those shown in the drawings, merely to facilitate description of the invention and simplify the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the invention.
First embodiment, referring to fig. 1, the method for quantitatively evaluating AQI contribution rate based on ML and DM provided by the present invention includes the following steps:
 Step S1, data collection, namely collecting air quality monitoring data, meteorological data, emission source data, geographical position data, time data and air quality indexes;
 step S2, data preprocessing, data cleaning, data skewness processing, correlation analysis, data standardization and label setting are carried out on the collected data;
 S3, creating an air quality index contribution rate quantitative evaluation model, and creating and training the air quality index contribution rate quantitative evaluation model through a design model overall framework, a design self-attention layer, a design gradual stable activation function, a design contribution rate calculation layer, a design loss function, a design gradient adjustment strategy, a design self-adaptive momentum parameter and a design gradient momentum;
 S4, quantitatively evaluating the model tuning of the contribution rate, and performing parameter tuning on the model through designing an optimized guide function, designing an optimized amplitude function and designing a mixed amplitude optimized search function;
 And S5, quantitatively evaluating the air quality index contribution rate, inputting the data of the evaluated region into an air quality index contribution rate quantitative evaluation model, predicting the air quality index of the region by the model, and outputting the contribution value of each characteristic factor to the air quality index.
In a second embodiment, referring to fig. 1, the data collection is based on the above embodiment, and the air quality monitoring data includes concentration data of fine particulate matter, inhalable particulate matter, sulfur dioxide, nitrogen dioxide, ozone and carbon monoxide, the meteorological data includes temperature, humidity, wind speed, wind direction and air pressure, the emission source data includes plant number, vehicle flow, fertilizer use frequency and incineration activity frequency, the geographical location data includes land utilization type, geographical location and population density, and the time data includes seasonal data, holiday data and special activity data.
Embodiment III, referring to FIGS. 1 and 2, the data preprocessing specifically includes the following steps:
 S21, data cleaning, namely filling the missing value by using the median of the feature corresponding to the missing value, observing and drawing a box diagram of the air quality monitoring data, identifying the feature of the abnormal value and replacing the feature by using the median of the feature corresponding to the abnormal value;
 S22, processing data skewness, carrying out logarithmic transformation on the characteristics with the skewness, and adjusting the skewed characteristics into average neighbor values;
 Step S23, performing correlation analysis on the data, evaluating the degree of correlation between the data and the air quality index, and taking the data highly correlated with the air quality index as an input characteristic of the model according to the result of the correlation analysis;
 step S24, data standardization, unifying units and ranges of numerical data in air quality monitoring data, meteorological data, emission source data, geographic position data and time data;
 step S25, setting a label and setting an air quality index as label data.
Fourth embodiment, referring to fig. 1 and 3, the method for creating a quantitative assessment model of air quality index contribution rate specifically includes the following steps:
 s31, designing a model overall architecture, wherein the model comprises an input layer for receiving input characteristic data, a self-attention layer for capturing the dependency relationship between the characteristics, a hidden layer with M sub-layers, introducing residual connection, an output layer for predicting an air quality index, and a contribution rate calculation layer for evaluating the air quality index contribution rate;
 Step S32, designing an input layer, and receiving characteristic data of quantitative evaluation of the air quality index contribution rate;
 Step S33, designing a self-attention layer, mapping input features to different attention heads, calculating correlation scores between the input features and the attention heads through dot product operation, converting the scores into probability distribution by using a normalized exponential function and using the probability distribution as attention weights, and carrying out weighted summation on the attention weights and the original features to obtain output of the self-attention layer, wherein the output is expressed as follows:
;
 Wherein,Representing the output of the self-attention layer, softmax (·) representing the normalized exponential function, Z being the dimension of the key, Q representing the query matrix, G representing the key matrix, V representing the value matrix, T representing the transposed symbol of the matrix;
 step S34, designing a progressive stable activation function, and introducing a gradient stability coefficient to relieve the gradient disappearance problem, wherein the gradient stability coefficient is expressed as follows:
;
 Wherein,Representing a progressively stabilizing activation function, x representing an input of the progressively stabilizing activation function,Representing the gradient stability coefficient;
 step S35, designing a hidden layer, and introducing residual connection, wherein the residual connection is represented as follows:
;
 wherein i represents the layer number index of the hidden sub-layer,Representing the output of the i-th hidden sub-layer,Representing the output of the i-1 th hidden sub-layer,Representing the weight of the i-th hidden sub-layer,Representing the input of the i-th hidden sub-layer,Representing the bias of the ith hidden sub-layer;
 Step S36, designing an output layer, wherein the design output layer is expressed as follows:
;
 Wherein,Representing the output of the output layer(s),Representing the input of the output layer,AndRespectively representing the weight and bias of the output layer;
 Step S37, designing a contribution rate calculation function, wherein the weight and gradient reflect the influence degree of the feature on the model output, and the contribution rate is represented by calculating the weight and gradient of the feature from the hidden layer to the output layer, and is represented as follows:
;
 Wherein,Represents a contribution rate calculation function, k represents an index of output layer neurons, w is the total number of output layer neurons,Representing the weight of the kth neuron of the output layer,Representing the gradient of the kth neuron of the output layer with respect to the input,Representing modulo symbols;
 step S38, designing a contribution rate calculation layer, wherein the contribution rate calculation layer is expressed as follows:
;
 wherein CR represents the contribution rate,Representing a contribution rate calculation function;
 Step S39, calculating entropy of the contribution rate, wherein the entropy is expressed as follows:
;
 wherein, n represents the index of the feature, D represents the number of features,The contribution rate of the nth feature is represented,Entropy representing the contribution rate of the feature;
 Step S310, designing a loss function, designing a loss term based on the rationality of the characteristic contribution rate distribution, and calculating the difference between the entropy of the characteristic contribution rate and the historical reference entropy value to measure the rationality of the contribution rate, wherein the rationality is expressed as follows:
;
 Wherein,For the weight and bias parameters of the model,Representing the loss function, c representing the index of the samples, U representing the number of samples,Representing the actual air quality index value of the c-th sample,Representing a predicted value of the air quality index for the c-th sample,The entropy weight is represented by a weight of the entropy,Representing a historical reference entropy value;
 step S311, designing a gradient adjustment strategy, which is expressed as follows:
;
 Where j represents the number of model parameter training times,Representing the gradient of the loss function at the jth model parameter training,Representing a gradient threshold;
 step S312, designing adaptive momentum parameters, which are expressed as follows:
;
 Wherein,The momentum parameter in the j-th model parameter training is min (the) which takes the minimum value, max (the) which takes the maximum value,Momentum parameters during the j-1 model parameter training,The step size of the momentum parameter is represented,AndRepresenting the maximum and minimum values of the momentum parameter respectively,Representing the model performance variation, obtained by calculating the accuracy variation value of the model,Representing a momentum parameter adjustment threshold;
 step S313, designing gradient momentum, which is expressed as follows:
;
 Wherein,Represents the gradient momentum at the jth model parameter training,Representing the gradient momentum of the j-1 model parameter training;
 step S314, training model parameters, which is expressed as follows:
;
 Wherein,Represents model parameters at the j-1 th model parameter training,The learning rate at the time of the j-th model parameter training is represented.
By executing the operation, aiming at the problems of low accuracy and generalization capability, low convergence speed of the model, weak characteristic contribution rate evaluation capability and weak model robustness of the traditional air quality index contribution rate quantitative evaluation model, the scheme captures the dependency relationship between the characteristics by introducing a self-attention layer, the accuracy and generalization capability of the model are improved, a progressive stable activation function is designed, residual error connection is introduced into a hidden layer, a contribution rate calculation layer and a loss function aiming at the characteristic contribution rate are designed, the convergence speed of the model is accelerated, the accurate evaluation capability of the model on the characteristic contribution rate is improved, and the robustness of the model is improved.
Embodiment five, referring to fig. 1 and fig. 4, the embodiment is based on the above embodiment, and the contribution ratio quantitative evaluation model tuning specifically includes the following steps:
 Step S41, creating a super-parameter optimization search space, wherein the optimized super-parameters comprise a learning rate, a gradient threshold value, a gradient momentum parameter, an entropy weight and a gradient stability coefficient;
 Step S42, creating an optimization effect evaluation index, and setting the accuracy of the model as the optimization effect evaluation index of the super-parameter individual;
 Step S43, initializing search space, creating an initial search point cluster, setting maximum search iteration times and setting an optimization effect evaluation index threshold;
 step S44, designing an optimized guide function, wherein the optimized guide function is expressed as follows:
;
 Wherein,Representing the optimized boot function,Represents an initial optimization guide factor, rn represents a random number obeying a standard normal distribution, t represents the number of search iterations, and Tmax represents the maximum number of search iterations
Step S45, designing an optimized amplitude function, wherein the optimized amplitude function is expressed as follows:
;
 Wherein,Represents an optimized amplitude function, x (t) represents a position obtained by searching at the time of the t-th parameter searching,The average value of the positions searched by the search point cluster in the t-th search, bu represents the upper bound of the search space, bl represents the lower bound of the search space,Representing a zero removal factor, xbest representing a position where the current optimization effect evaluation index is maximum;
 Step S46, designing a mixed amplitude optimization search function, wherein the mixed amplitude optimization search function is expressed as follows:
;
 Wherein,Representing the position searched during the t+1st parameter search;
 Step S47, super-parameter searching, namely calculating an optimization effect evaluation index for an initial search point cluster to obtain a position with the maximum optimization effect evaluation index, carrying out parameter optimization searching of a mixed amplitude optimization search function for the search point cluster, calculating the optimization effect evaluation index for the searched position, updating the position with the maximum optimization effect evaluation index, increasing the iteration number once, outputting the parameter of the position with the maximum current optimization effect evaluation index if the optimization effect evaluation index of the searched position is larger than the optimization effect evaluation index threshold, stopping searching, carrying out searching initialization if the maximum iteration number is reached, and carrying out searching again, otherwise, continuing searching.
By executing the operation, aiming at the problems of improper super-parameter selection, low model tuning efficiency and poor model performance of the traditional evaluation model, the super-parameter search is carried out by designing the optimized guide function, designing the optimized amplitude function and designing the mixed amplitude optimized search function, so that the super-parameter tuning efficiency and effect are improved, and the model performance is improved.
In a sixth embodiment, referring to fig. 1, the quantitative evaluation of the air quality index contribution rate is based on the above embodiment, where data of an evaluation area is collected, the data is input into a quantitative evaluation model of the air quality index contribution rate, the model predicts the air quality index of the area, and outputs the contribution value of each characteristic factor to the air quality index, so as to understand the influence degree of each characteristic factor on the air quality index, and make corresponding control measures, and continuously update the model according to the model result and feedback data.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made hereto without departing from the spirit and principles of the present invention.
The invention and its embodiments have been described above with no limitation, and the actual construction is not limited to the embodiments of the invention as shown in the drawings. In summary, if one of ordinary skill in the art is informed by this disclosure, a structural manner and an embodiment similar to the technical solution should not be creatively devised without departing from the gist of the present invention.