Face swap detection method and electronic device

By providing face-swapping detection methods and devices in electronic devices, users can trigger detection and obtain risk information, which solves the privacy and legal issues brought about by face-swapping technology and improves the intelligence of devices and user experience.

WO2026066744A9PCT designated stage Publication Date: 2026-07-09HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2025-08-11
Publication Date
2026-07-09

Smart Images

  • Figure CN2025113846_09072026_PF_FP_ABST
    Figure CN2025113846_09072026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a face swap detection method and an electronic device. The method comprises: displaying a first interface of a first application; detecting a first operation for the first interface; when the first interface comprises a first face, in response to detecting the first operation, displaying a first prompt control in the first interface, wherein the first prompt control is configured to trigger face swap detection on a face in the first interface; and upon detecting a second operation for the first prompt control, displaying a first window in the first interface, wherein the first window comprises an image of the first face and first information, and the first information indicates the risk of the first face being swapped. In this way, a user can know, in a timely manner, whether the currently displayed face has the risk of being swapped. The present application is conducive to improving the intelligence level of an electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Face swap detection methods and electronic devices

[0001] This application claims priority to Chinese Patent Application No. 202411392119.8, filed on September 30, 2024, entitled “Face Swap Detection Method and Electronic Device”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal technology, and in particular to a face-swapping detection method and electronic device. Background Technology

[0003] With the development of artificial intelligence generated content (AIGC) technology, various types of content, such as images, audio, and video, can be automatically created or generated using artificial intelligence (AI). Among these, AI-based face-swapping technology has also developed rapidly. This technology can replace the facial features of one person displayed on an electronic device (such as a smartphone) with those features of another person to create seemingly realistic videos or images. Its applications include, but are not limited to, live streaming, video playback, and video calls. This face-swapping technology raises many ethical and legal issues, especially regarding privacy violations, portrait rights, intellectual property rights, and cybersecurity. It may also lead to illegal activities such as fraud and defamation. Therefore, detecting whether the person displayed on an electronic device has been face-swapped is a crucial technology. Summary of the Invention

[0004] This application provides a face-swapping detection method and an electronic device, which can detect face-swapping on the face of a person displayed on the electronic device and output the detection results so that the user can know whether the face of the currently displayed person is at risk of face-swapping, which helps to improve the intelligence of the electronic device.

[0005] Firstly, embodiments of this application provide a face-swapping detection method applicable to electronic devices. The method includes: displaying 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 on the first interface; the first prompt control triggering face-swapping detection on the face in the first interface; and after detecting a second operation on the first prompt control, displaying a first window on the first interface; the first window including an image of the first face and first information; the first information indicating the risk of the first face being face-swapped. Therefore, in this technical solution, the user can actively trigger the electronic device to perform face-swapping detection on the face displayed on the interface, thereby prompting the user about the risk of the face being face-swapped. This helps to improve the intelligence level of the electronic device and thus enhance the user experience.

[0006] In conjunction with the first aspect, in one possible approach, the first interface also includes a second face; the first window further includes an image of the second face and second information; the second information indicates the risk of the second face being face-swapped. Therefore, when an electronic device displays multiple faces, face-swapping detection can be performed separately for each face, allowing users to more comprehensively understand whether the faces displayed on the interface are at risk of being face-swapped.

[0007] In conjunction with the first aspect, in one possible approach, the first interface includes a status bar area located at the top of the first interface; before displaying the first window on the first interface, the method further includes: displaying a capsule notification in the status bar area; the size of the capsule notification is smaller than the size of the first window. Therefore, by displaying the capsule notification at the top of the first interface, users can conveniently and promptly view the status information of the electronic device performing face-swapping detection.

[0008] In conjunction with the first aspect, in one possible approach, during the face-swapping detection process performed by the electronic device, the capsule notification includes first capsule information indicating that the electronic device is performing face-swapping detection. Therefore, capsule notifications can be used to inform the user that the electronic device is performing face-swapping detection.

[0009] In conjunction with the first aspect, in one possible approach, if the face-swapping detection process of the electronic device is interrupted, the capsule notification includes second capsule information indicating that the face-swapping detection process of the electronic device has been interrupted. Specifically, during the face-swapping detection process, if a user's switching operation on the current interface is detected, the face-swapping detection process will be interrupted. In this case, the capsule notification can be used to inform the user that the face-swapping detection has been interrupted.

[0010] In conjunction with the first aspect, in one possible approach, after the capsule notification is displayed in the status bar area, the method further includes: in response to the electronic device completing face-swapping detection, displaying a card notification in the status bar area; the card notification is larger than the capsule notification but smaller than the first window; the card notification includes a thumbnail image of the first face and first preview information, the first preview information being preview information indicating the risk of the first face being face-swapped. It is evident that displaying the card notification allows users to conveniently preview the results of the face-swapping detection.

[0011] In conjunction with the first aspect, in one possible approach, the card notification includes a viewing control that displays a first window on a first interface, including: displaying the first window on the first interface in response to detecting a third action on the viewing control. It is evident that by providing a viewing control in the card notification, users can conveniently view more detailed face-swapping detection results.

[0012] In conjunction with the first aspect, in one possible approach, the method further includes: shrinking the card notification into a capsule notification in response to the absence of a third action on the viewing control for an extended period of time. Thus, if a user does not interact with a card notification for an extended period, the card notification can be shrunk into a capsule notification to avoid interfering with the user's viewing or interaction with other displayed content on the interface.

[0013] In conjunction with the first aspect, in one possible 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 the power button of the electronic device.

[0014] In conjunction with the first aspect, in one possible approach, the above method further includes: playing a first animation effect on the first interface; the first animation effect indicating that the first interface is in the process of recording. The electronic device can perform face-swapping detection by first recording the first interface to obtain a recorded video, and then performing face-swapping detection based on the recorded video. Here, playing the animation effect allows the user to know that the current interface is in the process of recording.

[0015] In conjunction with the first aspect, in one possible approach, the first window also includes a face detection bounding box used to mark the first face in the image. This allows for a more intuitive representation of the result of the face-swapping detection.

[0016] In conjunction with the first aspect, in one possible approach, after detecting a 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 authorization consent control, the authorization prompt information being used to prompt whether to agree to authorize the execution of face-swapping detection; and performing face-swapping detection in response to detecting a fourth operation on the authorization consent control. This approach, obtaining user authorization before performing face-swapping detection, helps improve the data security of face-swapping detection.

[0017] In conjunction with the first aspect, in one possible approach, after detecting a second operation on the first prompt control, the method further includes: recording the first interface for 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 indicating that the first face is at risk of being face-swapped. Thus, performing face-swapping detection based on a video obtained from recording the first interface helps improve the accuracy of the face-swapping detection results.

[0018] In conjunction with the first aspect, in one possible approach, after detecting a second operation on the first prompt control, the method further includes: taking a screenshot of the first interface at 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 a first detection result from the at least one detection result; the first detection result indicating that the first face is at risk of being face-swapped. Thus, performing face-swapping detection based on screenshot images obtained from taking screenshots of the first interface helps improve the efficiency of face-swapping detection results.

[0019] In conjunction with the first aspect, in one possible approach, the aforementioned face-swapping detection of the first video to obtain a first detection result includes: invoking 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 the server; the face-swapping detection request is used to request the server to perform face-swapping detection on the first video. This approach improves the flexibility of performing face-swapping detection.

[0020] In conjunction with the first aspect, in one possible approach, displaying a first prompt control on a first interface includes: detecting whether the first interface is a video playback interface; in response to detecting that the first interface is a video playback interface, taking a screenshot of the video playback interface to obtain a screenshot image of the video playback interface; detecting whether the screenshot image of the video playback interface contains a face; and in response to detecting that the screenshot image of the video playback interface contains a face, displaying the first prompt control on the first interface. This approach recommends using a first prompt control to trigger face-swapping detection when the first interface includes a face, which helps improve the intelligence of electronic devices.

[0021] In conjunction with the first aspect, in one possible approach, the method further includes: 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 list of shortcut functions on the second interface; the list of shortcut functions including a face-swapping detection function; in response to the drag operation stopping at the face-swapping detection function, performing face-swapping detection on the first image to obtain a second detection result; the second detection result indicating the risk of the third face being face-swapped. In this technical solution, dragging an image containing a face can trigger the electronic device's intelligent recommendation of face-swapping detection functions, which helps improve the efficiency of triggering face-swapping detection functions.

[0022] Secondly, this application provides an electronic device comprising: one or more processors, a display screen, and a memory; the memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, the one or more processors calling the computer instructions to cause the electronic device to perform: displaying 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 on the first interface; the first prompt control being used to trigger face-swapping detection on the face in the first interface; and after detecting a second operation on the first prompt control, displaying a first window on the first interface; the first window including an image of the first face and first information; the first information indicating the risk of the first face being face-swapped.

[0023] In conjunction with the second aspect, in one possible manner, the first interface also includes a second face; the first window also includes an image of the second face and second information; the second information indicates the risk of the second face being face-swapped.

[0024] In conjunction with the second aspect, in one possible manner, the first interface includes a status bar area located at the top of the first interface; before displaying the first window in the first interface, the one or more processors invoke computer instructions to cause the electronic device to perform: displaying a capsule notification in the status bar area; the capsule notification is smaller than the size of the first window.

[0025] In conjunction with the second aspect, in one possible approach, during the face-swapping detection process performed by the electronic device, the capsule notification includes first capsule information indicating that the electronic device is performing face-swapping detection.

[0026] In conjunction with the second aspect, in one possible manner, if the process of face-swapping detection performed by the electronic device is interrupted, the capsule notification includes second capsule information indicating that the process of face-swapping detection performed by the electronic device has been interrupted.

[0027] In conjunction with the second aspect, in one possible manner, after the capsule notification is displayed in the status bar area, the one or more processors invoke the computer instructions to cause the electronic device to perform: in response to the electronic device completing face-swapping detection, displaying a card notification in the status bar area; the card notification is larger than the size of the capsule notification and smaller than the size of the first window; the card notification includes a thumbnail image of the first face and first preview information, the first preview information being preview information indicating the risk of the first face being face-swapped.

[0028] In conjunction with the second aspect, in one possible manner, the card notification includes a viewing control, which one or more processors invoke computer instructions to cause the electronic device to perform: displaying a first window in a first interface in response to detecting a third operation on the viewing control.

[0029] In conjunction with the second aspect, in one possible manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: shrinking the card notification into a capsule notification in response to the failure to detect a third operation on the viewing control for an extended period of time.

[0030] In conjunction with the second aspect, in one possible approach, 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 the power button of the electronic device.

[0031] In conjunction with the second aspect, in one possible manner, the one or more processors invoke computer instructions to cause the electronic device to perform: playing a first motion effect in a first interface; the first motion effect indicating that the first interface is in the process of recording.

[0032] In conjunction with the second aspect, in one possible approach, the first window also includes a face detection box used to mark the first face in the image.

[0033] In conjunction with the second aspect, in one possible manner, after detecting a 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 a first interface, the second window including authorization prompt information and an consent authorization control, the authorization prompt information being used to prompt whether to consent to perform face-swapping detection; and performing face-swapping detection in response to detecting a fourth operation on the consent authorization control.

[0034] In conjunction with the second aspect, in one possible manner, after detecting a 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; performing face-swapping detection on the first video to obtain a first detection result; the first detection result indicating that the first face is at risk of being face-swapped.

[0035] In conjunction with the second aspect, in one possible manner, after detecting a second operation on the first prompt control, the one or more processors invoke the computer instructions to cause the electronic device to perform: taking a screenshot of the first interface at 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 a first detection result from the at least one detection result; the first detection result indicating that the first face is at risk of being face-swapped.

[0036] In conjunction with the second aspect, in one possible 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 a face-swapping detection request including the first video to the server; the face-swapping detection request is used to request the server to perform face-swapping detection on the first video. This approach improves the flexibility of performing face-swapping detection.

[0037] In conjunction with the second aspect, in one possible 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 playback interface; in response to detecting that the first interface is a video playback interface, taking a screenshot of the video playback interface to obtain a screenshot image of the video playback interface; detecting whether the screenshot image of the video playback interface contains a face; and in response to detecting that the screenshot image of the video playback interface contains a face, displaying a first prompt control on the first interface.

[0038] In conjunction with the second aspect, in one possible 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 list of shortcut functions in the second interface; the list of shortcut functions including a face-swapping detection function; in response to the drag operation stopping at the face-swapping detection function, performing face-swapping detection on the first image to obtain a second detection result; the second detection result indicating the risk that the third face has been face-swapped.

[0039] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect above.

[0040] Fourthly, this application provides a chip system coupled to a memory, the chip system being used to read and execute a computer program stored in the memory to implement the method described in the first aspect above.

[0041] Fifthly, this application provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to perform the method described in the first aspect. Attached Figure Description

[0042] Figures 1A and 1B are schematic diagrams of an AI face-swapping method provided in an embodiment of this application;

[0043] Figures 2A-2G are schematic diagrams of an interface for single face swapping detection in a live streaming scenario provided by an embodiment of this application;

[0044] Figures 3A-3E are schematic diagrams of the interface for multiple face swapping detection in another live streaming scenario provided by the embodiments of this application;

[0045] Figures 4A-4D are schematic diagrams of an interface for outputting capsule notifications during face-swapping detection provided in an embodiment of this application;

[0046] Figures 5A and 5B are schematic diagrams of an interface for playing animation effects during face-swapping detection provided in an embodiment of this application;

[0047] Figures 6A and 6B are schematic diagrams of an authorized face-swapping detection service provided in an embodiment of this application;

[0048] Figures 7A-7C are schematic diagrams of an interface for triggering the face-swapping detection function according to an embodiment of this application;

[0049] Figure 8 is a flowchart illustrating a face-swapping detection method provided in an embodiment of this application;

[0050] Figures 9A-9F are schematic diagrams of an interface for face-swapping detection in a video playback scenario provided by an embodiment of this application;

[0051] Figure 10 is a flowchart illustrating another face-swapping detection method provided in an embodiment of this application;

[0052] Figure 11 is a flowchart illustrating another face-swapping detection method provided in an embodiment of this application;

[0053] Figure 12 is a schematic diagram of the software structure of an electronic device provided in an embodiment of this application;

[0054] Figure 13 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0056] The terms "first," "second," "third," etc., used in the embodiments of this application are to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, it may include a series of steps or units, or optionally, steps or units not listed, or other steps or units inherent to these processes, methods, products, or devices. The terms "one embodiment" or "some embodiments," etc., mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of the embodiments of this application, do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0057] In the embodiments of this application, the words "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.

[0058] Furthermore, "at least one" refers to one or more, while "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural 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, and c can be single or multiple.

[0059] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with the user. It realizes the conversion between the internal form of information and the form that the user can accept. The user interface is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of an electronic device.

[0060] AI face-swapping technology, also known as deepfake technology, is an artificial intelligence-based image synthesis technique that can replace the facial features of one person with those of another. Its realistic effect can fool the human eye and even some biometric systems. This AI face-swapping technology can replace faces in certain scenarios or be used to create digital characters.

[0061] For example, please refer to Figures 1A and 1B, which are schematic diagrams of an AI face-swapping method provided in an embodiment of this application. As shown in Figure 1A, AI face-swapping technology can replace the face of one person with the face of another. As shown in Figure 1B, AI face-swapping technology can create digital characters for live streaming, meaning that the host displayed in the live stream is a virtual character.

[0062] However, this technology could be used to create and spread false information, commit online fraud, and other illegal activities. Furthermore, using AI face-swapping technology for live streaming without the individual's consent could infringe on their privacy and portrait rights.

[0063] Based on this, the face-swapping detection method provided in this application can be applied to scenarios where the user interface displayed on an electronic device (such as a smartphone) contains facial features of a person, including but not limited to applications such as live streaming, video playback, video calls, and image viewing. The face-swapping detection method provided in this application can detect face-swapping on the face of a person displayed on an electronic device and output the detection results, so that the user can know whether the currently displayed person's face has been swapped by AI.

[0064] In this application embodiment, smartphones and other electronic devices can provide an "AI face-swapping detection" function. This "AI face-swapping detection" function can be used to detect the authenticity of a face during the display of facial features (i.e., a human face), that is, to detect whether the displayed face has been swapped, or to detect whether there is a risk of the displayed face being swapped, or to detect whether the displayed face is a fake face.

[0065] It is understood that "AI face-swapping detection" can also be called "face-swapping detection", "deepfake detection", "face authenticity identification", "face-swapping identification", or other terms, and this application does not limit this.

[0066] The following uses a live streaming scenario as an example to illustrate the application scenarios of the embodiments of this application.

[0067] As shown in Figure 2A, the electronic device can display a main screen interface, which includes multiple application icons, such as a live streaming application icon 2101, a gallery application icon, a weather application icon, a stock application icon, a calculator application icon, a settings application icon, an email application icon, a Facebook application icon, a browser application icon, a music application icon, a video application icon, and an app store icon. Below each application icon is a page indicator to show the positional relationship between the currently displayed page and other pages. The electronic device can detect a user's selection operation 2102 (e.g., a click operation) on the live streaming application icon 2101. In response to the selection operation 2102, the electronic device can display the user interface 2200 of the live streaming application as shown in Figure 2B.

[0068] As shown in Figure 2B, the user interface 2200 displays a live stream, which shows a person's face 2201. In this scenario, to detect whether the face 2201 displayed in the live stream has been face-swapped, the electronic device can be triggered to activate the "AI face-swapping detection" function. The electronic device can provide a virtual assistant service, an interactive service implemented using artificial intelligence technology. This service intelligently recommends relevant functional controls based on the content displayed on the user interface, thereby meeting the user's interactive needs. When the user interface of the electronic device displays a face, the virtual assistant service can be activated, and it can recommend functional controls to trigger face-swapping detection based on the displayed face. Optionally, the virtual assistant service can be activated based on a wake-up control (e.g., long-pressing the navigation bar) or the power button (e.g., long-pressing the power button). The user interface 2200 may 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 currently displayed content. When the electronic device detects a user's selection operation 2203 (e.g., a long press operation, such as a press operation lasting 1 second) 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 face-swapping detection services based on the face 2201 displayed in the live broadcast.

[0069] As shown in Figure 2C, the user interface 2200 may include an interactive area 2301 corresponding to the virtual assistant service. The interactive area 2301 may include a text input field 2302 and a voice input control 2303. The interactive area 2301 can be used to receive voice or text commands input by the user. In addition, the user interface 2200 also displays an "AI face-swapping detection" prompt control 2204. When the electronic device detects a user's selection operation 2205 (e.g., a click operation) on the "AI face-swapping detection" prompt control 2204, in response to the selection operation 2205, the electronic device can perform face-swapping detection and obtain the detection result. Alternatively, when the user detects a voice or text command input in the interactive area 2301, such as the voice "Enable face-swapping detection function" or the text "Enable face-swapping detection function," the virtual assistant service recognizes the intent of the command as performing face-swapping detection and can trigger the execution of face-swapping detection to obtain the detection result. This eliminates the need for the user to perform a selection operation on the "AI face-swapping detection" prompt control 2204. It should be understood that Figure 2C is only an example of the virtual assistant service recommending functional controls for triggering face-swapping detection based on the face displayed in the live broadcast. In actual applications, the virtual assistant service can recommend different functional controls based on information such as the content displayed in the current user interface, the running application, the system time, and the geographical location of the electronic device. This application does not limit this.

[0070] As shown in Figure 2D, the electronic device can output a card notification 2206 to the user interface 2200. The card notification 2206 includes a thumbnail image 2207 and preview information 2208 of the face-swapping detection result. The thumbnail image 2207 may include a face 2201, and the face 2201 is marked. The marking of the face 2201 can be done by annotating the face region in the thumbnail image 2207 with a detection box. Optionally, the face marking can also be in the form of elliptical marking, feature point marking, polygon marking, or a semi-transparent layer marking overlaid on the face detection region, etc. The form of face marking in this embodiment is not limited. The preview information 2208 may include the text content "Suspected AI face-swapping synthesis, AI face-swapping synthesis probability 95%". The card notification 2206 also 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 user's selection action (e.g., a click) on the view details option 2209, in response to the selection action, a window displaying more content related to the detection results can be output on the user interface 2200.

[0071] As shown in Figure 2E, the electronic device can display a window 2210 on the user interface 2200. The window 2210 includes an image 2211 and the detection results of face-swapping detection. The image 2211 may include a face 2201, which is labeled. The detection results may include a prompt message 2212 indicating the probability of face-swapping, and a prompt message 2213 indicating a risk of face-swapping. For example, prompt message 2212 may include the text "AI face-swapping probability 95%", and prompt message 2213 may include the text "The face in this image (i.e., the aforementioned face 2201) is suspected of being AI-generated". Furthermore, the window 2210 may also include a result feedback option 2214, which can be used to provide feedback on the accuracy of the face-swapping detection results. The result feedback option 2214 may include an "accurate" option and an "incorrect" option, allowing the electronic device to continuously optimize the accuracy of face-swapping detection based on user feedback. Window 2210 may also include a prompt message 2215 indicating the number of face-swapping detection attempts remaining, such as the text "Remaining detection attempts for today: 14". In other words, if the electronic device has not reached the required number of face-swapping detection attempts, it can continue to provide face-swapping detection services on the same user interface or a different user interface.

[0072] Referring again to FIG2E, in some embodiments, window 2210 may further include setting control 2216, and in response to a selection operation on setting control 2216, the electronic device may output window 2217 as shown in FIG2F on user interface 2200.

[0073] As shown in Figure 2F, window 2217 includes a setting item 2218 for controlling the on / off state of the AI ​​face-swapping detection function. Window 2217 may also include a function introduction for the face-swapping detection function to help users understand it. When the AI ​​face-swapping detection function is enabled, in response to the user's confirmation operation on the "AI face-swapping detection" prompt control 2204 shown in Figure 2C, the electronic device can perform face-swapping detection, obtain the face-swapping detection result, and then display the card notification 2206 shown in Figure 2D. In addition, when the electronic device detects a closing operation 2219 on setting item 2218, the prompt message 2220 shown in Figure 2G can be displayed in window 2217.

[0074] As shown in Figure 2G, the prompt message 2220 can be used to inform the user that the AI ​​face-swapping detection function will no longer be provided after it is turned off. The prompt message 2220 may also include a cancel option and a "Still off" option 2221. Upon detecting a user's selection of the "Still off" option 2221, the electronic device can turn off the AI ​​face-swapping detection function. In this way, a flexible option to enable or disable the AI ​​face-swapping detection function can be provided.

[0075] Figures 2A-2G exemplarily illustrate the user interface of an electronic device when the "AI face-swapping detection" function is enabled, and the detection results are output. The user interface displayed by the electronic device includes a person's face. After performing face-swapping detection on this face, the electronic device outputs the corresponding detection results, thereby alerting the user to the risk of face-swapping and improving the user experience.

[0076] In some embodiments, the user interface displayed by the electronic device may also include multiple faces. The electronic device can perform face-swapping detection on each of the multiple faces and then output the detection results corresponding to each of the multiple faces, so that the user can fully know whether the face displayed on the user interface is at risk of being face-swapped.

[0077] The following section describes a scenario where the user interface includes multiple faces.

[0078] As shown in Figure 3A, the live stream displayed on the user interface 3100 may include face 3101 and face 3102. In this scenario, the electronic device can detect whether face 3101 and face 3102 have been swapped. The method for triggering the electronic device to enable the "AI face-swapping detection" function is described in Figures 2B and 2C above, and will not be repeated here. Thus, after performing face-swapping detection, the electronic device can obtain the detection results corresponding to face 3101 and face 3102.

[0079] As shown in Figure 3B, the electronic device can output a card notification 3103 to the user interface 3100. The card notification 3103 may include a thumbnail image 3104, a thumbnail image 3105, preview information 3106, and preview information 3107. The thumbnail image 3104 may include a face 3101, and face 3101 is labeled. The thumbnail image 3105 may include a face 3102, and face 3102 is labeled. The preview information 3106 is a preview of the detection result corresponding to face 3101, and may include the text content "Suspected AI face-swapping, AI face-swapping probability 95%". The preview information 3107 is a preview of the detection result corresponding to face 3102, and may include the text content "Suspected AI face-swapping, AI face-swapping probability 90%". The card notification 3103 also includes a view details option 3108. In response to detecting a selection operation 3109 (e.g., a click operation) for the view details option 3108, the electronic device can output a window on the user interface 3100 that displays the detection results corresponding to face 3101 and more related content to the detection results corresponding to face 3102.

[0080] As shown in Figure 3C, the electronic device can output a window 3110 on the user interface 3100. The window 3110 can include an image 3111, a prompt message 3113 indicating the probability of face 3101 being swapped, and a prompt message 3114 indicating the risk of face 3101 being swapped. The image 3111 can include the face 3101, and the face 3101 is marked. The window 3110 can also include a page indicator 3112, which indicates that swiping right will display more pages. When the electronic device detects a right swipe operation on the page indicator 3112, the window 3110 can display the content shown in Figure 3D.

[0081] As shown in Figure 3D, window 3110 may include image 3115, prompt information 3116 indicating the probability of face 3102 being face-swapped, and prompt information 3117 indicating the risk of face 3102 being face-swapped. Image 3115 may include face 3102, and face 3102 is marked.

[0082] When the electronic device displays multiple faces, Figure 3B above illustrates an example of displaying the detection results of multiple faces in an expanded manner. In some embodiments, the detection results of multiple faces can also be displayed in other ways, such as a collapsed display. Optionally, in the case of a collapsed display of the detection results, the electronic device can display the detection result corresponding to the face with the highest risk of face swapping on the notification card, and display a collapse control that can be used to expand or collapse the detection results corresponding to other faces.

[0083] In some embodiments, after an electronic device outputs a card notification (e.g., card notification 2206 shown in FIG. 2D, or 3103 shown in FIG. 3B), if no viewing operation (e.g., selection operation for viewing details option) is detected for the card notification within a preset time threshold, the card notification may automatically disappear, or the card notification may be switched to a capsule notification. Optionally, the electronic device may also switch the card notification to a capsule notification upon detecting a user's collapse operation (e.g., swipe up) on the card notification. Here, the capsule notification may be displayed in the status bar area, which is located at the top of the screen, and the size of the capsule notification is smaller than the size of the card notification. The capsule notification may briefly display the detection result of face swapping, such as displaying the text content "Suspected face swapping" or "Suspected face swapping not present." In this way, it is possible to avoid affecting the user's viewing and operation of other displayed content in the current user interface.

[0084] As shown in Figure 3E, in response to detecting a collapse operation (e.g., an up swipe) on card notification 3103, the electronic device can switch to capsule notification 3301. Capsule notification 3301 may display text content such as "Suspected fabrication".

[0085] It is understandable that the above content uses the example of an electronic device detecting traces of AI face-swapping to illustrate how the detection results are displayed. In some embodiments, the electronic device may not detect traces of AI face-swapping, or it may not detect a face, or the detected face may not meet the conditions for performing face-swapping detection (such as insufficient face clarity or insufficient face size). The content of the card notification can be adaptively adjusted according to the specific detection results.

[0086] In some embodiments, in addition to outputting the face-swapping detection results to the user interface, the electronic device can also output content indicating that face-swapping detection is in progress to the user interface during the face-swapping detection process. This approach provides a more intuitive presentation of the face-swapping detection progress, thereby further enhancing the user experience.

[0087] Taking the live streaming scenario shown in Figure 2C as an example, the following section, in conjunction with Figures 4A-4D, explains the user interface of the capsule notification output by the electronic device during the face-swapping detection process.

[0088] As shown in Figure 4A, in response to detecting a confirmation operation on the "AI face swap detection" prompt control, the electronic device can trigger the execution of face swap detection and output a capsule notification 4101 on the user interface 4100. The capsule notification 4101 may include prompt information 4102, which may include, for example, the text content "Detection in progress".

[0089] In some embodiments, during the face-swapping detection process, the electronic device may encounter network or server connection issues, leading to detection failure. In response to detecting such issues, the electronic device can display a message indicating face-swapping detection failure in the user interface.

[0090] As shown in Figure 4B, if a network anomaly is detected during the face-swapping detection process, the electronic device can output a capsule notification 4103 to the user interface 4100. The capsule notification 4103 can include a prompt message 4104 indicating that the face-swapping detection has failed. The prompt message 4104 can include, for example, the text "AI face-swapping detection failed". The prompt message 4104 can also include the reason for the face-swapping detection failure, such as the text "Network not connected, please connect to the network and try again".

[0091] As shown in Figure 4C, if an abnormal server connection is detected during the face-swapping detection process, the electronic device can output a capsule notification 4105 to the user interface 4100. The capsule notification 4105 can include a prompt message 4106 indicating that the face-swapping detection failed. The prompt message 4106 can include, for example, the text content "AI face-swapping detection failed". The prompt message 4106 can also include the reason for the face-swapping detection failure, such as the text content "Server connection timed out".

[0092] In some embodiments, during the face-swapping detection process, the electronic device may detect a user switching operation on the current interface. In this case, the electronic device can interrupt the face-swapping detection and output a message indicating that the face-swapping detection has been interrupted.

[0093] As shown in Figure 4D, during the face-swapping detection process, if the electronic device detects an operation 4107 to return to the home screen (e.g., a swipe-up gesture), it can switch from the user interface 4100 displaying the live streaming application to the interface 4200 displaying the home screen, and display a capsule notification 4201 on the home screen interface 4200. The capsule notification 4201 may include a prompt message 4202 indicating that the face-swapping detection has been interrupted. The prompt message 4202 may include, for example, the text "AI face-swapping detection has been interrupted." The prompt message 4202 may also include the reason for the face-swapping detection interruption, such as the text "The detected live streaming application has exited."

[0094] In some embodiments, the electronic device may perform face-swapping detection by first recording the screen of 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 may play animation effects while recording the screen of the user interface so that the user is aware that the user interface is currently being recorded.

[0095] Continuing with the live streaming scenario shown in Figure 2C as an example, the user interface for playing animation effects during the face-swapping detection process of the electronic device will be explained below in conjunction with Figures 5A and 5B.

[0096] As shown in Figure 5A, the electronic device can play animation 5101 around the user interface 5100 to indicate that the electronic device is recording the scene in the user interface 5100. After the recording is completed, the animation 5101 can disappear automatically. Recording the scene in the user interface is one of the steps for the electronic device to perform face-swapping detection. Therefore, the user interface 5100 can also display a capsule notification 5102, which can include a prompt message indicating that face-swapping detection is being performed.

[0097] As shown in Figure 5B, the electronic device can also play motion effect 5103 from top to bottom on the user interface 5100. Here, motion effect 5103 has the same function as motion effect 5101 in Figure 5A, both of which inform the user that the current user interface is in the recording process. This application embodiment does not limit the specific form of the motion effect.

[0098] In some embodiments, before performing face-swapping detection, the electronic device may obtain user authorization. Only after the user agrees to authorize the face-swapping detection service can the face displayed in the user interface be detected.

[0099] As shown in Figure 6A, in response to detecting a confirmation operation on the "AI Face Swap Detection" prompt control in the user interface 6100, the electronic device can output the window 6102 shown in Figure 6B on the user interface 6100. As shown in Figure 6B, the window 6102 displays authorization prompt information, an "agree to authorization" option 6104, and a "cancel authorization" option. The authorization prompt information can be used by the user to understand the functions provided by the AI ​​face swap detection service. When the electronic device detects a confirmation operation on the "agree to authorization" option 6104, it can trigger face swap detection, for example, by displaying the user interface shown in Figure 5A or Figure 5B.

[0100] The above user interface, using a live streaming scenario as an example, exemplifies the application scenario of this application embodiment. In this application embodiment, when the electronic device displays a face on the user interface, if a face-swapping detection trigger event is detected, a prompt control for enabling the AI ​​face-swapping detection function (i.e., the face-swapping detection function entry) can be output on the user interface. The face-swapping detection trigger event can be, for example, an operation event (such as a long press) on the wake-up interaction control as shown in Figure 2B above. Alternatively, the face-swapping detection trigger event can also be an operation event on the power button (such as a long press), or an operation event on the face displayed on the user interface (such as a drag-and-drop operation), etc. This application embodiment does not specifically limit this.

[0101] The following example, using image viewing, illustrates another way to trigger the entry point for electronic face-swapping detection.

[0102] As shown in Figure 7A, the electronic device can display the interface of the main screen, and in response to detecting a user's selection operation (e.g., click operation) on the gallery application icon 7100, it can display the user interface 7102 of the gallery application shown in Figure 7B.

[0103] As shown in Figure 7B, the user interface 7102 displays multiple images, such as a face image 7103, a vase image, a landscape image, and a diamond image. In response to detecting a drag operation on the face image 7103, the electronic device can display a drag shadow of the face image 7103. This drag shadow can, for example, be a floating display of the face image 7103. In this way, the user can be informed of the movement trajectory of the dragged face image 7103. Furthermore, the electronic device can output a shortcut function list 7104, as shown in Figure 7C, in the right sidebar area of ​​the user interface 7102. Optionally, the electronic device can output the shortcut function list 7104 when a click operation on the face image 7103 is detected. Alternatively, the electronic device can output the shortcut function list 7104 after detecting that the face image 7103 has been dragged.

[0104] As shown in Figure 7C, the shortcut function list 7104 can include icons for multiple functions recommended by the electronic device based on the face image 7103, such as the icon 7105 for face-swapping detection, the icon for saving, the icon for sharing, the icon for image editing, the icon for printing, and the icon for searching. The icons for the multiple functions included in the shortcut function list 7104 can be understood as being obtained by the electronic device by predicting the user's intention in dragging the face image 7103. That is, the electronic device can predict that the user's intention in dragging the face image 7103 may be to perform face-swapping detection, save the image, share the image, edit the image, print the image, or search for the image. If the electronic device detects that the face image 7103 has been dragged onto the face-swapping detection icon 7105 in the shortcut function list 7104, it can know that the user intends to perform face-swapping detection on the face image 7103, and thus trigger the detection of whether the face in the face image 7103 has been swapped. If the electronic device detects that the face image 7103 has been swapped, it can display a face-swapping risk warning. The risk warning of face swapping can be in the form of a card notification, a capsule notification, or other forms such as a pop-up window. If the electronic device detects that the face image 7103 has not been face-swapped, it may not issue a warning or may indicate that the face has not been swapped.

[0105] Based on the user interface described above, the face-swapping detection method provided in this application embodiment is described below. Please refer to Figure 8, which is a schematic flowchart of a face-swapping detection method provided in this application embodiment. The method may include, but is not limited to, the following steps:

[0106] S801, display the first interface of the first application, and detect the virtual assistant service wake-up event for the first interface.

[0107] In this embodiment, the first interface may display a first face, which can be the face of any person. Optionally, the first interface may also display the faces of multiple people (i.e., multiple faces), for example, a second face may also be displayed. This embodiment does not limit the number of faces displayed on the first interface.

[0108] In some embodiments, the first interface of the first application may be, for example, the user interface of a live streaming application, the user interface of a video playback application, the user interface of a video call application, or the user interface of an image viewing application. This first interface may be the user interface shown in Figure 2B, the user interface shown in Figure 3A, the user interface shown in Figure 7B, etc.

[0109] The virtual assistant service wake-up events include: voice commands, such as the voice "open virtual assistant", long press the power button or operation on the wake-up control (for example, refer to the user interface shown in Figure 2B above).

[0110] When an electronic device detects a virtual assistant service wake-up event, it can wake up the virtual assistant service and output controls to enable the face-swapping detection function based on the face displayed on the first interface.

[0111] Optionally, after the virtual assistant service is activated, the first interface can display the corresponding interactive area for the virtual assistant service (for example, refer to the user interface shown in Figure 2C above). Users can input voice or text commands in the interactive area, such as the voice command "Enable face-swapping detection" or the text command "Enable face-swapping detection." Once the virtual assistant service recognizes the intent of the voice or text command as face-swapping detection, it can directly execute the face-swapping detection. Alternatively, the virtual assistant service can recommend a control for enabling the face-swapping detection function. The electronic device triggers face-swapping detection after detecting the user's click on this control.

[0112] S802, in response to detecting a virtual assistant service wake-up event, displays a face-swapping detection prompt control on the first interface based on the virtual wake-up service.

[0113] In this embodiment, the electronic device can wake up the virtual assistant service in response to detecting a virtual assistant service wake-up event. Based on the face displayed on the first interface, the virtual assistant service can display a face-swapping detection prompt control on the first interface. The face-swapping detection prompt control can be used to trigger the electronic device to begin face-swapping detection. For example, the face-swapping detection prompt control can be the "AI face-swapping detection" prompt control shown in Figure 2C, or it can be the icon of the face-swapping detection function shown in Figure 7C. This application does not limit the specific form of the face-swapping detection prompt control.

[0114] In some embodiments, before outputting the face-swapping detection prompt control on the first interface, the electronic device may first detect whether the screen on the first interface contains a face. If it is determined that the screen on the first interface contains a face, then the face-swapping prompt control is output. The screen on the first interface containing a face could be either a video playing on the first interface or an image displaying on the first interface.

[0115] Optionally, the video played on the first interface can be a live stream, a local video file, or a video from a specific video application. If the first interface is a video playback interface, the electronic device can take a screenshot of the first interface to obtain a screenshot image of the video playback interface; then, it can detect whether the screenshot image of the video playback interface contains a face, for example, by calling a face detection model; if it is determined that the screenshot image of the video playback interface contains a face, a face-swapping detection prompt control is output.

[0116] S803 detects face-swapping events on the first screen.

[0117] Here, a face-swapping detection event can be understood as an event that triggers the electronic device to perform face-swapping detection. For the first interface, a face-swapping detection event can include: inputting voice or text commands in the interactive area corresponding to the virtual assistant service on the first interface, or a second operation on the face-swapping detection prompt control displayed on the first interface.

[0118] Specifically, after the electronic device wakes up the virtual assistant service, an interactive area corresponding to the virtual assistant service can be displayed on the first interface (refer to interactive area 2301 in Figure 2C). The user can input voice or text commands in the interactive area, such as "Enable face-swapping detection function". Alternatively, the user can perform a second operation on the face-swapping detection prompt control. This second operation can be, for example, a click operation on the face-swapping detection prompt control (refer to operation 2205 in Figure 2C), or a drag operation on the first face that stops above the face-swapping detection prompt control.

[0119] In some embodiments, after the electronic device detects a face-swapping detection event, it can output a second window on the first interface. The second window displays an authorization prompt, asking the user whether they agree to authorize the use of relevant data to perform face-swapping detection. Optionally, the second window can display an "agree to authorization" option and a "disagree to authorization" option. If the electronic device detects a confirmation operation for the "agree to authorization" option, it can trigger face-swapping detection. If the electronic device detects a confirmation operation for the "disagree to authorization" option, it cancels face-swapping detection. For details on the user interface for displaying the authorization prompt on the electronic device, please refer to Figures 6A and 6B, which will not be elaborated here.

[0120] In some embodiments, the electronic device may perform face-swapping detection in the following two ways:

[0121] Method 1: Perform face-swapping detection based on the recorded video from the first interface.

[0122] S804, in response to the detection of a face-swapping event, records the screen of the first interface for a preset time length to obtain a recorded video of the first interface.

[0123] In this embodiment of the application, the electronic device can record the screen of the first interface for a preset time length (e.g., 3s or 5s) to obtain a recorded video of the first interface, and then perform face-swapping detection based on the recorded video.

[0124] In some embodiments, during the recording process of the screen on the first interface, the electronic device may play a first animation effect on the first interface to provide feedback to the user that the first interface is currently being recorded. An example of the first animation effect can be found in Figure 5A.

[0125] S805 calls the face-swapping detection model to perform face-swapping detection on the recorded video.

[0126] Specifically, electronic devices can use a face-swapping detection model to detect face swaps in recorded videos. This model can be, for example, a model pre-stored locally on the electronic device. After inputting the recorded video into the face-swapping detection model, based on multiple frames corresponding to the recorded video and the temporal information of each frame within the recorded video, the model can output the face-swapping detection result. This approach helps improve the accuracy of face-swapping detection.

[0127] In some embodiments, an electronic device can send a face-swapping detection request, including the recorded video, to a cloud-based server to request the server to perform face-swapping detection on the recorded video. Similarly, the cloud-based server can store a pre-trained face-swapping detection model, which can be used to detect face-swapping in the recorded video. In this way, the electronic device does not need to pre-store the face-swapping detection model, thus saving storage space.

[0128] Method 2: Perform face-swapping detection based on at least one screenshot image from the first interface:

[0129] S806, in response to detecting a confirmation operation for the face-swapping detection prompt control, take a screenshot of the screen in the first interface at a preset time interval to obtain at least one screenshot image of the first interface.

[0130] Specifically, if the image on the first interface is a still image, the electronic device can take a screenshot of the first interface only once to obtain a single screenshot image. If the image on the first interface is a moving image or video, the electronic device can take screenshots of the first interface at preset time intervals to obtain at least one screenshot image of the first interface, and then perform face-swapping detection based on at least one screenshot image.

[0131] S807, call the face-swapping detection model to perform face-swapping detection on at least one screenshot image.

[0132] Optionally, the face-swapping detection model in step S807 can be the same as or different from the face-swapping detection model in step S805. That is, the input to the face-swapping detection model can be an image or a video, or the first face-swapping detection model can be used to perform face-swapping detection on a video, and the second face-swapping detection model can be used to perform face-swapping detection on an image.

[0133] Here, the face-swapping detection model in Method 2 performs face-swapping detection based on images rather than videos. The difference from Method 1 is that it does not utilize the temporal information of each frame in the video, which helps to improve the efficiency of face-swapping detection.

[0134] Similar to step S805, the electronic device may pre-store a face-swapping detection model, and calling the pre-stored face-swapping detection model can perform face-swapping detection on at least one screenshot image. Alternatively, the electronic device may send a face-swapping detection request including at least one screenshot image to the cloud-side server to request the cloud-side server to perform face-swapping detection on at least one screenshot image.

[0135] In some embodiments, during the face-swapping detection process (such as using Method 1 or Method 2 described above), the electronic device may output a first prompt message on a first interface. The first prompt message may indicate that the electronic device is performing face-swapping detection. Optionally, the first prompt message may be displayed in the form of a capsule notification, for example, referring to the user interface shown in Figure 4A.

[0136] In some embodiments, if the electronic device detects a network anomaly or server connection failure during face-swapping detection, it can output a second prompt message on the first interface. The second prompt message can indicate that the face-swapping detection has failed. Optionally, the second prompt message can be displayed in the form of a capsule notification, for example, referring to the user interface shown in Figure 4B.

[0137] S808, obtain face-swapping detection results.

[0138] If an electronic device has a face-swapping detection model pre-stored locally, it can retrieve the face-swapping detection results output by the model locally. If the electronic device requests face-swapping detection from a cloud server, it can receive a face-swapping detection response from the cloud server, which may include the face-swapping detection results.

[0139] In some embodiments, the face-swapping detection result may include the detection result of at least one detection image. A detection image may correspond to a frame of a recorded video of the first interface, or to a screenshot of at least one screenshot of the first interface. The detection result of a detection image may indicate the risk of face swapping in that detection image, for example, it may include the confidence level of face swapping in that detection image. Here, a detection image may contain one or more faces. It should be understood that when a detection image contains multiple faces, the detection result of that detection image may include the detection result of each of the multiple faces, for example, it may include the confidence level of face swapping for each face.

[0140] Optionally, for a face detection result, the electronic device can select the detection result of a detection image containing the face from the detection results of at least one detection image, and use it as the face detection result. For example, the electronic device can select the detection result of the detection image with the highest confidence that the face has been swapped from the detection results of at least one detection image, and use it as the face detection result. Alternatively, the electronic device can randomly select the detection result of a detection image containing the face from the detection results of at least one detection image, and use it as the face detection result. Or, the electronic device can also combine the detection results of multiple detection images containing the face to determine the face detection result. For example, the electronic device can perform a weighted sum of the detection results of multiple detection images containing the face to obtain the face detection result.

[0141] In some embodiments, after the electronic device obtains the detection result of a face in the first interface, it can output a card notification on the first interface. The card notification can be used to preview the detection result of the face in the first interface. Taking the first interface displaying a face (such as the first face) as an example, 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 containing a detection image of 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 may include at least one of the following: face swapping risk exists, face swapping risk does not exist, no face was detected, and no valid face was detected (e.g., the face size is too small or the clarity is insufficient). Specifically, if the detection result includes face swapping risk, the thumbnail image may mark the face at risk of face swapping; if the detection result includes no face swapping risk, the thumbnail image may not mark the face and may locate the face region in the detection image; if the detection result includes no face detected, the thumbnail image may display a scaled-down version of the entire detection image to indicate that no face was detected; if the detection result includes no valid face detected, the thumbnail image may locate the face region that does not meet the requirements.

[0143] S809 outputs the first window on the first interface.

[0144] After the electronic device obtains the face-swapping detection results, it can first output a card notification. If it detects that the user has viewed the card notification, it can further output a first window on the first interface. The first window can be used to display more detailed detection results.

[0145] In some embodiments, the card notification output by the electronic device may include a "view details" option, which can be used to trigger the electronic device to display a first window. Optionally, if the electronic device does not detect a selection operation for "view details" for a preset time threshold, the card notification may automatically disappear or collapse into a capsule notification. Correspondingly, if the card notification collapses into a capsule notification, the electronic device can switch back to a card notification in response to detecting an expansion operation (e.g., a swipe down) for the capsule notification.

[0146] In some embodiments, when the first interface contains a face (such as a first face), the first window may display a first image and the corresponding detection result. The first image may include, for example, a first face that is marked, and the detection result corresponding to the first image may indicate the risk of the first face being swapped, as shown in the user interface of FIG2E. When the first interface contains multiple faces (such as a first face and a second face), the first window may also display a second image and the corresponding detection result, as shown in the user interface of FIG3C. The second image may include, for example, a second face that is marked, and the detection result corresponding to the second image may indicate the risk of the second face being swapped.

[0147] The following section uses Figures 9A-9F as a specific example to illustrate the interface changes involved in the above process.

[0148] As shown in Figure 9A, the electronic device is displaying a video playback interface containing a woman's face. If a long press operation is detected on the virtual assistant service wake-up control 9101, the electronic device can wake up the virtual assistant service. Based on the face contained in the current video playback interface, the virtual assistant service can output a face-swapping detection prompt control 9102 as shown in Figure 9B.

[0149] As shown in Figure 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 Figure 9C.

[0150] As shown in Figure 9C, the second window 9103 includes an authorization prompt and an "agree to authorize" control 9104. If a user's selection of the "agree to authorize" control 9104 is detected, face-swapping detection can be triggered, and the capsule notification 9105 shown in Figure 9D can be displayed.

[0151] As shown in Figure 9D, the capsule notification 9105 includes a prompt indicating that face-swapping detection is in progress, such as the text "Detection in progress." Specifically, during face-swapping detection, the electronic device can record the video playback interface for a preset time period, playing a motion effect 9106 from top to bottom during the recording process to inform the user that the video playback interface is being recorded. After obtaining the recorded video of the video playback interface, a 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, thereby obtaining 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 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 a detection image can indicate the confidence level of whether the face in the detection image has been swapped. The electronic device can select the detection result of the detection image with the highest confidence level of face swapping as the final detection result.

[0152] As shown in Figure 9E, after the electronic device obtains the detection results of a face contained in the video playback interface, it can output a card notification 9107. The card notification includes a thumbnail image, preview information, and a "view details" option 9108. The thumbnail image can be a thumbnail of the detection image with the highest confidence level of the face swapped image, and the preview information can indicate a suspected face swapping risk. If the electronic device detects the user's selection of the "view details" option 9108, it can output a window 9109 as shown in Figure 9F.

[0153] As shown in Figure 9F, window 9109 displays an image 9110 of a human face, and information 9111 indicating the risk of the face being swapped, and the face in image 9110 is marked by a detection box.

[0154] Next, taking the video playback scenario described in Figures 9A-9F as an example, and combining the internal module interactions of the electronic device, the process of face-swapping detection performed by the electronic device will be introduced. As shown in Figure 10, it may include, but is not limited to, the following steps:

[0155] S1001 receives the user's command to start the video playback application.

[0156] The video playback application can be any application with video playback functionality. Optionally, the command to open the video playback application can be a voice command or a gesture. A voice command could be, for example, "Open the video playback application," while a gesture could be, for example, clicking the video playback application icon on the home screen.

[0157] S1002, in response to the start command, starts the video playback application and displays the interface of the video playback application on the display screen.

[0158] Here, the interface of the video playback application can be the home screen of the video playback application or the video playback interface; this application does not limit this.

[0159] S1003 receives the user's face-swapping detection wake-up command.

[0160] Optionally, the face-swapping detection wake-up command can be a voice command "Enable face-swapping detection function", or a long press operation targeting the wake-up interaction control, or a long press operation targeting the power button of an electronic device, etc.

[0161] S1004, the scene perception module responds to the face-swapping detection wake-up command and detects whether the current scene is a video playback scene.

[0162] After receiving a face-swapping detection wake-up command from a user, an electronic device can use a scene awareness module to detect whether the current scene is a video playback scene, or more specifically, whether the current interface is a video playback interface. Video playback scenes include, but are not limited to, live streaming, local video playback, long video playback, and short video playback. The scene awareness module can be a module at the application framework layer, used to detect whether the currently running application is calling the processing module responsible for video encoding and decoding when the electronic device receives the face-swapping detection wake-up command. If the scene awareness module detects that the currently running application is calling the processing module responsible for video encoding and decoding, then it can determine that the current scene is a video playback scene.

[0163] In some embodiments, the electronic device may be configured with an application whitelist. When an application within the whitelist is running, the scene perception module may perform a step of detecting whether the current scene is a video playback scene. Optionally, the application whitelist may be distributed to the electronic device by a cloud server. Step S1004 may also be replaced by the scene perception module responding to a face-swapping detection wake-up command, determining whether the video playback application is within the application whitelist, and if so, detecting whether the current scene is a video playback scene.

[0164] S1005, the scene perception module responds to the detection of a video playback scene by taking a screenshot of the video playback interface and obtaining a screenshot image of the video playback interface.

[0165] If an electronic device determines that the current scene is a video playback scene through the scene perception module, it can take a screenshot of the video interface to obtain a screenshot image of the video playback interface.

[0166] S1006, The scene perception module detects whether a human face is contained in the screenshot image of the video playback interface.

[0167] Optionally, the scene awareness module can send a screenshot of the video playback interface to the face detection module. The face detection module can then use a face detection model to detect the screenshot to determine whether it contains a face.

[0168] It should be understood that whether a screenshot of the video playback interface described here contains a human face can be determined by whether it contains a human face that meets the detection criteria. Detection criteria may include, for example, a human face with a sharpness greater than a sharpness threshold, and / or a human face with a size greater than a size threshold.

[0169] S1007, the scene perception module responds to the detection that a human face is present in the screenshot image of the video playback interface and sends a first message to the display module.

[0170] If the scene perception module determines that a screenshot of the video playback interface contains a face that meets the detection criteria, it can send a first message to the display module. The first message can be used to notify that the screenshot of the video playback interface contains a face that meets the detection criteria, thereby triggering the display module to output a face-swapping detection prompt control.

[0171] Optionally, the scene perception module can send the first message directly to the display module, or it can send the first message indirectly, for example, through the service scheduling module. That is, the scene perception module can first notify the service scheduling module that the screenshot of the video playback interface contains a face that meets the detection criteria, and then the service scheduling module can notify the display module.

[0172] S1008, the display module responds to the first message and outputs a face-swapping detection prompt control.

[0173] The display module responds to the first message and can control the video playback interface to output a face-swapping detection prompt control.

[0174] S1009: Receive confirmation from the user regarding the face-swapping detection prompt control.

[0175] The user's confirmation action for the face-swapping detection prompt control can be, for example, a click or a long press on the face-swapping detection prompt control.

[0176] S1010, the display module responds to the detection module by sending a second message in response to the detection of a confirmation operation for the face-swapping 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 the detection result of at least one detection image. A detection image can correspond to a frame of a recorded video, or to a screenshot from at least one screenshot image. The detection result of a detection image can indicate the risk of face swapping in that image. After obtaining 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 receiving the face-swapping detection result, the display module can control the video playback interface to output a first window. If step S1006 detects that the video playback interface contains a face (such as a first face), the first window can include an image of the first face and first information. The first information can indicate the risk of the first face being face-swapped. Optionally, the image of the first face can also include a detection bounding box, which can be used to mark the first face. Here, the image of the first face can, for example, be the one with the highest confidence among multiple detection images corresponding to the first face.

[0194] Optionally, in the case where step S1006 detects that the video playback interface contains multiple faces (such as a first face and a second face), the first window may also include an image of the second face and second information, which may indicate the risk of the second face being swapped.

[0195] In some embodiments, before the display module controls the video playback interface to output the first window, it can also control the video playback interface to output card notifications. For details regarding card notifications, please refer to the relevant description in the foregoing embodiments (step S809 in the embodiment shown in Figure 8), which will not be repeated here.

[0196] The process of face-swapping detection described above is summarized below with reference to the software system architecture shown in Figure 11.

[0197] As shown in Figure 11, the application layer of the electronic device can include a video playback application and a display module, while the application framework layer can include a scene awareness 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 server and interact with data. Assuming the electronic device is currently running a video playback application, the process of face-swapping detection on the electronic device can be summarized as follows:

[0198] ① The scene awareness module receives an application whitelist from the cloud server. The scene awareness module determines whether the currently running video playback application is on the application whitelist.

[0199] ②If the currently running video playback application is an application in the application whitelist, the scene awareness module determines whether the current scene is a video playback scene.

[0200] ③ If the scene perception module determines that the current scene is a video playback scene, it takes a screenshot of the video playback interface to obtain a screenshot image of the video playback interface; then it provides the screenshot image of the video playback interface to the face detection module, which is responsible for detecting whether the screenshot image contains a face.

[0201] ④ If the face detection module detects a face in a screenshot of the video playback interface, the face detection module notifies the scene perception module that a face has been detected.

[0202] ⑤ The scene perception module notifies the detection module to start face-swapping detection.

[0203] ⑥ The detection module receives detection parameters from the cloud server. Detection parameters may include, for example, the preset duration of the recorded video and / or the preset time interval for screenshots.

[0204] ⑦ The detection module notifies the recording module to record or screenshot the video playback interface according to the detection parameters.

[0205] ⑧ The recording module returns a recorded video or at least one screenshot image to the detection module.

[0206] ⑨ The detection module provides the algorithm module with a recorded video or at least one screenshot image.

[0207] ⑩ The algorithm module sends a recorded video or at least one screenshot to the cloud server so that the cloud server can call the face-swapping detection model to perform face-swapping detection.

[0208] The algorithm module receives face-swapping detection results from the cloud server.

[0209] The algorithm module provides the face-swapping detection results to the detection module.

[0210] Based on the face-swapping detection results, the detection module determines the first image and the corresponding detection results; then it sends the first image and the corresponding detection results to the display module.

[0211] In some embodiments, this application also provides another software architecture for an electronic device.

[0212] Optionally, the software architecture of electronic devices can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. The following section uses the layered architecture of the Android system as an example to introduce another software architecture for electronic devices.

[0213] As shown in Figure 12, the layered architecture of an electronic device can divide the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system, from top to bottom, consists of the application layer, the application framework layer, and the kernel layer, etc.

[0214] The application layer may include a series of application packages, such as camera, gallery, video playback, live streaming, map, calendar, music, and call applications. In this embodiment, the application layer may also include a display module. The display module can be used to control the user interface to output content related to the face-swapping detection function, such as outputting face-swapping detection prompt controls, outputting playback animations, outputting capsule notifications, and outputting card notifications.

[0215] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0216] The application framework layer can include a window manager. The window manager is used to manage window applications. The window manager can obtain the screen size, determine if a status bar is present, lock the screen, capture the screen, etc.

[0217] The application framework layer may also include a view system, a notification manager, and so on.

[0218] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0219] The notification manager allows applications to display notification information in the status bar. It can be used to convey informational messages and can disappear automatically after a short pause, requiring no user interaction. In this embodiment, the notification manager can output prompts to the user, such as informing the user that the electronic device is performing face-swapping detection, or informing the user that face-swapping detection has been completed.

[0220] In this embodiment, the application framework layer may further include a scene awareness module, a face detection module, a detection module, an algorithm module, and a recording module. The scene awareness module can be used to perceive scenes suitable for face-swapping detection (such as video playback scenes). 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 the detection parameters required for face-swapping detection, manage the calling order of each module during face-swapping detection, and monitor whether the interface is switched during face-swapping detection. The algorithm module can be used to store the face-swapping detection model or to request face-swapping detection from a cloud server. The recording module can be used to record or screenshot the displayed interface, and filter out interfering content (such as notifications, pop-ups, etc.) in the interface during recording or screenshotting.

[0221] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, and processor drivers.

[0222] It should be noted that the functional modules included in the above software structure are merely exemplary and do not constitute a specific limitation on the mobile phone software architecture of this application. In other embodiments, the functional modules included in the above software structure may be more or fewer, and this application does not impose any limitations on this. Although the embodiments of this application use the Android system as an example for illustration, its basic principles are equally applicable to electronic devices based on operating systems such as iOS or Windows.

[0223] It should be understood that, in the embodiments of this application, the electronic device may be a mobile phone, tablet computer, laptop computer, handheld computer, mobile internet device (MID), wearable device, virtual reality (VR) device, augmented reality (AR) device, wireless terminal in industrial control, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, personal digital assistant (PDA), etc., and the embodiments of this application are not limited thereto.

[0224] For example, the hardware structure of the electronic device in the embodiments of this application will be described below.

[0225] As shown in Figure 13, the electronic device may 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 headphone jack 170D, a sensor module 180, buttons 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 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0227] An NPU (Neural Processing Unit) is a neural network computing processor that, by borrowing from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, rapidly processes input information and can continuously learn on its own. NPUs can enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding. In this embodiment, the NPU can be used to recognize screenshots of the display interface to determine whether the display interface contains a face, etc.

[0228] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0229] Electronic devices implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0230] The wireless communication function of electronic devices can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0231] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0232] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0233] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLAN) (such as WiFi), Bluetooth (BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0234] Electronic devices implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0235] The display screen 194 is used to display images, videos, etc. 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 flexible light-emitting diode (FLED), a Minied, MicroLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1. In this embodiment, the display screen 194 can be used to display the user interfaces shown in Figures 2A-2G, 3A-3E, 4A-4D, 5A and 5B, 6A and 6B, and 7A-7C.

[0236] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of the electronic device, in a different position than display screen 194. In this embodiment, touch sensor 180K can be used to detect user actions that trigger face-swapping detection functions, such as a long press on a face-swapping detection prompt control.

[0237] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0238] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk).

[0239] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0240] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.

[0241] The modules in the apparatus of this application embodiment can be merged, divided, and deleted according to actual needs. Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, magnetic disk, or optical disk, etc. The above disclosure is merely a preferred embodiment of this application, and only a part of the embodiments of this application, and should not be construed as limiting the scope of this application.

Claims

1. A face-swapping detection method, characterized in that, Applied to electronic devices, the method includes: Display the first interface of the first application, the first interface including a first face; Detect the first operation performed on the first interface; In response to detecting the first operation, a first prompt control is displayed on 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, a first window is displayed on the first interface; the first window includes an image of the first face and first information; the first information indicates the risk that the first face has been swapped.

2. The method as described in claim 1, characterized in that, The first interface also includes a second face; the first window also includes an image of the second face and second information; the second information indicates the risk of the second face being swapped.

3. The method as described in claim 1, characterized in that, The first interface includes a status bar area, which is located at the top of the first interface; before displaying the first window on the first interface, the method further includes: Capsule notifications are displayed in the status bar area; the size of the capsule notifications is smaller than the size of the first window.

4. The method as described in claim 3, characterized in that, During the face-swapping detection process performed by the electronic device, the capsule notification includes first capsule information, which indicates that the electronic device is performing face-swapping detection.

5. The method as described in claim 4, characterized in that, If the face-swapping detection process of the electronic device is interrupted, the capsule notification includes second capsule information indicating that the face-swapping detection process of the electronic device has been interrupted.

6. The method as described in claim 3 or 4, characterized in that, After displaying the capsule notification in the status bar area, the method further includes: In response to the electronic device completing face-swapping detection, a card notification is displayed in the status bar area; the size of the card notification is larger than the size of the capsule notification and smaller than the size of the first window; the card notification includes a thumbnail image of the first face and first preview information, the first preview information being preview information indicating the risk of the first face being face-swapped.

7. The method as described in claim 6, characterized in that, 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, a first window is displayed in the first interface.

8. The method as described in claim 1, characterized in that, 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 the power button of the electronic device.

9. The method as described in claim 4, characterized in that, The method further includes: Play the first animation effect on the first interface; the first animation effect indicates that the first interface is in the recording process.

10. The method as described in claim 1, characterized in that, The first window also includes a face detection box, which is used to mark the first face in the image.

11. The method as described in claim 1, characterized in that, After detecting a second operation on the first prompt control, the method further includes: The first interface is recorded according to a preset time length to obtain the first video; The first video is subjected to face-swapping detection to obtain a first detection result; the first detection result indicates the risk that the first face has been face-swapped.

12. The method as described in claim 1, characterized in that, After detecting a second operation on the first prompt control, the method further includes: The first interface is captured at a preset time interval 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; A first detection result is determined 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 as described in claim 11, characterized in that, The step of performing face-swapping detection on the first video to obtain a first detection result includes: Call the face-swapping detection model to perform face-swapping detection on the first video; or... A face-swapping detection request, including the first video, is sent to the server; the face-swapping detection request is used to request the server to perform face-swapping detection on the first video.

14. The method as described in claim 1, characterized in that, The step of displaying the first prompt control on the first interface includes: Detect whether the first interface is a video playback interface; In response to detecting that the first interface is a video playback interface, a screenshot of the video playback interface is taken to obtain a screenshot image of the video playback interface; Detect whether the screenshot image of the video playback interface contains a human face; In response to detecting that a human face is detected in a screenshot of the video playback interface, a first prompt control is displayed on the first interface.

15. An electronic device, characterized in that, The electronic device includes: 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, causing the electronic device to implement the method as described in any one of claims 1-14.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-14.