A palm vein recognition method, device, equipment and storage medium
By using the YOLOv5 model to detect the brightness of the palm area and adjust the camera exposure, the problem of low recognition efficiency and long recognition time caused by unstable brightness in existing technologies is solved, and efficient palm vein recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-04-10
AI Technical Summary
Existing palm vein recognition technology is affected by factors such as ambient light, palm height, and the optical characteristics of palm skin and blood vessels, resulting in unstable brightness in the palm area, leading to low recognition efficiency and long recognition time.
The brightness of the palm area is detected by the YOLOv5 model, and the camera exposure is adjusted to obtain a palm image with appropriate brightness. The YOLOv5 model is used to quickly detect the palm area and adjust the exposure to ensure that the brightness of the palm image is within the preset range.
It improves the efficiency and accuracy of palm vein recognition, shortens the recognition time, and enhances the user experience.
Smart Images

Figure CN116052230B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of biometric identification, and particularly relate to a palm vein identification method, device, equipment and storage medium. BACKGROUND
[0002] With the rapid development of palm vein identification technology, palm vein identification technology is widely applied to various systems for verifying personal identity, such as security systems, access control systems, subway systems and check-in systems. Compared with biometric identification technologies such as fingerprints and pupils, palm vein identification technology not only achieves non-contact identification, but also is difficult to fake and has a higher security level.
[0003] In the prior art, after a camera captures a palm image of a user, a palm region is first detected from the palm image based on a palm detection model, and a palm vein feature is identified from the palm region, so as to determine the identity of the user according to the palm vein feature. However, the brightness of the palm image is affected by many factors such as environmental light, palm height, optical properties of palm skin and blood vessels, and camera exposure value, and the palm region is prone to appear too dark or too bright, which is not conducive to accurately extracting the palm vein feature from the palm region, resulting in the system being unable to identify the identity of the user. The user needs to adjust the hand posture multiple times to capture a palm image with appropriate brightness, and to determine the identity of the user based on the palm image, so that the time required for identity recognition is relatively long, and the recognition efficiency is relatively low. SUMMARY
[0004] Embodiments of the present application provide a palm vein identification method, device, equipment and storage medium, by detecting a palm region in a palm image, adjusting the camera exposure according to the brightness value of the palm region, so as to quickly collect a palm image with appropriate brightness for palm vein identification, improve the recognition efficiency, and solve the problem of long time required for palm vein identification in the prior art.
[0005] In a first aspect, embodiments of the present application provide a palm vein identification method, comprising:
[0006] capturing a palm image by a camera, and identifying a first palm region from the palm image by a pre-trained palm detection model;
[0007] in a case where a target brightness value of the first palm region does not satisfy a preset brightness range, adjusting the exposure of the camera according to the target brightness value, and capturing a next palm image by the camera;
[0008] in a case where the target brightness value of the first palm region satisfies the preset brightness range, identifying a second palm region from the palm image;
[0009] extracting a palm vein feature from the second palm region, so as to determine corresponding identity information according to the palm vein feature.
[0010] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer;
[0011] Correspondingly, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer;
[0012] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer;
[0013] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer;
[0014] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer;
[0015] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer.
[0016] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer.
[0017] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer.
[0018] Further, the palm detection model is a YOLOv5 model, the YOLOv5 model comprising a convolutional neural network, a path aggregation network and a YOLO layer.
[0019] Further, before the palm image is captured by the camera, the method further comprises:
[0020] Further, before the palm image is captured by the camera, the method further comprises:
[0021] Further, before the palm image is captured by the camera, the method further comprises:
[0022] Further, before the palm image is captured by the camera, the method further comprises:
[0023] Further, before the palm image is captured by the camera, the method further comprises:
[0024] Further, the method further comprises:
[0025] determining an expected brightness value according to the preset brightness range;
[0026] determining an expected exposure value based on a preset exposure value calculation formula, and adjusting the exposure of the camera to the expected exposure value; the exposure value calculation formula is:
[0027] E n = E o *(1+Gap*ratio)
[0028] wherein, E n is the expected exposure value, E o is the current exposure value of the camera, Gap is the difference between the target brightness value and the expected brightness value; ratio is a constant parameter.
[0029] In a second aspect, an embodiment of the present application provides a palm vein recognition device, comprising:
[0030] A first palm detection module configured to capture a palm image through a camera, and identify a first palm region from the palm image through a pre-trained palm detection model;
[0031] An exposure adjustment module configured to, in a case where a target brightness value of the first palm region does not satisfy a preset brightness range, adjust the exposure of the camera according to the target brightness value, and capture a next palm image through the camera;
[0032] A second palm detection module configured to, in a case where the target brightness value of the first palm region satisfies the preset brightness range, identify a second palm region from the palm image;
[0033] A palm vein recognition module configured to extract a palm vein feature from the second palm region, so as to determine corresponding identity information according to the palm vein feature.
[0034] Further, the palm detection model is a YOLOv5 model, and the YOLOv5 model comprises a convolutional neural network, a path aggregation network and a YOLO layer; correspondingly, the first palm detection module comprises:
[0035] A first feature extraction unit configured to adjust the palm image to a preset size, and input the adjusted palm image into the convolutional neural network to obtain a first feature image output by the convolutional neural network;
[0036] A second feature extraction unit configured to input the first feature image into the path aggregation network to obtain a second feature image output by the path aggregation network;
[0037] The target detection unit is configured to input the second feature image into the YOLO layer to obtain the anchor box coordinates output by the YOLO layer;
[0038] A coordinate mapping unit is configured to map the anchor frame coordinates onto the palm image to determine the first palm region in the palm image.
[0039] Furthermore, the preset size is 96×96, and the anchor frame size of the hand detection model includes [27, 29], [33, 40] and [42, 46].
[0040] Furthermore, the YOLO layer includes three convolutional layers with 24, 48, and 96 channels, respectively.
[0041] Furthermore, the network depth gain of the hand detection model is 0.33, and the convolution channel gain of the hand detection model is 0.09.
[0042] Furthermore, the palm vein recognition device also includes a training module, which includes:
[0043] The sample acquisition unit is configured to acquire a training sample set, which includes positive sample images and negative sample images.
[0044] The sample prediction unit is configured to input the positive sample image or the negative sample image into the palm detection model to obtain the detection result output by the palm detection model;
[0045] The loss value determination unit is configured to determine the loss value based on the detection result, the marked region of the corresponding sample image, and a preset intersection-union ratio;
[0046] The parameter adjustment unit is configured to adjust the parameters of the palm detection model based on the loss value.
[0047] Furthermore, the exposure adjustment module includes:
[0048] The desired brightness determination unit is configured to determine a desired brightness value based on the preset brightness range;
[0049] The desired exposure determination unit is configured to determine a desired exposure value based on a preset exposure value calculation formula, and adjust the camera's exposure to the desired exposure value; the exposure value calculation formula is:
[0050] E n =E o *(1+Gap*ratio)
[0051] Among them, E n E is the desired exposure value.o Gsp is a difference between the target brightness value and the expected brightness value; rstio is a constant parameter.
[0052] In a third aspect, an embodiment of the present application provides a palm vein recognition device, comprising:
[0053] a memory and one or more processors;
[0054] the memory is configured to store one or more programs;
[0055] When the one or more programs are executed by the one or more processors, the one or more processors implement the palm vein recognition method according to the first aspect.
[0056] In a fourth aspect, an embodiment of the present application provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are configured to perform the palm vein recognition method according to the first aspect.
[0057] The palm detection model is used to quickly detect the first palm region in the palm image. When the target brightness value of the first palm region meets the preset brightness range, it is determined that the palm vein features can be accurately extracted from the palm image. Therefore, the second palm region can be detected from the palm image, and the palm vein features are extracted from the second palm region to determine the corresponding user identity according to the palm vein features. When the target brightness value of the first palm region does not meet the preset brightness range, it is determined that the palm vein features cannot be accurately extracted from the palm image. Therefore, the exposure value of the camera is adjusted according to the target brightness value of the first palm region, so that the camera can quickly capture the palm image from which the palm vein features can be accurately extracted. Through the above technical means, after the camera captures the invalid palm image, the exposure of the camera is adjusted according to the target brightness value of the palm region of the palm image, so that the camera can capture the valid palm image in a short time. Without adjusting the hand posture of the user, a palm image with appropriate brightness can be captured, the acquisition time of the valid palm image is shortened, and the user experience is improved. The palm vein recognition is performed on the valid palm image to determine the user identity, the palm vein recognition efficiency and accuracy are improved, and the problem of long palm vein recognition time in the prior art is solved. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 is a flowchart of a palm vein recognition method provided by an embodiment of the present application;
[0059] Figure 2 is a network structure diagram of a YOLOv5 model provided by an embodiment of the present application;
[0060] Figure 3is a flowchart of detecting a first palm region in a palm image based on a palm detection model provided by an embodiment of the present application;
[0061] Figure 4 is a flowchart of training a palm detection model provided by an embodiment of the present application;
[0062] Figure 5 is a flowchart of adjusting camera exposure provided by an embodiment of the present application;
[0063] Figure 6 is a structural schematic diagram of a palm vein recognition device provided by an embodiment of the present application;
[0064] Figure 7 is a structural schematic diagram of a palm vein recognition device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the objects, technical solutions and advantages of the present application clearer, the following further describes the specific embodiments of the present application with reference to the drawings. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only parts related to the present application are shown in the drawings, but not all contents. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted by flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0066] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a category, and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in a "or" relationship.
[0067] The palm vein recognition method, device, equipment and storage medium provided by the present application are aimed at capturing a palm image by a camera, identifying a first palm region from the palm image by a pre-trained palm detection model, adjusting the exposure of the camera according to the target brightness value in the case where the target brightness value of the first palm region does not meet the preset brightness range, capturing the next palm image by the camera, identifying a second palm region from the palm image in the case where the target brightness value of the first palm region meets the preset brightness range, extracting palm vein features from the second palm region, and determining the corresponding identity information according to the palm vein features. Compared with the traditional palm vein recognition method, when the camera collects an invalid palm image with too dark or too bright palm region, the user is prompted to adjust the hand posture and the distance between the hand and the camera to capture an effective palm image with appropriate brightness. However, the user may need to adjust the hand posture and the distance to the camera several times to capture the effective palm image, the collection time of the effective palm image is relatively long, and the time required for identity recognition is relatively long, and the identity recognition efficiency is relatively low.
[0068] Figure 1 is a flowchart of a palm vein recognition method provided by an embodiment of the present application. The palm vein recognition method provided in the embodiment can be executed by a palm vein recognition device, which can be realized by software and / or hardware, and can be composed of two or more physical entities or one physical entity.
[0069] The following describes an example in which the palm vein recognition device is the main body for executing the palm vein recognition method. Referring to Figure 1 The palm vein recognition method comprises the following steps.
[0070] In S110, a palm image is captured by a camera, and a first palm region is identified from the palm image by a pre-trained palm detection model.
[0071] The embodiment takes a community access control system provided with a palm vein recognition device as an example for description. When a user enters the community, the user places the palm in the shooting area of the camera of the palm vein recognition device, the camera captures a palm image of the user, and the palm image is transmitted to the processor of the palm vein recognition device. The palm image can be understood as the first palm image of the user captured by the camera.
[0072] In this embodiment, the palm detection model is a pre-trained neural network model for detecting the first palm region in the palm image. This embodiment aims to extract the first palm region in the palm image through the palm detection model, determine whether the brightness of the first palm region is in the ideal interval, and in the case that the brightness of the first palm region is not in the ideal interval, adjust the camera exposure according to the brightness of the first palm region, so that the brightness of the palm region in the next image captured by the camera is in the ideal interval. In the prior art, when adjusting the camera exposure, the camera exposure is adjusted according to the brightness of the entire palm image. Since the brightness of the palm region is easily affected by the background brightness and the optical properties of the palm skin, blood vessels and the like, the brightness of the palm region in the next image captured by the camera cannot be accurately adjusted to the ideal interval, the shooting efficiency of the effective palm image is low, and further the palm vein recognition efficiency is affected. Compared with the prior art, the embodiment adjusts the camera exposure according to the brightness of the first palm region, so as to adjust the brightness of the first palm region in the next image captured by the camera to the ideal region, improve the accuracy of exposure adjustment, and further improve the shooting efficiency of the effective palm image.
[0073] In an embodiment, the palm detection model is a YOLOv5 model. Compared with the YOLOv3 and YOLOv4 models, the detection speed of the YOLOv5 model is faster, which is more suitable for the scene of identity recognition such as access control system, so as to ensure the user identity recognition efficiency and avoid causing traffic congestion. Moreover, compared with the YOLOv3 and YOLOv4 models, the YOLOv5 model has a very light model size, which is more suitable for devices with lower hardware configuration such as access control system, and does not cause additional burden on the operation capacity of the device. In terms of accuracy, the YOLOv5 model may not be as good as the YOLOv3 model, but since the first palm region extracted by the palm detection model is used for camera exposure adjustment, it is only required to ensure that the first palm region extracted can cover most of the real palm region in the palm image, and the detection accuracy of the YOLOv5 model is sufficient. Therefore, the YOLOv5 model is selected as the palm detection model in this embodiment from the aspects of detection speed, model size and detection accuracy.
[0074] In this embodiment, Figure 2 is the network structure diagram of the YOLOv5 model provided by the embodiment of the application. As shown in Figure 2As shown, the YOLOv5 model includes a convolutional neural network, a path aggregation network, and a YOLO layer. The convolutional neural network serves as the backbone network of the YOLOv5 model, which is composed of Focus, Conv (Convolutional Layer), BottleneckCSP (Bottleneck CrossStage Partial Network), and SPP (Spatial Pyramid Pooling). The path aggregation network serves as the neck network of the YOLOv5 model, which is composed of BottleneckCSP, Conv, UpSample (up-sampling), and Concat (Concatenate Function). The YOLO layer serves as the head network of the YOLOv5 model, which is composed of three convolutional layers (Conv). As an example, Figure 3 is a flowchart of detecting a first palm region in a palm image based on a palm detection model provided by an embodiment of the present application. As shown in Figure 3 The step of detecting the first palm region in the palm image based on the palm detection model specifically includes S1101-S1104:
[0075] S1101, adjust the palm image to a preset size, and input the adjusted palm image into a convolutional neural network to obtain a first feature image output by the convolutional neural network.
[0076] In an embodiment, the preset size is 96x96 pixels. As an example, a camera captures a palm image of 1440x1080 pixels, compresses the palm image to 96x96 pixels, and then inputs the palm image into the trained convolutional neural network. Compared with the input image size of 640x640 of the traditional YOLOv5 model, the input image size of the YOLOv5 model is set to 96x96 in the present embodiment, so as to reduce the operation scale of the model, shorten the model detection time, and improve the model detection efficiency.
[0077] Reference Figure 2After the palm image is adjusted to the preset size, an input image with a size of 96x96x3 is obtained, the input image is input into the Focus module, the height and width of the input image are reduced through slicing of the Focus module, an image with a size of 48x48 is output, and the number of image channels is increased to 64, that is, the Focus module outputs an image with a size of 48x48x64. The image with a size of 48x48x64 is input into the Conv module, the Conv module performs convolution on the image with a size of 48x48x64, and an image with a size of 24x24x128 is output. After the image with a size of 24x24x128 is subjected to convolution operation of the first group of BottleneckCSP modules and the Conv module, an image with a size of 12x12x256 is obtained; after the image with a size of 12x12x256 is subjected to convolution operation of the second group of BottleneckCSP modules and the Conv module, an image with a size of 6x6x512 is obtained; after the image with a size of 6x6x512 is subjected to convolution operation of the third group of BottleneckCSP modules and the Conv module, a feature map with a size of 3x3x1024 is obtained. The SPP module is used for the feature map with a size of 4x4 to improve the model precision. The SPP module performs a total of four maximum pooling operations of 1*1, 5*5, 9*9 and 13*13 on the image to extract features from multiple aspects, and then aggregates four groups of feature maps after the pooling to output an image with a size of 3x3x1024. The image with a size of 12x12x256 output by the second group of BottleneckCSP modules, the image with a size of 6x6x512 output by the third group of BottleneckCSP modules, and the image with a size of 3x3x1024 output by the SPP module are taken as the first feature image output by the convolutional neural network.
[0078] S1102, input the first feature image into the path aggregation network to obtain a second feature image output by the path aggregation network.
[0079] Reference Figure 2The 3x3x1024 first feature image output by the convolutional neural network is subjected to convolution operation through the fourth group of BottleneckCSP modules and Conv modules to obtain a 3x3x512 image, the 3x3x512 image is up-sampled to obtain a 6x6x512 image. The 6x6x512 image is aggregated with the 6x6x512 first feature image output by the convolutional neural network through a Concat module to obtain a 6x6x1024 image. The 6x6x1024 image is subjected to convolution operation through the fifth group of BottleneckCSP modules and Conv modules to obtain a 6x6x256 image, the 6x6x256 image is up-sampled to obtain a 12x12x256 image. The 12x12x256 image is aggregated with the 12x12x256 first feature image output by the convolutional neural network through a Concat module to obtain a 12x12x512 image. The 12x12x512 image is subjected to convolution operation through the sixth group of BottleneckCSP modules and Conv modules to obtain a 6x6x256 image. The 6x6x256 image is aggregated with the 6x6x256 image output by the fifth group of Conv modules through a Concat module to obtain a 6x6x512 image. The 6x6x512 image is subjected to convolution operation through the seventh group of BottleneckCSP modules and Conv modules to obtain a 3x3x512 image. The 3x3x512 image is aggregated with the 3x3x512 image output by the fourth group of Conv modules through a Concat module to obtain a 3x3x1024 image. The 3x3x1024 image is input into the independent BottleneckCSP module to obtain a 3x3x1024 image output by the independent BottleneckCSP module. The 12x12x512 image output by the sixth group of BottleneckCSP modules, the 6x6x512 image output by the seventh group of BottleneckCSP modules, and the 3x3x1024 image output by the independent BottleneckCSP module are taken as the second feature image output by the path aggregation network.
[0080] In S1103, the second feature image is input into the YOLO layer to obtain anchor box coordinates output by the YOLO layer.
[0081] Reference Figure 2The 12x12x512 second feature image output by the path aggregation network is input into the first convolutional layer to obtain a 12x12x1 feature map output by the first convolutional layer. The 6x6x512 second feature image output by the path aggregation network is input into the second convolutional layer to obtain a 6x6x1 feature map output by the second convolutional layer. The 3x3x1024 second feature image output by the path aggregation network is input into the third convolutional layer to obtain a 3x3x1 feature map output by the third convolutional layer. The feature maps output by the first convolutional layer, the second convolutional layer and the third convolutional layer are connected through a Concat module to obtain a 1x189x6 prediction result, which includes anchor box coordinates in xywh format.
[0082] In this embodiment, when the preset size is 96x96 pixels, the anchor box sizes of the palm detection model include [27, 29], [33, 40] and [42, 46]. The [27, 29], [33, 40] and [42, 46] are all one-dimensional arrays, the element values 27 and 29 in the one-dimensional array [27, 29] are the anchor box sizes on the feature map output by the first convolutional layer, the element values 33 and 40 in the one-dimensional array [33, 40] are the anchor box sizes on the feature map output by the second convolutional layer, and the element values 42 and 46 in the one-dimensional array [42, 46] are the anchor box sizes on the feature map output by the third convolutional layer. It can be understood that, in this embodiment, the preset size is set to 96x96 pixels, and the anchor box sizes are adaptively adjusted to enable the anchor box to accurately detect the palm region in the palm image of the preset size, so as to obtain better palm region detection.
[0083] In an embodiment, the channel numbers of the three convolutional layers of the YOLO layer are 24, 48 and 96, respectively. For example, the channel number of the first convolutional layer is 24, the channel number of the second convolutional layer is 48, and the channel number of the third convolutional layer is 96. It can be understood that, when the channel numbers of the convolutional layers of the YOLO layer are reduced, the convolution operation of the convolutional layer on the input image is simplified, the processing time of the YOLO layer is accelerated, and the detection efficiency of the overall palm detection model is improved.
[0084] In an embodiment, the network depth gain of the palm detection model is 0.33, and the convolution channel gain of the palm detection model is 0.09. For example, assuming that the network depth gain is 1, the network parameters of the first group of BottleneckCSP modules in the convolutional neural network are [-1, 6, CSP,
[256] ], and the network depth gain is set to 0.33, the network parameters of the first group of BottleneckCSP modules in the convolutional neural network are [-1, 2, CSP,
[256] ], that is, the network depth of the first group of BottleneckCSP modules is reduced by 3 times. Assuming that the network parameters of the Conv module are [-1, 1, SPPF, [1024, 5]] when the convolution channel gain is 1, and the convolution channel gain is set to 0.09, the network parameters of the Conv module are [-1, 1, SPPF, [93, 5]], that is, the channel number of the Conv module is reduced by about 11 times. It can be understood that, by setting the network depth gain to 0.33 and the convolution channel gain to 0.09, the parameters of the entire network of the palm detection model are reduced, thereby simplifying the operation complexity of the palm detection model, shortening the detection time of the palm detection model, and improving the detection efficiency of the palm detection model.
[0085] It should be noted that experimental tests show that if the network depth gain of the palm detection model and the convolution channel gain are set to 0.33 and 0.09 respectively, and the channel numbers of the three convolution layers of the YOLO layer are set to 24, 48 and 96 respectively, the model detection time can be shortened to within 20ms. Compared with the nano version with the simplest structure in the YOLOv5 model, the palm detection model in the embodiment reduces the parameters by more than 85.8%, and the number of floating point operations is also reduced by 82.5%, that is, the detection efficiency of the palm detection model in the embodiment is much higher than that of the YOLOv5 nano version.
[0086] On the basis of the above embodiments, Figure 4 is a flowchart of training a palm detection model provided by the embodiments of the present application. As shown in Figure 4 , the steps of training the palm detection model specifically include S210-S240:
[0087] S210, obtaining a training sample set, the training sample set including positive sample images and negative sample images.
[0088] For example, images containing palm regions and images not containing palm regions are collected, and the palm regions in the images are manually marked by anchor boxes to obtain positive sample images, and images not containing palm regions are used as negative sample images.
[0089] S220, inputting the positive sample image or the negative sample image into the palm detection model to obtain a detection result output by the palm detection model.
[0090] Exemplarily, the positive sample image or the negative sample image is input into the untrained YOLOv5 model to obtain anchor box coordinates output by the YOLOv5.
[0091] S230, determining a loss value according to the detection result, a labeled region of the corresponding sample image, and a preset intersection-over-union ratio.
[0092] Preferably, the preset intersection-over-union ratio is equal to 0.85.
[0093] Exemplarily, according to the anchor box coordinates output by the YOLOv5 and the anchor box coordinates labeled according to the input positive sample image or negative sample image, the overlapping area and the non-overlapping area of the labeled anchor box and the predicted anchor box of the YOLOv5 model are calculated. The overlapping area, the non-overlapping area, and the preset intersection-over-union ratio are substituted into a preset loss function to obtain the loss value. The expression of the loss function is as follows:
[0094]
[0095] wherein, L GIoU is the loss value, IoU is the intersection-over-union ratio, A c is the overlapping area, and U is the non-overlapping area.
[0096] In this embodiment, the preferred intersection-over-union ratio is 0.85, indicating that the overlapping degree of the palm region output by the palm detection model and the real palm region in the image exceeds 85%. After testing the test set, the accuracy of the palm detection model is more than 95.3% when the intersection-over-union ratio is set to 0.85, and the accuracy of 95.3% and the real palm region of 85% are sufficient to ensure the accuracy of the estimated palm region brightness in this embodiment.
[0097] S240, adjusting the parameters of the palm detection model according to the loss value.
[0098] Exemplarily, the parameters of each network in the palm detection model are adjusted according to the loss value. Then, the new sample image is input into the palm detection model with the adjusted parameters, and the palm detection model is trained again until the parameters of the palm detection model converge or the training times reach the upper limit, to obtain the trained palm detection model.
[0099] S1104, mapping the anchor box coordinates to the palm image to determine a first palm region in the palm image.
[0100] Exemplarily, the anchor box coordinates are magnified and mapped to the palm image according to the ratio of the size of the palm image to the preset size to obtain the first palm region in the palm image.
[0101] S120, in a case where it is determined that the target brightness value of the first palm region does not satisfy the preset brightness range, adjusting exposure of the camera according to the target brightness value, and capturing a next palm image by the camera.
[0102] In the embodiment, the preset brightness range can be understood as a brightness range of the first palm region of the palm image when the palm vein feature can be accurately extracted from the palm image. The embodiment is described by taking the target brightness value as the average brightness value. When the average brightness value exceeds the preset brightness range, it indicates that the brightness of the first palm region is too large or too small, i.e., the palm vein feature cannot be accurately extracted from the palm image; when the average brightness value is in the preset brightness range, it indicates that the brightness of the first palm region is appropriate, i.e., the palm vein feature can be accurately extracted from the palm image.
[0103] Correspondingly, when the average brightness value exceeds the preset brightness range, the exposure of the current camera is adjusted according to the average brightness value, so that the average brightness value of the first palm region of the next palm image captured by the camera is in or close to the preset brightness range, and the exposure adjustment speed is improved. In the embodiment, Figure 5 is a flowchart of adjusting the exposure of the camera provided by the embodiment. As shown in Figure 5 , the step of adjusting the exposure of the camera specifically includes S1201-S1202:
[0104] S1201, determining the expected brightness value according to the preset brightness range.
[0105] For example, the preset brightness range is [80, 140], and the expected brightness value is 110.
[0106] S1202, determining the expected exposure value based on the preset exposure value calculation formula, and adjusting the exposure of the camera to the expected exposure value.
[0107] In the embodiment, the exposure value calculation formula is
[0108] E n = E o *(1+Gap*ratio)
[0109] wherein, E n is the expected exposure value, and E oThe Gap is the difference between the target brightness value and the expected brightness value; and the ratio is a constant parameter. It should be noted that the ratio can represent the mapping relationship between the image brightness change difference and the camera exposure change multiple, which can be determined through a large amount of experimental data. In order to adjust the image brightness from the current to the expected brightness, the difference between the current image brightness and the expected brightness value Gap is the image brightness change difference, and Gap*ratio can represent the multiple of the camera exposure change. The sum of the current camera exposure value multiplied by the multiple and 1 is the camera exposure value that can capture the palm image with the average brightness value in or close to the preset brightness range.
[0110] It should be noted that after adjusting the camera exposure value, the next palm image is captured by the camera, and the first palm region is identified from the palm image, and it is judged whether the target brightness value of the first palm region meets the preset brightness range. If not, adjust the exposure again and capture the palm image until the camera captures the effective palm image that can accurately extract the palm vein features. Since the camera adjusts the exposure based on the brightness value of the first palm region of the palm image, the user's hand posture remains unchanged, so the palm region in the palm image before and after exposure adjustment is the same. When the camera exposure is adjusted based on the brightness of the first palm region in the palm image before exposure adjustment, the brightness of the corresponding palm region in the palm image after exposure adjustment will be in or close to the preset brightness range. Therefore, after one or two exposure adjustments, it is highly probable to capture an effective palm image, and the efficiency of capturing the effective palm image is relatively high. Since the detection time of the palm detection model is short, the acquisition speed of the effective palm image is fast, and the user does not need to adjust the hand posture, which greatly improves the user's experience.
[0111] S130, in the case where it is determined that the target brightness value of the first palm region meets the preset brightness range, a second palm region is identified from the palm image.
[0112] Exemplarily, when the target brightness value of the palm image meets the preset brightness range, it indicates that the palm vein features can be accurately extracted from the palm image, and therefore the second palm region can be detected from the palm image. It should be noted that the second palm region is extracted from the palm image by a detection model more accurate than the above-mentioned palm detection model, to ensure that the real palm region in the palm image can be accurately determined.
[0113] S140, extracting the palm vein features from the second palm region to determine the corresponding identity information according to the palm vein features.
[0114] Exemplarily, the palm vein features extracted from the second palm region are compared with the palm vein features of each user pre-stored in the database, and when it is determined that the database stores the matching palm vein features, it is determined that the user is a community resident and the community gate is opened.
[0115] In summary, the palm vein recognition method provided by the embodiments of the present application can quickly detect the first palm region in the palm image through the palm detection model. In the case that the target brightness value of the first palm region meets the preset brightness range, it can be determined that the palm vein features can be accurately extracted from the palm image. Therefore, the second palm region can be detected from the palm image, and the palm vein features can be extracted from the second palm region to determine the corresponding user identity according to the palm vein features. In the case that the target brightness value of the first palm region does not meet the preset brightness range, it can be determined that the palm vein features cannot be accurately extracted from the palm image. Therefore, the exposure value of the camera can be adjusted according to the target brightness value of the first palm region to make the camera capture the palm image from which the palm vein features can be accurately extracted as soon as possible. Through the above technical means, after the camera captures the invalid palm image, the exposure of the camera is adjusted according to the target brightness value of the palm region of the palm image, so that the camera can capture the valid palm image in a short time. Without the user adjusting the hand posture, a palm image with appropriate brightness can be captured, the acquisition time of the valid palm image is shortened, and the user experience is improved. The palm vein recognition is performed on the valid palm image to determine the user identity, which improves the palm vein recognition efficiency and recognition accuracy, and solves the problem of long time required for palm vein recognition in the prior art.
[0116] On the basis of the above embodiments, Figure 6 is a structural schematic diagram of a palm vein recognition device provided by an embodiment of the present application. Referring to Figure 6 The palm vein recognition device provided by the embodiment specifically includes a first palm detection module 31, an exposure adjustment module 32, a second palm detection module 33, and a palm vein recognition module 34.
[0117] The first palm detection module 31 is configured to capture a palm image through a camera and identify a first palm region from the palm image through a pre-trained palm detection model.
[0118] The exposure adjustment module 32 is configured to adjust the exposure of the camera according to the target brightness value in the case that the target brightness value of the first palm region does not meet the preset brightness range, and capture the next palm image through the camera.
[0119] The second palm detection module 33 is configured to identify a second palm region from the palm image in the case that the target brightness value of the first palm region meets the preset brightness range.
[0120] The palm vein recognition module 34 is configured to extract palm vein features from the second palm region to determine the corresponding identity information according to the palm vein features.
[0121] On the basis of the above-mentioned embodiment, the palm detection model is a YOLOv5 model, the YOLOv5 model comprises a convolutional neural network, a path aggregation network and a YOLO layer; correspondingly, the first palm detection module comprises:
[0122] The first feature extraction unit is configured to adjust the palm image to a preset size, and input the adjusted palm image into the convolutional neural network to obtain a first feature image output by the convolutional neural network;
[0123] The second feature extraction unit is configured to input the first feature image into the path aggregation network to obtain a second feature image output by the path aggregation network;
[0124] The target detection unit is configured to input the second feature image into the YOLO layer to obtain anchor box coordinates output by the YOLO layer;
[0125] The coordinate mapping unit is configured to map the anchor box coordinates into the palm image to determine a first palm region in the palm image.
[0126] On the basis of the above-mentioned embodiment, the preset size is 96x96, and the anchor box size of the palm detection model comprises [27, 29], [33, 40] and [42, 46].
[0127] On the basis of the above-mentioned embodiment, the YOLO layer comprises three convolutional layers, and the channel numbers of the three convolutional layers are 24, 48 and 96 respectively.
[0128] On the basis of the above-mentioned embodiment, the network depth gain of the palm detection model is 0.33, and the convolutional channel gain of the palm detection model is 0.09.
[0129] On the basis of the above-mentioned embodiment, the palm vein recognition device further comprises a training module, the training module comprises:
[0130] The sample acquisition unit is configured to acquire a training sample set, the training sample set comprising positive sample images and negative sample images;
[0131] The sample prediction unit is configured to input the positive sample image or the negative sample image into the palm detection model to obtain a detection result output by the palm detection model;
[0132] The loss value determination unit is configured to determine a loss value according to the detection result, a labeled region of the corresponding sample image and a preset intersection over union;
[0133] The parameter adjustment unit is configured to adjust the parameters of the palm detection model according to the loss value.
[0134] On the basis of the above-mentioned embodiment, the exposure adjustment module comprises:
[0135] The expected brightness determination unit is configured to determine an expected brightness value according to a preset brightness range;
[0136] The expected exposure determination unit is configured to determine an expected exposure value based on a preset exposure value calculation formula, and adjust the exposure of the camera to the expected exposure value; the exposure value calculation formula is:
[0137] E n = E o *(1+Gap*ratio)
[0138] wherein, E n is the expected exposure value, E o is the current exposure value of the camera, Gap is the difference between the target brightness value and the expected brightness value; ratio is a constant parameter.
[0139] In summary, the palm vein recognition device provided by the embodiments of the present application can quickly detect the first palm region in the palm image through the palm detection model. In the case that the target brightness value of the first palm region meets the preset brightness range, it can be determined that the palm vein features can be accurately extracted from the palm image. Therefore, the second palm region can be detected from the palm image, and the palm vein features can be extracted from the second palm region to determine the corresponding user identity according to the palm vein features. In the case that the target brightness value of the first palm region does not meet the preset brightness range, it can be determined that the palm vein features cannot be accurately extracted from the palm image. Therefore, the exposure value of the camera can be adjusted according to the target brightness value of the first palm region to make the camera quickly capture the palm image from which the palm vein features can be accurately extracted. Through the above technical means, after the camera captures the invalid palm image, the exposure of the camera is adjusted according to the target brightness value of the palm region of the palm image, so that the camera can capture the valid palm image in a short time. Without the user adjusting the hand posture, a palm image with appropriate brightness can be captured, the acquisition time of the valid palm image is shortened, and the user experience is improved. The palm vein recognition is performed on the valid palm image to determine the user identity, which improves the palm vein recognition efficiency and recognition accuracy, and solves the problem of long time required for palm vein recognition in the prior art.
[0140] The palm vein recognition device provided by the embodiments of the present application comprises a processor 41, a memory 42, a communication device 43, an input device 44 and an output device 45. Figure 7 The number of processors in the palm vein recognition device can be one or more, and the number of memories in the palm vein recognition device can be one or more. The processor, the memory, the communication device, the input device and the output device of the palm vein recognition device can be connected through a bus or other means.
[0141] The memory 42, as a computer readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules of the palm vein recognition method according to any embodiment of the present application (for example, the first palm detection module 31, the exposure adjustment module 32, the second palm detection module 33 and the palm vein recognition module 34 in the palm vein recognition device). The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and application programs required by at least one function; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0142] The communication device 43 is used for data transmission.
[0143] The processor 41 executes various function applications and data processing of the device by running the software programs, instructions and modules stored in the memory, that is, implements the palm vein recognition method described above.
[0144] The input device 44 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 45 can include a display device such as a display screen.
[0145] The palm vein recognition device provided above can be used to execute the palm vein recognition method provided in the above embodiments, and has corresponding functions and beneficial effects.
[0146] The embodiment of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute a palm vein recognition method, the palm vein recognition method comprising: capturing a palm image through a camera, and identifying a first palm region from the palm image through a pre-trained palm detection model; in a case where a target brightness value of the first palm region does not satisfy a preset brightness range, adjusting exposure of the camera according to the target brightness value, and capturing a next palm image through the camera; in a case where the target brightness value of the first palm region satisfies the preset brightness range, identifying a second palm region from the palm image; extracting palm vein features from the second palm region to determine corresponding identity information according to the palm vein features.
[0147] Storage medium - any type of memory device or storage device. The term "storage medium" is intended to include an installation medium, e.g., a CD-ROM, floppy disks, or tape apparatus; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; or a non-volatile memory such as a magnetic medium (e.g., a hard drive or optical storage); registers or other similar types of memory elements, etc. The memory medium can also include other types of storage medium and combinations thereof. In addition, the memory medium can reside in a first computer system's internal storage or external storage that is connected to the first computer system. The first computer system can also provide the program instructions to a second computer system for execution. The term "storage medium" can also include two or more memory mediums that reside in different locations, e.g., in different computer systems that are connected over a network such as the Internet. The memory medium can store program instructions that implement one or more of the methods described herein (e.g., as a computer program).
[0148] Of course, the storage medium provided by the embodiments of the present application includes computer executable instructions, and the computer executable instructions are not limited to the palm vein recognition method described above, but can also perform the related operations in the palm vein recognition method provided by any of the embodiments of the present application.
[0149] The palm vein recognition device, the apparatus and the storage medium provided in the above embodiments can execute the palm vein recognition method provided by any of the embodiments of the present application, and the technical details not described in detail in the above embodiments can be referred to the palm vein recognition method provided by any of the embodiments of the present application.
[0150] The above are only the preferred embodiments of the present application and the technical principles applied. The present application is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments and replacements made by those skilled in the art will not deviate from the protection scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without deviating from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A method of palm vein recognition, characterized by, The method comprises the following steps: An image of a palm is captured by a camera, and a first palm region is identified from the image of the palm by a pre-trained palm detection model, the palm detection model being a YOLOv5 model, and an input size of the YOLOv5 model being 96x96; In a case where the target brightness value of the first palm region does not satisfy the preset brightness range, adjusting exposure of the camera according to the target brightness value, and capturing a next palm image by the camera; wherein the adjusting exposure of the camera according to the target brightness value comprises: determining an expected brightness value according to the preset brightness range; determining an expected exposure value based on a preset exposure value calculation formula, and adjusting the exposure of the camera to the expected exposure value; the exposure value calculation formula is: , is the expected exposure value, is a current exposure value of the camera, is a difference value between the target brightness value and the expected brightness value; is a constant parameter; In a case where a target brightness value of the first palm region meets a preset brightness range, a second palm region is identified from the image of the palm, the second palm region being detected by a detection model having higher accuracy than the palm detection model; Palm vein features are extracted from the second palm region, so as to determine corresponding identity information according to the palm vein features.
2. The method of claim 1, wherein, The YOLOv5 model comprises a convolutional neural network, a path aggregation network and a YOLO layer. Correspondingly, the first palm region is identified from the image of the palm by the pre-trained palm detection model, which comprises the following steps: The image of the palm is adjusted to a preset size, and the adjusted image of the palm is input into the convolutional neural network to obtain a first feature image output by the convolutional neural network; The first feature image is input into the path aggregation network to obtain a second feature image output by the path aggregation network; The second feature image is input into the YOLO layer to obtain anchor box coordinates output by the YOLO layer; The anchor box coordinates are mapped to the image of the palm to determine the first palm region in the image of the palm.
3. The method of claim 2, wherein, Anchor box sizes of the palm detection model comprise [27, 29], [33, 40] and [42, 46].
4. The method of claim 2, wherein, The YOLO layer comprises three convolutional layers, and channel numbers of the three convolutional layers are 24, 48 and 96 respectively.
5. The method of claim 2, wherein, A network depth gain of the palm detection model is 0.33, and a convolutional channel gain of the palm detection model is 0.
09.
6. The method of claim 2, wherein, Before the image of the palm is captured by the camera, the method further comprises the following steps: A training sample set is obtained, the training sample set comprising positive sample images and negative sample images; The positive sample images or the negative sample images are input into the palm detection model to obtain detection results output by the palm detection model; A loss value is determined according to the detection results, labeled regions of corresponding sample images and a preset intersection over union; Parameters of the palm detection model are adjusted according to the loss value.
7. A palm vein identification device, characterized by comprising: The method comprises the following steps: A first palm detection module is configured to capture an image of a palm by a camera, and identify a first palm region from the image of the palm by a pre-trained palm detection model, the palm detection model being a YOLOv5 model, and an input size of the YOLOv5 model being 96x96; The exposure adjustment module is configured to adjust the exposure of the camera according to the target brightness value of the first palm region and capture a next palm image by the camera in a case where the target brightness value of the first palm region does not satisfy the preset brightness range. The exposure adjustment module comprises: an expected brightness determination unit configured to determine an expected brightness value according to the preset brightness range; and an expected exposure determination unit configured to determine an expected exposure value based on a preset exposure value calculation formula and adjust the exposure of the camera to the expected exposure value. The exposure value calculation formula is: , is the expected exposure value, is a current exposure value of the camera, is a difference between the target brightness value and the expected brightness value; and is a constant parameter. A second palm detection module is configured to identify a second palm region from the image of the palm in a case where a target brightness value of the first palm region meets a preset brightness range, the second palm region being detected by a detection model having higher accuracy than the palm detection model; A palm vein identification module is configured to extract palm vein features from the second palm region, so as to determine corresponding identity information according to the palm vein features.
8. A palm vein identification device, characterized by, The method comprises the following steps: A memory and one or more processors; The memory is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the palm vein identification method as claimed in any one of claims 1-6.
9. A storage medium containing computer-executable instructions, wherein: The computer executable instructions, when executed by a computer processor, perform the palm vein identification method as claimed in any one of claims 1-6.
Citation Information
Patent Citations
Illumination processing method and apparatus for human face identification, computer device and storage medium
CN108197546A
Video registration method and device based on non-contact palm vein image
CN112183504A
Identity recognition method and device, terminal and storage medium
CN114092974A