Face change detection method and electronic equipment
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.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing face-swapping technology may lead to privacy violations, portrait rights issues, and illegal activities in electronic devices, and there is a lack of effective detection methods.
A face-swapping detection method and electronic device are provided. By displaying prompt controls on the interface, users can trigger face-swapping detection, output detection results including images and risk information, support multi-face detection, and provide status feedback and user authorization mechanisms during the detection process.
It enhances the intelligence of electronic devices, helps users identify the risks of face swapping, improves user experience, and strengthens data security and detection accuracy.
Smart Images

Figure CN121811508A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminals, and in particular to a face swapping detection method and an electronic device. BACKGROUND
[0002] With the development of artificial intelligence generated content (AIGC) technology, various types of content such as images, audio and videos can be automatically created or generated by using artificial intelligence (AI) technology. Among them, face swapping technology based on artificial intelligence has also developed rapidly. This technology can replace the facial features of a person on another person when displaying the facial features of the person on an electronic device (such as a smartphone), to create seemingly real videos or images, and its application scenarios include but are not limited to live streaming, video playback, video calls, etc. This face swapping technology has raised many ethical and legal issues, especially in terms of privacy invasion, portrait rights, intellectual property rights and network security, and may also lead to illegal activities such as fraud and libel. Therefore, it is necessary to detect whether the person displayed on the electronic device has been face swapped. SUMMARY
[0003] The embodiments of the present application provide a face swapping detection method and an electronic device, which can perform face swapping detection on the face of a person displayed on the electronic device and output the detection result, so that the user can know that the face of the currently displayed person has a face swapping risk, which is beneficial to improve the intelligence of the electronic device.
[0004] In a first aspect, the embodiments of the present application provide a face swapping detection method, which can be applied to an electronic device. 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 in the first interface; the first prompt control is used to trigger face swapping detection on the face in the first interface; after detecting a second operation on the first prompt control, displaying a first window in the first interface; the first window includes an image of the first face and first information; the first information indicates the risk of the first face being face swapped. As can be seen in this technical solution, the user can actively trigger the electronic device to perform face swapping detection on the face displayed in the interface, and then the electronic device can prompt the user of the risk of the face being face swapped, which is beneficial to improve the intelligent degree of the electronic device and thus improve the user experience.
[0005] With reference to the first aspect, in a possible implementation manner, the first interface further includes a second face; the first window further includes an image of the second face and second information; and the second information indicates a risk of the second face being face-swapped. Thus, in a case where the electronic device displays multiple faces, face-swapping detection can be performed on the multiple faces respectively, so that the user can more comprehensively know whether the faces displayed in the interface have a risk of being face-swapped.
[0006] With reference to the first aspect, in a possible implementation manner, the first interface includes a status bar region, and the status bar region is located at a top of the first interface; and before the first window is displayed in the first interface, the method further includes: displaying a capsule notification in the status bar region; and a size of the capsule notification is smaller than a size of the first window. Thus, by displaying the capsule notification on top of the first interface, the user can conveniently view state information of the electronic device performing face-swapping detection in a timely manner.
[0007] With reference to the first aspect, in a possible implementation manner, during the process of the electronic device performing face-swapping detection, the capsule notification includes first capsule information, and the first capsule information indicates that the electronic device is performing face-swapping detection. Thus, the capsule notification can be used to feed back to the user that the electronic device is performing face-swapping detection.
[0008] With reference to the first aspect, in a possible implementation manner, in a case where the process of the electronic device performing face-swapping detection is interrupted, the capsule notification includes second capsule information, and the second capsule information indicates that the process of the electronic device performing face-swapping detection has been interrupted. In this case, in a case where a switching operation of the user with respect to the current interface is detected, the process of face-swapping detection is interrupted. Thus, the capsule notification can be used to feed back to the user that face-swapping detection is interrupted.
[0009] With reference to the first aspect, in a possible implementation manner, after the status bar region displays the capsule notification, the method further includes: in response to the electronic device completing face-swapping detection, displaying a card notification in the status bar region; a size of the card notification is greater than a size of the capsule notification and smaller than a size of the first window; and the card notification includes a thumbnail image of the first face and first preview information, and the first preview information is preview information indicating a risk of the first face being face-swapped. Thus, by displaying the card notification, the user can conveniently preview a result of performing face-swapping detection.
[0010] With reference to the first aspect, in a possible implementation manner, the card notification includes a viewing control, and displaying the first window in the first interface includes: in response to detecting a third operation with respect to the viewing control, displaying the first window in the first interface. Thus, by providing the viewing control in the card notification, the user can conveniently view more detailed face-swapping detection results.
[0011] With reference to the first aspect, in a possible implementation manner, the method further includes: in response to the third operation for the viewing control not being detected for more than a time threshold, shrinking the card notification into a capsule notification. It can be seen that if the user does not operate the card notification for a long time, the card notification can be shrunk into a capsule notification to avoid affecting the user from viewing or operating other displayed content in the interface.
[0012] With reference to the first aspect, in a possible implementation manner, the first interface includes a wake-up control, and the first operation is a long-press operation on the wake-up control or a long-press operation on a power key of the electronic device.
[0013] With reference to the first aspect, in a possible implementation manner, the method further includes: playing a first dynamic effect in the first interface; and the first dynamic effect indicates that the first interface is in a recording process. The manner in which the electronic device performs the face swapping detection can be that the first interface is first recorded to obtain a recording video, and then the face swapping detection is performed based on the recording video. Here, by playing the dynamic effect, the user can be informed that the current interface is in a recording process.
[0014] With reference to the first aspect, in a possible implementation manner, the first window further includes a face detection frame, and the face detection frame is used to mark the first face in the image. In this way, the result of performing the face swapping detection can be more intuitively indicated.
[0015] With reference to the first aspect, in a possible implementation manner, after the second operation for the first prompt control is detected, the method further includes: displaying a second window in the first interface, the second window including authorization prompt information and an agree-to-authorize control, the authorization prompt information being used to prompt whether to agree to authorize the face swapping detection to be performed; and in response to the fourth operation for the agree-to-authorize control being detected, performing the face swapping detection. In this way, the user authorization is obtained before the face swapping detection is performed, which is beneficial to improving the data security of the face swapping detection.
[0016] With reference to the first aspect, in a possible implementation manner, after the second operation for the first prompt control is detected, the method further includes: recording the first interface for a preset time length to obtain a first video; performing the face swapping detection on the first video to obtain a first detection result; and the first detection result indicates that the first face has a face swapping risk. In this way, the face swapping detection is performed based on the video obtained by recording the first interface, which is beneficial to improving the accuracy of the face swapping detection result.
[0017] With reference to the first aspect, in a possible implementation manner, after the second operation on the first prompt control is detected, the method further includes: taking a screenshot of the first interface according to a preset time interval to obtain at least one screenshot image; performing face swapping detection on the at least one screenshot image to obtain at least one detection result; determining a first detection result from the at least one detection result; and the first detection result indicates that the first face is at a face swapping risk. In this way, the face swapping detection is performed on the screenshot image obtained by taking a screenshot of the first interface, which is beneficial to improving the efficiency of the face swapping detection result.
[0018] With reference to the first aspect, in a possible implementation manner, the face swapping detection on the first video to obtain the first detection result includes: 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 a server; and the face swapping detection request is used to request the server to perform face swapping detection on the first video. In this way, the flexibility of performing face swapping detection is improved.
[0019] With reference to the first aspect, in a possible implementation manner, the displaying of the first prompt control in the first interface includes: detecting whether the first interface is a video playing interface; in response to detecting that the first interface is the video playing interface, taking a screenshot of the video playing interface to obtain a screenshot image of the video playing interface; detecting whether the screenshot image of the video playing interface includes a face; and in response to detecting that the screenshot image of the video playing interface includes the face, displaying the first prompt control in the first interface. In this way, the first prompt control for triggering face swapping detection can be recommended when the first interface includes a face, which is beneficial to improving the intelligence of the electronic device.
[0020] With reference to the first aspect, in a possible implementation manner, the method further includes: displaying a second interface of a second application, the second interface including a first image, the first image including a third face; in response to detecting a drag operation on the first image, displaying a shortcut function list in the second interface; the shortcut function list including a face swapping detection function; in response to a stop position of the drag operation being on the face swapping detection function, performing face swapping detection on the first image to obtain a second detection result; and the second detection result indicates a face swapping risk of the third face. In this technical solution, the face swapping detection function can be intelligently recommended by the electronic device through dragging an image including a face, which is beneficial to improving the efficiency of triggering the face swapping detection function.
[0021] In a second aspect, the present 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, the memory is configured to store computer program code, the computer program code comprises computer instructions, the one or more processors invoke the computer instructions to enable the electronic device to perform: displaying a first interface of a first application, the first interface comprising a first face; detecting a first operation on the first interface; in response to detecting the first operation, displaying a first prompt control in the first interface; the first prompt control is configured to trigger face swapping detection on the face in the first interface; after detecting a second operation on the first prompt control, displaying a first window in the first interface; the first window comprises an image of the first face and first information; the first information indicates a risk of face swapping of the first face.
[0022] In a possible implementation manner of the second aspect, the first interface further comprises a second face; the first window further comprises an image of the second face and second information; the second information indicates a risk of face swapping of the second face.
[0023] In a possible implementation manner of the second aspect, the first interface comprises a status bar region, the status bar region is located at the top of the first interface; before displaying the first window in the first interface, the one or more processors invoke the computer instructions to enable the electronic device to perform: displaying a capsule notification in the status bar region; a size of the capsule notification is smaller than a size of the first window.
[0024] In a possible implementation manner of the second aspect, during the face swapping detection process performed by the electronic device, the capsule notification comprises first capsule information, the first capsule information indicates that the electronic device is performing face swapping detection.
[0025] In a possible implementation manner of the second aspect, in a case where the face swapping detection process performed by the electronic device is interrupted, the capsule notification comprises second capsule information, the second capsule information indicates that the face swapping detection process performed by the electronic device has been interrupted.
[0026] In a possible implementation manner of the second aspect, after the status bar region displays the capsule notification, the one or more processors invoke the computer instructions to enable the electronic device to perform: in response to the electronic device completing the face swapping detection, displaying a card notification in the status bar region; a size of the card notification is greater than a size of the capsule notification and smaller than a size of the first window; the card notification comprises a thumbnail image of the first face and first preview information, the first preview information is preview information indicating a risk of face swapping of the first face.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] 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: playing a first motion effect in a first interface; the first motion effect indicating that the first interface is in the process of recording.
[0031] 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.
[0032] 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.
[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: 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.
[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: 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.
[0035] 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.
[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: 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.
[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: 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.
[0038] 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.
[0039] 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.
[0040] 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
[0041] Figure 1A and Figure 1B A schematic diagram illustrating an AI face-swapping method provided in an embodiment of this application;
[0042] Figures 2A-2G A schematic diagram of an interface for detecting a single face swap in a live streaming scenario, provided as an embodiment of this application;
[0043] Figures 3A-3E A schematic diagram of an interface for multiple face swapping detection in another live streaming scenario provided in this application embodiment;
[0044] Figures 4A-4D This application provides an embodiment of an interface diagram illustrating the output of capsule notifications during face-swapping detection.
[0045] Figure 5A and Figure 5B This application provides an embodiment of an interface diagram illustrating the playback of animation effects during face-swapping detection.
[0046] Figure 6A and Figure 6B This is a schematic diagram of an interface for an authorized face-swapping detection service provided in an embodiment of this application;
[0047] Figures 7A-7C A schematic diagram of an interface for triggering a face-swapping detection function provided in an embodiment of this application;
[0048] Figure 8 A schematic flowchart illustrating a face-swapping detection method provided in an embodiment of this application;
[0049] Figures 9A-9F A schematic diagram of an interface for face-swapping detection in a video playback scenario provided in an embodiment of this application;
[0050] Figure 10 A flowchart illustrating another face-swapping detection method provided in this application embodiment;
[0051] Figure 11 A flowchart illustrating another face-swapping detection method provided in this application embodiment;
[0052] Figure 12 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;
[0053] Figure 13 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] 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.
[0059] 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.
[0060] For example, please see Figure 1A and Figure 1B , Figure 1A and Figure 1B This is a schematic diagram illustrating an AI face-swapping method provided in an embodiment of this application. Figure 1A As shown, AI face-swapping technology can replace one person's face with that of another. Figure 1B As shown, AI face-swapping technology can be used to create digital characters for live streaming, meaning that the anchor displayed in the live stream is a virtual character.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] The following uses a live streaming scenario as an example to illustrate the application scenarios of the embodiments of this application.
[0066] like Figure 2A As shown, 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, and in response to the selection operation 2102, the electronic device can display... Figure 2B The user interface 2200 of the live streaming application is shown.
[0067] like Figure 2BAs shown, the user interface 2200 displays a live stream, in which a person's face 2201 is displayed. 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.
[0068] like Figure 2C As shown, 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 Taking the virtual assistant service's recommendation of functional controls for triggering face-swapping detection based on the face displayed in the live stream as an example, in actual applications, the virtual assistant service can recommend and display 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.
[0069] like Figure 2D As shown, 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 in the form of a detection box annotated in the face region of the thumbnail image 2207. Optionally, the face marking can also be in the form of elliptical marking, feature point marking, polygon marking, or a semi-transparent layer marking superimposed on the face detection area, 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.
[0070] like Figure 2E As shown, 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. 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.
[0071] See also Figure 2EIn some embodiments, window 2210 may further include a settings control 2216, and in response to a selection operation on the settings control 2216, the electronic device may output on the user interface 2200. Figure 2F The window shown is 2217.
[0072] like Figure 2F As shown, window 2217 includes settings 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, it responds to user input... Figure 2C The confirmation operation of the "AI face swap detection" prompt control 2204 allows the electronic device to perform face swap detection, obtain the face swap detection result, and then display it. Figure 2D The card notification 2206 is shown. In addition, if the electronic device detects a closing operation 2219 for setting 2218, it can be displayed in window 2217. Figure 2G The displayed message is 2220.
[0073] like Figure 2G As shown, 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.
[0074] Figures 2A-2G The example illustrates an electronic device activating the "AI face-swapping detection" function and its user interface outputting the detection results. The user interface displays a person's face; after performing face-swapping detection on this face, the device outputs the corresponding detection results, thereby alerting the user to the risk of face-swapping and improving the user experience.
[0075] 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.
[0076] The following section describes a scenario where the user interface includes multiple faces.
[0077] like Figure 3AAs shown, 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 above. Figure 2B and Figure 2C The description is omitted here. Thus, after the electronic device performs face-swapping detection, it can obtain the detection results corresponding to face 3101 and face 3102.
[0078] like Figure 3B As shown, the electronic device can output card notification 3103 to the user interface 3100. Card notification 3103 may include thumbnail image 3104, thumbnail image 3105, preview information 3106, and preview information 3107. Thumbnail image 3104 may include a face 3101, and face 3101 is labeled. Thumbnail image 3105 may include a face 3102, and face 3102 is labeled. 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%". 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.
[0079] like Figure 3C As shown, 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 can indicate 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... Figure 3D The content shown.
[0080] like Figure 3DAs shown, 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.
[0081] In cases where the face displayed on an electronic device includes multiple faces, the above... Figure 3B Taking the expanded display of multiple face detection results as an example. 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 detection results, the electronic device can display the detection result corresponding to the face with the highest face-swapping risk on the notification card, and display a collapse control, which can be used to expand or collapse the detection results corresponding to other faces.
[0082] In some embodiments, the electronic device outputs a card notification (e.g.) Figure 2D The card notification shown is 2206, or Figure 3B After step 3103 (as shown), if no viewing operation (e.g., selecting a view option) is detected for the card notification within a preset time threshold, the card notification may automatically disappear, or it may switch to a capsule notification. Optionally, the electronic device may also switch the card notification to a capsule notification upon detecting a user's collapsing operation (e.g., swiping up) on the card notification. Here, the capsule notification can 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 that of the card notification. The capsule notification can briefly display the detection result of face-swapping, such as displaying the text "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.
[0083] like Figure 3E As shown, 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".
[0084] 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.
[0085] 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.
[0086] by Figure 2C Taking the live streaming scenario shown below as an example, let's combine... Figures 4A-4D This describes the user interface for the capsule notification that the electronic device outputs during the face-swapping detection process.
[0087] like Figure 4A As shown, in response to detecting a confirmation operation on the "AI face swap detection" prompt control, the electronic device can trigger face swap detection and output a capsule notification 4101 to the user interface 4100. The capsule notification 4101 may include prompt information 4102, which may include, for example, the text content "Detection in progress".
[0088] 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.
[0089] like Figure 4B As shown, if an electronic device detects a network anomaly during face-swapping detection, it 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 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".
[0090] like Figure 4C As shown, 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 has 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".
[0091] 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.
[0092] likeFigure 4D As shown, 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 content "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 content "The detected live streaming application has exited".
[0093] 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.
[0094] Continue with Figure 2C Taking the live streaming scenario shown below as an example, let's combine... Figure 5A and Figure 5B This describes the user interface that plays animations during the face-swapping detection process on an electronic device.
[0095] like Figure 5A As shown, 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, so 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.
[0096] like Figure 5B As shown, the electronic device can also play animation 5103 from top to bottom on the user interface 5100. Here, animation 5103 is related to... Figure 5A The function of the motion effect 5101 is the same, which is to 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.
[0097] 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.
[0098] like Figure 6AAs shown, 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 following on the user interface 6100: Figure 6B The window shown is 6102. (As shown) Figure 6B As shown, window 6102 displays an authorization prompt, an "Agree to Authorization" option 6104, and a "Cancel Authorization" option. The authorization prompt helps users understand the functions offered by the AI face-swapping detection service. When the electronic device detects a confirmation of the "Agree to Authorization" option 6104, it can trigger face-swapping detection, for example, by displaying... Figure 5A or Figure 5B The user interface shown.
[0099] 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 in 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, the one described above. Figure 2B The example shown is an operation event for waking up the interactive control (such as a long press). Alternatively, the face-swapping detection trigger event can also be an operation event for the power button (such as a long press), or it can be an operation event for the face displayed on the user interface (such as a drag operation), etc. This application embodiment does not specifically limit this.
[0100] The following example, using image viewing, illustrates another way to trigger the entry point for electronic face-swapping detection.
[0101] like Figure 7A As shown, the electronic device can display the main screen interface, and in response to detecting a user's selection operation (e.g., a click operation) on the gallery application icon 7100, it can display... Figure 7B The user interface 7102 of the gallery application is shown.
[0102] like Figure 7B As shown, 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 given feedback on the movement trajectory of the dragged face image 7103. Furthermore, the electronic device can output [information] in the right sidebar area of the user interface 7102. Figure 7CThe shortcut function list 7104 is shown. Optionally, the electronic device can output the shortcut function list 7104 when it detects a click operation on the face image 7103. Alternatively, the electronic device can output the shortcut function list 7104 after it detects that the face image 7103 has been dragged.
[0103] like Figure 7C As shown, 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, thereby triggering 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.
[0104] Based on the user interface described above, the face-swapping detection method provided in this application's embodiments is described below. Please refer to... Figure 8 , Figure 8 This is a flowchart illustrating a face-swapping detection method provided in an embodiment of this application. The method may include, but is not limited to, the following steps:
[0105] S801, display the first interface of the first application, and detect the virtual assistant service wake-up event for the first interface.
[0106] 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.
[0107] 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, etc. The first interface may be... Figure 2B The user interface shown Figure 3A The user interface shown Figure 7B The user interface shown, etc.
[0108] Virtual assistant service wake-up events include: voice commands, such as the voice command "Open virtual assistant", long press of the power button, or operations on the wake-up controls (for example, see the above). Figure 2B (The user interface shown).
[0109] 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.
[0110] Optionally, after the virtual assistant service is invoked, the first interface can display the interactive area corresponding to the virtual assistant service (for example, refer to the above). Figure 2C As shown in the user interface, 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 detection. Alternatively, the virtual assistant service can recommend a control for enabling face-swapping detection; the electronic device will trigger face-swapping detection upon detecting the user's click on this control.
[0111] 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.
[0112] 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 could be... Figure 2C The "AI face swap detection" prompt control shown may also be... Figure 7C The icon for the face-swapping detection function shown in this application does not limit the specific form of the face-swapping detection prompt control.
[0113] 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.
[0114] 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.
[0115] S803 detects face-swapping events on the first screen.
[0116] 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.
[0117] Specifically, after an electronic device activates the virtual assistant service, the corresponding interactive area for the virtual assistant service can be displayed on the first screen (see reference). Figure 2C In the interactive area 2301, users can input voice or text commands, such as "Enable face-swapping detection." Alternatively, users can perform a second operation on the face-swapping detection prompt control, such as clicking the control (see reference). Figure 2C Operation 2205 in the middle, or it can be that the drag operation for the first face stops above the face swap detection prompt control.
[0118] 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 authorize" option and a "disagree to authorize" option. If the electronic device detects a confirmation operation for the "agree to authorize" option, it can trigger face-swapping detection. If the electronic device detects a confirmation operation for the "disagree to authorize" option, it cancels face-swapping detection. For details on the user interface for displaying the authorization prompt on the electronic device, please refer to [link to relevant documentation]. Figure 6A and Figure 6BThis will not be elaborated upon here.
[0119] In some embodiments, the electronic device may perform face-swapping detection in the following two ways:
[0120] Method 1: Perform face-swapping detection based on the recorded video from the first interface.
[0121] 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.
[0122] 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.
[0123] 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 inform the user that the first interface is currently recording. An example of the first animation effect can be found in [reference needed]. Figure 5A .
[0124] S805 calls the face-swapping detection model to perform face-swapping detection on the recorded video.
[0125] 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.
[0126] 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.
[0127] Method 2: Perform face-swapping detection based on at least one screenshot image from the first interface:
[0128] 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.
[0129] 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.
[0130] S807, call the face-swapping detection model to perform face-swapping detection on at least one screenshot image.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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, as shown in [reference needed]. Figure 4A The user interface shown.
[0135] In some embodiments, if the electronic device detects a network or server connection error during face-swapping detection, it can output a second prompt message on the first interface. The second prompt message indicates that the face-swapping detection has failed. Optionally, the second prompt message can be displayed in the form of a capsule notification, for example, as shown in [reference needed]. Figure 4B The user interface shown.
[0136] S808, obtain face-swapping detection results.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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.
[0142] S809 outputs the first window on the first interface.
[0143] 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.
[0144] 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.
[0145] In some embodiments, where the first interface contains a face (e.g., a first face), the first window may display a first image and the corresponding detection results. The first image may, for example, include a first face that is labeled, and the detection results corresponding to the first image may indicate the risk of the first face being swapped. For example, reference can be made to... Figure 2E The user interface is shown. If the first interface contains multiple faces (such as a first face and a second face), the first window can also display a second image and the corresponding detection results. For example, you can refer to... Figure 3C The user interface shown. The second image may include, for example, a second face, which is labeled, and the detection results corresponding to the second image can indicate the risk of the second face being swapped.
[0146] The following is combined with Figures 9A-9F The interface changes involved in the above process will be introduced with a specific example.
[0147] like Figure 9AAs shown, 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, as shown below: Figure 9B The face-swapping detection prompt control shown is 9102.
[0148] like Figure 9B As shown, after detecting the user's operation on the face-swapping detection prompt control 9102, the electronic device can output... Figure 9C The second window shown is 9103.
[0149] like Figure 9C As shown, the second window 9103 includes an authorization prompt and an "agree to authorization" control 9104. If a user selects the "agree to authorization" control 9104, face-swapping detection can be triggered and displayed. Figure 9D The capsule notification shown is 9105.
[0150] like Figure 9D As shown, the capsule notification 9105 includes a prompt message 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 currently being recorded. After obtaining the recorded video of the video playback interface, the device can call a local face-swapping detection model to perform face-swapping detection on the recorded video, or it can send a face-swapping detection request including the recorded video to a cloud-side server, requesting the cloud-side 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 that the face in the detection image has been face-swapped, and 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.
[0151] like Figure 9EAfter the electronic device obtains the detection results of a face 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 the following: Figure 9F The window shown is 9109.
[0152] like Figure 9F As shown, 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 with a detection box.
[0153] Next, with Figures 9A-9F Taking a video playback scenario as an example, and combining the internal module interactions of the electronic device, the process of face-swapping detection on the electronic device is introduced. Figure 10 As shown, the steps may include, but are not limited to, the following:
[0154] S1001 receives the user's command to start the video playback application.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] S1003 receives the user's face-swapping detection wake-up command.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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.
[0164] 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.
[0165] S1006, The scene perception module detects whether a human face is contained in the screenshot image of the video playback interface.
[0166] 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.
[0167] 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.
[0168] 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.
[0169] 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.
[0170] 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.
[0171] S1008, the display module responds to the first message and outputs a face-swapping detection prompt control.
[0172] The display module responds to the first message and can control the video playback interface to output a face-swapping detection prompt control.
[0173] S1009: Receive confirmation from the user regarding the face-swapping detection prompt control.
[0174] 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.
[0175] 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.
[0176] 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.
[0177] S1011, the detection module responds to the second message and sends a third message to the recording module.
[0178] The third message can be used to notify the recording module to record or take screenshots of the video playback interface.
[0179] S1012, the recording module responds to the third message and records the video playback interface to obtain the recorded video.
[0180] 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.
[0181] 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.
[0182] 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.
[0183] S1013, the recording module sends the recorded video to the detection module.
[0184] 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.
[0185] S1014, the detection module calls the face-swapping detection model through the algorithm module to perform face-swapping detection on the recorded video.
[0186] 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.
[0187] S1015, the algorithm module sends the face-swapping detection result to the detection module.
[0188] After obtaining the face-swapping detection results, the algorithm module can send the face-swapping detection results to the detection module.
[0189] S1016, the detection module sends the face-swapping detection result to the display module.
[0190] 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.
[0191] S1017, the display module outputs the first window.
[0192] 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.
[0193] 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.
[0194] 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 information on card notifications, please refer to the foregoing embodiments (e.g., Figure 8 The relevant description of step S809 in the illustrated embodiment will not be repeated here.
[0195] The following is combined with Figure 11 The provided software system architecture summarizes the above face-swapping detection process.
[0196] like Figure 11 As shown, the application layer of an 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 it for data. Assuming the electronic device is currently running a video playback application, the process of face-swapping detection can be summarized as follows:
[0197] ① 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.
[0198] ②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.
[0199] ③ 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.
[0200] ④ 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.
[0201] ⑤ The scene perception module notifies the detection module to start face-swapping detection.
[0202] ⑥ 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.
[0203] ⑦ The detection module notifies the recording module to record or screenshot the video playback interface according to the detection parameters.
[0204] ⑧ The recording module returns a recorded video or at least one screenshot image to the detection module.
[0205] ⑨ The detection module provides the algorithm module with a recorded video or at least one screenshot image.
[0206] ⑩ 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.
[0207] The algorithm module receives face-swapping detection results from the cloud server.
[0208] The algorithm module provides the face-swapping detection results to the detection module.
[0209] 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.
[0210] In some embodiments, this application also provides another software architecture for an electronic device.
[0211] 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.
[0212] like Figure 12 As shown, 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.
[0213] 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.
[0214] 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.
[0215] 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.
[0216] The application framework layer may also include a view system, a notification manager, and so on.
[0217] 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.
[0218] 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.
[0219] 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.
[0220] 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.
[0221] 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.
[0222] 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.
[0223] For example, the hardware structure of the electronic device in the embodiments of this application will be described below.
[0224] like Figure 13As shown, 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.
[0225] 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.
[0226] 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.
[0227] 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.
[0228] 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.
[0229] 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.
[0230] 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.
[0231] 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.
[0232] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLAN) (such as WiFi networks), Bluetooth (BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. 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 signals, 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.
[0233] 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.
[0234] 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 miniature LED, a 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... Figures 2A-2G The user interface shown Figures 3A-3E The user interface shown Figures 4A-4D User interface shown Figure 5A and Figure 5BThe user interface shown Figure 6A and Figure 6B The user interface shown Figures 7A-7C The user interface shown.
[0235] 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.
[0236] 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.
[0237] 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 drive).
[0238] 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.
[0239] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.
[0240] The modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs.
[0241] 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. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.
[0242] The above-disclosed embodiments are merely one preferred embodiment of this application and only a part of the embodiments of this application. They should not be construed as limiting the scope of the claims 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.