Chemical engineering field accident risk prediction method and system based on AdaCost algorithm
Through the accident risk prediction method in the chemical industry based on the AdaCost algorithm, the technical problem of chemical companies being unable to provide timely early warnings during the production process has been solved, efficient prediction of fires, explosions and toxic substance leaks has been achieved, and the risk of accidents has been reduced.
Patent Information
- Application Number
- CN202510718944.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-12
AI Technical Summary
Existing technologies lack effective methods and systems to predict accident risks in the chemical industry, resulting in chemical companies being unable to provide timely warnings and take preventive measures during the production process, increasing the probability of accidents.
An accident risk prediction method in the chemical industry based on the AdaCost algorithm is adopted. By collecting and cleaning text data, screening key features, building an AdaCost model, and combining the user management module and the risk prediction module, the risk prediction of fire, explosion and toxic substance leakage is realized.
It improves the accuracy and sensitivity of chemical accident risk prediction, can timely warn of potential safety accidents, and reduce the probability of accidents.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and system for predicting accident risks in the chemical industry based on the AdaCost algorithm. Background Art
[0002] With the continuous development of my country's economy, the chemical industry will enter a critical period of transformation and development. Since most of the products produced by chemical companies are dangerous goods, which are flammable, explosive, toxic and harmful, improper transportation, storage and use of dangerous goods will have a great impact on people and the surrounding environment. The safety generation problem of chemical companies is particularly important. It is necessary to build methods and systems for predicting risks in various chemical fields, and to issue early warnings for production processes where accidents may occur based on the current production status, so that companies can pay attention and take preventive measures to reduce the probability of accidents. Summary of the Invention
[0003] The purpose of the present invention is to provide a system and method for predicting accident risks in the chemical industry.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: a method for predicting accident risks in the chemical industry based on the AdaCost algorithm, comprising the following steps:
[0005] S1. Determine the accident risk type to be predicted and collect text data of the chemical production process based on the determined risk type. The chemical accident risk types predicted by this system include: fire, explosion, and toxic substance leakage;
[0006] S2. Obtain descriptions of chemical accident processes related to fires, explosions, and toxic substance leaks, as well as safety production process descriptions, from the internet. Clean the text data and convert the cleaned data into JSON format.
[0007] S3. By reviewing relevant chemical accident statistics literature and based on hazard source theory (e.g., accidental energy release model) and accident causation theory (e.g., Swiss cheese model), we quantitatively screened 21 key features (e.g., ambient pressure, ambient temperature) from the dimensions of equipment, environment, and management through Pearson correlation analysis, random forest feature importance assessment, and recursive feature elimination. Cross-validation and SHAP values were used to verify the technical interpretability and predictive stability.
[0008] S4. Perform data annotation and preprocessing on the processed chemical accident text to form a data set that can be used for risk prediction of fire, explosion, and toxic substance leakage accidents. The data set is then exported for subsequent model training.
[0009] S5. According to the characteristics of the data set and the field of chemical accidents, a suitable prediction model is selected. This system uses the cost-sensitive AdaCost model and uses the constructed data set to train the prediction model.
[0010] Furthermore, the specific implementation process of step S2 is: using Python's Scrapy framework to crawl text data on chemical websites related to fires, explosions, toxic substance leaks and safe production in chemical production processes; using string matching and deletion methods to clean the text data; and saving the cleaned text in JSON format.
[0011] Furthermore, step S3 is specifically implemented by consulting relevant chemical accident statistics to identify fourteen major accident causes, including violations of procedures or labor discipline, equipment defects, lack of on-site inspections, lack of understanding of operating techniques, poor organization, poor access, lack of technical knowledge, inadequate safety regulations and rules, operational errors, command errors, lack of safety operating regulations and rules, insufficient lighting, signal defects, and lack of safety technical knowledge. Based on this, combined with hazard source theory and accident causation theory, an initial feature pool is established from the four dimensions of equipment, environment, management, and operation. Using actual accident data, redundant features were gradually eliminated through Pearson correlation analysis (screening for significant features with p < 0.01), a random forest algorithm (ranking feature importance by the Gini index), and recursive feature elimination (RFE). Twenty-one key features were quantitatively selected: ambient pressure, ambient temperature, integrity of the supervision system, robustness of the emergency response mechanism, comprehensiveness of production regulations and rules, formality of work organization, division of personnel responsibilities, degree of safety management system integrity, toxicity of reactants, explosiveness of reactants, flammability of reactants, violation of hazardous chemical management regulations, degree of safety education and training, illegal operation, presence of cooling devices, presence of temperature measurement devices, equipment status, equipment design defects, toxicity of products, flammability of products, and explosiveness of products. Data types were nominal or numerical. Finally, the predictive stability of the feature combination was evaluated through 5-fold cross-validation, and SHAP value analysis was used to verify the physical interpretability of the features to the model output (e.g., "frequency of illegal operation" was positively correlated with accident probability), ensuring the technical objectivity and practical application value of the feature selection.
[0012] Furthermore, step S4 is specifically implemented as follows: Scoring criteria are assigned to some of the 21 key features of the chemical accident risk dataset developed in S3, such as the degree of safety management system integrity, and the text data is annotated. The annotated data is exported and preprocessed: one-hot encoding is used for the nominal features. Because the scales of the features in the dataset vary, the dataset is normalized using a Z-score to prevent the scale and unit of measurement between features from affecting the model results.
[0013] Furthermore, the specific implementation process of step S5 is as follows: the AdaCost algorithm is improved on the basis of the AdaBoost algorithm, and takes into account the cost of misclassification of different samples when processing the classification problem.
[0014] Furthermore, the AdaCost algorithm assigns a misclassification cost factor c to each training sample. i , and add the cost factor into the classification learning process; secondly, the cost adjustment function β(sign(y i C k (x i )),c i ) is added to the weight adjustment formula, abbreviated as β(i), to adjust the weight; if the misclassification cost of the sample is high, if it is misclassified in the classification, the new weight obtained after the weight adjustment will increase more than the original weight; if it is correctly classified, the new weight will decrease more than the original weight; the weight adjustment formula is: where w k+1 (i) and w k (i) represents the sample x in the k+1th and kth rounds of training respectively. i The weight of Z k is the normalization factor, the purpose of which is to ensure that the sum of the weights is 1, and its calculation formula is: k =∑ i w k (i)exp(-a k C k (x i )y i );a k is the coefficient of the weak classifier, and its calculation formula is: If e k Small (good classification effect), at this time a k will be larger, the weak classifier will account for a higher proportion in the final vote. k Close to 0.5, at this time a k Approaching 0, the weak classifier is weakened; e k is the classification error, which reflects the classification performance of the weak classifier under the current weight. Its calculation formula is: is an indicator function, which is 1 if the classification is wrong, otherwise it is 0; C k (x) is the weight w k The training set is used to train the weak classifier, and the weak classifier C is obtained. k (x), C k (x) represents the predicted value of the kth weak classifier for sample x, which usually outputs +1 (positive class) or -1 (negative class). Multiple weak classifiers are trained to build a strong classifier. The final strong classifier construction formula is: The prediction results of all weak classifiers C k (x) and its a k The weights are multiplied and summed to obtain a weighted score, and the final classification is determined based on whether the weighted score is positive or negative.
[0015] On the other hand, the present invention provides a chemical industry accident risk prediction system based on the AdaCost algorithm:
[0016] It includes registration and login module, risk prediction module and user management module.
[0017] The registration and login module is provided with a login function and a registration function.
[0018] The risk prediction module has the following functions: registration and login function, which is mainly responsible for user registration, login and logout functions; data set management function, which is mainly responsible for managing data used to train risk prediction models. These data are characteristic data of toxic substance leakage, fire or explosion. Users can import, batch delete or export data to provide sufficient learning samples for the risk prediction model, thereby improving the accuracy of the prediction; fire risk prediction function, which mainly predicts fire risks. It evaluates the possibility of fire by analyzing data such as the characteristics of the material, the operating status of fire-fighting facilities and environmental factors. After the user enters the data required by the front-end page, the system will read the data and load the model for risk prediction, and finally return the results to the user through the front-end page; the explosion risk prediction function mainly focuses on predicting possible explosion incidents. It monitors the operating status of the equipment, gas concentration and other key parameters, combines historical data and model analysis to evaluate the size of the explosion risk; the toxic substance leakage risk prediction function mainly predicts possible toxic substance leakage incidents. It evaluates the possibility of toxic substance leakage by analyzing data such as the operating status of the equipment, storage conditions of the material and environmental factors; the historical record prediction record management function allows users to manage past risk prediction records and historical events. By viewing past prediction results and actual risk events, users can understand the accuracy and reliability of the risk prediction model and provide reference and reference for future risk predictions.
[0019] The user management module is provided with a user management function, which is mainly responsible for modifying the user's password. The user is required to correctly verify the old password before the password can be modified, ensuring that only the user himself can change the password of his account.
[0020] The present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. The processor executes the computer program to implement the chemical industry accident risk prediction method based on the AdaCost algorithm.
[0021] The present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for predicting accident risks in the chemical industry based on the AdaCost algorithm is implemented.
[0022] Beneficial effects of this invention: Based on an analysis of various chemical accident causes, including human, environmental, and equipment factors, this paper summarizes the main causes of chemical accidents and constructs a chemical accident dataset. This paper uses the cost-sensitive AdaCost and Decision Tree algorithms to predict chemical accident risks and identify potential safety incident risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 The present invention provides a flow chart of the steps of the accident risk prediction method in the chemical industry based on the AdaCost algorithm.
[0024] Figure 2 It is the AdaCost model diagram used in the present invention.
[0025] Figure 3 It is a system function module diagram of the present invention.
[0026] Figure 4 It is a schematic diagram of the system login page of the present invention.
[0027] Figure 5 It is a schematic diagram of the system home page of the present invention.
[0028] Figure 6 This is a schematic diagram of the dataset management page of the risk prediction module.
[0029] Figure 7 This is a schematic diagram of the fire risk prediction page of the risk prediction module.
[0030] Figure 8 This is a schematic diagram of the fire risk prediction result page.
[0031] Figure 9 Schematic diagram of the explosion risk prediction page of the risk prediction module.
[0032] Figure 10 This is a schematic diagram of the explosion risk prediction result page.
[0033] Figure 11 Schematic diagram of the toxic substance leakage risk prediction page of the risk prediction module.
[0034] Figure 12 This is a schematic diagram of the prediction result page for toxic substance leakage risk.
[0035] Figure 13 This is a schematic diagram of the historical prediction record management page of the risk prediction module.
[0036] Figure 14 This is a schematic diagram of the password change page of the user management module. DETAILED DESCRIPTION
[0037] The present invention will be further described below with reference to the accompanying drawings. It should be noted that the description of these drawings is for helping to understand the present invention, but does not constitute a limitation of the present invention.
[0038] Specifically, according to Figure 1 As shown, the chemical industry accident risk prediction method and system based on the AdaCost algorithm includes the following steps:
[0039] S1. Determine the accident risk type to be predicted and collect text data of the chemical production process based on the determined risk type. The chemical accident risk types predicted by this system include: fire, explosion, and toxic substance leakage;
[0040] S2. Obtain descriptions of chemical accident processes related to fires, explosions, and toxic substance leaks, as well as safety production process descriptions, from the internet. Cleanse the text data and convert the cleaned data into JSON format.
[0041] S3. By reviewing relevant chemical accident statistics literature and based on hazard source theory (e.g., accidental energy release model) and accident causation theory (e.g., Swiss cheese model), we quantitatively screened 21 key features (e.g., ambient pressure, ambient temperature) from the dimensions of equipment, environment, and management through Pearson correlation analysis, random forest feature importance assessment, and recursive feature elimination. Cross-validation and SHAP values were used to verify the technical interpretability and predictive stability.
[0042] S4. Perform data annotation and preprocessing on the processed chemical accident text to form a data set that can be used for risk prediction of fire, explosion, and toxic substance leakage accidents. The data set is then exported for subsequent model training.
[0043] S5. According to the characteristics of the data set and the field of chemical accidents, a suitable prediction model is selected. This system uses the cost-sensitive AdaCost model and uses the constructed data set to train the prediction model.
[0044] Furthermore, the specific implementation process of step S2 is: using Python's Scrapy framework to crawl text data on chemical websites related to fires, explosions, toxic substance leaks and safe production in chemical production processes; using string matching and deletion methods to clean the text data; and saving the cleaned text in JSON format.
[0045] Furthermore, step S3 is specifically implemented by consulting relevant chemical accident statistics to identify fourteen major accident causes, including violations of procedures or labor discipline, equipment defects, lack of on-site inspections, lack of understanding of operating techniques, poor organization, poor access, lack of technical knowledge, inadequate safety regulations and rules, operational errors, command errors, lack of safety operating regulations and rules, insufficient lighting, signal defects, and lack of safety technical knowledge. Based on this, combined with hazard source theory and accident causation theory, an initial feature pool is established from the four dimensions of equipment, environment, management, and operation. Using actual accident data, redundant features were gradually eliminated through Pearson correlation analysis (screening for significant features with p < 0.01), a random forest algorithm (ranking feature importance by the Gini index), and recursive feature elimination (RFE). Twenty-one key features were quantitatively selected: ambient pressure, ambient temperature, integrity of the supervision system, robustness of the emergency response mechanism, comprehensiveness of production regulations and rules, formality of work organization, division of personnel responsibilities, degree of safety management system integrity, toxicity of reactants, explosiveness of reactants, flammability of reactants, violation of hazardous chemical management regulations, degree of safety education and training, illegal operation, presence of cooling devices, presence of temperature measurement devices, equipment status, equipment design defects, toxicity of products, flammability of products, and explosiveness of products. Data types were nominal or numerical. Finally, the predictive stability of the feature combination was evaluated through 5-fold cross-validation, and SHAP value analysis was used to verify the physical interpretability of the features to the model output (e.g., "frequency of illegal operation" was positively correlated with accident probability), ensuring the technical objectivity and practical application value of the feature selection.
[0046] Furthermore, the specific implementation process of step S4 is as follows: specify scoring criteria for some numerical features of the 21 key features of the chemical accident risk data set formulated in S3, such as the degree of perfection of the safety management system, and annotate the text data. The annotated data results are exported for preprocessing: One-Hot coding is used for nominal features, for example, "whether it is a high-pressure environment", "whether it is high-temperature weather", "whether the work organization is formal", etc., all use One-Hot coding. Since the scales of the various numerical features in the data set are different, the data set is normalized using Z-score. For example, features such as "degree of perfection of the safety management system" and "illegal operation" are numerical type features and need Z-score normalization to avoid the scale and measurement unit between features from affecting the model results.
[0047] Furthermore, the specific implementation process of step S5 is as follows: The AdaCost algorithm is an improvement on the AdaBoost algorithm, which takes into account the cost of misclassifying different samples when dealing with classification problems. It is currently commonly used in fields such as medical diagnosis and financial fraud detection. These fields share a characteristic: the cost of different classification errors varies. In the chemical industry, the cost of predicting accident samples as normal samples is far greater than the cost of predicting normal samples as accident samples. Therefore, this paper selects the AdaCost algorithm for chemical accident risk prediction.
[0048] Specifically, according to Figure 2 As shown, the AdaCost model training process is as follows: The AdaCost algorithm assigns a misclassification cost factor c to each training sample i , and add the cost factor into the classification learning process.
[0049] Secondly, the cost adjustment function β(sign(y i C k (x i )),c i ) is added to the weight adjustment formula, abbreviated as β(i), to adjust the weight; if the misclassification cost of the sample is high, if it is misclassified in the classification, the new weight obtained after the weight adjustment will increase more than the original weight; if it is correctly classified, the new weight will decrease more than the original weight; the weight adjustment formula is: where w k+1 (i) and w k (i) represents the sample x in the k+1th and kth rounds of training respectively. i The weight of Z k is the normalization factor, the purpose of which is to ensure that the sum of the weights is 1, and its calculation formula is: k =∑ i w k(i)exp(-a k C k (x i )y i );a k is the coefficient of the weak classifier, and its calculation formula is: If e k Small (good classification effect), at this time a k will be larger, the weak classifier will account for a higher proportion in the final vote. k Close to 0.5, at this time a k Approaching 0, the weak classifier is weakened; e k is the classification error, which reflects the classification performance of the weak classifier under the current weight. Its calculation formula is: is an indicator function, which is 1 if the classification is wrong, otherwise it is 0; C k (x) is the weight w k The training set is used to train the weak classifier, and the weak classifier C is obtained. k (x), C k (x) represents the predicted value of the kth weak classifier for sample x, which usually outputs +1 (positive class) or -1 (negative class). Multiple weak classifiers are trained to build a strong classifier. The final strong classifier construction formula is: The prediction results of all weak classifiers C k (x) and its a k The weights are multiplied and summed to obtain a weighted score, and the final classification is determined based on whether the weighted score is positive or negative.
[0050] On the other hand, according to Figure 3 As shown, the chemical industry accident risk prediction system based on the AdaCost algorithm provided by the present invention includes the following main related modules and specific implementations:
[0051] The system in the present invention mainly includes a user registration and login module, a risk prediction module, and a user management module.
[0052] The user registration and login module includes user registration and login, and the system homepage. The system login page is as follows Figure 4 As shown, after the user opens the system, registers and correctly fills in the user name, password and verification code and clicks "Login" to enter the system. After entering the system, you can see the homepage content. The system homepage is as follows Figure 5 As shown, the homepage displays charts and numbers showing the number of named entity recognition training data items and risk prediction training data items currently entered into the system, as well as the number of times these two features have been used. The charts are presented as time series, allowing users to intuitively understand the development trends of chemical accidents. On the right side of the homepage, a pie chart illustrates the main factors leading to chemical accidents.
[0053] The risk prediction module is the core module, which mainly includes data set management functions, risk prediction functions for fire, explosion, and toxic substance leakage, and historical prediction record management functions.
[0054] The dataset management function is mainly responsible for managing the data used to train the risk prediction model. These data are characteristic data of toxic substance leakage, fire or explosion. The dataset management function implementation page is as follows: Figure 6 As shown, users can import, delete or export data in batches, which provides sufficient learning samples for the risk prediction model and thus improves the accuracy of the prediction.
[0055] The fire risk prediction function mainly predicts fire risks. It evaluates the possibility of fire by analyzing data such as the characteristics of materials, the operating status of fire protection facilities, and environmental factors. The fire risk prediction function implementation page is as follows Figure 7 As shown, after the user enters the data required by the front-end page, the system will read the data and load the model to perform risk prediction, and finally return the results to the user through the front-end page. The prediction results returned by the system are as follows Figure 8 shown.
[0056] The explosion risk prediction function focuses on predicting possible explosion events. It evaluates the size of the explosion risk by monitoring the operating status of the equipment, gas concentration and other key parameters, combining historical data and model analysis. Figure 9 As shown, the prediction results returned by the system are as follows Figure 10 shown.
[0057] The toxic substance leakage risk prediction function is mainly used to predict possible toxic substance leakage incidents. It evaluates the possibility of toxic substance leakage by analyzing data such as the operating status of the equipment, the storage conditions of the substances, and environmental factors. The toxic substance leakage risk prediction function implementation page is as follows: Figure 11 As shown, after submission, the prediction results returned by the system are as follows Figure 12 shown.
[0058] The historical prediction record management function allows users to manage past risk prediction records and historical events. The historical prediction record management function implementation page is as follows Figure 13 As shown, by reviewing past prediction results and actual risk events, users can understand the accuracy and reliability of the risk prediction model and provide reference and reference for future risk prediction.
[0059] The test results of the risk prediction module function are shown in Table 1.
[0060] Table 1 Risk prediction function test cases
[0061]
[0062] The main function of the user management module is to modify the user password, such as Figure 14 As shown, users are required to correctly verify their old passwords before they can change their passwords, ensuring that only users themselves can change their account passwords.
[0063] The specific application experiment execution process of obtaining relevant data using the technical solution of the present invention is as follows:
[0064] The present invention compares the effects of AdaBoost+Logistic, AdaCost+Logistic and AdaCost+DecisionTree. The experimental results are shown in Table 2.
[0065] Table 2 Comparison experimental results between AdaBoost and AdaCost
[0066]
[0067] According to the experimental results, AdaCost is more effective than AdaBoost in the accident risk prediction task of the present invention. Among the three combinations, the combination of AdaCost+DecisionTree achieved the highest performance. Although AdaBoost+Logistic and AdaCost+Logistic both showed good performance. But when AdaCost is used in combination with DecisionTree, its accuracy rate reached 97.11%, the recall rate was 98.30%, and the F1 value was 97.70%. This result shows that AdaCost+DecisionTree not only outperforms the other two models in overall accuracy, but also has a significant improvement in recall rate, which is crucial for tasks such as accident risk prediction that are sensitive to a small number of events. The F1 value, as the harmonic mean of accuracy and recall rate, comprehensively reflects the overall performance of the model. The F1 value of AdaCost+DecisionTree is also the highest among the three.
[0068] Therefore, the present invention selects the AdaCost+Decision Tree model as the prediction model of the risk prediction module. This combination not only provides higher prediction accuracy, but also has better sensitivity for predicting potential high-risk events, which helps to achieve more effective accident risk prediction.
Claims
1. A chemical industry accident risk prediction method based on the AdaCost algorithm, characterized by: The following steps are involved: S1. Determine the accident risk type to be predicted and collect text data of the chemical production process based on the determined risk type. The chemical accident risk types predicted by this system include: fire, explosion, and toxic substance leakage; S2. Obtain descriptions of chemical accident processes related to fires, explosions, and toxic substance leaks, as well as safety production process descriptions, from the internet. Clean the text data and convert the cleaned data into JSON format. S3. By reviewing relevant chemical accident statistics literature and based on hazard source theory and accident causation theory, we quantitatively screened 21 key features from the dimensions of equipment, environment, and management through Pearson correlation analysis, random forest feature importance assessment, and recursive feature elimination. Cross-validation and SHAP values were used to verify the technical interpretability and predictive stability. S4. Perform data annotation and preprocessing on the processed chemical accident text to form a data set that can be used for risk prediction of fire, explosion, and toxic substance leakage accidents. The data set is then exported for subsequent model training. S5. Based on the characteristics of the data set and the field of chemical accidents, the cost-sensitive AdaCost model is selected as the prediction model, and the data set constructed in S4 is used to train the prediction model.
2. The chemical industry accident risk prediction method based on the AdaCost algorithm according to claim 1, characterized in that: The specific implementation process of step S2 is: using Python's Scrapy framework to crawl text data on chemical websites related to fires, explosions, toxic substance leaks, and safe production in chemical production processes; using string matching and deletion methods to clean the text data; and saving the cleaned text in JSON format.
3. The chemical industry accident risk prediction method based on the AdaCost algorithm according to claim 1, characterized in that: The specific implementation process of step S3 is as follows: by consulting relevant chemical accident statistical literature, fourteen major accident causes are statistically analyzed, including violation of regulations or labor discipline, equipment defects, lack of on-site inspection, lack of understanding of operating techniques, unreasonable organization, poor access, lack of technical knowledge, incomplete safety regulations and systems, operating errors, command errors, lack of safety operating regulations and systems, insufficient lighting, signal defects, and lack of safety technical knowledge; on this basis, combining hazard source theory and accident causation theory, an initial feature pool is established from the four dimensions of equipment, environment, management, and operation; Using actual accident data, Pearson correlation analysis was performed to screen for significant features with p < 0.
01. A random forest algorithm was used to rank feature importance according to the Gini index, and recursive feature elimination (RFE) was used to gradually eliminate redundant features. Twenty-one key features were quantitatively selected: ambient pressure, ambient temperature, integrity of the supervision system, robustness of the emergency response mechanism, comprehensiveness of production regulations and rules, formality of work organization, division of personnel responsibilities, degree of perfection of the safety management system, toxicity of reactants, explosiveness of reactants, flammability of reactants, violation of hazardous chemical management regulations, degree of safety education and training, illegal operation, presence of cooling devices, presence of temperature measurement devices, equipment status, equipment design defects, toxicity of products, flammability of products, and explosiveness of products. Data types were either nominal or numerical. Finally, 5-fold cross-validation was used to assess the predictive stability of the feature combination, and SHAP value analysis was used to verify the physical interpretability of the features to the model output, ensuring the technical objectivity and practical application value of the feature selection.
4. The chemical industry accident risk prediction method based on the AdaCost algorithm according to claim 1, characterized in that: The specific implementation process of step S4 is as follows: specifying scoring criteria for some numerical features of the 21 key features of the chemical accident risk data set developed in S3, such as the degree of perfection of the safety management system, and annotating the text data; exporting the annotated data results for preprocessing: One-Hot encoding is used for the nominal features, and since the scales of the various features in the data set are different, the Z-score is used to normalize the data set to avoid the impact of inconsistent scales and measurement units between features on the model results.
5. The chemical industry accident risk prediction method based on the AdaCost algorithm according to claim 1, characterized in that: The specific implementation process of step S5 is as follows: the AdaCost algorithm is improved on the basis of the AdaBoost algorithm, and takes into account the cost of misclassification of different samples when processing classification problems.
6. The chemical industry accident risk prediction method based on the AdaCost algorithm according to claim 5, characterized in that: The AdaCost algorithm training process is as follows: each training sample is assigned a misclassification cost factor c i , and add the cost factor into the classification learning process; secondly, the cost adjustment function β(sign(y i C k (x i )),c i ) is added to the weight adjustment formula, abbreviated as β(i), to adjust the weight; If the cost of misclassification of a sample is high, if it is misclassified in the classification, the new weight obtained after weight adjustment will be much larger than the original weight; if it is correctly classified, the new weight will be much smaller than the original weight; The weight adjustment formula is: where w k+1 (i) and w k (i) represents the sample x in the k+1th and kth rounds of training respectively. i The weight of Z k is the normalization factor, the purpose of which is to ensure that the sum of the weights is 1, and its calculation formula is: k = ∑ i w k (i)exp(-a k C k (x i )y i );a k is the coefficient of the weak classifier, and its calculation formula is: If e k Small (good classification effect), at this time a k will be larger, the weak classifier will account for a higher proportion in the final vote. k Close to 0.5, at this time a k Approaching 0, the weak classifier is weakened; e k is the classification error, which reflects the classification performance of the weak classifier under the current weight. Its calculation formula is: L(C k (x i )≠y i ) is an indicator function, which is 1 if the classification is wrong, otherwise it is 0; C k (x) is the weight w k The training set is used to train the weak classifier, and the weak classifier C is obtained. k (x), C k (x) represents the predicted value of the kth weak classifier for sample x, which usually outputs +1 (positive class) or -1 (negative class). Multiple weak classifiers are trained to build a strong classifier. The final strong classifier construction formula is: The prediction results of all weak classifiers C k (x) and its a k The weights are multiplied and summed to obtain a weighted score, and the final classification is determined based on whether the weighted score is positive or negative.
7. The chemical industry accident risk prediction system based on the AdaCost algorithm according to any one of claims 1 to 6, characterized in that: It includes registration and login module, risk prediction module and user management module. The registration and login module is provided with a login function and a registration function. The risk prediction module has the following functions: registration and login function, which is mainly responsible for user registration, login and logout functions; data set management function, which is mainly responsible for managing the data used to train the risk prediction model. These data are characteristic data of toxic substance leakage, fire or explosion. Users can import, delete or export data in batches to provide sufficient learning samples for the risk prediction model, thereby improving the accuracy of the prediction; fire risk prediction function, which mainly predicts fire risks. It evaluates the possibility of fire by analyzing data such as the characteristics of the material, the operating status of the fire protection facilities and environmental factors. After the user enters the data required by the front-end page, the system will read the data and load the model for risk prediction, and finally return the results through the front-end page. Users; The explosion risk prediction function mainly focuses on predicting possible explosion incidents. It evaluates the size of the explosion risk by monitoring the operating status of the equipment, gas concentration and other key parameters, combining historical data and model analysis; The toxic substance leakage risk prediction function mainly predicts possible toxic substance leakage incidents. It evaluates the possibility of toxic substance leakage by analyzing data such as the operating status of the equipment, the storage conditions of the material and environmental factors; The historical record prediction record management function allows users to manage past risk prediction records and historical events. By viewing past prediction results and actual risk events, users can understand the accuracy and reliability of the risk prediction model and provide reference and reference for future risk predictions. The user management module is provided with a user management function, which is mainly responsible for modifying the user's password. The user is required to correctly verify the old password before the password can be modified, ensuring that only the user himself can change the password of his account.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the chemical industry accident risk prediction method based on the AdaCost algorithm as described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for predicting accident risks in the chemical industry based on the AdaCost algorithm as described in any one of claims 1 to 6 is implemented.