A processor-implemented method with liveness detection, comprising: receiving a plurality of phase images, each obtained using a respective plurality of sub-pixels of an image sensor in which each pixel includes at least two sub-pixels corresponding to different phases; generating a plurality of preprocessed phase images by performing preprocessing, including edge enhancement processing, on the plurality of phase images of different phases, wherein the preprocessed phase images include a first preprocessed phase image and a second preprocessed phase image; generating a plurality of differential images based on the preprocessed phase images by: setting a first basic region in the first preprocessed phase image; setting a plurality of shifted regions in the second preprocessed phased image by shifting a second basic region in the second preprocessed phase image corresponding to the first basic region in the first preprocessed phase image by a number of pixels; generating a differential image for each shifted region indicating a difference in pixel values between the first basic region in the first preprocessed phase image and the respective shifted region in the second preprocessed phase image; generating a plurality of low-resolution differential images having lower resolutions than the differential images, by reducing the size of the differential images; generating a minimum map image identifying, for each pixel of the minimum map image, either the minimum value of the corresponding pixels of the low-resolution differential images or an index of the low-resolution differential image which includes this minimum value; generating a plurality of low-resolution phase images by reducing the image size of the plurality of phase images such that they have the same resolution as the resolution of the minimum map image; and performing a liveness detection on an object in the phase images by applying, as input, the low-resolution phase images and the minimum map image to a neural network-based liveness detection model. receiving a plurality of phase images, each obtained using a respective plurality of sub-pixels of an image sensor in which each pixel includes at least two sub-pixels corresponding to different phases; generating a plurality of preprocessed phase images by performing preprocessing, including edge enhancement processing, on the plurality of phase images of different phases, wherein the preprocessed phase images include a first preprocessed phase image and a second preprocessed phase image; generating a plurality of differential images based on the preprocessed phase images by: setting a first basic region in the first preprocessed phase image; setting a plurality of shifted regions in the second preprocessed phased image by shifting a second basic region in the second preprocessed phase image corresponding to the first basic region in the first preprocessed phase image by a number of pixels; generating a differential image for each shifted region indicating a difference in pixel values between the first basic region in the first preprocessed phase image and the respective shifted region in the second preprocessed phase image; setting a first basic region in the first preprocessed phase image; setting a plurality of shifted regions in the second preprocessed phased image by shifting a second basic region in the second preprocessed phase image corresponding to the first basic region in the first preprocessed phase image by a number of pixels; generating a differential image for each shifted region indicating a difference in pixel values between the first basic region in the first preprocessed phase image and the respective shifted region in the second preprocessed phase image; generating a plurality of low-resolution differential images having lower resolutions than the differential images, by reducing the size of the differential images; generating a minimum map image identifying, for each pixel of the minimum map image, either the minimum value of the corresponding pixels of the low-resolution differential images or an index of the low-resolution differential image which includes this minimum value; generating a plurality of low-resolution phase images by reducing the image size of the plurality of phase images such that they have the same resolution as the resolution of the minimum map image; and performing a liveness detection on an object in the phase images by applying, as input, the low-resolution phase images and the minimum map image to a neural network-based liveness detection model.