Data classification method applied to government affair platform
By using adversarial generation network model in government data classification to expand data samples, combined with chaotic feedback mechanism, dynamic routing strategy and quantum state feature reweighting strategy, the stability and accuracy problems in government data classification are solved, and efficient and accurate data classification effects are achieved.
Patent Information
- Application Number
- CN202411418850.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-25
AI Technical Summary
The existing technology cannot efficiently and accurately realize the data classification of government information, and there are problems such as gradient disappearance, gradient explosion, and local optimal solutions. In addition, information is seriously lost during the feature dimensionality reduction process, and the classification accuracy is low.
The adversarial generation network model is used to expand government data samples, train feature extraction models, feature dimensionality reduction models and classifier models, optimize the learning rate through the chaotic feedback mechanism, dynamically adjust the number of hidden layer nodes in the neural network, and combine dynamic routing strategies and quantum state feature reweighting strategies to improve the generalization ability and classification accuracy of the model.
It improves the accuracy of the model when processing sparse samples, reduces the occurrence of gradient problems and local optimal problems, prevents overfitting, improves data reconstruction capabilities and classification accuracy, and is suitable for complex scenarios of government data.
Smart Images

Figure CN119513735A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data classification, and in particular to a data classification method applied to a government affairs platform. Background Art
[0002] With the rapid development of government information technology, various government systems such as tax management systems, social security management systems, and public security data platforms have gradually realized the digitization and electronicization of data. These systems generate a large amount of data every day, with a wide variety of data, including time, geographic location, business type, operator information, etc. These government data contain rich business process and social governance information, which is of great significance to government decision-making, process optimization, and improvement of public service quality.
[0003] However, the complexity, heterogeneity and incompleteness of government data have brought many challenges to data mining. For example, in terms of feature extraction, traditional neural network models are prone to gradient vanishing, gradient exploding and falling into local optimal solutions, resulting in unstable training and insufficient model performance; in the process of feature dimensionality reduction, traditional autoencoders suffer from information loss when processing large-scale data, and cannot effectively retain the feature structure of the original data, affecting the accuracy of subsequent data processing; the existing support vector machine algorithm has low classification accuracy when processing nonlinearly separable data, and cannot dynamically adjust the weight of the features, resulting in limited accuracy of the classification results.
[0004] Therefore, the existing technology is still unable to efficiently and accurately achieve data classification of government information. Summary of the invention
[0005] In view of the above analysis, an embodiment of the present invention aims to provide a data classification method applied to a government affairs platform, so as to solve the problem that the existing data classification of government affairs information cannot be realized efficiently and accurately.
[0006] The embodiment of the present invention provides a classification method applied to government affairs system platform data, including:
[0007] Acquire the stored data in the government affairs system platform; perform data preprocessing on the stored data, and perform data labeling on the preprocessed data, and use the labeled data as target data; expand the target data based on the adversarial generative network model to obtain a first training sample set; train a feature extraction model based on the first training sample set to obtain a target feature extraction model; input the samples in the first training sample set into the target feature extraction model to obtain a target feature vector corresponding to each sample, and the target feature vector and the corresponding labeling form a second training sample set; train a feature dimension reduction model based on the second training sample set to obtain a target feature dimension reduction model; input the samples in the second training sample set into the target feature dimension reduction model to obtain a target feature dimension reduction vector corresponding to each sample, and the target feature dimension reduction vector and the corresponding labeling form a third training sample set; train a classifier model based on the third training sample set to obtain a target classifier model; acquire government affairs data to be classified, input the government affairs data to be classified into the target feature extraction model to obtain a target feature vector, input the target feature vector into the target feature dimension reduction model to obtain a target feature dimension reduction vector, and input the target feature dimension reduction vector into the target classifier model to obtain a category corresponding to the government affairs data to be classified.
[0008] Based on the further improvement of the above method, the feature extraction model is a neural network model, the feature dimensionality reduction model is an autoencoder model, and the classifier model is a support vector machine model.
[0009] Based on the further improvement of the above method, the weight update method of the neural network model is:
[0010]
[0011] Among them, W p,t is the weight of the neural network at the tth iteration, W p,t-1 is the weight of the neural network at the t-1th iteration, E p is the error of the neural network, η p,t is the learning rate of the neural network at the tth iteration, is the symbol of partial derivative, η p,t-1 is the learning rate of the neural network at the t-1th iteration, γ p is the adjustment factor of the neural network, ΔE p,t-1 is the error change at the t-1th iteration.
[0012] Based on the further improvement of the above method, the number of nodes in the hidden layer of the neural network is:
[0013] N p,t =N p,t-1 +sgn(ΔE p,t-1 )*β p ,
[0014] Among them, N p,t is the number of nodes in the hidden layer of the neural network at the pth layer and the tth iteration; N p,t-1 is the number of nodes in the hidden layer of the neural network at the pth layer and the t-1th iteration, β p is the node adjustment step size of the hidden layer of the neural network, and sgn() is the sign function of the error change
[0015] The node adjustment step size β of the hidden layer of the neural network p The calculation method is:
[0016]
[0017] Among them, Int cs () is the rounding operation, α p is the influence coefficient of adjusting the adjustment step size, d p is the number of layers of the neural network.
[0018] Based on the further improvement of the above method, each layer of the encoder in the autoencoder model makes dynamic routing decisions based on the output results of the previous layer and the feature importance score of the current layer to pass the most informative features, specifically:
[0019] Z r,h =W r,h *x r,h-1 +b r,h ,
[0020] A r,h =R(Z r,h ),
[0021] x r,h =route(A r,h , imp(A r,h )),
[0022] Among them, Z r,h is the linear transformation output of the hth layer of the autoencoder, A r,h is the output feature of the activation function of the autoencoder, W r,h is the weight of the hth layer of the autoencoder, b r,h is the bias of the hth layer of the autoencoder, R() is the ReLU activation function, x r,h-1 is the output feature of the h-1th layer of the autoencoder, x r,h is the output feature of the hth layer of the autoencoder, route() is the dynamic routing function, imp(A r,h ) is the importance scoring function;
[0023] The weight and bias of the autoencoder are updated as follows:
[0024]
[0025] Where, ΔW r,h is the update increment of the weight of the hth layer of the autoencoder, Δb r,h is the update increment of the bias of the hth layer of the autoencoder, is the weight of the hth layer of the updated autoencoder, is the bias of the hth layer of the updated autoencoder, S r,h is the sparsity measure of the h-th layer of neurons in the autoencoder, λ r,h is the sparsity pruning threshold, and τ() is the indicator function.
[0026] Based on the further improvement of the above method, the dynamic routing function is specifically:
[0027]
[0028] The importance scoring function is specifically:
[0029]
[0030] Among them, A r,h,j is the activation output of the jth neuron in the hth layer, A r,h,k is the activation output of the kth neuron in the hth layer, W r,imp,j is the weight of the jth neuron, W r,imp,k is the weight of the kth neuron, n r,h is the total number of neurons in the hth layer.
[0031] Based on the further improvement of the above method, the sparsity metric is calculated as follows:
[0032]
[0033] Among them, S r,h is the sparsity measure of the h-th layer of neurons, a r,h,j is the activation value of the jth sample in the i-th layer, υ r is the sparsity threshold, m r The number of samples input in the current training process.
[0034] Based on the further improvement of the above method, the loss function of the classifier model is:
[0035]
[0036] Among them, L u () is the loss function of the support vector machine, W u is the weight, b uis the bias, C is the regularization parameter, m u is the number of training samples, y (u,l) is the label of sample 1, || || 2 represents the L2 norm, ψ u () is the quantum state characteristic reweighting function, which is calculated as follows:
[0037]
[0038] Among them, λ u,k is the kth feature reweighting coefficient dynamically adjusted by the quantum optimization algorithm, X u,k represents the kth eigenvalue of the government data feature after feature dimensionality reduction, φ u () is the quantum characteristic mapping function, which is calculated as follows:
[0039]
[0040] Among them, ω u,j Represents feature X u,j The quantum mapping frequency, X u is the target feature dimension reduction vector, n u is the number of features, i * is the imaginary unit, X u,j Represents the j-th eigenvalue of the government data feature after feature dimensionality reduction.
[0041] Based on the further improvement of the above method, the weight update method of the support vector machine model is expressed as:
[0042]
[0043] Among them, α u,l is the Lagrange multiplier, η u is the learning rate of the support vector machine, ΔW u is the update increment of the support vector machine, is the weight of the support vector machine before updating, is the updated support vector machine weight.
[0044] Based on the further improvement of the above method, the target data includes multiple different types of parameters, and the annotations include normal data, abnormal data, and delayed data;
[0045] The step of expanding the target data based on the generative adversarial network model to obtain a first training sample set includes:
[0046] A certain amount of target data is obtained, and any type of parameter data in the target data is set to empty to generate incomplete target data, and the incomplete target data is input into a generative adversarial network to obtain generated target data corresponding to the incomplete target data, wherein the generated target data is an expanded sample set, and the target data and the expanded sample set are used as the first training sample set.
[0047] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0048] 1. The present invention provides a data classification method applied to a government affairs platform. The government affairs data samples acquired by the generative adversarial network model are expanded so that the generated data samples are highly similar to the real data, thereby ensuring the diversity of training data and the generalization ability of the model, and improving the accuracy of the model when processing scarce samples.
[0049] 2. The present invention provides a data classification method applied to a government affairs platform. In the feature extraction model training process, the learning rate of weight update is optimized based on the chaotic feedback mechanism, and the number of hidden layer nodes of the neural network is dynamically adjusted by the regularization strategy, so as to ensure the generalization ability of the model, reduce the occurrence of gradient problems and local optimal problems, and prevent overfitting; in the feature dimension reduction model training process, the dynamic routing strategy is combined to ensure the accurate transmission of key information in the model training process, and the sparsity of the activation value is used to judge the importance of neurons, and the computational efficiency and generalization ability of the model are improved by dynamically pruning redundant weights, so as to improve the data reconstruction ability, reduce information loss, and enable the reduced-dimensional data to better express the original data characteristics; in the classification model training process, the influence weight of each quantum state is adjusted based on the quantum state feature reweighting strategy, and through the superposition and interference of quantum states, the model can adaptively emphasize the features that have the greatest impact on the classification results, enhance the expression ability of data features, improve the classification accuracy, and adapt to the classification requirements of government affairs data on nonlinear features. Therefore, compared with the prior art, the method proposed by the present invention is suitable for complex scenarios of government affairs data, can effectively process heterogeneous and complex government affairs data, and realize efficient and accurate data classification.
[0050] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;
[0052] Figure 1 This is a flowchart of a data classification method applied to a government affairs platform in an embodiment of the present invention;
[0053] Figure 2 This is an example diagram of the feature dimensionality reduction model training process in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0055] A specific embodiment of the present invention discloses a data classification method applied to a government affairs platform, such as Figure 1 As shown, including:
[0056] S1: Acquire the stored data in the government affairs system platform.
[0057] Among them, the government affairs system platform includes: government affairs office system, tax management system, social security management system, public security data platform, etc. The collected government affairs system data can be stored in JSON format. The stored data includes: attribute number of data; timestamp of data, in seconds; government affairs system ID of data source; business type code, such as "tax declaration", "social security payment", etc.; operator ID, used to identify the specific government affairs personnel of the operation; geographical location of data, represented by longitude and latitude coordinates; status of business execution, the value domain is 0 (unfinished) and 1 (completed); time-consuming business operation, in seconds; abnormal flag of data, when the value is 1, it means data abnormality, and when it is 0, it is normal; operation type, such as "add", "modify", "delete". It can be understood that for the government affairs system platform in actual application, the data stored is diverse, and its types may reach dozens or even hundreds.
[0058] S2: preprocess the stored data, annotate the preprocessed data, and use the annotated data as target data. As can be seen from the parameter types corresponding to the stored data, the target data includes multiple different types of parameters. For example, the attribute number of the above data, the timestamp of the data, the government system ID of the data source, etc. are all a type of parameter.
[0059] Wherein, the data preprocessing includes:
[0060] Data cleaning: Dealing with inconsistencies in data, such as missing value processing, noise data elimination, duplicate value processing, etc., to improve data quality. Data integration: Merging data from different sources into a unified data set to establish a data warehouse. Data transformation: Standardizing, discretizing, and normalizing data to meet analysis needs. Data reduction: Reduce data dimensions through feature selection and dimensionality reduction techniques to improve data processing efficiency and model performance. Feature engineering: Including feature construction, feature selection, and feature encoding to enhance the predictive power of the model. Outlier detection and processing: Identify and process outliers in the data to prevent them from having a negative impact on data analysis and model training.
[0061] Exemplarily, the annotation is manual annotation, and the category of annotation can be determined according to actual needs. It can be understood that the type of annotation data determines the customization function of the classification method proposed in the present invention, but the classification of any government data can be achieved using the method proposed in the present invention.
[0062] Preferably, the annotation types of the present invention include: "normal data", which refers to operation data without any abnormalities in the business process; "abnormal data", which refers to operation data that causes business abnormalities due to human operation or system failure in the business process; "delayed data", which refers to operation data in which the business process cannot be completed in time due to network problems or system delays during the operation.
[0063] After the acquired storage data is labeled, the target data is obtained.
[0064] S3: Expand the target data based on the generative adversarial network model to obtain a first training sample set.
[0065] A certain amount of target data is obtained, and any type of parameter data in the target data is set to empty to generate incomplete target data, and the incomplete target data is input into a generative adversarial network to obtain generated target data corresponding to the incomplete target data, wherein the generated target data is an expanded sample set, and the target data and the expanded sample set are used as the first training sample set.
[0066] It is understandable that the collection, acquisition, labeling and preprocessing of training data are time-consuming and labor-intensive, and insufficient training samples can easily lead to poor generalization ability of the model and affect the accuracy of the model. The present invention uses a generative adversarial network algorithm based on multi-objective optimization to expand the data of government data, and generates new data samples by simulating the distribution of real data to improve the generalization ability and accuracy of the model.
[0067] The generative adversarial network consists of two parts: a generator and a discriminator. The generator is responsible for generating data that is as realistic as possible, while the discriminator attempts to distinguish between real data and generated data. Based on the traditional generative adversarial network framework, the present invention adopts an adaptive multi-objective function balancing strategy and uses multiple loss functions to simultaneously optimize the generation quality and diversity, making it more adaptable to the characteristics of government data.
[0068] Among them, the weights of the generator and discriminator in the generative adversarial network are W Gc and W Dc , which is initialized as follows:
[0069]
[0070] in, It means the mean is 0 and the variance is The normal distribution of in and n out Represent the number of nodes in the input and output layers respectively, and ~ indicates that it obeys a specific distribution.
[0071] In the generative adversarial network, multiple loss functions are used, including adversarial loss, content loss and diversity loss. Adversarial loss ensures that the generated data is difficult to distinguish from the real data, content loss ensures the accuracy of the generated data at the semantic level, and diversity loss increases the diversity of the generated data. Specifically, the multi-objective loss function is defined as L c , the generated adversarial loss is ξ adv , the content loss is ξ content , the diversity loss is ξ diversity , expressed as:
[0072] L c =λ adv ξ adv +λ content ξ content +λ diversity ξ diversity ,
[0073] Among them, λ adv , content , diversity are the weight coefficients of adversarial loss, content loss and diversity loss respectively.
[0074] Adversarial loss ξ adv It is used to improve the quality of generated samples. The calculation method is expressed as:
[0075] ξ adv =E x~pdata [logD c (x)]+E z~pz [log(1-D c (Gc (z)))], where pdata is the distribution of real data, pz is the distribution of random noise, and D c () is the discriminator function, G c () is the generator function, E represents the expectation, and x represents the real sample. Content loss ξ content The mean square error is calculated as:
[0076]
[0077] Where, is the L2 norm, Nc is the number of samples in the batch, x i is the i-th true sample, z i is the i-th random noise vector. Diversity loss ξ diversity The difference between the generated samples is calculated and expressed as:
[0078]
[0079] Among them, z j is the jth random noise vector.
[0080] Adopt adaptive weight adjustment strategy to dynamically adjust the weight of each loss function. According to the difference between the generated data and the real data in the current training batch, the weight of the loss function is automatically adjusted to optimize the training process, which is expressed as:
[0081]
[0082] Among them, η c is the learning rate for adaptive weight adjustment, is the loss weight of the t+1th iteration, corresponding to λ adv , content , diversity , is the loss weight of the tth iteration. Preferably, η c Set to 0.01.
[0083] During the training process, the generator and the discriminator are trained alternately. Specifically, in each training batch, the generator is first fixed and the discriminator is updated to better identify the generated data and the real data; then the discriminator is fixed and the generator is updated to generate data that is more difficult for the discriminator to identify. The present invention uses the gradient descent method to alternately update and The update method is expressed as:
[0084]
[0085] in, and Respectively represent the loss function gradients with respect to the generator and discriminator parameters, η es is the learning rate of the generative adversarial network, is the weight of the generator at the tth iteration, is the weight of the discriminator at the tth iteration, is the weight of the generator at the t+1th iteration, is the weight of the discriminator at the t+1th iteration. Preferably, η es Set to 0.05.
[0086] It can be understood that the end condition of the training of the generative adversarial network can be that the value of the loss function reaches a preset threshold or the number of iterations reaches a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times. The present invention does not limit the type of the generative adversarial network, as long as its accuracy meets the preset threshold or the number of iterations reaches the preset maximum number of iterations, it can be used as a generative adversarial network for expanding samples.
[0087] S4: Training a feature extraction model based on the first training sample set to obtain a target feature extraction model, including:
[0088] Exemplarily, the feature extraction model can perform feature extraction using a fully connected neural network. Preferably, a 6-layer fully connected neural network can be used. For the training and testing process, a Softmax classification layer needs to be connected after the last layer of the feature extraction model so that the output of the feature extraction model corresponds to the annotation type in the aforementioned step. During the training process, the feature extraction model and the softmax classification layer are trained simultaneously. After the model training is completed, the trained feature extraction model is used as the target feature extraction model; for the target feature extraction model, its last layer is the last layer of the feature extraction model and does not include the Softmax classification layer.
[0089] Some solutions in the prior art use neural networks for feature extraction. In some neural network structures, they may encounter problems such as gradient vanishing, gradient exploding, or falling into local optimal solutions, which will affect the stability of training and the performance of the model. The present invention uses a chaos optimization algorithm to optimize the parameters of the neural network model to achieve the training of the neural network model. Specifically, the present invention uses a self-adjusting mechanism to allow the network to dynamically adjust its weight update strategy according to the error of the previous training cycle, and utilizes the sensitivity in chaos theory to enhance the model's responsiveness to initial conditions and parameter changes. Specifically, the weight vector and bias vector of the neural network are initialized as follows:
[0090] W p,0 =μ p +σ p * N(0, I),
[0091] b p,0 =v p * N(0, I),
[0092] Among them, W p,0 is the initial vector of the neural network weights, b p,0 is the initial bias vector of the neural network, μ p is the mean shift of the neural network weights, v p is the mean shift of the weight bias of the neural network, σ p is the standard deviation of the weight initialization of the neural network, N(0, I) represents a normal distribution with a mean of 0 and a standard deviation of the identity matrix, and I is the identity matrix. Preferably, μ p Set to 0.01, v p Set to 0.05, σ p Set to 0.001.
[0093] During the training process, the output error of the neural network model is evaluated, and the learning rate is adjusted through the chaotic feedback mechanism to avoid overfitting or underfitting. The dynamic update method of the self-adjusting learning rate is expressed as:
[0094] η p,t =η p,t-1 *exp(-γ p *ΔE p,t-1 ),
[0095] Among them, η p,t is the learning rate of the neural network at the tth iteration, η p,t-1 is the learning rate of the neural network at the t-1th iteration, γ p It is the adjustment factor of the neural network, controlling the sensitivity of the learning rate change, ΔE p,t-1 is the error change of the t-1th iteration, which refers to the difference between the error of the neural network corresponding to the current iteration process and the error of the neural network corresponding to the previous iteration process; based on the updated learning rate, the weight is updated, which is expressed as:
[0096]
[0097] Among them, W p,t is the weight of the neural network at the tth iteration, W p,t-1 is the weight of the neural network at the t-1th iteration, E p is the error of the neural network, which is calculated by the preset Softmax function on the output features of the last layer of the neural network. is the symbol of partial derivative.
[0098] During the training process, a regularization strategy is used to prevent overfitting and ensure the generalization ability of the model. Specifically, regularization and sparseness are performed by dynamically adjusting the number of nodes in the hidden layer of the neural network, which can be expressed as:
[0099] N p,t =N p,t-1 +sgn(ΔE p,t-1 )*β p ,
[0100] Among them, N p,t is the number of nodes in the hidden layer of the neural network at the tth iteration; N p,t-1 is the number of nodes in the hidden layer of the neural network at the t-1th iteration, β p is the node adjustment step size of the hidden layer of the neural network, sgn() is the sign function of the error change, which is used to decide whether to increase or decrease the number of nodes. For sgn(ΔE p,t-1 ), when ΔE p,t-1 When sgn(ΔE p,t-1 ) is 1, when ΔE p,t-1 When sgn(ΔE p,t-1 ) is -1.
[0101] Preferably, the node adjustment step size of the hidden layer of the neural network depends on the function of the network level, and the calculation method is expressed as:
[0102]
[0103] Among them, Int cs () is the rounding operation, α p is the influence coefficient of adjusting the adjustment step size, d p is the number of layers of the neural network. Preferably, d p The value is 6, α p Set to 2.5.
[0104] It can be understood that the termination condition of the feature extraction model can be that the value of the loss function reaches a preset threshold or the number of iterations reaches a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000. The present invention does not limit the type of neural network, as long as its accuracy meets the preset threshold or the number of iterations reaches the preset maximum number of iterations, it can be used as a feature extraction model.
[0105] S5: Input the samples in the first training sample set into the target feature extraction model to obtain the target feature vector corresponding to each sample, and the target feature vector and the corresponding annotation form the second training sample set.
[0106] S6: Training a feature dimensionality reduction model based on the second training sample set to obtain a target feature dimensionality reduction model.
[0107] The target feature vector is input into the feature dimensionality reduction model to train the feature dimensionality reduction model. The present invention adopts an autoencoder algorithm based on dynamic routing to perform feature dimensionality reduction. The autoencoder consists of a symmetric encoder and decoder. The present invention adopts a dynamic routing mechanism based on feature importance scoring to automatically determine the transmission path of each feature in different layers of the encoder, thereby enhancing the model's ability to reconstruct the original data and reducing information loss.
[0108] The present invention uses the feature vector output by the encoder as the target feature dimension reduction vector, and the output of the decoder corresponds to the label type of the input target feature vector. During training, the autoencoder is trained using the second training sample set, and after training, the encoder in the autoencoder is used as the target feature dimension reduction model.
[0109] The training process includes the following:
[0110] Initialize the weight vector and bias vector of the autoencoder, specifically:
[0111]
[0112] in, is the initial weight vector of the hth layer of the autoencoder, is the initial bias vector of the hth layer of the autoencoder, n r,h is the number of neurons in the hth layer of the autoencoder, n r,h-1 is the number of neurons in the h-1th layer of the autoencoder, randn(n r,h , n r,h-1 ) generates a shape of n r,h *n r,h-1 A standard normally distributed random number, zeros(n r,h ) generates a length of n r,i The zero vector of , h = 1, 2, 3, ..., N.
[0113] The input data is passed through each layer of the encoder, and each layer makes dynamic routing decisions based on the output of the previous layer and the feature importance score of the current layer, selectively passing the most informative features, expressed as:
[0114] Z r,h =W r,h *x r,h-1 +b r,h ,
[0115] A r,h =R(Z r,h ),
[0116] x r,h =route(A r,h , imp(Ar,h )),
[0117] Among them, Z r,h is the linear transformation output of the hth layer of the autoencoder, A r,h is the output feature of the activation function of the autoencoder, W r,h is the weight of the hth layer of the autoencoder, b r,h is the bias of the hth layer of the autoencoder, R() is the ReLU activation function, x r,h-1 is the output feature of the h-1th layer of the autoencoder, x r,h is the output feature of the hth layer of the autoencoder, route() is the dynamic routing function, imp(A r,h ) is the importance scoring function.
[0118] Exemplarily, the dynamic routing function integrates the activation outputs of each feature by weighted average, where the weight is determined by the importance score of the feature, and the calculation method is expressed as:
[0119]
[0120] The importance scoring function is specifically:
[0121]
[0122] Among them, A r,h,j is the activation output of the jth neuron in the hth layer, A r,h,k is the activation output of the kth neuron in the hth layer, W r,imp,j is the weight of the corresponding feature importance, indicating the importance of the jth neuron, W r,imp,k is the weight of the corresponding feature importance, indicating the importance of the kth neuron, n r,h is the total number of neurons in the hth layer.
[0123] In the decoder stage, the features from different encoding layers are used to reconstruct the data and calculate the reconstruction error. During the training process, the loss function of the autoencoder is calculated as follows:
[0124]
[0125] Among them, L r is the loss function of the autoencoder, m r The number of samples input in the current training process; is the jth sample input to the autoencoder, is the jth sample after reconstruction;
[0126] The gradient of the loss function to each parameter of the autoencoder is calculated through the back-propagation algorithm, and the weights and biases of the autoencoder are updated. The update method is expressed as:
[0127]
[0128] And update the weight and bias of the autoencoder, specifically:
[0129]
[0130] Where, ΔW r,h is the update increment of the weight of the hth layer of the autoencoder, Δb r,h is the update increment of the bias of the hth layer of the autoencoder, η r is the learning rate of the autoencoder, is the weight of the hth layer of the updated autoencoder, is the bias of the hth layer of the updated autoencoder, S r,h is the sparsity measure of the h-th layer of neurons in the autoencoder, λ r,h is the sparsity pruning threshold, τ() is the indicator function, which takes the value of 1 when the condition in the brackets is met, otherwise it takes the value of 0. r,h It is set to 0.8, indicating that weights will be pruned when the sparsity measure is above 80%.
[0131] Preferably, the computational efficiency and generalization ability of the model are improved by dynamically pruning redundant weights, that is, the weights corresponding to neurons with small activation values in most cases will be dynamically pruned, thereby simplifying the model structure. Specifically, the importance of neurons is judged by statistically analyzing the sparsity of activation values. The calculation method of the sparsity measure of the h-th layer neurons of the autoencoder is expressed as:
[0132]
[0133] Among them, S r,h is the sparsity measure of the h-th layer of neurons, a r,h,j is the activation value of the jth sample in the i-th layer, υ r is the sparsity threshold, m r is the number of samples input in the current training process.
[0134] It can be understood that the end condition of the feature dimensionality reduction module can be that the value of the loss function reaches a preset threshold or the number of iterations reaches a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000. The present invention does not limit the type of autoencoder, as long as its accuracy meets the preset threshold or the number of iterations reaches the preset maximum number of iterations, it can be used as a feature dimensionality reduction module.
[0135] S7: Input the samples in the second training sample set into the target feature dimensionality reduction model to obtain the target feature dimensionality reduction vector corresponding to each sample, and the target feature dimensionality reduction vector and the corresponding annotation form a third training sample set.
[0136] S8: Training a classifier model based on the third training sample set to obtain a target classifier model.
[0137] The data after feature dimensionality reduction is input into the classifier to train the classifier model. The present invention adopts a support vector machine algorithm based on quantum state feature reweighting as a classification algorithm. Traditional support vector machines may perform poorly for nonlinearly separable government data. The present invention adopts a quantum state feature reweighting strategy and uses quantum computing principles to adjust and optimize the weights of data features to improve classification accuracy.
[0138] The parameters of the support vector machine include the quantum state feature reweight vector W u and bias b u , the initialization method is expressed as:
[0139]
[0140] in, is the initial weight vector, is the initial bias vector, θ u,i is a randomly selected phase angle used to initialize the quantum state distribution of the weight vector, d u is the feature dimension input to the support vector machine model.
[0141] Suppose the input government data features after dimension reduction are X u , through quantum feature mapping and conversion to quantum state, the features of each data point are mapped to the quantum phase space to enhance the expressiveness of data features. Specifically, the way to map the government data features after feature dimensionality reduction to the quantum state space is expressed as:
[0142]
[0143] Among them, ω u,j Represents feature X u,j The quantum mapping frequency, X u is the target feature dimension reduction vector, n u is the number of features, i * is the imaginary unit, φ u () is the quantum characteristic mapping function, X u,j Represents the j-th eigenvalue of the government data feature after feature dimensionality reduction.
[0144] After feature mapping, the quantum state feature reweighting strategy is used to adjust the influence weight of each quantum state. Through the superposition and interference of quantum states, the model can adaptively emphasize the features that have the greatest impact on the classification results, which can be expressed as:
[0145]
[0146] Among them, λ u,k is the kth feature reweighting coefficient dynamically adjusted by the quantum optimization algorithm, X u,k represents the kth eigenvalue of the government data feature after feature dimensionality reduction, ψ u () is the quantum state characteristic reweighting function.
[0147] The reweighted features are used to train the support vector machine, and the quantum phase recovery strategy is used to optimize the classification hyperplane. Specifically, the decision boundary is adjusted by minimizing the quantum state error. The goal is to minimize the following regularized loss function:
[0148]
[0149] Among them, C is the regularization parameter, m u is the number of training samples, y (u,l) is the label of sample 1, L u () is the loss function of the support vector machine, || || 2 represents the L2 norm;
[0150] The quantum phase recovery technology is used to optimize the decision boundary of the support vector machine. Specifically, the update method of the support vector machine weight is expressed as:
[0151]
[0152] Among them, α u,l is the Lagrange multiplier, η u is the learning rate of the support vector machine, ΔW u is the update increment of the support vector machine, is the weight of the support vector machine before updating, is the updated support vector machine weight. Preferably, η u Set to 0.01.
[0153] It can be understood that the termination condition of the classifier model may be that the value of the loss function reaches a preset threshold or the number of iterations reaches a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times.
[0154] S9: Obtain the government data to be classified, input the government data to be classified into the target feature extraction model to obtain a target feature vector, input the target feature vector into the target feature dimensionality reduction model to obtain a target feature dimensionality reduction vector, and input the target feature dimensionality reduction vector into the target classifier model to obtain a category corresponding to the government data to be classified.
[0155] It can be understood that based on the data classification method provided in the present invention, after obtaining the government data to be classified, the corresponding type can be obtained efficiently and accurately.
[0156] Exemplarily, the above-mentioned method of training each model based on the sample set is a common technical means in the art and is not specifically described here.
[0157] Compared with the prior art, this embodiment provides a data classification method applied to a government affairs platform, which expands the acquired government affairs data samples based on a generative adversarial network model, so that the generated data samples are highly similar to the real data, ensuring the diversity of training data and the generalization ability of the model, and improving the accuracy of the model when processing scarce samples. In the process of feature extraction model training, the learning rate of weight update is optimized based on the chaotic feedback mechanism, and the number of hidden layer nodes of the neural network is dynamically adjusted by the regularization strategy, which ensures the generalization ability of the model, reduces the occurrence of gradient problems and local optimal problems, and prevents overfitting; in the process of feature dimension reduction model training, the dynamic routing strategy is combined to ensure the accurate transmission of key information in the model training process, and the sparsity of the activation value is used to judge the importance of neurons, and the computational efficiency and generalization ability of the model are improved by dynamically pruning redundant weights, which improves the data reconstruction ability, reduces information loss, and enables the reduced-dimensional data to better express the original data characteristics; in the process of classification model training, the influence weight of each quantum state is adjusted based on the quantum state feature reweighting strategy, and through the superposition and interference of quantum states, the model can adaptively emphasize the features that have the greatest impact on the classification results, enhance the expression ability of data features, improve the classification accuracy, and adapt to the classification requirements of government data on nonlinear features. Therefore, compared with the prior art, the method proposed by the present invention is suitable for complex scenarios of government data, can effectively process heterogeneous and complex government data, and achieve efficient and accurate data classification.
[0158] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0159] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A classification method applied to government affairs system platform data, characterized in that: include: Obtaining the stored data in the government affairs system platform; Preprocessing the stored data, annotating the preprocessed data, and using the annotated data as target data; Expanding the target data based on a generative adversarial network model to obtain a first training sample set; Training a feature extraction model based on the first training sample set to obtain a target feature extraction model; Input the samples in the first training sample set into the target feature extraction model to obtain the target feature vector corresponding to each sample, and the target feature vector and the corresponding annotation form the second training sample set; Training a feature dimensionality reduction model based on the second training sample set to obtain a target feature dimensionality reduction model; Input the samples in the second training sample set into the target feature dimensionality reduction model to obtain the target feature dimensionality reduction vector corresponding to each sample, and the target feature dimensionality reduction vector and the corresponding annotation form a third training sample set; Training a classifier model based on the third training sample set to obtain a target classifier model; Obtain government data to be classified, input the government data to be classified into a target feature extraction model to obtain a target feature vector, input the target feature vector into a target feature dimensionality reduction model to obtain a target feature dimensionality reduction vector, and input the target feature dimensionality reduction vector into a target classifier model to obtain a category corresponding to the government data to be classified.
2. According to claim 1, a data classification method applied to a government affairs platform is characterized in that: include: The feature extraction model is a neural network model, the feature dimension reduction model is an autoencoder model, and the classifier model is a support vector machine model.
3. According to claim 2, a data classification method applied to a government affairs platform is characterized in that: The weight update method of the neural network model is: or p,t =the p,t-1 *exp(-γ p *NO p,t-1 ), Among them, W p,t is the weight of the neural network at the tth iteration, W p,t-1 is the weight of the neural network at the t-1th iteration, E p is the error of the neural network, η p,t is the learning rate of the neural network at the tth iteration, is the symbol of partial derivative, η p,t-1 is the learning rate of the neural network at the t-1th iteration, γ p is the adjustment factor of the neural network, ΔE p,t-1 is the error change at the t-1th iteration.
4. According to claim 3, a data classification method applied to a government affairs platform is characterized in that: The number of nodes in the hidden layer of the neural network is: N p,t =N p,t-1 +sgn(ΔE p,t-1 )*b p , Among them, N p,t is the number of nodes in the hidden layer of the neural network at the tth iteration; N p,t-1 is the number of nodes in the hidden layer of the neural network at the t-1th iteration, β p is the node adjustment step size of the hidden layer of the neural network, and sgn() is the sign function of the error change; The node adjustment step size β of the hidden layer of the neural network p The calculation method is: Among them, Int cs () is the rounding operation, α p is the influence coefficient of adjusting the adjustment step size, d p is the number of layers of the neural network.
5. According to claim 2, a data classification method applied to a government affairs platform is characterized in that: Each layer of the encoder in the autoencoder model makes dynamic routing decisions based on the output of the previous layer and the feature importance score of the current layer to pass the most informative features, specifically: Z r,h =W r,h *x r,h-1 +b r,h , A r,h =R(Z r,h ), x r,h =route(A r,h ,imp(A r,h )), Among them, Z r,h is the linear transformation output of the hth layer of the autoencoder, A r,h is the output feature of the activation function of the autoencoder, W r,h is the weight of the hth layer of the autoencoder, b r,h is the bias of the hth layer of the autoencoder, R( ) is the ReLU activation function, x r,h-1 is the output feature of the h-1th layer of the autoencoder, x r,h is the output feature of the hth layer of the autoencoder, route() is the dynamic routing function, imp(A r,h ) is the importance scoring function; The weight and bias of the autoencoder are updated as follows: Where, ΔW r,h is the update increment of the weight of the hth layer of the autoencoder, Δb r,h is the update increment of the bias of the hth layer of the autoencoder, is the weight of the hth layer of the updated autoencoder, is the bias of the hth layer of the updated autoencoder, S r,h is the sparsity measure of the h-th layer of neurons in the autoencoder, λ r,h is the sparsity pruning threshold, and τ() is the indicator function.
6. A data classification method applied to a government affairs platform according to claim 5, characterized in that: The dynamic routing function is specifically: The importance scoring function is specifically: Among them, A r,h,j is the activation output of the jth neuron in the hth layer, A r,h,k is the activation output of the kth neuron in the hth layer, W r,imp,j is the weight of the jth neuron, W r,imp,k is the weight of the kth neuron, n r,h is the total number of neurons in the hth layer.
7. A data classification method applied to a government affairs platform according to claim 6, characterized in that: The sparsity measure is calculated as: Among them, S r,h is the sparsity measure of the h-th layer of neurons, a r,h,j is the activation value of the jth sample in the i-th layer, υ r is the sparsity threshold, m r The number of samples input in the current training process.
8. A data classification method applied to a government affairs platform according to claim 7, characterized in that: The loss function of the classifier model is: Among them, L u () is the loss function of the classifier model, W u is the weight, b u is the bias, C is the regularization parameter, m u is the number of training samples, y (u,l) is the label of sample 1, || || 2 represents the L2 norm, ψ u () is the quantum state characteristic reweighting function, which is calculated as follows: Among them, λ u,k is the kth feature reweighting coefficient dynamically adjusted by the quantum optimization algorithm, X u,k represents the kth eigenvalue of the government data feature after feature dimensionality reduction, φ u () is the quantum characteristic mapping function, which is calculated as follows: Among them, ω u,j Represents feature X u,j The quantum mapping frequency, X u is the target feature dimension reduction vector, n u is the number of features, i * is the imaginary unit, X u,j Represents the j-th eigenvalue of the government data feature after feature dimensionality reduction.
9. According to claim 7, a data classification method applied to a government affairs platform is characterized in that: The weight update method of the support vector machine model is expressed as: Among them, α u,l is the Lagrange multiplier, η u is the learning rate of the support vector machine, ΔW u is the update increment of the support vector machine, is the weight of the support vector machine before updating, is the updated support vector machine weight.
10. A data classification method applied to a government affairs platform according to claim 9, characterized in that: The target data includes parameters of different types, and the marked categories include normal data, abnormal data, and delayed data; The step of expanding the target data based on the generative adversarial network model to obtain a first training sample set includes: A certain amount of target data is obtained, and any type of parameter data in the target data is set to empty to generate incomplete target data, and the incomplete target data is input into a generative adversarial network to obtain generated target data corresponding to the incomplete target data, wherein the generated target data is an expanded sample set, and the target data and the expanded sample set are used as the first training sample set.