Pet identity verification method and related products based on liveness detection
By obtaining the pet's shooting time and geographic location information and combining it with liveness detection technology based on light intensity and light direction, the problem of influence of duplicate photos and toy pets in pet identification is solved, achieving efficient and accurate pet liveness detection and identity authentication.
Patent Information
- Application Number
- CN202210511360.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-05-11
AI Technical Summary
Existing pet identification technology is easily affected by re-photographed images or toy pets, resulting in inaccurate recognition and the pet's inability to cooperate in completing liveness detection actions.
By obtaining the shooting time and geographic location information of the pet to be identified, combined with the light intensity and light direction, frequency domain transformation and light decomposition technology are used for liveness detection, and the pet's nose print is identified for identity verification.
It improves the convenience and accuracy of pet liveness detection, can accurately identify live pets, prevent cheating, and ensure the accuracy of identity verification.
Smart Images

Figure CN114973315B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a pet identity verification method based on liveness detection and related products. Background Art
[0002] With economic development, more and more people are raising pets, and the pet-related service industry is also developing rapidly. To provide pets with better customized services, and given the uniqueness of pet nose prints that persists with age, a method for pet identification based on their nose prints has been developed. Existing pet identification technologies can be affected by re-photographed images or toy pets, resulting in inaccurate recognition. Furthermore, pets cannot respond to commands like humans, such as blinking, opening their mouths, and shaking their heads, to complete liveness detection.
[0003] Therefore, in the process of pet identification based on pet nose prints, how to quickly and accurately detect the liveness of pets is a technical problem that needs to be solved urgently. Summary of the Invention
[0004] The embodiments of the present application provide a pet identity verification method and related products based on liveness detection, which improves the efficiency and accuracy of pet liveness detection by performing liveness verification on the pet to be identified by taking the time and location information of the image to be identified and the image to be identified.
[0005] In a first aspect, an embodiment of the present application provides a pet identity verification method based on liveness detection, comprising:
[0006] Photographing the pet to be identified to obtain an image to be identified, wherein the image to be identified includes a nose print of the pet to be identified;
[0007] Determining the time and geographic location information when the pet to be identified is photographed;
[0008] Performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified;
[0009] When it is determined that the pet to be identified is alive, identity verification of the pet to be identified is performed based on the nose print.
[0010] In a second aspect, an embodiment of the present application provides a pet identity verification device, comprising: an acquisition unit and a processing unit;
[0011] The acquisition unit is configured to photograph the pet to be identified to acquire an image to be identified, wherein the image to be identified includes a nose print of the pet to be identified;
[0012] The processing unit is used to determine the time and geographical location information when the pet to be identified is photographed;
[0013] Performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified;
[0014] When it is determined that the pet to be identified is alive, identity verification of the pet to be identified is performed based on the nose print.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, the processor being connected to a memory, the memory being used to store a computer program, the processor being used to execute the computer program stored in the memory, so that the electronic device executes the method described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute the method described in the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer is operable to enable the computer to execute the method described in the first aspect.
[0018] The implementation of the embodiments of the present application has the following beneficial effects:
[0019] It can be seen that in the embodiment of the present application, before the identity of the pet to be identified is authenticated, the time and geographic location information when the pet to be identified is first obtained; then, based on the time and geographic location information, as well as the captured image to be identified, liveness detection is performed on the image to be identified, and the pet's liveness detection can be completed without the pet's cooperation, thereby improving the convenience and efficiency of pet liveness detection. In addition, the present application performs liveness detection on the pet to be identified based on the current environment and the nature of the image. This takes into account the actual situation at the time of shooting, and therefore can accurately identify cheating schemes using toy pets or pet images, thereby improving the accuracy of pet liveness detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1A schematic diagram of a pet identity verification device provided in an embodiment of the present application;
[0022] Figure 2 A flowchart of a pet identity verification method based on liveness detection provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of a light direction provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of a process for performing frequency domain transformation on an image to be recognized provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of filtering a first spectrum graph provided in an embodiment of the present application;
[0026] Figure 6 A block diagram of the functional units of a pet identity verification device provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0029] The terms "first," "second," "third," and "fourth," etc., in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0030] References herein to "embodiments" mean that a particular feature, result, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0031] See Figure 1 , Figure 1 A schematic diagram of a pet identity verification device provided in an embodiment of the present application. The pet identity verification device 10 includes an image acquisition module 101, a liveness detection module 102, and a pet nose print recognition module 103. The image acquisition module 101 is used to capture an image to be identified; the liveness detection module 102 is used to perform liveness detection on the pet to be identified; the pet nose print recognition module 103 is used to perform pet nose print recognition on the nose print of the pet to be identified when the pet to be identified passes the liveness detection, so as to obtain the identity information of the pet to be identified. The pet identity verification device 10 can be a movable device, such as a user terminal, or a fixed device, such as an access control terminal. The present application does not limit the type of the pet identity verification device 10.
[0032] Specifically, the pet to be identified is photographed by the image acquisition module 101 to obtain an image to be identified, wherein the image to be identified includes the nose print of the pet to be identified; then, the time and geographic location information when the pet to be identified is photographed are obtained; the liveness detection module 102 performs liveness detection on the pet to be identified based on the time, the geographic location information and the image to be identified; when it is determined that the pet to be identified is alive, the pet nose print recognition module 103 authenticates the identity of the pet to be identified based on the nose print.
[0033] It can be seen that in the embodiment of the present application, before the identity of the pet to be identified is authenticated, the pet identity authentication device 10 first obtains the time and geographic location information when the pet to be identified is photographed; then, based on the time and geographic location information, as well as the image to be identified photographed by the image acquisition module 101, the image to be identified is detected for liveness, and the pet's liveness detection can be completed without the pet's cooperation, thereby improving the convenience and efficiency of pet liveness detection. In addition, the present application performs liveness detection on the pet to be identified based on the current environment and the nature of the image. This takes into account the actual situation at the time of shooting, and therefore can accurately identify cheating schemes using toy pets or pet images, thereby improving the accuracy of pet liveness detection.
[0034] See Figure 2 , Figure 2 This is a flow chart of a pet identity verification method based on liveness detection provided in an embodiment of the present application. This method is applied to the above-mentioned pet identity verification device 10. The method includes but is not limited to the following steps:
[0035] 201: The pet identity verification device photographs the pet to be identified to obtain an image to be identified, wherein the image to be identified includes a nose print of the pet to be identified.
[0036] The pet to be identified may be any pet, for example, a cat, a dog, a pig, and the like.
[0037] Exemplarily, the pet identity verification device includes an image acquisition module, such as a camera. Optionally, a user can place the pet to be identified directly in front of the camera, and the pet identity verification device can then use the camera to capture the pet to be identified, thereby obtaining an image to be identified, wherein the image to be identified includes the nose print of the pet to be identified.
[0038] It should be understood that if the pet identity verification device recognizes that the image to be identified does not contain the nose print of the pet to be identified or the nose print is incomplete, it can prompt the user to adjust the position of the pet to be identified or the shooting angle to obtain the complete pet nose print until a qualified image to be identified is captured.
[0039] It should be noted that the above process only determines whether the image to be identified contains the nose print of the pet to be identified, but does not determine whether the pet to be identified is alive. For example, a user can place an image of a teddy bear or the pet to be identified directly in front of the camera to capture an image that meets the requirements. Therefore, before verifying the identity of the pet to be identified, a liveness test is performed on the pet to be identified.
[0040] 202: The pet identity verification device determines the time and geographic location information when the pet to be identified is photographed.
[0041] For example, the pet identity verification device can obtain the time when the identified pet was photographed using the system time and obtain geographic location information using the positioning system. It should be understood that if the pet identity verification device is a fixed device, the geographic location information is also fixed and can be stored locally, eliminating the need to obtain the geographic location information in real time through the positioning system each time.
[0042] 203: The pet identity verification device performs liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified.
[0043] For example, based on the above time and geographic location information, the weather information when the pet to be identified is photographed is determined, that is, the weather information of the shooting location of the pet to be identified is determined. Then, based on the weather information, the light intensity and light direction when the pet to be identified is photographed are determined, wherein the light intensity is the light intensity of the ambient light when the pet to be identified is photographed. Figure 3 As shown, the light direction is represented by the angle between the ambient light and the horizon. Finally, based on the light intensity, light direction, and the image to be identified, liveness detection is performed on the pet to be identified to determine whether the pet to be identified is alive.
[0044] In one embodiment of the present application, a reference image corresponding to the above-mentioned light intensity, the above-mentioned light direction and the above-mentioned type of pet to be identified is obtained. It should be noted that for each living pet, within a certain range of light intensity and a certain range of light direction, the components of different frequency bands (i.e., high frequency, medium frequency and low frequency) contained in the captured image are similar. Therefore, for each living pet, the face of each pet can be photographed in different light intensity intervals and different light direction intervals, respectively, to obtain reference images of each living pet in different light intensity intervals and different light direction intervals. Then, the pet identity verification device can establish a correspondence between the type of pet, the light intensity interval, the light direction interval and the reference image, and maintain this correspondence in the database. Optionally, since it is relatively difficult to photograph each living pet, in this application, a virtual pet corresponding to each living pet and a virtual lighting environment for each living pet can be simulated using a 3D unity simulator. The lighting intensity and light direction in the virtual lighting environment can then be adjusted using the 3Dunity simulator, and the virtual face of the virtual pet for each living pet can be photographed. The photographed images can be used as reference images of each living pet in different lighting intensity intervals and different light direction intervals, thereby constructing reference images of each living pet in different lighting intensity intervals and different light direction intervals. For example, Table 1 shows the correspondence between a cat, a lighting intensity interval, a light direction interval, and a reference image when the pet is a cat.
[0045] Finally, after the pet identity authentication device obtains the above-mentioned light intensity and light direction, it can determine the light interval to which the above-mentioned light intensity belongs and the light interval to which the above-mentioned light direction belongs. According to the light interval to which the above-mentioned light intensity belongs, the light interval to which the above-mentioned light direction belongs, the type of pet to be identified, and the corresponding relationship maintained in the database, the above-mentioned reference image can be determined.
[0046] Table 1:
[0047]
[0048] Furthermore, if Figure 4 As shown, the frequency domain transformation is performed on the above-mentioned image to be identified to obtain a first spectrum diagram. The frequency domain transformation can be a Fourier transform, such as a discrete cosine transform (DCT). Figure 4As shown, for DCT transformation, the high-frequency components in the obtained first spectrum are mainly concentrated in the upper left corner area of the first spectrum, the medium-frequency components are mainly concentrated in the middle area of the first spectrum, and the low-frequency components are mainly concentrated in the lower right corner area of the first spectrum.
[0049] Therefore, in view of the above situation, Figure 5 As shown, different filters can be used to perform high frequency filtering, medium frequency filtering and low frequency filtering on the first spectrum graph respectively to obtain the second spectrum graph, the third spectrum graph and the fourth spectrum graph. Figure 5 As shown, the first spectrum graph is filtered by filter 1 to filter out high-frequency components from the first spectrum graph, and a second spectrum graph containing only high-frequency components is obtained; the first spectrum graph is filtered by filter 2 to filter out intermediate-frequency components from the first spectrum graph, and a third spectrum graph containing only intermediate-frequency components is obtained; the first spectrum graph is filtered by filter 3 to filter out low-frequency components from the first spectrum graph, and a fourth spectrum graph containing only low-frequency components is obtained.
[0050] Furthermore, the energy of the second spectrum graph is obtained to obtain the first high-frequency energy; the energy of the third spectrum graph is obtained to obtain the first intermediate-frequency energy; and the energy of the fourth spectrum graph is obtained to obtain the first low-frequency energy.
[0051] Similarly, the reference image is transformed in the frequency domain to obtain the fifth spectrum map. The frequency domain transformation process of the reference image is similar to the frequency domain process of the above-mentioned image to be identified, and will not be repeated here. Then, the fifth spectrum map is subjected to high-frequency filtering, intermediate-frequency filtering and low-frequency filtering respectively to obtain the sixth spectrum map, the seventh spectrum map and the eighth spectrum map. Among them, the high-frequency filtering, intermediate-frequency filtering and low-frequency filtering of the fifth spectrum map can refer to the above-mentioned process of high-frequency filtering, intermediate-frequency filtering and low-frequency filtering of the first spectrum map, and will not be repeated here again. Finally, based on the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy and the third low-frequency energy, the pet to be identified is detected for liveness.
[0052] Specifically, the difference between the first high-frequency energy and the second high-frequency energy is obtained to obtain a first difference; the difference between the first intermediate-frequency energy and the second intermediate-frequency energy is obtained to obtain a second difference; and the difference between the first low-frequency energy and the second low-frequency energy is obtained to obtain a third difference. The first, second, and third differences are weighted to obtain a target difference, i.e., the first, second, and third differences are weighted based on preset weighting coefficients corresponding to the high, low, and intermediate frequencies, respectively, to obtain the target difference. It should be noted that high-frequency components refer to areas where image intensity (brightness / grayscale) changes dramatically, often referred to as edges (contours), and are relatively representative information. Low-frequency components refer to areas where image intensity (brightness / grayscale) changes smoothly, such as large color blocks. Intermediate-frequency components vary between high and low frequencies in an image. For example, certain color blocks containing slowly changing edges are considered intermediate-frequency components. Such components produce a large amount of low-frequency components when photographing living or toy pets. Therefore, the information represented by low-frequency components is less representative than that represented by high- and low-frequency components. Therefore, due to the nature of the information represented by the high-frequency component, the low-frequency component and the medium-frequency component, when setting the preset weight coefficients of the high frequency, medium frequency and low frequency, the preset weight coefficient of the high frequency can be greater than the preset weight coefficient of the low frequency, and the preset weight coefficient of the low frequency can be greater than the preset weight coefficient of the medium frequency.
[0053] It should be understood that since the reference image is obtained by photographing a living pet, the second high-frequency component, the second medium-frequency component, and the second low-frequency component respectively represent the edge information with drastic changes, the edge information with relatively gentle changes, and the gray block with no edge changes that can be captured when photographing a living pet under the above-mentioned light intensity and light direction. Therefore, if the image to be identified is also obtained by photographing a living pet, the edge information and gray block information in the image to be identified should be similar to those in the reference image. In other words, the first high-frequency energy contained in the image to be identified is relatively close to the second high-frequency energy, the first medium-frequency energy is relatively close to the second medium-frequency energy, and the first low-frequency energy is relatively close to the second low-frequency energy. Therefore, the image to be identified and the reference image can be compared in the high-frequency, medium-frequency, and low-frequency dimensions to determine whether the pet to be identified is alive.
[0054] Specifically, when the target difference is less than or equal to a first threshold, the pet to be identified is determined to be alive; when the target difference is greater than the first threshold, the pet to be identified is determined to be not alive.
[0055] As can be seen, the above-mentioned comprehensive comparison of high, medium, and low frequencies results in a more accurate comparison result, thereby improving the accuracy of pet liveness detection. Furthermore, when setting the preset weight coefficient for each comparison dimension, a targeted setting is made based on the nature of the information represented by each comparison dimension, resulting in a more accurate preset weight coefficient for each comparison dimension, further improving the accuracy of liveness detection.
[0056] In another embodiment of the present application, the image to be identified is subjected to illumination decomposition to obtain a first illumination intensity and a first light direction. Exemplarily, the image to be identified is subjected to illumination decomposition by a trained illumination imaging model to obtain an illumination map, that is, the image to be identified is feature decoupled to separate the illumination map related to the light source. For example, the trained illumination imaging model can be a trained U-net network, so the image to be identified can be input into the trained U-net network for feature decoupling to obtain an illumination map of the image to be identified. The illumination map is then divided into a plurality of sub-illumination maps, for example, the illumination map is divided according to a preset size to obtain a plurality of sub-illumination maps; the illumination intensity of each sub-illumination map is obtained according to the contrast of each sub-illumination map, for example, the illumination intensity of each sub-illumination map can be determined based on the correspondence between the contrast and the illumination intensity.
[0057] Furthermore, the image moments of each sub-illumination image are obtained, and based on the image moments of each sub-illumination image, the light intensity weighted center of each sub-illumination image and the geometric center of each sub-illumination image are determined. It should be noted that an image moment can be a set of moments calculated from a digital image, which generally describes the global features of the image and provides a large amount of information about different types of geometric features of the image, such as size, position, direction, and shape. For example, the original moment is used to determine the grayscale center of the image; the first-order moment is related to the shape; the second-order moment shows the degree of expansion of the curve around the average value of the straight line; the third-order moment is a measure of symmetry about the average value; a set of seven invariant moments can be derived from the second-order and third-order moments. Invariant moments are statistical features of the image that are invariant to translation, scaling, and rotation. In image processing, geometric invariant moments can be used as an important feature to represent objects, and these features can be used to perform operations such as image classification. Exemplarily, the geometric center coordinates of each sub-illumination image are obtained based on the original moment in the image moment of each sub-illumination image; the light intensity weighted center coordinates of each sub-illumination image are obtained based on the first-order moment in the image moment of each sub-illumination image. The specific determination process is existing technology and will not be described again.
[0058] Furthermore, the light direction of each sub-light map is determined based on the coordinates of the intensity-weighted center of each sub-light map and the coordinates of the geometric center of each sub-light map. Exemplarily, the geometric center coordinates of each sub-light map are compared with the coordinates of the intensity-weighted center of each sub-light map to obtain the light direction of each sub-light map. Optionally, the direction of the vector formed from the position represented by the geometric center coordinates to the position represented by the intensity-weighted center is used as the light direction of each sub-light map.
[0059] For example, the light direction of the ith sub-lighting map among the multiple sub-lighting maps (the ith sub-lighting map is any one of the multiple sub-lighting maps) can be expressed by formula (1):
[0060]
[0061] Among them, ∝ i is the light direction of the i-th sub-light map, (y i , x i ) is the geometric center coordinate of the i-th sub-lighting map, (u i , v i ) is the light intensity weighted center coordinate of the i-th sub-light map.
[0062] Finally, an average value of the multiple illumination intensities of the multiple sub-illumination maps is used as the first illumination intensity; and an average value of the multiple light directions of the multiple sub-illumination maps is used as the first light direction.
[0063] It should be understood that the first light intensity and first light direction determined above represent the actual light intensity and light direction generated by the ambient light illuminating the pet to be identified when the image is captured. Therefore, after obtaining the first light intensity and first light direction of the image to be identified, an attenuation coefficient for the pet to be identified is obtained. This attenuation coefficient represents the degree to which the ambient light intensity is attenuated when the ambient light irradiates the face of the living pet to be identified. It should be understood that different materials absorb ambient light differently. Different types of pets, due to differences in facial shape, hair density, and skin, also absorb ambient light differently, resulting in different degrees of attenuation for each type of pet. Therefore, the pet identity verification device can pre-determine the attenuation coefficient for each pet and locally store it. Then, based on the type of the pet to be identified, the attenuation coefficient corresponding to the pet to be identified can be obtained. Finally, the light intensity is attenuated according to the attenuation coefficient to obtain a second light intensity.
[0064] For example, the second light intensity can be expressed by formula (2):
[0065] Lux2=μ*Lux Formula (2);
[0066] Wherein, Lux2 is the second light intensity, μ is the attenuation coefficient, and Lux is the above light intensity.
[0067] Exemplarily, the first light intensity and the second light intensity are compared to obtain a first deviation value; the first light direction and the second light direction are compared to obtain a second deviation value. Finally, the first deviation value and the second deviation value are weighted to obtain a target deviation value. When the target deviation value is less than or equal to a second threshold, the pet to be identified is determined to be alive; when the target deviation value is greater than the second threshold, the pet to be identified is determined to be not alive.
[0068] For example, the first deviation value can be expressed by formula (3):
[0069]
[0070] Wherein, offset1 is the first offset value, Lux1 is the first light intensity, and Lux2 is the second light intensity.
[0071] For example, the second deviation value can be expressed by formula (4):
[0072]
[0073] Wherein, offset2 is the second offset value, α1 is the first light intensity, and α2 is the second light intensity.
[0074] It should be understood that the second light intensity is the light intensity after being attenuated by a living pet. Therefore, if the pet to be identified is a living pet, the difference between the first light intensity and the second light intensity obtained by performing light decomposition on the image to be identified should be relatively small, and thus the first offset value obtained should also be relatively small. Similarly, if the pet to be identified is a living pet, the difference between the first light direction obtained by light decomposition and the actual light direction (i.e., the light direction determined based on the weather information) is also relatively small, i.e., the second offset value is also relatively small. Therefore, by comparing the light intensity and light direction, it is possible to accurately determine whether the pet to be identified is alive.
[0075] 204: When it is determined that the pet to be identified is alive, the pet identity verification device performs identity verification on the pet to be identified based on the nose print.
[0076] For example, when the liveness detection of the pet to be identified is passed, the identity of the pet to be identified will be authenticated based on the acquired nose print of the pet to be identified, that is, the identity information of the pet to be identified will be identified.
[0077] Specifically, the area containing the nose print is cut out from the image to be identified to obtain a target image, that is, target recognition is performed on the image to be identified to obtain a target area containing the nose print in the image to be identified, and then the image corresponding to the target area is cut out to obtain a target image; feature extraction is performed on the target image to obtain a feature vector. For example, feature extraction can be performed on the target image using a trained feature extraction network to obtain a feature vector. Finally, the feature vector is matched with each template vector to obtain a matching degree with each template vector; based on the matching degree with each template vector, the identity of the pet to be identified is authenticated. Exemplarily, the maximum matching degree among the matching degrees with each template vector is obtained; when the maximum matching degree is greater than or equal to the matching threshold, the pet identity corresponding to the template vector corresponding to the maximum matching degree is used as the identity information of the pet to be identified; when the maximum matching degree is less than the matching degree threshold, a prompt message indicating that the identity authentication failed is displayed.
[0078] It can be seen that in the embodiment of the present application, before the identity of the pet to be identified is authenticated, the time and geographic location information when the pet to be identified is first obtained; then, based on the time and geographic location information, as well as the captured image to be identified, liveness detection is performed on the image to be identified, and the pet's liveness detection can be completed without the pet's cooperation, thereby improving the convenience and efficiency of pet liveness detection. In addition, the present application performs liveness detection on the pet to be identified based on the current environment and the nature of the image. This takes into account the actual situation at the time of shooting, and therefore can accurately identify cheating schemes using toy pets or pet images, thereby improving the accuracy of pet liveness detection.
[0079] See Figure 6 , Figure 6 The present invention provides a functional unit block diagram of a pet identity verification device. The pet identity verification device 600 includes: an acquisition unit 601 and a processing unit 602, wherein:
[0080] An acquisition unit 601 is configured to photograph a pet to be identified and acquire an image to be identified, wherein the image to be identified includes a nose print of the pet to be identified;
[0081] The processing unit 602 is used to determine the time and geographic location information when the pet to be identified is photographed;
[0082] Performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified;
[0083] When it is determined that the pet to be identified is alive, identity verification of the pet to be identified is performed based on the nose print.
[0084] In some possible implementations, in performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified, the processing unit 602 is specifically configured to:
[0085] determining weather information when photographing the pet to be identified based on the time and the geographical location information;
[0086] Determining the light intensity and light direction when photographing the pet to be identified based on the weather information;
[0087] Perform liveness detection on the pet to be identified based on the light intensity, the light direction, and the image to be identified.
[0088] In some possible implementations, in performing liveness detection on the pet to be identified based on the light intensity, the light direction, and the image to be identified, the processing unit 602 is specifically configured to:
[0089] Acquire a reference image corresponding to the light intensity, the light direction, and the type of the pet to be identified;
[0090] Performing frequency domain transformation on the image to be identified to obtain a first spectrum graph;
[0091] Performing high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the first spectrum graph respectively to obtain a second spectrum graph, a third spectrum graph, and a fourth spectrum graph;
[0092] respectively acquiring the energy of the second spectrum graph, the energy of the third spectrum graph, and the energy of the fourth spectrum graph to obtain a first high-frequency energy, a first intermediate-frequency energy, and a first low-frequency energy;
[0093] Performing frequency domain transformation on the reference image to obtain a fifth frequency spectrum graph;
[0094] Performing high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the fifth spectrum graph respectively to obtain a sixth spectrum graph, a seventh spectrum graph, and an eighth spectrum graph;
[0095] respectively acquiring the energy of the sixth spectrum graph, the energy of the seventh spectrum graph, and the energy of the eighth spectrum graph to obtain a second high-frequency energy, a second intermediate-frequency energy, and a third low-frequency energy;
[0096] Liveness detection is performed on the pet to be identified based on the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy, and the third low-frequency energy.
[0097] In some possible implementations, in performing liveness detection on the pet to be identified based on the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy, and the third low-frequency energy, the processing unit 602 is specifically configured to:
[0098] obtaining a difference between the first high-frequency energy and the second high-frequency energy to obtain a first difference;
[0099] Obtaining a difference between the first intermediate frequency energy and the second intermediate frequency energy to obtain a second difference;
[0100] obtaining a difference between the first low-frequency energy and the second low-frequency energy to obtain a third difference;
[0101] performing weighted processing on the first difference, the second difference, and the third difference to obtain a target difference;
[0102] When the target difference is less than or equal to a first threshold, the pet to be identified is determined to be alive; when the target difference is greater than the first threshold, the pet to be identified is determined to be not alive.
[0103] In some possible implementations, in performing liveness detection on the pet to be identified based on the light intensity, the light direction, and the image to be identified, the processing unit 602 is specifically configured to:
[0104] Performing illumination decomposition on the image to be recognized to obtain a first illumination intensity and a first light direction;
[0105] Obtaining an attenuation coefficient corresponding to the pet to be identified, and attenuating the light intensity according to the attenuation coefficient to obtain a second light intensity;
[0106] Comparing the first light intensity with the second light intensity to obtain a first deviation value;
[0107] Comparing the first light direction with the light direction to obtain a second deviation value;
[0108] performing weighted processing on the first deviation value and the second deviation value to obtain a target deviation value;
[0109] When the target deviation value is less than or equal to a second threshold, the pet to be identified is determined to be alive; when the target deviation value is greater than the second threshold, the pet to be identified is determined to be not alive.
[0110] In some possible implementations, in performing illumination decomposition on the image to be recognized to obtain the first illumination intensity and the first light direction, the processing unit 602 is specifically configured to:
[0111] Performing illumination decomposition on the image to be identified using a trained illumination imaging model to obtain an illumination map;
[0112] Splitting the light map into a plurality of sub-light maps;
[0113] According to the contrast of each sub-illumination map, the illumination intensity of each sub-illumination map is obtained;
[0114] Get the image moment of each sub-light map;
[0115] Determine the light intensity weighted center coordinates of each sub-illumination image and the geometric center coordinates of each sub-illumination image according to the image moment of each sub-illumination image;
[0116] Determine the light direction of each sub-light map according to the light intensity weighted center coordinates of each sub-light map and the geometric center coordinates of each sub-light map;
[0117] Taking an average value of multiple illumination intensities of the multiple sub-illumination maps as the first illumination intensity;
[0118] An average value of multiple light directions of the multiple sub-illumination maps is used as the first light direction.
[0119] In some possible implementations, in terms of performing identity authentication on the pet to be identified based on the nose print, the processing unit 602 is specifically configured to:
[0120] Cutting out the region containing the nose print from the image to be recognized to obtain a target image;
[0121] Performing feature extraction on the target image to obtain a feature vector;
[0122] Matching the feature vector with each template vector to obtain a matching degree with each template vector;
[0123] The pet to be identified is authenticated according to the matching degree with each template vector.
[0124] See Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, electronic device 700 includes transceiver 701, processor 702 and memory 703. They are connected via bus 704. Memory 703 is used to store computer programs and data, and can transmit data stored in memory 703 to processor 702.
[0125] The processor 702 is configured to read the computer program in the memory 703 and perform the following operations:
[0126] Controlling the transceiver 701 to photograph the pet to be identified, and obtaining an image to be identified, wherein the image to be identified includes a nose print of the pet to be identified;
[0127] Determining the time and geographic location information when the pet to be identified is photographed;
[0128] Performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified;
[0129] When it is determined that the pet to be identified is alive, identity verification of the pet to be identified is performed based on the nose print.
[0130] In some possible implementations, in terms of performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified, the processor 702 is specifically configured to perform the following operations:
[0131] determining weather information when photographing the pet to be identified based on the time and the geographical location information;
[0132] Determining the light intensity and light direction when photographing the pet to be identified based on the weather information;
[0133] Perform liveness detection on the pet to be identified based on the light intensity, the light direction, and the image to be identified.
[0134] In some possible implementations, in terms of performing liveness detection on the pet to be identified based on the light intensity, the light direction, and the image to be identified, the processor 702 is specifically configured to perform the following operations:
[0135] Acquire a reference image corresponding to the light intensity, the light direction, and the type of the pet to be identified;
[0136] Performing frequency domain transformation on the image to be identified to obtain a first spectrum graph;
[0137] Performing high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the first spectrum graph respectively to obtain a second spectrum graph, a third spectrum graph, and a fourth spectrum graph;
[0138] respectively acquiring the energy of the second spectrum graph, the energy of the third spectrum graph, and the energy of the fourth spectrum graph to obtain a first high-frequency energy, a first intermediate-frequency energy, and a first low-frequency energy;
[0139] Performing frequency domain transformation on the reference image to obtain a fifth frequency spectrum graph;
[0140] Performing high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the fifth spectrum graph respectively to obtain a sixth spectrum graph, a seventh spectrum graph, and an eighth spectrum graph;
[0141] respectively acquiring the energy of the sixth spectrum graph, the energy of the seventh spectrum graph, and the energy of the eighth spectrum graph to obtain a second high-frequency energy, a second intermediate-frequency energy, and a third low-frequency energy;
[0142] Liveness detection is performed on the pet to be identified based on the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy, and the third low-frequency energy.
[0143] In some possible implementations, in terms of performing liveness detection on the pet to be identified based on the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy, and the third low-frequency energy, the processor 702 is specifically configured to perform the following operations:
[0144] obtaining a difference between the first high-frequency energy and the second high-frequency energy to obtain a first difference;
[0145] Obtaining a difference between the first intermediate frequency energy and the second intermediate frequency energy to obtain a second difference;
[0146] obtaining a difference between the first low-frequency energy and the second low-frequency energy to obtain a third difference;
[0147] performing weighted processing on the first difference, the second difference, and the third difference to obtain a target difference;
[0148] When the target difference is less than or equal to a first threshold, the pet to be identified is determined to be alive; when the target difference is greater than the first threshold, the pet to be identified is determined to be not alive.
[0149] In some possible implementations, in terms of performing liveness detection on the pet to be identified based on the light intensity, the light direction, and the image to be identified, the processor 702 is specifically configured to perform the following operations:
[0150] Performing illumination decomposition on the image to be recognized to obtain a first illumination intensity and a first light direction;
[0151] Obtaining an attenuation coefficient corresponding to the pet to be identified, and attenuating the light intensity according to the attenuation coefficient to obtain a second light intensity;
[0152] Comparing the first light intensity with the second light intensity to obtain a first deviation value;
[0153] Comparing the first light direction with the light direction to obtain a second deviation value;
[0154] performing weighted processing on the first deviation value and the second deviation value to obtain a target deviation value;
[0155] When the target deviation value is less than or equal to a second threshold, the pet to be identified is determined to be alive; when the target deviation value is greater than the second threshold, the pet to be identified is determined to be not alive.
[0156] In some possible implementations, in performing illumination decomposition on the image to be recognized to obtain the first illumination intensity and the first light direction, the processor 702 is specifically configured to perform the following operations:
[0157] Performing illumination decomposition on the image to be identified using a trained illumination imaging model to obtain an illumination map;
[0158] Splitting the light map into a plurality of sub-light maps;
[0159] According to the contrast of each sub-illumination map, the illumination intensity of each sub-illumination map is obtained;
[0160] Get the image moment of each sub-light map;
[0161] Determine the light intensity weighted center coordinates of each sub-illumination image and the geometric center coordinates of each sub-illumination image according to the image moment of each sub-illumination image;
[0162] Determine the light direction of each sub-light map according to the light intensity weighted center coordinates of each sub-light map and the geometric center coordinates of each sub-light map;
[0163] Taking an average value of multiple illumination intensities of the multiple sub-illumination maps as the first illumination intensity;
[0164] An average value of multiple light directions of the multiple sub-illumination maps is used as the first light direction.
[0165] In some possible implementations, in terms of performing identity verification on the pet to be identified based on the nose print, the processor 702 is specifically configured to perform the following operations:
[0166] Cutting out the region containing the nose print from the image to be recognized to obtain a target image;
[0167] Performing feature extraction on the target image to obtain a feature vector;
[0168] Matching the feature vector with each template vector to obtain a matching degree with each template vector;
[0169] The pet to be identified is authenticated according to the matching degree with each template vector.
[0170] Specifically, the transceiver 701 may be Figure 6 The acquisition unit 601 of the pet identity verification device 600 of the embodiment described above, the processor 702 may be Figure 6 The processing unit 602 of the pet identity verification device 600 of the embodiment described.
[0171] It should be understood that the electronic devices in this application may include smartphones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptops, mobile Internet devices (MIDs) or wearable devices. The above electronic devices are only examples and are not exhaustive, including but not limited to the above electronic devices. In actual applications, the above electronic devices may also include: smart car terminals, computer equipment, etc.
[0172] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement part or all of the steps of any pet identity authentication method based on liveness detection as described in the above method embodiments.
[0173] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute part or all of the steps of any one of the pet identity authentication methods based on liveness detection as described in the above method embodiments.
[0174] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
[0175] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as 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 interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0177] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0178] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of software program modules.
[0179] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0180] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0181] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A pet identity authentication method based on liveness detection, characterized in that: include: Photographing the pet to be identified to obtain an image to be identified, wherein the image to be identified includes a nose print of the pet to be identified; Determining the time and geographic location information when the pet to be identified is photographed; Performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified, including: Determining weather information when photographing the pet to be identified based on the time and the geographical location information; determining light intensity and light direction when photographing the pet to be identified based on the weather information; Obtain a reference image corresponding to the light intensity, the light direction, and the type of the pet to be identified; perform frequency domain transformation on the image to be identified to obtain a first spectrum graph; perform high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the first spectrum graph to obtain a second spectrum graph, a third spectrum graph, and a fourth spectrum graph; obtain the energy of the second spectrum graph, the energy of the third spectrum graph, and the energy of the fourth spectrum graph to obtain a first high-frequency energy, a first intermediate-frequency energy, and a first low-frequency energy; perform frequency domain transformation on the reference image to obtain a fifth spectrum graph; perform high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the fifth spectrum graph to obtain a sixth spectrum graph, a seventh spectrum graph, and an eighth spectrum graph; obtain the energy of the sixth spectrum graph, the energy of the seventh spectrum graph, and the energy of the eighth spectrum graph to obtain a second high-frequency energy, a second intermediate-frequency energy, and a second low-frequency energy; perform liveness detection on the pet to be identified based on the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy, and the second low-frequency energy; or, Performing illumination decomposition on the image to be identified to obtain a first illumination intensity and a first light direction; obtaining an attenuation coefficient corresponding to the pet to be identified, and attenuating the illumination intensity according to the attenuation coefficient to obtain a second illumination intensity; comparing the first illumination intensity with the second illumination intensity to obtain a first deviation value; comparing the first light direction with the light direction to obtain a second deviation value; performing weighted processing on the first deviation value and the second deviation value to obtain a target deviation value; when the target deviation value is less than or equal to a second threshold, determining that the pet to be identified is alive; when the target deviation value is greater than the second threshold, determining that the pet to be identified is not alive; When it is determined that the pet to be identified is alive, identity verification of the pet to be identified is performed based on the nose print.
2. The method according to claim 1, characterized in that The performing liveness detection on the pet to be identified according to the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy, and the second low-frequency energy includes: obtaining a difference between the first high-frequency energy and the second high-frequency energy to obtain a first difference; Obtaining a difference between the first intermediate frequency energy and the second intermediate frequency energy to obtain a second difference; obtaining a difference between the first low-frequency energy and the second low-frequency energy to obtain a third difference; performing weighted processing on the first difference, the second difference, and the third difference to obtain a target difference; When the target difference is less than or equal to a first threshold, the pet to be identified is determined to be alive; when the target difference is greater than the first threshold, the pet to be identified is determined to be not alive.
3. The method according to claim 1, characterized in that The performing illumination decomposition on the image to be recognized to obtain a first illumination intensity and a first light direction includes: Performing illumination decomposition on the image to be identified using a trained illumination imaging model to obtain an illumination map; Splitting the light map into a plurality of sub-light maps; According to the contrast of each sub-illumination map, the illumination intensity of each sub-illumination map is obtained; Get the image moment of each sub-light map; Determine the light intensity weighted center coordinates of each sub-illumination image and the geometric center coordinates of each sub-illumination image according to the image moment of each sub-illumination image; Determine the light direction of each sub-light map according to the light intensity weighted center coordinates of each sub-light map and the geometric center coordinates of each sub-light map; Taking an average value of multiple illumination intensities of the multiple sub-illumination maps as the first illumination intensity; An average value of multiple light directions of the multiple sub-illumination maps is used as the first light direction.
4. The method according to any one of claims 1 to 3, characterized in that The identity verification of the pet to be identified based on the nose print includes: Cutting out the region containing the nose print from the image to be recognized to obtain a target image; Performing feature extraction on the target image to obtain a feature vector; Matching the feature vector with each template vector to obtain a matching degree with each template vector; The pet to be identified is authenticated according to the matching degree with each template vector.
5. A pet identity verification device, characterized in that: include: Acquisition unit and processing unit; The acquisition unit is configured to photograph the pet to be identified to acquire an image to be identified, wherein the image to be identified includes a nose print of the pet to be identified; The processing unit is used to determine the time and geographical location information when the pet to be identified is photographed; Performing liveness detection on the pet to be identified based on the time, the geographic location information, and the image to be identified, including: Determining weather information when photographing the pet to be identified based on the time and the geographical location information; determining light intensity and light direction when photographing the pet to be identified based on the weather information; Obtain a reference image corresponding to the light intensity, the light direction, and the type of the pet to be identified; perform frequency domain transformation on the image to be identified to obtain a first spectrum graph; perform high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the first spectrum graph to obtain a second spectrum graph, a third spectrum graph, and a fourth spectrum graph; obtain the energy of the second spectrum graph, the energy of the third spectrum graph, and the energy of the fourth spectrum graph to obtain a first high-frequency energy, a first intermediate-frequency energy, and a first low-frequency energy; perform frequency domain transformation on the reference image to obtain a fifth spectrum graph; perform high-frequency filtering, intermediate-frequency filtering, and low-frequency filtering on the fifth spectrum graph to obtain a sixth spectrum graph, a seventh spectrum graph, and an eighth spectrum graph; obtain the energy of the sixth spectrum graph, the energy of the seventh spectrum graph, and the energy of the eighth spectrum graph to obtain a second high-frequency energy, a second intermediate-frequency energy, and a second low-frequency energy; perform liveness detection on the pet to be identified based on the first high-frequency energy, the first intermediate-frequency energy, the first low-frequency energy, the second high-frequency energy, the second intermediate-frequency energy, and the second low-frequency energy; or, Performing illumination decomposition on the image to be identified to obtain a first illumination intensity and a first light direction; obtaining an attenuation coefficient corresponding to the pet to be identified, and attenuating the illumination intensity according to the attenuation coefficient to obtain a second illumination intensity; comparing the first illumination intensity with the second illumination intensity to obtain a first deviation value; comparing the first light direction with the light direction to obtain a second deviation value; performing weighted processing on the first deviation value and the second deviation value to obtain a target deviation value; when the target deviation value is less than or equal to a second threshold, determining that the pet to be identified is alive; when the target deviation value is greater than the second threshold, determining that the pet to be identified is not alive; When it is determined that the pet to be identified is alive, identity verification of the pet to be identified is performed based on the nose print.
6. An electronic device, characterized in that: include: A processor and a memory, the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Face recognition method, living body face detection method, devices and equipment
CN107480576A
Identity authentication method and device
CN111199032A