Elderly face recognition method, device, equipment and storage medium
By introducing a multi-scale information input module, a global adaptive feature extraction module and a pixel attention mechanism into the YOLOv7 network architecture, the problem of low facial recognition accuracy in the elderly is solved, and accurate recognition of the faces of the elderly is achieved.
Patent Information
- Application Number
- CN202411687083.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-08
AI Technical Summary
The existing face recognition algorithm has low accuracy when recognizing faces in the elderly, making it difficult to effectively deal with wrinkles and other inherent features of the elderly's faces, resulting in problems of errors in recognition and low accuracy.
The multi-scale information input module based on the YOLOv7 network architecture is adopted, combined with the global adaptive feature extraction module and the pixel attention mechanism, the global and subtle features of the elderly face are extracted, and the network model is optimized through the target loss function to improve the recognition accuracy.
It realizes accurate recognition of faces for the elderly, improves recognition accuracy and stability, and is suitable for actual face recognition scenarios for the elderly.
Smart Images

Figure CN119785392A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition technology, and in particular to a method, device, equipment and storage medium for elderly face recognition. Background Art
[0002] Face recognition algorithms have been studied for a long time. In the case of simple background, most algorithms can handle it well. However, the application range of face recognition is quite wide. Simple image testing alone is far from meeting the actual needs. Therefore, there are still many difficulties in face recognition algorithms. For example, with the change of age, the facial appearance is also changing, especially for the elderly. Compared with the middle-aged period, the change of facial appearance may cause the recognition rate of face algorithms to decrease. Face recognition algorithms include two stages: face detection and face matching. Among them, the face detection stage mainly predicts whether a face exists and locates it based on statistical methods, while the face matching stage determines whether the target face exists in the existing data. In recent years, with the rapid development of artificial intelligence technology, a large number of scholars have proposed face recognition algorithms based on deep learning frameworks. The mainstream algorithms include network models based on single-step regression and network frameworks based on two-step candidates. Among them, the face recognition algorithm based on two-step has higher stability, but compared with the single-step algorithm, it takes longer to operate and has lower work efficiency. The single-step network framework is mainly represented by the YOLO (You Only Look Once) series. Compared with the two-step network, the face recognition algorithm based on the single-step regression network model has a short operation time and high efficiency. In addition, since the single-step network integrates the face detection and recognition stages, it maintains the consistency of the algorithm operation to a certain extent, avoiding problems such as feature loss due to improper algorithm connection.
[0003] In addition to the above algorithms, a large number of researchers have also proposed different facial recognition algorithms for specific scenarios. Although facial recognition algorithms for specific scenarios are more accurate than universal algorithms in practical applications, there are very few existing algorithms that are applied to elderly scenarios. In addition, since the elderly have more wrinkles on their faces, the wrinkles are different in different expressions or states, and compared with young faces, they also have fixed features such as large eyelid bags and shriveled faces, making it difficult for existing facial recognition algorithms to guarantee accuracy. And in the context of the accelerated aging of the population, the solution to this problem is imminent. In addition, the existing facial recognition algorithms ignore the inherent characteristics of the elderly's faces, resulting in low accuracy or recognition errors when applied to elderly scenes. Therefore, how to achieve accurate recognition of the elderly's faces is a problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for elderly face recognition, which can realize accurate recognition of elderly faces. The specific scheme is as follows:
[0005] In the first aspect, the present application discloses a method for face recognition of the elderly, comprising:
[0006] Inputting the image to be detected into the target network model, and extracting the facial features of the image to be detected using the multi-scale information input module of the target network model; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes;
[0007] Using the global adaptive feature extraction module in the backbone network of the target network model to perform a global adaptive feature extraction operation on the facial features to obtain processed features; the global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size;
[0008] Based on the pixel attention mechanism, the feature enhanced attention module is used to perform feature processing on the processed features to obtain the target features, and the face recognition result of the elderly person in the image to be detected is determined based on the target loss function, the target features and the target network model.
[0009] Optionally, the extracting facial features of the image to be detected by using the multi-scale information input module of the target network model includes:
[0010] Using each convolution unit in the multi-scale information input module of the target network model to collect subtle facial features of the image to be detected and increase the receptive field to obtain scale feature information of the image to be detected;
[0011] The Concat operation is used to concatenate feature information of each scale by increasing the number of channels to obtain the facial features of the image to be detected.
[0012] Optionally, the utilizing the global adaptive feature extraction module in the backbone network of the target network model to perform a global adaptive feature extraction operation on the facial features to obtain processed features includes:
[0013] Using the global adaptive feature extraction module in the backbone network of the target network model to perform an average pooling operation on the facial features to obtain average pooled features;
[0014] The average pooled features are processed using a ReLU activation function and a Sigmoid activation function to obtain processed features.
[0015] Optionally, the pixel-based attention mechanism uses a feature enhancement attention module to perform feature processing on the processed features to obtain target features, including:
[0016] Using a feature enhancement attention module to perform a maximum pooling operation and a convolution and normalization operation on the processed features to obtain a first feature;
[0017] Processing the subtle features corresponding to the processed features based on the pixel attention mechanism to obtain a second feature;
[0018] The target feature is determined according to the first feature and the second feature.
[0019] Optionally, before determining the elderly face recognition result of the image to be detected based on the target loss function, the target feature and the target network model, the method further includes:
[0020] The target loss function is determined according to the EIoU loss function and the geometric properties of the bounding box.
[0021] Optionally, determining the elderly face recognition result of the image to be detected based on the target loss function, the target feature and the target network model includes:
[0022] Optimizing the target network model using the target loss function to obtain an optimized network model;
[0023] The face recognition result of the elderly person in the image to be detected is determined based on the target features according to the optimized network model.
[0024] In a second aspect, the present application discloses a face recognition device for the elderly, comprising:
[0025] A facial feature extraction module is used to input the image to be detected into the target network model, and extract the facial features of the image to be detected by using the multi-scale information input module of the target network model; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes;
[0026] A feature processing module, used to perform a global adaptive feature extraction operation on the facial features using the global adaptive feature extraction module in the backbone network of the target network model to obtain processed features; the global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size;
[0027] The recognition result determination module is used to perform feature processing on the processed features using a feature enhancement attention module based on a pixel attention mechanism to obtain target features, and determine the face recognition result of the elderly person in the image to be detected based on a target loss function, the target features and the target network model.
[0028] Optionally, the facial feature extraction module includes:
[0029] A scale feature information unit, used to collect subtle facial features of the image to be detected and increase the receptive field by using each convolution unit in the multi-scale information input module of the target network model, so as to obtain scale feature information of the image to be detected;
[0030] The facial feature acquisition unit is used to perform feature splicing on the feature information of each scale by increasing the number of channels through a Concat operation to obtain the facial features of the image to be detected.
[0031] In a third aspect, the present application discloses an electronic device, comprising:
[0032] Memory, used to store computer programs;
[0033] A processor is used to execute the computer program to implement the aforementioned method for recognizing faces of the elderly.
[0034] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned elderly face recognition method.
[0035] When identifying the face of an elderly person, the present application first inputs the image to be detected into the target network model, and uses the multi-scale information input module of the target network model to extract the face features of the image to be detected; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes; then the global adaptive feature extraction module in the backbone network of the target network model is used to perform global adaptive feature extraction operations on the face features to obtain processed features; the global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size; finally, based on the pixel attention mechanism, the feature enhancement attention module is used to perform feature processing on the processed features to obtain target features, and the elderly face recognition result of the image to be detected is determined based on the target loss function, the target features and the target network model. It can be seen that the present application is based on the YOLOv7 algorithm. First, a multi-scale information input module is proposed to extract the global information of the image and improve the information utilization rate; secondly, the face features of the elderly are summarized and summarized, a global adaptive feature extraction module is proposed, and the backbone network and the detection head are improved in combination with the attention mechanism to improve stability. Finally, the network is trained through transfer learning method, and the loss function is added to assign feature weights, while the parameters are continuously adjusted to improve the network recognition ability. Thus, accurate recognition of the elderly face is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0037] Figure 1 A flow chart of a method for face recognition of the elderly disclosed in this application;
[0038] Figure 2 A schematic diagram of a YOLOv7 algorithm flow chart disclosed in this application;
[0039] Figure 3 This is a schematic diagram of the structure of a face recognition device for the elderly disclosed in this application;
[0040] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] At present, there are few AI-based face recognition algorithms for the elderly, and the existing face recognition algorithms ignore the inherent characteristics of the elderly's faces, resulting in low accuracy or recognition errors when applied to elderly scenes. In order to solve the above technical problems, this application discloses a face recognition method, device, equipment and storage medium for the elderly, which can realize accurate recognition of the elderly's faces.
[0043] See also Figure 1 As shown, the embodiment of the present invention discloses a method for face recognition of the elderly, comprising:
[0044] Step S11, inputting the image to be detected into the target network model, and using the multi-scale information input module of the target network model to extract the facial features of the image to be detected; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes.
[0045] In this embodiment, the image to be detected is first input into the target network model, where the target network model is a network model based on the YOLOv7 network architecture. Among them, YOLOv7 is one of the newer networks and is widely used in various detection and recognition tasks due to its advantages such as fast speed and high accuracy. Compared with other networks in the YOLO series, YOLOv7 has a similar design concept to YOLOv4 and YOLOv5. The process is as follows Figure 2As shown. When the detection image is input to the network, the input module first modifies the image size and transmits it to the backbone network. Secondly, the backbone network mainly includes MPConv (MaxpoolingConvolution), E-ELAN (Extended Efficient Layer AggregationNetWork) and SPPCSPC (Spatial Pyramid Pooling and ChannelSpatial Pyramid Convolution) modules. The MPConv module is used to reduce the number of parameters and calculations of the network and improve its generalization ability; the E-ELAN module is used to control the gradient path of the network and enhance the network learning ability; the SPPCSPC module can increase the receptive field and solve the problem of image feature duplication. Finally, the detection head fuses feature information at different levels, adjusts the channels of features at different scales, and outputs the processing results.
[0046] However, the wrinkles on the faces of the elderly are more numerous, and the wrinkles under different expressions or states are also different. In addition, compared with the faces of young people, there are also fixed features such as large eyelid bags and shrunken faces, which makes it difficult for existing face recognition algorithms to ensure accuracy. To this end, this application proposes a multiscale information input module (MIIM) to extract the global spatial features of the face. The convolution units in the multiscale information input module of the target network model are used to collect the subtle features of the face of the image to be detected and increase the receptive field to obtain the scale feature information of the image to be detected; the Concat operation is used to splice the features of each scale feature information by increasing the number of channels to obtain the face features of the image to be detected. The specific operation is: use a 1x1 convolution unit to collect subtle facial features, and a 7x7 convolution unit to expand the receptive field and grasp the overall facial features. In addition, when two 3x3 convolution units are connected in series, the receptive field is the same as that of a 5x5 convolution unit, and the number of parameters is small. In addition, when two 3x3 convolution units are connected in series, the receptive field is the same as that of a 5x5 convolution unit, and the number of parameters is small. Therefore, considering the lightweight of the network, two 3x3 convolution units are used instead of 5x5 convolution units, which can not only further extract scale feature information, but also reduce the complexity of the network. The three branches of 1x1, 3x3, and 7x7 are used to collect subtle facial features and expand the receptive field, improving information utilization while taking into account the network processing speed. The Concat operation is used to fuse the collected multi-scale information by increasing the number of channels and output it to the backbone network for further extraction. The formula is:
[0047] ;
[0048] This formula is a feature concatenation operation, which is a common operation in deep learning, especially in convolutional neural networks (CNN). Feature concatenation can merge multiple feature maps along a certain dimension to increase the network's expressive power. In the formula: Represents the feature map output by the convolution unit; H, W, C represent the height, width, and number of channels of the corresponding feature map. Concat(f1, f2, f3) represents the convolution of the three feature maps. Perform splicing operations. represents the depth (or number of channels) of the concatenated feature map, which is the sum of the depths of the three feature maps. i represents the number of channels of the i-th feature map. Specifically, if The sizes of are (H, W, C1), (H, W, C2), (H, W, C3), then the size after the concatenation operation will be (H, W, C1+C2+C3). This operation is usually used to merge features from different network layers or different branches so that richer feature information can be used in subsequent network layers. In this way, the original input module in YOLOv7 is replaced by a multi-scale information input module to extract the global features of the input face, expand the receptive field and improve information utilization.
[0049] Step S12: using the global adaptive feature extraction module in the backbone network of the target network model to perform a global adaptive feature extraction operation on the facial features to obtain processed features; the global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size.
[0050] In this embodiment, after the multi-scale information input module extracts facial features, in order to prevent the extraction of too much repeated information or useless features, which will lead to reduced network accuracy and efficiency, a global adaptive feature extraction module (Adaptive Global Feature Extraction Module, AG-FEM) is proposed. The global adaptive feature extraction module in the backbone network of the target network model is used to perform average pooling operations on facial features to obtain average pooled features; the average pooled features are processed using ReLU activation functions and Sigmoid activation functions to obtain processed features.
[0051] Specifically, first, the global adaptive feature extraction module uses the average pooling operation to process the feature map, which not only smoothes the feature image and reduces the interference of wrinkle features, but also helps the network distinguish between facial and background information, making it faster and more accurate to identify whether a face exists. The formula is:
[0052] ;
[0053] This formula describes the Average Pooling operation, which is a downsampling technique used to reduce the size of feature maps while retaining important features. Represents the output value of the average pooling operation. W represents the width of the feature map. H represents the height of the feature map. X(i, j) represents the pixel value at position (i, j) on the feature map. Represents the sum of all pixel values on the feature map. The average pooling operation obtains the output by calculating the average value of all pixel values on the feature map. This operation is usually used in the last few layers of convolutional neural networks to reduce the number of parameters and calculations of the model, while helping the model learn more abstract features.
[0054] After that, two 1x1 convolution units with a step size of 1 are used to extract the feature image. Among them, the purpose of the ReLU activation function is to reduce the number of useless features, and its formula is:
[0055] ;
[0056] ReLU is a commonly used activation function in neural networks to introduce nonlinear characteristics and help the network learn complex patterns. Represents the output value of the ReLU function. max(0,x) represents the calculation method of the ReLU function, that is, taking the larger of 0 and the input value x. If x is greater than 0, then output x; if x is less than or equal to 0, then output 0. It is mainly used to accelerate the training process of the neural network.
[0057] The Sigmoid activation function makes the output smooth and reduces the number of repeated features. Its formula is:
[0058] ;
[0059] The Sigmoid function is a commonly used activation function in neural networks. It maps the input value to between 0 and 1 and is often used in binary classification problems. represents the output value of the Sigmoid function, x represents the input value of the Sigmoid function, and e represents the base of the natural logarithm, which is approximately equal to 2.71828. The characteristics of this function are: when x tends to positive infinity, d tends to 1. As x tends to negative infinity, tends to 0. In this way, the most representative features are adaptively learned and passed to the deep layers.
[0060] Step S13, based on the pixel attention mechanism, use the feature enhancement attention module to perform feature processing on the processed features to obtain target features, and determine the face recognition result of the elderly person in the image to be detected based on the target loss function, the target features and the target network model.
[0061] In this embodiment, after obtaining the processed features, the feature enhancement attention module is used to perform a maximum pooling operation and a convolution and normalization operation on the processed features to obtain a first feature; the subtle features corresponding to the processed features are processed based on the pixel attention mechanism to obtain a second feature; and the target feature is determined according to the first feature and the second feature. Specifically, when the network pays more attention to fixed features such as eyelid bags than to non-fixed features such as wrinkles, the accuracy can be improved, thereby improving the operation efficiency. In addition, the upsampling operation is used in the detection head of the original YOLOv7 network to improve the image resolution. Although this method can obtain a large amount of feature information. But it will also reduce the degree of correlation of feature information in the image. Therefore, the present application uses a pixel attention mechanism (Pixed Attention Mechanism, PAM) to replace the upsampling module in the detection head. Compared with the upsampling module, the use of the pixel attention mechanism can not only reduce the network parameters, but also make the detection head pay more attention to fixed features. Then, in combination with the pixel attention mechanism, the present application proposes a feature enhancement attention module (Feature Enhancement Attention Module, FEAM), which consists of two branches in parallel. One uses Max Pooling and BConv convolution to enhance features such as image texture, that is, using the feature enhancement attention module to perform max pooling, convolution and normalization operations on the processed features. The other combines pixel attention to process subtle features. In this way, the module can process texture features while ensuring that subtle features are not lost, and combines the attention mechanism to improve the backbone network and detection head, thereby improving stability.
[0062] In addition, in order to ensure that the network in this paper can stably identify the faces of the elderly, this application determines the target loss function based on the EIoU loss function (Enhanced Intersection over Union) and the geometric properties of the bounding box. Then the target loss function is used to optimize the target network model to obtain the optimized network model; finally, the face recognition result of the elderly in the image to be detected is determined based on the target features according to the optimized network model. That is, the accuracy of face recognition of the elderly is improved through an adaptive loss strategy. After the improvement, the accuracy, recall rate and average precision of the network are higher than other algorithms, which means that the algorithm of this application is more suitable for actual face recognition scenarios of the elderly.
[0063] In summary, when identifying the face of an elderly person, the present application first inputs the image to be detected into the target network model, and uses the multi-scale information input module of the target network model to extract the face features of the image to be detected; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes; then the global adaptive feature extraction module in the backbone network of the target network model is used to perform global adaptive feature extraction operations on the face features to obtain processed features; the global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size; finally, based on the pixel attention mechanism, the feature enhancement attention module is used to perform feature processing on the processed features to obtain target features, and the elderly face recognition result of the image to be detected is determined based on the target loss function, the target features and the target network model. It can be seen that the present application is based on the YOLOv7 algorithm. First, a multi-scale information input module is proposed to extract the global information of the image and improve the information utilization rate; secondly, the face features of the elderly are summarized and summarized, a global adaptive feature extraction module is proposed, and the backbone network and the detection head are improved in combination with the attention mechanism to improve stability. Finally, the network is trained through transfer learning method, and the loss function is added to assign feature weights, while the parameters are continuously adjusted to improve the network recognition ability. Thus, accurate recognition of the elderly face is achieved.
[0064] Based on the previous embodiment, this application determines the target loss function based on the EIoU loss function and the geometric properties of the bounding box, and then uses the target loss function to optimize the target network model. Then, an adaptive loss strategy is used to improve the accuracy of elderly face recognition. Next, the process of determining the target loss function based on the EIoU loss function and the geometric properties of the bounding box will be described in detail.
[0065] The CIoU (Complete Intersection over Union) loss function in the original YOLOv7 mainly calculates the aspect ratio of the relative value, and the description is somewhat vague. The EIoU loss function separates the influencing factors of the aspect ratio based on CIoU and calculates the width and length of the target box and anchor box respectively. Therefore, this paper chooses to improve the performance of the proposed network by improving the EIoU loss function, and its formula is:
[0066] ;
[0067] This formula represents the EIoU loss function, which is an improved form of the IoU loss function and is used in object detection tasks, especially in bounding box regression. The EIoU loss function more accurately measures the difference between the predicted bounding box and the true bounding box by considering the overlapping area, center point distance, and aspect ratio of the bounding box. Represents the total value of the EIoU loss function. Represents the value of the IoU loss function, which is the complement of the ratio of the overlap area of the predicted bounding box to the true bounding box and the union area. It is a weight parameter used to balance the contribution between IoU loss and distance loss. Represents the distance loss between the center points of the bounding box, which is used to penalize the distance between the center point of the predicted bounding box and the center point of the true bounding box. λ is another weight parameter used to balance the contribution of the aspect ratio loss. Represents the aspect ratio loss, which is used to penalize the difference in aspect ratio between the predicted bounding box and the true bounding box. By minimizing this loss function, the model can be trained to more accurately predict the position and size of the bounding box while taking into account the geometric properties of the bounding box, such as the center point position and aspect ratio, thereby improving the accuracy of object detection. The adjusted loss function is
[0068] ;
[0069] Where: b, b gt are the predicted box and the true box respectively; ρ 2 (b,b gt ) represents the square of the Euclidean distance between the predicted box and the true box; ρ 2 (h,h gt ) represents the height h of the predicted bounding box and the height h of the true bounding box gt The square of the Euclidean distance between the two. c represents the diagonal distance that can contain both the real box and the predicted box. It is a constant used to normalize the distance. C ω and C h is the width and height of the minimum bounding box; α is a weight parameter used to balance the contribution between IoU loss and distance loss, and ρ is the weight coefficient. Therefore, the target loss function is finally determined based on the EIoU loss function and the geometric properties of the bounding box, and then the target network model can be optimized using the target loss function.
[0070] In this way, by designing a polynomial loss adjustment strategy to allocate network weights, the parameters are continuously adjusted to improve the recognition ability of the network model, and the transfer learning training method is used to solve the problem of insufficient facial data for the elderly.
[0071] See also Figure 3 As shown, the embodiment of the present invention discloses a face recognition device for the elderly, comprising:
[0072] The face feature extraction module 11 is used to input the image to be detected into the target network model, and extract the face features of the image to be detected by using the multi-scale information input module of the target network model; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes;
[0073] A feature processing module 12, used to perform a global adaptive feature extraction operation on the facial features using a global adaptive feature extraction module in the backbone network of the target network model to obtain processed features; the global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size;
[0074] The recognition result determination module 13 is used to perform feature processing on the processed features using the feature enhancement attention module based on the pixel attention mechanism to obtain the target features, and determine the face recognition result of the elderly person in the image to be detected based on the target loss function, the target features and the target network model.
[0075] It can be seen that this application is based on the YOLOv7 algorithm. First, a multi-scale information input module is proposed to extract the global information of the image and improve the information utilization rate; secondly, the facial features of the elderly are summarized and a global adaptive feature extraction module is proposed. The backbone network and the detection head are improved by combining the attention mechanism to improve stability. Finally, the network is trained by the transfer learning method, and the loss function is added to allocate feature weights. At the same time, the parameters are continuously debugged to improve the network recognition ability. Thus, accurate recognition of the elderly's faces is achieved.
[0076] In some specific embodiments, the face feature extraction module 11 may specifically include:
[0077] A scale feature information unit, used to collect subtle facial features of the image to be detected and increase the receptive field by using each convolution unit in the multi-scale information input module of the target network model, so as to obtain scale feature information of the image to be detected;
[0078] The facial feature acquisition unit is used to perform feature splicing on the feature information of each scale by increasing the number of channels through a Concat operation to obtain the facial features of the image to be detected.
[0079] In some specific embodiments, the feature processing module 12 may specifically include:
[0080] An average pooling processing unit, used to perform an average pooling operation on the facial features using the global adaptive feature extraction module in the backbone network of the target network model to obtain average pooled features;
[0081] The feature processing unit is used to process the average pooled features by using a ReLU activation function and a Sigmoid activation function to obtain processed features.
[0082] In some specific embodiments, the recognition result determination module 13 may specifically include:
[0083] A first feature acquisition unit, configured to perform a maximum pooling operation, a convolution and a normalization operation on the processed feature using a feature enhancement attention module to obtain a first feature;
[0084] A second feature acquisition unit, configured to process a subtle feature corresponding to the processed feature based on the pixel attention mechanism to obtain a second feature;
[0085] A target feature determination unit is used to determine the target feature according to the first feature and the second feature.
[0086] In some specific embodiments, the device may further include:
[0087] The target loss function determination module is used to determine the target loss function according to the EIoU loss function and the geometric properties of the bounding box.
[0088] In some specific embodiments, the recognition result determination module 13 may specifically include:
[0089] A model optimization unit, used to optimize the target network model using the target loss function to obtain an optimized network model;
[0090] A face recognition result determination unit is used to determine the face recognition result of the elderly person in the image to be detected based on the target features according to the optimized network model.
[0091] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0092] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the elderly face recognition method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0093] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0094] In addition, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0095] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the elderly face recognition method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0096] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed elderly face recognition method is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0097] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0098] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0099] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0100] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0101] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article 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 of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will 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 method for face recognition of the elderly, characterized in that: include: Inputting the image to be detected into the target network model, and extracting the facial features of the image to be detected using the multi-scale information input module of the target network model; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes; Using the global adaptive feature extraction module in the backbone network of the target network model to perform a global adaptive feature extraction operation on the facial features to obtain processed features; the global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size; Based on the pixel attention mechanism, the feature enhanced attention module is used to perform feature processing on the processed features to obtain the target features, and the face recognition result of the elderly person in the image to be detected is determined based on the target loss function, the target features and the target network model.
2. The elderly face recognition method according to claim 1, characterized in that: The step of extracting facial features of the image to be detected by using the multi-scale information input module of the target network model includes: Using each convolution unit in the multi-scale information input module of the target network model to collect subtle facial features of the image to be detected and increase the receptive field to obtain scale feature information of the image to be detected; The Concat operation is used to concatenate feature information of each scale by increasing the number of channels to obtain the facial features of the image to be detected.
3. The elderly face recognition method according to claim 1, characterized in that: The global adaptive feature extraction module in the backbone network of the target network model is used to perform a global adaptive feature extraction operation on the facial features to obtain processed features, including: Using the global adaptive feature extraction module in the backbone network of the target network model to perform an average pooling operation on the facial features to obtain average pooled features; The average pooled features are processed using a ReLU activation function and a Sigmoid activation function to obtain processed features.
4. The elderly face recognition method according to claim 1, characterized in that: The pixel-based attention mechanism uses a feature enhancement attention module to perform feature processing on the processed features to obtain target features, including: Using a feature enhancement attention module to perform a maximum pooling operation and a convolution and normalization operation on the processed features to obtain a first feature; Processing the subtle features corresponding to the processed features based on the pixel attention mechanism to obtain a second feature; The target feature is determined according to the first feature and the second feature.
5. The elderly face recognition method according to claim 1, characterized in that: Before determining the elderly face recognition result of the image to be detected based on the target loss function, the target feature and the target network model, the method further includes: The target loss function is determined according to the EIoU loss function and the geometric properties of the bounding box.
6. The elderly face recognition method according to any one of claims 1 to 5, characterized in that: The method of determining the elderly face recognition result of the image to be detected based on the target loss function, the target feature and the target network model includes: Optimizing the target network model using the target loss function to obtain an optimized network model; The face recognition result of the elderly person in the image to be detected is determined based on the target features according to the optimized network model.
7. A facial recognition device for the elderly, characterized in that: include: A facial feature extraction module is used to input the image to be detected into the target network model, and extract the facial features of the image to be detected by using the multi-scale information input module of the target network model; the target network model is a network model based on the YOLOv7 network architecture; the multi-scale information input module includes convolution units and feature splicing units of three sizes; A feature processing module, used to perform a global adaptive feature extraction operation on the facial features using the global adaptive feature extraction module in the backbone network of the target network model to obtain processed features; The global adaptive feature extraction module includes an average pooling unit and two convolution units of the same size; The recognition result determination module is used to perform feature processing on the processed features using a feature enhancement attention module based on a pixel attention mechanism to obtain target features, and determine the face recognition result of the elderly person in the image to be detected based on a target loss function, the target features and the target network model.
8. The elderly face recognition device according to claim 7, characterized in that: The facial feature extraction module comprises: A scale feature information unit, used to collect subtle facial features of the image to be detected and increase the receptive field by using each convolution unit in the multi-scale information input module of the target network model, so as to obtain scale feature information of the image to be detected; The facial feature acquisition unit is used to perform feature splicing on the feature information of each scale by increasing the number of channels through a Concat operation to obtain the facial features of the image to be detected.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the elderly face recognition method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, it implements the elderly face recognition method as described in any one of claims 1 to 6.