Quantitative evaluation method of AQI contribution rate based on ML and DM
By introducing a self-attention layer, asymptotically stable activation function, and residual connections, and optimizing the contribution rate calculation layer and loss function, the problems of insufficient accuracy and generalization ability of traditional models are solved, the robustness of the model and the efficiency of hyperparameter tuning are improved, and a more efficient assessment of the air quality index contribution rate is achieved.
Patent Information
- Application Number
- CN202410626271.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-05-20
Smart Images

Figure CN118365212B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of environmental detection technology, and in particular to an AQI contribution rate quantitative evaluation method based on ML and DM. Background Art
[0002] The quantitative evaluation method of AQI contribution rate based on ML and DM uses machine learning algorithms and data mining technology to predict the regional air quality index, evaluate the contribution rate of characteristic factors to the air quality index, and better understand the factors affecting air quality. However, the traditional quantitative evaluation model of air quality index contribution rate has the problems of low accuracy and generalization ability, slow model convergence speed, weak ability to evaluate characteristic contribution rate, and weak model robustness; the traditional evaluation model has the problems of improper hyperparameter selection, low model tuning efficiency, and poor model performance. Summary of the invention
[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides an AQI contribution rate quantitative evaluation method based on ML and DM. The traditional air quality index contribution rate quantitative evaluation model has the problems of low accuracy and generalization ability, slow model convergence speed, weak feature contribution rate evaluation ability, and weak model robustness. This solution introduces a self-attention layer to capture the dependency between features, improves the accuracy and generalization ability of the model, designs a progressively stable activation function, introduces residual connection in the hidden layer, and designs a contribution rate calculation layer and loss function for the feature contribution rate, which accelerates the convergence speed of the model, improves the model's ability to accurately evaluate the feature contribution rate, and improves the robustness of the model; in view of the problems of improper hyperparameter selection, low model tuning efficiency, and poor model performance in the traditional evaluation model, the model searches for hyperparameters by designing an optimized guide function, designing an optimized amplitude function, and designing a mixed amplitude optimization search function to improve the efficiency and effect of hyperparameter tuning. This solution searches for hyperparameters by designing an optimized guide function, designing an optimized amplitude function, and designing a mixed amplitude optimization search function, thereby improving the efficiency and effect of hyperparameter tuning and improving model performance.
[0004] The technical solution adopted by the present invention is as follows: The present invention provides a quantitative evaluation method of AQI contribution rate based on ML and DM, and the method comprises the following steps:
[0005] Step S1: data collection;
[0006] Step S2: data preprocessing;
[0007] Step S3: Creating a quantitative assessment model for air quality index contribution rate;
[0008] Step S4: Tuning the contribution rate quantitative evaluation model;
[0009] Step S5: quantitative evaluation of air quality index contribution rate.
[0010] Furthermore, in step S1, the data collection is to collect air quality monitoring data, meteorological data, emission source data, geographic location data, time data and air quality index; 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 the number of factories, vehicle flow, frequency of fertilizer use and frequency of incineration activities; the geographic location data includes land use type, geographic location and population density; the time data includes seasonal data, holiday data and special activity data.
[0011] Furthermore, in step S2, the data preprocessing specifically includes the following steps:
[0012] Step S21: Data cleaning, using the median of the features corresponding to the missing values to fill the missing values, observing and drawing the box plot of the air quality monitoring data, identifying the features of the outliers and replacing them with the median of the features corresponding to the outliers;
[0013] Step S22: Processing data skewness, performing logarithmic transformation on features with skewness, and adjusting skewed features to their mean neighbor values;
[0014] Step S23: Correlation analysis: performing correlation analysis on the data to evaluate the correlation between the data and the air quality index. According to the results of the correlation analysis, data highly correlated with the air quality index are used as input features of the model.
[0015] Step S24: data normalization, unifying the units and ranges of numerical data in air quality monitoring data, meteorological data, emission source data, geographic location data, and time data;
[0016] Step S25: Setting a label, and setting the air quality index as label data.
[0017] Furthermore, in step S3, the creation of the air quality index contribution rate quantitative evaluation model specifically includes the following steps:
[0018] Step S31: Design the overall architecture of the model, which includes: an input layer to receive input feature data, a self-attention layer to capture the dependency between features, a hidden layer with M sub-layers, and introduces residual connections, an output layer to predict the air quality index, and a contribution rate calculation layer to evaluate the contribution rate of the air quality index;
[0019] Step S32: designing an input layer to receive characteristic data for quantitative evaluation of air quality index contribution rate;
[0020] Step S33: Design a self-attention layer to map the input features to different attention heads, calculate the correlation score between the input features and the attention heads through a dot product operation, and use a normalized exponential function to convert the score into a probability distribution as the attention weight. Perform a weighted summation of the attention weight and the original feature to obtain the output of the self-attention layer, which is expressed as follows:
[0021] ;
[0022] in, represents the output of the self-attention layer, softmax(·) represents the normalized exponential function, Z is the dimension of the key, Q represents the query matrix, G represents the key matrix, V represents the value matrix, and T represents the transpose sign of the matrix;
[0023] Step S34: Design a progressively stable activation function and introduce a gradient stabilization coefficient to alleviate the gradient vanishing problem, as shown below:
[0024] ;
[0025] in, represents the asymptotically stable activation function, x represents the input of the asymptotically stable activation function, represents the gradient stability coefficient;
[0026] Step S35: Design the hidden layer and introduce residual connection, which is expressed as follows:
[0027] ;
[0028] Among them, i represents the layer index of the hidden sublayer, represents the output of the i-th hidden sublayer, represents the output of the i-1th hidden sublayer, represents the weight of the i-th hidden sublayer, represents the input of the i-th hidden sublayer, represents the bias of the i-th hidden sublayer;
[0029] Step S36: Design the output layer, which is expressed as follows:
[0030] ;
[0031] in, represents the output of the output layer, represents the input of the output layer, and Represent the weight and bias of the output layer respectively;
[0032] Step S37: Design a contribution rate calculation function. The weight and gradient reflect the influence of the feature on the model output. The contribution rate is expressed by calculating the weight and gradient of the feature between the hidden layer and the output layer, as shown below:
[0033] ;
[0034] in, represents the contribution rate calculation function, k represents the index of the output layer neuron, w is the total number of output layer neurons, represents the weight of the kth neuron in the output layer, represents the gradient of the kth neuron in the output layer for the input, Represents the modulo symbol;
[0035] Step S38: Design contribution rate calculation layer, expressed as follows:
[0036] ;
[0037] Among them, CR represents the contribution rate, Represents the contribution rate calculation function;
[0038] Step S39: Calculate the entropy of the contribution rate, expressed as follows:
[0039] ;
[0040] Among them, n represents the index of the feature, D represents the number of features, represents the contribution rate of the nth feature, Entropy representing the contribution rate of features;
[0041] Step S310: Design a loss function, design a loss term based on the rationality of the feature contribution rate distribution, calculate the difference between the entropy of the feature contribution rate and the historical reference entropy value to measure the rationality of the contribution rate, which is expressed as follows:
[0042] ;
[0043] in, are the weight and bias parameters of the model, represents the loss function, c represents the index of the sample, U represents the number of samples, represents the actual value of the air quality index of the cth sample, represents the predicted value of the air quality index for the cth sample, represents the entropy weight, Represents the historical reference entropy value;
[0044] Step S311: Design a gradient adjustment strategy, as shown below:
[0045] ;
[0046] Among them, j represents the number of times the model parameters are trained, represents the gradient of the loss function during the j-th model parameter training, represents the gradient threshold;
[0047] Step S312: Designing adaptive momentum parameters, expressed as follows:
[0048] ;
[0049] in, Momentum parameter for the j-th model parameter training, min(·) means taking the minimum value, max(·) means taking the maximum value, The momentum parameter during the j-1th model parameter training, represents the momentum parameter step size, and represent the maximum and minimum values of the momentum parameter, respectively. Represents the change in model performance, which is obtained by calculating the change in model accuracy. represents the momentum parameter adjustment threshold;
[0050] Step S313: Design the gradient momentum, which is expressed as follows:
[0051] ;
[0052] in, represents the gradient momentum during the j-th model parameter training, Represents the gradient momentum during the j-1th model parameter training;
[0053] Step S314: Model parameter training, as shown below:
[0054] ;
[0055] in, represents the model parameters during the j-1th model parameter training, Represents the learning rate during the j-th model parameter training.
[0056] Furthermore, in step S4, the contribution rate quantitative evaluation model tuning specifically includes the following steps:
[0057] Step S41: creating a hyperparameter optimization search space, where the optimized hyperparameters include learning rate, gradient threshold, gradient momentum parameter, entropy weight and gradient stationary coefficient;
[0058] Step S42: Create an optimization effect evaluation index, and set the accuracy of the model as the optimization effect evaluation index of the hyperparameter individual;
[0059] Step S43: search initialization, initializing the search space, creating an initial search point cluster, setting the maximum number of search iterations, and setting the optimization effect evaluation index threshold;
[0060] Step S44: Design an optimized guiding function, which is expressed as follows:
[0061] ;
[0062] in, represents the optimized guidance function, represents the initial optimization guiding factor, Rn represents a random number that follows a standard normal distribution, t represents the number of search iterations, and Tmax represents the maximum number of search iterations.
[0063] Step S45: Design an optimized amplitude function, which is expressed as follows:
[0064] ;
[0065] in, represents the optimization amplitude function, x(t) represents the position obtained during the tth parameter search, 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, and Bl represents the lower bound of the search space. represents the zero removal factor, and Xbest represents the position where the current optimization effect evaluation index is the largest;
[0066] Step S46: Design a hybrid amplitude optimization search function, which is expressed as follows:
[0067] ;
[0068] in, Indicates the position searched during the t+1th parameter search;
[0069] Step S47: Hyperparameter search, calculate the optimization effect evaluation index for the initial search point cluster, obtain the position with the largest optimization effect evaluation index, perform parameter optimization search of the mixed amplitude optimization search function on the search point cluster, calculate the optimization effect evaluation index for the searched position, update the position with the largest optimization effect evaluation index, increase the number of iterations by one, if the optimization effect evaluation index of the searched position is greater than the optimization effect evaluation index threshold, output the parameters of the position with the largest current optimization effect evaluation index and stop the search; if the maximum number of iterations is reached, the search is initialized and the search is performed again; otherwise, the search is continued.
[0070] Furthermore, in step S5, the quantitative assessment of the contribution rate of the air quality index is to collect data of the assessment area, input the data into a quantitative assessment model of the contribution rate of the air quality index, and 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 degree of influence of each characteristic factor on the air quality index and formulate corresponding control measures; and continuously update the model according to the model results and feedback data.
[0071] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0072] (1) Aiming at the problems of low accuracy and generalization ability, slow model convergence speed, weak feature contribution rate assessment ability and weak model robustness in the traditional air quality index contribution rate quantitative assessment model, this scheme introduces a self-attention layer to capture the dependency between features, improves the accuracy and generalization ability of the model, designs a progressively stable activation function, introduces residual connection in the hidden layer, designs a contribution rate calculation layer and loss function for the feature contribution rate, accelerates the convergence speed of the model, improves the model's ability to accurately assess the feature contribution rate, and improves the robustness of the model.
[0073] (2) In order to address the problems of improper hyperparameter selection, low model tuning efficiency, and poor model performance in traditional evaluation models, this solution conducts hyperparameter search by designing optimization guidance functions, optimization amplitude functions, and mixed amplitude optimization search functions, thereby improving the efficiency and effectiveness of hyperparameter tuning and enhancing model performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 A flowchart of the AQI contribution rate quantitative evaluation method based on ML and DM provided by the present invention;
[0075] Figure 2 is a schematic flow chart of step S2;
[0076] Figure 3 is a schematic flow chart of step S3;
[0077] Figure 4 It is a schematic diagram of the process of step S4.
[0078] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0079] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0080] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0081] Example 1, see Figure 1 The present invention provides a quantitative evaluation method for AQI contribution rate based on ML and DM, the method comprising the following steps:
[0082] Step S1: Data collection, collecting air quality monitoring data, meteorological data, emission source data, geographic location data, time data and air quality index;
[0083] Step S2: Data preprocessing, data cleaning, data skewness processing, correlation analysis, data normalization and labeling of the collected data;
[0084] Step S3: Create an air quality index contribution rate quantitative evaluation model, and create and train the air quality index contribution rate quantitative evaluation model by designing the overall model architecture, designing the self-attention layer, designing the progressively stable activation function, designing the contribution rate calculation layer, designing the loss function, designing the gradient adjustment strategy, designing the adaptive momentum parameter, and designing the gradient momentum;
[0085] Step S4: Tuning the contribution rate quantitative evaluation model, tuning the model parameters by designing an optimization guide function, designing an optimization amplitude function, and designing a mixed amplitude optimization search function;
[0086] Step S5: quantitative assessment of air quality index contribution rate. The data of the assessment area is input into the quantitative assessment model of 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.
[0087] Example 2, see Figure 1This embodiment is based on the above embodiment, and the data collection collects air quality monitoring data, meteorological data, emission source data, geographic location data, time data and air quality index; 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 the number of factories, vehicle flow, frequency of fertilizer use and frequency of incineration activities; the geographic location data includes land use type, geographic location and population density; the time data includes seasonal data, holiday data and special activity data.
[0088] Example 3, see Figure 1 and Figure 2 This embodiment is based on the above embodiment, and the data preprocessing specifically includes the following steps:
[0089] Step S21: Data cleaning, using the median of the features corresponding to the missing values to fill the missing values, observing and drawing the box plot of the air quality monitoring data, identifying the features of the outliers and replacing them with the median of the features corresponding to the outliers;
[0090] Step S22: Processing data skewness, performing logarithmic transformation on features with skewness, and adjusting skewed features to their mean neighbor values;
[0091] Step S23: Correlation analysis: performing correlation analysis on the data to evaluate the correlation between the data and the air quality index. According to the results of the correlation analysis, data highly correlated with the air quality index are used as input features of the model.
[0092] Step S24: data normalization, unifying the units and ranges of numerical data in air quality monitoring data, meteorological data, emission source data, geographic location data, and time data;
[0093] Step S25: Setting a label, and setting the air quality index as label data.
[0094] Example 4, see Figure 1 and Figure 3 This embodiment is based on the above embodiment, and the creation of the air quality index contribution rate quantitative evaluation model specifically includes the following steps:
[0095] Step S31: Design the overall architecture of the model, which includes: an input layer to receive input feature data, a self-attention layer to capture the dependency between features, a hidden layer with M sub-layers, and introduces residual connections, an output layer to predict the air quality index, and a contribution rate calculation layer to evaluate the contribution rate of the air quality index;
[0096] Step S32: designing an input layer to receive characteristic data for quantitative evaluation of air quality index contribution rate;
[0097] Step S33: Design a self-attention layer to map the input features to different attention heads, calculate the correlation score between the input features and the attention heads through a dot product operation, and use a normalized exponential function to convert the score into a probability distribution as the attention weight. Perform a weighted summation of the attention weight and the original feature to obtain the output of the self-attention layer, which is expressed as follows:
[0098] ;
[0099] in, represents the output of the self-attention layer, softmax(·) represents the normalized exponential function, Z is the dimension of the key, Q represents the query matrix, G represents the key matrix, V represents the value matrix, and T represents the transpose sign of the matrix;
[0100] Step S34: Design a progressively stable activation function and introduce a gradient stabilization coefficient to alleviate the gradient vanishing problem, as shown below:
[0101] ;
[0102] in, represents the asymptotically stable activation function, x represents the input of the asymptotically stable activation function, represents the gradient stability coefficient;
[0103] Step S35: Design the hidden layer and introduce residual connection, which is expressed as follows:
[0104] ;
[0105] Among them, i represents the layer index of the hidden sublayer, represents the output of the i-th hidden sublayer, represents the output of the i-1th hidden sublayer, represents the weight of the i-th hidden sublayer, represents the input of the i-th hidden sublayer, represents the bias of the i-th hidden sublayer;
[0106] Step S36: Design the output layer, which is expressed as follows:
[0107] ;
[0108] in, represents the output of the output layer, represents the input of the output layer, and Represent the weight and bias of the output layer respectively;
[0109] Step S37: Design a contribution rate calculation function. The weight and gradient reflect the influence of the feature on the model output. The contribution rate is expressed by calculating the weight and gradient of the feature between the hidden layer and the output layer, as shown below:
[0110] ;
[0111] in, represents the contribution rate calculation function, k represents the index of the output layer neuron, w is the total number of output layer neurons, represents the weight of the kth neuron in the output layer, represents the gradient of the kth neuron in the output layer for the input, Represents the modulo symbol;
[0112] Step S38: Design contribution rate calculation layer, expressed as follows:
[0113] ;
[0114] Among them, CR represents the contribution rate, Represents the contribution rate calculation function;
[0115] Step S39: Calculate the entropy of the contribution rate, expressed as follows:
[0116] ;
[0117] Among them, n represents the index of the feature, D represents the number of features, represents the contribution rate of the nth feature, Entropy representing the contribution rate of features;
[0118] Step S310: Design a loss function, design a loss term based on the rationality of the feature contribution rate distribution, calculate the difference between the entropy of the feature contribution rate and the historical reference entropy value to measure the rationality of the contribution rate, which is expressed as follows:
[0119] ;
[0120] in, are the weight and bias parameters of the model, represents the loss function, c represents the index of the sample, U represents the number of samples, represents the actual value of the air quality index of the cth sample, represents the predicted value of the air quality index for the cth sample, represents the entropy weight, Represents the historical reference entropy value;
[0121] Step S311: Design a gradient adjustment strategy, as shown below:
[0122] ;
[0123] Among them, j represents the number of times the model parameters are trained, represents the gradient of the loss function during the j-th model parameter training, represents the gradient threshold;
[0124] Step S312: Designing adaptive momentum parameters, expressed as follows:
[0125] ;
[0126] in, Momentum parameter for the j-th model parameter training, min(·) means taking the minimum value, max(·) means taking the maximum value, The momentum parameter during the j-1th model parameter training, represents the momentum parameter step size, and represent the maximum and minimum values of the momentum parameter, respectively. Represents the change in model performance, which is obtained by calculating the change in model accuracy. represents the momentum parameter adjustment threshold;
[0127] Step S313: Design the gradient momentum, which is expressed as follows:
[0128] ;
[0129] in, represents the gradient momentum during the j-th model parameter training, Represents the gradient momentum during the j-1th model parameter training;
[0130] Step S314: Model parameter training, as shown below:
[0131] ;
[0132] in, represents the model parameters during the j-1th model parameter training, Represents the learning rate during the j-th model parameter training.
[0133] By performing the above operations, the traditional air quality index contribution rate quantitative evaluation model has the problems of low accuracy and generalization ability, slow model convergence speed, weak feature contribution rate evaluation ability, and weak model robustness. This scheme introduces a self-attention layer to capture the dependency between features, improves the accuracy and generalization ability of the model, designs an asymptotically stable activation function, introduces residual connection to the hidden layer, designs a contribution rate calculation layer and loss function for the feature contribution rate, accelerates the convergence speed of the model, improves the model's ability to accurately evaluate the feature contribution rate, and improves the robustness of the model.
[0134] Example 5, see Figure 1 and Figure 4 This embodiment is based on the above embodiment, and the contribution rate quantitative evaluation model tuning specifically includes the following steps:
[0135] Step S41: creating a hyperparameter optimization search space, where the optimized hyperparameters include learning rate, gradient threshold, gradient momentum parameter, entropy weight and gradient stationary coefficient;
[0136] Step S42: Create an optimization effect evaluation index, and set the accuracy of the model as the optimization effect evaluation index of the hyperparameter individual;
[0137] Step S43: search initialization, initializing the search space, creating an initial search point cluster, setting the maximum number of search iterations, and setting the optimization effect evaluation index threshold;
[0138] Step S44: Design an optimized guiding function, which is expressed as follows:
[0139] ;
[0140] in, represents the optimized guidance function, represents the initial optimization guiding factor, Rn represents a random number that follows a standard normal distribution, t represents the number of search iterations, and Tmax represents the maximum number of search iterations.
[0141] Step S45: Design an optimized amplitude function, which is expressed as follows:
[0142] ;
[0143] in, represents the optimization amplitude function, x(t) represents the position obtained during the tth parameter search, 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, and Bl represents the lower bound of the search space. represents the zero removal factor, and Xbest represents the position where the current optimization effect evaluation index is the largest;
[0144] Step S46: Design a hybrid amplitude optimization search function, which is expressed as follows:
[0145] ;
[0146] in, Indicates the position searched during the t+1th parameter search;
[0147] Step S47: Hyperparameter search, calculate the optimization effect evaluation index for the initial search point cluster, obtain the position with the largest optimization effect evaluation index, perform parameter optimization search of the mixed amplitude optimization search function on the search point cluster, calculate the optimization effect evaluation index for the searched position, update the position with the largest optimization effect evaluation index, increase the number of iterations by one, if the optimization effect evaluation index of the searched position is greater than the optimization effect evaluation index threshold, output the parameters of the position with the largest current optimization effect evaluation index and stop the search; if the maximum number of iterations is reached, the search is initialized and the search is performed again; otherwise, the search is continued.
[0148] By performing the above operations, in order to address the problems of improper hyperparameter selection, low model tuning efficiency, and poor model performance in traditional evaluation models, this solution designs optimization guidance functions, optimization amplitude functions, and mixed amplitude optimization search functions to perform hyperparameter search, thereby improving the efficiency and effect of hyperparameter tuning and enhancing model performance.
[0149] Example 6, see Figure 1 This embodiment is based on the above embodiment. The quantitative assessment of the contribution rate of the air quality index collects data from the assessment area and inputs the data into a quantitative assessment model of the contribution rate of the air quality index. 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 degree of influence of each characteristic factor on the air quality index and formulate corresponding control measures; and the model is continuously updated according to the model results and feedback data.
[0150] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0151] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.
[0152] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. A quantitative evaluation method of AQI contribution rate based on ML and DM, characterized by: The method comprises the following steps: Step S1: Data collection, collecting air quality monitoring data, meteorological data, emission source data, geographic location data, time data and air quality index; 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 the number of factories, vehicle flow, frequency of fertilizer use and frequency of incineration activities; the geographic location data includes land use type, geographic location and population density; the time data includes seasonal data, holiday data and special activity data; Step S2: Data preprocessing, data cleaning, data skewness processing, correlation analysis, data normalization and labeling of the collected data; Step S3: Create an air quality index contribution rate quantitative evaluation model, and create and train the air quality index contribution rate quantitative evaluation model by designing the overall model architecture, designing the self-attention layer, designing the progressively stable activation function, designing the contribution rate calculation layer, designing the loss function, designing the gradient adjustment strategy, designing the adaptive momentum parameter, and designing the gradient momentum; Step S4: Tuning the contribution rate quantitative evaluation model, tuning the model parameters by designing an optimization guide function, designing an optimization amplitude function, and designing a mixed amplitude optimization search function; Step S5: quantitative assessment of air quality index contribution rate, collecting air quality monitoring data, meteorological data, emission source data, geographic location data and time data of the assessment area, inputting the data into the air quality index contribution rate quantitative assessment model, 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 of each characteristic factor on the air quality index; In step S2, the data preprocessing specifically includes the following steps: Step S21: Data cleaning, using the median of the features corresponding to the missing values to fill the missing values, observing and drawing the box plot of the air quality monitoring data, identifying the features of the outliers and replacing them with the median of the features corresponding to the outliers; Step S22: Processing data skewness, performing logarithmic transformation on features, and adjusting skewed features to their mean neighbor values; Step S23: Correlation analysis: performing correlation analysis on the data to evaluate the correlation between the data and the air quality index. According to the results of the correlation analysis, data highly correlated with the air quality index are used as input features of the model. Step S24: data normalization, unifying the units and ranges of numerical data in air quality monitoring data, meteorological data, emission source data, geographic location data, and time data; Step S25: Setting a label, setting the air quality index as label data; In step S3, the creation of the air quality index contribution rate quantitative assessment model specifically includes the following steps: Step S31: Design the overall architecture of the model, which includes: an input layer to receive input feature data, a self-attention layer to capture the dependency between features, a hidden layer with M sub-layers, and introduces residual connections, an output layer to predict the air quality index, and a contribution rate calculation layer to evaluate the contribution rate of the air quality index; Step S32: designing an input layer to receive characteristic data for quantitative evaluation of air quality index contribution rate; Step S33: Design a self-attention layer to map the input features to different attention heads, calculate the correlation score between the input features and the attention heads through a dot product operation, and use a normalized exponential function to convert the score into a probability distribution as the attention weight. Perform a weighted summation of the attention weight and the original feature to obtain the output of the self-attention layer, which is expressed as follows: ; in, represents the output of the self-attention layer, softmax(·) represents the normalized exponential function, Z is the dimension of the key, Q represents the query matrix, G represents the key matrix, V represents the value matrix, and T represents the transpose sign of the matrix; Step S34: Design a progressively stable activation function and introduce a gradient stabilization coefficient to alleviate the gradient vanishing problem, as shown below: ; in, represents the asymptotically stable activation function, x represents the input of the asymptotically stable activation function, represents the gradient stability coefficient; Step S35: Design the hidden layer and introduce residual connection, which is expressed as follows: ; Among them, i represents the layer index of the hidden sublayer, represents the output of the i-th hidden sublayer, represents the output of the i-1th hidden sublayer, represents the weight of the i-th hidden sublayer, represents the input of the i-th hidden sublayer, represents the bias of the i-th hidden sublayer; Step S36: Design the output layer, which is expressed as follows: ; in, represents the output of the output layer, represents the input of the output layer, and Represent the weight and bias of the output layer respectively; Step S37: Design a contribution rate calculation function. The weight and gradient reflect the influence of the feature on the model output. The contribution rate is expressed by calculating the weight and gradient of the feature between the hidden layer and the output layer, as shown below: ; in, represents the contribution rate calculation function, k represents the index of the output layer neuron, w is the total number of output layer neurons, represents the weight of the kth neuron in the output layer, represents the gradient of the kth neuron in the output layer for the input, Represents the modulo symbol; Step S38: Design contribution rate calculation layer, expressed as follows: ; Among them, CR represents the contribution rate, represents the contribution rate calculation function; Step S39: Calculate the entropy of the contribution rate, expressed as follows: ; Among them, n represents the index of the feature, D represents the number of features, represents the contribution rate of the nth feature, Entropy representing the contribution rate of features; Step S310: Design a loss function, design a loss term based on the rationality of the feature contribution rate distribution, calculate the difference between the entropy of the feature contribution rate and the historical reference entropy value to measure the rationality of the contribution rate, which is expressed as follows: ; in, are the weight and bias parameters of the model, represents the loss function, c represents the index of the sample, U represents the number of samples, represents the actual value of the air quality index of the cth sample, represents the predicted value of the air quality index for the cth sample, represents the entropy weight, Represents the historical reference entropy value; Step S311: Design a gradient adjustment strategy, as shown below: ; Among them, j represents the number of times the model parameters are trained, represents the gradient of the loss function during the j-th model parameter training, represents the gradient threshold; Step S312: Designing adaptive momentum parameters, expressed as follows: ; in, Momentum parameter for the j-th model parameter training, min(·) means taking the minimum value, max(·) means taking the maximum value, The momentum parameter during the j-1th model parameter training, represents the momentum parameter step size, and represent the maximum and minimum values of the momentum parameter, respectively. Represents the change in model performance, which is obtained by calculating the change in model accuracy. represents the momentum parameter adjustment threshold; Step S313: Design the gradient momentum, which is expressed as follows: ; in, represents the gradient momentum during the j-th model parameter training, Represents the gradient momentum during the j-1th model parameter training; Step S314: Model parameter training, as shown below: ; in, represents the model parameters during the j-1th model parameter training, Represents the learning rate during the j-th model parameter training.
2. The AQI contribution rate quantitative evaluation method based on ML and DM according to claim 1, characterized in that: In step S4, the contribution rate quantitative evaluation model tuning specifically includes the following steps: Step S41: creating a hyperparameter optimization search space, where the optimized hyperparameters include learning rate, gradient threshold, gradient momentum parameter, entropy weight and gradient stationary coefficient; Step S42: Create an optimization effect evaluation index, and set the accuracy of the model as the optimization effect evaluation index of the hyperparameter individual; Step S43: search initialization, initializing the search space, creating an initial search point cluster, setting the maximum number of search iterations, and setting the optimization effect evaluation index threshold; Step S44: Design an optimized guiding function, which is expressed as follows: ; in, represents the optimized guidance function, represents the initial optimization guiding factor, Rn represents a random number that follows a standard normal distribution, t represents the number of search iterations, and Tmax represents the maximum number of search iterations. Step S45: Design an optimized amplitude function, which is expressed as follows: ; in, represents the optimization amplitude function, x(t) represents the position obtained during the tth parameter search, 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, and Bl represents the lower bound of the search space. represents the zero removal factor, and Xbest represents the position where the current optimization effect evaluation index is the largest; Step S46: Design a hybrid amplitude optimization search function, which is expressed as follows: ; in, Indicates the position searched during the t+1th parameter search; Step S47: Hyperparameter search, calculate the optimization effect evaluation index for the initial search point cluster, obtain the position with the largest optimization effect evaluation index, perform parameter optimization search of the mixed amplitude optimization search function on the search point cluster, calculate the optimization effect evaluation index for the searched position, update the position with the largest optimization effect evaluation index, increase the number of iterations by one, if the optimization effect evaluation index of the searched position is greater than the optimization effect evaluation index threshold, output the parameters of the position with the largest current optimization effect evaluation index and stop the search; if the maximum number of iterations is reached, the search is initialized and the search is performed again; otherwise, the search is continued.
Citation Information
Patent Citations
Method and system for evaluating grid-connected transient voltage stability of doubly-fed fan
CN117748516A
Method for predicting air quality index (AQI) based on a fusion model
US11816556B1