An electronic device is provided. The electronic device includes a sensor, memory configured to store plurality of
fingerprint templates, each of the plurality of
fingerprint templates is an embedding vector indicating each of plurality of registered
fingerprint images, and at least one
computer program, and at least one processor communicatively coupled to the sensor and the memory, wherein the plurality of registered fingerprint images comprises a forged
fingerprint image made by
forging a fingerprint of a user, an abnormal state
fingerprint image comprising an obstacle obstructing fingerprint
authentication, and a
normal state fingerprint image which is either a successfully registered fingerprint image or a fingerprint
image matching the successfully registered fingerprint image, and wherein the at least one
computer program includes instructions that, when executed by the at least one processor individually or collectively, cause the electronic device to acquire, using the sensor, an input fingerprint image indicating a fingerprint image input by the user, identify whether the input fingerprint image matches at least a part of the plurality of registered fingerprint images based on the plurality of fingerprint templates, in case that the input fingerprint image matches the at least a part of the plurality of registered fingerprint images, generate at least one virtual fingerprint image, based on the input fingerprint
image matching the at least a part of the plurality of registered fingerprint images, store a template of the input fingerprint image and at least one template of the at least one virtual fingerprint image in the plurality of fingerprint templates, and
train a fingerprint generation
artificial intelligence model to generate a fingerprint image similar to the at least one virtual fingerprint image or the input fingerprint image.