Organic compound toxicity prediction method based on particle swarm optimization and ensemble learning
By combining particle swarm algorithms and integrated learning methods, toxicity prediction of organic compounds is solved, and the problem of insufficient reliance on animal experiments and model weight optimization in the prior art is solved, and toxicity prediction and environmental risk assessment with high accuracy are achieved.
Patent Information
- Application Number
- CN202411662346.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art relies on animal experiments in the evaluation of chemical toxicity, has high resource consumption and prominent ethical problems, and the particle swarm algorithm is insufficient in model weight optimization, resulting in low accuracy in predicting toxicity of organic compounds.
Using an organic compound toxicity prediction method based on particle swarm algorithm and integrated learning, volatile organic compounds are integrated and pretreated through the acquisition module and the integration module, combined with four machine learning algorithms and four molecular representation schemes, 16 classifiers are built, and the weight is adjusted through the particle swarm algorithm to construct an integrated model for toxicity prediction.
It improves the accuracy and accuracy of toxicity prediction of organic compounds, reduces dependence on animal experiments, and realizes rapid assessment and management of environmental risks of chemicals.
Smart Images

Figure CN119517233A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of organic compound toxicity prediction, and in particular to an organic compound toxicity prediction method based on particle swarm algorithm and ensemble learning. Background Art
[0002] With the advancement of industrialization and urbanization, the amount of chemical substances in the environment has increased dramatically, causing serious pollution to water bodies, soil and other ecosystems, and also posing a potential threat to human health. Traditional chemical toxicity assessment, especially those that rely on animal experiments, not only consumes a lot of resources, but also faces many challenges in timeliness and ethical considerations. International organizations such as the OECD actively advocate innovation in chemical assessment and promote the development and application of alternative experimental methods to reduce reliance on animal experiments.
[0003] The Chinese patent publication number CN103714211A discloses an integrated circuit layout method based on pattern shift sequence and multi-agent particle swarm, which belongs to the field of physical design layout planning technology. The present invention uses pattern shift sequence as a coding method, combines multi-agent system with particle swarm algorithm, and is used to solve the integrated circuit layout problem. First, each agent in the agent grid is initialized according to the random generation method, and then a pattern shift sequence is designed to encode each agent. Finally, a neighborhood competition operator, a particle swarm algorithm, and a self-learning operator are designed to optimize the agent.
[0004] The above technical solution has advantages in evaluating an important aspect of the effectiveness of the method for solving the integrated circuit layout problem: finding the area of the minimum rectangular envelope. It is an effective method for solving the integrated circuit layout problem and can also be extended to solving multi-objective integrated circuit layout problems. However, the introduction of the particle swarm algorithm (PSO) without optimizing the weights of the model will lead to reduced prediction accuracy, especially the failure to provide strong technical support for the rapid assessment and management of chemical environmental risks. When detecting toxic organic chemical compounds, some organic compounds are volatilized, resulting in a gap between the predicted toxicity data and the toxicity data obtained by the model, which in turn leads to poor accuracy of the toxicity data detected later.
[0005] Therefore, a new method for predicting the toxicity of organic compounds based on particle swarm optimization and ensemble learning is proposed to solve the above problems. Summary of the invention
[0006] The main purpose of the present invention is to provide an organic compound toxicity prediction method based on particle swarm optimization and ensemble learning to solve the problems raised in the above background.
[0007] To achieve the above object, the technical solution adopted by the present invention is: a method for predicting the toxicity of organic compounds based on particle swarm optimization and ensemble learning, the method comprising the following implementation steps:
[0008] Step 1: Using the combination of the collection module and the integration module, organic compounds are collected from the ECOTOX aquatic toxicity database and placed in a container, and the volatile organic compounds are integrated using the integration module, and after integration, they are mixed with the original non-volatile compounds;
[0009] Step 2: Enter the preprocessing module and preprocess the toxic organic compound molecules through Python scripts. The obtained data set is divided into training set, validation set and test set according to 7:1.5:1.5;
[0010] Step 3: Enter the model basic classification number construction module, obtain 16 classifiers through four machine learning algorithms and four molecular representation schemes, and select the first four classifiers as basic classifiers to build an integrated model;
[0011] Step 4: Enter the prediction module, retrain the first four classifiers obtained using their optimal hyperparameters on the entire training set, develop an integrated model, and each classifier acts as a base classifier. For data point processing, the toxicity of organic compounds is predicted by combining particle swarm optimization and ensemble learning;
[0012] Step 5: Enter the training and verification module, fine-tune the optimal hyperparameters on the training set to retrain the four classifiers, use the particle swarm algorithm (PSO) to adjust the weights on the verification set, input the tested aquatic organism toxicity data into the constructed organic compound toxicity prediction model, perform model training and verify the model performance.
[0013] The integration module includes a monitoring module, a collection module and a compound integration;
[0014] The monitoring module includes a real-time detection unit and an auxiliary tracking unit;
[0015] The real-time detection unit uses a photoionization detector and a gas chromatography-mass spectrometer to detect the toxic volatilization of the current organic compound in real time, and transmits the toxic volatilization data through wireless sensing;
[0016] The auxiliary tracking unit is used to detect the volatilized organic compound gas in real time through the gas detection sensor and the data recorder, and to record the detected gas in real time for later planning of the collection and treatment of the volatilized gas.
[0017] The collection module includes a liquefaction molding unit and a vibration sliding unit;
[0018] The collecting module is used to receive the signal transmitted by the monitoring module, and cool the container through the liquefaction molding unit to cool and liquefy the toxic organic compound gas to form water droplets;
[0019] The vibration sliding unit uses a vibration auxiliary device to slightly vibrate the upper end of the container, so that the water droplets of the toxic compound after cooling and liquefaction fall into the original non-volatile compound.
[0020] The compound integration includes a uniform mixing unit and a real-time start-stop unit;
[0021] The uniform mixing unit uses a mixing and stirring mechanism to uniformly mix the toxic organic compounds again;
[0022] The real-time start-stop unit uses a PLC system through a programmable logic controller to control the operating state of the uniform mixing unit in real time, thereby realizing automatic start-stop of the uniform mixing unit.
[0023] The preprocessing module includes a preprocessing unit, which preprocesses molecules through Python scripts, including: removing salts, removing inorganic compounds, removing isomers, using standard SMILES to represent molecules, and merging records of the same molecule after standardization. The obtained data set is divided into a training set, a validation set, and a test set, and features are extracted from the training set, validation set, and test set through a feature extraction module to obtain training set features, validation set features, and test set features.
[0024] The model basic classification number construction module includes a feature receiving module, a machine algorithm module and a basic classifier module;
[0025] The feature receiving module is used to receive training set features, validation set features and test set features, and uses the molecular access control system (MACCS) key, extended connection fingerprint (ECFP6), functional connection fingerprint (FCFP) and molecular structure-based fingerprint system, and then calculates all molecular fingerprints through an open source molecular informatics toolkit to complete the mathematical description of the toxic chemical molecular structure.
[0026] The machine algorithm module uses support vector machine (SVM), random forest (RF), K nearest neighbor (KNN) and extreme gradient boosting to select the optimal hyperparameters. The specific steps are as follows:
[0027] Step (i): The support vector machine (SVM) selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in the support vector machine (SVM);
[0028] Step (ii): Random Forest (RF) selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in Random Forest (RF);
[0029] Step (iii): KNN selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in KNN;
[0030] Step (iv): Extreme gradient boosting selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in extreme gradient boosting;
[0031] The basic classifier module obtains 16 classifiers by combining the four machine learning algorithms and the four molecules one by one.
[0032] The basic classifier module includes a time selection unit and a sequence selection unit;
[0033] The time selection unit allocates a running time slice to each classifier according to a preset time series scheduling algorithm and dynamically adjusts according to the classifier processing speed;
[0034] The sequential selection unit starts the classifiers in sequence according to the order of the time series during the time slice allocation process, and each classifier completes a specific calculation within its allocated time slice;
[0035] The time selection unit and the sequence selection unit mark specific calculation times in the 16 classifiers, and then select four classifiers with shorter specific calculation times from the 16 classifiers as the first four classifiers, and use the best four classifiers as basic classifiers.
[0036] The prediction module uses the integrated model probability value data obtained by combining the machine learning algorithm and the particle swarm algorithm in the integrated model to sort out the data and then make toxicity predictions;
[0037] Step (1): After the integrated model is constructed, the first four classifiers are selected, each of which acts as a basic classifier. For each data point, the predicted probability values returned by the four basic classifiers are continuously multiplied by the weight number to obtain the probability value of the integrated model. The formula is as follows:
[0038] P 整 =w1p1+w2p2+w3p3+w4p4;
[0039] Among them, P整 is the probability value of the integrated model; w1, w2, w3, w4 are the weight numbers of the four basic classifiers; p1, p2, p3, p4 are the probability values predicted by the four basic classifiers;
[0040] Step (2): Use the particle swarm algorithm (PSO) to adjust the weights on the validation set. Use the particle swarm algorithm (PSO) to optimize w1, w2, w3, and w4 on the validation set. The speed is determined by the best position found by the entire group, which is called the global best position (G best ) and one's own best position is called the personal best position (P best ) Specifically, the velocity (v) of a particle is defined as:
[0041] v i =W×v i +c1r1(P best,i -x i )+c2r2(G best -x i );
[0042] x i =x i +v i ;
[0043] Among them, v i and x i is the update speed of i and the position of the i-th particle; r1 and r2 are random numbers between 0 and 1, c1 and c2 are acceleration coefficients; W is the inertial weight;
[0044] Step (3): Based on step (1), the predicted probability values returned from the four basic classifiers are continuously multiplied by the weight numbers and then added to obtain the probability value of the integrated model. Based on step (2), the weights are adjusted using the particle swarm algorithm (PSO). Since r1 and r2 are random numbers between 0 and 1, 100 values are taken between 0 and 1, and the obtained values are arranged in order of size. The 100 values are substituted into the particle swarm algorithm (PSO) calculation formula in turn to obtain 100 weight values and arrange them in order of size. Repeat the particle swarm algorithm (PSO) calculation to obtain the optimal range value within the 100 weight values in the particle swarm algorithm (PSO). The optimal weight range value is substituted into the formula in step (1) to obtain the optimal probability value range of the integrated model. The optimal probability value range is represented by Q, which is the toxicity prediction data range.
[0045] The training verification module compares the toxicity data obtained from the training verification with the predicted toxicity data to verify the performance of the model basic classification number construction module. The verification steps are as follows:
[0046] Step 1: Retrain the four classifiers on the training set using the best hyperparameters fine-tuned in the 5-fold cross validation.
[0047] Step 2: Use the particle swarm algorithm (PSO) to adjust the weights on the validation set, set the particle swarm size to 100, and repeat the number of times to 10;
[0048] Step 3: Evaluate the model on the test set. The mathematical formula of the evaluation index is as follows:
[0049]
[0050] Among them, MCC stands for Matthews correlation coefficient, BA stands for balanced accuracy, SP stands for sensitivity, RE stands for specificity, TP, FP, TN and FN are true positive, false positive, true negative and false negative values respectively;
[0051] Step 4: Based on step 3, the mathematical formula of the evaluation index is used to obtain the value range of MCC in [-1, 1], where 1 represents perfect classification, -1 represents completely wrong classification, and 0 represents random guessing. The optimal probability value range is represented by Q. When -1≤Q<0, it means that the performance of the integrated model is unstable, that is, the compound toxicity data obtained by the integrated model is inaccurate. When [-1,0)<Q<[0,1], it means that the integrated model is asymptotically stable. When 0<Q≤1, it means that the performance of the integrated model is stable, that is, the compound toxicity data obtained by the integrated model is accurate.
[0052] The present invention has the following beneficial effects:
[0053] 1. In the present invention, by setting up a collection module and an integration module, the volatilization of toxic organic compounds is detected in real time through a data receiver and a data recorder. The liquefaction molding unit uses a cooling method to cool the upper end of the container so that the toxic organic compound gas is cooled and liquefied to form water droplets. The vibration sliding unit allows the toxic compound water droplets to fall into the original non-volatile compound after cooling and liquefaction. The uniform mixing unit uses a mixing and stirring mechanism to stir and evenly mix the toxic organic compound to ensure the accuracy of the toxicity data of the compound to be detected.
[0054] 2. In the present invention, by setting the model basic classification number construction module, the machine algorithm module uses 5-fold cross validation and grid search to select the optimal hyperparameters for each machine learning algorithm, and 16 classifiers are obtained by combining four machine learning algorithms and four molecules one by one. Then, the best four classifiers are selected from the 16 classifiers through the time selection unit and the sequence selection unit as a new machine learning integrated model, so as to obtain accurate and reliable toxicity prediction data from the integrated model, thereby increasing the accuracy of compound toxicity data prediction;
[0055] 3. In the present invention, the four classifiers are retrained on the training set using the best hyperparameters fine-tuned in the 5-fold cross validation through the training verification module, and the weights are adjusted in real time on the verification set using the particle swarm algorithm (PSO), so that the compound toxicity data obtained from the integrated model can be compared with the evaluation compound toxicity data in real time, and accurate evaluation can be achieved through the result hierarchical verification, thereby further increasing the accuracy of organic compound toxicity prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 The figure is an overall flow chart of the method for predicting the toxicity of organic compounds based on particle swarm algorithm and ensemble learning of the present invention;
[0057] Figure 2 It is a schematic diagram of the integrated module architecture of the method for predicting the toxicity of organic compounds based on particle swarm algorithm and ensemble learning of the present invention;
[0058] Figure 3 It is a schematic diagram of the preprocessing module framework of the method for predicting the toxicity of organic compounds based on particle swarm algorithm and ensemble learning of the present invention;
[0059] Figure 4 This is a schematic diagram of the model basic classification number building module framework of the organic compound toxicity prediction method based on particle swarm algorithm and ensemble learning of the present invention. DETAILED DESCRIPTION
[0060] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.
[0061] Embodiment 1
[0062] Please refer to Figures 1 to 3 As shown: The method for predicting the toxicity of organic compounds based on particle swarm optimization and ensemble learning includes the following implementation steps:
[0063] Step 1: Using the combination of the collection module and the integration module, organic compounds are collected from the ECOTOX aquatic toxicity database and placed in a container, and the volatile organic compounds are integrated using the integration module, and after integration, they are mixed with the original non-volatile compounds;
[0064] Step 2: Enter the preprocessing module and preprocess the toxic organic compound molecules through Python scripts. The obtained data set is divided into training set, validation set and test set according to 7:1.5:1.5;
[0065] Step 3: Enter the model basic classification number construction module, obtain 16 classifiers through four machine learning algorithms and four molecular representation schemes, and select the first four classifiers as basic classifiers to build an integrated model;
[0066] Step 4: Enter the prediction module, retrain the first four classifiers obtained using their optimal hyperparameters on the entire training set, develop an integrated model, and each classifier acts as a base classifier. For data point processing, the toxicity of organic compounds is predicted by combining particle swarm optimization and ensemble learning;
[0067] Step 5: Enter the training and verification module, fine-tune the optimal hyperparameters on the training set to retrain the four classifiers, use the particle swarm algorithm (PSO) to adjust the weights on the verification set, input the tested aquatic organism toxicity data into the constructed organic compound toxicity prediction model, perform model training and verify the model performance.
[0068] The integration module includes monitoring module, collection module and compound integration;
[0069] The monitoring module includes a real-time detection unit and an auxiliary tracking unit;
[0070] The real-time detection unit uses a photoionization detector and a gas chromatography-mass spectrometer to detect the toxic volatilization of current organic compounds in real time, and transmits the toxic volatilization data through wireless sensing;
[0071] The auxiliary tracking unit is used to detect the volatilized organic compound gas in real time through gas detection sensors and data recorders, and to record the detected gas in real time for later planning of the collection and treatment of the volatilized gas.
[0072] The collection module includes a liquefaction molding unit and a vibration sliding unit;
[0073] The collecting module is used to receive the signal transmitted by the monitoring module, and cool the container through the liquefaction molding unit to cool and liquefy the toxic organic compound gas to form water droplets;
[0074] The vibration slide unit uses a vibration assist device to slightly vibrate the upper end of the outer portion of the container, so that the droplets of the toxic compound after cooling and liquefaction fall into the original non-volatile compound.
[0075] Compound integration includes a homogeneous mixing unit and a real-time start-stop unit;
[0076] The uniform mixing unit adopts a mixing and stirring mechanism to uniformly mix the toxic organic compounds again;
[0077] The real-time start-stop unit adopts a PLC system through a programmable logic controller to control the operating state of the uniform mixing unit in real time, thereby realizing automatic start-stop of the uniform mixing unit.
[0078] The preprocessing module includes a preprocessing unit, which preprocesses molecules through Python scripts, including: removing salts, removing inorganic compounds, removing isomers, using standard SMILES to represent molecules, and merging records of the same molecule after standardization. The resulting data set is divided into training set, validation set and test set, and features are extracted from the training set, validation set and test set through the feature extraction module to obtain training set features, validation set features and test set features.
[0079] The collection module collects the median lethal concentration data of aquatic organisms from the ECOTOX aquatic toxicity database, and the collected toxic compounds are placed in a container. The real-time detection unit and the auxiliary tracking unit detect the volatilization of toxic organic compounds in real time through the data receiver and the data recorder, and then transmit the data to the monitoring module through wireless sensing. The monitoring module receives and processes the information, and then transmits the signal to the collection module through wireless transmission. At this time, the liquefaction molding unit uses a cooling method to cool the upper end of the container so that the toxic organic compound gas is cooled and liquefied to form water droplets. The vibration and sliding unit shakes off the cooled and liquefied toxic compound droplets and merges them with the original non-volatile compounds. The uniform mixing unit uses a mixing and stirring mechanism to evenly stir the toxic organic compounds to ensure the accuracy of the toxicity data of the compounds to be tested.
[0080] Embodiment 2
[0081] Please refer to Figure 4 As shown: Based on the first embodiment, the model basic classification number construction module includes a feature receiving module, a machine algorithm module and a basic classifier module;
[0082] The feature receiving module is used to receive the features of the training set, the validation set and the test set. It uses the molecular access control system (MACCS) key, the extended connectivity fingerprint (ECFP6), the functional connectivity fingerprint (FCFP) and the fingerprint system based on the molecular structure, and then calculates all the molecular fingerprints through the open source molecular informatics toolkit to complete the mathematical description of the structure of toxic chemical molecules.
[0083] The machine algorithm module uses support vector machine (SVM), random forest (RF), K nearest neighbor (KNN) and extreme gradient boosting to select the optimal hyperparameters. The specific steps are as follows:
[0084] Step (i): The support vector machine (SVM) selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in the support vector machine (SVM);
[0085] Step (ii): Random Forest (RF) selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in Random Forest (RF);
[0086] Step (iii): KNN selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in KNN;
[0087] Step (iv): Extreme gradient boosting selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in extreme gradient boosting;
[0088] The basic classifier module combines four machine learning algorithms and four molecules one by one to obtain 16 classifiers.
[0089] The basic classifier module includes a time selection unit and a sequence selection unit;
[0090] The time selection unit allocates a running time slice to each classifier according to the preset time series scheduling algorithm and dynamically adjusts according to the classifier processing speed;
[0091] When the time slices are allocated, the sequential selection unit starts the classifiers in sequence according to the order of the time series, and each classifier completes a specific calculation within its allocated time slice;
[0092] The specific calculation time of the 16 classifiers is marked by the time selection unit and the sequence selection unit, and then four classifiers with shorter specific calculation time are selected from the 16 classifiers as the first four classifiers, and the best four classifiers are used as basic classifiers.
[0093] The prediction module uses the probability value data of the integrated model obtained by combining the machine learning algorithm and the particle swarm algorithm in the integrated model to organize the data and make toxicity predictions;
[0094] Step (1): After the ensemble model is constructed, the first four classifiers are selected, each of which acts as a base classifier. For each data point, the predicted probability values returned by the four base classifiers are continuously multiplied by the weight number to obtain the probability value of the ensemble model. The formula is as follows:
[0095] P 整 =w1p1+w2p2+w3p3+w4p4;
[0096] Among them, P 整is the probability value of the integrated model; w1, w2, w3, w4 are the weight numbers of the four basic classifiers; p1, p2, p3, p4 are the probability values predicted by the four basic classifiers;
[0097] Step (2): Use the particle swarm algorithm (PSO) to adjust the weights on the validation set. Use the particle swarm algorithm (PSO) to optimize w1, w2, w3, and w4 on the validation set. The speed is determined by the best position found by the entire group, which is called the global best position (G best ) and one's own best position is called the personal best position (P best ) Specifically, the velocity (v) of a particle is defined as:
[0098] v i =W×v i +c1r1(P best,i -x i )+c2r2(G best -x i );
[0099] x i =x i +v i ;
[0100] Among them, v i and x i is the update speed of i and the position of the i-th particle; r1 and r2 are random numbers between 0 and 1, c1 and c2 are acceleration coefficients; W is the inertial weight;
[0101] Step (3): Based on step (1), the predicted probability values returned from the four basic classifiers are continuously multiplied by the weight numbers and then added to obtain the probability value of the integrated model. Based on step (2), the weights are adjusted using the particle swarm algorithm (PSO). Since r1 and r2 are random numbers between 0 and 1, 100 values are taken between 0 and 1, and the obtained values are arranged in order of size. The 100 values are substituted into the particle swarm algorithm (PSO) calculation formula in turn to obtain 100 weight values and arrange them in order of size. Repeat the particle swarm algorithm (PSO) calculation to obtain the optimal range value within the 100 weight values in the particle swarm algorithm (PSO). The optimal weight range value is substituted into the formula in step (1) to obtain the optimal probability value range of the integrated model. The optimal probability value range is represented by Q, which is the toxicity prediction data range.
[0102] The feature receiving module uses the molecular expression scheme to describe the molecules in the training set features, validation set features and test set features. The machine algorithm module uses 5-fold cross-validation and grid search to select the optimal hyperparameters for each machine learning algorithm. By combining four machine learning algorithms and four molecules one by one, 16 classifiers are obtained. Then, the time selection unit and the sequence selection unit are used to select the best four classifiers from the 16 classifiers as a new machine learning integrated model, so as to obtain accurate and reliable toxicity prediction data from the integrated model, thereby increasing the accuracy of compound toxicity data prediction.
[0103] Embodiment 3
[0104] Please refer to Figure 1 and Figure 4 As shown: Based on the first embodiment, the training verification module compares the toxicity data obtained by the training verification with the predicted toxicity data to verify the performance of the model basic classification number construction module. The verification steps are as follows:
[0105] Step 1: Retrain the four classifiers on the training set using the best hyperparameters fine-tuned in the 5-fold cross validation.
[0106] Step 2: Use the particle swarm algorithm (PSO) to adjust the weights on the validation set, set the particle swarm size to 100, and repeat the number of times to 10;
[0107] Step 3: Evaluate the model on the test set. The mathematical formula of the evaluation index is as follows:
[0108]
[0109] Among them, MCC stands for Matthews correlation coefficient, BA stands for balanced accuracy, SP stands for sensitivity, RE stands for specificity, TP, FP, TN and FN are true positive, false positive, true negative and false negative values respectively;
[0110] Step 4: Based on step 3, the mathematical formula of the evaluation index is used to obtain the value range of MCC in [-1, 1], where 1 represents perfect classification, -1 represents completely wrong classification, and 0 represents random guessing. The optimal probability value range is represented by Q. When -1≤Q<0, it means that the performance of the integrated model is unstable, that is, the compound toxicity data obtained by the integrated model is inaccurate. When [-1,0)<Q<[0,1], it indicates that the integrated model is asymptotically stable. When 0<Q≤1, it indicates that the performance of the integrated model is stable, that is, the compound toxicity data obtained by the integrated model is accurate. [-1,0)<Q<[0,1] indicates that part of the optimal probability value range of the integrated model is between [-1,0) and the other part is between [0,1].
[0111] In the present invention, a method for predicting the toxicity of organic compounds based on particle swarm algorithm and integrated learning is used. The collection module collects toxic compounds, detects and processes the volatile toxic compounds through the real-time monitoring unit and the auxiliary tracking unit, and feeds back the signal to the monitoring module. At this time, after the collection module receives the signal from the monitoring module, the liquefaction molding unit cools the toxic volatile gas to form water droplets, and then the vibration sliding unit vibrates the formed water droplets, and the water droplets slide into the non-volatile toxic compounds. At this time, the uniform mixing unit stirs the multiple toxic compounds uniformly; enters the preprocessing module, and preprocesses the toxicity data of the toxic compounds through a Python script. The molecules are then represented by SMILES, and the records of the same molecule are merged after standardization. The obtained data set is divided into a training set, a validation set, and a test set, and the features are extracted from the training set, the validation set, and the test set through the feature extraction module. After standardized arrangement, the training set features, The validation set features and the test set features, the feature receiving module uses the molecular expression scheme to describe the molecules in the training set features, the validation set features and the test set features. The machine algorithm module uses 5-fold cross-validation and grid search to select the optimal hyperparameters for each machine learning algorithm. By combining the four machine learning algorithms and the four molecules one by one, 16 classifiers are obtained. Then, the time selection unit and the sequence selection unit are used to select the best four classifiers from the 16 classifiers as the integrated model. Based on the integrated model, the best hyperparameters are fine-tuned in the 5-fold cross-validation on the training set, and the four classifiers are retrained. The particle swarm algorithm (PSO) is used on the validation set to adjust the weights in real time, so that the compound toxicity data obtained from the integrated model can be compared with the evaluation compound toxicity data in real time, and accurate evaluation can be achieved through the result hierarchical verification, which further increases the accuracy of organic compound toxicity prediction and reduces the number of toxicity experiments using animals.
[0112] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for predicting the toxicity of organic compounds based on particle swarm optimization and ensemble learning, characterized in that: The method comprises the following implementation steps: Step 1: Using the combination of the collection module and the integration module, organic compounds are collected from the ECOTOX aquatic toxicity database and placed in a container, and the volatile organic compounds are integrated using the integration module, and after integration, they are mixed with the original non-volatile compounds; Step 2: Enter the preprocessing module and preprocess the toxic organic compound molecules through Python scripts. The obtained data set is divided into training set, validation set and test set according to 7:1.5:1.5; Step 3: Enter the model basic classification number construction module, obtain 16 classifiers through four machine learning algorithms and four molecular representation schemes, and select the first four classifiers as basic classifiers to build an integrated model; Step 4: Enter the prediction module, retrain the first four classifiers obtained using their optimal hyperparameters on the entire training set, develop an integrated model, and each classifier acts as a base classifier. For data point processing, the toxicity of organic compounds is predicted by combining particle swarm optimization and ensemble learning; Step 5: Enter the training and verification module, fine-tune the optimal hyperparameters on the training set to retrain the four classifiers, use the particle swarm algorithm (PSO) to adjust the weights on the verification set, input the tested aquatic organism toxicity data into the constructed organic compound toxicity prediction model, perform model training and verify the model performance.
2. The method according to claim 1, characterized in that: The integration module includes a monitoring module, a collection module and a compound integration; The monitoring module includes a real-time detection unit and an auxiliary tracking unit; The real-time detection unit uses a photoionization detector and a gas chromatography-mass spectrometer to detect the toxic volatilization of the current organic compound in real time, and transmits the toxic volatilization data through wireless sensing; The auxiliary tracking unit is used to detect the volatilized organic compound gas in real time through the gas detection sensor and the data recorder, and to record the detected gas in real time for later planning of the collection and treatment of the volatilized gas.
3. The method according to claim 2, characterized in that: The collection module includes a liquefaction molding unit and a vibration sliding unit; The collecting module is used to receive the signal transmitted by the monitoring module, and cool the container through the liquefaction molding unit to cool and liquefy the toxic organic compound gas to form water droplets; The vibration sliding unit uses a vibration auxiliary device to slightly vibrate the upper end of the container, so that the water droplets of the toxic compound after cooling and liquefaction fall into the original non-volatile compound.
4. The method according to claim 3, characterized in that: The compound integration includes a uniform mixing unit and a real-time start-stop unit; The uniform mixing unit uses a mixing and stirring mechanism to uniformly mix the toxic organic compounds again; The real-time start-stop unit uses a PLC system through a programmable logic controller to control the operating state of the uniform mixing unit in real time, thereby realizing automatic start-stop of the uniform mixing unit.
5. The method according to claim 1, characterized in that: The preprocessing module includes a preprocessing unit, which preprocesses molecules through Python scripts, including: removing salts, removing inorganic compounds, removing isomers, using standard SMILES to represent molecules, and merging records of the same molecule after standardization. The obtained data set is divided into a training set, a validation set, and a test set, and features are extracted from the training set, validation set, and test set through a feature extraction module to obtain training set features, validation set features, and test set features.
6. The method according to claim 5, characterized in that: The model basic classification number construction module includes a feature receiving module, a machine algorithm module and a basic classifier module; The feature receiving module is used to receive training set features, validation set features and test set features, and uses the molecular access control system (MACCS) key, extended connection fingerprint (ECFP6), functional connection fingerprint (FCFP) and molecular structure-based fingerprint system, and then calculates all molecular fingerprints through an open source molecular informatics toolkit to complete the mathematical description of the toxic chemical molecular structure.
7. The method according to claim 6, characterized in that: The machine algorithm module uses support vector machine (SVM), random forest (RF), K nearest neighbor (KNN) and extreme gradient boosting to select the optimal hyperparameters. The specific steps are as follows: Step (i): The support vector machine (SVM) selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in the support vector machine (SVM); Step (ii): Random Forest (RF) selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in Random Forest (RF); Step (iii): KNN selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in KNN; Step (iv): Extreme gradient boosting selects the optimal hyperparameters in the search range of the algorithm by using 5-fold cross validation and grid search, and repeats the validation 100 times to obtain the value with the highest repetition rate as the optimal hyperparameter in extreme gradient boosting; The basic classifier module obtains 16 classifiers by combining the four machine learning algorithms and the four molecules one by one.
8. The method according to claim 7, characterized in that: The basic classifier module includes a time selection unit and a sequence selection unit; The time selection unit allocates a running time slice to each classifier according to a preset time series scheduling algorithm and dynamically adjusts according to the classifier processing speed; The sequential selection unit starts the classifiers in sequence according to the order of the time series during the time slice allocation process, and each classifier completes a specific calculation within its allocated time slice; The time selection unit and the sequence selection unit mark specific calculation times in the 16 classifiers, and then select four classifiers with shorter specific calculation times from the 16 classifiers as the first four classifiers, and use the best four classifiers as basic classifiers.
9. The method according to claim 1, characterized in that: The prediction module uses the integrated model probability value data obtained by combining the machine learning algorithm and the particle swarm algorithm in the integrated model to sort out the data and then make toxicity predictions; Step (1): After the integrated model is constructed, the first four classifiers are selected, each of which acts as a basic classifier. For each data point, the predicted probability values returned by the four basic classifiers are continuously multiplied by the weight number to obtain the probability value of the integrated model. The formula is as follows: P 整 =w1p1+w2p2+w3p3+w4p4; Among them, P 整 is the probability value of the integrated model; w1, w2, w3, w4 are the weight numbers of the four basic classifiers; p1, p2, p3, p4 are the probability values predicted by the four basic classifiers; Step (2): Use the particle swarm algorithm (PSO) to adjust the weights on the validation set. The particle swarm algorithm (PSO) is used to optimize w1, w2, w3, and w4 on the validation set. The speed is determined by the best position found by the entire group, which is called the global best position (G best ) and one's own best position is called the personal best position (P best ) Specifically, the velocity (v) of a particle is defined as: x i =x i +v i ; Among them, vi and x i is the update speed of i and the position of the i-th particle; r1 and r2 are random numbers between 0 and 1, c1 and c2 are acceleration coefficients; W is the inertial weight; Step (3): Based on step (1), the predicted probability values returned from the four basic classifiers are continuously multiplied by the weight numbers and then added to obtain the probability value of the integrated model. Based on step (2), the weights are adjusted using the particle swarm algorithm (PSO). Since r1 and r2 are random numbers between 0 and 1, 100 values are taken between 0 and 1, and the obtained values are arranged in order of size. The 100 values are substituted into the particle swarm algorithm (PSO) calculation formula in turn to obtain 100 weight values and arrange them in order of size. Repeat the particle swarm algorithm (PSO) calculation to obtain the optimal range value within the 100 weight values in the particle swarm algorithm (PSO). The optimal weight range value is substituted into the formula in step (1) to obtain the optimal probability value range of the integrated model. The optimal probability value range is represented by Q, which is the toxicity prediction data range.
10. The method according to claim 9, characterized in that: The training verification module compares the toxicity data obtained from the training verification with the predicted toxicity data to verify the performance of the model basic classification number construction module. The verification steps are as follows: Step 1: Retrain the four classifiers on the training set using the best hyperparameters fine-tuned in the 5-fold cross validation. Step 2: Use the particle swarm algorithm (PSO) to adjust the weights on the validation set, set the particle swarm size to 100, and repeat the number of times to 10; Step 3: Evaluate the model on the test set. The mathematical formula of the evaluation index is as follows: Among them, MCC stands for Matthews correlation coefficient, BA stands for balanced accuracy, SP stands for sensitivity, RE stands for specificity, TP, FP, TN and FN are true positive, false positive, true negative and false negative values respectively; Step 4: Based on step 3, the mathematical formula of the evaluation index is used to obtain the value range of MCC in [-1, 1], where 1 represents perfect classification, -1 represents completely wrong classification, and 0 represents random guessing. The optimal probability value range is represented by Q. When -1≤Q<0, it means that the performance of the integrated model is unstable, that is, the compound toxicity data obtained by the integrated model is inaccurate. When [-1,0)<Q<[0,1], it means that the integrated model is asymptotically stable. When 0<Q≤1, it means that the performance of the integrated model is stable, that is, the compound toxicity data obtained by the integrated model is accurate.
Citation Information
Patent Citations
Integrated circuit floorplanning method based on moving block sequence and multi-agent particle swarm
CN103714211A