A facial biopsy method and device based on mouth opening action
Through the face biopsy method based on mouth opening movements, combined with RGB and D depth map information, the problem of low accuracy of face biopsy in the existing technology is solved, and the safety and credibility of face recognition are improved.
Patent Information
- Application Number
- CN202210744870.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-06-27
AI Technical Summary
Existing face biopsy methods have low accuracy and fail to effectively utilize the three-dimensional information of the face, resulting in the customer's authenticity, safety and credibility being affected during the face recognition process.
A face biopsy method based on mouth opening movements is adopted. By obtaining D depth map and RGB image, mediapipe is used to determine the position information of the face and mouth area, the face collection frame is expanded, the mouth area is mapped to the D depth map, and attention is input force model to obtain probability values, and combine RGB and D depth map information to make biopsy decisions.
It improves the accuracy and defense capabilities of face biopsy, prevents face attacks, and enhances the safety and credibility of biopsy.
Smart Images

Figure CN115082993B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of face detection, and in particular to a face biopsy method and device based on mouth opening action. Background Art
[0002] With the continuous development of technology, the application scenarios of face recognition are becoming more and more extensive, but at the same time, it is common for cybercriminals to use fake faces to complete online face recognition and cause customer losses. Therefore, in the process of face recognition in various business scenarios, customer authenticity, security and credibility have become crucial issues. There are many liveness recognition products in the market: motion biopsy, silent liveness detection, facial glare liveness detection, etc., but these products currently have obvious shortcomings. They only use the two-dimensional information of the face and lose the important third-dimensional information of the face, resulting in low accuracy of existing face biopsy methods.
[0003] There is no effective solution to the above problems. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a facial biopsy method and device based on mouth opening action, so as to alleviate the technical problem of low accuracy of existing facial biopsy methods.
[0005] In a first aspect, an embodiment of the present invention provides a facial biopsy method based on a mouth opening action, comprising: obtaining a facial image of an object to be detected when the mouth is opened, wherein the facial image comprises: a D depth map and an RGB image; determining position information of a face area and position information of a mouth area in the RGB image; enlarging the face acquisition frame by a preset multiple using the position information of the face acquisition frame to obtain target position information, and determining the area corresponding to the target position information in the RGB image as a target RGB image, and mapping the position information of the mouth area to the D depth map to determine the D depth map of the mouth area; inputting the target RGB image into a first attention model to obtain a first probability value, and inputting the D depth map of the mouth area into a second attention model to obtain a second probability value, wherein the first attention model and the second attention model are both attention models constructed based on a se-block module and a resnet module; based on the first probability value and the second probability value, determining the biopsy result of the object to be detected.
[0006] In combination with the first aspect, the embodiment of the present invention provides a first possible implementation of the first aspect, wherein the resnet module includes 8 submodules, namely 2 2 2 and 2 The se-block module is arranged between two residual layers in each sub-module.
[0007] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein determining the position information of the face area and the position information of the mouth area in the RGB image includes: using mediapipe to determine the face area in the RGB image, and determining the position information of the face area using the position information of the face acquisition frame corresponding to the face area in the RGB image; using mediapipe to determine the mouth area in the RGB image, and determining the position information of the mouth area.
[0008] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the face collection frame is enlarged by a preset multiple based on the position information of the face collection frame to obtain the target position information, including:
[0009] Based on the position information of the face collection frame, determine the position information of the upper left corner and the position information of the lower right corner of the face collection frame, wherein the position information of the upper left corner is (face_box.x1, face_box.y1), and the position information of the lower right corner is (face_box.x2, face_box.y2); based on the position information of the upper left corner of the face collection frame and the position information of the lower right corner of the face collection frame, enlarge the face collection frame by a preset multiple to obtain target position information, wherein the target position information includes: target position information of the upper left corner and target position information of the lower right corner, the target position information of the upper left corner is (face_box.x1-n*face_box.x1, face_box.y1-n*face_box.y1), and the target position information of the lower right corner is (face_box.x2+n*face_box.x2, face_box.y2+n*face_box.y2), and n is the preset multiple.
[0010] In combination with the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein, based on the first probability value and the second probability value, determining the biopsy result of the object to be detected, includes: calculating the product between the first probability value and the weight value corresponding to the first probability value to obtain a first product; calculating the product between the second probability value and the weight value corresponding to the second probability value to obtain a second product; if the sum of the first product and the second product is greater than a preset threshold, the object to be detected is a living body; if the sum of the first product and the second product is less than or equal to the preset threshold, the object to be detected is a non-living body.
[0011] In a second aspect, an embodiment of the present invention further provides a facial biopsy device based on a mouth opening action, comprising: an acquisition unit, a first determination unit, a second determination unit, a calculation unit and a detection unit, wherein the acquisition unit is used to acquire a facial image of the object to be detected when the mouth is open, wherein the facial image comprises: a 3D depth map and an RGB image; the first determination unit is used to determine the position information of the face area and the position information of the mouth area in the RGB image; the second determination unit is used to enlarge the face acquisition frame by a preset multiple to obtain the target position information, and convert the target position information in the RGB image into a pixel value; The area corresponding to the positioning information is determined as the target RGB image, and the position information of the mouth area is mapped to the D depth map to determine the D depth map of the mouth area; the calculation unit is used to input the target RGB image into a first attention model to obtain a first probability value, and input the D depth map of the mouth area into a second attention model to obtain a second probability value, wherein the first attention model and the second attention model are both attention models constructed based on the se-block module and the resnet module; the detection unit is used to determine the biopsy result of the object to be detected based on the first probability value and the second probability value.
[0012] In combination with the second aspect, the embodiment of the present invention provides a first possible implementation of the first aspect, wherein the resnet module includes 8 submodules, namely 2 2 2 and 2 The se-block module is arranged between two residual layers in each sub-module.
[0013] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the first determination unit is used to: use mediapipe to determine the face area in the RGB image, and determine the position information of the face area using the position information of the face acquisition frame corresponding to the face area in the RGB image; use mediapipe to determine the mouth area in the RGB image, and determine the position information of the mouth area.
[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the method described in the first aspect above, and the processor is configured to execute the program stored in the memory.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored.
[0016] In an embodiment of the present invention, a facial image of an object to be detected when the mouth is open is obtained, wherein the facial image includes: a 3D depth map and an RGB image; position information of a face region and position information of a mouth region in the RGB image are determined; the position information of the face acquisition frame is used to enlarge the face acquisition frame by a preset multiple to obtain target position information, and the region corresponding to the target position information in the RGB image is determined as a target RGB image, and the position information of the mouth region is mapped to the 3D depth map to determine the 3D depth map of the mouth region; the target RGB image is input into a first attention model to obtain a first probability value, and the 3D depth map of the mouth region is input into a second attention model to obtain a second probability value, wherein both the first attention model and the second attention model are attention models constructed based on a se-block module and a resnet module; based on the first probability value and the second probability value, a biopsy result of the object to be detected is determined, thereby achieving the purpose of performing face biopsy by using the two-dimensional information of the RGB image and fusing the three-dimensional information of the 3D depth map, thereby solving the technical problem of low accuracy of the existing face biopsy method, thereby achieving the technical effect of improving the accuracy of face biopsy.
[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of a facial biopsy method based on mouth opening action provided by an embodiment of the present invention;
[0021] Figure 2A schematic diagram of the conv2_x and se-block modules provided in an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of a facial biopsy device based on mouth opening action provided by an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Embodiment 1:
[0026] According to an embodiment of the present invention, an embodiment of a facial biopsy method based on a mouth opening action is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0027] Figure 1 FIG. 4 is a flow chart of a method for facial biopsy based on mouth opening action according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0028] Step S102, obtaining a facial image of the object to be detected when the mouth is open, wherein the facial image includes: a D depth map and an RGB image;
[0029] Step S104, determining the position information of the face area and the position information of the mouth area in the RGB image;
[0030] Step S106, the face acquisition frame is enlarged by a preset multiple based on the position information of the face acquisition frame to obtain target position information, and the area corresponding to the target position information in the RGB image is determined as the target RGB image, and the position information of the mouth area is mapped to the D depth map to determine the D depth map of the mouth area;
[0031] Step S108, inputting the target RGB image into a first attention model to obtain a first probability value, and inputting the D depth map of the mouth area into a second attention model to obtain a second probability value, wherein both the first attention model and the second attention model are attention models constructed based on a se-block module and a resnet module;
[0032] It should be noted that the network structures of the first attention model and the second attention model are the same, but the training data are different, so the weights of the two models are also different.
[0033] The first attention model and the second attention model are used to extract the features of the frequency domain graph. Their structures are that the features of the upper layer are superimposed on the lower layer. The superposition mechanism of the first attention model and the second attention model in this application is to superimpose one layer at a time, and the middle layer uses SE_Block to allow the model to focus on key information.
[0034] Specifically, the resnet module includes 8 submodules, namely 2 2 2 and 2 The se-block module is arranged between two residual layers in each sub-module.
[0035] like Figure 2 As shown, Figure 2 Schematic diagram of conv2_x and se-block modules.
[0036] Step S110: determining a biopsy result of the object to be detected based on the first probability value and the second probability value.
[0037] In an embodiment of the present invention, a facial image of an object to be detected when the mouth is open is obtained, wherein the facial image includes: a 3D depth map and an RGB image; position information of a face region and position information of a mouth region in the RGB image are determined; the position information of the face acquisition frame is used to enlarge the face acquisition frame by a preset multiple to obtain target position information, and the region corresponding to the target position information in the RGB image is determined as a target RGB image, and the position information of the mouth region is mapped to the 3D depth map to determine the 3D depth map of the mouth region; the target RGB image is input into a first attention model to obtain a first probability value, and the 3D depth map of the mouth region is input into a second attention model to obtain a second probability value, wherein both the first attention model and the second attention model are attention models constructed based on a se-block module and a resnet module; based on the first probability value and the second probability value, a biopsy result of the object to be detected is determined, thereby achieving the purpose of performing face biopsy by using the two-dimensional information of the RGB image and fusing the three-dimensional information of the 3D depth map, thereby solving the technical problem of low accuracy of the existing face biopsy method, thereby achieving the technical effect of improving the accuracy of face biopsy.
[0038] It should be noted that the above method is applied to a terminal device, and the terminal device needs to have LiDAR.
[0039] In the embodiment of the present invention, determining the position information of the face region and the position information of the mouth region in the RGB image includes:
[0040] Step S11, using mediapipe to determine the face area in the RGB image, and using the position information of the face collection frame corresponding to the face area in the RGB image to determine the position information of the face area;
[0041] Step S12: using mediapipe, determining the mouth area in the RGB image, and determining the position information of the mouth area.
[0042] In an embodiment of the present invention, first, the face area is obtained through mediapipe to obtain the position information of the face collection frame, including: the coordinates of the upper left corner of the face collection frame: (face_box.x1, face_box.y1), and the coordinates of the lower right corner of the face frame: (face_box.x2, face_box.y2).
[0043] Then, the mediapipe is used to determine the mouth area in the RGB image and the position information of the mouth area.
[0044] In an embodiment of the present invention, the position information of the face collection frame is used to enlarge the face collection frame by a preset multiple to obtain the target position information, including the following steps:
[0045] Based on the position information of the face collection frame, determine the position information of the upper left corner of the face collection frame and the position information of the lower right corner of the face collection frame, wherein the position information of the upper left corner is (face_box.x1, face_box.y1), and the position information of the lower right corner is (face_box.x2, face_box.y2);
[0046] Based on the position information of the upper left corner of the face collection frame and the position information of the lower right corner of the face collection frame, the face collection frame is enlarged by a preset multiple to obtain target position information, wherein the target position information includes: target position information of the upper left corner and target position information of the lower right corner, the target position information of the upper left corner is (face_box.x1-n*face_box.x1, face_box.y1-n*face_box.y1), and the target position information of the lower right corner is (face_box.x2+n*face_box.x2, face_box.y2+n*face_box.y2), and n is the preset multiple.
[0047] Preferably, the value of n is 1.25.
[0048] In the embodiment of the present invention, determining the biopsy result of the object to be detected based on the first probability value and the second probability value includes:
[0049] Step S21, calculating the product of a first probability value and a weight value corresponding to the first probability value to obtain a first product;
[0050] Step S22, calculating the product of the second probability value and the weight value corresponding to the second probability value to obtain a second product;
[0051] Step S23, if the sum of the first product and the second product is greater than a preset threshold, the object to be detected is a living body;
[0052] Step S24: if the sum of the first product and the second product is less than or equal to a preset threshold, the object to be detected is a non-living body.
[0053] In an embodiment of the present invention, the target RGB image is input into the first attention model to obtain a first probability value cls1, and the D depth map of the mouth area is input into the second attention model to obtain a second probability value cls2.
[0054] Then, the sum of the first product and the second product is calculated using the weighted formula P(cls)=0.35*cls1+0.65*cls2, where 0.35 is the weight value corresponding to the first probability value and 0.65 is the weight value corresponding to the second probability value.
[0055] Finally, whether the object to be detected is alive is determined based on the following formula.
[0056]
[0057] In the embodiment of the present invention, not only simple 3D depth map information is used, but 3D depth map information of a specific area under the specific condition of opening the mouth. Since the depth map of a normal person with an open mouth has an obvious "concave" area, while there is no such "concave" area in the case of common face attacks, the depth information of the two is completely different. Therefore, using this obvious feature will effectively defend against common face attacks.
[0058] Since most of the current biopsy systems are basically based on RGB two-dimensional information, the black market also uses this information to optimize their attack methods in a targeted manner, resulting in a decrease in the biopsy defense capability. In the embodiment of the present invention, in addition to using RGB two-dimensional information, the 3D depth map information is also integrated for double defense to improve the biopsy defense capability.
[0059] Furthermore, the attention model in the embodiment of the present invention extracts detailed features, which can better extract subtle features of face attacks, thereby greatly improving the detection rate of electronic screens. In addition, the embodiment of the present invention uses a lightweight network, which greatly reduces the time consumption of the algorithm and facilitates deployment on mobile terminal devices. At the same time, the 3D depth map in the embodiment of the present invention can be collected during the original biopsy process without affecting the original biopsy process, thereby improving the user experience.
[0060] Embodiment 2:
[0061] An embodiment of the present invention also provides a facial biopsy device based on mouth opening action, which is used to execute the facial biopsy method based on mouth opening action provided in the above content of the embodiment of the present invention. The following is a detailed introduction to the device provided in the embodiment of the present invention.
[0062] like Figure 3 As shown, Figure 3 Schematic diagram of the above-mentioned facial biopsy device based on mouth opening action, which includes: an acquisition unit 10, a first determination unit 20, a second determination unit 30, a calculation unit 40 and a detection unit 50.
[0063] The acquisition unit 10 is used to acquire a facial image of the object to be detected when the mouth is open, wherein the facial image includes: a D depth map and an RGB image;
[0064] The first determining unit 20 is used to determine the position information of the face area and the position information of the mouth area in the RGB image;
[0065] The second determining unit 30 is used to enlarge the face acquisition frame by a preset multiple based on the position information of the face acquisition frame to obtain target position information, determine the area corresponding to the target position information in the RGB image as the target RGB image, and map the position information of the mouth area to the D depth map to determine the D depth map of the mouth area;
[0066] The calculation unit 40 is used to input the target RGB image into a first attention model to obtain a first probability value, and input the D depth map of the mouth area into a second attention model to obtain a second probability value, wherein the first attention model and the second attention model are both attention models constructed based on a se-block module and a resnet module;
[0067] The detection unit 50 is used to determine the biopsy result of the object to be detected based on the first probability value and the second probability value.
[0068] In an embodiment of the present invention, a facial image of an object to be detected when the mouth is open is obtained, wherein the facial image includes: a 3D depth map and an RGB image; position information of a face region and position information of a mouth region in the RGB image are determined; the position information of the face acquisition frame is used to enlarge the face acquisition frame by a preset multiple to obtain target position information, and the region corresponding to the target position information in the RGB image is determined as a target RGB image, and the position information of the mouth region is mapped to the 3D depth map to determine the 3D depth map of the mouth region; the target RGB image is input into a first attention model to obtain a first probability value, and the 3D depth map of the mouth region is input into a second attention model to obtain a second probability value, wherein both the first attention model and the second attention model are attention models constructed based on a se-block module and a resnet module; based on the first probability value and the second probability value, a biopsy result of the object to be detected is determined, thereby achieving the purpose of performing face biopsy by using the two-dimensional information of the RGB image and fusing the three-dimensional information of the 3D depth map, thereby solving the technical problem of low accuracy of the existing face biopsy method, thereby achieving the technical effect of improving the accuracy of face biopsy.
[0069] Preferably, the resnet module includes 8 submodules, namely 2 2 2 and 2 The se-block module is arranged between two residual layers in each sub-module.
[0070] Preferably, the first determination unit is used to: use mediapipe to determine the face area in the RGB image, and determine the position information of the face area using the position information of the face acquisition frame corresponding to the face area in the RGB image; use mediapipe to determine the mouth area in the RGB image, and determine the position information of the mouth area.
[0071] Preferably, the second determining unit is used to: determine the position information of the upper left corner of the face collection frame and the position information of the lower right corner of the face collection frame based on the position information of the face collection frame, wherein the position information of the upper left corner is (face_box.x1, face_box.y1), and the position information of the lower right corner is (face_box.x2, face_box.y2); based on the position information of the upper left corner of the face collection frame and the position information of the lower right corner of the face collection frame, enlarge the face collection frame by a preset multiple to obtain target position information, wherein the target position information includes: target position information of the upper left corner and target position information of the lower right corner, the target position information of the upper left corner is (face_box.x1-n*face_box.x1, face_box.y1-n*face_box.y1), and the target position information of the lower right corner is (face_box.x2+n*face_box.x2, face_box.y2+n*face_box.y2), and n is the preset multiple.
[0072] Preferably, the detection unit is used to: calculate the product of a first probability value and a weight value corresponding to the first probability value to obtain a first product; calculate the product of a second probability value and a weight value corresponding to the second probability value to obtain a second product; if the sum of the first product and the second product is greater than a preset threshold, the object to be detected is a living body; if the sum of the first product and the second product is less than or equal to the preset threshold, the object to be detected is a non-living body.
[0073] Embodiment three:
[0074] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the method described in the above embodiment 1, and the processor is configured to execute the program stored in the memory.
[0075] See also Figure 4 An embodiment of the present invention further provides an electronic device 100, comprising: a processor 60, a memory 61, a bus 62 and a communication interface 63, wherein the processor 60, the communication interface 63 and the memory 61 are connected via the bus 62; the processor 60 is used to execute an executable module stored in the memory 61, such as a computer program.
[0076] The memory 61 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0077] The bus 62 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0078] Among them, the memory 61 is used to store programs, and the processor 60 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 60 or implemented by the processor 60.
[0079] The processor 60 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 60. The above processor 60 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 61, and the processor 60 reads the information in the memory 61 and completes the steps of the above method in combination with its hardware.
[0080] Embodiment 4:
[0081] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the above-mentioned embodiment 1 are executed.
[0082] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0083] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0084] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0086] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0087] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A facial biopsy method based on mouth opening action, characterized in that: include: Acquire a facial image of the object to be detected when the mouth is open, wherein the facial image includes: a D depth map and an RGB image; Using mediapipe, determining a face region in the RGB image, and determining position information of a face acquisition frame corresponding to the face region in the RGB image as position information of the face region; Using mediapipe, determining a mouth area in the RGB image, and determining position information of the mouth area; Based on the position information of the face acquisition frame, the face acquisition frame is enlarged by a preset multiple to obtain target position information, and the area corresponding to the target position information in the RGB image is determined as the target RGB image, and the position information of the mouth area is mapped to the D depth map to determine the D depth map of the mouth area; Input the target RGB image into a first attention model to obtain a first probability value, and input the D depth map of the mouth area into a second attention model to obtain a second probability value, wherein the first attention model and the second attention model are both attention models constructed based on a se-block module and a resnet module; Based on the first probability value and the second probability value, a biopsy result of the object to be detected is determined.
2. The method according to claim 1, characterized in that The resnet module consists of 8 submodules, namely 2 2 2 and 2 The se-block module is arranged between two residual layers in each sub-module.
3. The method according to claim 1, characterized in that Enlarging the face collection frame by a preset multiple based on the position information of the face collection frame to obtain target position information includes: Based on the position information of the face collection frame, determine the position information of the upper left corner of the face collection frame and the position information of the lower right corner of the face collection frame, wherein the position information of the upper left corner is (face_box.x1, face_box.y1), and the position information of the lower right corner is (face_box.x2, face_box.y2); Based on the position information of the upper left corner of the face collection frame and the position information of the lower right corner of the face collection frame, the face collection frame is enlarged by a preset multiple to obtain target position information, wherein the target position information includes: target position information of the upper left corner and target position information of the lower right corner, the target position information of the upper left corner is (face_box.x1-n*face_box.x1, face_box.y1-n*face_box.y1), and the target position information of the lower right corner is (face_box.x2+n*face_box.x2, face_box.y2-n*face_box.y2), and n is the preset multiple.
4. The method according to claim 1, characterized in that: Determining a biopsy result of the object to be detected based on the first probability value and the second probability value includes: Calculating the product of a first probability value and a weight value corresponding to the first probability value to obtain a first product; Calculating the product of the second probability value and the weight value corresponding to the second probability value to obtain a second product; If the sum of the first product and the second product is greater than a preset threshold, the object to be detected is a living body; If the sum of the first product and the second product is less than or equal to a preset threshold, the object to be detected is a non-living body.
5. A facial biopsy device based on mouth opening action, characterized in that: include: an acquisition unit, a first determination unit, a second determination unit, a calculation unit and a detection unit, wherein: The acquisition unit is used to acquire a facial image of the object to be detected when the mouth is open, wherein the facial image includes: a D depth map and an RGB image; The first determining unit is used to determine the position information of the face area and the position information of the mouth area in the RGB image; The second determining unit is used to enlarge the face acquisition frame by a preset multiple based on the position information of the face acquisition frame to obtain target position information, determine the area corresponding to the target position information in the RGB image as the target RGB image, and map the position information of the mouth area to the D depth map to determine the D depth map of the mouth area; The calculation unit is used to input the target RGB image into a first attention model to obtain a first probability value, and input the D depth map of the mouth area into a second attention model to obtain a second probability value, wherein the first attention model and the second attention model are both attention models constructed based on a se-block module and a resnet module; The detection unit is used to determine the biopsy result of the object to be detected based on the first probability value and the second probability value; Wherein, the first determining unit is used to: Using mediapipe, determine the face area in the RGB image, and determine the position information of the face area using the position information of the face collection frame corresponding to the face area in the RGB image; Using mediapipe, a mouth area in the RGB image is determined, and position information of the mouth area is determined.
6. The device according to claim 5, characterized in that The resnet module consists of 8 submodules, namely 2 2 2 and 2 The se-block module is arranged between two residual layers in each sub-module.
7. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store a program for supporting the processor to execute the method according to any one of claims 1 to 4, and the processor is configured to execute the program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are executed.
