Aquatic risk endpoint prediction and active cliff identification method based on SMILES semantic embedding space
By employing XGBoost regressors and cosine similarity retrieval in the SMILES semantic embedding space, we address the shortcomings of traditional methods in identifying out-of-domain samples and predicting activity cliffs, thereby improving the prediction accuracy and robustness of aquatic organism datasets.
Patent Information
- Application Number
- CN202511744161.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-03-03
AI Technical Summary
Traditional methods struggle to effectively identify out-of-domain samples and predict liveness cliffs in the SMILES-based Transformer semantic embedding space, resulting in insufficient prediction accuracy and robustness.
A method for predicting aquatic risk endpoints and identifying active cliffs based on the SMILES semantic embedding space is adopted. Through data collection and cleaning, semantic embedding acquisition, feature construction, regression modeling and application domain delineation, the XGBoost regressor and cosine similarity retrieval are used, and the application domain of the samples is determined by combining weighted molecular similarity density and activity weighted inconsistency.
It significantly improves the prediction accuracy and robustness of Transformer-XGBoost on aquatic organism datasets, and enables effective identification of out-of-domain samples and sensitive early warning of activity cliffs.
Smart Images

Figure CN121601076A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computational toxicology and cheminformatics, and in particular to a method for predicting aquatic risk endpoints and identifying active cliffs based on the SMILES semantic embedding space. Background Technology
[0002] Structure-activity landscapes (SALs) are used to describe the changes in activity / properties under molecular similarity distributions and have been widely used to discover molecules that may have activity cliffs (ACs). In recent years, the academic community has proposed using SALs as a basis, combined with weighted molecular similarity density (WMS) analysis... ")" and "activity-weighted inconsistency" The approach of constructing the Applicability Domain (AD) was adopted, and the identification of ACs and the improvement of prediction performance were verified on molecular graph models (such as GAT).
[0003] However, traditional Algorithm Optimization (AD) relies heavily on predefined global distance and density statistics of fingerprints or descriptors. Its geometric and distributional assumptions are difficult to match the SMILES-based Transformer semantic embedding space: this space is high-dimensional, significantly anisotropic, and cosine similarity dominates local geometry. Simple unweighted k-nearest neighbors or Euclidean radius thresholds are prone to density misjudgments and underestimation of uncertainty. Furthermore, without explicitly measuring the volatility of activity within the neighborhood, even similar samples may be near an activity cliff, leading to prediction spillover errors. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method for predicting aquatic risk endpoints and identifying active cliffs based on the SMILES semantic embedding space, so as to achieve effective identification of out-of-domain samples and sensitive early warning of active cliffs, and significantly improve the prediction accuracy and robustness of Transformer-XGBoost on the remaining samples.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for predicting aquatic risk endpoints and identifying active cliffs based on the SMILES semantic embedding space, comprising the following steps:
[0006] Step 1: Data collection and cleaning: Collect aquatic organism toxicity records from the environmental toxicity database, standardize the toxicity endpoints for algae, fish, and aquatic invertebrates, unify endpoint representation, remove outliers, standardize molecular structures to Canonical SMILES, and divide the training set and test set according to compounds after preprocessing labels and covariates.
[0007] Step 2: Semantic embedding acquisition: A molecular encoder is used to perform supervised regression fine-tuning on the target aquatic endpoint dataset. After training converges, the regression head is removed, the encoder is retained, and the last layer [CLS] hidden state of each molecule is extracted as a 768-dimensional semantic embedding vector.
[0008] Step 3: Feature construction: Concatenate the 768-dimensional semantic embedding vector obtained in step S2 with covariates, wherein the covariates include at least exposure time and effect category;
[0009] Step 4: Regression Modeling: Using the features constructed in Step S3 as input, train the XGBoost regressor to predict the regression model after logarithmic regression. 10 The transformed aquatic toxicity endpoint concentration;
[0010] Step 5: Domain Delineation: For any query sample in the test set, retrieve the top-k neighbors with the highest cosine similarity in the embedding space of the training set, and calculate the weighted molecular similarity density ρ. s Inconsistent with activity-weighted inconsistencies, a two-dimensional threshold is used to jointly determine whether a sample is within the applicable domain (AD).
[0011] Step 6: Output strategy: For samples within the applicable domain, publish the prediction results of the XGBoost regressor; for samples outside the applicable domain, reject the numerical prediction and return an alert and reason code.
[0012] In a preferred embodiment, the method includes the following steps: In step 1, the environmental toxicity database is the US EPAECOTOX database, with a data time range covering 1915 to 2024; the outlier removal rule is to remove records with an effective concentration greater than 500 mg / L; the label preprocessing involves performing logarithmic analysis on the concentration. 10 The model training employed a 10-fold cross-validation method.
[0013] In a preferred embodiment, the method includes the following steps: In step 2, a pre-trained SMILES-BERT model is used as the molecular encoder; the pre-trained SMILES-BERT model is unikei / bert-base-smiles, the objective function for supervised fine-tuning is the mean squared error (MSE), the input during fine-tuning is a Canonical SMILES sequence, and the supervision signal is log10 Transformed endpoint concentration labels.
[0014] In a preferred embodiment, in step S2, the BERT model and the XGBoost model in step S4 use the exact same training, validation, and testing partitions and random seeds. The training set is only used to generate training embeddings and train XGBoost, and the embeddings of the validation and test sets are only used for model evaluation and are not used across sets.
[0015] In a preferred embodiment, in step S3, the covariate is encoded as follows: the exposure time is normalized to the [0,1] interval, and the effect category is encoded using one-hot encoding; and no additional processing such as PCA dimensionality reduction or L1 / L2 feature selection is performed on the semantic embedding vector.
[0016] In a preferred embodiment, in step S5, Top-k neighbors refer to the k*Num molecules in the training set embedding space that have the highest cosine similarity to the query sample, where Num represents the number of molecules in the training set.
[0017] In a preferred embodiment, in step S5, the weighted molecular similarity density The calculation process is as follows: First, the cosine similarity between the query sample and its Top-k neighbors is mapped to the [0,1] interval. Then, the influence of low-similarity neighbors is suppressed by a non-linear weight function. Finally, the weights are averaged to obtain the result. The nonlinear weighting function is:
[0018] ,in This represents the similarity after mapping.
[0019] In a preferred embodiment, in step S5, the calculation process for the activity-weighted inconsistency is as follows: first, a local activity discontinuity score is pre-calculated for each sample in the training set. Then, for the Top-k neighbors of the query sample We obtain the weighted average by nonlinear weights. The local activity discontinuity score It is calculated by the weights, similarity, and activity differences of neighboring samples.
[0020] In a preferred embodiment, in step S5, the two-dimensional threshold ( , The search objective is determined through grid search, aiming to maximize the validation set determination coefficient R² or minimize the mean absolute error (MAE). The applicable domain determination rule is: sample... .
[0021] In a preferred embodiment, in step S6, if and Then publish This is the final prediction; otherwise, it is considered out of the domain, no value is published, only the reason is returned; the reason codes include: R1, R2, R3; R1: Insufficient density < R2: Inconsistency is too high > R3: Not satisfied at the same time.
[0022] In a preferred embodiment, in step S1, the toxicity endpoints of the three species include:
[0023] Algae: Population toxicity tests EC10, EC50;
[0024] Fish: Mortality EC50, LC50, Developmental toxicity EC10, Growth toxicity EC10, Morphological toxicity EC10, Population toxicity EC10, Reproductive toxicity EC10;
[0025] Aquatic invertebrates: Mortality EC50, LC50, Poisoning effect EC10, EC50, Developmental toxicity EC10, Population toxicity EC10, Reproductive toxicity EC10.
[0026] Compared with the prior art, the present invention has the following beneficial effects: The present invention { , The method better matches the geometric features of Transformer semantic embedding, and can simultaneously reflect "local data density differences" and "active landscape smoothness". Thus, in the three types of aquatic organisms (algae, fish, aquatic invertebrates) and their multi-endpoint datasets, it can effectively identify out-of-domain samples and provide sensitive early warning of active cliffs, significantly improving the prediction accuracy and robustness of Transformer-XGBoost on the remaining samples. Attached Figure Description
[0027] Figure 1 This is a flowchart of the Transformer-XGB model prediction process provided in this embodiment of the invention.
[0028] Figure 2 This is provided by the embodiments of the present invention. Method flowchart.
[0029] Figure 3 This is provided by the embodiments of the present invention. A schematic diagram of the method results.
[0030] Figure 4 This is a flowchart of the toxicity prediction method provided in the embodiments of the present invention. Detailed Implementation
[0031] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0032] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0033] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0034] refer to Figure 1-4 This invention provides a method for predicting the toxicity endpoints of aquatic animals based on SMILES and Transformer-XGBoost. { , The applicable domain delineation algorithm includes the following steps S1-S10:
[0035] S1. Data Collection and Cleaning S1.1 Data Sources and Time Range: Aquatic organism toxicity records were collected from the US EPAECOTOX environmental toxicity database; the time range covers 1915-2024. S1.2 Species and Endpoint Classification: Three categories of species and endpoints were standardized according to regulatory or authoritative standards (US EPA classification):
[0036] Algae: Population toxicity assays (EC10, EC50);
[0037] Fish: Mortality (EC50, LC50), Development (EC10), Growth (EC10), Mortality (EC10), Morphology (EC10), Population (EC10), Reproduction (EC10);
[0038] Aquatic Invertebrates: Mortality (EC50, LC50), Intoxication (EC50, EC10), Development (EC10), Mortality (EC10), Population (EC10), Reproduction (EC10). Based on this, the data is divided into multiple task datasets. S1.3 Endpoint Unification and Anomaly Control: The NOEC and the effect / lethal concentrations within the 0%-10% effect range are unified as EC10; to ensure data quality, outliers are removed—all effect concentrations greater than 500 mg / L are removed. S1.4 Structural Representation Normalization: Molecular structures are retrieved by CAS number and unified as SMILES; then standardized to Canonical SMILES using a cheminformatics tool (RDKit preferred). S1.5 Labeling and Feature Preprocessing: Concentration labels are processed... Transformation; perform missing data handling and standardization / coding on task-related covariates (such as exposure time and effect type) (duration normalization, effect one-hot encoding). S0.6 Data splitting: perform training and testing splitting at the sample level according to SMILES (ten-fold cross-validation) to avoid information leakage and ensure cross-molecular generalization.
[0039] S2, Semantic Embedding Acquisition
[0040] S2.1 SMILES Normalization and Tokenization: For each compound, canonical SMILES (preserving chiral / charge markers) are obtained, and then decomposed into substructure-level tokens using a chemi-sensing tokenizer to obtain the sequence. .
[0041] S2.2 Supervised Fine-Tuning of the BERT Encoder: The pre-trained model unikei / bert-base-smiles was selected as the molecular encoder, and supervised regression fine-tuning was performed on the target aquatic endpoint dataset.
[0042] Input: SMILES sequence ;
[0043] Monitoring signal: via The transformed endpoint concentration labels (e.g., EC10 / EC50 / LC50) are denoted as ;
[0044] Objective function: Mean Squared Error (MSE) After training converges, the regression head is removed, and only the finely tuned BERT encoder is retained. .
[0045] S2.3 Molecular-level representation of polymerization and derivation Send in Take the last layer [CLS] hidden state as the global molecule representation: .
[0046] S2.4 Split Consistency: BERT and XGBoost use completely consistent training / validation / test splits and random seeds: the training set is used only to generate training embeddings and train XGBoost; the embeddings of the validation / test set are used only for evaluation; they are not used across sets to avoid information leakage.
[0047] S3 Feature Construction
[0048] Will Task-related covariates are concatenated as input to the tree model:
[0049] ,
[0050] in It must include at least the exposure time (normalized continuous value) and the effect category (one-heat / embedded encoding). To maintain the integrity of BERT semantics, no additional dimensionality reduction / filtering such as PCA or L1 / L2 selection is performed.
[0051] S4 Regression Modeling (XGBoost)
[0052] by Using this as input, train an XGBoost regressor to predict labels. :
[0053] ,
[0054] in The hyperparameters, such as the number of trees, depth, learning rate, and regularization term, are determined through cross-validation. This yields the baseline predictor. .
[0055] S5 Training Process and Baseline Output
[0056] Baseline predictions are obtained after completing S3. The AD module will then perform a "pre-judgment" process, releasing data only to samples within the AD module. .
[0057] S6 Neighborhood Search and Similarity Mapping
[0058] For any query sample q, retrieve the top k neighbor sets in the training set embedding space based on cosine similarity. Map the cosine similarity to [0,1]:
[0059] (S4)
[0060] S7 Nonlinear Weights and Similarity Density
[0061] Define non-linear weights to suppress distant / low-similarity neighbors:
[0062] (S3)
[0063] Calculate the weighted similarity density:
[0064]
[0065] S8 activity-weighted inconsistency
[0066] For each sample ttt in the training set, pre-compute its local activity discontinuity score:
[0067]
[0068] in For training labels. For query sample q, according to... Weighted average:
[0069]
[0070] S9 Application Domain (AD) Joint Determination
[0071] Set a two-dimensional threshold Judgment rules:
[0072] .
[0073] The threshold is obtained by maximizing the validation set R² (or minimizing MAE) under the constraints of cross-validation, grid / Bayes search, or target coverage (preferably 60%–95%).
[0074] S10 Output Strategy
[0075] AD (Advertisement) Internal: Publish ;
[0076] AD Outside: Reject / warning, record "outside domain" reason code (insufficient density or excessive inconsistency), with the option to return a range or confidence prompt.
Claims
1. A method for predicting aquatic risk endpoints and identifying active cliffs based on the SMILES semantic embedding space, characterized in that, Includes the following steps: Step 1: Data collection and cleaning: Collect aquatic organism toxicity records from the environmental toxicity database, standardize the toxicity endpoints for algae, fish, and aquatic invertebrates, unify endpoint representation, remove outliers, standardize molecular structures to Canonical SMILES, and divide the training set and test set according to compounds after preprocessing labels and covariates. Step 2: Semantic embedding acquisition: A molecular encoder is used to perform supervised regression fine-tuning on the target aquatic endpoint dataset. After training converges, the regression head is removed, the encoder is retained, and the last layer [CLS] hidden state of each molecule is extracted as a 768-dimensional semantic embedding vector. Step 3: Feature construction: Concatenate the 768-dimensional semantic embedding vector obtained in step S2 with covariates, wherein the covariates include at least exposure time and effect category; Step 4: Regression Modeling: Using the features constructed in Step S3 as input, train the XGBoost regressor to predict the regression model after logarithmic regression. 10 The transformed aquatic toxicity endpoint concentration; Step 5: Domain Delineation: For any query sample in the test set, retrieve the top-k neighbors with the highest cosine similarity in the embedding space of the training set, and calculate the weighted molecular similarity density ρ. s Inconsistent with activity-weighted inconsistencies, a two-dimensional threshold is used to jointly determine whether a sample is within the applicable domain (AD). Step 6: Output strategy: For samples within the applicable domain, publish the prediction results of the XGBoost regressor; for samples outside the applicable domain, reject the numerical prediction and return an alert and reason code.
2. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, Includes the following steps: In step 1, the environmental toxicity database is the US EPAECOTOX, with data covering the period from 1915 to 2024; the outlier removal rule is to remove records with an effective concentration greater than 500 mg / L; the label preprocessing involves performing a logarithmic adjustment on the concentration. 10 The model training employed a 10-fold cross-validation method.
3. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, Includes the following steps: In step 2, a pre-trained SMILES-BERT model is used as the molecular encoder; the pre-trained SMILES-BERT model is unikei / bert-base-smiles, the objective function for supervised fine-tuning is the mean squared error (MSE), the input during fine-tuning is the Canonical SMILES sequence, and the supervision signal is log 10 Transformed endpoint concentration labels.
4. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, In step S2, the BERT model and the XGBoost model in step S4 use the same training, validation, and testing partitions and random seeds. The training set is only used to generate training embeddings and train XGBoost, and the embeddings in the test set are only used for model evaluation and are not used across sets.
5. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, In step S3, the covariate is encoded as follows: the exposure time is normalized to the [0,1] interval, and the effect category is encoded using one-hot encoding; and no additional processing is performed on the semantic embedding vector for PCA dimensionality reduction or L1 / L2 feature selection.
6. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, In step S5, Top-k neighbors refer to the k*Num molecules in the training set embedding space that have the highest cosine similarity to the query sample, where Num represents the number of molecules in the training set.
7. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, In step S5, the weighted molecular similarity density The calculation process is as follows: First, the cosine similarity between the query sample and its Top-k neighbors is mapped to the [0,1] interval. Then, the influence of low-similarity neighbors is suppressed by a non-linear weight function. Finally, the weights are averaged to obtain the result. The nonlinear weighting function is: ,in The similarity after mapping; In step S5, the calculation process for the activity-weighted inconsistency is as follows: first, a local activity discontinuity score is pre-calculated for each sample in the training set. Then, for the Top-k neighbors of the query sample We obtain the weighted average by nonlinear weights. The local activity discontinuity score It is calculated by the weights, similarity, and activity differences of neighboring samples.
8. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, In step S5, the two-dimensional threshold ( , The search objective is determined through grid search, aiming to maximize the validation set determination coefficient R² or minimize the mean absolute error (MAE). The applicable domain determination rule is: sample... .
9. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, In step S6, if and Then publish For the final prediction; Otherwise, it will be judged as being outside the domain, and no value will be published; only the reason will be returned. Reason codes include: R1, R2, R3; R1: Insufficient density < R2: Inconsistency is too high > ; R3: Not satisfied at the same time.
10. The method for predicting aquatic risk endpoints and identifying active cliffs based on SMILES semantic embedding space according to claim 1, characterized in that, In step S1, the toxicity endpoints for the three species include: Algae: Population toxicity tests EC10, EC50; Fish: Mortality EC50, LC50, Developmental toxicity EC10, Growth toxicity EC10, Morphological toxicity EC10, Population toxicity EC10, Reproductive toxicity EC10; Aquatic invertebrates: Mortality EC50, LC50, Poisoning effect EC10, EC50, Developmental toxicity EC10, Population toxicity EC10, Reproductive toxicity EC10.