Face swap detection method and electronic device
By providing face-swapping detection methods and functions in electronic devices, users can proactively trigger detection and obtain risk information, thus solving the privacy and security issues of face-swapping technology and improving device intelligence and user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2026-04-02
AI Technical Summary
In existing technologies, AI-based face-swapping technology poses ethical and legal issues such as privacy violations, portrait rights, and cybersecurity risks in electronic devices, and it is difficult to effectively detect the presence of face-swapping risks.
This invention provides a face-swapping detection method and an electronic device. By displaying prompt controls on the interface, users can actively trigger face-swapping detection, outputting detection results including images and risk information. It supports multi-face detection, displays notifications and card notifications in the status bar, provides animation effects and authorization processes, and utilizes a virtual assistant service to intelligently recommend detection functions.
It enhances the intelligence and user experience of electronic devices, helps users understand the risks of face swapping in a timely manner, improves the accuracy and flexibility of detection, and strengthens data security.
Smart Images

Figure CN2025113846_02042026_PF_FP_ABST
Abstract
Description
Face changing detection method and electronic device
[0001] The present application claims priority to the Chinese patent application No. 202411392119.8, filed on September 30, 2024, and entitled "Face changing detection method and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of terminals, and in particular to a face changing detection method and an electronic device. BACKGROUND
[0003] With the development of artificial intelligence generated content (AIGC) technology, various types of content such as images, audio and videos can be automatically created or generated by using artificial intelligence (AI) technology. Among them, the face changing technology based on artificial intelligence has also developed rapidly. This technology can replace the facial features of a person to another person when displaying the facial features of the person on an electronic device (such as a smart phone), to create a seemingly real video or image, and its application scenarios include but are not limited to live broadcast, video playback, video call, etc. This face changing technology has raised many ethical and legal issues, especially in the aspects of privacy invasion, portrait rights, intellectual property rights and network security, and may also lead to illegal behaviors such as fraud and libel. Therefore, it is necessary to detect whether the person displayed on the electronic device has been face changed. SUMMARY
[0004] The present application provides a face changing detection method and an electronic device, which can detect the face changing of the person displayed on the electronic device, and output the detection result, so that the user can know whether the face of the person displayed currently has the risk of face changing, and the intelligence of the electronic device can be improved.
[0005] In a first aspect, embodiments of the present application provide a face swapping detection method, which can be applied to an electronic device. The method comprises: displaying a first interface of a first application, the first interface comprising a first face; detecting a first operation directed to the first interface; in response to detecting the first operation, displaying a first prompt control in the first interface; the first prompt control is used to trigger face swapping detection on the face in the first interface; after detecting a second operation directed to the first prompt control, displaying a first window in the first interface; the first window comprises an image of the first face and first information; the first information indicates a risk of the first face being face swapped. It can be seen that in this technical solution, the user can actively trigger the electronic device to perform face swapping detection on the face displayed in the interface, and then the electronic device can prompt the user of the risk of the face being face swapped, which is conducive to improving the intelligent level of the electronic device and thus improving the user experience.
[0006] In combination with the first aspect, in a possible manner, the first interface further comprises a second face; the first window further comprises an image of the second face and second information; the second information indicates a risk of the second face being face swapped. It can be seen that in the case where the electronic device displays multiple faces, face swapping detection can be performed on multiple faces respectively, so as to enable the user to more comprehensively know whether the face displayed in the interface is at risk of being face swapped.
[0007] In combination with the first aspect, in a possible manner, the first interface comprises a status bar region, and the status bar region is located at the top of the first interface; before displaying the first window in the first interface, the method further comprises: displaying a capsule notification in the status bar region; the size of the capsule notification is smaller than the size of the first window. It can be seen that by displaying the capsule notification on top of the first interface, the user can conveniently check the state information of the electronic device performing face swapping detection in a timely manner.
[0008] In combination with the first aspect, in a possible manner, during the process of the electronic device performing face swapping detection, the capsule notification comprises first capsule information, and the first capsule information indicates that the electronic device is performing face swapping detection. It can be seen that the capsule notification can be used to feed back to the user that the electronic device is performing face swapping detection.
[0009] In combination with the first aspect, in a possible manner, in the case where the process of the electronic device performing face swapping detection is interrupted, the capsule notification comprises second capsule information, and the second capsule information indicates that the process of the electronic device performing face swapping detection has been interrupted. In the process of the electronic device performing face swapping detection, if a switching operation of the user directed to the current interface is detected, the process of face swapping detection will be interrupted. In this case, the capsule notification can be used to feed back to the user that the face swapping detection is interrupted.
[0010] With reference to the first aspect, in a possible implementation manner, after the status bar area displays the capsule notification, the method further includes: in response to the electronic device completing the face swapping detection, displaying a card notification in the status bar area; the card notification has a size greater than that of the capsule notification and less than that of the first window; and the card notification includes a thumbnail image of the first face and first preview information, the first preview information being preview information indicating a risk of the first face being face swapped. It can be seen that by displaying the card notification, the user can conveniently preview the result of performing the face swapping detection.
[0011] With reference to the first aspect, in a possible implementation manner, the card notification includes a viewing control, and displaying the first window in the first interface includes: in response to detecting a third operation on the viewing control, displaying the first window in the first interface. It can be seen that by providing the viewing control in the card notification, the user can conveniently view the more detailed face swapping detection result.
[0012] With reference to the first aspect, in a possible implementation manner, the method further includes: in response to not detecting the third operation on the viewing control for more than a time threshold, shrinking the card notification to the capsule notification. It can be seen that if the user does not operate the card notification for a long time, the card notification can be shrunk to the capsule notification to avoid affecting the user to view or operate other displayed content in the interface.
[0013] With reference to the first aspect, in a possible implementation manner, the first interface includes a wake-up control, and the first operation is a long press operation on the wake-up control or a long press operation on a power key of the electronic device.
[0014] With reference to the first aspect, in a possible implementation manner, the method further includes: playing a first dynamic effect in the first interface; and the first dynamic effect indicates that the first interface is in a recording process. In this way, the electronic device can perform the face swapping detection in the following manner: first, recording the first interface to obtain a recording video, and then performing the face swapping detection based on the recording video. Here, by playing the dynamic effect, the user can know that the current interface is in the recording process.
[0015] With reference to the first aspect, in a possible implementation manner, the first window further includes a face detection frame for marking the first face in the image. In this way, the result of performing the face swapping detection can be more intuitively represented.
[0016] With reference to the first aspect, in a possible implementation manner, after detecting the second operation on the first prompt control, the method further includes: displaying a second window in the first interface, the second window including authorization prompt information and an agree-to-authorize control, the authorization prompt information being used to prompt whether to agree to authorize the face swapping detection; and in response to detecting a fourth operation on the agree-to-authorize control, performing the face swapping detection. In this way, the user authorization is obtained before the face swapping detection is performed, which is beneficial to improving the data security of the face swapping detection.
[0017] With reference to the first aspect, in a possible implementation manner, after detecting the second operation on the first prompt control, the method further includes: recording the first interface according to a preset time length to obtain a first video; performing face swapping detection on the first video to obtain a first detection result; and the first detection result indicates that the first face has a face swapping risk. In this way, the face swapping detection is performed on the video obtained by recording the first interface, which is beneficial to improving the accuracy of the face swapping detection result.
[0018] With reference to the first aspect, in a possible implementation manner, after detecting the second operation on the first prompt control, the method further includes: taking screenshots of the first interface according to a preset time interval to obtain at least one screenshot image; performing face swapping detection on the at least one screenshot image to obtain at least one detection result; determining the first detection result from the at least one detection result; and the first detection result indicates that the first face has a face swapping risk. In this way, the face swapping detection is performed on the screenshot image obtained by taking screenshots of the first interface, which is beneficial to improving the efficiency of the face swapping detection result.
[0019] With reference to the first aspect, in a possible implementation manner, the face swapping detection on the first video to obtain the first detection result includes: calling a face swapping detection model to perform face swapping detection on the first video; or sending a face swapping detection request including the first video to a server; and the face swapping detection request is used to request the server to perform face swapping detection on the first video. In this way, the flexibility of performing face swapping detection is improved.
[0020] With reference to the first aspect, in a possible implementation manner, the first prompt control is displayed in the first interface, including: detecting whether the first interface is a video playing interface; in response to detecting that the first interface is a video playing interface, taking a screenshot of the video playing interface to obtain a screenshot image of the video playing interface; detecting whether the screenshot image of the video playing interface contains a face; and in response to detecting that the screenshot image of the video playing interface contains a face, displaying the first prompt control in the first interface. In this way, the first prompt control for triggering face swapping detection can be recommended when the first interface contains a face, which is beneficial to improving the intelligence of the electronic device.
[0021] With reference to the first aspect, in a possible implementation manner, the method further includes: displaying a second interface of a second application, the second interface including the first image, the first image including a third face; in response to detecting a drag operation on the first image, displaying a shortcut function list in the second interface; the shortcut function list including a face swapping detection function; in response to a stop position of the drag operation being on the face swapping detection function, performing face swapping detection on the first image to obtain a second detection result; the second detection result indicating a risk that the third face is face swapped. In this technical solution, the face swapping detection function can be triggered by dragging an image including a face, which is beneficial to improving the efficiency of triggering the face swapping detection function.
[0022] With reference to the second aspect, the present application provides an electronic device, including: one or more processors, a display screen and a memory; the memory is coupled with the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, the one or more processors invoke the computer instructions to make the electronic device execute: display a first interface of a first application, the first interface including a first face; detecting a first operation on the first interface; in response to detecting the first operation, displaying a first prompt control in the first interface; the first prompt control is used to trigger face swapping detection on the face in the first interface; after detecting a second operation on the first prompt control, displaying a first window in the first interface; the first window including an image of the first face and first information; the first information indicating a risk that the first face is face swapped.
[0023] With reference to the second aspect, in a possible implementation manner, the first interface further includes a second face; the first window further includes an image of the second face and second information; the second information indicating a risk that the second face is face swapped.
[0024] With reference to the second aspect, in a possible implementation manner, the first interface includes a status bar region, the status bar region being located at the top of the first interface; before displaying the first window in the first interface, the one or more processors invoke the computer instructions to make the electronic device execute: displaying a capsule notification in the status bar region; the size of the capsule notification being smaller than the size of the first window.
[0025] With reference to the second aspect, in a possible implementation manner, during the process of performing face swapping detection by the electronic device, the capsule notification includes first capsule information, the first capsule information indicating that the electronic device is performing face swapping detection.
[0026] With reference to the second aspect, in a possible implementation manner, in the case that the process of performing face swapping detection by the electronic device is interrupted, the capsule notification includes second capsule information, the second capsule information indicating that the process of performing face swapping detection by the electronic device has been interrupted.
[0027] With reference to the second aspect, in a possible implementation manner, after the status bar area displays the capsule notification, the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to the electronic device completing the face swapping detection, displaying a card notification in the status bar area; the card notification has a size greater than that of the capsule notification and less than that of the first window; the card notification includes a thumbnail image of the first face and first preview information, and the first preview information is preview information indicating a risk of the first face being face swapped.
[0028] With reference to the second aspect, in a possible implementation manner, the card notification includes a view control, and the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to detecting a third operation on the view control, displaying the first window in the first interface.
[0029] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to not detecting the third operation on the view control for more than a time threshold, collapsing the card notification into the capsule notification.
[0030] With reference to the second aspect, in a possible implementation manner, the first interface includes a wake-up control, and the first operation is a long press operation on the wake-up control or a long press operation on a power key of the electronic device.
[0031] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: playing a first dynamic effect in the first interface; and the first dynamic effect indicates that the first interface is in a recording process.
[0032] With reference to the second aspect, in a possible implementation manner, the first window further includes a face detection frame for marking the first face in the image.
[0033] With reference to the second aspect, in a possible implementation manner, after detecting the second operation on the first prompt control, the one or more processors invoke the computer instructions to cause the electronic device to perform: displaying a second window in the first interface, the second window including authorization prompt information and an agree-to-authorize control, the authorization prompt information prompting whether to agree to authorize the face swapping detection; and in response to detecting a fourth operation on the agree-to-authorize control, performing the face swapping detection.
[0034] With reference to the second aspect, in a possible implementation manner, after detecting the second operation on the first prompt control, the one or more processors invoke the computer instructions to cause the electronic device to perform: recording the first interface for a preset time length to obtain a first video; and performing face swapping detection on the first video to obtain a first detection result; and the first detection result indicates that the first face has a risk of being face swapped.
[0035] With reference to the second aspect, in a possible implementation manner, after detecting the second operation on the first prompt control, the one or more processors invoke the computer instructions to cause the electronic device to perform: taking screenshots of the first interface at preset time intervals to obtain at least one screenshot image; performing face swapping detection on the at least one screenshot image to obtain at least one detection result; determining a first detection result from the at least one detection result; and the first detection result indicating that the first face is at risk of face swapping.
[0036] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: invoking a face swapping detection model to perform face swapping detection on the first video; or sending, to a server, a face swapping detection request including the first video; the face swapping detection request being used to request the server to perform face swapping detection on the first video. In this way, the flexibility of performing face swapping detection is improved.
[0037] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: detecting whether the first interface is a video playing interface; in response to detecting that the first interface is a video playing interface, taking a screenshot of the video playing interface to obtain a screenshot image of the video playing interface; detecting whether the screenshot image of the video playing interface includes a face; and in response to detecting that the screenshot image of the video playing interface includes a face, displaying the first prompt control in the first interface.
[0038] With reference to the second aspect, in a possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: displaying a second interface of a second application, the second interface including a first image, the first image including a third face; in response to detecting a drag operation on the first image, displaying a shortcut function list in the second interface; the shortcut function list including a face swapping detection function; in response to a stop position of the drag operation being on the face swapping detection function, performing face swapping detection on the first image to obtain a second detection result; and the second detection result indicating that the third face is at risk of face swapping.
[0039] In a third aspect, a computer readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the method according to the first aspect is implemented.
[0040] In a fourth aspect, a chip system is provided, which is coupled with a memory. The chip system is configured to read and execute a computer program stored in the memory, so as to implement the method according to the first aspect.
[0041] In a fifth aspect, the present application provides a computer program product comprising instructions which, when the computer program product runs on an electronic device, cause the electronic device to perform the method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0042] FIG. 1A and FIG. IB are schematic diagrams of AI face changing provided by an embodiment of the present application;
[0043] FIG. 2A-FIG. 2G are interface schematic diagrams of single face changing detection in a live broadcast scenario provided by an embodiment of the present application;
[0044] FIG. 3A-FIG. 3E are interface schematic diagrams of multiple face changing detection in a live broadcast scenario provided by an embodiment of the present application;
[0045] FIG. 4A-FIG. 4D are interface schematic diagrams of output capsule notification in a face changing detection process provided by an embodiment of the present application;
[0046] FIG. 5A and FIG. 5B are interface schematic diagrams of playing animation effects in a face changing detection process provided by an embodiment of the present application;
[0047] FIG. 6A and FIG. 6B are interface schematic diagrams of authorizing face changing detection service provided by an embodiment of the present application;
[0048] FIG. 7A-FIG. 7C are interface schematic diagrams of triggering face changing detection function entry provided by an embodiment of the present application;
[0049] FIG. 8 is a flow schematic diagram of a face changing detection method provided by an embodiment of the present application;
[0050] FIG. 9A-FIG. 9F are interface schematic diagrams of face changing detection in a video playing scenario provided by an embodiment of the present application;
[0051] FIG. 10 is a flow schematic diagram of another face changing detection method provided by an embodiment of the present application;
[0052] FIG. 11 is a flow schematic diagram of still another face changing detection method provided by an embodiment of the present application;
[0053] FIG. 12 is a software structure schematic diagram of an electronic device provided by an embodiment of the present application;
[0054] FIG. 13 is a hardware structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0055] With reference to the drawings and the embodiments described herein, it will be understood that the embodiments are presented by way of example only and are not exhaustive of all embodiments. Based on the embodiments described herein, one of ordinary skill in the art will be able to contemplate changes and modifications to the embodiments without departing from the scope of the present disclosure.
[0056] The terms "first", "second", "third", etc. in the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a series of steps or units are included, or optionally, other steps or units not listed are also included, or optionally, other steps or units inherent to the process, method, product or equipment are also included. The terms "one embodiment" or "some embodiments" mean that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in other embodiments" and the like appearing in the embodiments of the present application do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized.
[0057] In the embodiments of the present application, the words "exemplary", "such as", or "for example" are used to mean serving as an example, instance or illustration. Any embodiment or design presented as "exemplary", "such as", or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of "exemplary", "such as", or "for example" is intended to present relevant concepts in a concrete manner.
[0058] In addition, "at least one" means one or more, and "multiple" means two or more. The association relationship between the associated objects is described by "and / or", which means that there can be three relationships, for example, A and / or B, which means that A exists alone, A and B exist together, B exists alone, and A, B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b and c, can mean a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, where a, b, c can be single or multiple.
[0059] The term "user interface (UI)" in the following embodiments of the present application is a medium interface for interaction and information exchange between an application program or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable by the user. The user interface is source code written in a specific computer language such as Java, extensible markup language (XML), and the like. The interface source code is parsed, rendered, and finally presented as content recognizable by the user on an electronic device. The commonly used form of the user interface is a graphic user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, and the like displayed in the display screen of the electronic device.
[0060] AI face changing technology, also known as deepfake technology, is an image synthesis technology based on artificial intelligence, which can replace the facial features of one person with those of another person. The realistic effect can deceive the human eye and even some biometric systems. This AI face changing technology can replace the faces of some characters in certain scenes or be used to create digital characters.
[0061] For example, please refer to FIG. 1A and FIG. 1B, which are schematic diagrams of AI face changing provided by an embodiment of the present application. As shown in FIG. 1A, the AI face changing technology can replace the face of one person with that of another person. As shown in FIG. 1B, the AI face changing technology can be used to create a digital character for live streaming, that is, the anchor displayed in the live streaming screen is a virtual character.
[0062] However, this technology can be used to create and spread false information, conduct online fraud, and other illegal activities. In addition, if the AI face changing technology is used to change the face of a person without the person's consent, it may also involve the problem of infringing the person's privacy and portrait rights.
[0063] Therefore, the face changing detection method provided by an embodiment of the present application can be applied to a scene in which the user interface displayed by an electronic device (such as a smart phone) contains the facial features of a person, including but not limited to application scenarios such as live streaming, video playback, video call, picture viewing, and the like. The face changing detection method provided by an embodiment of the present application can detect the face of a person displayed in an electronic device and output the detection result, so that the user can know whether the face of the currently displayed person is changed by AI.
[0064] In the embodiments of the present application, an electronic device such as a smartphone can provide an "AI face swapping detection" function. The "AI face swapping detection" function can be used to detect the authenticity of a face during the display of facial features (i.e., a face) of a person, that is, to detect whether the displayed face has been face-swapped, or to describe it as detecting whether the displayed face is at risk of being face-swapped, or to describe it as detecting whether the displayed face is a fake face.
[0065] It can be understood that "AI face swapping detection" can also be referred to as "face swapping detection", "deep fake detection", "face authenticity identification", "face swapping identification", and other names. The embodiments of the present application do not limit this.
[0066] The following will take the live broadcast scene as an example to exemplarily introduce the application scenario of the embodiments of the present application.
[0067] As shown in FIG. 2A, the electronic device can display an interface of a home screen, which includes a plurality of application icons, such as a live broadcast application icon 2101, a gallery application icon, a weather application icon, a stock application icon, a calculator application icon, a settings application icon, a mail application icon, a Facebook application icon, a browser application icon, a music application icon, a video application icon, an application store icon, and the like. The plurality of application icons further include a page indicator below to indicate the positional relationship of the currently displayed page and other pages. The electronic device can detect a selection operation 2102 (such as a click operation) of the user on the live broadcast application icon 2101, and in response to the selection operation 2102, the electronic device can display the user interface 2200 of the live broadcast application as shown in FIG. 2B.
[0068] As shown in FIG. 2B, the user interface 2200 displays a live picture in which a face 2201 of a person is displayed. In this scenario, to detect whether the face 2201 displayed in the live picture is replaced, the electronic device can be triggered to start the "AI face replacement detection" function. The electronic device can provide a virtual assistant service, which is an interactive service implemented through artificial intelligence technology and can intelligently recommend relevant function controls according to the display content of the user interface, thereby meeting the interactive needs of the user. For the case where the user interface of the electronic device displays a face, the virtual assistant service can be awakened, and the virtual assistant service can recommend a function control for triggering face replacement detection according to the displayed face. Alternatively, the virtual assistant service can be awakened based on a wake-up control (such as long-pressing the navigation bar to wake up) or based on a power key (such as long-pressing the power key to wake up). The user interface 2200 can include a virtual assistant service wake-up control 2202, which can be used to trigger the electronic device to intelligently recommend services based on the current display content. In the case where the electronic device detects a selection operation 2203 (for example, a long-press operation with a duration of 1 s) of the user on the virtual assistant service wake-up control 2202, in response to the selection operation 2203, the electronic device can wake up the virtual assistant service, and then the virtual assistant service can intelligently recommend a face replacement detection service based on the face 2201 displayed in the live picture.
[0069] As shown in FIG. 2C, the user interface 2200 can include an interaction area 2301 corresponding to the virtual assistant service, which can include a text input bar 2302 and a voice input control 2303. The interaction area 2301 can be used to receive voice instructions or text instructions input by the user. In addition, the user interface 2200 also displays an "AI face replacement detection" prompt control 2204. When the electronic device detects a selection operation 2205 (for example, a click operation) of the user on the "AI face replacement detection" prompt control 2204, in response to the selection operation 2205, the electronic device can perform face replacement detection and obtain a detection result of the face replacement detection. Alternatively, when the virtual assistant service detects a voice instruction or a text instruction input by the user in the interaction area 2301, for example, a voice "start face replacement detection function" or a text "start face replacement detection function", the virtual assistant service can recognize the intention of the instruction as performing face replacement detection, and can trigger the face replacement detection to obtain a face replacement detection result. In this way, the user does not need to perform a selection operation on the "AI face replacement detection" prompt control 2204. It should be understood that FIG. 2C only takes the virtual assistant service recommending a function control for triggering face replacement detection based on the face displayed in the live picture as an example, and in actual applications, the virtual assistant service can recommend different function controls based on the display content of the current user interface, the running application, the system time, the geographic location of the electronic device, and the like, which are not limited in the present application.
[0070] As shown in FIG. 2D, the electronic device can output a card notification 2206 at the user interface 2200, the card notification 2206 including a thumbnail image 2207, and preview information 2208 of the detection result of the face swapping detection. The thumbnail image 2207 can include the face 2201, and the face 2201 is marked. The form of marking the face 2201 can be that a detection frame is marked in the face region in the thumbnail image 2207. Alternatively, the form of marking the face can also be an elliptical mark, a feature point mark, a polygon mark, or a semi-transparent layer mark superimposed on the face detection region, and the form of marking the face in the embodiments of the present application is not limited. The preview information 2208 can include the text content “suspected to exist AI face swapping synthesis, AI face swapping synthesis probability 95%”. The card notification 2206 further includes a view details option 2209, which can be used to trigger the electronic device to display more content related to the detection result. When the electronic device detects a selection operation (such as a click operation) of the user on the view details option 2209, in response to the selection operation, a window displaying more content related to the detection result can be output at the user interface 2200.
[0071] As shown in FIG. 2E, the electronic device can display a window 2210 at the user interface 2200, the window 2210 including an image 2211, and the detection result of the face swapping detection. The image 2211 can include the face 2201, and the face 2201 is marked. The detection result of the face swapping detection can include prompt information 2212 indicating the face swapping probability, and prompt information 2213 indicating the existence of face swapping risk. For example, the prompt information 2212 can include the text content “AI face swapping synthesis probability 95%”, and the prompt information 2213 can include the text content “the face (i.e. the face 2201 mentioned above) in the image is suspected to be AI synthesized”. In addition, the window 2210 can further include a result feedback option 2214, which can be used to feed back whether the detection result of the face swapping detection is accurate. The result feedback option 2214 can include an “accurate” option and an “incorrect” option, so that the electronic device can continuously optimize the accuracy of the face swapping detection based on the user feedback. The window 2210 can further include prompt information 2215 indicating the number of times of face swapping detection, such as the text content “remaining number of detection times today: 14 times”. That is, if the number of times of face swapping detection performed by the electronic device does not reach the threshold, the face swapping detection service can be continuously provided at the same user interface or a different user interface.
[0072] Continuing to refer to FIG. 2E, in some embodiments, the window 2210 can further include a setting control 2216, and in response to a selection operation on the setting control 2216, the electronic device can output a window 2217 as shown in FIG. 2F at the user interface 2200.
[0073] As shown in FIG. 2F, the window 2217 includes a setting item 2218 for controlling the switching state of the AI face changing detection function. The window 2217 can also include a function introduction of the face changing detection function, so as to facilitate the user to understand the face changing detection function. In the case where the AI face changing detection function is enabled, in response to the user's confirmation operation on the "AI face changing detection" prompt control 2204 shown in FIG. 2C, the electronic device can perform face changing detection and obtain the face changing detection result, and then display the card notification 2206 shown in FIG. 2D. In addition, in the case where the electronic device detects a closing operation 2219 on the setting item 2218, the window 2217 can display the prompt information 2220 shown in FIG. 2G.
[0074] As shown in FIG. 2G, the prompt information 2220 can be used to prompt the user that the AI face changing detection function will not be provided after being closed. The prompt information 2220 can also include a cancel option and a still close option 2221. In the case where the user's selection operation on the still close option 2221 is detected, the electronic device can close the AI face changing detection function. In this way, the selection of flexibly enabling or closing the AI face changing detection function can be provided.
[0075] FIGS. 2A-2G exemplarily show the user interface in which the electronic device enables the "AI face changing detection" function and outputs the detection result of the face changing detection. Among them, the user interface displayed by the electronic device includes a face of one person, and the electronic device outputs the corresponding detection result of the face after performing face changing detection on the face, so as to achieve the purpose of prompting the user of the face changing risk, which is conducive to improving the user experience.
[0076] In some embodiments, the user interface displayed by the electronic device can also include multiple faces, and the electronic device can perform face changing detection on the multiple faces respectively, and then output the corresponding detection result of each face in the multiple faces, so as to facilitate the user to comprehensively know whether the faces displayed in the user interface are at risk of face changing.
[0077] The scenario in which the user interface includes multiple faces is described below.
[0078] As shown in FIG. 3A, the live broadcast screen displayed by the user interface 3100 can include a face 3101 and a face 3102. In this scenario, the electronic device can detect whether the face 3101 and the face 3102 are changed respectively. Here, the way of triggering the electronic device to enable the "AI face changing detection" function can refer to the description of FIGS. 2B and 2C above, which will not be described herein. In this way, after the electronic device performs face changing detection, the corresponding detection result of the face 3101 and the corresponding result of the face 3102 can be obtained.
[0079] As shown in FIG. 3B, the electronic device can output a card notification 3103 at the user interface 3100, which can include a thumbnail image 3104, a thumbnail image 3105, preview information 3106, and preview information 3107. The thumbnail image 3104 can include the face 3101, and the face 3101 is marked. The thumbnail image 3105 can include the face 3102, and the face 3102 is marked. The preview information 3106 is the preview information of the detection result corresponding to the face 3101, which can include the text content “Suspected AI face swapping synthesis, AI face swapping synthesis probability 95%”. The preview information 3107 is the preview information of the detection result corresponding to the face 3102, which can include the text content “Suspected AI face swapping synthesis, AI face swapping synthesis probability 90%”. The card notification 3103 further includes a view details option 3108. In response to detecting a selection operation 3109 (e.g., a click operation) on the view details option 3108, the electronic device can output a window showing more content related to the detection result corresponding to the face 3101 and the detection result corresponding to the face 3102 at the user interface 3100.
[0080] As shown in FIG. 3C, the electronic device can output a window 3110 at the user interface 3100, which can include an image 3111, prompt information 3113 indicating the face swapping probability of the face 3101, and prompt information 3114 indicating the face swapping risk of the face 3101. The image 3111 can include the face 3101, and the face 3101 is marked. The window 3110 can further include a page indicator 3112, which can indicate that there are more pages displayed by swiping right. In the case that the electronic device detects a right swipe operation on the page indicator 3112, the window 3110 can display the content shown in FIG. 3D.
[0081] As shown in FIG. 3D, the window 3110 can include an image 3115, prompt information 3116 indicating the face swapping probability of the face 3102, and prompt information 3117 indicating the face swapping risk of the face 3102. The image 3115 can include the face 3102, and the face 3102 is marked.
[0082] For the case that the electronic device displays a plurality of faces, the above-mentioned FIG. 3B takes the example of expanding display of the detection results of the plurality of faces. In some embodiments, the detection results of the plurality of faces can also be displayed in other manners, for example, in a folding display manner. Optionally, in the case of folding display of the detection results, the electronic device can display the detection result corresponding to the face with the highest face swapping risk in the notification card, and display a folding control, which can be used to expand or fold the detection results corresponding to other faces.
[0083] In some embodiments, after outputting the card notification (e.g., the card notification 2206 shown in FIG. 2D, or the card notification 3103 shown in FIG. 3B), if no viewing operation (e.g., a selection operation on the viewing detail option) for the card notification is detected within a preset time threshold, the card notification can automatically disappear, or the card notification can be switched to a capsule notification. Alternatively, the electronic device can also switch the card notification to a capsule notification when detecting a user's tucking operation (e.g., an upslide operation) on the card notification. Here, the display position of the capsule notification can be in the status bar area at the top of the screen, and the size of the capsule notification can be smaller than that of the card notification. The capsule notification can briefly display the detection result of the face swap detection, such as displaying the text content "suspected to exist synthesis" or "suspected to not exist synthesis". In this way, the user's viewing and operation on other display content of the current user interface can be avoided.
[0084] As shown in FIG. 3E, in response to detecting a tucking operation (e.g., an upslide operation) on the card notification 3103, the card notification 3103 can be switched to a capsule notification 3301. The capsule notification 3301 can display text content such as "suspected to exist synthesis", for example.
[0085] It can be understood that the above content all takes the detection of AI face swap traces by the electronic device as an example to introduce the display manner of the detection result. In some embodiments, the electronic device can also not detect AI face swap traces, or can not detect a face, or the detected face does not meet the condition for performing face swap detection (such as the face clarity not meeting the condition, or the face size not meeting the condition, etc.), and the content of the card notification can be adaptively adjusted according to the specific detection result.
[0086] In some embodiments, in addition to outputting the detection result of the face swap detection on the user interface, the electronic device can also output content for prompting that the face swap detection is being performed on the user interface during the execution of the face swap detection. In this way, the progress of the face swap detection can be more intuitively presented to further improve the user experience.
[0087] Taking the live broadcast scene shown in FIG. 2C as an example, the user interface of the electronic device for outputting the capsule notification during the execution of the face swap detection is described below in combination with FIGS. 4A-4D.
[0088] As shown in FIG. 4A, in response to detecting a confirmation operation on the "AI face swap detection" prompt control, the electronic device can trigger the execution of the face swap detection, and output a capsule notification 4101 on the user interface 4100. The capsule notification 4101 can include prompt information 4102, which can include text content such as "detecting" for example.
[0089] In some embodiments, the electronic device may, in the process of performing face swapping detection, encounter network anomalies or server connection anomalies, etc., resulting in the failure of face swapping detection. In response to detecting network anomalies or server connection anomalies, the electronic device can output content in the user interface prompting that face swapping detection has failed.
[0090] As shown in FIG. 4B, in the process of performing face swapping detection, if the electronic device detects network anomalies, it can output capsule notification 4103 in user interface 4100, which can include prompt information 4104 indicating that face swapping detection has failed. For example, prompt information 4104 can include the text content “AI face swapping detection failed”. Prompt information 4104 can also include the reason for the failure of face swapping detection, such as the text content “Please connect to the network and try again after connecting to the network”.
[0091] As shown in FIG. 4C, in the process of performing face swapping detection, if the electronic device detects server connection anomalies, it can output capsule notification 4105 in user interface 4100, which can include prompt information 4106 indicating that face swapping detection has failed. For example, prompt information 4106 can include the text content “AI face swapping detection failed”. Prompt information 4106 can also include the reason for the failure of face swapping detection, such as the text content “Server connection timeout”.
[0092] In some embodiments, in the process of performing face swapping detection, the electronic device may, for example, detect a switching operation of the user for the current interface. In this case, the electronic device can interrupt face swapping detection and output content prompting that face swapping detection has been interrupted.
[0093] As shown in FIG. 4D, in the process of performing face swapping detection, if the electronic device detects an operation 4107 (such as an up-swipe gesture operation) to return to the home screen, it can switch from the user interface 4100 displaying the live application to the interface 4200 displaying the home screen, and display capsule notification 4201 with the interface 4200 of the home screen. Capsule notification 4201 can include prompt information 4202 indicating that face swapping detection has been interrupted. For example, prompt information 4202 can include the text content “AI face swapping detection has been interrupted”. Prompt information 4202 can also include the reason for the interruption of face swapping detection, such as the text content “The detected live application has exited”.
[0094] In some embodiments, the electronic device can perform face swapping detection by first recording the screen in the user interface to obtain a recorded video of the user interface, and then performing face swapping detection based on the recorded video. Optionally, the electronic device can play an animation when recording the screen in the user interface, so as to let the user know that the current user interface is in the recording process.
[0095] Continuing with the live streaming scenario shown in FIG. 2C, the electronic device plays a user interface with an animation effect during the face swapping detection process is illustrated in FIGS. 5A and 5B.
[0096] As shown in FIG. 5A, the electronic device can play an animation effect 5101 around the user interface 5100, indicating that the electronic device is recording the screen in the user interface 5100. After the recording is completed, the animation effect 5101 can automatically disappear. Recording the screen in the user interface is one of the steps of the electronic device performing face swapping detection, and therefore the user interface 5100 can also display a capsule notification 5102, which can include prompt information indicating that face swapping detection is being performed.
[0097] As shown in FIG. 5B, the electronic device can also play an animation effect 5103 from top to bottom in the user interface 5100. Here, the animation effect 5103 has the same function as the animation effect 5101 in FIG. 5A, both of which are to let the user know that the current user interface is in the recording process, and the specific form of the animation effect is not limited in the embodiments of the present application.
[0098] In some embodiments, the electronic device can obtain user authorization before performing face swapping detection, and perform face swapping detection on the face displayed in the user interface after the user agrees to authorize the face swapping detection service.
[0099] As shown in FIG. 6A, the electronic device can output a window 6102 shown in FIG. 6B in response to detecting a confirmation operation on the "AI face swapping detection" prompt control in the user interface 6100. As shown in FIG. 6B, the window 6102 displays authorization prompt information, an agree to authorize option 6104, and a cancel authorization option. The authorization prompt information can be used for the user to understand the functions that the AI face swapping detection service can provide. The electronic device detects a confirmation operation on the agree to authorize option 6104, and triggers the face swapping detection, for example, the user interface shown in FIG. 5A or FIG. 5B can be displayed.
[0100] The above user interfaces take the live streaming scenario as an example to exemplarily introduce the application scenarios of the embodiments of the present application. In the embodiments of the present application, if the face swapping detection trigger event is detected when the user interface displayed by the electronic device contains a face, the electronic device can output a prompt control (i.e., a face swapping detection function entry) for starting the AI face swapping detection function in the user interface. The face swapping detection trigger event can be, for example, the operation event (such as a long press operation) on the wake-up interaction control shown in FIG. 2B. Alternatively, the face swapping detection trigger event can also be an operation event (such as a long press operation) on the power key, or an operation event (such as a drag operation) on the face displayed in the user interface. The embodiments of the present application do not make specific limitations on this.
[0101] The following takes the picture viewing scenario as an example to introduce another way of triggering the electronic device to provide the face changing detection function entry.
[0102] As shown in FIG. 7A, the electronic device can display an interface of a home screen, and in response to detecting a selection operation (e.g., a click operation) of a user on a gallery application icon 7100, the electronic device can display a user interface 7102 of the gallery application as shown in FIG. 7B.
[0103] As shown in FIG. 7B, the user interface 7102 displays a plurality of pictures, such as a face picture 7103, a vase picture, a landscape picture, a diamond picture, and the like. In response to detecting a drag operation of the user on the face picture 7103, the electronic device can display a drag shadow of the face picture 7103, which can be, for example, a form of displaying the face picture 7103 in suspension. In this way, the user can be fed back the movement trajectory of dragging the face picture 7103. In addition, the electronic device can output a quick function list 7104 as shown in FIG. 7C in a right sidebar area of the user interface 7102. Alternatively, the electronic device can output the quick function list 7104 when detecting a click operation on the face picture 7103. Alternatively, the electronic device can output the quick function list 7104 after detecting that the face picture 7103 is dragged.
[0104] As shown in FIG. 7C, the quick function list 7104 can include icons of a plurality of functions recommended by the electronic device based on the face picture 7103, such as an icon 7105 of a face changing detection function, an icon of a collection function, an icon of a sharing function, an icon of a picture editing function, an icon of a printing function, an icon of a search function, and the like. The icons of the plurality of functions included in the quick function list 7104 can be understood as being obtained by the electronic device predicting the intention of the user dragging the face picture 7103. That is, the electronic device can predict that the intention of the user dragging the face picture 7103 can expect to perform face changing detection, or collect the picture, or share the picture, or edit the picture, or print the picture, or search the picture. If the electronic device detects that the face picture 7103 is dragged onto the icon 7105 of the face changing detection function in the quick function list 7104, the electronic device can know that the user expects to perform face changing detection on the face picture 7103, and then trigger detection of whether the face in the face picture 7103 is changed. If the electronic device detects that the face picture 7103 is changed, a face changing risk prompt can be displayed. The face changing risk prompt can be in the form of a card notification, or in the form of a capsule notification, or in other forms, such as a pop-up window form. If the electronic device detects that the face picture 7103 is not changed, no prompt or a prompt of not being changed can be displayed.
[0105] Based on the user interface introduced in the foregoing content, the face swapping detection method provided by the embodiments of the present application is introduced below. Please refer to FIG. 8, which is a flowchart of a face swapping detection method provided by an embodiment of the present application. The method can include but is not limited to the following steps:
[0106] S801, display a first interface of a first application, and detect a virtual assistant service wake-up event for the first interface.
[0107] In the embodiments of the present application, the first interface can display a first face, which can be the face of any person. Optionally, the first interface can also display the faces of multiple persons (i.e., multiple faces), for example, a second face can also be displayed, and the number of faces displayed in the first interface is not limited by the embodiments of the present application.
[0108] In some embodiments, the first interface of the first application can be, for example, a user interface of a live broadcast application, or a user interface of a video playback application, or a user interface of a video call application, or a user interface of a picture viewing application, etc. The first interface can be the user interface shown in FIG. 2B, the user interface shown in FIG. 3A, the user interface shown in FIG. 7B, etc.
[0109] The virtual assistant service wake-up event includes, for example, a voice instruction such as "turn on the virtual assistant", a long press on the power key, or an operation on a wake-up control (for example, please refer to the user interface shown in FIG. 2B described above).
[0110] When the electronic device detects the virtual assistant service wake-up event, the virtual assistant service can be woken up, and a control for starting the face swapping detection function can be output according to the face displayed in the first interface.
[0111] Optionally, after the virtual assistant service is woken up, an interaction area corresponding to the virtual assistant service can be displayed in the first interface (for example, please refer to the user interface shown in FIG. 2C described above). The user can input a voice instruction or a text instruction in the interaction area, for example, the voice instruction can be "start the face swapping detection function", or the text instruction can be "start the face swapping detection function". After the virtual assistant service identifies the intention of the voice instruction or the text instruction as face swapping detection, the face swapping detection can be directly performed. Alternatively, the virtual assistant service can recommend a control for starting the face swapping detection function, and the electronic device can trigger the face swapping detection after detecting the operation of the user clicking the function control.
[0112] S802, in response to detecting the virtual assistant service wake-up event, display a face swapping detection prompt control in the first interface based on the virtual wake-up service.
[0113] In the embodiments of the present application, in response to detecting a virtual assistant service wake-up event, the electronic device can wake up the virtual assistant service, and based on the face displayed in the first interface, the virtual assistant service can display a face changing detection prompt control in the first interface. The face changing detection prompt control can be used to trigger the electronic device to start performing face changing detection. The face changing detection prompt control may, for example, be the "AI face changing detection" prompt control shown in FIG. 2C, or may, for example, be the icon of the face changing detection function shown in FIG. 7C, and the present application does not limit the specific form of the face changing detection prompt control.
[0114] In some embodiments, before the electronic device outputs the face changing detection prompt control in the first interface, the electronic device can first detect whether the picture in the first interface contains a face, and in the case where it is determined that the picture in the first interface contains a face, the face changing prompt control is output. The picture in the first interface containing a face may, for example, be a picture containing a face in a video played in the first interface, or may, for example, be a picture containing a face in an image displayed in the first interface.
[0115] Optionally, the video played in the first interface may, for example, be a live broadcast, or a local video file, or a video in a certain video application. In the case where the first interface is a video playing interface, the electronic device can obtain a screenshot image of the video playing interface by taking a screenshot of the first interface, and then detect whether the screenshot image of the video playing interface contains a face, for example, by calling a face detection model to detect. In the case where it is determined that the screenshot image of the video playing interface contains a face, the face changing detection prompt control is output.
[0116] S803, detecting a face changing detection event for the first interface.
[0117] The face changing detection event may, for example, be an event triggering the electronic device to perform face changing detection. The face changing detection event for the first interface may, for example, include inputting a voice instruction or a text instruction in an interactive region corresponding to the virtual assistant service in the first interface, or a second operation on the face changing detection prompt control displayed in the first interface.
[0118] Specifically, after the electronic device wakes up the virtual assistant service, the electronic device can display an interactive region corresponding to the virtual assistant service in the first interface (for example, the interactive region 2301 in FIG. 2C), and the user can input a voice instruction or a text instruction in the interactive region, such as "start face changing detection function". Alternatively, the user can perform a second operation on the face changing detection prompt control, which may, for example, be a click operation on the face changing detection prompt control (for example, the operation 2205 in FIG. 2C), or may, for example, be a drag operation on the first face stopping above the face changing detection prompt control.
[0119] In some embodiments, after detecting the face swapping detection event, the electronic device can output a second window in the first interface, and the second window displays an authorization prompt information to inquire whether the user agrees to authorize the use of relevant data to perform face swapping detection. Optionally, the second window can display an authorization agreement option and an authorization refusal option. If the electronic device detects a confirmation operation on the authorization agreement option, it can trigger the face swapping detection. If the electronic device detects a confirmation operation on the authorization refusal option, it cancels the face swapping detection. For the user interface in which the electronic device displays the authorization prompt information, refer to FIG. 6A and FIG. 6B, which will not be repeated here.
[0120] In some embodiments, the electronic device can perform face swapping detection in the following two ways:
[0121] Way one, performing face swapping detection based on the recorded video of the first interface:
[0122] S804, in response to detecting the face swapping detection event, recording the pictures in the first interface for a preset time length to obtain a recorded video of the first interface.
[0123] In the embodiments of the present application, the electronic device can record (i.e. screen recording) the pictures in the first interface for a preset time length (e.g. 3s or 5s, etc.) to obtain a recorded video of the first interface, and then perform face swapping detection based on the recorded video.
[0124] In some embodiments, the electronic device can play a first dynamic effect in the first interface during the recording of the pictures in the first interface, so as to feedback to the user that the current first interface is in the recording process. For examples of the first dynamic effect, refer to FIG. 5A.
[0125] S805, calling a face swapping detection model to perform face swapping detection on the recorded video.
[0126] Specifically, the electronic device can perform face swapping detection on the recorded video through the face swapping detection model, which can be a model pre-stored in the local of the electronic device. After inputting the recorded video into the face swapping detection model, based on the multiple frame images corresponding to the recorded video and the time domain information of each frame image in the recorded video, the face swapping detection model can output a face swapping detection result. In this way, it is beneficial to improve the accuracy of face swapping detection.
[0127] In some embodiments, the electronic device can send a face swapping detection request including the recorded video to a cloud-side server to request the cloud-side server to perform face swapping detection on the recorded video. Similarly, the cloud-side server can store a trained face swapping detection model, and calling the face swapping detection model can perform face swapping detection on the recorded video. In this way, the electronic device can not need to pre-store the face swapping detection model, thereby benefiting to save storage space.
[0128] In the second manner, the face swapping detection is performed based on at least one screenshot image of the first interface.
[0129] At S806, in response to detecting the confirmation operation on the face swapping detection prompt control, the electronic device captures a screenshot of the frame in the first interface at a preset time interval to obtain at least one screenshot image of the first interface.
[0130] For a case where the frame in the first interface is a still image, the electronic device can capture a screenshot of the frame in the first interface only once to obtain one screenshot image of the first interface. For a case where the frame in the first interface is a dynamic image or a video, the electronic device can capture a screenshot of the frame in the first interface at a preset time interval to obtain at least one screenshot image of the first interface, and then perform the face swapping detection based on the at least one screenshot image.
[0131] At S807, the face swapping detection model is invoked to perform the face swapping detection on the at least one screenshot image.
[0132] Optionally, the face swapping detection model in S807 can be the same as or different from the face swapping detection model in S805. That is, the input of the face swapping detection model can be an image or a video, or a first face swapping detection model is used to perform the face swapping detection on a video, and a second face swapping detection model is used to perform the face swapping detection on an image.
[0133] Here, the face swapping detection model in the second manner performs the face swapping detection based on an image rather than a video, which is different from the first manner in that the temporal information of the frames in the video is not used, which is beneficial to improving the efficiency of the face swapping detection.
[0134] Similarly to S805, the electronic device can pre-store the face swapping detection model, and the pre-stored face swapping detection model can be invoked to perform the face swapping detection on the at least one screenshot image. Alternatively, the electronic device can send a face swapping detection request including the at least one screenshot image to a cloud server to request the cloud server to perform the face swapping detection on the at least one screenshot image.
[0135] In some embodiments, the electronic device can output first prompt information in the first interface during the process of performing the face swapping detection (e.g., in the first or second manner described above), and the first prompt information can indicate that the electronic device is performing the face swapping detection. Optionally, the first prompt information can be displayed in the form of a capsule notification, for example, the user interface shown in FIG. 4A can be referred to.
[0136] In some embodiments, during the process of performing face swapping detection, if a network anomaly or a server connection anomaly is detected, the electronic device can output second prompt information in the first interface, which can indicate that the electronic device fails to perform face swapping detection. Optionally, the second prompt information can be displayed in the form of a capsule notification, for example, the user interface shown in FIG. 4B can be referred to.
[0137] S808, obtaining a face swapping detection result.
[0138] For the case that the electronic device pre-stores a face swapping detection model locally, the electronic device can obtain the face swapping detection result output by the face swapping detection model from the local storage. For the case that the electronic device requests a cloud-side server to perform face swapping detection, the electronic device can receive a face swapping detection response from the cloud-side server, which can include the face swapping detection result.
[0139] In some embodiments, the face swapping detection result can include at least one detection result of a detection image. Wherein, one detection image can correspond to one frame image of the recorded video of the first interface, or correspond to one of the at least one screenshot image of the first interface. The detection result of one detection image can indicate the risk of face swapping of the face in the detection image, for example, can include the confidence of face swapping of the face in the detection image. Here, one detection image can contain one or more faces. It should be understood that when one detection image contains multiple faces, the detection result of the detection image can include the detection result of each face in the multiple faces, for example, can include the confidence of face swapping of each face.
[0140] Optionally, for the detection result of a face, the electronic device can select a detection result of a detection image containing the face from the detection results of the at least one detection image as the detection result of the face. For example, the electronic device can select the detection result of the detection image with the highest confidence of face swapping of the face from the detection results of the at least one detection image as the detection result of the face. For another example, the electronic device can randomly select a detection result of a detection image containing the face from the detection results of the at least one detection image as the detection result of the face. Alternatively, the electronic device can also integrate the detection results of multiple detection images containing the face to determine the detection result of the face. For example, the electronic device can perform weighted summation on the detection results of multiple detection images containing the face to obtain the detection result of the face.
[0141] In some embodiments, after the electronic device obtains the detection result of the face in the first interface, the electronic device can output a card notification in the first interface. The card notification can be used to preview the detection result of the face in the first interface. Taking an example in which the first interface displays one face (e.g., a first face), the card notification can include a thumbnail image corresponding to the first face and preview information. The thumbnail image corresponding to the first face can be a thumbnail image of a detection image containing the first face, and the thumbnail image can display all or part of the content in the detection image. The preview information can be preview information of the detection result of the detection image.
[0142] Optionally, the detection result can include at least one of the following: a face swap risk exists, a face swap risk does not exist, no face is detected, and no valid face is detected (e.g., the face size is too small or the clarity is insufficient). In a case where the detection result includes that a face swap risk exists, the thumbnail image can be marked with the face with the face swap risk; in a case where the detection result includes that a face swap risk does not exist, the thumbnail image can not be marked with the face and can be positioned to the face region in the detection image; in a case where the detection result includes that no face is detected, the thumbnail image can display all the content in the detection image in a thumbnail manner to indicate that no face is detected; and in a case where the detection result includes that no valid face is detected, the thumbnail image can be positioned to the face region that does not meet the requirement.
[0143] S809, output a first window in the first interface.
[0144] After the electronic device obtains the face swap detection result, the electronic device can first output the card notification, and if the electronic device detects a viewing operation of the card notification by the user, the electronic device can further output the first window in the first interface. The first window can be used to display a more detailed detection result.
[0145] In some embodiments, the card notification output by the electronic device can include a viewing detail option, and the viewing detail option can be used to trigger the electronic device to display the first window. Optionally, if the electronic device does not detect a selection operation of the viewing detail option for more than a preset time threshold, the card notification can automatically disappear or be shrunk into a capsule notification. Correspondingly, if the card notification is shrunk into the capsule notification, the electronic device can cut the capsule notification back to the card notification in response to detecting an unfolding operation (e.g., a downward sliding operation) of the capsule notification.
[0146] In some embodiments, for a case where the first interface contains one face (e.g., the first face), the first window can display the first image and the detection result corresponding to the first image. The first image may, for example, include the first face and the first face is marked, and the detection result corresponding to the first image can indicate the risk of the first face being face-swapped, for example, the user interface shown in FIG. 2E can be referred to. For a case where the first interface contains multiple faces (e.g., the first face and the second face), the first window can also display the second image and the detection result corresponding to the second image, for example, the user interface shown in FIG. 3C can be referred to. The second image may, for example, include the second face and the second face is marked, and the detection result corresponding to the second image can indicate the risk of the second face being face-swapped.
[0147] The interface changes involved in the above process will be introduced below in a specific example in conjunction with FIGS. 9A-9F.
[0148] As shown in FIG. 9A, the electronic device is displaying a video playback interface containing a female face. If a long-press operation on the virtual assistant service wake-up control 9101 is detected, the electronic device can wake up the virtual assistant service, and the virtual assistant service can output a face-swapping detection prompt control 9102 as shown in FIG. 9B based on the face contained in the current video playback interface.
[0149] As shown in FIG. 9B, after detecting the user's operation on the face-swapping detection prompt control 9102, the electronic device can output the second window 9103 shown in FIG. 9C.
[0150] As shown in FIG. 9C, the second window 9103 includes authorization prompt information and an agree authorization control 9104. If a selection operation of the user on the agree authorization control 9104 is detected, the face-swapping detection can be triggered to be performed, and the capsule notification 9105 shown in FIG. 9D can be displayed.
[0151] As shown in FIG. 9D, the capsule notification 9105 includes prompt information indicating that face swapping detection is being performed, such as the text "Detecting". Specifically, during the execution of face swapping detection, the electronic device can record the screen in the video playback interface according to a preset time length, and play a dynamic effect 9106 from top to bottom during the recording process, so as to inform the user that the current video playback interface is in the recording process. After obtaining the recorded video of the video playback interface, the local face swapping detection model can be called to perform face swapping detection on the recorded video, or a face swapping detection request including the recorded video can be sent to the cloud server, requesting the cloud server to call the face swapping detection model to perform face swapping detection on the recorded video, and then obtain the face swapping detection result corresponding to the recorded video. The face swapping detection result corresponding to the recorded video can include the detection result of at least one detection image, and one detection image can correspond to one frame of image of the recorded video. Based on the detection result of at least one detection image, the electronic device can determine the detection result of the face contained in the video playback interface. For example, the detection result of one detection image can indicate the confidence of the face in the detection image being face swapped, and the electronic device can select the detection result of the detection image with the highest confidence of being face swapped as the final detection result.
[0152] As shown in FIG. 9E, after the electronic device obtains the detection result of the face contained in the video playback interface, the electronic device can output a card notification 9107, which includes a thumbnail image, preview information, and a view details option 9108. The thumbnail image can be a thumbnail image of the detection image with the highest confidence of being face swapped, and the preview information can indicate that there is a suspected face swapping risk. If the electronic device detects a selection operation of the user on the view details option 9108, the electronic device can output a window 9109 as shown in FIG. 9F.
[0153] As shown in FIG. 9F, the window 9109 displays an image 9110 of a face, and information 9111 indicating the risk of the face being face swapped, and the face in the image 9110 is marked by a detection frame.
[0154] Next, taking the video playback scenario described in FIGS. 9A-9F as an example, the process of the electronic device performing face swapping detection is introduced in combination with the internal module interaction of the electronic device. As shown in FIG. 10, the process can include but is not limited to the following steps:
[0155] S1001, receiving a user's opening instruction for a video playback application.
[0156] The video playback application can be any application with a video playback function. Optionally, the opening instruction for the video playback application can be a voice instruction or a gesture operation. The voice instruction can be, for example, "open the video playback application", and the gesture operation can be, for example, a click operation on the icon of the video playback application in the home screen.
[0157] S1002, in response to the opening instruction, opening the video playing application, and displaying the interface of the video playing application on the display interface.
[0158] Here, the interface of the video playing application can be the home page interface of the video playing application, or the video playing interface, which is not limited in the present application.
[0159] S1003, receiving a face changing detection wake-up instruction of the user.
[0160] Optionally, the face changing detection wake-up instruction can be a voice instruction "open the face changing detection function", or a long press operation of the wake-up interactive control, or a long press operation of the power key of the electronic device, etc.
[0161] S1004, the scene perception module detects whether the current scene is a video playing scene in response to the face changing detection wake-up instruction.
[0162] After the electronic device receives the face changing detection wake-up instruction of the user, the scene perception module can detect whether the current scene is a video playing scene, or describe as detecting whether the current interface is a video playing interface. The video playing scene includes but is not limited to live streaming scene, local video playing scene, long video playing scene, short video playing scene, etc. Among them, the scene perception module can be a module of the application program framework layer, which can be used to perceive whether the currently running application calls the processing module responsible for video encoding and decoding when the electronic device receives the face changing detection wake-up instruction of the user. If the scene perception module perceives that the currently running application calls the processing module responsible for video encoding and decoding, it can be determined that the current scene is a video playing scene.
[0163] In some embodiments, the electronic device can be configured with an application white list. In the case of running the application in the application white list, the scene perception module can execute the step of detecting whether the current scene is a video playing scene. Optionally, the application white list can be issued to the electronic device by the cloud side server. Step S1004 can also be replaced by the scene perception module judging whether the video playing application is an application in the application white list in response to the face changing detection wake-up instruction, and if so, detecting whether the current scene is a video playing scene.
[0164] S1005, the scene perception module screens the video playing interface to obtain a screenshot image of the video playing interface in response to detecting the video playing scene.
[0165] If the electronic device determines that the current scene is a video playing scene through the scene perception module, the video interface can be screened to obtain a screenshot image of the video playing interface.
[0166] S1006, the scene perception module detects whether the screenshot image of the video playing interface contains a face.
[0167] Optionally, the scene perception module can send the screenshot image of the video playing interface to the face detection module. The face detection module can call the face detection model to detect the screenshot image of the video playing interface to determine whether the screenshot image of the video playing interface contains a face.
[0168] It should be understood that whether the screenshot image of the video playing interface contains a face described herein can be whether it contains a face that meets the detection condition. The detection condition may, for example, include that the face clarity is greater than a clarity threshold, and / or the face size is greater than a size threshold, etc.
[0169] S1007, the scene perception module sends a first message to the display module in response to detecting that the screenshot image of the video playing interface contains a face.
[0170] In the case where the scene perception module determines that the screenshot image of the video playing interface contains a face that meets the detection condition, the first message can be sent to the display module. The first message can be used to notify that the screenshot image of the video playing interface contains a face that meets the detection condition, thereby triggering the display module to output the face change detection prompt control.
[0171] Optionally, the scene perception module can directly send the first message to the display module, or indirectly send the first message to the display module, for example, by sending the first message to the display module through the service scheduling module. That is, the scene perception module can first notify the service scheduling module that the screenshot image of the video playing interface contains a face that meets the detection condition, and then the service scheduling module notifies the display module.
[0172] S1008, the display module outputs the face change detection prompt control in response to the first message.
[0173] The display module can control the video playing interface to output the face change detection prompt control in response to the first message.
[0174] S1009, receiving a confirmation operation of the user on the face change detection prompt control.
[0175] For example, the confirmation operation of the user on the face change detection prompt control may, for example, be a click operation or a long press operation on the face change detection prompt control.
[0176] S1010, the display module sends a second message to the detection module in response to detecting the confirmation operation on the face change detection prompt control.
[0177] In response to a confirmation action detected by the face-swapping detection prompt control, the display module can send a second message to the detection module. This second message can be used to notify the detection module to begin face-swapping detection.
[0178] S1011, the detection module responds to the second message and sends a third message to the recording module.
[0179] The third message can be used to notify the recording module to record or take screenshots of the video playback interface.
[0180] S1012, the recording module responds to the third message and records the video playback interface to obtain the recorded video.
[0181] In some embodiments, the recording module, in response to a third message, can record the video playback interface for a preset duration to obtain a recorded video.
[0182] In some embodiments, the recording module may also take screenshots of the video playback interface at preset time intervals in response to a third message, thereby obtaining at least one screenshot image.
[0183] Optionally, the preset time length and preset time interval can be sent to the electronic device by the cloud server. In other words, the cloud server can adjust the parameters used by the electronic device during the face-swapping detection process.
[0184] S1013, the recording module sends the recorded video to the detection module.
[0185] The recording module can provide the acquired recorded video to the detection module. Optionally, the recording module can also send at least one screenshot image to the detection module.
[0186] S1014, the detection module calls the face-swapping detection model through the algorithm module to perform face-swapping detection on the recorded video.
[0187] Optionally, the algorithm module can store a face-swapping detection model. The algorithm module can call the face-swapping detection model to perform face-swapping detection on a recorded video or at least one screenshot image. The algorithm module can also send at least one screenshot image of a recorded video to the cloud server, so that the cloud server can call the face-swapping detection model to perform face-swapping detection. Here, the face-swapping detection model can detect techniques for forging faces, such as face replacement, face generation, face replay, face editing, and face synthesis.
[0188] S1015, the algorithm module sends the face-swapping detection result to the detection module.
[0189] After obtaining the face-swapping detection results, the algorithm module can send the face-swapping detection results to the detection module.
[0190] S1016, the detection module sends the face swapping detection result to the display module.
[0191] The face swapping detection result can include at least one detection result of a detection image. One detection image can correspond to one frame image of the recorded video, or correspond to one of the at least one screenshot image. The detection result of one detection image can indicate the risk of face swapping of the face in the detection image. After the detection module obtains the face swapping detection, the detection module can send the face swapping detection result to the display module.
[0192] S1017, the display module outputs the first window.
[0193] After the display module receives the face swapping detection result, the display module can control the video playing interface to output the first window. For the case that the step S1006 detects that the video playing interface contains one face (such as the first face), the first window can include the image of the first face and the first information. The first information can indicate the risk of face swapping of the first face. Optionally, the image of the first face can also include a detection frame, which can be used to mark the first face. Here, the image of the first face may, for example, be one of the detection images corresponding to the plurality of first faces with the highest confidence.
[0194] Optionally, for the case that the step S1006 detects that the video playing interface contains multiple faces (such as the first face and the second face), the first window can also include the image of the second face and the second information, which can indicate the risk of face swapping of the second face.
[0195] In some embodiments, before the display module controls the video playing interface to output the first window, the display module can also control the video playing interface to output a card notification. For the card notification, please refer to the related description of the foregoing embodiments (such as the step S809 in the embodiment shown in FIG. 8), which will not be described here.
[0196] The above face swapping detection process is summarized below in combination with the software system architecture provided in FIG. 11.
[0197] As shown in FIG. 11, the application layer of the electronic device can include a video playing application and a display module, and the application program framework layer can include a scene perception module, a face detection module, a detection module, an algorithm module, and a recording module. The electronic device can establish a connection with a cloud-side server and perform data interaction. Assuming that the electronic device has currently run the video playing application, the process of the electronic device performing face swapping detection may, for example, be summarized as follows:
[0198] ① The scene perception module receives an application white list from the cloud-side server. The scene perception module determines whether the currently running video playing application is an application in the application white list.
[0199] If the currently running video playing application is an application in the application white list, the scene awareness module determines whether the current scene is a video playing scene.
[0200] If the scene awareness module determines that the current scene is a video playing scene, a screenshot of the video playing interface is obtained; and the scene awareness module provides the screenshot of the video playing interface to the face detection module, and the face detection module is responsible for detecting whether the screenshot contains a face.
[0201] If the face detection module detects that the screenshot of the video playing interface contains a face, the face detection module notifies the scene awareness module that a face is detected.
[0202] The scene awareness module notifies the detection module to start performing face swapping detection.
[0203] The detection module receives detection parameters from the cloud side server. The detection parameters may include, for example, a preset time length of recording a video, and / or a preset time interval of taking a screenshot.
[0204] The detection module notifies the recording module to record or take a screenshot of the video playing interface according to the detection parameters.
[0205] The recording module returns the recorded video or at least one screenshot image to the detection module.
[0206] The detection module provides the recorded video or at least one screenshot image to the algorithm module.
[0207] The algorithm module sends the recorded video or at least one screenshot image to the cloud side server, so that the cloud side server calls a face swapping detection model to perform face swapping detection.
[0208] The algorithm module receives a face swapping detection result from the cloud side server.
[0209] The algorithm module provides the face swapping detection result to the detection module.
[0210] The detection module determines a first image and a detection result corresponding to the first image based on the face swapping detection result, and sends the first image and the detection result corresponding to the first image to the display module.
[0211] In some embodiments, the electronic device also provides another software architecture of the electronic device.
[0212] Optionally, the software architecture of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The following describes another software architecture of the electronic device by taking an Android system with a layered architecture as an example.
[0213] As shown in FIG. 12, the layered architecture of the electronic device divides the software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system includes, from top to bottom, an application layer, an application framework layer, and a kernel layer, etc.
[0214] The application layer can include a series of application packages, which can include camera, gallery, video player, live broadcast, map, calendar, music, call, etc. In the embodiments of the present application, the application layer can also include a display module. The display module can be used to control the user interface to output the content related to the face swapping detection function, such as outputting a face swapping detection prompt control, outputting a playing animation, outputting a capsule notification, outputting a card notification, etc.
[0215] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0216] The application framework layer can include a window manager. The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and take screenshots, etc.
[0217] The application framework layer can also include a view system, a notification manager, etc.
[0218] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0219] The notification manager enables an application to display notification information in the status bar, which can be used to convey a type of message that can automatically disappear after a short stay without user interaction. In the embodiments of the present application, the notification manager can be used to output prompt information to the user, such as prompting the user that the electronic device is performing face swapping detection, or prompting the user that the face swapping detection is completed, etc.
[0220] In the embodiments of the present application, the application framework layer can further include a scene perception module, a face detection module, a detection module, an algorithm module, and a recording module. The scene perception module can be used to perceive a scene suitable for face swapping detection (such as a video playing scene). The face detection module can be used to detect whether the current interface contains a face. The detection module can be used to monitor whether the face swapping detection function is enabled, configure detection parameters required for performing face swapping detection, manage the calling order of each module in the face swapping detection process, and monitor whether the interface is switched during the face swapping detection execution process. The algorithm module can be used to store a face swapping detection model, or used to request a cloud side server to perform face swapping detection. The recording module can be used to record or capture the display interface, and filter interference content (such as notifications, pop-up windows, etc.) in the interface during recording or capturing.
[0221] The kernel layer is a layer between hardware and software. The kernel layer at least includes display drivers, camera drivers, audio drivers, sensor drivers, processor drivers, and the like.
[0222] It should be noted that the various functional modules included in the software structure are only exemplary and do not constitute a specific limitation on the mobile phone software architecture of the present application. In other embodiments, the various functional modules included in the software structure can be more or less, and the present application does not limit this. Although the embodiments of the present application are described taking the Android system as an example, the basic principles are also applicable to electronic devices based on iOS or Windows operating systems.
[0223] It should be understood that in the embodiments of the present application, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a personal digital assistant (PDA), and the like, and the embodiments of the present application are not limited thereto.
[0224] Exemplarily, the hardware structure of the electronic device in the embodiments of the present application is introduced below.
[0225] As shown in FIG. 13, the electronic device can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0226] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU), etc. Different processing units can be independent devices, or can be integrated in one or more processors.
[0227] The NPU is a neural network computing processor, which can quickly process input information by referring to the structure of a biological neural network, for example, by referring to the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, intelligent cognition and other applications of the electronic device can be realized, for example: image recognition, face recognition, voice recognition, text understanding, etc. In the embodiments of the present application, the NPU can be used to identify the screenshot image of the display interface to determine whether the display interface contains a face, etc.
[0228] The processor 110 can also include memory that stores instructions and data. In some embodiments, the memory within the processor 110 is a cache memory. This memory can hold instructions or data that the processor 110 has recently used or has used frequently. If the processor 110 needs to use that instruction or data again, it can be retrieved directly from the memory. This avoids repeated access to the main memory, reducing the latency of the processor 110 and improving the efficiency of the system.
[0229] The electronic device can display by a GPU, the display 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0230] The wireless communication function of the electronic device can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, and a baseband processor.
[0231] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0232] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1 and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves radiated through the antenna 1. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the function modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be disposed in the same device.
[0233] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., a WiFi network), Bluetooth (BT), BLE broadcasting, a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.
[0234] The electronic device implements a display function through a GPU, a display screen 194, an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0235] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light emitting diode (OLED), an active matrix organic light emitting diode (AMOLED), a flex light emitting diode (FLED), a Miniled, a MicroLed, a MicrooLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device can include one or N display screens 194, where N is a positive integer greater than 1. In the embodiments of the present application, the display screen 194 can be configured to display the user interfaces shown in FIGS. 2A-2G, the user interfaces shown in FIGS. 3A-3E, the user interfaces shown in FIGS. 4A-4D, the user interfaces shown in FIGS. 5A and 5B, the user interfaces shown in FIGS. 6A and 6B, and the user interfaces shown in FIGS. 7A-7C.
[0236] The touch sensor 180K, also referred to as a “touch panel”. The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 together form a touch screen, also referred to as a “touch screen”. The touch sensor 180K is configured to detect a touch operation acting on or near the touch sensor 180K. The touch sensor 180K can transmit the detected touch operation to the application processor to determine the touch event type. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device, which is different from the position where the display screen 194 is located. In the embodiments of the present application, the touch sensor 180K can be configured to detect the operation of triggering the face changing detection function by the user, such as the long press operation on the face changing detection prompt control and the like.
[0237] It can be understood that the structure illustrated in the embodiments does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device can include more or fewer components than those illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0238] In the above embodiments, all or part can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, all or part of the computer program instructions generate the processes or functions described in the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another via wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as Solid State Disk), etc.
[0239] It should be noted that for each of the above method embodiments, in order to simply describe, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, some steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0240] The steps in the method of the embodiments of the present application can be adjusted in sequence, combined and deleted according to actual needs.
[0241] The modules in the device of the embodiments of the present application can be combined, divided and deleted according to actual needs. Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by programs instructing relevant hardware, and the programs can be stored in a computer-readable storage medium, which can include flash disk, ROM, RAM, magnetic disk or optical disk, etc. The above disclosure is only a preferred embodiment of the present application, and only a part of the embodiments of the present application, which cannot limit the scope of the rights of the present application.
Claims
1. A face swapping detection method, characterized in that, The method is applied to an electronic device, and the method comprises: displaying a first interface of a first application, the first interface comprising a first face; detecting a first operation on the first interface; in response to detecting the first operation, displaying a first prompt control in the first interface; the first prompt control is used to trigger face changing detection on the face in the first interface; after detecting a second operation on the first prompt control, displaying a first window in the first interface; the first window comprises an image of the first face and first information; the first information indicates a risk of the first face being face changed.
2. The method of claim 1, wherein, The first interface further comprises a second face; the first window further comprises an image of the second face and second information; the second information indicates a risk of the second face being face changed.
3. The method of claim 1, wherein, The first interface comprises a status bar region located at the top of the first interface; before displaying the first window in the first interface, the method further comprises: displaying a capsule notification in the status bar region; the size of the capsule notification is smaller than the size of the first window.
4. The method of claim 3, wherein, During the process of the electronic device performing face changing detection, the capsule notification comprises first capsule information, and the first capsule information indicates that the electronic device is performing face changing detection.
5. The method of claim 4, wherein, In the case where the process of the electronic device performing face changing detection is interrupted, the capsule notification comprises second capsule information, and the second capsule information indicates that the process of the electronic device performing face changing detection has been interrupted.
6. The method of claim 3 or 4, wherein, After displaying the capsule notification in the status bar region, the method further comprises: in response to the electronic device completing face changing detection, displaying a card notification in the status bar region; the size of the card notification is greater than the size of the capsule notification and smaller than the size of the first window; the card notification comprises a thumbnail image of the first face and first preview information, and the first preview information is preview information indicating the risk of the first face being face changed.
7. The method of claim 6, wherein, The card notification comprises a viewing control, and the displaying of the first window in the first interface comprises: in response to detecting a third operation on the viewing control, displaying the first window in the first interface.
8. The method of claim 1, wherein, The first interface comprises a wake-up control, and the first operation is a long-press operation on the wake-up control or a long-press operation on a power key of the electronic device.
9. The method of claim 4, wherein, The method further comprises: playing a first dynamic effect in the first interface; the first dynamic effect indicates that the first interface is in a recording process.
10. The method of claim 1, wherein, The first window further comprises a face detection frame used to mark the first face in the image.
11. The method of claim 1, wherein, After detecting the second operation on the first prompt control, the method further comprises: recording the first interface for a preset time length to obtain a first video; performing face changing detection on the first video to obtain a first detection result; the first detection result indicates the risk of the first face being face changed.
12. The method of claim 1, wherein, After detecting the second operation on the first prompt control, the method further comprises: taking screenshots of the first interface at preset time intervals to obtain at least one screenshot image; Perform face swapping detection on the at least one screenshot image to obtain at least one detection result; Determine a first detection result from the at least one detection result; the first detection result indicates that the first face is at risk of being face swapped.
13. The method of claim 11, wherein, The face swapping detection on the first video to obtain the first detection result comprises: Calling a face swapping detection model to perform face swapping detection on the first video; or Sending a face swapping detection request including the first video to a server; the face swapping detection request is used to request the server to perform face swapping detection on the first video.
14. The method of claim 1, wherein, The displaying of the first prompt control in the first interface comprises: Detecting whether the first interface is a video playing interface; In response to detecting that the first interface is a video playing interface, performing screenshot on the video playing interface to obtain a screenshot image of the video playing interface; Detecting whether the screenshot image of the video playing interface contains a face; In response to detecting that the screenshot image of the video playing interface contains a face, displaying a first prompt control in the first interface.
15. An electronic device, comprising: The electronic device comprises one or more processors, a memory and a touch screen; the memory is used to store program code; the processor is used to run the program code, so that the electronic device implements the method according to any one of claims 1-14.
16. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, which is executed by a processor to implement the method according to any one of claims 1-14.