An electronic device comprising: a memory configured to store information related to an artificial intelligence model that performs an arithmetic operation through a plurality of neural network layers; and a processor configured to pre-process raw data and obtain output data by inputting the pre-processed data to the artificial intelligence model, wherein first data used for the pre-processing of the raw data and second data used in some of the plurality of neural network layers are stored in a secure area of the memory, and third data used in remaining layers of the plurality of neural network layers is stored in a non-secure area of the memory, wherein the first data includes at least one of data used for filtering of raw data to be input to the artificial intelligence model among a plurality of raw data, or data used for conversion of raw data into input data to be input to the artificial intelligence model, wherein the second data includes information regarding parameters used in a last layer of the plurality of neural network layers, wherein the processor operating as a secure world, reads the raw data stored in the non-secure area, and pre-processes the raw data based on the first data, performs an arithmetic operation on feature map information based on the second data, and obtains, as the output data, data output from the last layer, wherein the third data includes information regarding parameters used in layers except for the last layer of the plurality of neural network layers, and the processor operating as a normal world, performs an arithmetic operation on the pre-processed data based on the third data, and obtains the feature map information output from a previous layer of the last layer. a memory configured to store information related to an artificial intelligence model that performs an arithmetic operation through a plurality of neural network layers; and a processor configured to pre-process raw data and obtain output data by inputting the pre-processed data to the artificial intelligence model, wherein first data used for the pre-processing of the raw data and second data used in some of the plurality of neural network layers are stored in a secure area of the memory, and third data used in remaining layers of the plurality of neural network layers is stored in a non-secure area of the memory, wherein the first data includes at least one of data used for filtering of raw data to be input to the artificial intelligence model among a plurality of raw data, or data used for conversion of raw data into input data to be input to the artificial intelligence model, wherein the second data includes information regarding parameters used in a last layer of the plurality of neural network layers, wherein the processor operating as a secure world, reads the raw data stored in the non-secure area, and pre-processes the raw data based on the first data, performs an arithmetic operation on feature map information based on the second data, and obtains, as the output data, data output from the last layer, wherein the third data includes information regarding parameters used in layers except for the last layer of the plurality of neural network layers, and the processor operating as a normal world, performs an arithmetic operation on the pre-processed data based on the third data, and obtains the feature map information output from a previous layer of the last layer.