liveBook · Manning

Surrogate model

As explained in Build AI Drug Discovery Pipelines

A surrogate model is an inexpensive predictive model that approximates the performance or outputs of a more computationally expensive process.

A surrogate model approximates the outputs or performance of another model or process. It can provide cheaper predictions than an expensive calculation, or make a black-box model easier to interpret. Its predictions are approximations, not replacements for checking promising results with the original process. section 6.4.3 section 9.2.1

In virtual screening, docking estimates how well a molecule may bind to a target, but docking every candidate in a large library can be costly. A surrogate trained on docking scores predicts scores for the remaining molecules, helping choose which ones to dock next. section 9.0 section 9.2.1

A practical active learning cycle uses the surrogate to spend a limited docking budget:

  • Select and dock an initial set of molecules. Diversity-based sampling can cover more chemical space than random sampling when a library contains many similar structures. section 9.2.4
  • Train the surrogate on molecular features and docking scores, then predict scores for the remaining pool. section 9.2.2 section 9.2.1
  • Use an acquisition function to select a batch, dock it, add its scores to the training set, and retrain. Repeat until the budget is exhausted. section 9.2.7
  • Track predictive performance, convergence, and changes in the selected compound pool. When reference scores are available, count how many top-scoring molecules the process recovers. section 9.2.3 section 9.2.7
Listing 9.5 Deep Learning Surrogate Model for Binding Affinity Prediction
class DeepDockingModel(nn.Module):
    def __init__(self, input_size, hidden_size, output_size=1):
        super(DeepDockingModel, self).__init__()
        
        self.layers = nn.Sequential(    #A
            nn.Linear(input_size, hidden_size),
            nn.ReLU(),
            nn.Dropout(0.5),
            nn.Linear(hidden_size, hidden_size // 2),
            nn.ReLU(),
            nn.Dropout(0.5),
            nn.Linear(hidden_size // 2, output_size)
        )
 
    def forward(self, x):
        return self.layers(x)
 
    def predict(self, fingerprints, device):
        self.eval()    #B
        with torch.no_grad():    #C
            inputs = torch.tensor(
                np.atleast_2d(fingerprints), dtype=torch.float32
            ).to(device)    #D
            outputs = self(inputs)    #E
            return outputs.cpu().numpy().flatten()

This PyTorch surrogate uses three fully connected layers to predict docking scores from molecular fingerprints. ReLU adds nonlinearity, while dropout helps limit overfitting. section 9.2.2

One implementation uses 1,024-bit Morgan fingerprints with radius 2, mean squared error, and the Adam optimizer. When very few labeled examples are available, a Gaussian process is an alternative that can be more data-efficient than a neural network. section 9.2.2 section 9.2.3

Recovering top docking candidates

In a run against the VEGFR-2 dataset 4AG8, the process started with 5,000 molecules and selected 250 more per iteration. After 10 iterations, it had found 73 of the reference top 100 molecules, with 7,500 molecules evaluated in total. section 9.2.7 section 9.4

Surrogates can also predict the accuracy of free energy perturbation protocols. Initial calculations provide errors for training; predicted low-error protocols receive further evaluation, and the final protocol is validated on a separate set of ligands. section 9.3.1

For interpretation, a surrogate can approximate a difficult-to-understand model rather than an expensive physical calculation. Shapley values attribute a molecule’s prediction to its descriptors by considering their contributions across coalitions of features. section 6.4.3

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Develops a neural surrogate, its training procedure, and an iterative selection loop, while identifying Gaussian processes as a low-data alternative.
Examples
Uses a VEGFR-2 docking experiment and free energy perturbation protocol selection to illustrate surrogate-guided decisions.
What it assumes
Assumes familiarity with supervised learning when training the docking surrogate.
What you can do after
Apply it via PyTorch to predict docking scores and guide an active learning screening loop.
How it connects
Connects surrogate models to active learning, molecular docking, Gaussian processes, and Shapley values.

Also explained in

Compare how 7 books explain surrogate model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.