A computer-implemented method for obtaining a confidence measure for a machine learning model, the method comprising: processing input data with the machine learning model to generate a primary result; generating a plurality of modified instances of the input data; processing the plurality of modified instances of the input data with the machine learning model to generate a respective plurality of secondary results; and determining a confidence measure relating to the primary result based on the secondary results, wherein determining a confidence measure comprises: determining a measure of distribution or variance of the secondary results; and determining a confidence measure based on the determined measure of distribution or variance, wherein determining the measure of distribution or variance of the secondary results comprises determining at least one of: the inverse variance of the secondary results; the shannon entropy of the secondary results; the gini coefficient of the secondary results; the Kullback-Liebler divergence of the secondary results; and a concentration measure of the secondary results, wherein generating a plurality of modified instances of the input data comprises: applying a first spatial warping transformation to the input data to generate a first modified instance of the input data; applying a first inverse spatial warping transformation to the secondary result generated for the first modified instance of the input data. processing input data with the machine learning model to generate a primary result; generating a plurality of modified instances of the input data; processing the plurality of modified instances of the input data with the machine learning model to generate a respective plurality of secondary results; and determining a confidence measure relating to the primary result based on the secondary results, wherein determining a confidence measure comprises: determining a measure of distribution or variance of the secondary results; and determining a confidence measure based on the determined measure of distribution or variance, wherein determining the measure of distribution or variance of the secondary results comprises determining at least one of: the inverse variance of the secondary results; the shannon entropy of the secondary results; the gini coefficient of the secondary results; the Kullback-Liebler divergence of the secondary results; and a concentration measure of the secondary results, wherein generating a plurality of modified instances of the input data comprises: applying a first spatial warping transformation to the input data to generate a first modified instance of the input data; applying a first inverse spatial warping transformation to the secondary result generated for the first modified instance of the input data. determining a measure of distribution or variance of the secondary results; and determining a confidence measure based on the determined measure of distribution or variance, wherein determining the measure of distribution or variance of the secondary results comprises determining at least one of: the inverse variance of the secondary results; the shannon entropy of the secondary results; the gini coefficient of the secondary results; the Kullback-Liebler divergence of the secondary results; and a concentration measure of the secondary results, wherein generating a plurality of modified instances of the input data comprises: applying a first spatial warping transformation to the input data to generate a first modified instance of the input data; applying a first inverse spatial warping transformation to the secondary result generated for the first modified instance of the input data. the inverse variance of the secondary results; the shannon entropy of the secondary results; the gini coefficient of the secondary results; the Kullback-Liebler divergence of the secondary results; and a concentration measure of the secondary results, wherein generating a plurality of modified instances of the input data comprises: applying a first spatial warping transformation to the input data to generate a first modified instance of the input data; applying a first inverse spatial warping transformation to the secondary result generated for the first modified instance of the input data. applying a first spatial warping transformation to the input data to generate a first modified instance of the input data; applying a first inverse spatial warping transformation to the secondary result generated for the first modified instance of the input data.