Social risk event classification method and system based on graph invariant learning

Through the method based on constant learning of graphs, the social risk event graph structure is constructed and the relationship characteristics between events are extracted, and the problem of failure to fully consider the interconnection and regional differences in the existing technology is solved, and a more accurate and robust classification of social risk event is achieved.

CN119598257APending Publication Date: 2025-03-11SHANXI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411664748.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing social risk event classification methods fail to fully consider the interconnection and regional differences between events, resulting in misjudgment in response to complex events and the accuracy of predictions in different regions or environments.

Method used

Using a graph-invariant learning method, by constructing a social risk event graph structure, using events as nodes, and interrelationships between events as edges, the graph neural network is used to extract the relationship characteristics between events, and eliminating redundant features through constant learning and information bottleneck criteria to build a robust classification model.

Benefits of technology

It improves the accuracy and robustness of social risk events classification, can better understand the risk transmission mode and mutual influence between regions, and improves the classification ability and efficiency in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598257A_ABST
    Figure CN119598257A_ABST
Patent Text Reader

Abstract

The invention discloses a social risk event classification method and system based on graph invariant learning, and belongs to the technical field of social risk event classification. According to the method, the graph neural network model is constructed according to an invariant learning method and an information bottleneck criterion by constructing an event graph structure, so that stable internal characteristics of a cross-region are captured, and the classification accuracy and robustness of the model in a complex environment are improved. A social risk event classification system based on graph invariant learning comprises a computer processor, a memory, an event graph construction unit, a feature extraction and redundancy elimination unit based on invariant learning, a model training unit and a prediction result output unit, and finally outputs a model classification result to a social governance system. Governance personnel are helped to identify and deal with potential social risks in time, and the efficiency and accuracy of social governance are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of social risk event classification, and specifically relates to a social risk event classification method and system based on graph invariant learning. Background Art

[0002] The classification of social risk events is an important issue in grassroots social governance, which aims to accurately identify and effectively respond to different types of social risk events. One of the main problems facing the current classification method is that it fails to fully consider the interconnections between events, which may lead to misjudgments when responding to complex events. Many social risk events do not occur independently, and there are often connections between them. Ignoring this connection may affect the accuracy of classification. In addition, since social risk events are greatly affected by geographical, social and cultural backgrounds in different regions, if the classification method does not take these regional differences into account, when the risk event changes in the new region or environment, the accuracy of the prediction will decrease, resulting in deviations in the classification results.

[0003] Graph learning-based social risk event classification is an innovative method to model social risk events and their complex relationships through graph neural networks. This type of method represents each social risk event as a node in the graph, and the mutual influence between events is connected as edges, thus forming a graph structure containing event associations. Compared with traditional classification methods, graph-based learning classification methods can not only utilize the characteristics of individual events, but also better understand the risk propagation pattern and the mutual influence between regions by mining the implicit associations between events. This enables it to improve the accuracy and generalization of classification when facing complex, cross-regional social risk events, especially in different regional environments.

[0004] However, graph learning-based methods still face some challenges, especially when capturing the connections between events, the model sometimes learns redundant pseudo-invariant relationships, which may cause the model to overfit to a specific region or data distribution, and the classification effect will decrease when facing new regions or different scenarios. Summary of the invention

[0005] In order to solve the problem of how to improve the robustness and accuracy of social risk event classification based on the attributes and mutual connections of events, the present invention provides a classification method and system based on graph invariant learning.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A social risk event classification method based on graph invariant learning includes the following steps:

[0008] Step 1: Take each event as a node in the graph and the connections between events as edges, and connect them to build a social risk event graph structure;

[0009] Step 2: Feature extraction based on invariant learning: Encode the graph structure, convert the information of each node and edge into a corresponding vector representation, and compress redundant features according to the information bottleneck criterion to ensure that the model can capture the true invariant relationship, thereby improving the accuracy of classification; Construct a graph neural network classification model based on invariant learning;

[0010] Step 3: Use the gradient descent method to iteratively train the graph neural network classification model based on invariant learning, continuously optimize the model parameters, so that it can gradually improve the classification ability of complex social risk events, and finally obtain a trained graph invariant learning classification model;

[0011] Step 4: Classify social risk events through graph-invariant learning classification model.

[0012] The prediction results will be fed back to the social governance system to help grassroots governance personnel identify and deal with potential social risks in a timely manner and improve the efficiency of monitoring and response.

[0013] Further, the step 1 comprises the following steps:

[0014] Step 1.1, according to the requirements of risk event classification task, obtain the event data to be analyzed from the social risk event monitoring system, and extract the key attributes of the event, including the time attribute, spatial attribute and the mutual connection between the events; organize the event data into a data set denoted as T = {t i} i=1,…,N , where N is the number of events, t i Represents the i-th event record in the data set;

[0015] Step 1.2: Use the K-nearest neighbor algorithm to construct the event graph structure G = (V, E, Y), where V = {v 1 ,v 2 ,…,v N} represents the node set of the event, each node v i represents a social risk event, N is the number of events, and E represents the edge set, that is, if node v i is node v j The adjacent nodes of , then the edge set E contains the edge (v i ,v j ); Y represents the category label assigned to each event in the training set after expert judgment, where y i Represents the node v i The associated category label;

[0016] Formula (1) is used to calculate the similarity between each event and other events, and the most similar event is selected as the adjacent node;

[0017]

[0018] Among them, t i , t j Represent two different events respectively; h ik and h jk is the event t i and t j The value on the kth feature; m represents the feature dimension of the event; d(t i ,t j ) represents event t i and t j The Euclidean distance between them (a measure of similarity).

[0019] Further, the step 2 specifically includes the following steps:

[0020] Step 2.1, construct a forward conduction model of the graph neural network to encode the graph structure data;

[0021] Step 2.2, use the forward conduction model of the graph neural network to extract features of risk events;

[0022] Set consistent learning goals:

[0023] Among them, G e represents the input image under region e; Y e represents the set of labels associated with the input graph; θ represents the model parameters; e represents a specific area, and β is a hyperparameter. represents the variance of the loss function, represents the expected value of the loss function; l represents the number of layers; f θ represents the model expressed by the parameters θ; Represents the classification result of the model for node v in the graph; represents the true label of node v in the graph;

[0024] Step 2.3, introduce K graph structure editors to imitate training data from different regions; increase distribution differences by maximizing the loss variance between environments; the main loss requires minimizing the loss variance, promoting the model's effective learning of invariant features and ensuring the model's predictive ability;

[0025]

[0026] in, Indicates the variance of the calculated loss function L under K different graph structures; Represents a graph after a specific transformation The loss function value calculated using the model parameters θ, Y is the corresponding label; represents the average loss over all K graph structures, and the hyperparameter β is used to balance the variance term and the average loss term.

[0027] Step 2.4, introduce the information bottleneck criterion to optimize the invariant learning model and eliminate redundant features; set the learning goal:

[0028]

[0029] Among them, Z represents the learned feature representation, I represents mutual information, and λ is a hyperparameter;

[0030] Step 2.5, use variational approximation method to accurately estimate the mutual information of high-dimensional vectors;

[0031] Assume r(z) is an approximation of p(z), q(y|z) is an approximation of p(y|z); and assume p(z|g) is a random encoder. The optimization objective of the information bottleneck is as shown in formula (6):

[0032]

[0033] Step 2.6, transforming the encoder using a reparameterization operation;

[0034] The encoder is in the form of Where f outputs the K-dimensional mean μ and K×K covariance matrix ∑ of z;

[0035] Then, by changing the variable formula, we get q(z|g)dz=q(ε)dε, where z=f(g,ε), Therefore, the model is optimized by optimizing formula (7):

[0036]

[0037] in, and Where f(g) is the feature extractor, f i is a classifier, is the cross entropy loss.

[0038] Furthermore, the forward conduction model is expressed by the forward conduction process, specifically:

[0039] 1) Initial input: The input of layer 0 is the initial feature vector set of the node These features are attributes extracted from graph data;

[0040] 2) Feature update: Each node v i The features of are updated by aggregating the features of its adjacent nodes. The feature update formula of each layer is shown in formula (2):

[0041]

[0042] in, is the lth layer node v i is the feature representation, σ is the activation function, W (l) is the weight matrix of the lth layer, b (l) is the bias term of the lth layer, represents the set of neighbor nodes of node i; Formula (2) requires risk event data from different regions to ensure that the model can perform effective classification in different regions.

[0043] 3) Inter-layer transfer: Each layer uses the features of neighboring nodes and the node representation of the previous layer to update until the Lth layer, and this process continues;

[0044] 4) Output layer: After the last layer of feature update, the final representation of each node is obtained

[0045] The input of the model is a graph G = (V, E, Y), where each node v i ∈V has an initial eigenvector The feature vector encodes the attribute information of the node. The model consists of L layers of neural networks, and each layer aggregates and updates the feature information of the node and its neighboring nodes.

[0046] Further, the step 3 specifically includes the following steps:

[0047] Step 3: Use the gradient descent method to iteratively train the model and continuously optimize the model parameters to gradually improve its classification ability for complex social risk events, and finally obtain a trained graph-invariant learning classification model;

[0048] Step 3.1, construct an overall optimization loss function based on the invariant learning method and the information bottleneck criterion to guide the model to learn the feature representation that remains stable and unchanged under different environments;

[0049] The overall optimization loss function includes invariance loss, redundancy compression loss, and prediction loss;

[0050] 1) Invariance loss: Multiple graph structure editors are used to generate data in various environments, and invariance loss is used to encourage the model to maintain stable performance in different distributions, thereby enhancing the robustness of the model.

[0051] 2) Redundancy compression loss: Based on the information bottleneck optimization criterion, the redundancy compression loss is obtained to promote the model to capture features related to the prediction target and compress the learned redundant information.

[0052] 3) Prediction loss: The prediction loss is in the form of cross entropy to ensure that the model can effectively learn for the given task.

[0053] The overall optimization loss function is expressed as:

[0054]

[0055] in, is the cross entropy loss under region e, and is the approximate calculation term of mutual information, γ is the regularization coefficient, which is used to control the complexity of the model and prevent overfitting, η and ζ are parameters used to control information bottleneck optimization;

[0056] Step 3.2, using the gradient descent optimization algorithm, updates the model parameters θ through multiple iterations; in each iteration, the model performs forward propagation based on the current parameters θ, calculates the prediction results, and evaluates the gap between the model output and the true label through the loss function; then, back propagation is performed to update the parameters θ according to the gradient of the loss, gradually reducing the error; as the iterations proceed, the model is continuously optimized, learns stable and invariant features in different regions and environments, and eliminates redundant information. Ultimately, the accuracy of classification is improved;

[0057] A social risk event classification system based on graph invariant learning, comprising: a computer processor and memory, an event graph construction unit, a feature extraction and redundancy elimination unit based on invariant learning, a model training unit and a prediction result output unit;

[0058] The computer processor and memory are used to store information and process information;

[0059] The event graph construction unit executes step 1, collects event data from the social risk event monitoring system using a computer processor, extracts the time attributes, spatial attributes and their mutual connections of the events, constructs an event graph structure and loads it into the computer memory;

[0060] The feature extraction and redundancy elimination unit executes step 2 according to the event graph structure generated by the event graph construction unit, extracts features of events and their connections through a graph neural network, uses a graph invariant learning method to identify stable relationships between events in different regions and environments, and eliminates redundant information and irrelevant connections to ensure that the model learns true invariant relationships;

[0061] The model training unit executes step 3 to iteratively train the model by setting a loss function to improve the accuracy of the classification model;

[0062] The prediction result output unit executes step 4 according to the trained model, predicts the social risk events to be classified, generates classification results, and outputs the results to the social governance system to help governance personnel identify and respond to potential social risks in a timely manner and improve the efficiency and accuracy of social governance.

[0063] Compared with the prior art, the present invention has the following advantages:

[0064] The present invention provides a social risk event classification method based on graph invariant learning. By constructing an event graph structure and using a graph neural network to extract relationship features between events, the model can deeply explore the temporal attributes, spatial attributes and mutual connections between events, and extract comprehensive feature representations, thereby improving the accuracy and robustness of the classification results.

[0065] The present invention provides a social risk event classification method based on graph invariant learning. According to the invariant learning method and the information bottleneck criterion, the model can capture the intrinsic characteristics of cross-regional stability, thereby improving the classification accuracy and robustness of the model in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 This is a graph neural network model structure diagram of the social risk event classification system of the present invention;

[0067] Figure 2 A computer-implemented system structure diagram of the social risk event classification system of the present invention;

[0068] Figure 3 Flow chart of the method of the present invention. DETAILED DESCRIPTION

[0069] In order to gain a deeper understanding of the present invention, we will provide a comprehensive and detailed description of the present invention. However, the present invention has multiple implementations and is not limited to the specific examples listed herein. The presentation of these examples is intended to deepen the comprehensive understanding of the disclosure of the present invention.

[0070] The social risk event classification method based on graph invariant learning described in the present invention is implemented by a computer program. Figure 3The process shown details the specific implementation method of the technical solution proposed in the present invention. The "China Social Risk Event Dataset" is used for classification tasks. This dataset covers various types of social risk events across the country, and the data contains key attributes such as the time, location, and mutual connections between events. These data are divided into training sets and test sets. The training set is used for model training, and the test set is used for model verification and performance evaluation. Each event record is described by several key features, including time attributes, spatial attributes, and its connection with other events. The event records of the training set are labeled through expert judgment, and the categories include natural disasters, public health events, social unrest and other risk types.

[0071] Example 1

[0072] A social risk event classification method based on graph invariant learning includes the following steps:

[0073] Step 1: Take each event as a node and the connections between events as edges to construct a social risk event graph structure. The specific steps are as follows:

[0074] Step 1.1, according to the requirements of risk event classification task, obtain the event data to be analyzed from the social risk event monitoring system, and extract the key attributes of the event, including the time attribute, spatial attribute and the mutual connection between the events; organize these data into a data set denoted as T = {t i} i=1,…,N , where N is the number of events in the data set, and t i Represents the i-th event record in the dataset.

[0075] Step 1.2: Use the K-nearest neighbor algorithm to construct the event graph structure G = (V, E, Y), where V = {v 1 ,v 2 ,…,v N} represents the node set of the event, each node v i represents a social risk event, N is the number of events, E represents the edge set, and Y represents the category label assigned to each event in the training set after expert judgment;

[0076] Formula (1) is used to calculate the similarity between each event and other events, and the most similar event is selected as the adjacent node;

[0077]

[0078] Among them, t i , t j Represent two different events respectively; h ik and h jk is the event t i and t jThe value on the kth feature; m represents the feature dimension of the event; d(t i ,t j ) represents event t i and t j The Euclidean distance between .

[0079] Step 2: Feature extraction based on invariant learning: Encode the graph structure, convert the information of each node and edge into a corresponding vector representation, and compress redundant features according to the information bottleneck criterion to ensure that the model captures the true invariant relationship and construct a graph neural network classification model based on invariant learning. The specific steps are as follows:

[0080] Step 2.1, construct a forward conduction model of the graph neural network to encode the graph structure data;

[0081] Step 2.2, use the forward conduction model of the graph neural network to extract features of risk events;

[0082] Set consistent learning goals:

[0083] Among them, G e represents the input image under region e; Y e represents the set of labels associated with the input graph; θ represents the model parameters; e represents a specific area, and β is a hyperparameter. represents the variance of the loss function, represents the expected value of the loss function; l represents the number of layers; f θ represents the model expressed by the parameters θ; Represents the classification result of the model for node v in the graph; represents the true label of node v in the graph;

[0084] Step 2.3, introduce K graph structure editors to imitate training data from different regions; increase distribution differences by maximizing the loss variance between environments; the main loss requires minimizing the loss variance, promoting the model's effective learning of invariant features and ensuring the model's predictive ability;

[0085]

[0086] in, Indicates the variance of the calculated loss function L under K different graph structures; Represents a graph after a specific transformation The loss function value calculated using the model parameters θ, Y is the corresponding label; represents the average loss over all K graph structures, and the hyperparameter β is used to balance the variance term and the average loss term.

[0087] Step 2.4, introduce the information bottleneck criterion to optimize the invariant learning model and eliminate redundant features; set the learning goal:

[0088]

[0089] Among them, Z represents the learned feature representation, I represents mutual information, and λ is a hyperparameter;

[0090] Step 2.5, use variational approximation method to accurately estimate the mutual information of high-dimensional vectors;

[0091] Let r(z) be an approximation of p(z), and q(y|z) be an approximation of p(y|z). Let p(z|g) be a random encoder. The optimization goal of the information bottleneck is:

[0092]

[0093] Step 2.6, transforming the encoder using a reparameterization operation;

[0094] The encoder is in the form of Where f outputs the K-dimensional mean μ and K×K covariance matrix ∑ of z;

[0095] Then, by changing the variable formula, we get q(z|g)dz=q(ε)dε, where z=f(g,ε), Therefore, the model is optimized by optimizing formula (7):

[0096]

[0097] in, and Where f(g) is the feature extractor, f i is a classifier, is the cross entropy loss.

[0098] The forward conduction model is described by the forward conduction process, specifically:

[0099] 1) Initial input: The input of layer 0 is the initial feature vector set of the node

[0100] 2) Feature update: Each node v i The features of are updated by aggregating the features of its adjacent nodes. The feature update formula of each layer is shown in formula (2):

[0101]

[0102] in, is the lth layer node v i is the feature representation, σ is the activation function, W (l)is the weight matrix of the lth layer, b (l) is the bias term of the lth layer, Represents the set of neighbor nodes of node i;

[0103] 3) Inter-layer transfer: Each layer uses the features of neighboring nodes and the node representation of the previous layer to update until the Lth layer, and this process continues;

[0104] 4) Output layer: After the last layer of feature update, the final representation of each node is obtained

[0105] Step 3: Use the gradient descent method to iteratively train the graph neural network classification model based on invariant learning, continuously optimize the model parameters, improve the classification ability of complex social risk events, and obtain a trained graph invariant learning classification model. The specific steps are as follows:

[0106] Step 3.1, construct an overall optimization loss function based on the invariant learning method and the information bottleneck criterion to guide the model to learn the feature representation that remains stable and unchanged under different environments;

[0107] The overall optimization loss function includes invariance loss, redundancy compression loss, and prediction loss;

[0108] The overall optimization loss function is expressed as:

[0109]

[0110] in, is the cross entropy loss under region e, and is the approximate calculation term of mutual information, γ is the regularization coefficient, which is used to control the complexity of the model and prevent overfitting, η and ζ are parameters used to control information bottleneck optimization;

[0111] In step 3.2, the gradient descent optimization algorithm is used to update the model parameters θ through multiple iterations. In each iteration, the model performs forward propagation based on the current parameters θ, calculates the prediction results, and evaluates the gap between the model output and the true label through the loss function. Subsequently, backpropagation is performed to update the parameters θ according to the gradient of the loss, gradually reducing the error. As the iterations proceed, the model is continuously optimized, learns stable and invariant features in different regions and environments, and eliminates redundant information.

[0112] Step 4: Classify social risk events through graph-invariant learning classification model.

[0113] Example 2

[0114] A social risk event classification system based on graph invariant learning, comprising: a computer processor and memory, an event graph construction unit, a feature extraction and redundancy elimination unit based on invariant learning, a model training unit and a prediction result output unit;

[0115] The computer processor and memory are used to store and process information; the event graph construction unit uses a computer processor to collect event data from the social risk event monitoring system, extracts the time attributes, spatial attributes and mutual connections of the events, constructs an event graph structure and loads it into the computer memory; the feature extraction and redundancy elimination unit extracts features of events and their connections through a graph neural network, uses a graph invariant learning method to identify stable relationships between events in different regions and environments, and eliminates redundant information and irrelevant connections to ensure that the model learns true invariant relationships; the model training unit iteratively trains the model by setting a loss function to improve the accuracy of the classification model; the prediction result output unit predicts the social risk events to be classified, generates classification results, and outputs the results to the social governance system.

[0116] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A social risk event classification method based on graph invariant learning, characterized in that: The following steps are involved: Step 1: Take each event as a node and the connections between events as edges to construct a social risk event graph structure; Step 2, feature extraction based on invariant learning; Encode the graph structure, convert the information of each node and edge into a corresponding vector representation, and compress redundant features according to the information bottleneck criterion to ensure that the model captures the true invariant relationship and build a graph neural network classification model based on invariant learning; Step 3: Use the gradient descent method to iteratively train the graph neural network classification model based on invariant learning, continuously optimize the model parameters, improve the classification ability of complex social risk events, and obtain a trained graph invariant learning classification model; Step 4: Classify social risk events through graph-invariant learning classification model.

2. According to claim 1, a social risk event classification method based on graph invariant learning is characterized by: The step 1 comprises the following steps: Step 1.1, according to the requirements of risk event classification task, obtain the event data to be analyzed from the social risk event monitoring system, and extract the key attributes of the event, including the time attribute, spatial attribute and the mutual connection between the events; organize the event data into a data set denoted as T = {t i } i=1,…,N , where N is the number of events, t i Represents the i-th event record in the data set; Step 1.2: Use the K-nearest neighbor algorithm to construct the event graph structure G = (V, E, Y), where V = {v1, v2, …, v N } represents the node set of the event, each node v i represents a social risk event, N is the number of events, E represents the edge set, and Y represents the category label assigned to each event in the training set after expert judgment; Formula (1) is used to calculate the similarity between each event and other events, and the most similar event is selected as the adjacent node; Among them, t i , t j Represent two different events respectively; h ik and h jk is the event t i and t j The value on the kth feature; m represents the feature dimension of the event; d(t i ,t j ) represents event t i and t j The Euclidean distance between .

3. According to claim 1, a social risk event classification method based on graph invariant learning is characterized by: The step 2 specifically includes the following steps: Step 2.1, construct a forward conduction model of the graph neural network to encode the graph structure data; Step 2.2, use the forward conduction model of the graph neural network to extract features of risk events; Set consistent learning goals: Among them, G e represents the input image under region e; Y e represents the set of labels associated with the input graph; θ represents the model parameters; e represents a specific area, and β is a hyperparameter. represents the variance of the loss function, represents the expected value of the loss function; l represents the number of layers; f θ represents the model expressed by the parameters θ; Represents the classification result of the model for node v in the graph; V represents the true label of node v in the graph; e Represents the number of nodes in the graph structure G; Step 2.3, introduce K graph structure editors to imitate training data from different regions; increase distribution differences by maximizing the loss variance between environments; the main loss requires minimizing the loss variance, promoting the model's effective learning of invariant features and ensuring the model's predictive ability; in, Indicates the variance of the calculated loss function L under K different graph structures; Represents a graph after a specific transformation The loss function value calculated using the model parameters θ, Y is the corresponding label; Represents the average loss on all K graph structures, and the hyperparameter β is used to balance the variance term and the average loss term; Step 2.4, introduce the information bottleneck criterion to optimize the invariant learning model and eliminate redundant features; set the learning goal: Among them, Z represents the learned feature representation, I represents mutual information, and λ is a hyperparameter; Step 2.5, use variational approximation method to accurately estimate the mutual information of high-dimensional vectors; Let r(z) be an approximation of p(z), and q(y|z) be an approximation of p(y|z). Let p(z|g) be a random encoder. The optimization goal of the information bottleneck is: Step 2.6, transforming the encoder using a reparameterization operation; The encoder is in the form of Where f outputs the K-dimensional mean μ and K×K covariance matrix ∑ of z; Then, by changing the variable formula, we get q(z|g)dz=q(ε)dε, where z=f(g,ε), Therefore, the model is optimized by optimizing formula (7): in, and Where f(g) is the feature extractor, f i is a classifier, is the cross entropy loss.

4. The social risk event classification method based on graph invariant learning according to claim 3 is characterized by: The forward conduction model is described by the forward conduction process, specifically: 1) Initial input: The input of layer 0 is the initial feature vector set of the node 2) Feature update: Each node v i The features of are updated by aggregating the features of its adjacent nodes. The feature update formula of each layer is shown in formula (2): in, is the lth layer node v i is the feature representation, σ is the activation function, W (l) is the weight matrix of the lth layer, b (l) is the bias term of the lth layer, Represents the set of neighbor nodes of node i; 3) Inter-layer transfer: Each layer uses the features of neighboring nodes and the node representation of the previous layer to update until the Lth layer, and this process continues; 4) Output layer: After the last layer of feature update, the final representation of each node is obtained 5. The social risk event classification method based on graph invariant learning according to claim 1 is characterized by: The step 3 specifically includes the following steps: Step 3: Use the gradient descent method to iteratively train the model and continuously optimize the model parameters to gradually improve its classification ability for complex social risk events, and finally obtain a trained graph-invariant learning classification model; Step 3.1, construct an overall optimization loss function based on the invariant learning method and the information bottleneck criterion to guide the model to learn the feature representation that remains stable and unchanged under different environments; The overall optimization loss function includes invariance loss, redundancy compression loss, and prediction loss; The overall optimization loss function is expressed as: in, is the cross entropy loss under region e, and is the approximate calculation term of mutual information, γ is the regularization coefficient, which is used to control the complexity of the model and prevent overfitting, η and ζ are parameters used to control information bottleneck optimization; In step 3.2, the gradient descent optimization algorithm is used to update the model parameters θ through multiple iterations. In each iteration, the model performs forward propagation based on the current parameters θ, calculates the prediction results, and evaluates the gap between the model output and the true label through the loss function. Subsequently, backpropagation is performed to update the parameters θ according to the gradient of the loss, gradually reducing the error. As the iterations proceed, the model is continuously optimized, learns stable and invariant features in different regions and environments, and eliminates redundant information.

6. A social risk event classification system based on graph invariant learning, characterized by: include: Computer processor and memory, event graph construction unit, feature extraction and redundancy elimination unit based on invariant learning, model training unit and prediction result output unit; The computer processor and memory are used to store information and process information; The event graph construction unit collects event data from the social risk event monitoring system using a computer processor, extracts the time attributes, spatial attributes and their mutual connections of the events, constructs an event graph structure and loads it into the computer memory; The feature extraction and redundancy elimination unit extracts features from events and their connections through graph neural networks, uses graph invariant learning methods to identify stable relationships between events in different regions and environments, and removes redundant information and irrelevant connections to ensure that the model learns true invariant relationships. The model training unit iteratively trains the model by setting the loss function to improve the accuracy of the classification model; The prediction result output unit predicts the social risk events to be classified, generates classification results, and outputs the results to the social governance system.