Live skin detection method, liveness detection method, system, device and storage medium
Through speckle structured light image tiling and DCT transformation, the existing live skin detection methods are solved, and more efficient live skin area recognition is achieved.
Patent Information
- Application Number
- CN202510639823.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-05-19
AI Technical Summary
The existing live skin detection methods are highly dependent on skin surface characteristics and are sensitive to the environment, resulting in low detection accuracy and high operational complexity.
The speckle structured light image blocking process is used, and the image energy information is converted from the spatial domain to the frequency domain by using discrete cosine transformation (DCT), and the living skin area is distinguished by calculating the low-frequency and high-frequency component ratios of the detection area.
It improves the accuracy and reliability of live skin detection, reduces the dependence on laser clarity, and simplifies the operation process.
Smart Images

Figure CN120164265B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of biometric identification technology, and in particular to a living skin detection method, a living body detection method, a system, a device and a storage medium. Background Art
[0002] With the increasing popularity of electronic devices, biometrics are gaining widespread application across various technological fields, including identity authentication, security monitoring, and financial payments. Liveness detection is primarily used to distinguish between real and non-live organisms. As a crucial step in biometrics, liveness detection requires both accuracy and security.
[0003] Prior art has proposed methods based on physical properties for live skin detection. These methods primarily use a 3D camera to capture a face, obtain 3D data of the skin area, and then determine whether the image is stereoscopic based on this 3D data. This method can effectively identify non-live skin in flat photos, screen replays, and other non-live objects. However, this method not only relies heavily on skin surface features, but also faces the challenge of balancing measurement accuracy and resolution, and is sensitive to environmental conditions, resulting in low detection accuracy.
[0004] Therefore, the prior art needs to be further improved. Summary of the Invention
[0005] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a live skin detection method, liveness detection method, system, device and storage medium to improve the accuracy and reliability of live skin detection and liveness detection.
[0006] In a first aspect, the present application discloses a living skin detection method, which includes:
[0007] Acquiring a speckle structured light image containing the skin of the object to be detected;
[0008] Dividing the speckle structured light image into a plurality of continuous detection areas;
[0009] Calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively;
[0010] The living skin area of the object to be detected is determined according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area.
[0011] Optionally, the step of dividing the speckle structured light image into a plurality of continuous detection areas includes:
[0012] A rectangular frame of a preset size is used as a sliding window basic block, and the sliding window basic block is slid according to the preset sliding size to slide the speckle structured light image into a plurality of continuous detection areas.
[0013] Optionally, the step of respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes:
[0014] Convert each detection area into a grayscale image;
[0015] Calculate the discrete cosine transform coefficients corresponding to each grayscale image respectively;
[0016] Calculate the signal energy value of the discrete cosine transform coefficient corresponding to each detection area respectively;
[0017] Sorting the discrete cosine transform coefficients according to the signal energy values corresponding to each detection area, and normalizing the sorted signal energy values;
[0018] After energy normalization, the frequency components whose energy proportion in each detection area is greater than the preset energy threshold are regarded as low-frequency components, and the frequency components whose energy proportion is less than or equal to the preset energy threshold are regarded as high-frequency components.
[0019] Optionally, the frequency component includes a low-frequency component and a high-frequency component;
[0020] The step of determining the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes:
[0021] Calculate the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in each detection area respectively;
[0022] The living skin area of the object to be detected is determined according to the energy value of the low-frequency component corresponding to each detection area and the calculated energy ratio corresponding to each detection area.
[0023] Optionally, the step of determining the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes:
[0024] The detection area where the energy proportion corresponding to the low-frequency component is greater than the preset energy threshold is determined as the living skin area.
[0025] Optionally, after the step of determining the detection area where the energy proportion corresponding to the low-frequency component is greater than a preset energy threshold as a living skin area, the method further includes:
[0026] Within the range of each screened living skin area, the difference between each living skin area and the detection area in the adjacent row or column is calculated to obtain the overlap of the coverage area between the living skin area and the adjacent detection area;
[0027] Adjacent detection areas whose coverage area overlaps with each other more than a preset overlap threshold are determined as living skin areas, thereby obtaining an updated living skin area of the object to be detected.
[0028] In a second aspect, the present application provides a liveness detection method implemented using the live skin detection method, which includes:
[0029] Determining whether the speckle structured light image of the skin of the object to be detected contains a living skin area;
[0030] If the living skin area is contained, the object to be detected is determined to be a living body; otherwise, the object to be detected is determined to be a non-living body.
[0031] In a third aspect, the present application further discloses a living skin detection system, which includes:
[0032] An image acquisition module, configured to acquire a speckle structured light image containing the skin of an object to be detected;
[0033] a detection area division module, configured to divide the speckle structured light image into a plurality of continuous detection areas;
[0034] Energy calculation module, used to calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area;
[0035] The detection result output module determines the living skin area of the object to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area.
[0036] In a fourth aspect, the present application also discloses a live skin detection device, which includes: a processor and a storage medium communicatively connected to the processor, wherein the storage medium is suitable for storing multiple instructions; the processor is suitable for calling the instructions in the storage medium to execute the steps of implementing any of the above-mentioned live skin detection methods.
[0037] In a fifth aspect, the present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the live skin detection method is implemented, or the live detection method is implemented.
[0038] Beneficial effects:
[0039] The present invention provides a live skin detection method, live detection method, system, device, and storage medium, which acquire a speckle structured light image containing the skin of an object to be detected; divide the speckle structured light image as a whole into multiple continuous detection areas; calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area; and determine the live skin area of the object to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area. Based on the differences in the frequency domain sharpness characteristics of laser spots on skin and non-skin surfaces, the method of the present invention proposes a method for effectively distinguishing live skin from non-live skin using the frequency components corresponding to the discrete cosine transform coefficients. Because the method converts image energy information from the spatial domain to the frequency domain, it extracts more discriminative frequency features, thereby improving the accuracy and reliability of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flowchart of the steps of the living skin detection method provided by the present invention;
[0041] Figure 2 is a speckle structured light image of the skin of the object to be detected provided in the method of the embodiment of the present invention;
[0042] Figure 3 is a schematic diagram of continuously sliding a window on a speckle structure image in a method according to an embodiment of the present invention;
[0043] Figure 4 is a schematic diagram of a sliding window basic block in a method according to an embodiment of the present invention;
[0044] Figure 5 Schematic diagram of discrete cosine transform coefficients within a detection area in a method according to an embodiment of the present invention;
[0045] Figure 6 is a distribution diagram of the normalized average values of the energy values corresponding to the high-frequency components and low-frequency components of the living skin area and the non-living skin area in the embodiment of the present invention;
[0046] Figure 7 It is a distribution diagram of the normalized average values of the energy values corresponding to the high-frequency components and low-frequency components of the entire image in the method provided by the present invention;
[0047] Figure 8 It is a visual schematic diagram of the detection area screened in the method provided by the present invention;
[0048] Figure 9 It is a visual schematic diagram of the detection area overlap in the method provided by the present invention;
[0049] Figure 10 is a color schematic diagram of the location of the living skin area detected in the method provided by the present invention;
[0050] Figure 11 is a schematic diagram of a frame showing the location of the living skin area detected by the method provided by the present invention;
[0051] Figure 12 This is a principle structural block diagram of the living skin detection system provided by the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to illustrate the present invention and are not intended to limit the present invention.
[0053] The main purpose of live skin detection technology is to distinguish real human skin features from forged prosthetic skin features to prevent illegal intrusion and fraud.
[0054] The existing live skin detection solutions are mainly divided into the following categories:
[0055] 1) Live skin detection based on texture features in static images. These include Local Binary Pattern (LBP), Local Phase Quantization (LPQ), Histogram of Oriented Gradient (HOG), Scale Invariant Feature Transform (SIFT), Speeded-Up Robust Features (SURF), Image Distortion Analysis (IDA), and deep learning features. Although these texture-based methods are effective, they are susceptible to interference from high-definition photos and videos.
[0056] 2) Live skin detection based on facial motion feature extraction, such as blinking and mouth movement. While these methods are effective, they lack the ability to be completely passive, requiring the subject to actively engage in specific movements. This makes them unsuitable for use in sleep or unconscious situations.
[0057] 3) Live skin detection uses 3D sensing technologies to measure the three-dimensional structure of the face, such as structured light projection and time of flight (TOF). This depth-based detection method effectively protects against 2D attacks such as flat photos, videos, and screens, but is susceptible to interference from 3D skin masks and mannequins.
[0058] 4) Live skin detection based on physiological signals. Remote photoplethysmography (rPPG), for example, uses reflected ambient light to measure subtle changes in skin brightness caused by blood flow due to the heartbeat. However, since pulse-based methods require at least 2-3 seconds to measure two or three consecutive heartbeats, they cannot achieve rapid liveness detection. Furthermore, they are susceptible to interference in high-definition video.
[0059] In addition to the above methods, recent studies have found that due to the interaction between laser photons and tissues within the multi-layered skin structure, the frequency domain sharpness characteristics of laser spots on skin and non-skin surfaces show obvious differences (sharpness is an important indicator of image quality, reflecting the amount and clarity of details in the image. Sharpness is determined by the boundaries between areas of different brightness or color; the clearer the boundary, the higher the sharpness). Based on this finding, the Energy of Gradient (EOG) function can be used to effectively distinguish between living skin and non-living skin.
[0060] However, actual research has found that the aforementioned energy gradient method requires high speckle clarity. When speckle clarity falls short of expectations, the distinction between living and non-living skin is weakened, resulting in low recognition accuracy using the energy gradient method. This high reliance on high laser clarity not only increases operational complexity but also limits the method's practical application.
[0061] To overcome the above-mentioned problems, the present application provides a live skin detection method, live detection method, system, and storage medium, which acquire a speckle structured light image containing the skin of the object to be detected; divide the speckle structured light image as a whole into multiple continuous detection areas; calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area; and determine the live skin area of the object to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area. The method and system provided in the present application innovatively introduce the Discrete Cosine Transform (DCT) into structured light live skin detection to achieve the conversion of image energy information from the spatial domain to the frequency domain through signal transformation using the DCT, thereby extracting more discriminative frequency features. In addition, due to the energy concentration characteristic of the DCT transform, the main information in the data can be concentrated on the low-frequency coefficients, thereby reducing the data dimension and improving computational efficiency.
[0062] The following is a more detailed description of the live skin detection method, live skin detection method, live skin detection system, device and storage medium disclosed in this application in conjunction with the accompanying drawings.
[0063] First, the method for detecting living skin based on EOG not only relies on the high definition of laser speckle, but also increases the complexity of the operation. Therefore, this embodiment provides a method for detecting living skin, such as Figure 1 As shown, the living skin detection method includes:
[0064] Step S1: Acquire a speckle structured light image containing the skin of an object to be detected.
[0065] Speckle structured light is formed by the speckle effect when structured light is irradiated onto a rough surface. The speckle pattern corresponding to these speckle structured lights is random in both spatial and intensity distribution.
[0066] There are multiple ways to obtain a speckle structured light image of the subject's skin in this step. For example, a saved speckle structured light image can be directly obtained from another smart device, or a speckle structured light camera can be connected to the device. After the speckle structured light camera captures the speckle structured light image, the speckle structured light image of the subject's skin can be obtained from the camera.
[0067] In one embodiment, a speckle structured light depth camera is used as the acquisition camera. The depth camera captures the skin area of the subject to be inspected to obtain a speckle structured light image containing the corresponding skin to be inspected. Furthermore, in this step, structured light (e.g., laser) is used as the light source to project a speckle pattern onto the skin surface of the subject to be inspected, and the speckle structured light image reflected from the skin surface of the subject to be inspected is collected.
[0068] Step S2: Divide the entire speckle structured light image into a plurality of continuous detection areas.
[0069] Since the acquired speckle structured light image may contain both living and non-living skin areas, including clothing, surroundings, or mannequin areas, converting the speckle structured light image from color to grayscale and processing individual spots in the grayscale image will make it impossible to distinguish between living and non-living skin areas.
[0070] To better capture the gradient changes between speckles in the grayscale image, this step, after acquiring the speckle structured light image, divides the entire speckle structured light image into multiple continuous detection areas. This block-based approach allows each detection area to simultaneously contain multiple speckles while also reflecting the gradient changes between them. This captures the differences between the detection areas, allowing for the identification of living and non-living skin areas within the multiple detection areas, as well as the identification of dummy areas, clothing areas, or surrounding areas within the non-living skin area.
[0071] In specific implementation, there are two different ways to divide the entire speckle structured light image into regions: the first is a continuous sliding window method, and the second is a fixed block method.
[0072] The continuous sliding window method mainly includes: using a rectangular frame of a preset size as a sliding window basic block, sliding the sliding window basic block according to the preset sliding size, and slidingly dividing the speckle structured light image into multiple continuous detection areas.
[0073] To achieve better detection area demarcation, a rectangular frame of a preset size can be selected as a sliding window basic block during implementation. This sliding window basic block can then be slid across the speckle structured light image at the preset size to demarcate multiple detection areas. The preset size can be customized, and the size of the sliding window basic block can be adjusted based on the proportion of the detected object's outline in the speckle structured light image. For example, when the detected object's outline occupies a relatively small proportion, in order to more accurately identify the living skin area, the sliding window basic block can be a rectangle that is several times smaller than the detected object's outline (e.g., 1 / 4 or 1 / 6 of the size), thereby achieving more accurate detection results.
[0074] To obtain more image information while reducing data processing and improving information processing efficiency, in one implementation, based on the diameter of each scattered speckle being approximately 5 pixels, this method shifts the window basic block within a row rightward by 5 pixels at a time, and the window basic block within a column downward by 5 pixels at a time during continuous window sliding. This allows each scattered speckle in the image to be identified as a spot corresponding to living skin, thereby increasing the accuracy and reliability of the detection method.
[0075] The fixed block method for dividing the detection area is as follows: dividing the speckle structured light image into a plurality of detection areas of fixed size and non-overlapping areas according to a preset size.
[0076] The fixed segmentation method divides the speckle structured light image into fixed-size segments, so that the divided detection areas do not overlap. In practice, the size of the segments can also be determined based on the size of the entire image area occupied by the contour of the object to be detected, thereby achieving the segmentation of the speckle structured light image.
[0077] To determine a suitable preset size, in this step, the speckle structured light image can first be used to identify the contour of the target object, identify the contour of the area where the object is located, and then determine a suitable size based on the identified object contour. The preset size can also be a fixed size value.
[0078] Although both the continuous sliding window method and the fixed block method can achieve the division of the detection area, and the detection and identification of each detection area can distinguish between the living skin area and the non-living skin area, the continuous sliding window method has higher flexibility and can adapt to the identification of detection targets in more scenarios. Moreover, since the detection areas of the continuous sliding window method overlap, it can more accurately capture the local features of the data, thereby enhancing the reliability of the detection method.
[0079] Step S3: Calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively.
[0080] After the speckle structured light image is divided into multiple detection areas, the discrete cosine transform coefficients corresponding to each detection area are calculated. Based on the discrete cosine transform coefficients, the frequency components within each detection area are obtained. The frequency components include low-frequency components and high-frequency components.
[0081] Specifically, the steps of respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection area include:
[0082] Each detection area is converted into a grayscale image; the discrete cosine transform coefficients corresponding to each grayscale image are calculated; and the signal energy value of the discrete cosine transform coefficients corresponding to each detection area is calculated. The discrete cosine transform coefficients are sorted according to the signal energy values corresponding to each detection area, and the sorted signal energy values are normalized. After energy normalization, frequency components within each detection area with energy ratios greater than a preset energy threshold are considered low-frequency components, and frequency components less than or equal to the preset energy threshold are considered high-frequency components.
[0083] Specifically, to obtain the frequency components of each detection area, a sliding window basic block is first used to sequentially shift the same row according to a preset size to locate each detection area. Each located detection area is then used in turn as the processing area. Processing each detection area involves converting the color image within the detection area into a grayscale image, then calculating the DCT coefficients of the detection area using the dct2() function. Next, the corresponding energy values are calculated based on the DCT coefficients. In one implementation, the energy values corresponding to the DCT coefficients are calculated by squared DCT coefficients. Finally, the discrete cosine transform coefficients are sorted according to the calculated energy values, and the sorted signal energy values are normalized. After normalization, frequency components with energy percentages greater than a preset energy threshold are considered low-frequency components, while frequency components with energy percentages less than or equal to the preset energy threshold are considered high-frequency components.
[0084] In this step, the energy values calculated from the DCT coefficients of each detection area are first collected to form a set of energy values. Linear normalization or Z-Score normalization is selected as the normalization method. Each energy value in the energy value set is scaled to within a target range to obtain the normalized energy value corresponding to each detection area. During the energy value normalization process, normalization parameters are calculated based on the scaled target range. Normalization parameters typically refer to the scaling factor, offset, or standardization parameters (such as mean and standard deviation) used in the normalization process.
[0085] The normalized energy value is divided according to a preset energy threshold. When the energy ratio is greater than the preset energy threshold, it is divided into a low-frequency component. When the energy ratio is less than the preset energy threshold, it is divided into a high-frequency component. In a specific implementation, the preset energy threshold can be 95%, and the range of the preset energy threshold can be: 88% to 97%.
[0086] Step S4: Determine the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area.
[0087] After calculating the frequency components corresponding to the discrete cosine transform coefficients corresponding to each detection area, it is possible to determine whether each detection area corresponds to a living skin area based on the division of low-frequency components and high-frequency components, thereby determining the detection result of the living skin of the object to be detected.
[0088] Specifically, in this step, determining the live skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of the detection area can be achieved in two different ways. One method is to screen the live skin area based on the low-frequency components and energy ratio. The other method is to screen the live skin area based solely on the low-frequency components. This method can further optimize the live skin area screened based solely on the low-frequency components by calculating the area overlap, thereby improving the accuracy of live skin area detection.
[0089] Specifically, the steps of screening out the living skin area based on the low-frequency component and the energy ratio include:
[0090] Step S41 : Calculate the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in each detection area.
[0091] Since each detection area corresponds to an image located by the sliding window, frequency domain analysis is performed on the image to obtain the energy values corresponding to the low-frequency components and the high-frequency components within the image. Each image receives a corresponding set of energy values for the low-frequency components and the high-frequency components. Therefore, different detection areas each have a corresponding set of energy values for the low-frequency components and the high-frequency components. The energy value for each detection area is divided by the energy value for the high-frequency components to obtain the energy ratio for each detection area.
[0092] Step S42: Determine the living skin area of the subject to be detected based on the energy value of the low-frequency component corresponding to each detection area and / or the calculated energy ratio corresponding to each detection area.
[0093] According to the energy value of the low-frequency component corresponding to each detection area and the energy ratio calculated in the above steps, the detection area belonging to the living skin area is screened out.
[0094] Since the energy ratio corresponding to the living skin area is significantly different from the energy ratio of the non-living area (eg, the dummy model area, the environment area, and the clothing area), the living skin area and the non-living skin area can be distinguished.
[0095] Specifically, when only the energy ratio is used to divide the living skin area and the non-living skin area, the detection area with an energy ratio greater than the preset energy threshold is determined as the living skin area, and the detection area with a ratio less than the preset energy threshold is determined as the non-living skin area.
[0096] The method for determining the preset energy threshold includes: determining the standard ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component of the living sample skin area and the non-living sample skin area respectively; and determining the preset energy threshold according to the standard ratio corresponding to the living sample skin area and the non-living sample skin area.
[0097] In order to determine the preset energy threshold, in one implementation method, a standard ratio between the energy values corresponding to the low-frequency components and the energy values corresponding to the high-frequency components of the living sample skin area and the non-living sample area can be used to infer an optimal range of the preset energy threshold. Then, based on the current environmental state of the object to be detected, a suitable preset energy threshold is selected for identifying the living skin area and the non-living skin area in the acquired speckle structured light image.
[0098] The determination of the detection result of living skin based on the energy ratio in this step is based on the fact that the energy ratio corresponding to the living skin area is significantly different from the energy ratio corresponding to the non-living skin area. The energy ratio corresponding to the living skin area is significantly greater than that of the non-living skin area.
[0099] In a specific implementation, the preset energy threshold can be set in the range of 88% to 97%. Taking the preset energy threshold of 95% as an example, after normalizing the energy value, the portion with an energy ratio greater than 95% is selected as the low-frequency signal, and the rest is selected as the high-frequency signal.
[0100] Since the low-frequency component energy accounts for the largest proportion in the living skin area and the high-frequency component energy accounts for the smallest proportion, by calculating the energy ratio corresponding to the low-frequency component and the energy ratio corresponding to the high-frequency component, the difference between the low-frequency signal and the high-frequency signal can be further amplified, thereby effectively distinguishing the living skin area and the non-living skin area in the image.
[0101] In order to verify the difference in energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in the speckle structured light image of the living skin area and the non-living skin area, the following is combined with Figures 2 to 6 Describe it in detail.
[0102] In the first step, unlike the mode of using Realsense speckle structured light depth camera with ids camera, this step first uses Realsense speckle structured light depth camera as light source and acquisition camera. Figure 2 As shown, the depth camera captures a single image of the target verification object, which includes both the skin and dummy areas. The resulting speckle structured light image simultaneously captures the living skin, dummy, clothing, and surrounding areas. Because only the structured light depth camera was used to capture the image, the speckle clarity in the resulting speckle structured light image is lower than that of images captured using a Realsense speckle structured light depth camera in conjunction with an IDS camera.
[0103] The second step is to ensure that the processing of each region (living skin region and non-living skin region) is based on a uniform rectangle size in order to improve the consistency and accuracy of the information in subsequent processing. The rectangle size is determined as follows:
[0104] 1) Manually or using image processing software, select the live skin area and the dummy model area in the speckle structured light image. During the selection process, try to avoid selecting spots that are not part of the target area, while ensuring that the rectangular frame covers the target area as much as possible. Since the clothing area and the surrounding area are relatively large in the captured image and are not the main factor limiting the size of the rectangle, the selection should focus on the live skin area and the dummy model area.
[0105] 2) Compare the width and length of the live skin area and the dummy model area, selecting the smaller width and length as the final rectangle. This ensures that the final rectangle does not extend beyond the boundaries of the target area, thus avoiding selecting spots that do not belong to the area. After determining the final rectangle size, the rectangle is applied to the live skin area, dummy model area, clothing area, and environment area. During this application process, the rectangle coordinates of each area are recorded to facilitate subsequent discrete cosine transform (DCT) of each area.
[0106] The third step is to perform continuous sliding window on each framed area. Due to clarity limitations, after converting the image from a color image to a grayscale image, if a single spot is processed according to the original method, it is impossible to distinguish between the living area and the non-living skin area. Therefore, this step is approached from the perspective of blocking. The advantage of blocking is that it includes multiple scattered spots at the same time and can capture the gradient changes between spots, thereby amplifying the differences. In the block processing, a fixed block method and a continuous sliding window method can be used. Although the two have similar effects and can both distinguish the living area from the non-living skin area well, the continuous sliding window method has higher flexibility. It can better adapt to the needs of different subjects, and can capture the local features of the data more carefully, thereby enhancing the reliability of the method.
[0107] Combine Figure 3 As shown in the figure, four regions (living skin region, dummy model region, clothing region, and ambient light region) are manually drawn with rectangles of equal length and width, and a rectangle 1 / 4 of the size of the rectangle is selected as the basic block of the sliding window. Figure 4 As shown, each area contains multiple spots. Since the diameter of each spot is about 5 pixels, the sliding window in the same row is shifted to the right by 5 pixels each time, and the sliding window in the same column is shifted downward by 5 pixels each time.
[0108] The fourth step is to calculate the detection area located by each continuous sliding window. The area located by each sliding window is taken as the detection area in turn, that is, the processing area. First, the area corresponding to the sliding window is converted into a grayscale image, and then the DCT coefficient of the area is calculated using the dct2() function. The DCT coefficient corresponding to the detection area is as follows Figure 5 shown.
[0109] The fifth step is to calculate the energy of each DCT coefficient, and then sort the DCT coefficients from small to large according to the energy value using the sort function. After sorting, the energy values in each detection area are normalized, and the threshold corresponding to the top 95% energy is found after normalization. The part with energy greater than the threshold is selected as the low-frequency signal, and the rest is selected as the high-frequency signal, and the signal distribution map corresponding to each selected area is obtained. Figure 6 As shown in the figure, blue represents low-frequency components, red represents high-frequency components, and from left to right they are the living skin area, the dummy model area, the clothing area, and the ambient light area. Figure 6 As shown in the figure, the energy ratio between the low-frequency component energy value and the high-frequency component energy value corresponding to the living skin area is greater than the energy ratio corresponding to the non-living skin area. Therefore, based on the energy ratio between the low-frequency component energy value and the high-frequency component energy value corresponding to different areas in the image, the living skin area and the non-living skin area can be identified. It can be imagined that the non-living skin area includes one or more of: clothing area, environment area, and mannequin area.
[0110] In addition, the living skin area in the scattered structured light image can be directly screened out based only on the energy value corresponding to the low-frequency component.
[0111] In detail, the step of determining the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes:
[0112] The detection area where the energy proportion corresponding to the low-frequency component is greater than the preset energy threshold is determined as the living skin area.
[0113] After determining the energy values of the low-frequency components and the high-frequency components in each detection area, the normalized mean value graph corresponding to the energy values of the low-frequency components and the high-frequency components in the entire speckle structured light image can be obtained. Figure 7 As shown in the figure, the protruding area with the maximum value contains the living skin area. Since the energy proportion of the low-frequency component corresponding to living skin is always above 0.945, and the corresponding interval length of the low-frequency component energy value is between 0.005 and 0.007, a threshold of the maximum low-frequency component minus 0.007 can be set to filter out the living skin area. In other words, the detection area is determined to be the living skin area if the low-frequency component energy value is greater than the maximum low-frequency energy value minus 0.007.
[0114] In specific implementation, if the energy value of the low-frequency component fluctuates violently due to the influence of ambient light or other interference, the maximum value of this low-frequency component will be slightly reduced by 0.002-0.004 to ensure the effective effect of the threshold. Then, this threshold is applied to screen the detection area containing living skin, such as Figure 8As shown in the figure, it can be seen that after the energy threshold of the low-frequency component is filtered, the living skin area of the entire image is filtered out ( Figure 8 middle green area).
[0115] Furthermore, in order to more accurately screen out living skin areas, after the step of determining the detection area where the energy proportion corresponding to the low-frequency component is greater than the preset energy threshold as the living skin area, the method further includes:
[0116] Within the range of each screened living skin area, the difference between each living skin area and the detection area in the adjacent row or column is calculated to obtain the overlap of the coverage area between the living skin area and the adjacent detection area; the adjacent detection area whose coverage area overlap is greater than a preset overlap threshold is determined as the living skin area, thereby obtaining the updated living skin area of the object to be detected.
[0117] like Figure 8 As shown in the figure, it can be seen that after the threshold value set by the energy value corresponding to the low-frequency component is filtered, most of the living skin areas in the image are detected, but the accuracy cannot meet the requirements. Therefore, after the living skin areas are initially screened out, the screened living skin areas are used as target areas, and the overlap between the target area and the adjacent detection area is calculated. The higher the overlap, the closer it should be to the living skin area. The visualization result of the overlap is as expected. Figure 9 As shown, the overlap first increases monotonically and then decreases monotonically. This property allows us to calculate the difference between each row and the previous row, and each column, corresponding to the detection area, to obtain row / column boundaries that conform to this rule. The overlap of any area outside of these boundaries is set to 0. Based on the general rule for facial width, assuming that half the face is no wider than 10cm, the overlap of any area with a maximum value as the center is set to 0. Finally, a threshold is set to (maximum overlap / 6). Pixels with overlaps no less than this threshold are retained as the final living area and visualized, as shown in the following example: Figure 10 and Figure 11 As shown, Figure 10 It displays the located living skin area by color. Figure 11 The located living skin area is displayed through a positioning frame.
[0118] This embodiment of the method first acquires a speckle structured light image of the subject's skin. This image is then divided into multiple detection regions using a continuous sliding window. Each detection region is converted into a grayscale image, and the DCT coefficients are calculated for each converted grayscale image. Based on the calculated DCT coefficients, the corresponding frequency components are calculated, and the presence of living skin regions is determined based on these frequency components.
[0119] The method disclosed in this embodiment uses the frequency components derived from DCT coefficients for comparison, demonstrating that the frequency domain characteristics of speckles in living and non-living skin areas differ significantly, making this method suitable for live skin detection. The method provided in this embodiment also significantly reduces the high standards for high-definition speckle resolution and requires processing time that is only half or more of that of EOG methods, effectively enhancing the reliability and usability of speckle structured light live skin detection.
[0120] Based on the above-mentioned live skin detection method, this application also provides a liveness detection method, including:
[0121] Step H1: Determine whether the speckle structured light image of the skin of the object to be detected contains a living skin area.
[0122] Step H2: If the living skin area is present, the object to be detected is determined to be living; otherwise, the object to be detected is determined to be non-living.
[0123] The liveness detection method provided in this embodiment is implemented based on the live skin detection method. First, the live skin detection method disclosed in the above embodiment is used to determine whether the acquired speckle structured light image contains live skin. If live skin is detected, it indicates that the object to be detected is live. If no live skin is detected, the object to be detected is non-live, such as a dummy model.
[0124] Since the liveness detection method provided in this embodiment is implemented based on the above-disclosed live skin detection method, and since the above-disclosed live skin detection method not only significantly reduces the requirement for high-definition spots but also greatly speeds up the processing speed, the liveness detection method disclosed in this embodiment can also achieve the above-mentioned detection effect.
[0125] This application provides a living skin detection system, such as Figure 12 As shown, the living skin detection system specifically includes:
[0126] The image acquisition module 1201 is used to acquire a speckle structured light image containing the skin of the object to be detected; its function is as shown in step S1.
[0127] The detection area division module 1202 is used to divide the speckle structured light image into a plurality of continuous detection areas; its function is as shown in step S2.
[0128] The energy calculation module 1203 is used to calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively; its function is shown in step S3.
[0129] The detection result output module 1204 determines the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area. Its function is shown in step S4.
[0130] Based on the disclosure of the above-mentioned live skin detection method, the present application also discloses a live skin detection device, which includes: a processor and a storage medium communicatively connected to the processor, the storage medium being suitable for storing multiple instructions; the processor being suitable for calling the instructions in the storage medium to execute the steps of implementing any of the above-mentioned live skin detection methods.
[0131] In addition to disclosing the above-mentioned live skin detection method, the present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the live skin detection method or the liveness detection method is implemented.
[0132] It is conceivable that, in order to achieve more accurate live skin detection, the live skin detection method disclosed in this embodiment can be combined with the method of identifying live skin using depth information to achieve even more accurate live skin detection. That is, the depth information detection method can be used to first determine whether the photo is live, and then the live skin detection provided by the present invention can be used to determine whether the photo is live.
[0133] The present invention provides a live skin detection method, live detection method, system, device, and storage medium, which acquire a speckle structured light image containing the skin of an object to be detected; divide the speckle structured light image as a whole into multiple continuous detection areas; calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area; and determine the live skin area of the object to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area. The method of the present invention is based on the difference in frequency domain sharpness characteristics of laser spots on skin and non-skin surfaces, and proposes a method for effectively distinguishing live skin from non-live skin using the frequency components corresponding to the discrete cosine transform coefficients. Because the method converts image energy information from the spatial domain to the frequency domain, it extracts more discriminative frequency features, thereby improving the accuracy and reliability of detection. In addition, the DCT transform has the characteristic of energy concentration, which can concentrate the main information in the data on low-frequency coefficients, reducing the data dimension and improving the computational efficiency.
[0134] Other embodiments of the present invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the invention being indicated by the following claims.
[0135] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0136] It is understandable that the above embodiments are exemplary and should not be construed as limiting the present application. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A living skin detection method, characterized in that: include: Acquiring a speckle structured light image containing the skin of the object to be detected; Dividing the speckle structured light image into a plurality of continuous detection areas; Calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively; Determine the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area; The step of respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: Convert each detection area into a grayscale image; Calculate the discrete cosine transform coefficients corresponding to each grayscale image respectively; Calculating the signal energy value of the discrete cosine transform coefficient corresponding to each detection area respectively; wherein the signal energy value corresponding to the discrete cosine transform coefficient is obtained by calculating the square of the discrete cosine transform coefficient; Sorting the discrete cosine transform coefficients according to the signal energy values corresponding to each detection area, and normalizing the sorted signal energy values; After energy normalization, the frequency components whose energy ratio in each detection area is greater than the preset energy threshold are regarded as low-frequency components, and the frequency components whose energy ratio is less than or equal to the preset energy threshold are regarded as high-frequency components; Frequency components include low-frequency components and high-frequency components; The step of determining the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: Calculate the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in each detection area respectively; Determine the living skin area of the subject to be detected based on the energy value of the low-frequency component corresponding to each detection area and the calculated energy ratio corresponding to each detection area; Alternatively, the living skin area of the subject to be detected is determined only based on the calculated energy ratios corresponding to the various detection areas.
2. The living skin detection method according to claim 1, characterized in that: The step of dividing the speckle structured light image into a plurality of continuous detection areas includes: A rectangular frame of a preset size is used as a sliding window basic block, and the sliding window basic block is slid according to the preset sliding size to slide the speckle structured light image into a plurality of continuous detection areas.
3. The living skin detection method according to claim 1, wherein: Also includes: Within the range of each screened living skin area, the difference between each living skin area and the detection area in the adjacent row or column is calculated to obtain the overlap of the coverage area between the living skin area and the adjacent detection area; Adjacent detection areas whose coverage area overlaps with each other more than a preset overlap threshold are determined as living skin areas, thereby obtaining an updated living skin area of the object to be detected.
4. A liveness detection method implemented using the live skin detection method according to any one of claims 1 to 3, characterized in that: include: Determining whether the speckle structured light image of the skin of the object to be detected contains a living skin area; If the living skin area is contained, the object to be detected is determined to be a living body; otherwise, the object to be detected is determined to be a non-living body.
5. A living skin detection system, characterized in that: include: An image acquisition module, configured to acquire a speckle structured light image containing the skin of an object to be detected; a detection area division module, configured to divide the speckle structured light image into a plurality of continuous detection areas; Energy calculation module, used to calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area; The detection result output module determines the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area; An energy calculation module is used to convert each detection area into a grayscale image; calculate the discrete cosine transform coefficient corresponding to each grayscale image; calculate the signal energy value of the discrete cosine transform coefficient corresponding to each detection area; wherein the signal energy value corresponding to the discrete cosine transform coefficient is obtained by calculating the square of the discrete cosine transform coefficient; the discrete cosine transform coefficients are sorted according to the signal energy value corresponding to each detection area, and the sorted signal energy values are normalized; after energy normalization, the frequency components in each detection area whose energy ratio is greater than a preset energy threshold are regarded as low-frequency components, and the frequency components less than or equal to the preset energy threshold are regarded as high-frequency components; Frequency components include low-frequency components and high-frequency components; The step of determining the living skin area of the subject to be detected based on the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: Calculate the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in each detection area respectively; Determine the living skin area of the subject to be detected based on the energy value of the low-frequency component corresponding to each detection area and the calculated energy ratio corresponding to each detection area; Alternatively, the living skin area of the subject to be detected is determined only based on the calculated energy ratios corresponding to the various detection areas.
6. A living skin detection device, characterized in that: include: It includes a processor and a storage medium in communication with the processor, wherein the storage medium is suitable for storing multiple instructions; the processor is suitable for calling the instructions in the storage medium to execute the steps of the live skin detection method according to any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, it implements the live skin detection method according to any one of claims 1 to 3, or implements the liveness detection method according to claim 4.
Citation Information
Patent Citations
Living body detection method and system, electronic equipment and computer readable storage medium
CN119169705A