OnionNet-2: A Convolutional Neural Network Model for Predicting Protein-Ligand Binding Affinity based on Residue-Atom Contacting Shells

Abstract: One key task in virtual screening is to accurately predict the binding affinity ($\triangle$$G$) of protein-ligand complexes. Recently, deep learning (DL) has significantly increased the predicting accuracy of scoring functions due to the extraordinary ability of DL to extract useful features from raw data. Nevertheless, more efforts still need to be paid in many aspects, for the aim of increasing prediction accuracy and decreasing computational cost. In this study, we proposed a simple scoring function (called OnionNet-2) based on convolutional neural network to predict $\triangle$$G$. The protein-ligand interactions are characterized by the number of contacts between protein residues and ligand atoms in multiple distance shells. Compared to published models, the efficacy of OnionNet-2 is demonstrated to be the best for two widely used datasets CASF-2016 and CASF-2013 benchmarks. The OnionNet-2 model was further verified by non-experimental decoy structures from docking program and the CSAR NRC-HiQ data set (a high-quality data set provided by CSAR), which showed great success. Thus, our study provides a simple but efficient scoring function for predicting protein-ligand binding free energy.

\section{Introduction}
Protein-ligand binding is the basic of almost all processes in living organisms\cite{ref1} thus predicting binding affinity($\triangle$$G$) of protein-ligand complex becomes the research focus of bioinformatics and drug design. \cite{ref2, ref3, ref4} Theoretically, molecular dynamics (MD) simulations and free energy calculations (for instance, thermal integration method and free energy perturbation can provide accurate predictions of $\triangle$$G$ relying on extensive configurational sampling and calculation, leading to a large demand in computational cost.\cite{ref4, ref5, ref6, ref7} Therefore, developing simple, accurate and efficient scoring methods to predict protein-ligand binding will greatly accelerate the drug design process.\cite{ref8} To achieve this, several theoretical methods (scoring functions) have been proposed. Typically, the scoring functions are based on calculations of interactions between protein and ligand atoms.\cite{ref1, ref8, ref9, ref10} This includes quantum mechanics calculations, molecular dynamics simulations (electrostatic interaction, van der Waals interaction, hydrogen-bond and etc.), empirical-based interacting models.\cite{ref1, ref9, ref10, ref11}

In recent years, approaches based on machine learning (ML) have been applied in scoring functions and demonstrated great success.\cite{ref12, ref13, ref14, ref15} For instance, RF-Score\cite{ref16} and NNScore are two pioneering ML-based scoring functions.\cite{ref17} Compared with classical approaches, these ML-based methods allow higher flexibility in selecting configurational representations or features for protein and ligand. More importantly, these methods have been demonstrated to perform better and more effective than classical approaches.\cite{ref18, ref19} Recently, the deep learning (DL) approaches have provided alternative solution. Compared with ML, the DL models perform better at learning features from the raw data to extract the relationship between these features and labels.\cite{ref20, ref21, ref22} Thus, DL algorithms have been introduced to model the structure-activity relationships.\cite{ref23, ref24, ref25} One of the most popular methods of DL is the convolutional neural network (CNN), which is a multi-layer perceptron inspired by the neural network of living organisms.\cite{ref26}

Inspired by the great success of DL and CNN techniques, several models applying CNN to virtual screening and $\triangle$$G$ prediction have been reported.\cite{ref27, ref28, ref29, ref30, ref31, ref32, ref33, ref34, ref35} For example, \"{O}zt\"{u}rk and co-workers reported a DeepDTA model based on one-dimensional (1D) convolution, which took protein sequences and simplified molecular input line entry specification (SMILES) codes of ligand as inputs to predict drug-target $\triangle$$G$.\cite{ref30} Using 3D CNN model, two independent groups developed scoring functions, named Pafnucy\cite{ref31} and \emph{K}$_{deep}$\cite{ref29}, to model the complex in a cubic box centered on the geometric center of the ligand to predict the $\triangle$$G$ of protein-ligand complex. More interestingly, Russ et al. employed Graph-CNNs to automatically extract features from protein pocket and 2D ligand graphs, and demonstrated that the Graph-CNN framework can achieve superior performance without relying on protein-ligand complexes.\cite{ref34} Our group has proposed a 2D convolution-based predictor, called OnionNet, based on element-pair-specific contacts between ligands and protein atoms.\cite{ref32} As is shown, these DL and CNN based approaches, achieved higher accuracy in $\triangle$$G$ prediction than most traditional scoring functions, such as AutoDock,\cite{ref36, ref37} X-Score\cite{ref38} and KScore.\cite{ref39}

For DL scoring functions, how to treat with the high-dimensional structural information encoded in the 3D structures and convert to the low-dimensional features for ML (or DL) training is critical. For most structure-based ML/DL models, the features are usually derived from the atomic information of proteins and ligands, such as the element type and spatial coordinates of the atom and even other atomic properties.\cite{ref29, ref31}

We noticed that same elements in different residues have quite different physical and chemical properties, which might greatly affect the predicting performance of scoring functions. Considering that the twenty types of amino acids can be treated as intrinsic classifications of protein compounds which involve lay features of them, like polar, apolar, aromatic and etc. We anticipate that it may be more beneficial to encode protein as residues instead of atoms in developing DL scoring functions.

In this work, we proposed a simple OnionNet-2 -- a 2D CNN based regression model, which adopts the rotation-free residue-atom-specific contacts in multiple distance shells to describe the protein (residues) - ligand (atoms) interactions. We demonstrated that, our present method can significantly improve the prediction power by about 3.7\% than previous models, thus providing an efficient and accurate approach for predicting protein-ligand interactions and uncover a new trend of using DL technique for massive biological structures training for drug design.

\section{Methods}

    \subsection{Descriptors}
    The features employed are the pair numbers of the specific residue (protein)-atom (ligand) combination in multiple distance shells. The minimum distances between any atom in the ligand and any residue of protein are treated as the representative distances. First, around each atom in the ligand, we defined N continuously packed shells. The thickness of each shell is $\delta$, except that the first shell is a sphere with a radius of $d_0$. The boundary K$_i$ of the $i$th shell is as follows
    \begin{center}
        0 $<$ K{$_i$} $<$ $d_0$, $\,$ $i$ = 1 \\
        $d_0$ + (i - 2)$\delta$ $\le$ K{$_i$} $<$ $d_0$ + (i - 1)$\delta$, $\,$ i $\ge$ 2
    \end{center}

    Meanwhile, we classified atoms in the ligand into eight types, namely C, H, O, N, P, S, HAL and DU, where HAL represents the halogen elements (F, Cl, Br and I), and DU represents the element types excluded in these seven types.
    \begin{center}
    T$_e$ $\in$ \{C, H, O, N, P, S, HAL, DU\}
    \end{center}

    When pre-processing the structure file, water and ions were treated explicitly because crystal water molecules and ions could affect the protein-ligand binding.\cite{ref40, ref41} In addition to the twenty standard residues, we added an expanded type named ``OTH'' to represent water, ions and any other non-standard residues.
    \begin{center}
    T$_r$ $\in$ \{GLY, ALA, VAL, LEU, ILE, PRO, PHE, TYR, TRP, SER,
    THR, CYS, MET, ASN, GLN, ASP, GLU, LYS, ARG, HIS, OTH \}
    \end{center}

    \begin{figure}[htp]
      \centering
      \includegraphics[width=9cm, height=4.8cm]{fig1.png}
      \caption{Workflow of OnionNet-2.}
    \end{figure}

    It is worth mention that the residue-atom distance is defined as the distance between the atom in the ligand and the nearest heavy atom in the residue. A 2D visual representation is depicted at the upper left of Fig. 1. For any shell, the number of contacts for each residue-atom pair is calculated and used as a feature. Each shell has 8$\times$21=168 residue-atom combinations, which means that there are 168 features for a shell. Thus, if the total number of shells is N, 168$\times$N features will be generated.
    \begin{equation}
    n_{T_r,T_e}=\sum_{r=1}^R\sum_{e=1}^Ec_{r,e}^i
    \end{equation}
    \begin{equation}
    c_{r,e}^i = \left\{
    \begin{aligned}
    \begin{gathered}
    1, (i-2)\delta + d_0 \leq d_{r,e} < (i-1)\delta + d_0 \\
    0, otherwise
    \end{gathered}
    \end{aligned}
    \right.
    \end{equation}

    Here, $R$ is the total number of residues in the protein, and $E$ is the total number of atoms in the ligand. The $d_{r,e}$ is the minimum distance between the residue $r$ in the protein and the atom $e$ in the ligand, and $n_{T_r,T_e}^i$ is the number of contacts of the specific residue-element combination in the ith shell. The $c_{r,e}^i$ is 1 when $(i - 2)\delta + d_0 \leq d_{r,e} < (i - 1)\delta + d_0$, otherwise $c_{r,e}^i$ is 0. Following our previous study,\cite{ref32} we used $d_0 = 1$ {\AA} and $\delta = 0.5$ {\AA}. Interestingly such shell-like, or radial, representations of protein environments, have been demonstrated to be superior features in protein function prediction.\cite{ref35} The preparation of datasets and the CNN architecture\cite{ref42, ref43} can be found in \href{run:./supporting/supplement.pdf}{SI}.  The source code of OnionNet-2 is available at \url{https://github.com/zchwang/OnionNet-2/}.

    \subsection{Evaluation metrics}
    To evaluate the performance of the OnionNet-2,we adopted the loss function defined in the previous work.\cite{ref32}
    \begin{equation}
    loss = \alpha(1 - R) + (1 - \alpha) RMSE
    \end{equation}
    \begin{equation}
    R=\frac{\sum_{i}^n(x_i-\bar x)(y_i-\bar y)}{\sqrt{\sum_i^n(x_i-\bar x)^2\sqrt{\sum_i^n(y_i-\bar y)^2}}}
    \end{equation}

    where R and RMSE represent Pearson correlation coefficient(Eq. 3) and root-mean-squared error, respectively; x$_i$ is the predicted pKa for ith complex; y$_i$ is the experimental pKa of this complex; $\bar x$ and $\bar y$ are the averages of all predicted values and experimental values.\cite{ref44} The $\alpha(0 \leq \alpha \leq1)$ value is an adjustable factor for adjusting the weight with R and RMSE, which was finally set to 0.7. For each independent training task, we adopted early stopping (patience = 20, that is, if the change of the loss value in the validating set is less than 0.001 after 20 epochs, the training is terminated) and save the model that performed best on the validating set. For the prediction in each case, five independently trainings were conducted to obtain the predicted mean value.

\section{Results and Discussions}

    \subsection{The predictive power of OnionNet-2}

    \begin{figure}[htp]
      \centering
      \includegraphics[width=6.6cm, height=5.4cm]{fig2.png}
      \caption{The Pearson correlation coefficient with respect to the shell number N for OnionNet-2 testing with core set v.2016. The bars indicate the standard deviations of the R values for five independent runs.}
    \end{figure}

    \begin{figure}[htp]
      \centering
      \includegraphics[width=8.5cm, height=8.5cm]{fig3.png}
      \caption{OnionNet-2 predicted pKa with respect to experimental determined pKa on (a) training set, (b) validating set, and two test sets of (c) core set v.2016 and (d) core set v.2013.}
    \end{figure}

    Firstly, we explored the effect of shell number N on the predictive capability of the OnionNet-2 model. A range of the total shell number $10 \leq N \leq 90$ was tested with interval of 2. According to our definitions of distance shell, this covers a separation between the residue and the atom from 0.55 nm to 4.55 nm. Fig. 2 depicts the trend of the R value to shell number N testing with core set v.2016\cite{ref44}. For N from 10 to 20, the R quickly increases as the total number of shells increases. This is expected because as the number of shells increases, the interactions between ligand and protein were gradually captured by the model. The R value reached the first peak for N is 30. This means that OnionNet-2 can achieve high prediction accuracy at a relatively low computational cost. Then, R fluctuates in a range of 0.01 until reaches the global maximum value when N = 62. Fig. 3 summarized the predicted mean pKa, with respect to experimental value, using N=62, on the training set (Fig. 3a), validating set (Fig. 3b) and two testing sets, core set v.2016 (Fig. 3c) and core set v.2013\cite{ref45, ref46, ref47} (Fig. 3d). It shows that the predicted pKa and experimental pKa are highly correlated for the two testing sets and validating set. After this point, R decreases when N increase. We attribute this to the enormous data that leads to the introduction of noise in the training. Unless otherwise specified, we adopted N of 62 in the following discussions. In addition, we also re-trained the model with two elder versions (v.2016 and v.2018) of the PDBbind database, and the R values of our re-trained models are almost the same (Fig. S1 and Table S1).

    The performance of some published scoring functions\cite{ref48, ref49} and OnionNet-2 tested on CASF-2016 and CASF-2013 are showed in Fig. 4 and Fig. S2, respectively. The corresponding R and RMSE (or SD) achieved by these representative scoring functions can be found in Table S2 in SI. Firstly, our OnionNet-2 model achieved highest R of 0.864 and RMSE of 1.164 with the core set v.2016, and R = 0.821 and RMSE = 1.357 with the core set v.2013. These were significantly higher than other scoring functions. The $2^{nd}$ best scoring function was AGL, which adopted the gradient boosting trees (GBTs) algorithm, focusing on multiscale weighted labeled algebraic subgraphs to characterize protein-ligand interactions.\cite{ref48} For two 3D convolution-based scoring functions \emph{K}$_{deep}$\cite{ref29} and Pafnucy\cite{ref31}, they adopted 3D voxel representation to model the protein-ligand complex and explicitly treated with physical properties of atoms such as hydrophobic, hydrogen-bond donor or acceptor and aromatic etc. into consideration. It is interesting to find that although we only employed the residue-atom contact to mimic the interactions between the protein and the ligand in OnionNet-2, the predicting power is higher. This further reveals that the selected features have a great impact on the predictive power of the CNN-based scoring functions. Secondly, as is expected, the introduction of ML/DL techniques into models has systematically enhanced the predicting accuracy.

    \begin{figure}[htp]
      \centering
      \includegraphics[width=8.8cm, height=4.4cm]{fig4.png}
      \caption{Pearson correlation coefficient of different scoring functions on CASF-2016 benchmark.}
    \end{figure}

    \subsection{Evaluation of the generalization ability of the model on different test sets}

    Generally, DL models display a good generalization behavior in practical applications.\cite{ref50} To verify the generalization ability of the OnionNet-2, the CSAR NRC-HiQ data set provided by CSAR\cite{ref51} was used as an additional test set in this study. This data set contains two subsets which contain 176 and 167 protein-ligand complexes respectively. For the two previous ML models, \emph{K}$_{deep}$ and RF-Score, the researchers used 55 and 49 complexes in two subsets respectively as test data.\cite{ref29} To provide a direct comparison with them, we adopted the same data for the OnionNet-2 test. It is worth mention that the two test subsets from the CSAR NRC-HiQ only have two common complexes with core set v.2013, namely 2jdy and 2qmj, and does not overlap with the training set, validation set and core set v.2016. The performance of \emph{K}$_{deep}$, RF-Score and OnionNet-2 on these two subsets are shown in Table \uppercase\expandafter{\romannumeral1}, and the scatter plots of the pKa predicted by OnionNet-2 with respect to experimental pKa can be found in Fig. S3 in SI.
    As expected, our model achieved a higher performance than \emph{K}$_{deep}$ and RF-score. For subset 1, the present OnionNet-2 achieved R of 0.89, which is considerably higher than that of \emph{K}$_{deep}$ (0.72) and RF-Score (0.78). This is also true for subset 2. Especially that, the R value of \emph{K}$_{deep}$ model is only 0.65 for subset 2, indicating weak predicting capability on these data. These results effectively demonstrated that OnionNet-2 has a good generalization ability.
    \begin{table}[htp]
      \begin{ruledtabular}
      \centering
      \caption{The performance of OnionNet-2, \emph{K}$_{deep}$ and RF-Score achieved on subsets from CSAR NRC-HiQ data set}
      \begin{tabular}{ccccc}
      {\,} & \multicolumn{2}{c}{Subset 1} & \multicolumn{2}{c}{Subset 2} \\
      {\,} & R & RMSE & R & RMSE \\
      \colrule
      OnionNet-2 & 0.89 & 1.50 & 0.87 & 1.21 \\
      \emph{K}$_{deep}$\cite{ref29} & 0.72 & 2.09 & 0.65 & 1.92 \\
      RF-Score\cite{ref29} & 0.78 & 1.99 & 0.75 & 1.66 \\
      \end{tabular}
      \end{ruledtabular}
    \end{table}
    \subsection{Evaluations on subsets of non-experimental decoy structures}
    As all the training and validating sets are composed of well-validated native structures in previous studies, it is largely unknown whether the DL method is capable to distinguish ``bad data'' that are incorporated in these integrated data sets, for instance, non-native binding poses. To verify this, we tested OnionNet-2 to deal with non-experimental structures (generated by docking programs). Technically, non-native binding poses (called decoys) were generated based on core set v.2016 complexes by AutoDock Vina.\cite{ref52, ref53} The detailed information of the generation of decoys can be found in the SI.\cite{ref54, ref55}

    The predicting accuracy was evaluated by calculating the RMSE between the predicted pKa of the decoy complex and the pKa of the corresponding native receptor-ligand complex which is shown in Fig. 5. It is clear that, the RMSE quickly increased with increasing RMSD. This is expected because decoys with larger RMSD result in more severe change of $\delta$G. These results reveal that OnionNet-2 can accurately respond to changes of the ligand binding poses and distinguish the native structure.
    \begin{figure}[htp]
      \centering
      \includegraphics[width=7cm, height=5.6cm]{fig5.png}
      \caption{RMSE between the predicted pKa of the decoy complex and the pKa of the corresponding native receptor-ligand complex achieved by OnionNet-2 on different protein-decoy complexes subsets. The bars indicate the standard deviations of RMSE for five independent runs.}
    \end{figure}

    \begin{table*}[htp]
      \centering
      \caption{Pearson correlation coefficients achieved by OnionNet-2 and previous scoring functions on three series of subsets}
      \begin{threeparttable}
      \begin{ruledtabular}
      \begin{tabular}{cccccccccc}
      {\,} & \multicolumn{3}{c}{Subset H} & \multicolumn{3}{c}{Subset S} & \multicolumn{3}{c}{Subset V} \\
      {\,} & H1 & H2 & H3 & S1 & S2 & S3 & V1 & V2 & V3 \\
      \colrule
      OnionNet-2 & 0.872 & 0.866 & 0.856 & 0.868 & 0.839 & 0.869 & 0.856 & 0.774 & 0.866 \\
      $\triangle$$_{Vina}$RF$_{20}$\tnote{*} & 0.820 & 0.832 & 0.804 & 0.843 & 0.765 & 0.823 & 0.727 & 0.760 & 0.818 \\
      X-Score\tnote{*} & 0.698 & 0.570 & 0.661 & 0.743 & 0.536 & 0.572 & 0.437 & 0.622 & 0.579 \\
      X-Score$^{HS}$\tnote{*} & 0.711 & 0.565 & 0.647 & 0.748 & 0.557 & 0.546 & 0.433 & 0.630 & 0.559 \\
      $\triangle$SAS\tnote{*} & 0.641 & 0.643 & 0.589 & 0.746 & 0.572 & 0.494 & 0.480 & 0.669 & 0.541 \\
      X-Score$^{HP}$\tnote{*} & 0.669 & 0.558 & 0.672 & 0.740 & 0.510 & 0.575 & 0.450 & 0.575 & 0.580 \\
      AutoDock Vina\tnote{*} & 0.626 & 0.586 & 0.641 & 0.745 & 0.521 & 0.507 & 0.484 & 0.564 & 0.486 \\
      \end{tabular}
      \end{ruledtabular}
      \begin{tablenotes}
      \footnotesize
      \item[*] Results of the last six rows taken from Su et al.\cite{ref44}
      \end{tablenotes}
      \end{threeparttable}
    \end{table*}

    \subsection{Effects of hydrophobic scale, buried solvent-accessible area and excluded volume inside the binding pockets on the prediction accuracy}

    Principally, the physical interactions between protein and ligand determine the $\triangle$$G$. The dominating factors for overall $\triangle$$G$ involve electrostatic interactions, van der Waals interactions, hydrogen bonds, hydration/de-hydration during complexation. However, such mechanistic interactions were not directly input into DL features. At molecular level, these involves the size and shape of the binding pocket, and the nature of residues around the binding pocket which determine its physicochemical characteristics.\cite{ref56} Whether DL models can accurately represent the structural specificity of the binding pocket is poorly documented.

    The entire CASF-2016 test set can be divided into three subsets by each of three descriptors according to physical classifications of the binding pocket on the target protein.\cite{ref44} The three descriptors include H-scale (hydrophobic scale of the binding pocket), $\triangle SAS$ (buried percentage of the solvent-accessible area of the ligand after binding) and $\triangle VOL$ (excluded volume inside the binding pocket after ligand binding). Protein-ligand complexes in CASF-2016 were grouped into 57 clusters, and the authors sorted all 57 clusters in ascending order by each descriptor. Then, these complex clusters were divided into three subsets according to the chosen descriptor, labeled as H1, H2 and H3 or S1, S2 and S3 or V1, V2 and V3. These subsets were used as validations of our OnionNet-2 model. As comparison, previous scoring functions were also tested on these three sets of subsets by Su et al.\cite{ref44}, and the results are summarized in Table \uppercase\expandafter{\romannumeral2}.

    As can be seen in Table \uppercase\expandafter{\romannumeral2}, OnionNet-2 achieved higher prediction accuracy compared with other soring functions when tested on H-, S- and V-series subsets. This indicates that the feature based on the contact number of residue-atom pairs in multiple shell is capable of capturing the hydrophobic scale of the binding pocket. The number of contacts in different shells (specifically the shells within the binding pocket) may be able to reflect the buried solvent-accessible surface area and the excluded volume of the ligand.

    We noticed that, compared to other subsets, the R value of OnionNet-2 on V2 subset is clearly lower than other subsets (nevertheless it is still high than other scoring functions). This may indicate that our model is less sensitive to medium-sized binding pockets. Thus it may be still challenging for current scoring functions to recognize the size and shape of the binding pocket.

    Furthermore, we plotted the detailed scatter plots of predicted pKa and experimental pKa in Fig. S4 according to the specific H, S and V range. It is interesting to find almost no dependence of pKa with the values of H, S or V. Thus we speculate that a more realistic descriptor for the ligand characteristic in the binding pocket is essential to guide the protein-ligand $\triangle$$G$ prediction.

\section{Conclusion}

To summarize, a 2D convolution-based CNN model, OnionNet-2, is proposed for prediction of the protein-ligand binding free energy. The contacting pair numbers between the protein residues and the ligand atoms were used as features for DL training. Using CASF-2013 and CASF-2016 as benchmarks, our model achieved the highest accuracy to predict $\triangle$$G$ than previous scoring functions. In addition, when employing different versions of PDBbind database for training, the performance of OnionNet-2 is nearly the same. The generalization ability of the model was verified by the CSAR NRC-HiQ data set and decoy structures. Our result also indicates that OnionNet-2 has the capability to recognize these physical natures (in detail, hydrophobic scale of the binding pocket, buried percentage of the solvent-accessible area of the ligand upon binding and excluded volume inside the binding pocket upon ligand binding) of the ligand-binding pocket interactions.

\begin{acknowledgments}
This work is supported by the Natural Science Foundation of Shandong Province (ZR2020JQ04), National Natural Science Foundation of China (11874238) and Singapore MOE Tier 1 Grant RG146/17.
\end{acknowledgments}

\section{Part \uppercase\expandafter{\romannumeral1}. Preparation of Dataset and Architecture}
\subsection{Preparation of training set, validating set and testing sets}
We mainly used the protein-ligand complexes of PDBbind database v.2019 (\url{http://www.pdbbind-cn.org/}) for training. This database consists of two overlapping subsets, the general set and the refined set. The general set includes all available complexes and the refined set comprises protein-ligand complexes with high-quality structure and binding information selected from the general set. For each structure of the protein-ligand complex, the corresponding binding affinity is represented by the negative logarithms (pKa) of the dissociation constants ($Kd$), inhibition constants ($Ki$) or half inhibition concentrations ($IC50$). In order to evaluate the predictive ability and compare with other scoring functions, OnionNet-2 was evaluated on the CASF-2016 test set (core set v.2016)\cite{ref1} and CASF-2013 test set (core set v.2013)\cite{ref2, ref3, ref4}. It should be noted that the CASF-2016 test set is the latest update of CASF-2016, which contains 285 high-quality complexes. While for core set v.2013, it is a subset of the PDBbind database v.2013, consisting of 195 protein-ligand complexes classified in 65 clusters with binding constants spanning nearly 10 orders of magnitude. Besides, a data set called CSAR NRC-HiQ, consisting of two subsets containing 176 and 167 complexes respectively,\cite{ref5} was employed as a third test set. For the previous models of Kdeep and RF-score, 55 and 49 complexes in two subsets were used as test data.\cite{ref6} To provide a direct comparison with \emph{K}$_{deep}$ and RF-score, we adopted the same data for the OnionNet-2 test. In order to perform normal training and testing, it is necessary to redistribute remaining complexes in PDBbind database v.2019. First, we excluded the complexes contained in three test sets from PDBbind database v.2019 (general set and refined set). Then, as a common practice (Reference: Pafnucy\cite{ref7} and OnionNet\cite{ref8}), 1000 complexes were randomly sampled from v.2019 refined set (after filtering all complexes used in the test sets described previously) as the validating set. Finally, the remaining complexes (that is, the complexes that are not included in the three test sets and validating set) were adopted for the training set. This ensures that there is no overlapping protein-ligand complex in the training set, validating set and test sets.

\subsection{Architecture}
We adopted a CNN model based on 2D convolution to learn the relationship between the contact features and the $\triangle$$G$. The model was constructed using the Keras package in tensorflow.\cite{ref9} The workflow architecture is shown in Fig. 1.

The raw data is pre-processed before input into the CNN model. Here, the features are standardized through the scikit-learn package.\cite{ref10} Three convolutional layers, with 32, 64 and 128 filters respectively were used and the filter sizes were all set as 4, with strides as 1. After preliminary tests, two fully connected layers with 100 and 50 neurons are used before the output layer, which is capable of capturing the nonlinear relationship between the features and the pKa values.

To further increase the nonlinear ability of the model, a rectified linear unit (RELU) layer was added after each convolutional layer and fully connected layer. Also, a batch normalization layer was used after the fully connected layer. The stochastic gradient descent (SGD) optimizer was adopted and the learning rate was set as 0.001. To reduce overfitting, L2 regularization with weight decay $\lambda$ = 0.01 was used after each fully connected layer. The number of samples processed per batch is 64.

\section{Part \uppercase\expandafter{\romannumeral2}. The statistical information of the training set and validating set when using different versions of PDBbind database}

Generally, the size of the datasets has an impact on the predictive ability of the DL model.\cite{ref11, ref12} To make a fair comparison with previous scoring functions, we re-trained the model with two elder versions (v.2016 and v.2018) of the PDBbind database, and the number of samples in the training set and validating set is shown in Table S1. In addition, we only re-trained the models using N = 58, 60 and 62. The performance on core set v.2013 and core set v.2016 are summarized in Fig. 4. It is clear that, although the three versions of PDBbind database differed greatly in size, the R values of our re-trained models are almost the same. This suggests that the difference between these three databases (in detail, PDBbind database v.2016, v.2018 and v.2019) has a rather limited impact on our OnionNet-2 model.

    \begin{figure}[htp]
      \centering
      \includegraphics[width=9cm, height=4cm]{figs1.png}
      \caption{Pearson correlation coefficients achieved by OnionNet-2 on (A) core set v.2016 and (B) core set v.2013 when different versions of PDBbind database are used for training (the total number of shells is set to 58, 60 and 62).}
    \end{figure}

    \begin{table}[htp]
      \begin{ruledtabular}
      \centering
      \caption{The number of samples in training set and validating set for three versions of PDBbind database.}
      \begin{tabular}{ccc}
      {\,} & Training set & Validating set \\
      \colrule
      v.2016 & 11820 & 1000 \\
      v.2018 & 14686 & 1000 \\
      v.2019 & 16626 & 1000 \\
      \end{tabular}
      \end{ruledtabular}
    \end{table}

\section{Part \uppercase\expandafter{\romannumeral3}. Comparison of OnionNet-2 with some representative scoring functions}
    \begin{table}[htp]
      \begin{ruledtabular}
      \centering
      \caption{Comparison of the predictive power of scoring functions on the core set v.2016 and v.2013}
      \begin{tabular}{ccccc}
      {\,} & \multicolumn{2}{c}{CASF-2016} & \multicolumn{2}{c}{CASF-2013} \\
      \colrule
      Scoring functions & R & RMSE & R & SD \\
      OnionNet-2 & 0.864 & 1.164 & 0.821 & 1.29 \\
      AGL\cite{ref13} & 0.833 & 1.271 & 0.792 & 1.45 \\
      \emph{K}$_{deep}$\cite{ref6} & 0.82 & 1.27 & {} & {} \\
      OnionNet\cite{ref8} & 0.816 & 1.278 & 0.78 & 1.45 \\
      RF-Score-v3\cite{ref7} & 0.80 & 1.39 & 0.74 & 1.51 \\
      Pafnucy\cite{ref7} & 0.78 & 1.42 & 0.70 & 1.61 \\
      kNN-Score\cite{ref14} & {} & {} & 0.672 & 1.65 \\
      X-Score\cite{ref14} & {} & {} & 0.614 & 1.78 \\
      ChemScore\cite{ref14} & {} & {} & 0.592 & 1.82 \\
      AutoDock Vina\cite{ref15} & {} & {} & 0.54 & 1.90 \\
      AutoDock\cite{ref15} & {} & {} & 0.54 & 1.91 \\
      \end{tabular}
      \end{ruledtabular}
    \end{table}

    \begin{figure}[htp]
      \centering
      \includegraphics[width=9cm, height=4.8cm]{figs2.png}
      \caption{Pearson correlation coefficient of different scoring functions on two benchmarks CASF-2013.}
    \end{figure}

    \begin{figure}[h!]
      \centering
      \includegraphics[width=9cm, height=4.4cm]{figs3.png}
      \caption{The result achieved by OnionNet-2 on CSAR-HiQ subsets.}
    \end{figure}

\section{Part \uppercase\expandafter{\romannumeral4}.The detailed information of the generation of decoys}

In CASF-2016 benchmark, the similarity between two binding poses is measured by the root-mean-square deviation (RMSD) value.\cite{ref4} Following previous studies by Allen et al.,\cite{ref16} we adopted the Hungarian algorithm to calculate RMSD between decoy ligand and native structure which is implemented in spyrmsd.\cite{ref17} In this study, we used AutoDock Vina to generate non-native binding pose (called decoys). The sampling space is a 27 {\AA} $\times$ 27 {\AA} $\times$ 27 {\AA} cubic, which is centered on the geometric center of the native ligand binding pose. The exhaustiveness value was set to 12. It is worth noting that AutoDock Vina ignores the effects of water molecules and ions when calculating protein-ligand binding energy. In addition, changes in the ligand binding poses will be accompanied by changes in the surrounding microenvironment. Therefore, the receptor-decoy complexes here do not include water molecules and ions.

1.	For each receptor, up to 20 decoy ligands were generated by AutoDock Vina. The actual number may be less than 20 because of limited size and shape of the binding pocket in the target protein. For each decoy, the RMSD with respect to native structure was calculated.

2.	We used 10 RMSD intervals, [0 {\AA}, 2 {\AA}], [2 {\AA}, 3 {\AA}], [3{\AA}, 4{\AA}], ..., [9{\AA}, 10{\AA}] and [10{\AA}:].

3.	For all ligands in every interval, we selected the decoy with the smallest RMSD value to put into the corresponding subsets.

4.	Ten test subsets containing non-experimental complexes were used for OnionNet-2 training.

\section{Part \uppercase\expandafter{\romannumeral5}. OnionNet-2 predicted pKa with respect to experimental determined pKa on three series subsets}
\begin{figure}[htp!]
  \centering
  \includegraphics[width=10cm, height=3cm]{figs4.png}
  \caption{OnionNet-2 predicted pKa with respect to experimental determined pKa on (A) H-, (B) S- and (C) V series subsets.}
\end{figure}


Diagnosis of Acute Poisoning Using Explainable Artificial Intelligence

Abstract: Medical toxicology is the clinical specialty that treats the toxic effects of substances, be it an overdose, a medication error, or a scorpion sting. The volume of toxicological knowledge and research has, as with other medical specialties, outstripped the ability of the individual clinician to entirely master and stay current with it. The application of machine learning techniques to medical toxicology is challenging because initial treatment decisions are often based on a few pieces of textual data and rely heavily on prior knowledge. ML techniques often do not represent knowledge in a way that is transparent for the physician, raising barriers to usability. Rule-based systems and decision tree learning are more transparent approaches, but often generalize poorly and require expert curation to implement and maintain. Here, we construct a probabilistic logic network to represent a portion of the knowledge base of a medical toxicologist. Our approach transparently mimics the knowledge representation and clinical decision-making of practicing clinicians. The software, dubbed Tak, performs comparably to humans on straightforward cases and intermediate difficulty cases, but is outperformed by humans on challenging clinical cases. Tak outperforms a decision tree classifier at all levels of difficulty. Probabilistic logic provides one form of explainable artificial intelligence that may be more acceptable for use in healthcare, if it can achieve acceptable levels of performance.

\section{Introduction \label{sec:intro}}
    The goal of this project is to represent physician decision making in acute conditions in medical toxicology using explainable and transparent computational techniques. The scope of biomedical knowledge is too vast and rate of increase of that knowledge too rapid for an individual physician to bring all relevant knowledge to bear on the diagnosis and treatment of an illness. The traditional response is the formation of teams of specialists, but this can promote fragmentation of care and increases the cost of delivering healthcare as well the chances for miscommunication. Nor does specialization remove elements of human fatigue or latent bias. Machine learning and artificial intelligence (ML/AI) approaches are trained on data sets larger than any physician could encounter in training. ML/AI algorithms can outperform physicians on \emph{specific} tasks, such as predicting the likelihood of response to a chemotherapeutic regimen \cite{rajkomar2019machine} or diagnosing pneumonia from a chest X-ray \cite{rajpurkar2017chexnet}, but perform dismally in poorly-defined tasks such as constructing a differential diagnosis, a list of diagnoses ranked by the likelihood of explaining a patient's current condition.

    A barrier to integrating ML/AI into healthcare is the difference between how ML/AI and physicians evaluate clinical data. Many current ML/AI approaches look for quantitative patterns across large data sets. They ignore prior knowledge (\emph{i.e.} information an experience physicians acquire in medical school and residency). Pretrained models and transfer learning incorporate statistical relationships from prior knowledge, but do not explicitly represent these relationships in terms readily interpretable by physicians. Reliability plots and counterfactual reasoning provide a way to understand the internal reasoning of algorithms that classify pictures of biopsies \cite{thiagarajan2020calibrating}, but it is not clear how to apply these methods to \emph{textual} data.  Probabilistic logic provides a way to combine statistical learning with symbolic reasoning, a way to combine machine capacity with human intuition.

\subsection{The Diagnosis and Initial Treatment of a Poisoned Patient\label{sec:toxidromes}}
The diagnosis and treatment of a poisoned patient begins with a rapid determination of whether the patient requires immediate intervention to prevent death. This determination is usually made at the patient's bedside by a physical examination and, if the patient's mental status allows, a brief discussion with the patient. In these critical situations, laboratory tests (\textit{e.g.} serum or urine drug concentrations) are rarely available readily enough to inform this determination. Opioids can slow breathing within minutes of ingestion. The metabolites are not detected in urine for hours, but the effect of the drug needs to be immediately reversed to prevent death from lack of oxygen. Serum concentrations of opioids and sedatives often have to be sent to specialized labs and the results are not available for days to weeks.

The medical toxicologist relies on pattern of findings on bedside evaluation, termed \emph{toxidromes}, that suggest a life-threatening ingestion from a class of drugs, \emph{e.g.} a sedative or a stimulant. Table \ref{tab:toxidromes} displays the $6$ canonical toxidromes, the features physicians extracts, and the feature values for each toxidrome. The bedside evaluation a medical toxicologist performs resembles, in the language of ML/AI, feature extraction and then multinomial classification with a complex loss function. From this lens, a toxidrome is a set of ranges of values of features that define decision regions for class membership. The word \textit{toxidrome} refers to a decision region. Toxidromes are intended to accurately identify severe poisonings that will respond to treatment, but may misclassify milder poisonings. This misclassification is acceptable clinically because mild poisonings, in general, do not require any specific immediate treatment.

\begin{table}
\setlength\tabcolsep{2pt}
\centering
\begin{tabular}{rcccccccc}
 & HR & BP & Pup & Sec & Temp  & RR & MS \\
Anticholinergic & $\Uparrow$ &  & {\Large$\bullet$} & $\Downarrow$ & $\Uparrow$ &   & D \\
Cholinergic & $\Downarrow$&  & {\tiny$\bullet$} & $\Uparrow$ &  & $\Downarrow$  & S \\
Opioid &  &  & {\tiny$\bullet$}&  &  &  $\Downarrow$ & S \\
Sedative-Hypnotic &  &  &  &  &  &  &  S \\
Serotonin Toxicity & $\Uparrow$ & $\Uparrow$  &  &  & $\Uparrow$  & &  A \\
Sympathomimetic & $\Uparrow$ & $\Uparrow$ & {\Large$\bullet$} &  & $\Uparrow$ & $\Uparrow$ & A
\end{tabular}
\caption{\textbf{Six canonical toxidromes.} HR, heart rate; BP, blood pressure; Pup, pupil diameter, size of bullet represents increased or decreased pupil diameters; Sec, secretions; Temp, temperature; RR, respiratory rate; MS, mental status; D, delirious, S, sedated; A, agitated Empty cell indicates expectation of no abnormality for that sign.}
\label{tab:toxidromes}
\end{table}

The names of the toxidromes reflect the biochemical pathways excessively activated or blocked by classes of drugs. The anticholinergic toxidrome results from blockade of the acetylcholine receptor family; cholinergic toxidrome from activation of the acetylcholine receptor family; opioid toxidrome from activation of the $\mu$ opioid receptors; sedative-hyponotic toxidrome from activation of the GABA ($\gamma$-amino butyric acid) receptors or blockade of glutamate receptors, and the sympathomimetic toxidrome from activation at adrenaline or noradrenaline receptors \cite{holstege2012toxidromes}. Serotonin toxicity is thought to result from excess activation at the 5-HT$_{2A}$ receptor\cite{boyer2005serotonin}. The clinical findings from excess serotonin activation are canonically termed serotonin syndrome or serotonin toxicity, but the term is used equivalently to a toxidrome.

\subsection{Review of Relevant Studies \label{sec:prior-work}}
Machine learning techniques (\textit{e.g.} naive Bayesian classifiers, neural networks, decision trees) have been applied to  diagnosis in many fields of medicine\cite{kononenko2001machine}. Here we review the application of probabilistic logic networks that analyze \emph{text} to perform medical diagnosis. We exclude algorithms that analyze images, as might be done in radiology or pathology. Images may be helpful in identifying whether flora or fauna are poisonous. Support vector machines have been productively applied to the automatic identification of poisonous mushrooms \cite{wibowo2018classification} and plants \cite{prasvita2013medleaf, sharma2015review} from images. But, image data are often not available to the toxicologist.

A combination of Bayesian networks and an ontology has been used to diagnose osteoporosis, achieving a $72\%$ accuracy \cite{agarwal2016ontology}. A Markov logic network has been implemented for diagnosis of medical conditions from Chinese-language medical records\cite{jiang2017learning}, but there was no assessment of its performance. The construction of a fuzzy Bayesian network for medical diagnosis has also been proposed but its performance not assessed \cite{zarikas2018medical}.

Software that combined rules and probabilities was developed for medicine as early as the 1970's, for example \textsc{MYCIN}\cite{shortliffe1974mycin}. Research on neural networks eclipsed work on rule-based systems because neural networks could operate with inexact matching, performed more accurately, and scaled more easily and rapidly. The use of neural networks in clinical practice is limited, however, owing, in part, to the difficulty of a clinician interacting with something that ``doesn't speak my language''\cite{naylor2018prospects}.

To the authors' knowledge there have been no prior publications on the application of probabilistic logic networks to the diagnosis of the poisoned patient. The Chemical Hazards and Emergency Medical Management branch (CHEMM) of the US Department of Health and Human Services has developed the CHEMM Intelligent Syndromes Tool. This tool is available via a web-based interface, but no application programming interface or other scalable endpoint is provided. There are no publications describing its implementation, but it appears to be based on FALCON\cite{frysinger2007falcon}, a deterministic decision tree to co-ordinate responses against attacks with chemical weapons.

\subsection{Probabilistic Logic Networks \label{sec:plns}}
Probabilistic logic networks (PLNs) aim to represent knowledge about the world and allow inference under uncertainty using a combination of predicate logic, symbolic reasoning, and statistical inference\cite{goertzel2008probabilistic}. A PLN consists of a set of pairs of a probability and a logical statement.

\begin{equation}
    0.4\quad\textrm{somnolent}\left(x\right)\Rightarrow\textrm{sedative_hypnotic}\left(x
    \right)\label{eq:pln-example}
\end{equation}

Equation \eqref{eq:pln-example} represents the concept that in $40\%$ of possible worlds if a patient is somnolent (excessively sleepy and lethargic) then the patient may be poisoned by a medication from the sedative/hypnotic class.

The fraction associated with each statement represents the fraction of words in which the logical statement is true. The statement is assumed to be false in all other worlds. The Supplementary Material provides more detail on the underlying mathematics and our software implementation.

Rule-based systems need experts to create and curate the rules as well as to adapt the rules to include new knowledge or apply the system to unfamiliar types of data. This need for curation may limit the speed of development. It also provides an opportunity for physicians to contribute to software development, which may increase use in clinical practice. For a more complete introduction to probabilistic logic we refer the reader to \cite{kimmig2011implementation} and for software implementation to \cite{de2003probabilistic}.

A significant advantage of rule-based approaches over other machine learning approaches for many areas of medicine is that rule-based approaches do not require large training data sets. Many subspecialties within medicine diagnose and treat rare diseases for which large data sets to explore all methods of diagnosis and treatment are unlikely to exist. The rules, in addition, can be a distillation of the received knowledge of a field, or a combination of this distillation and relationships inferred from large data sets.

Decision tree (DT) learning provides a competitive alternative to probabilisitic logic networks. DT classifiers have been used to predict the risk of breast cancer\cite{lavanya2012ensemble}, heart disease\cite{soni2011predictive}, diagnose diabetes\cite{al2011decision}, and classify electroencephalogram outputs in patient with epilepsy\cite{polat2007classification}. DTs are robust against collinearity. This is important in toxicology where poisonings share overlapping features. For example an elevated heart rate can be seen in the anithcolinergic and sympathomimetic toxidromes as well as in the serotonin syndrome. The sympathomimetic toxidrome and serotonin syndrome also both have elevated blood pressure.

DTs and PLNs also require less training data than neural networks. This is advantageous for medical applications, where curated data are often tiny. All of the studies discussed above were developed on $150$ or fewer patient presentations.

A limitation of decision trees is the tendency to overfit, which would correspond in clinical practice to bending diagnostic criteria so that each patient has at least one diagnosis. PLNs avoid this overfitting because they are not trying to minimize the number of undiagnosed patients.

\section{Methods \label{sec:methods}}

\subsection{Knowledge Representation}
   We created $34$ probabilistic logic rules based on the consensus of three medical toxicologists to describe the medical knowledge base used to diagnose acute poisoning. We named these rules and the underlying implementation in ProbLog, \emph{Tak}. We restricted ourselves to developing rules that described features that could be observed during one evaluation at a patient's bedside without laboratory testing. We followed these restrictions to assess our algorithm's performance in the most time-sensitive aspect of medical toxicology.

   The rules were constructed as follows. We treated each finding elicited by the toxicologist as a predicate. A predicate is a function that returns only \textsc{True} or \textsc{False}, dpeending on its input. For example, the predicate \mintinline{prolog}{salivation(X,increased)} is true if patient demonstrates increased salivation. We considered all predicates representing clinical findings to require two inputs, the patient and the value of the feature, usually \{present|absent\} or \{increased|normal|decreased\}. These values reflect a discretization of underlying continuous variables that reflect a common pattern of communication with information compression between physicians.

   \begin{listing}
   \begin{minted}{prolog}
    0.10::salivation(X,decreased);
    0.10::salivation(X,increased);
    0.80::salivation(X,usual).
   \end{minted}
   \caption{\textbf{Example rule in probabilistic logic that represent knowledge from medical toxicology.} Fraction preceding each function denotes number of worlds in which that function is true. Numbers sum to one across values.  \label{lst:prior-probability}}
   \vspace{-1.5em}
   \end{listing}

   In Listing \ref{lst:prior-probability}, the number before the two colons represents the probability with which the probability is true. The semicolon represents logical exclusive disjunction, \emph{i.e.} \mintinline{prolog}{A;B} means ``A or B but not both''. A period terminates each logical statement. Listing \ref{lst:eg-posterior-probability} demonstrates assigning the likelihood of one toxidrome over another given that the patient is manifesting a symptom. A colon followed by a dash represents unidirectional implication, \emph{i.e.} \mintinline{prolog}{A :- B} means that B is true if A is true. The function \mintinline{prolog}{mentalStatus(X,agitated)} is true if patient X is agitated. The function \mintinline{prolog}{hasToxidrome(X,Y)} is true if patient X manifests toxidrome Y.

   \begin{listing}
   \begin{minted}{prolog}
    4*P::hasToxidrome(X,sympathomimetic);
    P::hasToxidrome(X,serotonergic) :-
    mentalStatus(X,agitated), P is 0.2.
   \end{minted}
   \vspace{-1.5em}
   \caption{\textbf{Example rule in probabilistic logic linking a symptoms to toxidromes.} Expression preceding each goal in disjunction (sequence of statements separated by semicolons) is evaluated when conditions of goal are satisfied. \label{lst:eg-posterior-probability}}
   \end{listing}

   \begin{listing}
   \begin{minted}{prolog}
    hasToxidrome(X,cholinergic) :-
    salivation(X, increased),
    urination(X, increased),
    pupilDiameter(X,small).
   \end{minted}
   \vspace{-1.5em}
   \caption{\textbf{Example Expression of Diagnosis of Toxidrome as Prolog Goal.} \label{lst:eg-cholinergic-goal}}
   \end{listing}

 The relative probabilities across rules were chosen to reflect the perceived relative prevalence of each clinical finding. We used the most recent annual report from American Association of Poison Control Centers on the relative prevalence of each poisoning in the US to estimate the prior probability of each toxidrome. The prevalence of many physical findings, for example hypersalivation in the general population, are not known. Nor is it known that a patient is exactly four times more likely to suffer from a sympathomimetic toxidrome as opposed to serotonin toxicity if the patient becomes agitated after an unknown ingestion. The magnitudes were chosen, in conjunction with the consensus of experts, to reflect implicit components of clinical reasoning.

\subsection{Data Set}
We generated $300$ simulated toxidrome presentations as follows. We chose $300$ as the minimum number needed to detect whether the inter-rater reliability between human consensus and \emph{Tak} was greater than $0.2$. We took a difference in inter-rater reliability of $0.2$ to indicate clinically significant disagreement. The inter-rater reliability among toxicologists in using toxidromes to diagnose poisonings has not been systematically studied and the need for such a study is acknowledged\cite{larsen2018reviewing}.

For each presentation we chose two toxidromes according to a uniform random distribution without replacement and a level of difficulty, $k$. One toxidrome was the \emph{intended} toxidrome. The other became the distractor toxidrome. We created the presentation by choosing $5-k$ signs from the intended toxidrome and $k$ signs from the distractor toxidrome. The parameter $k$ models the variability of clinical presentation. A difficulty of $0$ simulates an unequivocal presentation, where all findings are canonically associated with the intended toxidrome. A difficulty of $2$ simulates a mixed picture, as might result from the ingestion of many substances with conflicting effects.  To the author's knowledge, this is the first data set created to evaluate the inter-rater reliability of diagnosis in medical toxicology.

\subsection{Evaluation}
We compared the performance of \emph{Tak} with expert consensus, a decision tree, and recovery of the intended toxidrome generated by Algorithm \ref{alg:make-patients}. We presented the same $300$ cases described above to \emph{Tak} as well as two human medical toxicologists. \emph{Tak} assigned the most likely rating to each toxidrome based on the posterior probabilities calculated by the probabilistic logic engine. The human raters labeled each presentation with the toxidrome that most accurately captured the presentation. We excluded presentations if either rater felt that no single toxidrome captured the presentation or that the presentation was not clinically plausible.

We use the term \emph{inferred toxidrome} to denote the toxidrome that \emph{Tak}, the decision tree, or the human raters inferred from the case presentation. We quantified inter-rater reliability using a multinomial extension of Cohen's $\kappa$. Cohen's $\kappa$ ranges between $0$ and $1$ where $0$ indicates the level of agreement expected by chance and $1$ indicates perfect agreement. Cohen's $\kappa$ is more clinically relevant than accuracy because Cohen's $\kappa$ also considers the discordance in errors between raters. We felt it important that \emph{Tak} perform similarly to humans in both accurate and inaccurate diagnoses.

We used the inter-rater reliability between \emph{Tak}'s inferred toxidrome and the intended toxidrome as a measure of best performance and between \emph{Tak}'s inferred toxidrome and the consensus of the human raters as a measure of actual performance. We took the inter-rater reliability between the consensus of the human raters and the intended toxidrome as a benchmark for actual performance.

To provide a machine learning benchmark we trained a decision tree classifier on the same cases. We trained one decision tree classifier for each level of difficulty. Training one DT for each level of difficulty is likely to lead to overfitting, but also will overestimate the decision tree's performance, providing a more stringent benchmark against which to evaluate \emph{Tak}. The trees were not averaged nor was any random forest method used. We used the \emph{sklearn} implementation, DecisionTreeClassifier, with the maximum depth set to $3$.

\section{Results \label{sec:results}}

Figure \ref{fig:study-flow} shows the overall organization of our study. $18$ cases were omitted because the human raters could not reach consensus and both said none of them were medically plausible, decreasing the number of cases from $300$ to $282$.

\begin{figure}
    \centering
    \begin{tikzpicture}
        \node[draw,rectangle] (generate-data)
        {
            \begin{minipage}{0.45\textwidth}
            \uline{Generate Data}\\
            \begin{tikzpicture}
                \node[text width=0.5\textwidth] (generate-cases) {Generate $300$ cases,\\ according to Alg [ref]};
                \node[below =  of generate-cases, text width=0.1\textwidth] (included){Included\\$\left(n=282\right)$};
                \node[below left= -0.26cm and 0.30cm of generate-cases, text width=0.3\textwidth] (excluded) {Clinically Implausible\\ $\left(n=18\right)$};

                \draw[->, thick] (generate-cases) -- (included);
                \draw[->, thick] (generate-cases) -- ($(generate-cases.south)+(0,-0.44)$) -- node[below]{Excluded}(excluded.east);
            \end{tikzpicture}
            \end{minipage}
        };
        \node[right= of generate-data, draw, rectangle, rounded corners] (evaluate)
        {
            \begin{minipage}{0.45\textwidth}
             \uline{Evaluate \emph{Tak}'s Performance}
             \begin{enumerate}[leftmargin=0cm, itemsep=0cm]
                 \item[] \textbf{Actual: } \emph{Tak} vs. Human Consensus
                 \item[] \textbf{Best: }\emph{Tak} vs. Intended Toxidrome
                 \item[]
                 \item[] \textbf{Benchmarks:}
                 \item[] Human Consensus vs Intended Toxidrome
                 \item[] DT vs Intended Toxidrome
             \end{enumerate}
            \end{minipage}
        };

        \draw[->, thick] (generate-data) -- (evaluate);
    \end{tikzpicture}
    \caption{\textbf{Study flow. Left:} Generation of data using Algorithm \ref{alg:make-patients}.\textbf{Right:} Evaluation of data. Actual denotes actual performance; best, best performance; DT, decision tree, \emph{Tak}, name of combination of probabilistic logic algorithm and knowledge base.}
    \label{fig:study-flow}
\end{figure}

Figure \ref{fig:summary-of-performace} summarizes the performances. \emph{Tak}'s peak and actual performance were comparable. As the complexity of the case increased \emph{Tak}'s performance decreased, as did the performance of human experts. In the most difficult cases, \emph{Tak}'s accuracy approached that of the decision tree classifier, approximately half of human performance. In all cases, \emph{Tak's} performance was better than chance ($\kappa =0$) and at least as good as the decision tree, our benchmark for current approaches.

\subsection{Ideal Performance \label{sec:ideal-performance}}
The inter-rater reliabilities between the toxidromes \emph{Tak} inferred and the intended toxidromes were $\kappa=0.8554$, $0.5614$, and $0.2904$ for difficulty levels $0$,$1$, and $2$, respectively. The inter-rater reliabilities between the consensus of human raters and the intended toxidromes were $\kappa=0.9878$, $0.7818$, and $0.2718$ for difficulty levels $0$,$1$, and $2$, respectively. As the difficulty increased \emph{Tak} developed difficulty distinguishing among the anticholinergic, cholinergic, and sedative-hypnotic toxidromes as well as between the opioid and cholinerigc toxidromes.

\subsection{Usual Performance}
Our benchmark for usual performance was the inter-rater reliability between the consensus of human raters and the intended toxidromes.  The inter-rater reliability between the consensus of the human raters and the labels predicted by \emph{Tak} was $\kappa=0.8432$, $0.4396$, and $0.3331$, for difficulties $0$,$1$, and $2$, respectively.

\subsection{Benchmark Performance}
 To compare \emph{Tak}'s performance against other machine learning approaches, we calculated the inter-rater reliability between the ground truth labels and a decision tree classifier. In straightforward presentations (difficulty, $0$) \emph{Tak} outperformed the decision tree ($\kappa_{\textrm{DT}}=0.6144$ vs $\kappa_{Tak}=.8554$). In intermediate difficulty presentations \emph{Tak} outperformed the decision tree ($\kappa_{\textrm{DT}}=0.3527$ vs $\kappa_{Tak}=.5614$). In complex presentations (difficulty=$2$) \emph{Tak} performed comparably to the decision tree ($\kappa_{\textrm{DT}}=0.2622$ vs $\kappa_{Tak}=.2904$). This benchmark was designed to favor the decision trees.

\subsection{Evaluation of Errors \label{sec:evaluation-of-errors}}
As the difficulty of presentations increased both \emph{Tak} and the human raters decreased in accuracy. This decrease in accuracy reflects the construction of the synthetic data set and the limits of resolution of toxidromes. The synthetic data were constructed to have three levels of difficulty, corresponding to clinical reality. Some patients may ingest or be exposed to a large amount of one substance leading to an unequivocal presentations. Others may ingest or be exposed to a mixture of substances with a variety of stimulating and sedating effects, the balance of which shifts over time as the chemicals are distributed throughout the body and metabolized at different rates.

The authors could find no published formal analysis of the discriminative limits of toxidromes, but it stands to reason that $6$ features may not be able to accurately classify $6$ categories if all features do not have values for all categories.

\emph{Tak} confused the anticholinergic and sympathomimetic toxidromes and cholinergic, opioid, and sedative hypnotic toxidromes. This mimics difficulties that medical toxicologists have. The anticholinergic and sympathomimetic toxidromes share overlapping features (increased heart rate, increased blood pressure, and agitated mental status). The cholinergic, opioid, and sedative-hypnotic toxidromes share overlapping features (sedated mental status, and in the case of the cholinergic and opioid toxidromes slowed breathing and small pupils). \emph{Tak} was able to distinguish serotonergic toxicity from the anticholinergic and cholinergic toxidromes because serotonergic toxicity has unique features. Future work can explore the sensitivity of classification to each rule.

 \begin{figure}
     \centering
     \begin{tikzpicture}[scale=0.6]
    \begin{axis}[xbar,xmajorgrids, tick align=inside,
        major grid style={draw=white}, x axis line style = {draw=none},
        axis y line*=left, xtick={0,0.5,1},legend style={draw=none},
        xmajorgrids=true,
        bar width=0.5cm,symbolic y coords={
           Human-Human,Human-Tak,Human-Ground Truth, Ground Truth-Tak, DT-Ground Truth}, y axis line style={opacity=0},tickwidth=0pt,enlarge x limits=true,width=\columnwidth, height=12cm,
           enlarge y limits=0.1, enlarge x limits=0.1, ytick distance=1,
           legend style={font=\Large},
           tick label style={font=\LARGE}
           ]
            \addlegendimage{empty legend}
            \addlegendentry{\hspace{-1em}\textbf{Difficulty}}
           \foreach \i in {2,1,0}
           {
                \addplot+[draw=none,discard if not symbolic={difficulty}{\i},] table [
                    col sep=comma,y=type,x=kappa] {combined-consensus-kappas.csv};
                \addlegendentryexpanded{\i}
            }
    \end{axis}
\end{tikzpicture}
     \caption{\textbf{Human and Computer Agreement} Y-axis denotes Cohen's $\kappa$. X-axis denotes pair; Human raters, Intended (actual) labels, and Inferred (Tak) labels. Hue indicates difficulty of presentation. Refers to number of noncanonical symptoms in presentation. \label{fig:summary-of-performace}}
     \end{figure}

\section{Conclusions \label{sec:conclusions}}
 The goal of this study was to use probabilistic logic to model medical decision-making in medical toxicology. We derived probabilistic logic rules from expert consensus to represent background medical knowledge and constructed a probabilistic logic network, \emph{Tak}. We evaluated \emph{Tak}'s performance on a synthetic data set and compared its performance against the consensus of expert clinicians and a decision tree classifier.

The misclassification errors made by \emph{Tak} resemble those by humans. The decrease in inter-rater reliability for more difficult cases arose, in part, from the increased chance of the introduction of nondiscriminative physical findings. Toxidromes share overlapping features. For example, an elevated heart rate can be a sign of the anticholinergic or sympathomimetic toxidrome and, indeed, it can be difficult for clinicians to distinguish these two processes without further information.  For example, in a poisoned patient the heart rate and blood pressure usually move in tandem, both rising or both falling. This collinearity is such a hallmark of poisoned patients that its absence can prompt medical toxicologist to consider nontoxicological causes of the patient's condition.

\emph{Tak}'s error rate needs improvement before clinical use. Even if \emph{Tak} never reaches accuracy comparable to human physicians across all levels of difficulty, it could be used to automate the processing of more routine cases, where it's performance is comparable to humans, freeing up physician time to deal with more complex cases.

 The most significant limitation of this paper is the use of synthetic rather than actual data to evaluate our approach. We used synthetic data because no clinical data set currently exists. We took steps to generate realistic data, creating cases at $3$ levels of complexity to capture the heterogeneity of clinical data. We reviewed all cases with medical toixcologists for plausibility. Our data set dotes not fully evaluate \emph{Tak's} performance. It would require $\left(3^5\right) \cdot 4^5$ unique cases to fully evaluate all possible patient presentations, even clinically implausible ones. Our evaluation of actual performance is also limited by the omission of cases on whom the raters could not reach consensus.  The full value of our approach in helping physicians treat poisoned patients will not be known until our approach can be evaluated on actual clinical data.

 For most variables, empiric probability distributions were not available. This renders the absolute values of the calculated posterior probabilities uninformative even if the relative magnitude is still informative.

 Physicians must trust an AI-based system to include it in their evaluation and treatment of patients. An algorithm can earn that trust through proficiency on complex cases and transparency. \emph{Tak} demonstrates transparent clinical reasoning. This transparency, if preserved in more accurate models, may remove barriers to the use of AI approaches in clinical decision making.  Even if a more detailed analysis of the limits of PLNs suggests a unimprovably poor performance on complex cases, a transparent AI-system may be useful by automating aspects routine cases and in doing so freeing up expert time for more complicate cases.

 The main contribution of this paper is the demonstration that probabilistic logic networks can model toxicologic knowledge in a way that transparently mimic physician thought. An additional contribution of this paper is that it is one of the first, to the authors' knowledge, to quantify the inter-rater reliability of physicians in diagnosing a specific type of poisoned patient. Yet another contribution of this paper is the development of a data set that unsupervised or weakly supervised techniques could use to explore other ways of representing knowledge in this domain.

\addtolength{\textheight}{-.2cm}
\bibliographystyle{ieeetr}

Artificial Intelligence (cs.AI); Human-Computer Interaction (cs.HC); Machine Learning (cs.LG)