Data processing apparatus and method
11580390 · 2023-02-14
Assignee
Inventors
Cpc classification
G16H50/20
PHYSICS
G16H50/70
PHYSICS
G16H10/60
PHYSICS
International classification
G16H50/20
PHYSICS
Abstract
A medical system comprises processing circuitry configured to: receive a first trained model, wherein the trained model has been trained using a first data set acquired in a first cohort; receive a second data set acquired in a second cohort; input data included in the second data set and data representative of the first trained model into a second trained model; and receive from the second trained model an affinity-relating value which represents an affinity between the data included in the second data set and the first trained model.
Claims
1. A medical system comprising: processing circuitry configured to: receive a plurality of candidate first trained models, wherein the plurality of candidate first trained models have each been trained using a first data set acquired in a first cohort; receive a second data set acquired in a second cohort; train a second model to produce a second trained model to output affinity-relating values which represent affinity between data and an input candidate first trained model; for each of the plurality of candidate first trained models: apply a set of weights of the respective candidate first trained model to a plurality of data samples of the second data set to obtain a respective set of activation values for each of the data samples; apply the second trained model to data included in the second data set, the activation values obtained by applying the set of weights of the candidate first trained model to the data samples of the second data set, and data representative of the set of weights of the respective candidate first trained model to obtain a respective affinity-relating value which represents an affinity between the data included in the second data set and the respective candidate first trained model; and select at least one candidate first trained model from the plurality of candidate first trained models based on the respective affinity-relating values.
2. The medical system according to claim 1, wherein the affinity-relating value represents or is dependent on an affinity between the data included in the second data set and data included in the first data set.
3. The medical system according to claim 1, wherein the training comprises, for each data sample of a set of training data, inputting to the second model a set of weights for the first trained model and a set of activation values for the first trained model, wherein the activation values are obtained by inputting the data sample to the first trained model.
4. The medical system according to claim 1, wherein the first trained model comprises a first neural network and/or the second trained model comprises a second neural network.
5. The medical system according to claim 1, wherein the processing circuitry is configured to output a plurality of affinity-relating values which represent an affinity between data included in the second data set and the first trained model, and wherein the processing circuitry is configured to determine an aggregated value from the affinity-relating values.
6. The medical system according to claim 5, wherein the aggregated value comprises a median of the affinity-relating values.
7. The medical system according to claim 1, wherein the processing circuitry is configured to use the affinity-relating value to determine a suitability of use of the selected at least one candidate first trained model for the second data set.
8. The medical system according to claim 1, wherein the processing circuitry is further configured to input data included in the second data set and data representative of the first trained model into further second trained models, wherein the further second trained models are trained on different layers of the first trained model.
9. The medical system according to claim 1, wherein the training comprises supervised learning using at least part of the first data set and the first trained model.
10. The medical system according to claim 1, wherein the first trained model is trained to output a classification and/or a segmentation and/or an identification of an anatomical feature or pathology.
11. The medical system according to claim 1, wherein the first data set and second data set each comprise volumetric medical imaging data.
12. The medical system according to claim 1, wherein the training of the second trained model comprises using a loss function which compares the affinity-relating values output by the second trained model with ground truth information.
13. The medical system according to claim 12, wherein the loss function comprises a cross-entropy.
14. The medical system according to claim 12, wherein the loss function is weighted by an accuracy of the input trained model that is input to the second model.
15. A method comprising: receiving a plurality of candidate first trained models, wherein the plurality of candidate first trained models have each been trained using a first data set acquired in a first cohort; receiving a second data set acquired in a second cohort; training a second model to produce a second trained model to output affinity-relating values which represent affinity between data and an input candidate first trained model; for each of the plurality of candidate first trained models: applying a set of weights of the respective candidate first trained model to a plurality of data samples of the second data set to obtain a respective set of activation values for each of the data samples; applying the second trained model to data included in the second data set, the activation values obtained by applying the set of weights of the candidate first trained model to the data samples of the second data set, and data representative of the set of weights of the respective candidate first trained model to obtain a respective affinity-relating value which represents an affinity between the data included in the second data set and the respective candidate first trained model; and selecting at least one candidate first trained model from the plurality of candidate first trained models based on the respective affinity-relating values.
16. A medical system comprising: processing circuitry configured to train a second model to output affinity-relating values which represent affinity between data samples of a data set and at least one first trained model, the training comprising: receiving training data comprising a plurality of data samples, a respective set of weights of each of a plurality of first trained models, and activation values obtained by applying the respective set of weights of each of the plurality of first trained models to the training data; and using the training data, the data representative of the weights of the plurality of first trained models and the activation values for training the second model to output affinity-relating values.
17. A method comprising: training a second model to output affinity-relating values which represent affinity between data samples of a data set and at least one first trained model, the training comprising: receiving training data comprising a plurality of data samples, a respective set of weights of each of a plurality of first trained models, and activation values obtained by applying the respective set of weights of each of the plurality of first trained models to the training data; and using the training data, the data representative of the weights of the plurality of first trained models and the activation values for training the second model to output affinity-relating values.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) Embodiments are now described, by way of non-limiting example, and are illustrated in the following figures, in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
DETAILED DESCRIPTION
(17) Certain embodiments provide a medical system comprising processing circuitry configured to: receive a first trained model, wherein the trained model has been trained using a first data set acquired in a first cohort; receive a second data set acquired in a second cohort; input data included in the second data set and data representative of the first trained model into a second trained model; and receive from the second trained model an affinity-relating value which represents an affinity between the data included in the second data set and the first trained model.
(18) Certain embodiments provide a method comprising: receiving a first trained model, wherein the trained model has been trained using a first data set acquired in a first cohort; receiving a second data set acquired in a second cohort; inputting data included in the second data set and data representative of the first trained model into a second trained model; and receiving from the second trained model an affinity-relating value which represents an affinity between the data included in the second data set and the first trained model.
(19) Certain embodiments provide a medical system comprising processing circuitry configured to train a second model to output affinity-relating values which represent affinity between data samples of a data set and at least one first trained model, the training comprising: receiving training data comprising a plurality of data samples; receiving data representative of at least one first trained model; applying the at least one first trained model to the training data to obtain activation values; and using the training data, the data representative of at least one first trained model and the activation values for train the second model to output affinity-relating values.
(20) Certain embodiments provide a method for training a second model to output affinity-relating values which represent affinity between data samples of a data set and at least one first trained model, the training comprising: receiving training data comprising a plurality of data samples; receiving data representative of at least one first trained model; applying the at least one first trained model to the training data to obtain activation values; and using the training data, the data representative of at least one first trained model and the activation values for train the second model to output affinity-relating values.
(21) A data processing apparatus 20 according to an embodiment is illustrated schematically in
(22) The data processing apparatus 20 comprises a computing apparatus 22, which in this case is a personal computer (PC) or workstation. The computing apparatus 22 is connected to a display screen 26 or other display device, and an input device or devices 28, such as a computer keyboard and mouse.
(23) The computing apparatus 22 is configured to obtain image data sets from a data store 30. The image data sets have been generated by processing data acquired by a scanner 24 and stored in the data store 30.
(24) The scanner 24 is configured to generate medical imaging data, which may comprise two-, three- or four-dimensional data in any imaging modality. For example, the scanner 24 may comprise a magnetic resonance (MR or MRI) scanner, CT (computed tomography) scanner, cone-beam CT scanner, X-ray scanner, ultrasound scanner, PET (positron emission tomography) scanner or SPECT (single photon emission computed tomography) scanner.
(25) The computing apparatus 22 may receive medical image data from one or more further data stores (not shown) instead of or in addition to data store 30. For example, the computing apparatus 22 may receive medical image data from one or more remote data stores (not shown) which may form part of a Picture Archiving and Communication System (PACS) or other information system.
(26) Computing apparatus 22 provides a processing resource for automatically or semi-automatically processing medical image data. Computing apparatus 22 comprises a processing apparatus 32. The processing apparatus 32 comprises classifier training circuitry 34 configured to train a first model to perform a classification task; metalearner training circuitry 36 configured to train a second model to determine matches and mismatches between a new data sample and a given source distribution; model selection circuitry 38 configured to use a metalearner to select at least one trained model; and classification circuitry 39 configured to classify data using the selected at least one trained model.
(27) In the present embodiment, the circuitries 34, 36, 38, 39 are each implemented in computing apparatus 22 by means of a computer program having computer-readable instructions that are executable to perform the method of the embodiment. However, in other embodiments, the various circuitries may be implemented as one or more ASICs (application specific integrated circuits) or FPGAs (field programmable gate arrays).
(28) The computing apparatus 22 also includes a hard drive and other components of a PC including RAM, ROM, a data bus, an operating system including various device drivers, and hardware devices including a graphics card. Such components are not shown in
(29) The data processing apparatus 20 of
(30) Using the method of
(31) At stage 40 of
(32) In the present embodiment, the first data set comprises image data acquired using the scanner 24. The first training data set comprises a plurality of data samples, each of the data samples comprising a respective medical image. In other embodiments, each of the data samples may comprise any suitable data type.
(33) In the embodiment of
(34) At stage 42, the classifier training circuitry 34 uses the first training data set to train the first model to perform the binary classification task. The first model may be trained using any suitable model training method. In the present embodiment, the model training method comprises a supervised learning process. The first model is trained by minimizing a difference between binary classification values that are output by the model and ground truth classifications. In other embodiments, any suitable supervised or unsupervised learning process may be used to train the first model.
(35) At stage 44, the classifier training circuitry outputs the trained first model.
(36)
(37) The first trained model comprises a first set of model weights w.sup.1 which are applied to the data elements to obtain a set of activation values a.sup.1 for a set of nodes 62 of the model. The first model further comprises a second set of model weights w.sup.2 which are applied to the set of activation values a for the nodes 60 to obtain the model outputs 64. The outputs 64 have associated activation values a.sup.2.
(38) In the embodiment shown in
(39) During training, the weights w.sup.1, w.sup.2 of the first model are adjusted to improve the model's performance. Once the model has been trained, the model weights are fixed.
(40) For simplicity, only a single layer comprising a single set of nodes 62 is illustrated in
(41) At stage 44, the classifier training circuitry 34 outputs the trained first model. The trained first model may be represented by the set of model weights w.sup.1, w.sup.2. The trained first model may be used to perform a binary classification by inputting a new data sample to the model inputs 60.
(42) The metalearner training circuitry 36 receives the trained first model from the classifier training circuitry 34.
(43) At stage 46, the metalearner training circuitry 36 receives from the data store 30 and/or from a further data store (not shown) a second training data set comprising a plurality of data samples. The second training data set comprises at least some of the data samples of the first training data set. The second training data set also comprises further data samples that do not form part of the first training data set. The further data samples may comprise simulated data or augmented data. The further data samples may comprise data samples that are deliberately selected to be bad matches with the first training data set on which the first trained model was trained.
(44) At stage 48, the metalearner training circuitry 36 trains a second model 70, which may be referred to as a metalearner 70. In the description below, reference is made to training the metalearner 70 on the first trained model, which is trained to perform a binary classification. In other embodiments, the metalearner 70 may be trained on a plurality of trained models. The metalearner 70 may be trained on a plurality of similar models (for example, binary classifiers) that have been trained using different training conditions, for example using different random weight initializations. The metalearner 70 may be trained on a plurality of models that have been trained on different data sets and/or with different noise in a source distribution. The metalearner 70 may be trained on a combination of models which have be trained to perform any appropriate task or tasks. In some circumstances, model representations may be processed such that like-for-like nodes or filters are matched.
(45) Any suitable method may be used to train the metalearner 70. For example, the metalearner 70 may be trained using a method that has been developed to train one-shot learning algorithms for similarity metric learning. See, for example, Chopra, S., Hadsell, R. and LeCun, Y., 2005, June. Learning a similarity metric discriminatively, with application to face verification. In CVPR (1) (pp. 539-546); Vinyals, O., Blundell, C., Lillicrap, T. and Werstra, D., 2016. Matching networks for one shot learning. In Advances in neural information processing systems (pp. 3630-3638).
(46) In the present embodiment, the metalearner training circuitry 36 trains the metalearner 70 using a set of vector pairs (d, m).
(47) Vector m represents a trained model using a set of model weights. For example, the first trained model may be represented in a vector m comprising the weights w.sup.1, w.sup.2 of the first trained model. Vector m may be referred to as a model vector.
(48) Vector d represents a data sample and the activation of a trained model by said data sample. Vector d comprises data elements x of the data sample plus a set of data activations a that occur in the trained model when the data sample is input to the first trained model. For example, for a data sample that has been input to the first trained model, the vector d comprises the data elements x of the data sample plus the activation values a.sup.1, a.sup.2 that result from applying the first trained model to the data sample. Vector d may be referred to as a data vector.
(49) The metalearner training circuitry 36 trains the metalearner to determine whether each of the data samples was acquired in the first cohort or was not acquired in the first cohort. In the present embodiment, the first cohort comprises data acquired at a first institution. The data acquired at the first cohort has a distribution that may be referred to as a source distribution. A determination that the data sample was acquired at the first institution may be described as a match. A determination that the data sample was not acquired at the first institution may be described as a mismatch.
(50) The metalearner learns to match the activation patterns produced by the input d with the model m. In the present embodiment, the metalearner 70 is trained in a supervised way by being provided with lots of data-model pairs, including both data samples that match with the source distribution and data samples that do not match with the source distribution.
(51)
(52) The metalearner 70 is trained to output 76 a probability P(match) of whether the data sample of the data vector d matches a distribution on which the model was trained. The value for the probability P(match) may be referred to as an affinity-relating value. The probability P(match) is representative of an affinity between the data sample and the model. The probability P(match) is representative of an affinity between the data sample and the data on which the model was trained.
(53) The metalearner 70 is trained using a loss function of binary cross-entropy (CE) for a P(match) value that is produced by the metalearner versus the true answer. The true answer denotes whether the data sample comes from the same institution at which the model was trained (same institution=1, match) or whether the data sample comes from a different institution (different institution=0, mismatch). The cross-entropy may be written as CE(P(match), Label(match)) where Label denotes the true answer.
(54) In other embodiments, any suitable training method may be used to train the metalearner 70. The training of the metalearner 70 may be supervised or unsupervised.
(55) At stage 50, the metalearner training circuitry 36 outputs the trained metalearner 70. The model selection circuitry 38 receives the first trained model (which in this embodiment is a trained classifier) and the trained metalearner 70. The model selection circuitry 38 also receives further trained models, which in the present embodiment are also trained classifiers. Some or all of the further trained models may have been trained on different data processing apparatuses. Some or all of the trained models may have been trained using data that is not available to the data processing apparatus 20.
(56) The first trained model and the further trained models may be considered to form a set of candidate models 84. At stage 52, the model selection circuitry 38 applies the metalearner 70 to the set of candidate models 84 to select one or more of the candidate models using a method as illustrated in overview in
(57) Turning to
(58)
(59) For each candidate model 84, the model selection circuitry 38 applies the candidate model 84 to each of the data samples 82 in the data set 80. For each data sample 82, the model selection circuitry 84 obtains a data vector d which comprises data x of the data sample and a corresponding set of data activations a. The data activations a are representative of activations of the candidate model 84 when the data x is input to the candidate model 84.
(60) For each of the data samples 82 in the target data set 80, the model selection circuitry 38 applies the metalearner 70 to the data vector d for the data sample 82 and the model vector m for the candidate model 84. d and m are input to the metalearner 70. The metalearner 70 outputs a value 86 for a probability of a match, P(match), for the data sample 82.
(61) The model selection circuitry 38 aggregates the P(match) values for all of the data samples 82 in the target data set 80.
(62) If the candidate model 84 and the target data set 80 have a good match, it is expected that the plot 88 will show a distribution of matching probabilities that is skewed towards 1. Such a distribution is illustrated in
(63) In the present embodiment, the model selection circuitry 38 also obtains a single aggregated P(match) value 90 for the target data set 80. To obtain the single value 90 for the target data set, a metric such as the median may be used. In the example shown in
(64) The model selection circuitry 38 compares the P(match) distribution and/or aggregated P(match) value for each candidate model 84 to the P(match) distribution and/or aggregated P(match) value for the other candidate models 84.
(65) The model selection circuitry 38 selects one or more of the candidate models to use in classifying the new data set. The selection of the one or more of the candidate models 84 is based on the comparison of the P(match) distribution and/or aggregated P(match) value for each of the candidate models 84. For example, the model selection circuitry 38 may select the candidate model 84 having the highest aggregated P(match) value. The model selection circuitry 84 may select a number (for example, 2, 3, 4 or 5) of candidate models 84 having the highest aggregated P(match) value. In other embodiments, the model selection circuitry 84 may select all candidate models having an aggregated P(match) value that is above a threshold value.
(66) The model selection circuitry 38 outputs a selection of one or more candidate models 84. The classification circuitry 39 receives the selected one or more candidate models 84.
(67) We return to the flow chart of
(68) At stage 54, the classification circuitry 39 uses the selected one or more candidate models 84 to classify data samples of the target data set 80. In the present embodiment, the selected models 84 each perform a binary classification. In other embodiments, the selected models 84 may be models that are trained to perform any suitable task, for example any suitable classification, regression, segmentation or identification.
(69) In the method of
(70) It is known that the candidate models may typically have limited support. Models may perform best in the domain they were trained, or on the source data. The method of
(71) The metalearner 70 learns to map data (model activation) to a model (weights). The metalearner 70 may learn to distinguish between normal activations which may occur when a model is applied to data similar to that on which is trained, and abnormal activations which may occur when a model is applied to data that is less similar to that on which it is trained. In some circumstances, the metalearner 70 may generalize to models other than the model or models on which it is trained.
(72) The metalearner 70 may match models to data distributions even when the data distributions are complex. For example, the data distributions may relate to intensities, anatomical content, noise characteristics and/or alignment properties.
(73) The use of the metalearner 70 may facilitate selection of a model from a plurality of candidate models, for example from a model zoo. The metalearner 70 may select models automatically, with minimal expert input. The use of a metalearner 70 may make it more straightforward to use trained models at institutions other than the institution at which a given model was trained.
(74) The metalearner 70 may be used to select models in a federated learning setup in which models are trained at multiple institutions. Data from each institution may not be available to other institutions.
(75) The metalearner 70 may be used to select training data on which to train a model. The metalearner 70 may be used to select a trained model before fine-tuning that model with further training. In some circumstances, less specialist input may be needed to fine-tune a model if information about the model has been obtained by the metalearner 70. The metalearner 70 may be used to select a trained model to which knowledge is to be added by continual learning.
(76) In some embodiment, a separate metalearner is trained for each task and model architecture. In other embodiments a metalearner may generalize between tasks and/or architectures.
(77) In some embodiments, a metalearner is trained on a single model and is only used on the model on which it is trained. In other embodiments, a metalearner is trained on multiple models. The metalearner may be a general metalearner that can work for unseen models.
(78) To train the metalearner, the metalearner may be provided with examples of annotated data for which each model does well, and examples of annotated data for which each model does poorly. In some circumstances, the metalearner does not have access to data on which one or more of the models was trained. In general, the metalearner may be provided with access to annotated examples (comprising data and labels) in both categories (good performance, bad performance) across the models. In some circumstances, the best performance of the metalearner may be obtained when examples of both categories are available for every model.
(79) In some embodiments, the performance of a model is used as a proxy for training distribution. If the model performs well on given data, it may be assumed that the data is within a distribution similar to that on which the model was trained. If the model performs poorly on given data, it may be assumed that the data is out of distribution.
(80) In the embodiment described above, the first model (which in the present embodiment is a binary classifier) and the metalearner 70 are each trained by the data processing apparatus 10. The data processing apparatus 10 applies the metalearner 70 to select models, which may include the first model.
(81) In other embodiments, the first model and metalearner 70 are each trained by an apparatus different from the apparatus at which they are applied. In some circumstances, the first model is trained by one apparatus and the metalearner 70 is trained by a different apparatus.
(82) In one embodiment, the data processing apparatus 10 at a first institution trains a first model and a metalearner 70 on data held at that institution. The data processing apparatus 10 provides the trained first model and the trained metalearner 70 to a second apparatus that is outside the first institution. For example, the second apparatus may be an external server. The external server may comprise a centralized repository. The external server may comprise a server at another entity, for example at a different hospital.
(83) The training data set is not provided to the external server. Data restrictions may be such that the training data set is not permitted to leave the first institution. The first model and metalearner 70 were each trained on data from the first institution, but do not comprise data from the first institution. Therefore, it may be permissible to provide the trained first model and/or metalearner 70 to the external server.
(84) The external server stores a plurality of trained models, including the first trained model. The plurality of models may be referred to as a model zoo. The plurality of models comprises multiple models that are trained to perform the same task. The models have been trained on different data cohorts. For example, the models may have been trained at different institutions.
(85) The metalearner 70 may be used at the external server to select one or more of the trained models to be used on a target data set, as described above with reference to
(86) In the embodiment described above with reference to
(87) In further embodiments, the metalearner's output is weighted by the accuracy of the candidate model 84 for the task that the candidate model 84 is trained to perform. In such a case, the cross-entropy with which the metalearner is trained may be written as: Weighted_CE(P(match), Label(match), P(true class))
(88) In some circumstances, matching only to the source distribution of each model 84 may not provide the best result. For example, if a data sample comes from institution A but a model 84 trained at institution A performs poorly for that sample (perhaps because institution A has little data), then a match between the institution A and the data sample may be considered to be invalid.
(89) In some circumstances, a model trained on data from institution B may perform well for a data sample from institution A. For example, the populations of institution A and institution B may be similar. Institution B may have more data available than institution A. If a data sample comes from institution A but a model trained on data from institution B does well for that data sample, a mismatch between the data sample and institution B may be considered to be invalid.
(90) A weighting factor may be added to the cross-entropy. The weighting factor may be added to account for the possibility of a model performing well on data from a different institution and/or a model performing poorly on data from its own institution. The weighting factor may be derived from the performance of the model on the data sample.
(91) If the task is classification, the cross-entropy may be weighted by the accuracy of the model of the data sample, P(true class).
(92) In the equation below, P(match) is written as P.sub.Match, Label(match) is written as Y.sub.Match, P(class) is written as P.sub.C and Label(class) is written as P(class) or P.sub.C is the output of the model, which provides a probability of a binary classification. Label(class) or Y.sub.C is the ground truth value for the classification.
CE(P.sub.Match,Y.sub.Match).sub.=Y.sub.Match log(P.sub.Match)+(1−Y.sub.Match)log(1−P.sub.Match)
Weighted_CE(P.sub.MatchY.sub.matchP.sub.C,Y.sub.C)=Σ.sub.c=1.sup.nY.sup.c[P.sup.cY.sup.Match log(P.sup.Match)+(1−P.sup.c)(1−Y.sup.Match)log(1−P.sup.Match)]
(93) The weighted cross-entropy may be used to train the metalearner 70.
(94) By including performance of the model 84 when training the metalearner 70, model selection may be improved. The model selection circuitry 38 may use the metalearner 70 to select one or more models 84 for use of a target data set based not only on the similarity of the target data set to the data sets on which the models were trained, but also on the performance of the models 84. Models 84 that do not have good performance on given target data may be downweighted, even if the model 84 was trained using similar data to the target data.
(95) In the embodiment shown in
(96) In many embodiments, the trained first model (for example, a classification or regression model) is a neural network comprising multiple layers. In some embodiments, a layerwise metalearner is used. The layerwise metalearner may learn from early activations as well as from later ones. For example, the metalearner may comprise multiple metalearners desired from successive intermediate levels. The use of an ensemble of multiple layers may be considered to be similar to the idea of deep supervision, for example as described in Zeng, G., Yang, X., Li, J., Yu, L., Heng, P. A. and Zheng, G., 2017, September. 3D U-net with multi-level deep supervision: fully automatic segmentation of proximal femur in 3D MR images. In International Workshop on Machine Learning in Medical Imaging (pp. 274-282). Springer, Cham.
(97)
(98) A first metalearner 101 is trained using values for the inputs 90 and for activations of the first layer 91. The first metalearner 101 may be trained using any suitable method, for example using a method as described above with reference to
(99) A second metalearner 102 is trained using values for the inputs 90 and for activations of the first layer 91 and second layer 92. The second metalearner 102 may be trained using any suitable method, for example using a method as described above with reference to
(100) A third metalearner 103 is trained using values for the inputs 90 and for activations of the first layer 91, second layer 92 and third layer 93. The third metalearner 103 may be trained using any suitable method, for example using a method as described above with reference to
(101) A fourth metalearner 104 is trained using values for the inputs 90 and for activations of the first layer 91, second layer 92, third layer 93 and outputs 94. The fourth metalearner 104 may be trained using any suitable method, for example using a method as described above with reference to
(102) Once trained, model selection circuitry 38 uses the ensemble of metalearners 101, 102, 103, 104 to determine a match between a candidate model 84 and a target data set 80. In the embodiment of
P(match)=Σ.sub.x=1.sup.nw.sub.xP(match).sub.x
(103) The model selection circuitry 38 obtains the weighted sum of the estimated matching probabilities P(match).sub.1, P(match).sub.2, P(match).sub.3, and P(match).sub.4 using a set of weights w.sub.x with x from 1 to 4. In some embodiments, the weights w.sub.x may be learned during training of the ensemble of metalearners 101, 102, 103, 104.
(104) By using multiple metalearners 101, 102, 103, 104, features at different levels of the neural network may be captured. Towards the input, it may be expected that generic features may be extracted, for example edges. Towards the output, more complex or specific features may be extracted. In some circumstances, a better identification of unusual activation patterns may be obtained when metalearners that act on different layers of the neural network are combined.
(105) In some embodiments, layerwise convolutional kernels (applied to all nodes/kernels in a layer) and/or layerwise max pooling operations may be used.
(106) For convolutional neural network models as applied to images, a metalearner may depend on learning characteristic spatial patterns in the activations across the voxelwise input. The spatial patterns in the activations may be referred to as characteristic feature maps. In some embodiments, the metalearner is provided with the intermediate feature maps.
(107)
(108) The model comprises a set of layers 110. Arrows 111 are representative of convolution operations, which in this example are 3×3 convolutions. Arrows 112 are representative of max pooling operations, which in this example have stride 2. Arrows 113 are representative of up-convolution operations, which in this example have stride 2. Arrows 114 are representative of skip connections.
(109) All of the blocks shown in the U-Net diagram may be possible inputs to a metalearner for the segmentation task performed by the U-net. The metalearner may look at activations across the image and learn spatial information. In the case of image data, a prediction is known for each pixel and also for its neighbors. The metalearner may be presented with information for the whole image at once. The metalearner may be presented with some or all of the feature maps that are generated by the U-Net.
(110) In some embodiments, the model weights are not input into the metalearner. Instead, the model receives spatial patterns between the activations. The use of spatial patterns of activations may be particularly appropriate to convolutions imaging models.
(111) A first model, classifier 120, was trained to classify 1s and 0s from the MNIST (Modified National Institute of Standards and Technology) database of handwritten digits. The classifier 120 receives an input image 121. The input image 121 passes through four layers 122A, 122B, 122C, 122D via pooling operations 123A, 123B, 123C to obtain an output which comprises a prediction 124A, 124B of whether the input image 121 represents a 1 or a 0. The intermediate activations at layers 122, 123, 124, 125 are feature maps.
(112) A second model, metalearner 125 was trained on the intermediate feature maps from layers 122A, 122B, 122C, 122D of the classifier 120. The metalearner 125 received a data representation d. The metalearner did not receive the model weights.
(113) In the metalearner 125 of
(114) The metalearner 125 was trained using 0s and 1s as matched data, and 2s, 3s, 4s, 5s, 6s and 7s as the unmatched data. The metalearner 125 was trained to return a match when the activations of the classifier 120 correspond with an input that is a 0 or 1, and to return a mismatched when the activations of the classifier 120 correspond with an input that is a 2, 3, 4, 5, 6 or 7. Straight cross-entropy was used as the loss function.
(115) The model was tested on a held back set of images. The held back set of images contained new images of the classes that the classifier 120 had been trained to distinguish (0s and 1s), and unseen data (0s, 1s, 2s, 3s, 4s, 5s, 6s, 7s, 8s and 9s).
(116) In training, the metalearner 125 had learned that 0s and 1s match the classifier 120, and 2s to 7s are mismatched with the classifier 120.
(117)
(118)
(119) Images 152 are images for which the metalearner 125 outputs a probability in the central region of the graph. The probability is neither very low or very high. It may be seen that images sampled from the center of the graph have many similar features to the matched distribution of 1s and 0s. For example, the images 152 include some 9s and 6s that are written in such a way to look similar to 1s and 0s. The images 152 also include a 1 which has been rotated.
(120) Images 154 at the high probability end of the graph are 1s and 0s. The metalearner has correctly learned that 1s and 0s match the model.
(121) The metalearner 125 was also tested on a matched example (a number 1) as it was rotated through 360 degrees. The classifier 120 had been trained on numbers having a standard orientation.
(122) The prediction of the classifier 120 is shown by points 162. A prediction value of 1 indicates a prediction of number 1, and a prediction value of 0 indicates a prediction of number 0. It can be seen from points 162 that when the example number 1 is rotated by 90 degrees, the classifier 120 classifies the image incorrectly. When the number 1 is rotated by 90 degrees, the classifier classifies the image as a 0. This is because the input data at 90 degrees is outside the limited support of the training data.
(123) The prediction of the metalearner 125 is shown by points 164. A value of 1 indicates that the metalearner 125 has determined a match with the model. A value of 0 indicates that the metalearner has determined a mismatch with the model 120. The metalearner 125 correctly identifies that the image at 90 degrees of rotation does not match the model 120.
(124)
(125) The user interface 170 shows a set of icons representing a plurality of trained models 172A, 172B, 172C, 172D. The models 172A, 172B, 172C, 172D may be trained to perform any appropriate task. For example, the models 172A, 172B, 172C, 172D may be trained classifiers. Only four trained models 172A, 172B, 172C, 172D are illustrated for simplicity. In practice, any number of trained models 172A, 172B, 172C, 172D may be available for use.
(126) The user interface 170 also shows icons representing a set of anatomical regions. In the example shown in
(127) The user interface 170 also includes a button 176. At the start of a user interaction process as illustrated in
(128)
(129) In response to the user's selection of the brain, the model selection circuitry 38 inputs data into each of the models 172A, 172B, 172C, 174D, the data comprising brain images.
(130) The model selection circuitry 38 inputs the model activations produced by the brain images to a trained metalearner 70 to determine an aggregated P(match) value for each of the models 172A, 172B, 172C, 174D, for example using a method as described above with reference to
(131) The model selection circuitry 38 selects the one of the models 172A, 172B, 172C, 174D having the highest aggregated P(match) value. The model selection circuitry 38 displays on the user interface 170 an icon 190 representing the selected model. The model selection circuitry 38 also displays a plot of P(match) values 192 and an aggregated P(match) value 194 for the selected model.
(132) The model selection circuitry 38 changes the text of the button 176 to ‘Best model found’.
(133) In other embodiments, the selected model 190 and/or plot 192 and/or aggregated P(match) value may not be displayed to the user. For example, the user may just be informed that a best model has been found. The selected best model may be passed internally to the classification circuitry 39 or to another circuitry or apparatus. The selected best model may be used to perform any appropriate task.
(134) In the embodiment described above with reference to
(135) Embodiments describes above relate to the selection of models for processing medical image data. In other embodiments, the models may be for the processing of any type of medical data, for example, clinical notes, vital sign data or laboratory data. The models may be for processing data from any human or animal subject or subjects. The models may relate to any suitable anatomy and/or pathology.
(136) In further embodiments, the models may be for the processing of any type of data, which may not be medical data. The models to be compared and selected may be trained to perform any appropriate task or tasks. The metalearner may be trained on any one or more models.
(137) Certain embodiments provide a machine learning model and data sample matching tool, and a method comprising a metalearner trained to map the data sample to the model. The data sample and the model are represented as vectors d and m, where m comprises the model weights. The metalearner is trained by classifying the institution that the data sample d came from as the same institution (match) or a different institution (mismatch) as the model. The metalearner training also incorporates the accuracy of the model m on the data sample d so as to downweight samples where the model match does not correlate with the model performance. The metalearner has a number of outputs, at intermediate levels in the model, and the result is a combination of the outputs e.g. weighted average. If the model is a convolutional neural network, the metalearner may also learn from intermediate spatial/sequential representations in the network (activations a (from within d) across pixels/voxels, i.e. feature maps.
(138) The metalearner may be used to select one or multiple models (i.e. ensemble) to apply to the novel data sample. Multiple novel data samples may be treated as a distribution and summary metrics (e.g. mean) used to select the model(s). The metalearner may be used to detect anomalous data on which the model will not perform well.
(139) The metalearner may be used for the purpose of selecting training data for personalized models in a federated learning setup. The metalearner may be used for the purpose of selecting a pre-trained model in order to fine-tune (adapt). The metalearner may be used for the purpose of selecting a pre-trained model in order to add knowledge (continual learning).
(140) Certain embodiments provide a method of processing medical data comprising: applying a trained model to a target medical data set to generate an output, wherein the model has been trained on a plurality of source data sets; determining a measure of relevance of the source data sets to the target data set; using the determined measure of relevance to determine the suitability of the use of the model for the target data set.
(141) The determining of the measure of relevance may comprise using a further, trained relevance-learning model, that has been trained on data generated by source models being applied to source data sets, wherein the using of the trained relevance-learning model comprises applying the trained relevance-learning model to data generated when the trained relevance-learning model is applied to the target data set, thereby to obtain the measure of relevance.
(142) The applying of the trained model to the target data set may produce intermediate data that is used to generate the output, and the generated data to which the further trained relevance-learning model is applied may include said intermediate data.
(143) The intermediate data may comprise at least one of: model weights for at least one layer of the model; data and model weight pair vectors.
(144) The trained relevance-learning model may be trained using model weights generated by source models applied to source data sets.
(145) The trained relevance-learning model may be trained in a supervised manner to distinguish between source models applied to source data sets for which the source models are more suitable and source models applied to source data sets for which the source models are less suitable.
(146) The suitability may be determined based on similarity of the distribution of the source data and/or based on the origin of the source data on which the source models were trained.
(147) The training of the relevance-learning model may include using a weighting, optionally based on cross-entropy, to weight the importance of at least some of: data-distribution similarity, origin of source data and/or source model, and at least one other property of the source data and/or source models.
(148) The determined measure of relevance may be based on a similarity of data distribution for the data set and for the source data sets on which the model was trained.
(149) The determining of the measure of relevance may comprise using a plurality of further, trained relevance-learning models, that have been trained on data generated by source models being applied to source data sets, wherein different ones of the trained relevance-learning models are trained on different layers of the source models.
(150) The determined measure of relevance may be used to select a model from the plurality of candidate models.
(151) The data set may comprise volumetric medical imaging data. The data set may comprise a set of voxels representing a volume. The output may comprise a segmentation and/or an identification of an anatomical feature or pathology.
(152) Certain embodiments provide a medical system comprising a processing circuitry configured to: receive a first neural network trained by first data set acquired in a first cohort, receive second data set acquired in a second cohort, output affinity-relating value which represents an affinity between data included in the second data set and the first neural network by inputting the data included in the second data set and the first neural network to a second neural network, wherein the second neural network is trained to output affinity-relating value based on predetermined data and a predetermined trained neural network.
(153) The processing circuitry may be further configured to train the second neural network by giving a supervision by inputting the first data set.
(154) The processing circuitry may be further configured to train the second neural network by inputting weights of the first neural network and the values of perceptron of the first neural network when inputted a predetermined data to the first neural network.
(155) The processing circuitry may be further configured to output a plurality of affinity-relating values which represents an affinity between data included in the second data set and the first neural network, specify a median value among the plurality of affinity-relating values.
(156) Whilst particular circuitries have been described herein, in alternative embodiments functionality of one or more of these circuitries can be provided by a single processing resource or other component, or functionality provided by a single circuitry can be provided by two or more processing resources or other components in combination. Reference to a single circuitry encompasses multiple components providing the functionality of that circuitry, whether or not such components are remote from one another, and reference to multiple circuitries encompasses a single component providing the functionality of those circuitries.
(157) Whilst certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the invention. Indeed the novel methods and systems described herein may be embodied in a variety of other forms. Furthermore, various omissions, substitutions and changes in the form of the methods and systems described herein may be made without departing from the spirit of the invention. The accompanying claims and their equivalents are intended to cover such forms and modifications as would fall within the scope of the invention.