A computer aided diagnosis, CADx, system for reviewing medical images to determine if the images are acceptable for further analysis by the CADx system to determine a disease risk score, by identifying the respiratory state of the lungs as shown in a medical image, the system comprising: an input circuit for receiving at least one medical image; characterised by: a respiratory state assessor circuit for determining the respiratory state of the lungs in the input medical image, the respiratory state assessor consists of a respiratory state predictor circuit which reviews the input image, and can output a respiratory state prediction signal y that is indicative of the respiratory state of the patient at the moment the input image was acquired, where the respiratory state assessor is trained using a machine learning model with model parameters θ with a plurality of training images showing a range of different respiratory states; an optimiser running an optimisation algorithm; the training of the machine learning model comprising the steps of providing a training dataset of input images with corresponding ground truth labels which indicate a respiratory state at which the image was acquired: providing at least one image from the training set to the respiratory state predictor to output a respiratory state prediction; comparing the respiratory state prediction with the corresponding ground truth label to determine the accuracy of the machine learning model; using a loss function to compare the respiratory state prediction with the corresponding ground truth label; wherein the optimiser running the optimisation algorithm is used to reduce the loss, the output of the loss function, by measuring how much each model parameter θ contributed to the loss, and using the information to update the model parameters θ in such a way as to reduce the loss; repeating the above steps until the variation between the prediction and the ground truth level reaches a pre-set level; and an output circuit to produce an output confirming the respiratory state of the input image. an input circuit for receiving at least one medical image; characterised by: a respiratory state assessor circuit for determining the respiratory state of the lungs in the input medical image, the respiratory state assessor consists of a respiratory state predictor circuit which reviews the input image, and can output a respiratory state prediction signal y that is indicative of the respiratory state of the patient at the moment the input image was acquired, where the respiratory state assessor is trained using a machine learning model with model parameters θ with a plurality of training images showing a range of different respiratory states; an optimiser running an optimisation algorithm; the training of the machine learning model comprising the steps of providing a training dataset of input images with corresponding ground truth labels which indicate a respiratory state at which the image was acquired: providing at least one image from the training set to the respiratory state predictor to output a respiratory state prediction; comparing the respiratory state prediction with the corresponding ground truth label to determine the accuracy of the machine learning model; a respiratory state assessor circuit for determining the respiratory state of the lungs in the input medical image, the respiratory state assessor consists of a respiratory state predictor circuit which reviews the input image, and can output a respiratory state prediction signal y that is indicative of the respiratory state of the patient at the moment the input image was acquired, where the respiratory state assessor is trained using a machine learning model with model parameters θ with a plurality of training images showing a range of different respiratory states; an optimiser running an optimisation algorithm; the training of the machine learning model comprising the steps of providing a training dataset of input images with corresponding ground truth labels which indicate a respiratory state at which the image was acquired: providing at least one image from the training set to the respiratory state predictor to output a respiratory state prediction; comparing the respiratory state prediction with the corresponding ground truth label to determine the accuracy of the machine learning model; providing at least one image from the training set to the respiratory state predictor to output a respiratory state prediction; comparing the respiratory state prediction with the corresponding ground truth label to determine the accuracy of the machine learning model; using a loss function to compare the respiratory state prediction with the corresponding ground truth label; wherein the optimiser running the optimisation algorithm is used to reduce the loss, the output of the loss function, by measuring how much each model parameter θ contributed to the loss, and using the information to update the model parameters θ in such a way as to reduce the loss; repeating the above steps until the variation between the prediction and the ground truth level reaches a pre-set level; and an output circuit to produce an output confirming the respiratory state of the input image.