A method, a device and a terminal for generating training data is provided. The method for generating training data includes: obtaining an original image; determining a transferred image based on the image style transfer model and the original image, wherein the image style transfer model is obtained by minimizing a loss function, the loss function is determined by the original loss function the background loss function and the foreground loss function; determining the training data based on the transferred image. The difference between the generated training data and the target image is small, thereby improving the accuracy of the training model obtained by using the training data.