Inference

Using a trained model to produce output on new input data.

What happens when the next returned book arrives?

A library has already trained a model to recognize spine labels. A new book passes under a camera. For this example the model version is fixed, and the application uses its output to decide whether a person should inspect the scan.

  1. Prepare the input

    Crop the spine and use the same image size and pixel convention expected by the model. A changed camera orientation can affect this step.

  2. Run the model

    The model computes a label prediction from this image and its stored parameters. Processing one new book does not by itself update those parameters.

  3. Apply the policy

    The application can route uncertain readings for review. A later process may use reviewed cases for training, with a new model version and separate checks.

Where should latency be measured?

Time the full route from an available camera frame to a usable decision, as well as the model call itself. Image loading, preprocessing, queues and review routing can dominate the experience even when the forward pass is fast.

A book passes under a reader on a library conveyor.
One new input can receive a prediction with the fitted model held fixed.

Which evidence explains a changed result?

Record the input, model version, preprocessing and decision rule. A new threshold can change the route without changing the model prediction. A changed input can alter the prediction while the model weights stay fixed.

Follow the idea

Model Parameters · Identify what stays fixed during this example.

Data Preprocessing · Check the input transformations needed for a reliable prediction.

Source · PyTorch guide to training, saving and using a model for predictions

Return to Inference in the A–Z glossary