Electronic device and method for processing image by same

An electronic device according to an embodiment disclosed herein may include a communication circuit, a processor; and a memory configured to be operatively connected to the processor. The memory according to an embodiment may store instructions that, when executed, cause the processor to: recognize an area comprising at least part of a face in an image to be transmitted to an external device; generate perturbation data about the recognized area based on a machine learning model stored in the memory; apply the perturbation data to the recognized area; and transmit the image to which the perturbation data has been applied to the external device. Various other embodiments are possible.

BACKGROUND

Technical Field

One or more embodiments disclosed herein generally relate to an electronic device and image processing thereof. For example, one or more embodiments disclosed herein generally relate to a device and a method for processing an image using a machine learning algorithm in an electronic device.

Description of Related Art

Artificial intelligence (AI) technology can be used to implement humanlike intelligence through computer systems and enables self-learning through machine learning algorithms. Machine learning algorithms are algorithms that autonomously classify or learn features of input data.

With the development of artificial intelligence technology, electronic devices (or machines) can autonomously analyze images using artificial intelligence technology and can classify or determine objects included in the images.

SUMMARY

As artificial intelligence technology related to image recognition has developed, electronic devices using artificial intelligence technology can collect a large number of images on the Internet in a database for machine learning. In this case, images (e.g., selfie images) including biometric information distributed on the Internet may be analyzed regardless of the intention of the persons included in the images. Further, images including biometric information may be further processed and misused (e.g., by being used in fake images).

To protect personal information included in the images, an electronic device may encrypt the images when they are stored. However, when sharing the images externally (e.g., uploading the images to a social media service (SNS) or transmitting the images through a messaging service in a non-encrypted manner over the Internet), the electronic device may decrypt the encrypted images and transmit the decrypted images to another device, and thus the personal information included in the images externally shared cannot be protected.

The electronic device may modify the image (e.g., blur the image or insert an emoticon thereinto) in order to protect the personal information included in the image. However, when the electronic device modifies the image, the image may be deteriorated or objects included in the image may be deformed so that people cannot identify the objects. Even when the electronic device inserts a watermark into the image to protect the pieces of personal information included in the image, it may be impossible to prevent misuse or abuse of the image.

An electronic device according to an embodiment disclosed herein may include a communication circuit, a processor; and a memory configured to be operatively connected to the processor. The memory according to an embodiment may store instructions that, when executed, cause the processor to: recognize an area including at least part of a face in an image to be transmitted to an external device; generate perturbation data about the recognized area based on a machine learning model stored in the memory; apply the perturbation data to the recognized area; and transmit the image to which the perturbation data has been applied to the external device.

An image processing method of an electronic device according to an embodiment disclosed herein may include: recognizing an area including at least part of a face in an image to be transmitted to an external device; generating perturbation data about the recognized area based on a machine learning model; applying the perturbation data to the recognized area; and transmitting the image to which the perturbation data has been applied to the external device.

DETAILED DESCRIPTION

Certain embodiments disclosed herein disclose a device and a method for processing an image in an electronic device to prevent misuse or abuse of the image.

An electronic device according to an embodiment disclosed herein may cause malfunction of a machine learning algorithm for image recognition by adding (applying) perturbation data (adversarial perturbation data) to an image, thereby preventing misuse or abuse of the image regardless of the intention of a person included in the image.

An electronic device according to an embodiment disclosed herein may transmit a modified image obtained by adding perturbation data to an image to an external device when transmitting the image to the external device, thereby preventing misuse or abuse of the externally shared image.

An electronic device according to an embodiment disclosed herein may generate perturbation data based on a machine learning algorithm and may apply the generated perturbation data to an image, thereby causing malfunction of the machine learning algorithm with only a modification that is so insignificant that a human cannot visually recognize the modification.

The memory130may store various data used by at least one component (e.g., the processor120or the sensor module176) of the electronic device101. The various data may include, for example, software (e.g., the program140) and input data or output data for a command related thereto. The memory130may include the volatile memory132or the non-volatile memory134. The memory134may further include internal memory136and/or external memory138.

The power management module188may manage power supplied to the electronic device101. According to an example embodiment, the power management module188may be implemented as at least part of, for example, a power management integrated circuit (PMIC).

The communication module190may support establishing a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device101and the external electronic device (e.g., the electronic device102, the electronic device104, or the server108) and performing communication via the established communication channel. The communication module190may include one or more communication processors that are operable independently from the processor120(e.g., the application processor (AP)) and supports a direct (e.g., wired) communication or a wireless communication.

FIG.2is a block diagram of an electronic device according to an embodiment of the disclosure.

Referring toFIG.2, the electronic device101according to an embodiment may include a processor210(e.g., the processor120ofFIG.1), a memory220(e.g., the memory130ofFIG.1), a communication circuit230(e.g., the communication module190ofFIG.1), a display240(e.g., the display device160ofFIG.1), and/or a camera250(e.g., the camera module180ofFIG.1). When some of the components illustrated inFIG.2are omitted or substituted, one or more embodiments disclosed herein can be implemented without difficulty for one of skill in the art.

According to an embodiment, the processor210may be a component capable of performing operations or data processing related to control and/or communication of each component of the electronic device101. For example, the processor210may be operatively connected to components of the electronic device101(e.g., the memory220, the communication circuit230, the display240, and/or the camera250). The processor210may load a command or data received from a different component of the electronic device101into the memory220, may process a command or data stored in the memory220, and may store resulting data. The processor210may include a microprocessor or any suitable type of processing circuitry, such as one or more general-purpose processors (e.g., ARM-based processors), a Digital Signal Processor (DSP), a Programmable Logic Device (PLD), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), a Graphical Processing Unit (GPU), a video card controller, etc. In addition, it would be recognized that when a general purpose computer accesses code for implementing the processing shown herein, the execution of the code transforms the general purpose computer into a special purpose computer for executing the processing shown herein. Certain of the functions and steps provided in the Figures may be implemented in hardware, software or a combination of both and may be performed in whole or in part within the programmed instructions of a computer. No claim element herein is to be construed under the provisions of 35 U.S.C. 112(f), unless the element is expressly recited using the phrase “means for.” In addition, an artisan understands and appreciates that a “processor” or “microprocessor” may be hardware in the claimed disclosure. Under the broadest reasonable interpretation, the appended claims are statutory subject matter in compliance with 35 U.S.C. § 101.

According to an embodiment, the memory220may store instructions for an operation of the processor210. According to an embodiment, the memory220may store at least one machine learning model.

According to an embodiment, the communication circuit230may establish a communication channel with an external device (e.g., the electronic device102or the electronic device104ofFIG.1) and may transmit and receive various data to and from the external device. According to an embodiment, the communication circuit230may be configured to include a cellular communication module and to be connected to a cellular network (e.g., Third Generation (3G), Long-Term Evolution (LTE), Fifth Generation (5G), Wibro, or Wimax). According to an embodiment, the communication circuit230may include a short-range communication module and may transmit and receive data to and from the external device using short-range communication (e.g., Wi-Fi, Bluetooth, Bluetooth Low Energy (BLE), or ultra wideband (UWB)), but is not limited thereto.

According to an embodiment, the communication circuit230may include a contactless communication module for contactless communication. For example, the contactless communication may include at least one contactless short-range communication technology such as near-field communication (NFC), radio frequency identification (RFID) communication, or magnetic secure transmission (MST) communication.

According to an embodiment, the display240may display various screens based on control of the processor210. According to an embodiment, the camera250may obtain an image by capturing a still image or a video.

When transmitting an image stored in the memory220of the electronic device101to the external device, the processor210according to an embodiment may transmit, instead of the original image, an image (modified image or merged image) processed such that incorrect image recognition will be performed through a machine learning model. According to an embodiment, the image may include a picture or a video. According to an embodiment, the image stored in the memory220may include an image obtained and stored through the camera250and/or an image received and stored from the external device.

The processor210according to an embodiment may recognize an area including at least part of a face in the image to be transmitted to the external device. According to an embodiment, the processor210may recognize the area including the at least part of the face in the image to be transmitted to the external device, based on a machine learning model. For example, the processor210may receive a user input to transmit some of images stored in the electronic device101to the external device. For example, transmitting an image to the external device may include uploading an image to a social networking service (SNS) (transmitting the image to an SNS server device), transmitting an image to a different user through a messaging service, or uploading an image to an Internet home page, and may include any case of transmitting (or sharing) an image stored in the electronic device101to the external device in addition to the above case. The processor210may recognize the area including the at least part of the face in the image in response to a request to transmit the image to the external device. For example, the processor may recognize an entire face area and/or an area including part of the face in the image.

According to an embodiment, the processor210may recognize an area including at least one of an eye area, a wrist area, or a fingerprint area in the image. For example, the processor210may recognize the area including the at least one of the eye area, the wrist area, or the fingerprint area in the image to be transmitted to another device, based on a machine learning model. In addition to the above areas, any area on which image recognition can be performed may be included. Hereinafter, for convenience of explanation, the case of recognizing a face area will be described.

The processor210according to an embodiment may generate perturbation data (perturbation, adversarial perturbation, or adversarial example) about a recognized face area, based on a machine learning model. For example, the perturbation data may be a pattern or noise for causing malfunction of the machine learning model. For example, the perturbation data may be a pattern or noise added to the original image in order to deceive the machine learning model for learned image recognition. For example, the perturbation data may be a random small value. For example, the perturbation data may be a value having a pixel value range (e.g., 0 to 5) of 1/50 or less of the pixel value range (e.g., 0 to 255) of the original image. An image to which perturbation data is applied may cause malfunction of a classification model, a pose estimation model, or a semantic segmentation model of the machine learning model. For example, the image to which the perturbation data is applied may have low recognition accuracy due to incorrect classification of the type, species, or gender of an object (e.g., human) included in the image through the machine learning model. For example, the processor210may generate perturbation data about the face area based on the image of the recognized face area recognized using the machine learning model. For example, the perturbation data may include a pattern or noise generated according to the image input to the machine learning model. Among terms described in certain embodiments of the disclosure, a security filter may refer to perturbation data.

According to an embodiment, machine learning is a field of artificial intelligence and may include various machine learning methods for realizing a function, such as human learning ability, in the electronic device101(e.g., a computer). A machine learning model may include a deep learning model based on an artificial neural network. For example, the machine learning model include a deep neural network (DNN), a recurrent neural network (RNN), a convolutional neural network (CNN), a generative adversarial network (GAN), a machine learning model for classification-regression analysis (e.g., a support vector machine (SVM)), or a reinforcement learning (RL) model. For example, the machine learning model may be a generator (e.g., a GAN generator) of an encoder-decoder type based on a convolution neural network.

The processor210according to an embodiment may generate perturbation data to be applied to the original image or may generate a new image resulting from application of a modification (perturbation) to the original image using a machine learning model learned based on a model learned by at least one machine learner. The machine learning model according to an embodiment may be stored in the memory220.

The generator based on the convolutional neural network according to an embodiment may have various types of network structures. For example, the generator may include a U-Net with an encoder-decoder based on a convolution. The generator may generate perturbation data based on information learned from images. The perturbation data may be applied to the original image, thereby generating a modified image (or a merged image) corresponding to the original image. Alternatively, the generator may generate a new image based on information learned from images. The new image generated by the generator may be an image that imitates the original image and has a modification (perturbation).

When a generative adversarial network (GAN) is used as the convolutional neural network, the machine learning model according to an embodiment may include a generator and a discriminator.

An image modified by the processor210(e.g., the generator) according to an embodiment may be an image that is difficult to distinguish from the original image with the human naked eye and causes malfunction of the machine learning model.

A reinforcement learning model according to an embodiment may generate perturbation data about the image and then update the perturbation data through reinforcement learning. The reinforcement learning model may generate state information and reward information about the perturbation data generated by the generator through the discriminator. The generator may update the perturbation data based on the state information and the reward information generated by the discriminator. For example, the state information may refer to information about a currently given state. For example, the reward information may be information that can be obtained when a specific action is made in the currently given state. For example, the information about the currently given state may include the extent of modification of the modified image compared to the original image or the recognition accuracy of the modified image. For example, when a reward information value is small, the processor201may determine that the generator is not properly operating and may increase variance when the perturbation data is updated through the generator. For example, defining the extent of modification of the modified image compared to the original image as d, the reward information may be expressed as Δd. The processor210may update the extent of modification of the image using the reward information. Equation 1 is an equation for updating the extent of modification.
d′=+Δd[Equation 1]

The processor210according to an embodiment may generate perturbation data about an image based on at least one machine learning model.

The processor210according to an embodiment may generate perturbation data about an area including at least part of a face recognized from an image based on at least one machine learning model. When the processor210generates the perturbation data about the area including the at least part of the face, the processing speed of the machine learning model may be improved compared to the case of generating perturbation data for the entire image.

The processor210according to an embodiment may apply the perturbation data to the area including the at least part of the face recognized in the image. For example, the processor210may apply the perturbation data to the area including the at least part of the face recognized in the image based on a preset application level.

The processor210according to an embodiment may transmit the image to which the perturbation data has been applied to the external device. The processor210according to an embodiment may temporarily or permanently store the image to which the perturbation data has been applied in the memory220.

The processor210according to an embodiment may display the image to which the perturbation data has been applied and the recognition accuracy of the image to which the perturbation data has been applied on the display240before transmitting the image to which the perturbation data has been applied to the external device. The electronic device101(or the processor210) may display the image to which the perturbation data has been applied and the recognition accuracy of the image to which the perturbation data has been applied on the display240before transmitting the image to which the perturbation data has been applied to another device so that the user of the electronic device101can recognize information about the image to be transmitted to the external device. For example, the user of the electronic device101may recognize the information about the image to be transmitted to the external device, thereby recognizing the extent of the modification of the image to be transmitted to the external device.

The processor210according to an embodiment may extract an area including at least part of a face from an image and may then apply perturbation data to the original image, thereby generating a merged image. For example, the processor210may recognize an area including at least part of a face in an image. The processor210may extract the area including the at least part of the face. The processor210may generate perturbation data about the area including the at least part of the face based on a machine learning model to which extraction information is applied. The processor210may apply the perturbation data, generated based on the machine learning model, to the extracted area. The processor210may merge the area to which the perturbation data has been applied and the original image. The processor210may transmit the merged image to the external device. For example, the merged image may be temporarily or permanently stored in the memory220.

The processor210according to an embodiment may adjust a level at which perturbation data is applied to an image. For example, the processor210may set a level (e.g., an application level) at which perturbation data is applied to an original image based on a user input. For example, the processor210may determine a level at which perturbation data is applied based on the type of the external device to which an image is to be transmitted. For example, the processor210may analyze an image and may determine a level at which perturbation data is applied to the original image based on an object (e.g., a user) identified in the image.

According to an embodiment, when an image is used in the electronic device101(e.g., a Gallery application), the processor210may use and display the original image. When transmitting the image to the external device, the processor210may transmit the image to which perturbation data has been applied (e.g., a merged image) to the external device.

FIG.3illustrates a method for processing an image according to an embodiment of the disclosure.

Referring toFIG.3, the processor210according to an embodiment may include a detecting module211and a filtering module213. The processor210according to an embodiment may further include a merging module215. The detecting module211, the filtering module213, and the merging module215may be software modules.

The detecting module211according to an embodiment may recognize (or detect) an area including at least part of a face in an image310(e.g., an original image) input to the detecting module211. The detecting module211may extract the area320including the at least part of the face recognized in the image310. The detecting module211may be a deep learning-based single shot multibox detector (SSD) module. According to an embodiment, the detecting module211may recognize at least one of an eye area, a wrist area, or a fingerprint area in addition to the face area. In an embodiment illustrated in this drawing, for convenience of explanation, the case of recognizing a face area will be described.

The filtering module213according to an embodiment may generate perturbation data about the image310based on at least one machine learning model and may apply the perturbation data to at least part of the image310(e.g., a face area320) to thereby generate a modified image. For example, the filtering module213may generate perturbation data about the face area320recognized by the detecting module211and may apply the perturbation data to the face area320recognized by the detecting module211. According to an embodiment, when the detecting module211extracts the face area320, the filtering module213may generate the perturbation data about the face area320and may apply the perturbation data to the extracted face area320. The operation of the filtering module213applying the perturbation data to the face area320may be referred to as an operation of applying a security filter to prevent misuse of the image. For example, the filtering module213may generate the perturbation data about the face area320extracted by the detecting module211, based on at least one of the generator of an encoder-decoder type based on a convolutional neural network, a deep neural network (DNN), a recurrent neural network (RNN), a convolutional neural network (CNN), a generative adversarial network (GAN), a machine learning algorithm for classification-regression (support vector machine, SVM), or a reinforcement learning (RL) algorithm. Hereinafter, although the machine learning model will be described with reference to the generator of the encoder-decoder type based on the convolutional neural network as an example, it is apparent to those having ordinary skill that the disclosure can be performed using various different machine learning models.

The filtering module213according to an embodiment may apply the perturbation data to the face area320recognized by the detecting module211to prevent misuse of biometric information, thereby modifying at least part (e.g., the face area320) of the image310. The modification of the image can be applied by adding the perturbation data having a pixel value of [−k, k] to the original image. The generator of the encoder-decoder type based on the convolutional neural network may be trained to minimize loss (LG).

For example, the loss (LG) of the generator may include three types of losses as shown in Equation 2.
LG=LD_fake+Ladv+Lpert[Equation 2]

According to an embodiment, LD_fakemay denote the loss from the difference between the original image and the modified image (merged image). In GAN-based learning, the generator may perform adversarial learning with a discriminator that distinguishes whether the image is the original image or the image to which the perturbation data has been applied. As the difference between the original image and the modified image becomes insignificant, LD_fakemay decrease.

According to an embodiment, Ladvmay denote the loss associated with the extent to which the image to which the perturbation data has been applied causes malfunction of a machine learning-based recognizer (e.g., a face detector or a gender/age/face recognizer). As the extent to which the malfunction caused by the image with perturbation data increases, Ladvmay decrease.

According to an embodiment, Lpertmay denote a value indicating the size of the perturbation data. As the size of the perturbation data increases, Lpertmay decrease.

The generator according to an embodiment may be trained to reduce the difference between the image to which the perturbation data has been applied and the original image (to reduce the value of LD_fake), to reduce the image recognition accuracy of the machine learning model for the image to which the perturbation data has been applied (to reduce the value of Ladv), and to reduce the size of the perturbation data (to reduce the value of Lpert).

According to an embodiment, the perturbation data may have a pattern to cause the malfunction of the machine learning model for image recognition or face detection. The pattern may be applied to the original image lightly and naturally at a level that is difficult to distinguish with the human naked eye. The operation of applying the perturbation data to the original image may be based on Equation 3.
{circumflex over (p)}=tanh(w*perturb+P)  [Equation 3]

According to an embodiment, the pixel value P of the original image may be normalized to a range of [−1, 1]. The perturbation data (perturb) may be added to P with a weight (w) adjusted depending on purpose of use and performance. The pixel value of the original image to which the perturbation data has been added may be clipped to a value of [−1, 1] through a tank function or a min/max function.

The filtering module213according to an embodiment may divide an interest area and a non-interest area of a human based on an attention map method and may be trained to generate perturbation data in the non-interest area of the human. For example, the attention map method may be a neural network method for implementing human visual attention. For example, the filtering module213may analyze the image310, may then determine a pupil, a beard, hair, or the periphery of a face as a non-interest area of the human, and may generate perturbation data in the determined non-interest area.

According to an embodiment, the user of the electronic device101may set a level (e.g., an application level) at which perturbation data is applied. As the application level relatively increases, the probability of malfunction of the machine learning model for image recognition may also increase. For example, the user of the electronic device101may adjust the size of the pixel value of the perturbation data by adjusting the application level. For example, when the application level of the perturbation data is set to be relatively low, the electronic device101may generate perturbation data having a pixel value range (e.g., 0 to 2) of 1/100 of the pixel value range (e.g., 0 to 255) of the original image and may apply the perturbation data to the original image. For example, when the application level of the perturbation data is set to be relatively high, the electronic device101may generate perturbation data having a pixel value range (e.g., 0 to 25) of 1/10 of the pixel value range of the original image and may apply the perturbation data to the original image.

The synthesis module215according to an embodiment may merge a face area330to which the perturbation data has been applied and the image310, thereby generating a merged image340. For example, the merging module215may merge the face area330to which the perturbation data has been applied and the original image310and may then process a boundary area between the two so that the boundary appears to be natural. For example, the merging module215may process a color change to be natural in image merging.

The merging module215according to an embodiment may have an encoder-decoder structure based on a convolutional neural network. According to an embodiment, the merging module215may be trained to minimize loss (LM).

According to an embodiment, the loss (LM) of the merging module215may include two types of losses as shown in Equation 4.
LM=Lf+Lh[Equation 4]

According to an embodiment, Lfmay denote a loss from the extent of change of the extracted face area. The merging module215may be trained to minimize the value of Lf. Lfmay be measured by Equation 5.
Lf=|+Mf|k[Equation 5]

According to an embodiment,is values of an image of the face area output through the filtering module213, and Mfis values of an image of the face area in the merged image output through the merging module215. The difference between the two images may be measured through L1 normalization (least absolute shrinkage and selection operator: LASSO) or L2 normalization.

According to an embodiment, Lhmay denote a loss from the extent of change of the boundary area. The merging module215may be trained to minimize the value of Lh. Lhmay be measured by Equation 6.
Lh=|h(Mb)−h(Mn)|k[Equation 6]

According to an embodiment, h( ) may be a function for measuring a histogram. Equation 6 may represent the histogram difference between the boundary area (Mb) and the peripheral area thereof (Mn). According to an embodiment, pixel value difference may be used instead of the histogram difference.

The processor210according to an embodiment may transmit the merged image340, output through the merging module215, to an external device through the communication circuit230.

AlthoughFIG.3includes exaggerated perturbation to emphasize that the perturbation data has been applied to the face area of the merged image340output through the merging module215and that the merged image is different from the original image, the merged image and the original image cannot actually be distinguished with the naked eye of the user, or may have only very subtle distinguishable differences therebetween.

FIG.4illustrates an environment in which an image transmitted to an external device is used according to an embodiment of the disclosure.

Referring toFIG.4, when transmitting an image to an external device, the electronic device101according to an embodiment may transmit a modified image corresponding to an original image, thereby preventing the image from being misused or being abused regardless of the intention of the user of the electronic device101.

According to an embodiment, the electronic device101may upload an image410to an SNS server421. For example, the image uploaded to the SNS server421may be a modified image corresponding to an original image410. For example, the modified image may include an image in which perturbation data has been applied to the original image410. Although the SNS server421is illustrated in an embodiment disclosed in this drawing, the disclosure may be applied to various external devices which the image is transmitted to or shared with.

According to an embodiment, the image uploaded to the SNS server421may be transmitted to an external device423via downloading or screen capturing. For example, the image transmitted to the external device423may be used for face merging (e.g., face change)431. For example, the image transmitted to the external device423may be collected for training of a deep learning model433for face recognition. For example, the image transmitted to the external device423may be printed through a printer435and may be used in a device (e.g., a mobile phone or an ATM) to which a face recognition system is applied.

According to an embodiment, the electronic device101may upload the modified image corresponding to the original image410to the SNS server421, thereby preventing misuse or abuse of the image using the foregoing methods (431,433, and/or435). For example, when the modified image (e.g., the image to which the perturbation data has been applied) is input to the deep learning model433for face recognition, the image causes malfunction, thus preventing the image from being misused regardless of the user's intention.

When transmitting or sharing an image to or with an external device (e.g., the SNS server421), the electronic device101according to an embodiment may transmit or share a modified image in which perturbation data is applied to the original image, thereby preventing abuse or misuse of the image regardless of the intention of the user of the electronic device101.

FIG.5AandFIG.5Beach illustrate a method for generating an image by applying perturbation data to an image according to an embodiment of the disclosure. For example, perturbation data520may be implemented as a security filter for preventing misuse or abuse of biometric information included in an image. The perturbation data520is not limited to the pattern illustrated inFIG.5A, and at least one of the spacing, size, or shape of the pattern may be changed according to the application level.

Referring toFIG.5A, the processor210according to an embodiment may recognize a face area in an original image511. The processor210may generate perturbation data520about the face area. The perturbation data520may be applied to the face area recognized in the original image511. According to an embodiment, the processor210may generate perturbation data520corresponding to the entire original image511and apply the perturbation data520to the entire original image511. According to an embodiment, the processor210may recognize at least one of an eye (iris) area, a wrist area, or a fingerprint area included in the original image511. In an embodiment illustrated in this drawing, for convenience of explanation, the case of recognizing a face area will be described.

The processor210according to an embodiment may generate the perturbation data520by inputting the face area recognized in the original image511into a machine learning model530.

According to an embodiment, the processor210may extract the face area recognized in the original image511. The processor210may generate perturbation data520about the face area extracted from the original image511and apply the perturbation data520to the face area extracted from the original image511. The processor210may merge the face area to which the perturbation data520has been applied and the original image511. For example, a modified image513may be an image obtained by applying the perturbation data520to the face area of the original image511. When the modified image513is input to the machine learning model for image recognition, the modified image may cause malfunction of the machine learning model. For example, as a result of analyzing the modified image513, the machine learning model may not be able to recognize that the object included in the modified image513is a person, may recognize the object included in the image as a different person, or may misrecognize the gender of the person.

According to an embodiment, the modified image513to which the perturbation data has been applied is not significantly different from the original image511as perceived by the naked human eye but may cause malfunction of the machine learning model for image recognition.

Referring toFIG.5B, the processor210according to an embodiment may generate a modified image by directly modifying the original image based on a machine learning model, rather than separately generating perturbation data and applying the perturbation data to the original image.

The processor210according to an embodiment may generate a modified image543by inputting an original image541to be transmitted to an external device into the machine learning model530. For example, the modified image543may be an image that is obtained by applying modification to at least a portion included in the original image541to causes malfunction of the machine learning model for face recognition.

FIG.6illustrates images generated by setting different levels at which perturbation data is applied to an image according to one or more embodiments of the disclosure.

Referring toFIG.6, a first image610may refer to a modified image (or merged image) when the level (e.g., application level) at which perturbation data is applied is set to a relatively low value. A second image620may refer to a modified image when the level at which the perturbation data is applied is set to an intermediate value. In one example, the application level set to the intermediate value may be relatively higher than the application level of the first image610and may be relatively lower than the application level of a third image630. The third image630may refer to a modified image when the level at which the perturbation data is applied is set to a relatively high value. Although the first image610, the second image620, and the third image630are shown as being exaggeratedly modified to emphasize differences therebetween, the actual modified images and an original image cannot be distinguished with the naked eye of the user, or may have only very subtle distinguishable differences therebetween.

According to an embodiment, the image recognition rate of a machine learning model may relatively decrease as the level of the perturbation data relatively increases. For example, it may be assumed that the first image610is a modified image generated by applying the perturbation data to the original image at an application level of 0.5. In this case, when the first image610is input, the machine learning model may determine the gender of a person included in the original image with an accuracy of 76.14%.

For example, it may be assumed that the second image620is a modified image generated by applying the perturbation data to the original image at an application level of 0.8. In this case, when the second image620is input, the machine learning model may determine the gender of a person included in the original image with an accuracy of 25.96%.

For example, it may be assumed that the third image630is a modified image generated by applying the perturbation data to the original image at an application level of 1.1. In this case, when the third image630is input, the machine learning model may determine the gender of a person included in the original image with an accuracy of 6.59%.

According to an embodiment, the electronic device101may relatively increase the probability of occurrence of malfunction of the machine learning model for image recognition as the application level of perturbation data is relatively increased.

The processor210according to an embodiment may set the level (e.g., application level) at which the perturbation data is applied to the original image based on a user input. For example, the user may adjust the application level through parameter setup. For example, the processor210may display a user interface (UI) (e.g., a Seek Bar) for setting the application level on the display240. The processor210may set the level at which the perturbation data is applied to the original image based on a user input via the user interface displayed on the display240.

The processor210according to an embodiment may determine the level (e.g., application level) at which perturbation data is applied to the original image based on the type of an external device to which the image is to be transmitted or an application (e.g., the application146ofFIG.1). For example, when it is determined that the image is to be uploaded to SNS that can be accessed by an unspecified number of people, the processor210may upload, to the SNS, an image generated by applying perturbation data to the original image at a relatively high application level.

For example, when it is determined that the image is to be transmitted to an external device of a friend through a messaging service, the processor210may transmit a modified image, generated by applying perturbation data to the original image at a relatively low application level, to the external device through the messaging service.

The processor210according to an embodiment may analyze an image and may determine the level (e.g., application level) at which perturbation data is applied to the original image based on a user identified in the image. For example, when it is determined that a person identified in an image is the user of the electronic device101, the processor210may apply perturbation data to the original image at a relatively high application level.

For example, when it is determined that the person identified in the image is a person other than the user of the electronic device101, the processor210may apply the perturbation data to the original image at a relatively low application level.

FIG.7is an operation flowchart of an electronic device101according to an embodiment of the disclosure.

Referring to the operation flowchart700, in operation710, a processor (e.g., the processor210ofFIG.2) of the electronic device101according to an embodiment may recognize an area including at least part of a face in an image to be transmitted to an external device. For example, the processor210may analyze an image based on a machine learning model for image recognition or a computer vision-based algorithm and may recognize an area including at least part of a face or the entire face.

According to an embodiment, the processor210may also recognize an area (e.g., an eye (iris) area, a wrist area, and/or a fingerprint area) that can be used for biometric authentication in addition to the area including the at least part of the face. The processor210according to an embodiment may recognize various types of areas other than the foregoing areas.

In operation720, the processor210according to an embodiment may generate perturbation data about the area recognized in the image based on the machine learning model. For example, the perturbation data may be a pattern or noise to cause malfunction of the machine learning model.

In operation730, the processor210according to an embodiment may apply the perturbation data to the area recognized in the image.

In operation740, the processor210according to an embodiment may transmit the image to which the perturbation data has been applied to the external device.

FIG.8is an operation flowchart of an electronic device according to an embodiment of the disclosure. Details overlapping with those explained inFIG.7will be omitted.

Referring to the operation flowchart800, in operation810, a processor (e.g., the processor210ofFIG.2) of the electronic device101according to an embodiment may recognize an area including at least part of a face in an image to be transmitted to an external device. In another example, the processor210may recognize an area including the entire face in the image to be transmitted to the external device.

In operation820, the processor210according to an embodiment may extract the area including the at least part of the face recognized in the image. For example, the processor210may separate the area including the at least part of the face recognized in the image from the image.

In operation830, the processor210according to an embodiment may generate perturbation data about the extracted area based on a machine learning model.

In operation840, the processor210according to an embodiment may apply the perturbation data to the face area extracted from the image.

In operation850, the processor210according to an embodiment may merge the face area to which the perturbation data has been applied and the image, thereby generating a single merged image.

In operation860, the processor210according to an embodiment may transmit the merged image to the external device.

FIG.9is an operation flowchart of an electronic device according to an embodiment of the disclosure. Specifically,FIG.9is an operation flowchart illustrating a method for applying perturbation data to an image according to an embodiment. Details overlapping with those explained inFIG.7andFIG.8will be omitted.

Referring to the operation flowchart900, in operation910, a processor210according to an embodiment may generate perturbation data about an area including at least part of a face recognized in an image based on a machine learning model. For example, operation910may be the same operation as operation720ofFIG.7or operation830ofFIG.8.

In operation920, the processor210according to an embodiment may determine the level at which the perturbation data is applied based on the type of the external device, for example. For example, when the external device is an SNS server device, the processor210may set the level at which the perturbation data is applied to be relatively high. For example, when the external device is a device registered to a friend of the user, the processor210may set the level at which the perturbation data is applied to be relatively low.

The processor210according to an embodiment may determine the level at which the perturbation data is applied based on a user input detected through a user interface (e.g., a Seek Bar) related to setup of the application level of the perturbation data. The processor210according to an embodiment may determine the level at which the perturbation data is applied based on the type of an object recognized in the image. For example, when the object included in the image is recognized as a human, the processor210may set the level at which the perturbation data is applied to be relatively high. For example, when the object included in the image is recognized as an animal, the processor210may set the level at which the perturbation data is applied to be relatively low.

In operation930, the processor210according to an embodiment may apply the perturbation data to the area including the at least part of the face recognized in the image based on the level (e.g., application level) at which the perturbation data is applied.

FIG.10is an operation flowchart of an electronic device according to an embodiment of the disclosure.

When an image is obtained through a camera (e.g., the camera250ofFIG.2), a processor (e.g., the processor210ofFIG.2) according to an embodiment may generate a modified image in advance by applying perturbation data to the original image obtained through the camera250. The processor (e.g., the processor210) may store the modified image along with the original image obtained through the camera (e.g., the camera250) in a memory (e.g., the memory220ofFIG.2). When a request to transmit the original image to an external device is made, the processor (e.g., the processor210) may transmit the modified image stored in the memory (e.g., the memory220) to the external device.

Referring to the operation flowchart1000, in operation1010, the processor210of the electronic device101according to an embodiment may obtain an image through the camera250.

In operation1020, the processor210according to an embodiment may identify a user by recognizing an area including at least part (e.g., a face, an iris, or a fingerprint) of the user included in the image obtained through the camera250.

In operation1030, the processor210according to an embodiment may determine whether the user identified in the image is the user of the electronic device101. For example, the processor210may compare the image obtained through the camera250and an image of the user of the electronic device101previously stored in the electronic device101and may determine whether the user included in the image obtained through the camera250is the user of the electronic device101.

According to an embodiment, when it is determined that the user included in the image is not the user of the electronic device101(No in operation1030), the processor210may transmit the image obtained through the camera250to the external device in response to a request to transmit the image obtained through the camera250to the external device in operation1080.

According to an embodiment, when it is determined that the user included in the image is the user of the electronic device101(Yes in operation1030), the processor210may generate perturbation data about the image obtained through the camera250in operation1040. For example, the processor210may identify an area including at least part (e.g. face) of the user in the image obtained through the camera250. The processor210may generate perturbation data about the area including the at least part of the user. For example, the area including the at least part of the user may include a face area, an eye (iris) area, a wrist area, and/or a fingerprint area.

In operation1050, the processor210according to an embodiment may apply the perturbation data to the area including the at least part of the user recognized in the image.

In operation1060, the processor210according to an embodiment may store the image (e.g., a modified image) to which the perturbation data has been applied. For example, the processor210may temporarily or permanently store the modified image to which the perturbation data has been applied in the memory220, separately from the original image obtained through the camera250. For example, the processor210may store the modified image to which the perturbation data has been applied in a JPEG extension of the original image.

According to an embodiment, when the electronic device101displays or uses the image, the electronic device101may display or use the original image to which perturbation data is not applied on a display240.

In operation1070, the processor210according to an embodiment may transmit the modified image to which the perturbation data has been applied to the external device in response to the request to transmit the image to the external device.

An electronic device101according to an embodiment disclosed herein may include a communication circuit230, a processor210, and a memory220operatively connected to the processor210. The memory220according to an embodiment may store instructions that, when executed, cause the processor210to: recognize an area including at least part of a face in an image to be transmitted to an external device; generate perturbation data about the recognized area based on a machine learning model stored in the memory220; apply the perturbation data to the recognized area; and transmit the image to which the perturbation data has been applied to the external device.

In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to recognize the area including the at least part of the face in the image in response to a request to transmit the image to the external device.

The electronic device101according to an embodiment disclosed herein may further include a camera250. In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to recognize the area including the at least part of the face in the image upon obtaining the image through the camera250.

In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to: extract the recognized area; generate the perturbation data about the extracted area; apply the perturbation data to the extracted area; and merge the extracted area to which the perturbation data has been applied and the image.

In the electronic device101according to an embodiment disclosed herein, the machine learning model may include a generator of an encoder-decoder type based on a convolutional neural network, and the instructions may further cause the processor210to: extract characteristic information about the recognized area through an encoder of the generator; and generate the perturbation data about the recognized area through a decoder of the generator based on the extracted characteristic information.

In the electronic device101according to an embodiment disclosed herein, the generator may be trained to relatively reduce the difference between the image to which the perturbation data has been applied and the original image, to relatively reduce the image recognition accuracy of the machine learning model for image recognition, and to relatively reduce the size of the perturbation data.

In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to: determine an interest area and a non-interest area of the recognized area based on an attention map method of the machine learning model; and generate the perturbation data about the non-interest area.

In the electronic device101according to an embodiment disclosed herein, the machine learning model may include at least one of a convolutional neural network, a recurrent neural network, a deep neural network, or a generative adversarial neural network.

In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to determine a level at which the perturbation data is applied to the recognized area based on the type of the external device.

In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to: identify a user in the image; and determine a level at which the perturbation data is applied to the recognized area based on the identified user.

In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to: identify a person in the image, where the recognized area includes at least part of a face of the person when the identified person is a user of the electronic device101.

In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to recognize an area including at least one of an eye area, a wrist area, or a fingerprint area in the image to be transmitted to the external device.

The electronic device101according to an embodiment disclosed herein may further include a display240. In the electronic device101according to an embodiment disclosed herein, the instructions may further cause the processor210to display the image to which the perturbation data has been applied and recognition accuracy of the image to which the perturbation data has been applied on the display240before transmitting the image to which the perturbation data has been applied to the external device.

An image processing method of an electronic device101according to an embodiment disclosed herein may include: recognizing an area including at least part of a face in an image to be transmitted to an external device; generating perturbation data about the recognized area based on a machine learning model; applying the perturbation data to the recognized area; and transmitting the image to which the perturbation data has been applied to the external device.

In the image processing method of an electronic device101according to an embodiment disclosed herein, the recognizing may include recognizing the area including the at least part of the face in the image in response to a request to transmit the image to the external device.

In the image processing method of an electronic device101according to an embodiment disclosed herein, the recognizing may include recognizing the area including the at least part of the face in the image upon obtaining the image through a camera250.

In the image processing method of an electronic device101according to an embodiment disclosed herein, the machine learning model may include a generator of an encoder-decoder type based on a convolutional neural network. In the image processing method according to various embodiments, the generating may include: extracting characteristic information about the recognized area through an encoder; and generating the perturbation data about the recognized area through a decoder based on the extracted characteristic information.

In the image processing method of an electronic device101according to an embodiment disclosed herein, the generator may be trained to reduce the difference between the image to which the perturbation data has been applied and the original image, to reduce the image recognition accuracy of the machine learning model for image recognition, and to reduce the size of the perturbation data.

In the image processing method of an electronic device101according to an embodiment disclosed herein, the generating may include: determining an interest area and a non-interest area of the recognized face area based on an attention map method of the machine learning model; and generating the perturbation data about the non-interest area.

In the image processing method of an electronic device101according to an embodiment disclosed herein, the applying may include: determining a level at which the perturbation data is applied to the recognized face area based on a type of the external device; and applying the perturbation data to the recognized face area based on the determined level.