Computer-implemented method for the reconstruction of medical image data ( r), comprising: - receiving the medical measuring data ( w), - minimising a cost value ( ε) as a result of a drop in gradient comprising the steps a) to e): a) reconstructing the medical image data ( r) comprising a number of image values ( r i) by applying a reconstruction function (g) to the received medical measuring data ( w) in accordance with reconstruction parameters ( p), b) determining a cost value ( ε) by applying a cost function (f) to the reconstructed medical image data ( r), wherein the cost function (f) comprises a trained function and is based on an image quality metric, wherein the cost value ( ε) is determined by applying the trained function to input data, wherein the input data is based on the reconstructed medical image data ( r) comprising a number of image values ( r i), wherein at least one parameter of the trained function is based on the image quality metric, c) determining a gradient of the cost function ( ∇ f) with respect to the reconstruction parameters ( p), d) adjusting the reconstruction parameters ( p) on the basis of - the gradient of the cost function ( ∇ f) with respect to the reconstruction parameters ( p) and - the previous reconstruction parameters ( p), e) providing the adjusted reconstruction parameters ( p '), wherein the steps a) to e) are repeated until a termination condition is met, - providing the reconstructed medical image data ( r). - receiving the medical measuring data ( w), - minimising a cost value ( ε) as a result of a drop in gradient comprising the steps a) to e): a) reconstructing the medical image data ( r) comprising a number of image values ( r i) by applying a reconstruction function (g) to the received medical measuring data ( w) in accordance with reconstruction parameters ( p), b) determining a cost value ( ε) by applying a cost function (f) to the reconstructed medical image data ( r), wherein the cost function (f) comprises a trained function and is based on an image quality metric, wherein the cost value ( ε) is determined by applying the trained function to input data, wherein the input data is based on the reconstructed medical image data ( r) comprising a number of image values ( r i), wherein at least one parameter of the trained function is based on the image quality metric, c) determining a gradient of the cost function ( ∇ f) with respect to the reconstruction parameters ( p), d) adjusting the reconstruction parameters ( p) on the basis of - the gradient of the cost function ( ∇ f) with respect to the reconstruction parameters ( p) and - the previous reconstruction parameters ( p), e) providing the adjusted reconstruction parameters ( p '), a) reconstructing the medical image data ( r) comprising a number of image values ( r i) by applying a reconstruction function (g) to the received medical measuring data ( w) in accordance with reconstruction parameters ( p), b) determining a cost value ( ε) by applying a cost function (f) to the reconstructed medical image data ( r), wherein the cost function (f) comprises a trained function and is based on an image quality metric, wherein the cost value ( ε) is determined by applying the trained function to input data, wherein the input data is based on the reconstructed medical image data ( r) comprising a number of image values ( r i), wherein at least one parameter of the trained function is based on the image quality metric, wherein the cost value ( ε) is determined by applying the trained function to input data, wherein the input data is based on the reconstructed medical image data ( r) comprising a number of image values ( r i), wherein at least one parameter of the trained function is based on the image quality metric, c) determining a gradient of the cost function ( ∇ f) with respect to the reconstruction parameters ( p), d) adjusting the reconstruction parameters ( p) on the basis of - the gradient of the cost function ( ∇ f) with respect to the reconstruction parameters ( p) and - the previous reconstruction parameters ( p), - the gradient of the cost function ( ∇ f) with respect to the reconstruction parameters ( p) and - the previous reconstruction parameters ( p), e) providing the adjusted reconstruction parameters ( p '), - providing the reconstructed medical image data ( r).