Face recognition method based on smart energy unit
Patent Information
- Application Number
- CN202610629267.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-09
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2046-05-09
AI Technical Summary
此处理模式在面对光照突变时,易导致图像特征丢失或引入高频本底噪声;同时,对连续出现的目标盲目执行重复的深度特征提取,会榨干边缘设备有限的算力和内存资源,导致整体系统帧率下降、识别响应卡顿
Smart Images

Figure CN122176479B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of artificial intelligence and computer vision, and in particular to a face recognition method based on a smart energy unit. Background Technology
[0002] Deploying facial recognition algorithms on edge computing nodes, such as smart energy units, facilitates zero-latency identity authentication and secure access control for front-end devices. Since edge terminals have high requirements for concurrent processing capabilities and real-time performance, completing image preprocessing, target detection, feature extraction, and identity comparison directly on the local computing unit in a closed loop avoids dependence on cloud servers and the overhead of long-link network transmission. This ensures the responsiveness of end-control devices and the security of biometric data.
[0003] Currently, face recognition solutions for edge devices typically employ a serial, periodic pipeline architecture of image acquisition, full-image detection, feature extraction, and comparison. In real-world industrial deployments, devices are located in confined spaces, in areas with frequent alternations of backlighting or strong light, and are often in uncontrolled environments. Recognition algorithms rely on statically configured image preprocessing operators and fixed evaluation and matching thresholds, and often mechanically perform time-consuming deep feature network inference on each valid frame of the video stream or at fixed time intervals. This processing mode is prone to image feature loss or the introduction of high-frequency background noise when faced with sudden changes in lighting. Furthermore, blindly performing repetitive deep feature extraction on continuously appearing targets exhausts the limited computing power and memory resources of edge devices, leading to a decrease in overall system frame rate and sluggish recognition response.
[0004] In summary, existing methods still fall short in terms of environmental adaptability and the ability to dynamically allocate underlying computing resources when faced with the dual constraints of external environment and extremely limited hardware computing power. Therefore, there is an urgent need to study a face recognition processing method that can balance recognition robustness under complex working conditions with edge computing power consumption. Summary of the Invention
[0005] The purpose of this invention is to provide a face recognition method based on a smart energy unit, in order to solve the aforementioned problems existing in the prior art.
[0006] The technical solution, in its first aspect, is a facial recognition method based on a smart energy unit, comprising:
[0007] Acquire the ambient light intensity and real-time raw images;
[0008] The illumination deviation index is calculated based on the ambient light intensity. Closed-loop adaptive preprocessing is then performed on the original image based on the illumination deviation index to obtain a brightness-corrected image.
[0009] The brightness-corrected image is denoised and edge-enhanced to obtain the target image;
[0010] Perform face detection and tracking on the target image to determine the current face tracking status and real-time quality assessment results;
[0011] The tracking status, real-time quality assessment results, and historical recognition confidence of the current face are combined to perform dynamic scheduling and obtain the scheduling determination result.
[0012] When the scheduling judgment result indicates that recognition is triggered, the current facial features are extracted from the target image, the current facial features are matched with the facial database, and the identity verification result is output.
[0013] On the other hand, closed-loop adaptive preprocessing is performed on the original image based on the illumination deviation index to obtain a brightness-corrected image, including:
[0014] The feedforward adjustment parameters are determined based on the illumination deviation index;
[0015] The brightness and contrast of the original image are adjusted using feedforward adjustment parameters to obtain a preliminary corrected image;
[0016] Extract the global mean brightness of the preliminarily corrected image;
[0017] Based on the difference between the global average brightness and the pre-configured target average brightness, the feedback correction parameters are calculated;
[0018] The initial corrected image is corrected using feedback correction parameters to obtain a brightness corrected image.
[0019] On the other hand, feedforward adjustment parameters are determined based on the illumination deviation index, including:
[0020] When the ambient light intensity is lower than the pre-configured low light threshold, the limit parameter for local contrast enhancement is calculated based on the light deviation index, and the limit parameter is used as the feedforward adjustment parameter.
[0021] When the ambient light intensity is higher than the pre-configured high light threshold, the exponential parameter for global brightness correction is calculated based on the light deviation index, and the exponential parameter is used as the feedforward adjustment parameter.
[0022] On the other hand, the brightness-corrected image is denoised and edge-enhanced to obtain the target image, including:
[0023] Establish a positive correlation mapping relationship between the range of edge-preserving smoothing filter smoothing intensity parameters and the illumination deviation index;
[0024] Based on the positive correlation mapping relationship and the current illumination deviation index, calculate the required range smoothing intensity parameter;
[0025] An edge-preserving smoothing filter with a range smoothing intensity parameter is used to denoise the brightness correction image, resulting in a smoothed and denoised image.
[0026] Edge enhancement processing is performed on the smoothed and denoised image to obtain the target image.
[0027] On the other hand, face detection and tracking are performed on the target image to determine the current face tracking status and real-time quality assessment results, including:
[0028] Obtain historical tracking status, and determine the detection mode for the target image between the full-map discovery mode and the region prediction tracking mode based on the activity index of the historical tracking status.
[0029] When the detection mode is full-image discovery mode, a global feature search is performed on the target image to obtain the face localization result, and the extracted reference image block is pre-stored;
[0030] When the detection mode is the region prediction tracking mode, the face localization result is obtained by searching and verifying within a local region of the target image based on the historical tracking status.
[0031] Based on the face localization results, tracking and matching are performed to update the current face tracking status, and real-time quality assessment results are extracted from the face localization results.
[0032] On the other hand, the process of generating real-time quality assessment results and outputting authentication results also includes the following threshold linkage:
[0033] A reverse linkage adjustment model is constructed based on the illumination deviation index, and dynamic quality admission threshold and dynamic feature matching threshold are generated using the reverse linkage adjustment model.
[0034] Among them, the dynamic quality admission threshold is negatively correlated with the illumination deviation index, while the dynamic feature matching threshold is positively correlated with the illumination deviation index.
[0035] When the real-time quality assessment results reach the dynamic quality access threshold, the currently tracked target is allowed to enter the dynamic scheduling process.
[0036] After extracting the current face features, calculate the feature similarity between the current face features and the face database;
[0037] When the feature similarity reaches the dynamic feature matching threshold, the match is considered successful and the authentication result is output.
[0038] On the other hand, the tracking status, real-time quality assessment results, and historical recognition confidence levels corresponding to the current face are dynamically scheduled to obtain scheduling determination results, including:
[0039] Based on the tracking status, identify whether the current face is a continuously tracked target;
[0040] If the current face is a newly emerging tracking target, generate a scheduling decision result that indicates the triggering of recognition;
[0041] If the current face is a continuously tracked target, extract the historical recognition confidence and the historical best quality assessment results for continuously tracked targets;
[0042] Based on the tracking duration and historical identification confidence of continuously tracked targets, a real-time tracking confidence that decreases over time is constructed.
[0043] By combining real-time tracking confidence, historical best quality assessment results, and real-time quality assessment results, a scheduling decision is generated for continuously tracked targets.
[0044] On another front, the update includes:
[0045] Calculate the feature consistency between the current facial features and historical facial feature templates;
[0046] When the feature consistency meets the pre-configured consistency verification threshold, obtain the best historical quality assessment result associated with the historical face feature template;
[0047] The current facial features and historical facial feature templates are weighted and fused using real-time quality assessment results and historical best quality assessment results, respectively, to generate a fused feature vector.
[0048] The historical face feature template is updated using the fused feature vector, and the historical recognition confidence is updated synchronously based on the rematch score of the fused feature vector in the face database.
[0049] When the feature consistency is lower than the consistency verification threshold, it is determined that the tracking of the current face has drifted, and the historical face feature template is directly reset using the current face features.
[0050] On the other hand, when extracting current facial features from the target image, a pre-deployed feature extraction model is used to perform the feature extraction operation. The feature extraction model is constructed through the following offline process:
[0051] Invoke the initial network containing depthwise separable convolutional structures;
[0052] The initial network is iteratively trained using the training sample set, and the update of the network parameters is constrained by the loss function during training to obtain the pre-trained network.
[0053] Fixed-point quantization is performed on the pre-trained network to map the network parameters from high-precision floating-point numbers to low-precision integers, resulting in a feature extraction model adapted to edge computing devices.
[0054] Beneficial effects: This invention solves the computing power bottleneck and complex environmental interference problems faced by edge computing devices in face recognition by constructing a multi-level coupled computing power and environment adaptive architecture. The related technical effects will be described in detail below with reference to specific embodiments. Attached Figure Description
[0055] Figure 1 A flowchart of a face recognition method based on a smart energy unit provided in this application embodiment.
[0056] Figure 2 The flowchart below shows how to perform closed-loop adaptive preprocessing on the original image based on the illumination deviation index to obtain a brightness-corrected image, as provided in the embodiments of this application.
[0057] Figure 3 This is a flowchart illustrating the determination of feedforward adjustment parameters based on the illumination deviation index, provided for an embodiment of this application.
[0058] Figure 4 This is a flowchart illustrating the process of denoising and edge enhancement of a brightness-corrected image to obtain a target image, as provided in an embodiment of this application.
[0059] Figure 5 This is a flowchart illustrating how to perform face detection and tracking on a target image, determine the current face tracking status, and obtain real-time quality assessment results, as provided in this embodiment of the application.
[0060] Figure 6 A flowchart illustrating face comparison provided in an embodiment of this application.
[0061] Figure 7 A flowchart for face data entry provided in this application embodiment. Detailed Implementation
[0062] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0063] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0064] To address the aforementioned issues, the applicant conducted in-depth searches and analyses, and discovered:
[0065] Correspondingly, using traditional facial recognition algorithms in this scenario faces environmental interference problems, namely, smart energy unit devices are usually deployed in scenarios with small spaces and large changes in lighting, which increases the difficulty of facial recognition.
[0066] Moreover, smart energy systems have high requirements for real-time operation and accuracy, and traditional facial recognition algorithms have response times that are difficult to meet actual needs due to their large model size.
[0067] Furthermore, smart energy unit devices have limited computing power and memory, and require relatively low power consumption, making it difficult for traditional algorithms to run under these constraints.
[0068] To solve these problems, combined with Figures 1 to 7 The present invention will be specifically described through the following embodiments.
[0069] Firstly, a facial recognition method based on a smart energy unit is provided, which mainly includes the following steps:
[0070] Step 101: Obtain the ambient light intensity and the original images acquired in real time;
[0071] Among them, the on-site light intensity can be collected in real time by a light sensor installed on the outside of the smart energy unit equipment, and the unit is lux;
[0072] The original images can be captured in real time by a high-definition camera positioned above the display screen of the smart energy unit.
[0073] For example, the camera can specifically adopt a high-definition video capture module with a resolution of 640×480 pixels, a frame rate of 15 frames per second, and a field of view of about 70 degrees.
[0074] In some scenarios, the distance between the operator and the equipment can be 1 meter, which can be adjusted according to actual needs.
[0075] Based on this, the real-time acquisition of ambient lighting data and the quality of the original face image can help with subsequent adaptive processing and recognition.
[0076] Optionally, considering the computing power limitations of edge computing devices, the original 640×480 pixel image captured by the high-definition camera can be downsampled and scaled to 320×240 pixels through bilinear interpolation. At this resolution, the face area can still occupy enough pixel space to ensure the accuracy of subsequent feature detection, while reducing memory usage and video memory throughput in subsequent operations.
[0077] Alternatively, the computing device can be selected, such as a terminal equipped with an ARM Cortex-A53 processor, a 64-bit embedded processor core based on the ARM architecture.
[0078] Step 102: Calculate the illumination deviation index based on the ambient light intensity, and perform closed-loop adaptive preprocessing on the original image based on the illumination deviation index to obtain a brightness-corrected image;
[0079] The illumination deviation index is a dimensionless mapping coefficient used to quantify the degree to which the current ambient lighting deviates from the standard lighting range suitable for face recognition. By calculating the illumination deviation index, the system can perceive the deterioration of ambient light.
[0080] Closed-loop adaptive preprocessing refers to a process that does not rely solely on sensor feedforward data for a one-time adjustment, but rather introduces a feedback loop based on the image's own grayscale statistical characteristics for secondary correction on the basis of feedforward adjustment.
[0081] Correspondingly, by using the illumination deviation index to drive the preprocessing module, interference such as strong light overexposure, weak light underexposure, or side light shadows can be dynamically compensated, and the output brightness-corrected image with an overall brightness distribution more suitable for extracting facial textures can be produced.
[0082] Step 103: Denoise and enhance the edges of the brightness-corrected image to obtain the target image;
[0083] Preprocessing may inevitably amplify the image background and sensor noise, especially the contrast amplification of low-light images, thus requiring image denoising.
[0084] Since facial recognition relies on high-frequency spatial features such as eye contours, nose bridge edges, and mouth corner shapes, the noise reduction process must also take edge preservation into account.
[0085] Therefore, the target image output after edge-preserving denoising and edge enhancement of the brightness-corrected image has a higher signal-to-noise ratio and sharper local structure, which can provide a data input source for subsequent deep learning network inference.
[0086] In some scenarios, when the computing power of edge devices is extremely limited and the requirement for preserving image details is not high, denoising and edge enhancement can be achieved using a standard Gaussian filtering algorithm combined with the Laplacian operator edge enhancement algorithm. The Gaussian kernel size constraint can be set to 3×3 with a standard deviation no greater than 1.0 to reduce the blurring interference caused by the Gaussian low-pass filtering in the edge enhancement process.
[0087] Step 104: Perform face detection and tracking on the target image to determine the current face tracking status and real-time quality assessment results;
[0088] Correspondingly, face detection is the process of locating the bounding box of a face in a two-dimensional image space.
[0089] Tracking refers to establishing a spatiotemporal correspondence between the same operator in consecutive video frames, that is, assigning and maintaining a globally unique identifier to the detected face.
[0090] The tracking status includes information such as whether the target is appearing for the first time, the number of frames that have been continuously and stably tracked, and its historical motion trajectory.
[0091] The real-time quality assessment results quantify and score the currently captured face image from multiple dimensions such as sharpness and illumination uniformity.
[0092] In some embodiments, the target is located in the spatial domain and tracked in the temporal domain, upgrading from a memoryless single-frame processing mode to a video stream processing mode with temporally continuous memory, thus avoiding repeated blind searches across the entire image.
[0093] As an example, the tracking process can achieve inter-frame association by calculating the Intersection over Union (IoU) of adjacent frame detection boxes and using the Hungarian algorithm for bipartite graph maximum matching. Since the smart energy unit is usually operated by a single person, there are few instances of severe occlusion or frequent crossings by multiple people. A lightweight tracking algorithm based on the IoU of the detection boxes can meet the engineering requirements without the need to introduce ReID appearance feature calculations.
[0094] In other embodiments, before extracting the real-time quality assessment results, an affine transformation can be performed based on facial key points output by the face detection network, such as the center positions of the left and right eyes, to rotate the face to a horizontal position and crop and scale it, outputting a standardized face image of, for example, 112×112 pixels. Based on this, alignment operations can be used to suppress the interference of in-plane rotation on the facial geometric topology.
[0095] Step 105: Dynamically schedule the data by combining the tracking status, real-time quality assessment results, and pre-stored historical recognition confidence scores corresponding to the current face, and obtain the scheduling decision result.
[0096] Correspondingly, historical recognition confidence refers to the score obtained when the tracked target has been identified and matched with the baseline database in historical frames.
[0097] Dynamic scheduling is used to save computing power.
[0098] Furthermore, a comprehensive evaluation is conducted to determine whether the currently tracked target has been identified and whether the currently captured facial image is more valuable for identification, thereby outputting a binarized scheduling decision result.
[0099] The scheduling decision indicates whether the system should directly reuse historical identity records in the current frame or immediately initiate a computationally intensive identification process to re-verify the identity.
[0100] Alternatively, based on historical recognition confidence and real-time quality assessment results, a comprehensive evaluation is conducted to determine whether the currently tracked target has been recognized and whether the currently captured face image is more identifiable, resulting in a binarized scheduling decision.
[0101] The scheduling decision result is used to indicate the system's processing method in the current frame. It can choose to directly reuse historical identity records and skip subsequent feature extraction and comparison; or start a high-computing-power-consuming face recognition process to re-verify the target identity.
[0102] Step 106: When the scheduling judgment result indicates that recognition is triggered, extract the current face features from the target image based on the tracking status, match the current face features with the pre-stored face database, and output the identity verification result.
[0103] The extraction of current facial features relies on a deep convolutional neural network to map a two-dimensional image matrix into a high-dimensional, such as a 128-dimensional feature vector.
[0104] The face database refers to the local feature map library built during the offline configuration phase of the system, such as by clicking "enter" through the device management interface.
[0105] When the smart energy unit serves as a local control terminal, the number of operators is fixed, and the facial recognition database is a small database containing dozens to hundreds of people. The extracted high-dimensional feature vector is compared with templates in the database one by one to measure similarity. When the maximum similarity exceeds a set threshold, the operator's access is confirmed, and the authentication result is output to unlock the control panel of the device unit.
[0106] Step 107: Update the pre-stored historical facial feature templates based on the real-time quality assessment results and the current facial features.
[0107] Furthermore, the pre-stored historical facial feature templates correspond to a dynamic feature record maintained in memory by the system for the person currently being tracked.
[0108] For example, after obtaining new high-value feature vectors, the system performs iterative feature-level updates on the template in memory based on the quality score of the current image. This mechanism, based on incremental updates along the physical timeline, facilitates the gradual fusion of identity information under different poses and subtle facial expressions, reducing recognition bias caused by sudden interference in a single frame image.
[0109] Based on the above embodiments, this paper describes how, in a smart energy unit scenario, the impact of unstable lighting on the recognition rate can be addressed by combining feedforward initialization of environmental parameters with feedback correction of image features, thus achieving parameter coordination between preprocessing and denoising stages. Specific steps may include:
[0110] Step 201: Determine the feedforward adjustment parameters based on the illumination deviation index;
[0111] The brightness and contrast of the original image are adjusted using feedforward adjustment parameters to obtain a preliminary corrected image;
[0112] Extract the global mean brightness of the preliminarily corrected image;
[0113] Based on the difference between the global average brightness and the pre-configured target average brightness, the feedback correction parameters are calculated;
[0114] The initial corrected image is corrected using feedback correction parameters to obtain a brightness corrected image.
[0115] Alternatively, feedforward adjustment parameters are generated based on the illumination deviation index, and the brightness and contrast of the original image are adaptively adjusted to obtain a preliminary corrected image.
[0116] Calculate the global average brightness of the preliminary corrected image, construct a feedback correction amount based on the difference between it and the preset target brightness, optimize the preliminary corrected image, and obtain the brightness corrected image.
[0117] As an example, the illumination deviation index ∆ is used to quantify the degree to which the current ambient illumination deviates from the suitable range. Its calculation is performed segmented according to the illumination state. When the ambient illumination intensity is within the suitable range [L_low, L_high], ∆=0, and the system does not need to perform any adjustment.
[0118] When the ambient light intensity L is lower than the pre-configured low light threshold L_low, ∆(L) is calculated by the following low light branch formula:
[0119] Δ(L) = (L_low − L) / L_low;
[0120] When the ambient light intensity L is higher than the pre-configured high light threshold L_high, ∆ is calculated by the following high light branch formula:
[0121] Δ(L)=(L−L_high) / L_ref_max;
[0122] In the formula, L_ref_max is a pre-configured upper limit value for the reference light intensity, used to normalize the degree of deviation from high light intensity. In this embodiment, it can be optionally set to 1400 lux. The value of ∆ is normalized to between 0 and 1 under all lighting conditions.
[0123] As ∆(L) increases, it indicates a more severe deviation in ambient light, requiring the system to apply stronger adjustment. ∆(L) refers to the light deviation index calculated according to the piecewise rule, and can also be written as ∆.
[0124] Accordingly, the feedforward adjustment parameter represents the initial control variable obtained by directly mapping sensor readings. Applying the feedforward adjustment parameter to the original image yields a preliminary corrected image. To further eliminate the influence of directional light sources or local shadows, the system extracts the global mean brightness μ_I1 of the preliminary corrected image in the brightness channel.
[0125] For example, the pre-configured target mean brightness μ_target can be set to 120, representing the ideal median brightness in the 8-bit grayscale space.
[0126] For example, the calculation of the feedback correction parameter γ_adj can be described as follows:
[0127] γ_adj=ln(μ_target / 255) / ln(μ_I1 / 255);
[0128] In the formula, γ_adj is the feedback correction parameter, μ_target is the pre-configured target mean brightness, and μ_I1 is the global mean brightness of the initially corrected image.
[0129] Based on this, the pixel value of each pixel in the initially corrected image is exponentially operated with the feedback correction parameter so that the corrected brightness distribution approaches the target mean, thus obtaining the brightness corrected image.
[0130] In another example, the calculation of the illumination deviation index ∆(L) can also follow the following piecewise logic:
[0131] When the ambient light intensity L is lower than the pre-configured low light threshold L_low, it can also be called low light deviation, that is, when L < L_low, ∆(L) = (L_low − L) / L_low;
[0132] When the ambient light intensity L is higher than the pre-configured high light threshold L_high, it can also be called high light deviation, that is, when L>L_high, ∆(L)=(L−L_high) / L_high;
[0133] When the ambient light intensity L is between the low light threshold and the high light threshold, it can also be called the normal light range. That is, when L_low≤L≤L_high, ∆(L)=0, the system determines that the current light conditions are suitable and no preprocessing adjustment is required.
[0134] In this case, the value of ∆(L) is normalized to be between 0 and 1. When ∆(L) equals 0, it indicates that the light intensity is within a suitable range; as ∆(L) increases, it indicates that the deviation of the ambient light intensity is aggravated, and stronger adjustment is required.
[0135] In another example, before feedback correction, the initially corrected image is converted from the BGR color space to the YCrCb color space. Feedback correction is performed only on the Y channel, which represents luminance information, while the Cr and Cb channels, representing chrominance, remain unchanged. After correction, the image is converted back to the BGR color space for further processing.
[0136] Step 202: When the ambient light intensity is lower than the pre-configured low light threshold, calculate the limit parameter for local contrast enhancement based on the light deviation index, and use the limit parameter as the feedforward adjustment parameter.
[0137] When the ambient light intensity is higher than the pre-configured high light threshold, the exponential parameter for global brightness correction is calculated based on the light deviation index, and the exponential parameter is used as the feedforward adjustment parameter.
[0138] When the ambient light intensity is between the low and high light thresholds, the pre-configured neutral reference adjustment parameters are directly used as feedforward adjustment parameters, and only reference correction operations are performed on the original image.
[0139] In this embodiment, the pre-configured low illumination threshold L_low can be optionally set to 200 lux, and the high illumination threshold L_high can be optionally set to 600 lux.
[0140] In some possible operating conditions, when L < 200 lux, the environment is under low illumination. In this case, the adaptive histogram equalization CLAHE algorithm can be used.
[0141] For example, the feedforward adjustment parameter is specifically the contrast-limited parameter c_init in this algorithm, which is calculated as follows:
[0142] c_init=c_min+(c_max-c_min)×Δ(L);
[0143] In the formula, c_init is the limit parameter used as the feedforward adjustment parameter, c_min is the contrast-limited reference value, and c_max is the contrast-limited maximum value. For example, c_min can be set to 2.0 and c_max to 6.0.
[0144] Through this mapping, the darker the lighting, the higher the contrast limit and the stronger the enhancement, which helps to improve the recognizability of facial details in dark areas.
[0145] In other possible operating conditions, when L > 600 lux, the environment is under high illumination. In this case, the system employs a gamma correction algorithm. The feedforward adjustment parameter is specifically the gamma exponent parameter γ_init, which can be calculated as follows:
[0146] γ_init=1.0+(γ_max-1.0)×Δ(L);
[0147] Wherein, γ_init is the exponential parameter used as the feedforward adjustment parameter, and γ_max is the preset upper limit value of gamma correction.
[0148] By increasing the gamma exponent, overexposed areas can be darkened. Since ∆(L) increases linearly with the degree of deviation, the darkening intensity of gamma correction will also be adjusted accordingly, avoiding image quality abrupt changes at the threshold edge caused by the preprocessing strategy.
[0149] Step 203: Obtain the positive correlation mapping relationship between the pre-configured edge-preserving smoothing filter's range smoothing intensity parameter and the illumination deviation index;
[0150] Based on the positive correlation mapping relationship and the current illumination deviation index, calculate the required range smoothing intensity parameter;
[0151] An edge-preserving smoothing filter with a range smoothing intensity parameter is used to denoise the brightness correction image, resulting in a smoothed and denoised image.
[0152] Edge enhancement processing is performed on the smoothed and denoised image to obtain the target image.
[0153] In this embodiment, a bilateral filter is used to achieve edge-preserving smoothing filtering. Edge-preserving smoothing filtering is used to suppress noise in flat areas and preserve edge structure by simultaneously weighting the pixel grayscale value domain and spatial neighborhood.
[0154] The range smoothing intensity parameter σ_r is used to control the sensitivity of the filtering process to pixel grayscale differences.
[0155] Since brightness enhancement simultaneously amplifies background noise, the denoising intensity must be coordinated with the preprocessing intensity. For example, the positive correlation between the two can be expressed as:
[0156] σ_r=σ_base+σ_scale×Δ(L);
[0157] In the formula, σ_r is the range smoothing intensity parameter, σ_base is the baseline value under suitable illumination, and σ_scale is the adjustment coefficient.
[0158] As ∆(L) increases, σ_r also increases, enhancing the smoothing ability against noise. To ensure that edge features are not overly erased, the upper limit of σ_r is constrained to 100.
[0159] For example, σ_base can also be set to 50 and σ_scale to 30.
[0160] After obtaining the smoothed and denoised image, the system performs edge enhancement processing using an unsharpened mask algorithm. Specifically, the smoothed and denoised image is linearly weighted with its difference image after being filtered again.
[0161] In this embodiment, the sharpening intensity coefficient can be set according to the actual scene and image quality requirements, for example, it can be set to 0.5.
[0162] Based on this, edge-preserving filtering retains facial contours at a preset intensity, and subsequent edge enhancement operations can highlight eye and contour features to output the target image.
[0163] In some implementations, if the smart energy unit faces extreme light fluctuations that cause ∆(L) to exceed 1.0, the system will use a safety constraint mechanism to determine whether the feedback correction mean μ_I1 of the current image is outside the range of 5-250.
[0164] If the image brightness exceeds this range, the system determines that the image brightness has been distorted beyond the correction capability and marks the current frame as an invalid frame, thereby avoiding the consumption of computing power and preventing the risk of misidentification due to feature distortion.
[0165] This embodiment describes the specific technical process of reducing the computational overhead of single-frame detection by dynamically switching between full-map detection and local region prediction, and by supplementing it with a lightweight keypoint network, under the condition of limited computing power in the smart energy unit. Accordingly, it includes:
[0166] Step 301: Obtain the pre-stored historical tracking status, and determine the detection mode for the target image between the full-map discovery mode and the region prediction tracking mode based on the activity index of the historical tracking status.
[0167] Specifically, the historical tracking status is stored in the system's memory, recording the location coordinates of the target personnel and the number of consecutive survival frames in the previous frame.
[0168] The activity metric is used to characterize whether a target is stably captured by the system. For example, if there are no active tracking identifiers (trackIDs) in the system, or if a tracked target has fewer than 3 consecutive frames of survival, the activity metric is deemed unsatisfactory, and the system switches its detection mode to full-map detection mode. Conversely, when a stably tracked target is present, the system switches to region prediction tracking mode to conserve computational resources.
[0169] Optionally, the system can also be configured with a forced scan cycle variable, such as forcing a full-image discovery mode to be executed once every 10 frames of images.
[0170] Step 302: When the detection mode is full-image discovery mode, perform a global feature search on the target image to obtain the face localization result and pre-store the extracted reference image block;
[0171] In this step, global feature search refers to performing calculations based on sliding window or anchor box regression on the entire target image using conventional deep learning object detection algorithms.
[0172] The obtained face localization results include the bounding box coordinates of the face.
[0173] As an example, after localization is completed, the system extracts the grayscale pixel matrix within the bounding box, scales it to a fixed size of 64×64, and pre-stores it in memory as a reference image block to provide a benchmark for similarity comparison of subsequent frames.
[0174] When the detection mode is the region prediction tracking mode, the face localization result is obtained by searching and verifying within a local region of the target image based on the historical tracking status.
[0175] Step 303: Based on the motion trajectory information contained in the historical tracking status, determine the predicted target region in the target image;
[0176] For example, when the system is in regional prediction and tracking mode, it will skip the time-consuming global feature search. Since the relative movement of smart energy unit operators is typically gentle, a linear motion model based on the constant velocity assumption can be used for coordinate extrapolation. The specific prediction formula is as follows:
[0177] P_pred = P_1 + P_1 - P_2;
[0178] Where P_pred is the predicted center coordinate of the current frame, P_1 is the face center coordinate of the previous frame, and P_2 is the face center coordinate of the frame before that.
[0179] By calculating the predicted center point and combining it with the bounding box width and height parameters of the previous frame, the system delineates a rectangular region in the target image and identifies it as the predicted target region.
[0180] Step 304: Extract the current image patch corresponding to the predicted target region from the target image;
[0181] In some embodiments, the calculated bounding box coordinates are used to perform pixel cropping in the spatial domain of the target image. Similarly, the size of the cropped content is standardized to a 64×64 grayscale matrix using an interpolation algorithm, and the output is the current image block.
[0182] Step 305: Calculate the image similarity between the current image patch and the pre-stored reference image patch;
[0183] In this embodiment, a normalized cross-correlation algorithm can be used to calculate image similarity. That is, before calculating the pixel product, the global grayscale mean of the current image block and the reference image block are calculated separately, and the corresponding mean is subtracted from the original pixel value. This subtraction operation decouples linear illumination changes, making the output similarity score insensitive to the overall shift in global brightness.
[0184] Step 306: When the image similarity meets the preset similarity threshold, the verification is successful, and the predicted target region is output as the face localization result.
[0185] As an example, the preset similarity threshold can be configured to 0.6. When the similarity calculated by the normalized cross-correlation algorithm is greater than or equal to 0.6, the system determines that the currently predicted target region contains the tracked face and that no severe pose shift or occlusion has occurred. In this case, the derived predicted target region is directly confirmed as the final face localization result of the current frame.
[0186] Step 307: When the image similarity is lower than the similarity threshold, the verification fails, and the process reverts to executing the full-image discovery mode for the target image.
[0187] Alternatively, when the similarity is less than 0.6, it indicates that the linear prediction has failed due to the target's rapid movement, sharp head turn, or severe occlusion. The system immediately discards the prediction result and restarts the global feature search algorithm to perform a global scan of the current image.
[0188] Step 308: Utilize a pre-deployed lightweight keypoint detection network to perform local facial structure analysis on the captured current image patch;
[0189] In this step, the system introduces a lightweight keypoint detection network with a small number of computational parameters. This network only accepts 64×64 local grayscale blocks as input, extracts shallow features using a small number of convolutional layers, and performs local facial structure parsing.
[0190] As an example, a lightweight keypoint detection network may have a network hierarchy consisting of three consecutive depthwise separable convolutional blocks and a global average pooling layer cascaded together.
[0191] Each depthwise separable convolutional block contains 3×3 channel-wise convolutions and 1×1 pointwise convolutions, supplemented by a modified linear unit activation function;
[0192] The network ends at two parallel fully connected regression branches.
[0193] The output tensor dimension of the first regression branch can be selected as 10, corresponding to the horizontal and vertical coordinate parameters of five facial key points: left eye center, right eye center, nose tip, left corner of mouth, and right corner of mouth.
[0194] The output tensor dimension of the second regression branch can be selected as 5. The values are mapped to the interval of 0 to 1 through the sigmoid activation function, corresponding to the independent confidence parameters of the 5 key points that are not occluded.
[0195] When training the network offline, the mean squared error loss function is used to constrain the coordinate parameters, and the binary cross-entropy loss function is used to constrain the confidence parameter.
[0196] This cylindrical structure allows the forward inference time to be controlled within 2 milliseconds.
[0197] Step 309: Output the set of facial key point coordinates for the current image patch, and use the set of facial key point coordinates as reference input data for generating real-time quality assessment results.
[0198] The set of facial key point coordinates specifically includes two-dimensional coordinate data for the center of the left eye, the center of the right eye, the tip of the nose, the left corner of the mouth, and the right corner of the mouth. The coordinate parameters inferred from the local network are directly output to subsequent modules to determine whether there is a large angle of facial rotation or facial occlusion.
[0199] Step 310: Perform tracking and matching based on the face localization result, update the current face tracking status, and extract real-time quality assessment results for the face localization result and the target image.
[0200] Furthermore, the cross-union ratio of the face localization results between consecutive frames is calculated, and it is associated and matched with the existing tracking identifiers to update the target's survival time and coordinate records in the current frame, thus completing the tracking status update operation.
[0201] And / or, by combining the previously output set of facial key point coordinates with the image's grayscale variance data, a real-time quality assessment result is calculated.
[0202] According to one aspect of this application, in the process of generating real-time quality assessment results and outputting identity verification results, the quality access threshold and identity matching threshold are dynamically adjusted using the degree of deviation from ambient light, achieving a balance between system data pass rate and security under different operating conditions. Specifically, this includes:
[0203] Step 401, in the process of generating real-time quality assessment results and outputting authentication results, also includes the following threshold linkage:
[0204] Optionally, when generating real-time quality assessment results, the image patches extracted from the current face localization result are comprehensively scored. In this embodiment, the evaluation dimensions specifically include facial sharpness, pose angle, occlusion ratio, and brightness uniformity.
[0205] Alternatively, different weighting coefficients can be configured for each of the four dimensions. For example, facial clarity weight is configured as 0.3, pose angle weight as 0.3, occlusion ratio weight as 0.2, and brightness uniformity weight as 0.2. The real-time quality assessment result is obtained by multiplying the normalized score of each dimension by its corresponding weight and then summing the results.
[0206] Furthermore, the system uses the set of facial keypoint coordinates and their corresponding detection confidence scores for evaluation. When the detection confidence score of a certain facial keypoint is lower than 0.5, the system determines that the facial region is occluded and deducts the score for the occlusion dimension accordingly.
[0207] It should be understood that this mechanism performs assessments based on key point confidence levels, which can quantify the degree of local occlusion in industrial scenarios such as wearing masks or safety helmets.
[0208] Step 402: Construct a reverse linkage adjustment model based on the illumination deviation index, and use the reverse linkage adjustment model to generate dynamic quality access threshold and dynamic feature matching threshold.
[0209] Among them, the dynamic quality admission threshold is negatively correlated with the illumination deviation index, while the dynamic feature matching threshold is positively correlated with the illumination deviation index.
[0210] The reverse linkage adjustment model belongs to the control logic that dynamically calculates the decision boundary based on environmental variables.
[0211] In this step, the illumination deviation index is introduced as a regulating variable, which can adaptively sense the degree of environmental degradation and perform inverse parameter compensation adjustment on the two thresholds of quality access and identity matching.
[0212] For example, the negative correlation mapping calculation process of the dynamic quality admission threshold can be described by the following formula:
[0213] Q_th = Q_base - α_Q × ∆;
[0214] In the formula, Q_th is the dynamic quality threshold, Q_base is the preset baseline quality threshold, α_Q is the quality adjustment coefficient, and ∆ is the illumination deviation index.
[0215] As another example, the positive correlation mapping calculation process for dynamic feature matching thresholds can be described by the following formula:
[0216] M_th = M_base + α_M × ∆;
[0217] In the formula, M_th is the dynamic feature matching threshold, M_base is the preset baseline matching threshold, α_M is the matching adjustment coefficient, and ∆ is the illumination deviation index.
[0218] As another example, the baseline quality threshold can be set to 0.70, and the quality adjustment factor can be set to 0.15; the baseline matching threshold can be set to 0.75, and the matching adjustment factor can be set to 0.10.
[0219] When lighting conditions are extremely poor and the lighting deviation index approaches 1.0, the dynamic quality admission threshold will be reduced to 0.55, thereby relaxing the image access conditions at the front end and avoiding situations where no face frames are available due to poor environmental conditions. At the same time, to compensate for the feature drift risk caused by the decline in front-end quality, the dynamic feature matching threshold will be increased to 0.85, performing more stringent back-end identity comparison.
[0220] Optionally, the system configures hard truncation constraints for the reverse linkage adjustment model. For example, the lower limit of the dynamic quality admission threshold is limited to no less than 0.50, and the upper limit of the dynamic feature matching threshold is limited to no more than 0.90. When the result calculated by the mapping formula exceeds the interval, the system forcibly outputs the corresponding boundary extreme value parameters.
[0221] Step 403: When the real-time quality assessment result reaches the dynamic quality access threshold, the currently tracked target is allowed to enter the dynamic scheduling process.
[0222] When the real-time quality assessment result is lower than the dynamic quality admission threshold, the current frame data is discarded and does not enter the dynamic scheduling stage;
[0223] In this step, the calculated dynamic quality admission threshold is used to gate and intercept the current frame data. If the real-time quality assessment result is less than the dynamic quality admission threshold, the system determines that the image quality of the current frame is too low, discards the current frame data directly, and skips the subsequent feature extraction process to avoid unnecessary computational waste.
[0224] Conversely, if the dynamic threshold is reached, the system opens its internal data stream, allowing the parameter information of the current frame to be input into the dynamic scheduling module for analysis and decision-making.
[0225] Step 404: After extracting the current face features, calculate the feature similarity between the current face features and the pre-stored face database;
[0226] In this process, after the dynamic scheduling module determines that the recognition and verification process needs to be executed, the system uses a feature extraction model to map the currently captured image patch into a high-dimensional feature vector. Next, it calculates the cosine of the spatial angle between the current facial feature and each feature template vector in the pre-stored facial database.
[0227] Since the extracted high-dimensional feature vectors have undergone length normalization in the backend of the network computation, the system can directly obtain the feature similarity between 0 and 1 by calculating the dot product of the two vectors, thereby quantifying the identity consistency between the two.
[0228] Step 405: When the feature similarity reaches the dynamic feature matching threshold, the matching is determined to be successful and the authentication result is output.
[0229] When the feature similarity is lower than the dynamic feature matching threshold, the matching is deemed to have failed and a rejection verification result is output.
[0230] Optionally, the system compares the calculated highest feature similarity value with the synchronously generated dynamic feature matching threshold. When environmental degradation causes the matching threshold to rise, the system only determines a successful match if the feature similarity is greater than or equal to the higher threshold value.
[0231] Based on this, the output authentication result includes the matched personnel identification code and the corresponding similarity matching score.
[0232] This invention designs a closed-loop preprocessing mechanism driven globally by the illumination deviation index, a cascaded denoising parameter mechanism, and a reverse linkage mechanism between the quality and matching thresholds. This not only suppresses image quality jumps caused by sudden changes in ambient light, but also enables the system to achieve a dynamic balance between high-sensitivity front-end access and rigorous back-end comparison, improving recognition robustness and anti-counterfeiting security under extreme lighting conditions.
[0233] In a further embodiment, after determining the identity of the tracking target, a confidence decay model and a time-freezing mechanism based on environmental security assessment can be introduced to intercept redundant computation and reduce the frequency of single-frame feature extraction and comparison. Specifically, this can be achieved by performing the following steps:
[0234] Step 501: Identify whether the current face is a continuously tracked target based on the tracking status;
[0235] Accordingly, a dynamic tracking state table is built and maintained in memory. This table assigns a unique tracking identifier to each face within the hardware field of view and records data including fields such as identity code, initial matching score, historical best quality assessment result, initial detection timestamp, and freeze flag.
[0236] Furthermore, the tracking identifier of the current face in the target image is obtained, the record in the dynamic tracking status table is checked, and it is determined whether the target has a historical retention status, and whether it is a newly appeared target that is accessing for the first time, or a continuously tracked target that is still alive.
[0237] Step 502: If the current face is a newly emerging tracking target, generate a scheduling judgment result that indicates the triggering of recognition;
[0238] When a newly emerging target is identified, the decision instruction to initiate feature extraction and database matching is forcibly generated because the prior identity parameters corresponding to the identifier are lacking in memory.
[0239] It should be understood that the scheduling decision will drive the underlying processor to call deep neural network resources to complete the initial identity authentication and documentation operation for the unknown target.
[0240] Step 503: If the current face is a continuously tracked target, extract the historical recognition confidence and the historical best quality assessment results pre-stored for continuously tracked targets;
[0241] When a target is identified as a continuously tracked target, the system accesses the dynamic tracking status table, extracts the cosine similarity score of the target when it was last successfully matched and verified, and introduces it as the historical recognition confidence score into the scheduling operation.
[0242] At the same time, the system reads the highest quality score data recorded during the target's lifespan as the best historical quality assessment result.
[0243] Given that the local facial database deployed in smart energy unit terminals is usually limited to a few hundred people, the system directly uses the cosine similarity value between high-dimensional features as an equivalent probabilistic trust credential for subsequent calculations.
[0244] Step 504: Evaluate the environmental security of the currently acquired image and determine whether the current image is a valid frame that meets the brightness security constraints;
[0245] Alternatively, it can be said that the environmental safety of the target image is assessed to determine whether the target image is a valid frame that meets the brightness safety constraints.
[0246] In industrial environments, camera equipment may encounter severe interference such as direct sunlight from high beams or momentary backlighting. Therefore, environmental safety can be assessed by obtaining the global average brightness of the entire image.
[0247] For example, the preset brightness safety constraint can be set to a global average brightness within the range of 5-250. When the calculated global average brightness is ≥5 and ≤250, the system determines that the image is within the normal light-sensing range and marks it as a valid frame.
[0248] The global average brightness of the target image, i.e. the current frame image obtained after subsequent denoising and enhancement processing of the brightness-corrected image, is calculated, and an environmental safety determination is performed.
[0249] Step 505: When a frame is determined to be invalid and does not meet the brightness safety constraints, a freeze operation is performed on the time decay state of the continuously tracked target.
[0250] When the global average brightness is <5 or >250, severe blinding illumination interference is identified, and the current image is an invalid frame with abnormal exposure. To address this, the system changes the flag state of the target object in the dynamic tracking status table, activating the freeze flag to block the evolution of the time decay variable under normal conditions.
[0251] Step 506: When calculating the tracked duration, remove the time periods that are in a frozen state, and calculate and update the real-time tracking confidence based on the effective tracking duration and the historical identification confidence.
[0252] When accumulating the time intervals between consecutive occurrences of the continuously tracked target, the system pauses the increment of the timer accumulator parameter, removing invalid time spans that are frozen from the total duration. After obtaining the uncontaminated time accumulation using the anomaly filtering mechanism, it can be output to the subsequent confidence dimensionality reduction module for processing.
[0253] Step 507: Based on the tracking duration and historical identification confidence obtained from the tracking status of the continuously tracked target, construct a real-time tracking confidence that decreases over time;
[0254] Furthermore, the passage of time leads to a decrease in identity trust parameters. Based on this, a nonlinear model is constructed to decay historically accumulated trust credentials in the form of an exponential function. The corresponding calculation formula is as follows:
[0255] C_t = C_0 × exp(-λ × ∆_t);
[0256] Where C_t is the real-time tracking confidence level, C_0 is the historical identification confidence level, λ is the preset decay rate, and ∆_t is the effective tracking duration obtained from the preceding calculation.
[0257] In this embodiment, the preset attenuation rate can be set to 0.05 based on the operating cycle of the smart energy unit.
[0258] The system employs an exponentially distributed mapping relationship, maintaining a gradual decrease in parameters during the initial phase after the target has been connected and its identity confirmed. This decrease accelerates after a certain period of continuous operation, forcing the system to update the comparison results.
[0259] As an alternative, in scenarios with stringent requirements for terminal power consumption and a high tolerance for identity hijacking risks, the system can also degenerate into a binary static scheduling mode. That is, the decay rate parameter is directly assigned a value of 0, and only the spatial continuity of the tracking identifier is checked, maintaining the initial identity determination variable constant within a continuous period in which the identifier is not lost.
[0260] Step 508: Combine the real-time tracking confidence, the historical best quality assessment results, and the real-time quality assessment results to generate a scheduling decision result for the continuously tracked target.
[0261] The real-time tracking confidence level is compared with the pre-configured confidence level security threshold.
[0262] The system obtains the real-time tracking confidence variable obtained from the calculation and performs a subtraction comparison with the pre-configured confidence safety threshold in the memory.
[0263] Used to build a hard security baseline based on the time dimension to prevent identity verification from failing due to the target's long-term presence.
[0264] Alternatively, calculate the incremental quality improvement of the real-time quality assessment results relative to the best historical quality assessment results, and compare the incremental quality improvement with the pre-configured quality improvement threshold.
[0265] In another computational branch, the real-time quality assessment result fed back by the current frame image quality scoring module is obtained, and a subtraction operation is performed: real-time quality assessment result - historical best quality assessment result = quality improvement increment. Subsequently, the obtained numerical parameter is evaluated against a pre-configured quality improvement threshold to determine whether the current input information has data replacement value.
[0266] When the real-time tracking confidence level is lower than the confidence level safety threshold, or when the quality improvement increment reaches the quality improvement magnitude threshold, a scheduling judgment result that triggers identification is generated;
[0267] The dual-line comparison logic constitutes the triggering mechanism of the NOT gate association. Taking an operational scenario as an example, after an operator completes the initial authentication, the real-time tracking confidence level maintained by the system gradually decreases exponentially as the duration of continuous operation accumulates. If the initial authentication score is high, this variable can remain above the confidence level safety threshold within a few seconds of effective operation time, blocking redundant re-identification requests for the same operator. Once the operation time exceeds the safety validity period and the confidence level falls below the safety threshold, the re-identification process is triggered, ensuring the timeliness of identity verification.
[0268] In some embodiments, a predetermined confidence level security threshold can be set to 0.60.
[0269] On the other hand, a pre-configured quality improvement threshold can be set to 0.15. Assume the best historical quality assessment result corresponding to the last successful verification of the target was 0.65. In subsequent frames, a clear frontal facial image is acquired, with a real-time quality assessment result of 0.82. The calculated increment is 0.82 - 0.65 = 0.17. Since 0.17 > 0.15, even if the real-time tracking confidence level at the current time is > 0.60, the system will still perform a step-by-step intervention, activating the decision signal that triggers recognition, to proactively replace low-quality historical features with high-definition data.
[0270] If any of the above triggering conditions are not met, an instruction is generated to maintain the historical identity and not trigger the scheduling judgment result of the extraction and matching process.
[0271] When the real-time tracking confidence level is ≥0.60 and the calculated quality improvement increment is <0.15, the system confirms that the identity trust parameters of the current face target are within the safe operating domain, and that there is no need to update the image data. The system outputs instruction codes that directly inherit the historical matching identity information status, physically truncating the transmission channel of the target image data to the feature extraction network and cosine distance metric module, and intercepting the hardware power consumption generated by redundant feature calculations.
[0272] This invention employs a dual-mode detection mechanism based on constant-rate prediction and a dynamic scheduling model based on confidence decay to address the problems of high computational overhead in full-map detection and wasted computing power due to redundant identification. When the target is stably tracked, full-map scanning is skipped, and unnecessary feature network inference operations are intercepted based on the time decay rule. This reduces the system's computing power requirements from the full-map frame-by-frame level to the local verification and on-demand scheduling level, thereby improving the concurrent processing capacity of edge devices.
[0273] In other embodiments, when the system decides to update features, the template quality is improved through weighted fusion of features from multiple observations. Simultaneously, a consistency check mechanism is used to prevent non-personal facial features from contaminating the template due to tracking errors. Specifically:
[0274] Step 601: Calculate the feature consistency between the current facial features and the historical facial feature templates;
[0275] Optionally, during the detection of consecutive video frames, the tracking bounding box maintained by algorithms such as intersection-union may shift due to background texture interference or multiple people intersecting, capturing facial information of background or non-target individuals. Therefore, the spatial distance between the current facial features and the historical facial feature templates residing in memory can be quantitatively evaluated by calculating the cosine similarity between two feature vectors.
[0276] The calculated similarity score represents the consistency of features.
[0277] Step 602: When the feature consistency meets the pre-configured consistency verification threshold, obtain the pre-stored historical best quality assessment result associated with the historical face feature template;
[0278] As an example, the pre-configured consistency check threshold can be set to 0.60. When the calculated feature consistency value is greater than or equal to 0.60, the system determines that the currently extracted facial features and historical features belong to the same physical individual, and no identity confusion has occurred.
[0279] Furthermore, the highest quality score data recorded for the continuously tracked target within the historical period is extracted from the dynamic tracking status table, i.e., the best historical quality assessment result is obtained, providing reference parameters for subsequent weighted calculations.
[0280] Step 603: Using the real-time quality assessment result and the historical best quality assessment result as weights, perform weighted fusion on the current face feature and the historical face feature template to generate a fused feature vector;
[0281] Furthermore, if new features are directly used to overwrite old templates in each recognition, high-value historical information will be lost; while if indiscriminate average fusion is used, the overall template's representational ability will be reduced if the current frame suffers from low quality due to motion blur. Therefore, the system introduces a weighted fusion strategy based on quality scores, calculated as follows:
[0282] F_fused=(Q_new×F_new+Q_stored×F_stored) / (Q_new+Q_stored);
[0283] In the formula, Q_new is the real-time quality assessment result, F_new is the current face feature, Q_stored is the historical best quality assessment result, and F_stored is the intermediate feature vector after weighted fusion before normalization corresponding to the historical face feature template F_fused.
[0284] Based on this, after calculating the fusion pre-vector using the formula, a second length normalization process is performed on it to obtain a fusion feature vector of unit length, which corresponds to the normalized fusion feature vector.
[0285] Since facial feature extraction networks typically map features to a high-dimensional hyperspherical space, the computational process of weighted fusion and renormalization is approximately equivalent to spherical linear interpolation. Using multi-frame observation data for fusion processing can average and suppress random high-frequency components caused by environmental noise or quantization errors.
[0286] For example, assuming the obtained real-time quality assessment result is 0.85 and the historical best quality assessment result is 0.65, then during the fusion process, the new observation features with higher quality will account for about 56.7% of the weight, causing the updated template vector to be more inclined to represent the direction in the hyperspherical space.
[0287] Step 604: Update the historical face feature template using the fused feature vector, and update the pre-stored historical recognition confidence based on the rematch score of the fused feature vector in the face database.
[0288] For example, the output fused feature vector can be used to directly overwrite the old template in memory. Since multi-frame fusion filters out the random white noise generated by single-frame acquisition, the distribution of the fused feature vector is closer to the ideal baseline features registered by the target person in the database. Therefore, when a cosine comparison is performed using the updated template against the face database, the resulting rematch score usually shows a numerical improvement.
[0289] For example, the improved rematch score is used as a new parameter to overwrite the pre-stored historical identification confidence.
[0290] Based on this, the updated parameters are input into the confidence decay model. According to the exponential decay function, an increase in the initial confidence level will prolong the time it takes for the variable to fall below the safe threshold.
[0291] For example, since quality fusion improves the initial value of historical recognition confidence, according to the exponential decay law, the improvement of the initial value will correspondingly extend the effective tracking time required for the confidence to reach the safety threshold, further extending the deduplication recognition cycle and reducing the overall computing power consumption.
[0292] Step 605: When the feature consistency is lower than the consistency verification threshold, it is determined that the tracking of the current face has drifted. The historical face feature template is directly reset using the current face features, the historical recognition confidence is reset to the initial value, and the pre-stored historical best quality assessment result is reset to the real-time quality assessment result of the current frame.
[0293] When the calculated feature consistency value is less than 0.60, it is determined that the underlying detection and tracking mechanism has experienced target loss or crosstalk. The system will forcibly implement a clearing and blocking policy to prevent irrelevant features from contaminating historical templates and to ensure the secure access protocol of device units.
[0294] Next, all cached feature data is discarded, and the newly extracted low-consistency facial features are written into memory as the initial baseline. Simultaneously, the associated highest quality score is reset to the real-time quality assessment result of the current frame. This reset operation can be used to handle extreme interference.
[0295] In a further embodiment, before the system runs, offline training and fixed-point quantization techniques are performed to construct a facial feature extraction model that can run on edge devices with limited computing power, such as smart energy units. This process can specifically involve the following steps:
[0296] Step 701: Extract the current facial features from the target image. This can be done using a pre-deployed feature extraction model, which is built through the following offline process:
[0297] Invoke the initial network containing depthwise separable convolutional structures;
[0298] Accordingly, a lightweight network architecture based on depthwise separable convolutions as the basic computing unit can be selected to adapt to the computing power and memory constraints of the smart energy unit terminal. In the offline construction phase, an initial network based on depthwise separable convolutions as the basic computing unit was designed and constructed.
[0299] For example, the initial network can specifically adopt the lightweight mobile network MobileNetV2 architecture, with a width factor of 0.5 to further reduce the number of channels. This network receives a 112×112 pixel three-channel image as input after affine transformation alignment, performs feature downsampling and high-dimensional space mapping through stacked inverse residual modules, and outputs a 128-dimensional feature vector by a global average pooling layer.
[0300] It should be understood that this architecture utilizes a grouped convolution mechanism, which can compress the amount of multiply-accumulate operations to less than 1 / 10 of that of traditional standard convolution while maintaining the feature receptive field.
[0301] Step 702: Iteratively train the initial network using the pre-collected training sample set. During training, a loss function designed to increase the difference between inter-class features is used to constrain the update of network parameters to obtain the pre-trained network.
[0302] Furthermore, by utilizing a pre-collected training sample set containing a massive number of face images, forward propagation and backward parameter updates can be performed. Alternatively, a classification loss function based on additional angular margin, such as the additive angular margin loss algorithm ArcFace, can be used as a supervisory constraint. This loss function introduces a constant angular margin into the angle between the feature vector and the corresponding class weight vector, forcibly widening the distance between different identity features in the angular space and compressing the intra-class variance of the same identity feature. After iterative convergence, the network weights are preserved, outputting a pre-trained network with strong identity recognition capabilities.
[0303] Furthermore, before performing iterative training, domain-adaptive data augmentation can be applied to the pre-collected training sample set. Specifically, based on the physical distribution of the illumination deviation index, random gamma correction perturbations and non-uniform illumination masks in local areas are superimposed on standard face images in the sample set. Artificially generated augmented samples with extreme highlights and heavy shadows are used to enable the initial network to learn illumination-independent identity features during the feature mapping stage.
[0304] In some embodiments, the optimization process for network parameters during iterative training is configured as follows:
[0305] Optionally, the initial network can be iteratively trained using optimization methods such as stochastic gradient descent, and the hyperparameters during training can be determined by tuning methods such as cross-validation or grid search.
[0306] Hyperparameters include learning rate, momentum, batch size, and number of training epochs.
[0307] Therefore, the value of the classification loss function tends to stabilize, and the output is a pre-trained network with convergent weights.
[0308] Step 703: Perform fixed-point quantization on the pre-trained network to map the network parameters from high-precision floating-point numbers to low-precision integers, thereby obtaining a feature extraction model adapted to edge computing devices.
[0309] After obtaining the pre-trained network, its weights and activation values are initially stored in 32-bit floating-point format. Optionally, an 8-bit integer INT8 fixed-point quantization operation can be performed on the pre-trained network using an offline calibration dataset. This operation calculates the dynamic range of the output values of each convolutional layer, calculates the scaling factor and zero-point offset, and maps the high-precision floating-point numbers to 8-bit low-precision integers.
[0310] After quantization, the model's storage volume is reduced to 1 / 4 of the original, and the inference speed is increased several times. The output feature extraction model is packaged and pre-deployed in the device's non-volatile memory for online runtime.
[0311] This invention employs a quality-weighted progressive feature fusion method to filter out random noise and improve the purity of feature templates, thereby extending the identity verification-free period. Combined with fixed-point quantization deployment of the model, it overcomes the resource constraints of the underlying hardware, achieving high-precision real-time recognition with low power consumption.
[0312] In other embodiments, a light sensor is installed in the smart energy unit device to monitor the light intensity of the on-site environment in real time;
[0313] After the camera captures an image, it dynamically adjusts the brightness and contrast of the image based on the light data provided by the light sensor. When the light intensity is below the threshold, a histogram equalization algorithm is used to enhance the image brightness, and when the intensity is too high, a gamma correction algorithm is used to reduce the image brightness.
[0314] Furthermore, Gaussian filtering can be used to remove noise from the image and improve image quality, while edge enhancement algorithms can highlight key features in the image, such as facial contours and eyes, facilitating subsequent feature extraction.
[0315] Furthermore, the preprocessed image undergoes four processes: face detection, face quality assessment, face feature extraction, and face comparison. Only faces with scores exceeding a threshold in face detection and face quality assessment will proceed to the face comparison process. Face comparison involves comparing the feature values of the current face with those stored in a face database; a successful comparison occurs when the result exceeds a set threshold.
[0316] For example, the algorithm model can employ a convolutional neural network (CNN), which improves algorithm performance through multiple layers of convolution and pooling operations.
[0317] Furthermore, data augmentation techniques, such as random rotation, scaling, and cropping, can be used to expand the training samples and improve the model's generalization ability. Alternatively, a large amount of labeled data can be used to train the model and optimize the feature extraction process.
[0318] Furthermore, face tracking algorithms can be introduced to avoid repeatedly performing face detection and feature extraction operations when the same person with the same tracking ID is detected, thereby optimizing the algorithm's runtime and reducing energy consumption.
[0319] Optionally, on the device system settings page, click on face registration. After the face detection and face quality assessment algorithm scores are greater than a set threshold, face features can be extracted and entered into the face database. The face database uses an embedded SQLite database for storage, which stores personnel information such as name, ID number, and face feature values.
[0320] It should be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.
Claims
1. A face recognition method based on a smart energy unit, characterized in that, include: Acquire the ambient light intensity and real-time raw images; The illumination deviation index is calculated based on the ambient light intensity. Closed-loop adaptive preprocessing is then performed on the original image based on the illumination deviation index to obtain a brightness-corrected image. The brightness-corrected image is denoised and edge-enhanced to obtain the target image; Perform face detection and tracking on the target image to determine the current face tracking status and real-time quality assessment results; The tracking status, real-time quality assessment results, and historical recognition confidence of the current face are combined to perform dynamic scheduling and obtain the scheduling determination result. When the scheduling judgment result indicates that recognition is triggered, the current face features are extracted from the target image, the current face features are matched with the face database, and the identity verification result is output. Among them, the joint tracking status, real-time quality assessment results and the historical recognition confidence of the current face are dynamically scheduled to obtain the scheduling judgment result, including: identifying whether the current face is a continuously tracked target based on the tracking status; If the current face is a newly emerging tracking target, a scheduling decision result indicating trigger recognition is generated. If the current face is a continuously tracked target, historical recognition confidence and historical best quality assessment results for continuously tracked targets are extracted. Based on the tracking duration and historical recognition confidence of the continuously tracked target, a real-time tracking confidence that decreases over time is constructed. The real-time tracking confidence, historical best quality assessment results, and real-time quality assessment results are combined to generate a scheduling decision result for continuously tracked targets. Specifically, the real-time tracking confidence is compared with a pre-configured confidence safety threshold. The quality improvement increment of the real-time quality assessment result relative to the historical best quality assessment result is calculated, and the quality improvement increment is compared with a pre-configured quality improvement magnitude threshold. When the real-time tracking confidence is lower than the confidence safety threshold, or when the quality improvement increment reaches the quality improvement magnitude threshold, a scheduling decision result indicating trigger recognition is generated. When none of the above triggering conditions are met, a scheduling decision result indicating maintenance of historical identity and not triggering the extraction and matching process is generated. Specifically, based on the tracking duration and historical recognition confidence of the continuously tracked target, a real-time tracking confidence that decreases over time is constructed. This includes: assessing the environmental safety of the currently acquired image and determining whether the current image is a valid frame that meets the brightness safety constraints; when it is determined to be an invalid frame that does not meet the brightness safety constraints, performing a freeze operation on the time decay state of the continuously tracked target; and when calculating the tracking duration, removing the time period in the frozen state so as to calculate and update the real-time tracking confidence based on the valid tracking duration.
2. The method according to claim 1, characterized in that, A closed-loop adaptive preprocessing method is performed on the original image based on the illumination deviation index to obtain a brightness-corrected image, including: The feedforward adjustment parameters are determined based on the illumination deviation index; The brightness and contrast of the original image are adjusted using feedforward adjustment parameters to obtain a preliminary corrected image; Extract the global mean brightness of the preliminarily corrected image; Based on the difference between the global average brightness and the pre-configured target average brightness, the feedback correction parameters are calculated; The initial corrected image is corrected using feedback correction parameters to obtain a brightness corrected image.
3. The method according to claim 2, characterized in that, The feedforward adjustment parameters are determined based on the illumination deviation index, including: When the ambient light intensity is lower than the pre-configured low light threshold, the limit parameter for local contrast enhancement is calculated based on the light deviation index, and the limit parameter is used as the feedforward adjustment parameter. When the ambient light intensity is higher than the pre-configured high light threshold, the exponential parameter for global brightness correction is calculated based on the light deviation index, and the exponential parameter is used as the feedforward adjustment parameter.
4. The method according to claim 1, characterized in that, The brightness-corrected image is denoised and edge-enhanced to obtain the target image, including: Establish a positive correlation mapping relationship between the range of edge-preserving smoothing filter smoothing intensity parameters and the illumination deviation index; Based on the positive correlation mapping relationship and the current illumination deviation index, calculate the required range smoothing intensity parameter; An edge-preserving smoothing filter with a range smoothing intensity parameter is used to denoise the brightness correction image, resulting in a smoothed and denoised image. Edge enhancement processing is performed on the smoothed and denoised image to obtain the target image.
5. The method according to claim 1, characterized in that, Perform face detection and tracking on the target image, determine the current face tracking status and real-time quality assessment results, including: Obtain historical tracking status, and determine the detection mode for the target image between the full-map discovery mode and the region prediction tracking mode based on the activity index of the historical tracking status. When the detection mode is full-image discovery mode, a global feature search is performed on the target image to obtain the face localization result, and the extracted reference image block is pre-stored; When the detection mode is the region prediction tracking mode, the face localization result is obtained by searching and verifying within a local region of the target image based on the historical tracking status. Based on the face localization results, tracking and matching are performed to update the current face tracking status, and real-time quality assessment results are extracted from the face localization results.
6. The method according to claim 1, characterized in that, The process of generating real-time quality assessment results and outputting authentication results also includes the following threshold linkage: A reverse linkage adjustment model is constructed based on the illumination deviation index, and dynamic quality admission threshold and dynamic feature matching threshold are generated using the reverse linkage adjustment model. Among them, the dynamic quality admission threshold is negatively correlated with the illumination deviation index, while the dynamic feature matching threshold is positively correlated with the illumination deviation index. When the real-time quality assessment results reach the dynamic quality access threshold, the currently tracked target is allowed to enter the dynamic scheduling process. After extracting the current face features, calculate the feature similarity between the current face features and the face database; When the feature similarity reaches the dynamic feature matching threshold, the match is considered successful and the authentication result is output.
7. The method according to claim 1, characterized in that, The update includes: Calculate the feature consistency between the current facial features and historical facial feature templates; When the feature consistency meets the pre-configured consistency verification threshold, obtain the best historical quality assessment result associated with the historical face feature template; The current facial features and historical facial feature templates are weighted and fused using real-time quality assessment results and historical best quality assessment results, respectively, to generate a fused feature vector. The historical face feature template is updated using the fused feature vector, and the historical recognition confidence is updated synchronously based on the rematch score of the fused feature vector in the face database. When the feature consistency is lower than the consistency verification threshold, it is determined that the tracking of the current face has drifted, and the historical face feature template is directly reset using the current face features.
8. The method according to claim 1, characterized in that, When extracting current facial features from a target image, a pre-deployed feature extraction model is used to perform the feature extraction operation. The feature extraction model is built through the following offline process: Invoke the initial network containing depthwise separable convolutional structures; The initial network is iteratively trained using the training sample set, and the update of the network parameters is constrained by the loss function during training to obtain the pre-trained network. Fixed-point quantization is performed on the pre-trained network to map the network parameters from high-precision floating-point numbers to low-precision integers, resulting in a feature extraction model adapted to edge computing devices.
Citation Information
Patent Citations
Face recognition system and detection method thereof
CN121259897A
Real-time face recognition tracking method based on multi-modal features and time sequence backtracking
CN121883533A