A home camera terminal side privacy area dynamic desensitization processing system and method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-11
AI Technical Summary
现有固定遮蔽方式通常难以准确处理云台旋转后的隐私区域映射问题,当云台发生水平旋转或者俯仰旋转后,原先定义的隐私区域可能不再对应当前画面中的实际隐私位置,从而造成遮蔽失效或者错误遮蔽
本发明在家用摄像头设备端完成目标检测、目标分割、像素交集计算、脱敏处理、时序一致性处理和编码输出,无需将原始视频流上传至云端服务器后再进行隐私处理,从而降低原始视频流在网络传输、云端存储或者云端处理过程中发生泄露的风险,减少对云端计算资源和网络连接质量的依赖,提高隐私区域动态脱敏处理的实时性。
Smart Images

Figure CN122554720A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart camera technology, and in particular to a dynamic desensitization processing system and method for the privacy area of a home camera. Background Technology
[0002] With the widespread use of smart home cameras in scenarios such as home security, elderly care, childcare, pet monitoring, doorbell monitoring, and remote viewing, the video footage captured by these cameras often includes information about family members, visitors, neighbors, and pedestrians in public passageways. This video information may include private content such as faces, body outlines, behavioral actions, home environment, and activity trajectories. If the raw video stream captured by the camera is stored, uploaded, or transmitted over the network without processing, it can easily lead to the risk of personal privacy leaks.
[0003] Existing privacy protection methods for home security cameras mainly include cloud processing, fixed-area masking, physical obstruction, and simple edge detection. Cloud processing typically involves uploading the raw video captured by the camera to a cloud server, where it performs human detection, face detection, or image anonymization before distributing it to the user. While this method can utilize cloud computing resources to perform complex image processing, the raw video remains vulnerable to interception, leakage, or unauthorized access during uploading, storage, and cloud processing. Furthermore, this method relies on network connectivity, resulting in high end-to-end latency, making it difficult to meet real-time privacy protection requirements.
[0004] Fixed-area masking typically involves setting a fixed obstruction block in the camera's view, such as a black block, mosaic block, or a fixed blurred area, to block the user's preset privacy area. This method is relatively simple to implement, but it can only obstruct fixed positions in the view and cannot dynamically identify or target individuals based on whether they have entered the privacy area. When only part of the individual enters the privacy area, over-masking or under-masking can easily occur. Furthermore, when the camera has a pan-tilt-zoom (PTZ) function, the originally set fixed masking area can easily misalign with the actual privacy area as the camera's angle of view changes, causing the privacy protection to fail.
[0005] Physical obstruction methods typically use motor-driven baffles, lens caps, or other mechanical structures to block the camera lens, thereby preventing the camera from capturing images. While this method can reduce the risk of privacy leaks when the lens is blocked, the camera cannot continue to perform normal security monitoring functions, failing to simultaneously meet the needs of privacy protection and monitoring. Furthermore, physical obstruction structures increase hardware costs, assembly complexity, and the risk of mechanical failure, and cannot achieve refined protection of localized areas, localized targets, or specific privacy zones.
[0006] Furthermore, while some home security cameras possess on-device human detection, face detection, or motion detection capabilities, these functions are typically used primarily for motion alarms, event alerts, or target recognition. They lack a comprehensive privacy protection mechanism that integrates user-defined privacy areas, on-device pixel-level desensitization, reliable isolation of the original video stream, continuous frame stabilization, and anomaly fallback protection. Simply applying mosaic or blurring based on ordinary bounding box detection results can easily lead to inaccurate human edge occlusion, mis-occlusion of background areas, and missed occlusion of privacy areas. Simultaneously, AI detection results may exhibit positional jitter, size changes, or short-term missed detections between consecutive video frames, causing flickering and abrupt changes in desensitized areas, impacting the viewing experience and the stability of privacy protection.
[0007] Furthermore, existing privacy masking solutions typically employ a uniform masking intensity or a fixed desensitization method, making it difficult to provide differentiated protection based on the privacy sensitivity of different home scenarios. For example, the privacy sensitivity of high-privacy areas such as bedrooms, bathrooms, and dressing areas differs from that of areas such as living rooms, doorways, and hallways. Using the same desensitization intensity may result in insufficient protection for highly sensitive areas or reduced usability of images in low-sensitivity areas.
[0008] Furthermore, when the camera has a gimbal rotation function, the privacy area preset by the user needs to be repositioned as the gimbal angle changes. Existing fixed masking methods often struggle to accurately handle the mapping of privacy areas after gimbal rotation. When the gimbal rotates horizontally or in pitch, the previously defined privacy area may no longer correspond to the actual privacy location in the current image, resulting in masking failure or incorrect masking.
[0009] Meanwhile, existing solutions typically lack effective security fallback mechanisms in situations such as AI inference failure, abnormal access to the raw video stream, insufficient system resources, abnormal device temperature, storage anomalies, or network anomalies. Once the detection algorithm fails or the system malfunctions, privacy areas may not be desensitized in time, or the raw video stream may be at risk of unauthorized access, storage, or output, making it difficult to guarantee the reliability of privacy protection in abnormal scenarios.
[0010] Therefore, existing home camera privacy protection technologies have at least the following shortcomings: First, cloud processing requires uploading the original video stream, which poses a risk of data leakage and high network latency; second, fixed-area masking methods cannot adapt to scenarios where dynamic targets enter the privacy area, and are prone to failure after the pan-tilt unit rotates; third, physical masking methods affect the normal monitoring function of the camera and have complex structures; fourth, simple edge detection methods lack reliable isolation and systematic desensitization protection for the original video stream; fifth, ordinary detection desensitization methods are prone to problems such as missed masking, false masking, and flickering of desensitized areas in consecutive frames; sixth, existing solutions cannot configure differentiated desensitization strategies according to different privacy-sensitive areas; and seventh, existing solutions lack effective security fallback mechanisms when AI inference is abnormal, the original stream access is abnormal, system resources are abnormal, device temperature is abnormal, storage is abnormal, or the network is abnormal. Summary of the Invention
[0011] To address the problems existing in the prior art, this invention provides a dynamic desensitization processing system and method for privacy areas on the home camera side. This allows users to customize privacy areas through the application, enabling the camera to perform real-time detection and dynamic desensitization of targets entering the privacy area on the device side. At the same time, it restricts access to and output of the original video stream, improves the stability of continuous frame desensitization, supports automatic relocation of privacy areas in pan-tilt rotation scenarios, and maintains basic privacy protection capabilities in abnormal situations.
[0012] To achieve the above objectives, the present invention provides a dynamic desensitization processing system for privacy areas on the home camera side, characterized in that it includes: a video acquisition module, a privacy area management module, a trusted isolation dual-stream module, an AI inference module, a desensitization processing module, a timing consistency module, an anomaly rollback module, and an encoding output module; The video acquisition module is used to acquire the raw video stream from the camera from the image sensor and output the raw video stream to the raw stream buffer of the trusted isolated dual-stream module; The privacy area management module is used to receive privacy area information defined by the user through the application, store the privacy area information, generate a corresponding privacy area mask based on the privacy area information, and output the privacy area mask to the de-identification processing module. The trusted isolation dual-stream module is used to write the original video stream and the desensitized video stream into buffers with different access permissions on the device side. The trusted isolation dual-stream module includes an original stream buffer and a processed stream buffer. The original stream buffer provides the original video frames to the AI inference module and the desensitization processing module, and the processed stream buffer provides the desensitized video frames to the encoding output module, so that the original video stream is only used for target recognition and desensitization processing within the device side. The AI inference module is used to obtain the original video frame from the trusted isolated dual-stream module, perform target detection or target segmentation on the original video frame based on a lightweight neural network, generate a target region mask, and output the target region mask to the desensitization processing module and the timing consistency module. The desensitization processing module is used to receive the privacy region mask, the target region mask, and the tracking prediction result output by the timing consistency module, calculate the pixel intersection between the target region mask and the privacy region mask, perform desensitization processing on the region corresponding to the pixel intersection, generate a desensitized video stream, and write the desensitized video stream into the processed stream buffer of the trusted isolation dual-stream module. The timing consistency module is used to receive the target region mask output by the AI inference module and the pixel intersection region determined by the desensitization processing module, and to perform tracking prediction and smoothing processing on the target region mask, pixel intersection region or desensitized region in consecutive video frames. The smoothed desensitized region position, size or boundary is output to the desensitization processing module to reduce the jitter or flicker of the desensitized region between consecutive frames. The anomaly rollback module is used to monitor the operating status of the AI inference module, the trusted isolation dual-stream module, the desensitization processing module, and the encoding output module. When at least one of the following occurs: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly, the module sends a corresponding rollback control command to the desensitization processing module or the encoding output module to trigger the corresponding security rollback strategy and maintain the privacy protection status. The encoding output module is used to read the desensitized video stream from the processed stream buffer of the trusted isolated dual-stream module, encode the desensitized video stream, and output the encoded video stream to the local storage module or the network module.
[0013] Preferably, the trusted isolation dual-stream module further includes a DMA channel isolation unit; The raw stream buffer is used to store the raw video stream acquired by the video acquisition module, and is only accessible to the video acquisition module, the AI inference module, and the desensitization processing module. The processed stream buffer is used to store the desensitized video stream after processing by the desensitization processing module, and is accessible by the encoding output module, local storage module or network module; The trusted isolation dual-stream module configures access permission tables through at least one of the memory management unit, trusted execution environment, and bus access control unit to prohibit the network module, local storage module, encoding output module, or external interface from directly accessing the original stream buffer. The DMA channel isolation unit is used to configure the video acquisition DMA to write data only to the raw stream buffer, configure the encoder DMA to read data only from the processed stream buffer, and lock the transfer address range of the DMA descriptor to prevent the raw video stream from being written to a storage area accessible by an external interface during operation.
[0014] Preferably, the AI inference module includes a pixel-level instance segmentation unit; The pixel-level instance segmentation unit is used to detect human targets in video frames using a lightweight instance segmentation network, and generate a corresponding human instance mask for each detected human target. The desensitization processing module is used to perform pixel-level intersection calculation between the humanoid instance mask and the privacy region mask, and to perform at least one of the following processing on the intersection region: mosaic, blur, solid color occlusion or silhouette. The timing consistency module is used to assign tracking identifiers to targets entering privacy regions in consecutive video frames, and to associate pixel intersection regions or desensitized regions in consecutive frames based on the tracking identifiers. The timing consistency module is also used to predict the position of the target in the next frame using Kalman filtering, and to verify the predicted position by combining the optical flow field between adjacent frames. Then, the position, size or boundary of the desensitized area is smoothed by low-pass filtering. When the AI inference module misses a target for a short period of time or the target is occluded, the temporal consistency module maintains the corresponding desensitized region according to the Kalman filter prediction result; when the number of consecutive missed frames does not exceed the preset frame threshold, the predicted desensitized region continues to be desensitized; when the number of consecutive missed frames exceeds the preset frame threshold, the tracking and desensitization of the region corresponding to the target is suspended.
[0015] Preferably, it also includes a regional risk classification module; The regional risk classification module is used to determine the corresponding risk level based on the privacy sensitivity of the privacy area, and to configure different de-identification strategies for different risk levels. The privacy area includes a high-risk area, a medium-risk area, and a low-risk area. The high-risk area corresponds to a strong desensitization strategy, the medium-risk area corresponds to a medium desensitization strategy, and the low-risk area corresponds to a weak desensitization strategy. The desensitization strategy includes at least one of the following: desensitization method, desensitization intensity, mosaic pixel block size, blur kernel parameters, occlusion color, and desensitization duration. When multiple privacy regions with different risk levels exist in the same video frame, the desensitization processing module performs desensitization processing of different intensities according to the risk level corresponding to each privacy region. When the camera has a gimbal mechanism, the system also includes a gimbal coordinate mapping module. The gimbal coordinate mapping module is used to map the privacy region from the world coordinate system or the gimbal coordinate system to the image coordinate system according to the user-defined privacy region information and the current gimbal angle, so as to update the position of the privacy region mask in the current video frame. The gimbal coordinate mapping module is also used to update the gimbal rotation matrix according to the current horizontal rotation angle and pitch angle of the gimbal, and to calculate the image coordinates of the privacy region vertex in the current video frame according to the transformation from the world coordinate system to the camera coordinate system and the projection transformation from the camera coordinate system to the image coordinate system. The transformation from the world coordinate system to the camera coordinate system satisfies: P_camera=R_PT·R_base·(P_world-T_base), Where P_world is the coordinate of the privacy region vertex in the world coordinate system, P_camera is the coordinate of the privacy region vertex in the camera coordinate system, R_PT is the gimbal rotation matrix determined according to the current gimbal horizontal rotation angle and pitch angle, R_base is the base rotation matrix corresponding to the camera mounting posture, and T_base is the translation vector corresponding to the camera mounting position. The projection transformation from the camera coordinate system to the image coordinate system satisfies: p_image=K·[P_camera.x / P_camera.z, P_camera.y / P_camera.z]^T, Where p_image is the coordinate of the vertex of the privacy region in the image coordinate system, K is the camera intrinsic parameter matrix, and P_camera.x, P_camera.y, and P_camera.z are the three-dimensional coordinate components of P_camera in the camera coordinate system, respectively. When all or part of the calculated privacy region vertices exceed the boundary of the current video frame, the gimbal coordinate mapping module marks the corresponding privacy region as invisible, partially visible, or visible. Specifically, when all vertices exceed the boundary of the current video frame, it is marked as invisible; when part of the vertices exceed the boundary of the current video frame, the boundary is clipped and marked as partially visible; and when the vertices do not exceed the boundary of the current video frame, it is marked as visible.
[0016] Preferably, the anomaly rollback module is used to trigger a corresponding rollback strategy when at least one of the following is detected: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly. When AI inference is abnormal, the abnormal rollback module controls the desensitization processing module to switch to a fixed privacy area masking mode. When the original stream access is abnormal, the abnormal rollback module controls the desensitization processing module to perform full-screen desensitization on the current video frame to be output or the cached video frame; when a valid video frame cannot be obtained, the abnormal rollback module controls the encoding output module to stop encoding output and record the abnormal log. When system resources or equipment temperature are abnormal, the abnormal rollback module controls the encoding output module to stop video encoding output or stop network uploading, and saves the abnormal log. When a network anomaly occurs, the anomaly rollback module controls the system to retain the anonymized video stream or anomaly log, without writing the original video stream to local storage, and to record the network anomaly event. Furthermore, the abnormal rollback module is also used to restore the normal working process of the AI inference module, the desensitization processing module, and the encoding output module after the abnormal state is resolved, and to verify the access permissions of the original stream buffer, the DMA channel configuration, and the output status of the processed stream buffer before restoring the normal working process.
[0017] This invention also provides a method for dynamic desensitization of privacy areas on the end side of a home security camera, comprising the following steps: S1: Acquire raw video stream from image sensor via video capture module on home camera device; S2: Receive privacy area information defined by the user through the application, and generate a corresponding privacy area mask based on the privacy area information; S3: The original video stream is written to the original stream buffer and the desensitized video stream is written to the processed stream buffer through a trusted isolation dual-stream architecture, so that the original video stream is only used for target recognition and desensitization processing within the device. S4: Perform target detection or target segmentation on the current video frame in the original video stream based on a lightweight neural network, and generate a target region mask; S5: Calculate the pixel intersection between the target region mask and the privacy region mask to obtain the region to be desensitized; S6: Track, predict and smooth the target area mask, pixel intersection area or area to be desensitized in consecutive video frames to determine the smoothed desensitized area. S7: Perform desensitization processing on the smoothed desensitized area to obtain desensitized video frames, encode the desensitized video frames, and output them to the local storage module or network module. S8: If at least one of the following is detected during processing: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly, trigger the corresponding anomaly rollback strategy.
[0018] Preferably, in step S3, the trusted isolated dual-stream architecture includes: The original video stream is stored in the original stream buffer, and the de-identified video stream is stored in the processed stream buffer. Configure access permission tables through the memory management unit, trusted execution environment, or bus access control unit; Configure the video capture DMA to write data only to the raw stream buffer, and configure the encoder DMA to read data only from the processed stream buffer; Direct access to the original stream buffer is prohibited by network modules, local storage modules, encoding output modules, or external interfaces. It also locks the transfer address range of the DMA descriptor to prevent the raw video stream from being written to a storage area accessible by an external interface during operation.
[0019] Preferably, in step S4, the human-shaped target in the current video frame is segmented at the pixel level based on a lightweight instance segmentation network to generate a human-shaped instance mask corresponding to the human-shaped target; In step S5, the pixel-level intersection of the humanoid instance mask and the privacy region mask is calculated, and only the intersection area that belongs to both the humanoid instance mask and the privacy region mask is determined as the area to be desensitized. The desensitization process includes at least one of mosaic processing, blurring processing, solid color masking processing, or silhouette processing. In step S6, a tracking identifier is assigned to the target entering the privacy region in consecutive video frames, the position of the target in the next frame is predicted using Kalman filtering, the predicted position is verified based on the optical flow field between adjacent frames, and the position, size or boundary of the desensitized region or the desensitized region in consecutive frames is smoothed. When a target is briefly occluded or missed in consecutive video frames, the corresponding desensitized area or desensitized area is maintained based on the Kalman filter prediction position; when the number of consecutive missed frames is less than or equal to a preset frame threshold, the desensitization process continues; when the number of consecutive missed frames is greater than the preset frame threshold, the tracking and desensitization of the area corresponding to the target is paused.
[0020] Preferably, in step S7, a corresponding desensitization strategy is determined based on the risk level of the privacy area, and desensitization processing is performed on the smoothed desensitized area according to the desensitization strategy; Among them, a strong desensitization strategy is used in high-risk areas, a medium desensitization strategy is used in medium-risk areas, and a weak desensitization strategy is used in low-risk areas. The desensitization strategy includes at least one of the following: desensitization method, desensitization intensity, mosaic pixel block size, blur kernel parameters, occlusion color, and desensitization duration. When there are multiple privacy regions with different risk levels in the same video frame, different levels of desensitization processing are performed according to the risk level corresponding to each privacy region. When the home camera device includes a pan-tilt mechanism, a pan-tilt coordinate mapping step is included before step S4: Get the current horizontal rotation angle and pitch angle of the gimbal; Update the gimbal rotation matrix based on the horizontal rotation angle and the pitch angle; Map the user-defined privacy region from the world coordinate system or the PTZ coordinate system to the image coordinate system corresponding to the current video frame; The privacy region mask is updated based on the mapped image coordinates; Mapping the user-defined privacy region from the world coordinate system to the image coordinate system corresponding to the current video frame includes: The coordinates of the privacy region vertices in the camera coordinate system are calculated using the following formula: P_camera=R_PT·R_base·(P_world-T_base), Where P_world is the coordinate of the privacy region vertex in the world coordinate system, P_camera is the coordinate of the privacy region vertex in the camera coordinate system, R_PT is the gimbal rotation matrix determined based on the current gimbal horizontal rotation angle and pitch angle, R_base is the base rotation matrix corresponding to the camera mounting posture, and T_base is the translation vector corresponding to the camera mounting position. The coordinates of the privacy region vertices in the image coordinate system are calculated using the following formula: p_image=K·[P_camera.x / P_camera.z, P_camera.y / P_camera.z]^T, Where p_image is the coordinate of the privacy region vertex in the image coordinate system, K is the camera intrinsic parameter matrix, and P_camera.x, P_camera.y, and P_camera.z are the three-dimensional coordinate components of P_camera in the camera coordinate system, respectively. When the mapped privacy region extends beyond the current video frame boundary, the corresponding privacy region is marked as invisible, and the desensitization process for that privacy region is paused. When a portion of the mapped privacy region extends beyond the current video frame boundary, a privacy region mask is generated for the visible portion within the current video frame, and the desensitization process for the visible portion continues. When the camera pan-tilt unit rotates to the privacy region and re-enters the current video frame, the corresponding privacy region is marked as visible, and the dynamic desensitization process for that privacy region is resumed.
[0021] Preferably, in step S8: When AI inference times out, AI inference returns an error code, the output data format is abnormal, or the confidence level of the target mask is lower than the preset threshold, switch to fixed privacy area masking mode. When an illegal access to the original stream buffer is detected but the current video frame to be output or the cached video frame can still be obtained, full-screen desensitization is performed on the current video frame to be output or the cached video frame; when a valid video frame cannot be obtained, encoding output is stopped and an exception log is recorded. When the processor usage, memory usage, or device temperature exceeds the corresponding safety threshold, stop video encoding output or network upload, and save the exception log; When a network anomaly prevents the upload of the anonymized video stream, retain the anonymized video stream or the anomaly log, do not write the original video stream to local storage, and record the network anomaly event. Furthermore, the target detection, target segmentation, pixel intersection calculation, desensitization processing, temporal consistency processing, and encoding output are all performed on the home camera device. The video stream uploaded to the cloud or output to an external interface is a video stream that has undergone desensitization processing.
[0022] The technical solution of this invention has the following beneficial effects: This invention completes target detection, target segmentation, pixel intersection calculation, desensitization processing, temporal consistency processing, and encoding output at the home camera device end, eliminating the need to upload the original video stream to a cloud server for privacy processing. This reduces the risk of leakage of the original video stream during network transmission, cloud storage, or cloud processing, reduces dependence on cloud computing resources and network connection quality, and improves the real-time performance of dynamic desensitization processing in privacy areas.
[0023] This invention employs a trusted isolation dual-stream architecture, writing the original video stream and the de-identified video stream into the original stream buffer and the processed stream buffer, respectively. It also combines at least one of the following—memory address domain isolation, DMA channel isolation, bus access control, memory management unit, or trusted execution environment—to restrict access permissions to the original stream buffer. This ensures that the original video stream is only accessible to the target identification module and de-identification processing module within the device, prohibiting direct access to the original stream buffer by network modules, local storage modules, encoding output modules, external interfaces, or unauthorized modules. This enhances the security and reliability of the original video stream during device-side processing.
[0024] This invention receives privacy area information defined by the user through the application via a privacy area management module, and generates a privacy area mask based on this information. This allows users to flexibly mark areas that need protection according to their actual home environment, such as bedrooms, bathrooms, children's rooms, living rooms, neighbor's windows, public passageways, or doorways. Compared to fixed global masking methods, this invention can provide localized dynamic protection for specific user-defined privacy areas, improving the flexibility and applicability of privacy protection.
[0025] This invention utilizes an AI inference module based on a lightweight neural network to perform target detection or segmentation on original video frames. A desensitization module calculates the pixel intersection between the target region mask and the privacy region mask, performing desensitization only on the region corresponding to this pixel intersection. Therefore, targeted desensitization can be performed when the target enters the privacy region, while retaining image information when the target does not enter the privacy region. This avoids indiscriminate occlusion of the entire human-shaped target, the entire video frame, or the entire privacy region, thereby improving the accuracy of desensitization and the usability of the security footage.
[0026] In a preferred embodiment, this invention employs pixel-level instance segmentation units to generate human-shaped instance masks. Compared to schemes that only use bounding box detection, pixel-level instance segmentation can more accurately fit the contours of human-shaped targets. By performing pixel-level intersection calculations between the human-shaped instance mask and the privacy region mask, the edge localization accuracy of the desensitized area can be improved, and the missed occlusion rate and false occlusion rate can be reduced. In experimental verification, the missed occlusion rate decreased from 3.2% to 1.2%, and the false occlusion rate decreased from 5.1% to 2.8%, thereby improving the accuracy of dynamic desensitization of the privacy region and the usability of the image.
[0027] This invention assigns tracking identifiers to targets entering privacy regions in consecutive video frames using a temporal consistency module. It then combines Kalman filtering, optical flow verification, and low-pass filtering to track, predict, and smooth target region masks, pixel intersection areas, or desensitized regions within consecutive frames. This reduces the impact of AI detection results on desensitized images due to boundary jitter, size jumps, or short-term missed detections between consecutive frames, lowers the flicker frequency in desensitized regions, and improves the stability and viewing experience of desensitized images in continuous video streams. In experimental verification, the flicker frequency in desensitized regions was reduced from 23 times / minute to 2 times / minute.
[0028] This invention uses a regional risk classification module to divide high-risk, medium-risk, and low-risk areas based on the privacy sensitivity of different monitoring areas, and configures different desensitization strategies for different risk levels. This enables differentiated protection in different privacy-sensitive scenarios, balancing the strength of privacy protection and the availability of security footage.
[0029] When the camera has a gimbal mechanism, this invention updates the gimbal rotation matrix based on the current horizontal and vertical rotation angles using a gimbal coordinate mapping module. It also maps the user-defined privacy region from the world coordinate system or the gimbal coordinate system to the image coordinate system corresponding to the current video frame, thereby updating the position of the privacy region mask in the current video frame. Therefore, even when the camera gimbal rotates, the system can still automatically track and relocate the privacy region, preventing fixed occlusion methods from failing due to changes in viewing angle in gimbal-equipped scenarios.
[0030] This invention monitors the operational status of the AI inference module, trusted isolation dual-stream module, desensitization module, and encoding output module through an anomaly fallback module. It executes corresponding security fallback strategies when AI inference fails, raw stream access fails, system resources fail, device temperature fails, storage fails, or network fails. For example, when AI inference fails, it switches to a fixed privacy region masking mode; when raw stream access fails but the current video frame to be output or a cached video frame is still available, it performs full-screen desensitization; when a valid video frame cannot be obtained, it stops encoding output and records an anomaly log; when system resources or device temperature fails, it stops video encoding output or network upload and saves the anomaly log. Therefore, basic privacy protection capabilities can be maintained under abnormal conditions, preventing privacy protection failure due to AI malfunction, insufficient resources, or unauthorized access, thus improving system reliability.
[0031] This invention can be applied to indoor cameras, outdoor cameras, doorbell cameras, and home smart cameras with pan-tilt mechanisms. It can dynamically process user-defined privacy zones, areas with different risk levels, and changes in the viewing angle after the pan-tilt mechanism rotates, thereby improving the system's adaptability in different home monitoring scenarios.
[0032] This invention utilizes the synergistic effects of edge-side AI inference, user-defined privacy regions, trusted dual-stream isolation, pixel-level instance segmentation, mask intersection desensitization, temporal consistency constraints, regional risk classification, PTZ coordinate mapping, and anomaly fallback mechanisms to form a complete closed loop from raw video acquisition, edge-side trusted processing, dynamic and precise desensitization to secure encoded output. While ensuring the normal security monitoring functions of home security cameras, this invention improves the trustworthiness, real-time performance, accuracy, stability, reliability, and scene adaptability of privacy protection. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of the overall architecture of the dynamic desensitization processing system for the privacy area of a home camera provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a trusted isolated dual-stream architecture provided in an embodiment of the present invention; Figure 3This is a schematic diagram illustrating the generation of a user-defined privacy region and a privacy region mask, provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of pixel-level instance segmentation and mask intersection desensitization provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of timing consistency processing provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of regional risk classification and differentiated desensitization strategy provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of gimbal coordinate mapping and privacy area relocation provided in an embodiment of the present invention; Figure 8 A flowchart illustrating the exception rollback mechanism provided in this embodiment of the invention; Figure 9 This is a flowchart of a method for dynamic desensitization of privacy areas on the end side of a home security camera, provided in an embodiment of the present invention. Figure 10 This is a schematic diagram of the end-side desensitization output closed loop provided in an embodiment of the present invention. Detailed Implementation
[0034] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0035] Reference Figures 1 to 10 This invention provides a dynamic desensitization processing system for privacy areas on the home camera side. This system can be applied to indoor cameras, outdoor cameras, doorbell cameras, and home smart cameras with pan-tilt mechanisms. The system completes raw video acquisition, privacy area management, trusted isolation dual-stream control, AI inference, pixel intersection calculation, desensitization processing, timing consistency processing, anomaly rollback processing, and encoding output at the camera device end. This ensures that the raw video stream is only controlled and used internally by the device, and the video stream uploaded to the cloud or output to an external interface is a desensitized video stream.
[0036] In one embodiment, the home camera's on-side privacy area dynamic desensitization processing system includes a video acquisition module, a privacy area management module, a trusted isolation dual-stream module, an AI inference module, a desensitization processing module, a timing consistency module, an anomaly rollback module, and an encoding output module. The trusted isolation dual-stream module includes a raw stream buffer and a processed stream buffer. The raw stream buffer stores the raw video stream acquired by the video acquisition module, and the processed stream buffer stores the desensitized video stream.
[0037] The video acquisition module connects to the image sensor of the camera and is used to acquire the raw video stream from the image sensor. The raw video stream can be in YUV, RGB, Bayer, or other video frame formats suitable for image processing. After acquiring the raw video frames, the video acquisition module can generate a corresponding frame number and timestamp for each raw video frame and write the raw video frame, frame number, and timestamp into the raw stream buffer of the trusted isolated dual-stream module. The raw stream buffer can be located in an independent physical memory area of the camera device's main control chip, or it can be located in a secure memory area protected by a memory management unit, a trusted execution environment, or a bus access control unit.
[0038] The privacy area management module receives privacy area information defined by the user through an application. This application can be a mobile app, tablet app, web management interface, or other user interaction terminal capable of communicating with the home security camera. Users can use the application to select areas requiring privacy protection within the camera's view, such as bedroom areas, children's play areas, neighbor's window areas, living room sofa areas, specific areas in public passageways, or doorways. These privacy areas can be rectangular, polygonal, circular, have freely drawn outlines, or be composite areas formed by combining multiple sub-areas.
[0039] The privacy region information may include privacy region number, region vertex coordinates, region outline, region type, risk level, desensitization method, desensitization strength, activation time period, whether PTZ tracking is enabled, and whether forced desensitization is required during network upload. After receiving the above privacy region information, the privacy region management module stores it in the device's configuration storage area and converts the privacy region information into the corresponding privacy region mask according to the current video frame resolution.
[0040] In one implementation, the privacy region mask is a binary mask image with the same resolution as the current video frame. Pixels belonging to the user-defined privacy region are assigned a first label value, and pixels not belonging to the privacy region are assigned a second label value. If the user defines multiple privacy regions, multiple privacy region masks can be generated separately, or a multi-value mask image containing different region numbers or risk level identifiers can be generated. After generating the privacy region mask, the privacy region management module outputs the privacy region mask to the de-identification processing module.
[0041] The trusted isolation dual-stream module is used to write the original video stream and the anonymized video stream to buffers with different access permissions on the device side. Specifically, the trusted isolation dual-stream module includes an original stream buffer and a processed stream buffer. The original stream buffer provides the original video frames to the AI inference module and the anonymization processing module, while the processed stream buffer provides the anonymized video frames to the encoding output module. With this structure, the original video stream is only used for target recognition and anonymization processing within the device, and the video streams output to the network module, local storage module, encoding output module, or external interface are all anonymized video streams.
[0042] In one implementation, the trusted isolated dual-stream module configures an access permission table through at least one of a memory management unit, a trusted execution environment, and a bus access control unit. The access permission table is used to limit the access permissions of different modules to different buffers. Specifically, the video acquisition module has permission to write data to the original stream buffer; the AI inference module has permission to read data from the original stream buffer; the de-identification processing module has permission to read data from the original stream buffer and write data to the processed stream buffer; the encoding output module has permission to read data from the processed stream buffer; the network module, local storage module, encoding output module, or external interface does not have permission to directly access the original stream buffer. The external interface may include a USB interface, a JTAG debugging interface, a wireless communication interface, a wired network interface, or other interfaces capable of transmitting data to the outside of the device.
[0043] In one implementation, the trusted isolated dual-stream module further includes a DMA channel isolation unit. The DMA channel isolation unit is used to configure the video acquisition DMA to write data only to the raw stream buffer, configure the encoder DMA to read data only from the processed stream buffer, and lock the transfer address range of the DMA descriptor. After the DMA descriptor is locked, the write address of the video acquisition DMA cannot be modified to the processed stream buffer or a storage area accessible by an external interface during operation, nor can the encoder DMA be configured to directly read the raw stream buffer. Through the coordinated settings of memory address domain isolation, DMA channel isolation, and bus access control, the raw video stream can be prevented from being read or output by unauthorized modules.
[0044] The AI inference module acquires raw video frames from the raw stream buffer of the trusted isolated dual-stream module and performs object detection or segmentation on the raw video frames based on a lightweight neural network to generate a target region mask. The lightweight neural network can be a lightweight object detection network, a semantic segmentation network, or an instance segmentation network, such as a lightweight structure based on MobileNet, YOLO-Nano, YOLO-Seg, DeepLab, or other network structures suitable for embedded AI chips, DSPs, NPUs, GPUs, or CPUs. After generating the target region mask, the AI inference module outputs the target region mask to the de-identification processing module and the timing consistency module.
[0045] In a preferred embodiment, the AI inference module includes a pixel-level instance segmentation unit. This unit uses a lightweight instance segmentation network to detect human-shaped targets in video frames and generates a corresponding human instance mask for each detected target. The human instance mask can be a pixel-level mask with the same resolution as the input video frame, or it can be a pixel-level mask aligned with the input video frame after upsampling, interpolation, or boundary refinement. Compared to target detection methods that only output bounding boxes, human instance masks can more accurately describe the actual contours of human-shaped targets, enabling subsequent desensitization processing to fit the boundaries of the human-shaped targets and reducing false occlusion of non-privacy areas.
[0046] The desensitization module receives the privacy region mask output by the privacy region management module, the target region mask output by the AI inference module, and the tracking prediction results output by the temporal consistency module. The desensitization module calculates the pixel intersection between the target region mask and the privacy region mask, and determines the region corresponding to the pixel intersection as the region to be desensitized. If the target region mask and the privacy region mask do not intersect, it means that the current target has not entered the user-defined privacy region, and the desensitization module may not perform desensitization processing on that target; if the target region mask and the privacy region mask intersect, desensitization processing is only performed on the intersection region.
[0047] In one implementation, the target region mask is a humanoid instance mask, and the privacy region mask is a pixel-level mask corresponding to a user-defined privacy region. The desensitization processing module performs a pixel-level intersection calculation on the two to obtain the region to be desensitized. The pixel-level intersection calculation can be expressed as: M_inter=M_person∩M_privacy; Here, M_person represents the human instance mask, M_privacy represents the privacy region mask, and M_inter represents the intersection of both the human instance mask and the privacy region mask. The desensitization module only identifies the region corresponding to M_inter as the area to be desensitized, thereby avoiding indiscriminate occlusion of the entire human target or the entire privacy region, thus preserving the visual information of non-sensitive areas in the image while achieving privacy protection.
[0048] The desensitization module can perform at least one of the following processing methods on the area to be desensitized: mosaic processing, blurring processing, solid color occlusion processing, or silhouette processing. Mosaic processing divides the area to be desensitized into multiple pixel blocks and replaces the pixels within each block with the average color, the center pixel color, or a preset color. Blur processing can employ Gaussian blur, mean blur, bilateral filtering, or other image blurring algorithms. Solid color occlusion processing covers the area to be desensitized with black, gray, or a user-specified color. Silhouette processing preserves the outer contour of the target and replaces the internal texture with a monochrome or low-detail texture. After completing the desensitization process, the module generates a desensitized video stream and writes it to the processed stream buffer of the trusted isolated dual-stream module.
[0049] The temporal consistency module receives the target region mask output by the AI inference module and the pixel intersection region determined by the desensitization processing module. It then tracks, predicts, and smooths the target region mask, pixel intersection region, or desensitized region in consecutive video frames, and outputs the smoothed desensitized region's position, size, or boundary to the desensitization processing module. Through the temporal consistency module, flickering or abrupt changes in the desensitized region caused by AI inference result jitter, target movement, short-term occlusion, or missed detections can be reduced.
[0050] In one implementation, the temporal consistency module assigns tracking identifiers to targets entering privacy regions in consecutive video frames. For each tracked target, the temporal consistency module can establish a state vector, which includes at least one of the following: target center point coordinates, region width, region height, velocity component, and scale variation component. The temporal consistency module uses a Kalman filter to predict the target's position in the next frame and verifies the predicted position by combining the optical flow field between adjacent frames. If the difference between the optical flow verification result and the Kalman filter prediction result is less than a preset threshold, the region fused with the prediction result and the current detection result is used as the smoothed desensitized region; if the difference is greater than the preset threshold, re-detection is triggered or the weight of the prediction result is reduced.
[0051] In one implementation, the timing consistency module performs low-pass filtering to smooth the position, size, or boundary of the desensitized region. For example, the boundary B_t of the desensitized region in frame t can be smoothed as follows: B_t=α·B_detect_t+(1-α)·B_t-1; Where B_detect_t is the desensitized region boundary determined based on the detection or prediction results in frame t, B_t-1 is the smoothed desensitized region boundary in the previous frame, and α is the smoothing coefficient. α can be set according to the video frame rate, target motion speed, and desensitization stability requirements, for example, a value between 0.3 and 0.8. Through the above low-pass filtering process, high-frequency jitter in the desensitized region between consecutive frames can be suppressed.
[0052] When the AI inference module misses a target for a short period or the target is occluded, the temporal consistency module maintains the corresponding region to be desensitized or the desensitized region according to the Kalman filter prediction result. When the number of consecutive missed frames is less than or equal to a preset frame threshold, the system continues to perform desensitization processing on the predicted region; when the number of consecutive missed frames is greater than the preset frame threshold, the tracking and desensitization of the region corresponding to the target is paused. The preset frame threshold can be set according to the camera frame rate and the actual scene requirements, for example, set to 30 frames in a 30fps video stream to cover a short period of occlusion or missed detection of about 1 second.
[0053] In one implementation, the system further includes a regional risk classification module. This module determines the corresponding risk level based on the privacy sensitivity of each privacy area and configures different de-identification strategies for different risk levels. The privacy areas can include high-risk areas, medium-risk areas, and low-risk areas. High-risk areas can be private spaces such as bedrooms, bathrooms, children's rooms, and dressing areas; medium-risk areas can be semi-public spaces such as living rooms, balconies, hallways, and entrances; and low-risk areas can be relatively public spaces such as corridors and stairwells.
[0054] Different risk levels can correspond to different desensitization strategies. These strategies include at least one of the following: desensitization method, desensitization intensity, mosaic pixel block size, blur kernel parameters, occlusion color, and desensitization duration. For example, high-risk areas can use strong mosaic, pure black occlusion, or large-scale blurring; medium-risk areas can use medium mosaic or medium-intensity blurring; low-risk areas can use slight blurring, small pixel block mosaic, or desensitization only on a localized target area. The specific parameters mentioned above are for illustrative purposes only and can be adjusted according to camera resolution, user settings, target size, and privacy sensitivity in actual applications.
[0055] When multiple privacy regions with different risk levels exist within the same video frame, the desensitization module performs desensitization processing with different intensities according to the risk level corresponding to each privacy region. For example, when high-risk and low-risk regions exist simultaneously in the same frame, the intersection region located within the high-risk region adopts a strong desensitization strategy, while the intersection region located within the low-risk region adopts a weak desensitization strategy. If the same target spans multiple risk level regions simultaneously, it can be uniformly desensitized according to the highest risk level, or desensitization processing of the corresponding risk level can be performed separately for different intersection regions.
[0056] When the home security camera is a PTZ camera, the system also includes a PTZ coordinate mapping module. This module maps the privacy region from the world coordinate system or PTZ coordinate system to the image coordinate system based on user-defined privacy region information and the current PTZ angle, thus updating the position of the privacy region mask in the current video frame. After the user defines the privacy region through the application, the system can record the vertex coordinates of that privacy region in the world coordinate system. When the PTZ rotates horizontally or vertically, the PTZ coordinate mapping module recalculates the image coordinates of the privacy region in the current video frame based on the current PTZ angle.
[0057] In one implementation, the gimbal coordinate mapping module obtains the current horizontal rotation angle and pitch angle of the gimbal, updates the gimbal rotation matrix R_PT according to the horizontal rotation angle and pitch angle, and calculates the image coordinates of the privacy region vertex in the current video frame according to the transformation from the world coordinate system to the camera coordinate system and the projection transformation from the camera coordinate system to the image coordinate system.
[0058] The transformation from the world coordinate system to the camera coordinate system satisfies: P_camera=R_PT·R_base·(P_world-T_base); Where P_world is the coordinate of the privacy region vertex in the world coordinate system, P_camera is the coordinate of the privacy region vertex in the camera coordinate system, R_PT is the gimbal rotation matrix determined based on the current gimbal horizontal rotation angle and pitch angle, R_base is the base rotation matrix corresponding to the camera mounting posture, and T_base is the translation vector corresponding to the camera mounting position.
[0059] The projection transformation from the camera coordinate system to the image coordinate system satisfies: p_image=K·[P_camera.x / P_camera.z, P_camera.y / P_camera.z]^T; Where p_image is the coordinate of the privacy region vertex in the image coordinate system, K is the camera intrinsic parameter matrix, and P_camera.x, P_camera.y, and P_camera.z are the three-dimensional coordinate components of P_camera in the camera coordinate system, respectively.
[0060] Based on the p_image corresponding to each privacy region vertex, the gimbal coordinate mapping module generates the privacy region outline in the current video frame and further generates or updates the privacy region mask. When all or part of the calculated privacy region vertices exceed the boundary of the current video frame, the gimbal coordinate mapping module marks the corresponding privacy region as invisible, partially visible, or visible. Specifically, when all vertices exceed the boundary of the current video frame, it is marked as invisible and the desensitization process for that privacy region is paused. When it partially exceeds the boundary of the current video frame, boundary clipping is performed and it is marked as partially visible. A privacy region mask is generated for the visible portion within the current video frame, and the desensitization process continues. When it does not exceed the boundary of the current video frame, it is marked as visible. When the camera gimbal rotates to the privacy region and re-enters the current video frame, the privacy region is marked as visible, and the dynamic desensitization process for that privacy region is resumed.
[0061] The anomaly rollback module is used to monitor the operating status of the AI inference module, the trusted isolation dual-stream module, the desensitization processing module, and the encoding output module. When at least one of the following occurs: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly, it sends a corresponding rollback control command to the desensitization processing module or the encoding output module to trigger the corresponding security rollback strategy and maintain the privacy protection status.
[0062] In one implementation, the anomaly rollback module monitors AI inference time, AI inference return status, output data format and target mask confidence, raw stream buffer access logs, processor utilization, memory utilization, device temperature, remaining storage space, and network connection status. When AI inference times out, AI inference returns an error code, the output data format is abnormal, or the target mask confidence is lower than a preset threshold, the anomaly rollback module controls the desensitization processing module to switch to a fixed privacy region masking mode. This mode directly performs fixed region masking, blurring, or mosaic processing on user-defined privacy regions without relying on AI inference results. When illegal access to the raw stream buffer is detected but the current video frame to be output or the cached video frame can still be obtained, the anomaly rollback module controls the desensitization processing module to perform full-screen desensitization on the current video frame to be output or the cached video frame. When a valid video frame cannot be obtained, the anomaly rollback module controls the encoding output module to stop encoding output and record anomaly logs, such as performing full-screen strong mosaic, full-screen blurring, or full-screen occlusion.
[0063] When processor utilization, memory utilization, or device temperature exceeds the corresponding safety threshold, the anomaly rollback module controls the encoding output module to stop outputting the video stream or only save the anomaly log. The safety threshold can be preset by the system or configured based on device type, operating temperature range, processor performance, and operating scenario. When a network anomaly prevents the upload of the anonymized video stream, the anomaly rollback module controls the system to retain the anonymized video stream or anomaly log, without writing the original video stream to local storage, and records the network anomaly event so that the anonymized video stream can be uploaded again after the network is restored or made available for local viewing by the user.
[0064] After the abnormal state is resolved, the anomaly rollback module restores the normal working flow of the AI inference module, the desensitization processing module, and the encoding output module. Before restoring the normal working flow, the anomaly rollback module verifies the access permissions of the original stream buffer, the DMA channel configuration, and the output status of the processed stream buffer. If the verification passes, the system resumes the normal dynamic desensitization process; if the verification fails, the corresponding rollback strategy is maintained, and the cause and time of the anomaly are recorded.
[0065] The encoding output module reads the de-identified video stream from the processed stream buffer of the trusted isolated dual-stream module, encodes the de-identified video stream, and outputs the encoded video stream to the local storage module or the network module. The encoding format can be H.264, H.265, AV1, or other video encoding formats suitable for home cameras. The local storage module can be a memory card, built-in flash memory, home gateway storage, or a local area network storage device. The network module can upload the encoded video stream to a cloud server, user terminal, or home network device. Because the encoding output module only reads the de-identified video stream from the processed stream buffer, the video stream uploaded to the cloud or output to an external interface is the de-identified video stream.
[0066] The present invention also provides a method for dynamic desensitization of privacy areas on the end side of a home camera, which can be executed by the aforementioned system.
[0067] The method includes the following steps.
[0068] S1: Acquire raw video streams from image sensors via the video capture module on the home camera device.
[0069] Specifically, the image sensor captures environmental images at a preset frame rate, and the video acquisition module reads raw video frames from the image sensor to form a continuous raw video stream. The raw video frames can be in YUV, RGB, Bayer, or other image processing formats. After capturing each raw video frame, the video acquisition module generates a corresponding frame number and timestamp for that frame and writes the raw video frame, frame number, and timestamp together into the raw stream buffer in the trusted isolated dual-stream architecture.
[0070] In one implementation, the video capture module writes raw video frames to the raw stream buffer via a video capture DMA. The video capture DMA is configured to have only permission to write data to the raw stream buffer and not permission to read the processed stream buffer, network buffer, or external interface buffer. Therefore, the raw video frames captured by the camera are initially confined to the raw stream buffer after entering the system.
[0071] S2: Receive privacy region information defined by the user through the application, and generate a corresponding privacy region mask based on the privacy region information.
[0072] Specifically, users can view the current camera view through a mobile app, tablet app, or web management interface, and select one or more areas within the view that require privacy protection. The application then sends the user-defined privacy area information to the camera device. This privacy area information may include the privacy area number, area vertex coordinates, area outline, area type, risk level, anonymization method, anonymization strength, activation time period, whether PTZ tracking is enabled, and whether mandatory anonymization is required during network upload.
[0073] After receiving privacy region information, the camera device stores it in the configuration storage area and converts the privacy region information into a privacy region mask according to the current video frame resolution. In one implementation, the privacy region mask is a binary mask image with the same resolution as the current video frame. Pixels belonging to the user-defined privacy region are assigned a first label value, and pixels not belonging to the privacy region are assigned a second label value. If the user defines multiple privacy regions, multiple privacy region masks can be generated separately, or a multi-value mask image containing different region numbers or risk level identifiers can be generated. The privacy region management module outputs the generated privacy region mask to the de-identification processing module.
[0074] S3: The original video stream is written to the original stream buffer through a trusted isolation dual-stream architecture, and the desensitized video stream is written to the processed stream buffer, so that the original video stream is only used for target recognition and desensitization processing within the device, and the video stream output to the local storage module, network module or external interface is the desensitized video stream.
[0075] Specifically, the trusted isolated dual-stream architecture includes a raw stream buffer and a post-processing stream buffer. The raw stream buffer stores the raw video stream acquired by the video acquisition module, while the post-processing stream buffer stores the de-identified video stream after anonymization processing. The AI inference module and the anonymization processing module read raw video frames from the raw stream buffer; the encoding output module reads de-identified video frames from the post-processing stream buffer. The network module, local storage module, encoding output module, or external interfaces do not directly read the raw stream buffer.
[0076] In one implementation, upon system startup, the trusted isolated dual-stream architecture first completes buffer initialization. The initialization process includes: allocating raw stream buffers and processed stream buffers; configuring physical address ranges for each buffer; establishing access permission tables; configuring video capture DMA and encoder DMA; locking the DMA descriptor address range; and disabling network modules, local storage modules, encoding output modules, or external interfaces from accessing the raw stream buffers.
[0077] In one implementation, the trusted isolated dual-stream architecture configures an access permission table through a memory management unit, a trusted execution environment, or a bus access control unit. The access permission table includes at least the following permission configurations: the video capture module has permission to write data to the raw stream buffer; the AI inference module has permission to read data from the raw stream buffer; the de-identification processing module has permission to read data from the raw stream buffer and write data to the processed stream buffer; the encoding output module has permission to read data from the processed stream buffer; and the network module and external interfaces do not have permission to access the raw stream buffer.
[0078] In one implementation, if a network module, local storage module, encoding output module, debugging interface, or other unauthorized object is detected to request access to the original stream buffer, the trusted isolation dual-stream architecture rejects the access request and records the access behavior as an original stream access exception event, which is then triggered by the exception rollback module to implement the corresponding security rollback strategy.
[0079] S4: Perform target detection or target segmentation on the current video frame in the original video stream based on a lightweight neural network, and generate a target region mask.
[0080] Specifically, the AI inference module reads the current original video frame from the original stream buffer according to the video frame number or timestamp, and preprocesses the original video frame. The preprocessing may include at least one of the following: size scaling, color space conversion, normalization, image enhancement, cropping, or padding. The preprocessed image is then input into a lightweight neural network for object detection or object segmentation.
[0081] In one implementation, the lightweight neural network is a lightweight instance segmentation network. The AI inference module performs pixel-level instance segmentation on human-shaped targets in the current video frame, generating a human-shaped instance mask corresponding to each human-shaped target. Each human-shaped instance mask corresponds to a detected human-shaped target and may include information such as target confidence, target category, target bounding box, mask outline, frame number, and detection timestamp.
[0082] In one implementation, the AI inference module can filter low-confidence targets based on target confidence. For example, if the detection confidence of a target is lower than a preset confidence threshold, the target is not considered a valid humanoid target; if the target confidence is higher than the preset confidence threshold, the corresponding humanoid instance mask is output. The output humanoid instance mask can be a binary mask with the same resolution as the current video frame, or a pixel-level mask aligned with the current video frame after upsampling, interpolation, or boundary refinement.
[0083] S5: Calculate the pixel intersection between the target region mask and the privacy region mask to obtain the region to be desensitized.
[0084] Specifically, the desensitization processing module receives the target region mask output by the AI inference module and the privacy region mask output by the privacy region management module, and performs pixel-level intersection calculation on the two. If the target region mask is a humanoid instance mask, the desensitization processing module performs a pixel-by-pixel logical AND operation on the humanoid instance mask and the privacy region mask to obtain the intersection region. This intersection region is the region that simultaneously belongs to the humanoid target and the user-defined privacy region, and is identified as the region to be desensitized.
[0085] In one implementation, pixel-level intersection calculation satisfies: M_inter=M_person∩M_privacy; Where M_person represents the human instance mask, M_privacy represents the privacy region mask, and M_inter represents the intersection region that belongs to both the human instance mask and the privacy region mask. If the number of valid pixels in M_inter is less than a preset area threshold, it can be determined that the target has not actually entered the privacy region, and desensitization processing is not performed temporarily; if the number of valid pixels in M_inter is greater than or equal to the preset area threshold, then M_inter is determined as the region to be desensitized.
[0086] In one implementation, when multiple humanoid instances and multiple privacy regions exist in the same video frame, the desensitization module calculates the pixel intersection between the mask of each humanoid instance and the mask of each privacy region, and determines the processing priority of the region to be desensitized based on the intersection area, the privacy region risk level, or the target confidence level. If the same target enters multiple privacy regions simultaneously, desensitization can be performed according to the desensitization strategy corresponding to the highest risk level, or desensitization processing corresponding to the risk level can be performed separately for different intersection regions.
[0087] S6: Track, predict, and smooth the target area mask, pixel intersection area, or area to be desensitized in consecutive video frames to determine the smoothed desensitized area.
[0088] Specifically, the temporal consistency module receives the target region mask of the current frame, the region to be desensitized, and the historical tracking results of the previous frame or multiple frames. The temporal consistency module assigns a tracking identifier to targets entering the privacy region and associates the current frame target with historical frame targets based on the frame number and spatial location. The association method can be based on at least one of the following: target center point distance, mask intersection-over-union ratio, bounding box intersection-over-union ratio, target appearance features, or motion direction.
[0089] In one implementation, for each tracked target, the temporal consistency module establishes a state vector, which may include the target's center point coordinates, target width, target height, velocity components, and scale variation components. The temporal consistency module uses a Kalman filter to predict the target's position in the next frame and updates the prediction based on the detection results of the current frame. For target motion between adjacent frames, the temporal consistency module can also calculate an optical flow field and use this field to verify whether the Kalman filter-predicted position matches the actual motion trend.
[0090] In one implementation, if the difference between the Kalman filter prediction result and the optical flow verification result is less than a preset threshold, the prediction result, the current detection result, and the optical flow result are fused to determine the smoothed and desensitized region of the current frame; if the difference is greater than the preset threshold, the weight of the prediction result is reduced, or the AI inference module is triggered to re-detect the target in the current frame. The smoothed and desensitized region may include the smoothed region location, size, boundary contour, or mask.
[0091] In one implementation, the timing consistency module performs low-pass filtering to smooth the position, size, or boundary of the region to be desensitized. For the boundary B_t of the desensitized region in frame t, smoothing can be performed as follows: B_t=α·B_detect_t+(1-α)·B_t-1; Where B_detect_t is the desensitized region boundary determined in frame t based on the detection results, intersection region, or prediction results, B_t-1 is the smoothed desensitized region boundary of the previous frame, and α is the smoothing coefficient. α can be set according to the camera frame rate, target movement speed, and desensitization stability requirements, for example, a value between 0.3 and 0.8.
[0092] When a target experiences brief occlusion or is missed in consecutive video frames, the timing consistency module continues to maintain the corresponding region to be desensitized or desensitized based on the Kalman filter prediction position. When the number of consecutive missed frames is less than or equal to a preset frame threshold, desensitization processing continues on the predicted region; when the number of consecutive missed frames exceeds the preset frame threshold, tracking and desensitization of the region corresponding to the target is paused. The preset frame threshold can be set according to the camera frame rate, for example, 30 frames in a 30fps video stream.
[0093] S7: Perform desensitization processing on the smoothed desensitized area to obtain desensitized video frames, encode the desensitized video frames, and output them to the local storage module or network module.
[0094] Specifically, the desensitization processing module receives the smoothed desensitized region output by the timing consistency module, and performs desensitization processing on the original video frame based on the smoothed desensitized region. The desensitization processing may include at least one of mosaic processing, blurring processing, solid color occlusion processing, or silhouette processing.
[0095] In one implementation, the desensitization processing module determines the corresponding desensitization strategy based on the risk level of the privacy region. A strong desensitization strategy is used for high-risk regions, a medium-risk strategy for medium-risk regions, and a weak desensitization strategy for low-risk regions. The desensitization strategy includes at least one of the following: desensitization method, desensitization intensity, mosaic pixel block size, blur kernel parameters, occlusion color, and desensitization duration.
[0096] For example, for high-risk areas, the desensitization module can use large mosaic pixel blocks, strong Gaussian blur, or pure black occlusion; for medium-risk areas, it can use medium-sized mosaic pixel blocks or medium-intensity blur; and for low-risk areas, it can use small-sized mosaic pixel blocks, light blur, or desensitize only local target areas. If there are multiple privacy areas with different risk levels in the same video frame, different intensities of desensitization processing are performed according to the risk level corresponding to each privacy area.
[0097] After the desensitization process is complete, the desensitization module writes the generated desensitized video frames into the processed stream buffer. The encoding output module reads the desensitized video frames from the processed stream buffer and encodes them. The encoding format can be H.264, H.265, AV1, or other video encoding formats suitable for home cameras. The encoded video stream is then output to the local storage module or the network module. Because the encoding output module only reads video frames from the processed stream buffer, the video stream output to the local storage module, network module, or external interface is the desensitized video stream.
[0098] In one implementation, when the home camera device includes a pan-tilt mechanism, a pan-tilt coordinate mapping step is included before step S4. This step is used to update the position of the privacy region mask in the current video frame after the pan-tilt rotates. Specifically, the system obtains the current horizontal rotation angle and pitch angle of the pan-tilt, updates the pan-tilt rotation matrix according to the horizontal rotation angle and pitch angle, maps the user-defined privacy region from the world coordinate system or the pan-tilt coordinate system to the image coordinate system corresponding to the current video frame, and updates the privacy region mask according to the mapped image coordinates.
[0099] In one implementation, mapping a user-defined privacy region from the world coordinate system to the image coordinate system corresponding to the current video frame includes: calculating the coordinates of the privacy region vertices in the camera coordinate system according to the following formula: P_camera=R_PT·R_base·(P_world-T_base); Where P_world is the coordinate of the privacy region vertex in the world coordinate system, P_camera is the coordinate of the privacy region vertex in the camera coordinate system, R_PT is the gimbal rotation matrix determined based on the current gimbal horizontal rotation angle and pitch angle, R_base is the base rotation matrix corresponding to the camera mounting posture, and T_base is the translation vector corresponding to the camera mounting position.
[0100] Then, calculate the coordinates of the privacy region vertices in the image coordinate system using the following formula: p_image=K·[P_camera.x / P_camera.z, P_camera.y / P_camera.z]^T; Where p_image is the coordinate of the privacy region vertex in the image coordinate system, K is the camera intrinsic parameter matrix, and P_camera.x, P_camera.y, and P_camera.z are the three-dimensional coordinate components of P_camera in the camera coordinate system, respectively.
[0101] When the mapped privacy region extends beyond the current video frame boundary, the corresponding privacy region is marked as invisible, and the desensitization process for that privacy region is paused. When a portion of the mapped privacy region extends beyond the current video frame boundary, a privacy region mask is generated for the visible portion within the current video frame, and the desensitization process for that visible portion continues. When the camera pan-tilt rotates to the privacy region and re-enters the current video frame, the corresponding privacy region is marked as visible, and the dynamic desensitization process for that privacy region is resumed.
[0102] S8: If at least one of the following is detected during processing: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly, trigger the corresponding anomaly rollback strategy.
[0103] Specifically, the exception rollback module continuously or periodically monitors the running status of the AI inference module, the trusted isolation dual-stream module, the desensitization processing module, and the encoding output module during method execution. Monitoring content may include AI inference time consumption, AI inference return status, output data format and target mask confidence level, raw stream buffer access logs, processor utilization, memory utilization, device temperature, remaining storage space, and network connection status.
[0104] When AI inference times out, returns an error code, the output data format is abnormal, or the target mask confidence level is lower than a preset threshold, the anomaly fallback module controls the desensitization processing module to switch to a fixed privacy region masking mode. In this mode, the system does not rely on the AI inference result, but directly performs fixed masking, blurring, or mosaic processing on the corresponding region based on the user-defined privacy region mask.
[0105] When an unauthorized access to the original stream buffer is detected but the current video frame to be output or a cached video frame is still available, the anomaly fallback module controls the desensitization processing module to perform full-screen desensitization on the current video frame to be output or the cached video frame. When a valid video frame cannot be obtained, the anomaly fallback module controls the encoding output module to stop encoding output and record an anomaly log. The full-screen desensitization can be full-screen strong mosaic, full-screen high-intensity blur, or full-screen occlusion. This fallback strategy is used to prioritize privacy and security when there is a risk of unauthorized access to the original stream.
[0106] When processor utilization, memory utilization, or device temperature exceeds the corresponding safety threshold, the anomaly rollback module controls the encoding output module to stop video encoding output or stop network upload, and saves an anomaly log. The anomaly log may include anomaly type, occurrence time, frame sequence number, current device temperature, processor utilization, memory utilization, access request source, and rollback strategy type.
[0107] When a network anomaly prevents the uploading of the anonymized video stream, the system retains the anonymized video stream or the anomaly log, without writing the original video stream to local storage, and records the network anomaly event. Once the network is restored, the anonymized video stream can be uploaded again, or it can be made available for local viewing only.
[0108] After the abnormal state is resolved, the abnormal rollback module verifies the access permissions of the original stream buffer, the DMA channel configuration, and the output status of the processed stream buffer. If the verification passes, the normal flow of AI inference, timing consistency processing, desensitization processing, and encoding output is restored; if the verification fails, the corresponding abnormal rollback strategy is maintained.
[0109] Through the above embodiments, this invention can complete trusted isolation of the original video stream, target region identification, privacy region intersection calculation, temporal smoothing desensitization, encoded output, and anomaly rollback processing at the home camera device end. The original video stream is only used for target identification and desensitization processing within the device; the video stream output to the local storage module, network module, or external interface is a desensitized video stream. This method can reduce the risk of privacy leakage caused by the external transmission of the original video and achieve accurate, stable, and continuous desensitization protection when dynamic targets enter the privacy region.
[0110] Experimental verification example To verify the technical effectiveness of the dynamic desensitization processing system and method for privacy areas on the home camera side as described in this invention, the applicant conducted experimental verification on pixel-level instance segmentation effect, temporal consistency processing effect, trusted isolation dual-stream security, overall performance, and the contribution of each technical module. The following experimental data are only used to illustrate the technical effects achievable by this invention and are not intended to limit the scope of protection of this invention.
[0111] Experiment Example 1: Comparison Experiment of Detection Accuracy To verify the effectiveness of the pixel-level instance segmentation scheme compared to the bounding box detection scheme in dynamic desensitization scenarios of privacy regions, tests were conducted using a subset of the COCO-Person dataset and a self-built home scene dataset. The test dataset included 50,000 images from the COCO-Person subset and 10,000 images from the self-built home scene dataset. The comparison schemes were the bounding box detection scheme and the pixel-level instance segmentation scheme.
[0112] Bounding box detection schemes typically define the human target region using rectangular boxes, which can easily cover the surrounding background and lead to false occlusion. Pixel-level instance segmentation schemes can output a pixel-level mask corresponding to the human target contour and perform pixel-level intersection calculation with the privacy region mask, thus performing desensitization processing only on the intersection region. The experimental results comparing detection accuracy are shown in Table 1 below. Table 1
[0113] As shown in Table 1, compared with the bounding box detection scheme, the pixel-level instance segmentation scheme can improve the edge localization accuracy of human targets and reduce the missed occlusion rate and false occlusion rate. This result demonstrates that the present invention, through "pixel-level intersection calculation of human instance mask and privacy region mask," can improve the accuracy of dynamic desensitization of privacy regions.
[0114] Experiment Example 2: Time Series Stability Experiment To verify the effectiveness of the temporal consistency module of this invention in improving the stability of desensitized regions in consecutive video frames, an indoor walking scene was selected for testing. The test video consisted of 300 consecutive frames, i.e., a 10-second, 30fps video segment. Comparison schemes included an unconstrained detection scheme and a temporal consistency scheme using Kalman filtering combined with optical flow constraints. In the unconstrained detection scheme, the desensitized region is prone to jumps or flickering due to jitter in the detection result. This invention predicts the target position using Kalman filtering, verifies the prediction result using optical flow, and then performs temporal smoothing on the position and size of the desensitized region, thereby reducing flickering in the desensitized region. The experimental results of timing stability are shown in Table 2 below.
[0115] Table 2
[0116] As shown in Table 2, after applying the temporal consistency constraint, the standard deviation of positional jitter, the standard deviation of size jitter, and the flicker frequency of the desensitized area are all significantly reduced. This result indicates that the temporal consistency module of this invention can improve the stability of the desensitized area in a continuous video stream and improve the viewing experience of the desensitized image.
[0117] Experiment Example 3: Security Isolation Verification To verify the protection effect of the trusted isolation dual-stream architecture of this invention on the original video stream, a scenario was simulated where an attacker attempted to access the original stream buffer, i.e., the Raw Domain memory area. Tests included direct CPU access to the Raw Domain, DMA out-of-bounds transfers, debug interface access, and reading residual data during cold starts. This invention isolates the original video stream from the processed stream at the physical or access permission level through memory address domain isolation, DMA channel isolation, DMA descriptor locking, TrustZone or MMU access control, and reset clearing, reducing the risk of the original video stream being illegally read or output. The security isolation verification results are shown in Table 3 below.
[0118]
[0119] As shown in Table 3, the trusted isolation dual-stream architecture of this invention can intercept or restrict unauthorized access to the original stream buffer. These experimental results support the technical effect of this invention: the original video stream is used only for target identification and de-identification processing within the device, while the video stream output to the local storage module, network module, or external interface is a de-identified video stream.
[0120] Experiment Example 4: Comprehensive Performance Comparison Experiment To verify the overall performance of this invention compared to existing technical solutions, it was compared with cloud-based desensitization solutions and fixed masking solutions. The comparison metrics included end-to-end latency, risk of original video leakage, dynamic target tracking capability, gimbal scene support capability, and network dependency. Cloud-based desensitization solutions require uploading the original video to a cloud server for processing, posing a high risk of original video leakage and strong network dependency. While fixed masking solutions have lower latency, they cannot dynamically track human targets entering privacy areas and do not support automatic relocation of privacy areas after gimbal rotation. This invention completes AI inference, pixel-level intersection desensitization, temporal consistency processing, and encoding output on the device side, outputting only the desensitized video stream. The comprehensive performance comparison experimental results are shown in Table 4 below.
[0121] Table 4
[0122] As shown in Table 4, this invention can achieve dynamic target tracking and gimbal scene support with low end-to-end latency, while reducing the risk of original video leakage. Compared with cloud-based desensitization solutions, this invention does not require uploading the original video stream; compared with fixed occlusion solutions, this invention can dynamically desensitize based on the intersection of human-shaped targets and privacy areas, and adapt to gimbal rotation scenarios.
[0123] Experiment Example 5: Ablation Experiment To verify the contribution of each technical module of the present invention to the overall effect, the bounding box detection scheme was used as the baseline scheme, and pixel-level instance segmentation, temporal constraints and risk classification mechanisms were gradually added to test the changes in missed occlusion rate, false occlusion rate and flicker frequency; the ablation experiment results are shown in Table 5 below.
[0124] Table 5
[0125] As shown in Table 5, pixel-level instance segmentation mainly reduces the missed occlusion rate and false occlusion rate, temporal constraints mainly reduce the flickering frequency of the desensitized area, and the risk grading mechanism is used to configure desensitization strategies of different intensities in different privacy-sensitive areas. The above results show that there is a clear division of functions and synergistic effect among the various technical modules of this invention.
[0126] Experiment Example 6: Example of Regional Risk Classification Strategy To achieve differentiated levels of privacy protection, this invention divides the monitoring area into high-risk, medium-risk, and low-risk areas based on the degree of privacy sensitivity, and configures different de-identification strategies for different risk levels. Examples of regional risk-level de-identification strategies are shown in Table 6 below.
[0127] Table 6
[0128] As shown in Table 6, the present invention can automatically or manually configure different desensitization intensities according to the risk level of privacy areas. For high-risk areas, a strong desensitization strategy is adopted to minimize the leakage of privacy details; for medium-risk areas, a medium desensitization strategy is adopted to balance privacy protection and screen usability; and for low-risk areas, a weak desensitization strategy is adopted to retain more security screen information.
[0129] In summary, the above experiments demonstrate that this invention improves the positioning accuracy of desensitized regions by calculating the pixel-level intersection of pixel-level instance segmentation and privacy region masks; reduces positional jitter, size jitter, and flicker frequency of desensitized regions in consecutive video frames through Kalman filtering and optical flow constraints; reduces the risk of unauthorized access or output of the original video stream through a trusted isolated dual-stream architecture; improves the adaptability of home cameras in different privacy-sensitive areas and gimbal rotation scenarios through a regional risk grading mechanism and a gimbal coordinate mapping mechanism; and maintains basic privacy protection capabilities when AI inference fails, memory access violates regulations, or device malfunctions through a multi-level anomaly fallback mechanism.
[0130] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A dynamic desensitization processing system for the privacy area on the end side of a home security camera, characterized in that, include: The module includes a video capture module, a privacy zone management module, a trusted isolation dual-stream module, an AI inference module, a desensitization processing module, a timing consistency module, an anomaly rollback module, and an encoding output module. The video acquisition module is used to acquire the raw video stream from the camera from the image sensor and output the raw video stream to the raw stream buffer of the trusted isolated dual-stream module; The privacy area management module is used to receive privacy area information defined by the user through the application, store the privacy area information, generate a corresponding privacy area mask based on the privacy area information, and output the privacy area mask to the de-identification processing module. The trusted isolation dual-stream module is used to write the original video stream and the desensitized video stream into buffers with different access permissions on the device side. The trusted isolation dual-stream module includes an original stream buffer and a processed stream buffer. The original stream buffer provides the original video frames to the AI inference module and the desensitization processing module, and the processed stream buffer provides the desensitized video frames to the encoding output module, so that the original video stream is only used for target recognition and desensitization processing within the device side. The AI inference module is used to obtain the original video frame from the trusted isolated dual-stream module, perform target detection or target segmentation on the original video frame based on a lightweight neural network, generate a target region mask, and output the target region mask to the desensitization processing module and the timing consistency module. The desensitization processing module is used to receive the privacy region mask, the target region mask, and the tracking prediction result output by the timing consistency module, calculate the pixel intersection between the target region mask and the privacy region mask, perform desensitization processing on the region corresponding to the pixel intersection, generate a desensitized video stream, and write the desensitized video stream into the processed stream buffer of the trusted isolation dual-stream module. The timing consistency module is used to receive the target region mask output by the AI inference module and the pixel intersection region determined by the desensitization processing module, and to perform tracking prediction and smoothing processing on the target region mask, pixel intersection region or desensitized region in consecutive video frames. The smoothed desensitized region position, size or boundary is output to the desensitization processing module to reduce the jitter or flicker of the desensitized region between consecutive frames. The anomaly rollback module is used to monitor the operating status of the AI inference module, the trusted isolation dual-stream module, the desensitization processing module, and the encoding output module. When at least one of the following occurs: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly, the module sends a corresponding rollback control command to the desensitization processing module or the encoding output module to trigger the corresponding security rollback strategy and maintain the privacy protection status. The encoding output module is used to read the desensitized video stream from the processed stream buffer of the trusted isolated dual-stream module, encode the desensitized video stream, and output the encoded video stream to the local storage module or the network module.
2. The system for dynamic de-sensitization of in-home camera endpoint side privacy regions of claim 1, wherein, The trusted isolation dual-stream module also includes a DMA channel isolation unit; The raw stream buffer is used to store the raw video stream acquired by the video acquisition module, and is only accessible to the video acquisition module, the AI inference module, and the desensitization processing module. The processed stream buffer is used to store the desensitized video stream after processing by the desensitization processing module, and is accessible by the encoding output module, local storage module or network module; The trusted isolation dual-stream module configures access permission tables through at least one of the memory management unit, trusted execution environment, and bus access control unit to prohibit the network module, local storage module, encoding output module, or external interface from directly accessing the original stream buffer. The DMA channel isolation unit is used to configure the video acquisition DMA to write data only to the raw stream buffer, configure the encoder DMA to read data only from the processed stream buffer, and lock the transfer address range of the DMA descriptor to prevent the raw video stream from being written to a storage area accessible by an external interface during operation.
3. The system for dynamic de-sensitization of in-home camera endpoint side privacy regions of claim 1, wherein, The AI inference module includes a pixel-level instance segmentation unit; The pixel-level instance segmentation unit is used to detect human targets in video frames using a lightweight instance segmentation network, and generate a corresponding human instance mask for each detected human target. The desensitization processing module is used to perform pixel-level intersection calculation between the humanoid instance mask and the privacy region mask, and to perform at least one of the following processing on the intersection region: mosaic, blur, solid color occlusion or silhouette. The timing consistency module is used to assign tracking identifiers to targets entering privacy regions in consecutive video frames, and to associate pixel intersection regions or desensitized regions in consecutive frames based on the tracking identifiers. The timing consistency module is also used to predict the position of the target in the next frame using Kalman filtering, and to verify the predicted position by combining the optical flow field between adjacent frames. Then, the position, size or boundary of the desensitized area is smoothed by low-pass filtering. When the AI inference module misses the target for a short time or the target is occluded, the temporal consistency module maintains the corresponding desensitized area according to the Kalman filter prediction result; If the number of consecutive missed frames does not exceed the preset frame threshold, the predicted desensitized areas will continue to be desensitized. When the number of consecutive missed frames exceeds the preset frame threshold, the tracking and desensitization of the area corresponding to the target is suspended.
4. The system for dynamic de-sensitization of in-home camera endpoint side privacy regions of claim 1, wherein, It also includes a regional risk classification module; The regional risk classification module is used to determine the corresponding risk level based on the privacy sensitivity of the privacy area, and to configure different de-identification strategies for different risk levels. The privacy area includes a high-risk area, a medium-risk area, and a low-risk area. The high-risk area corresponds to a strong desensitization strategy, the medium-risk area corresponds to a medium desensitization strategy, and the low-risk area corresponds to a weak desensitization strategy. The desensitization strategy includes at least one of the following: desensitization method, desensitization intensity, mosaic pixel block size, blur kernel parameters, occlusion color, and desensitization duration. When multiple privacy regions with different risk levels exist in the same video frame, the desensitization processing module performs desensitization processing of different intensities according to the risk level corresponding to each privacy region. When the camera has a gimbal mechanism, the system also includes a gimbal coordinate mapping module. The gimbal coordinate mapping module is used to map the privacy region from the world coordinate system or the gimbal coordinate system to the image coordinate system according to the user-defined privacy region information and the current gimbal angle, so as to update the position of the privacy region mask in the current video frame. The gimbal coordinate mapping module is also used to update the gimbal rotation matrix according to the current horizontal rotation angle and pitch angle of the gimbal, and to calculate the image coordinates of the privacy region vertex in the current video frame according to the transformation from the world coordinate system to the camera coordinate system and the projection transformation from the camera coordinate system to the image coordinate system. The transformation from the world coordinate system to the camera coordinate system satisfies: P_camera=R_PT·R_base·(P_world-T_base), Where P_world is the coordinate of the privacy region vertex in the world coordinate system, P_camera is the coordinate of the privacy region vertex in the camera coordinate system, R_PT is the gimbal rotation matrix determined according to the current gimbal horizontal rotation angle and pitch angle, R_base is the base rotation matrix corresponding to the camera mounting posture, and T_base is the translation vector corresponding to the camera mounting position. The projection transformation from the camera coordinate system to the image coordinate system satisfies: p_image=K·[P_camera.x / P_camera.z, P_camera.y / P_camera.z]^T, Where p_image is the coordinate of the vertex of the privacy region in the image coordinate system, K is the camera intrinsic parameter matrix, and P_camera.x, P_camera.y, and P_camera.z are the three-dimensional coordinate components of P_camera in the camera coordinate system, respectively. When all or part of the calculated privacy region vertices exceed the boundary of the current video frame, the gimbal coordinate mapping module marks the corresponding privacy region as invisible, partially visible, or visible. Specifically, when all vertices exceed the boundary of the current video frame, it is marked as invisible; when part of the vertices exceed the boundary of the current video frame, the boundary is clipped and marked as partially visible; and when the vertices do not exceed the boundary of the current video frame, it is marked as visible.
5. The system for dynamic desensitization of in-home camera endpoint side privacy regions of claim 1, wherein, The anomaly rollback module is used to trigger the corresponding rollback strategy when at least one of the following is detected: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly. When AI inference is abnormal, the abnormal rollback module controls the desensitization processing module to switch to a fixed privacy area masking mode. When the original stream access is abnormal, the abnormal rollback module controls the desensitization processing module to perform full-screen desensitization on the current video frame to be output or the cached video frame; when a valid video frame cannot be obtained, the abnormal rollback module controls the encoding output module to stop encoding output and record the abnormal log. When system resources or equipment temperature are abnormal, the abnormal rollback module controls the encoding output module to stop video encoding output or stop network uploading, and saves the abnormal log. When a network anomaly occurs, the anomaly rollback module controls the system to retain the anonymized video stream or anomaly log, without writing the original video stream to local storage, and to record the network anomaly event. Furthermore, the abnormal rollback module is also used to restore the normal working process of the AI inference module, the desensitization processing module, and the encoding output module after the abnormal state is resolved, and to verify the access permissions of the original stream buffer, the DMA channel configuration, and the output status of the processed stream buffer before restoring the normal working process.
6. A method for dynamically desensitizing the privacy area on the end side of a home security camera, characterized in that, Includes the following steps: S1: Acquire raw video stream from image sensor via video capture module on home camera device; S2: Receive privacy area information defined by the user through the application, and generate a corresponding privacy area mask based on the privacy area information; S3: The original video stream is written to the original stream buffer through a trusted isolation dual-stream architecture, and the desensitized video stream is written to the processed stream buffer, so that the original video stream is only used for target recognition and desensitization processing inside the device, and the video stream output to the local storage module, network module or external interface is the desensitized video stream; S4: Perform target detection or target segmentation on the current video frame in the original video stream based on a lightweight neural network, and generate a target region mask; S5: Calculate the pixel intersection between the target region mask and the privacy region mask to obtain the region to be desensitized; S6: Track, predict and smooth the target area mask, pixel intersection area or area to be desensitized in consecutive video frames to determine the smoothed desensitized area. S7: Perform desensitization processing on the smoothed desensitized area to obtain desensitized video frames, encode the desensitized video frames, and output them to the local storage module or network module. S8: If at least one of the following is detected during processing: AI inference anomaly, raw stream access anomaly, system resource anomaly, device temperature anomaly, storage anomaly, or network anomaly, trigger the corresponding anomaly rollback strategy.
7. The method of claim 6, wherein, In step S3, the trusted isolated dual-stream architecture includes: The original video stream is stored in the original stream buffer, and the de-identified video stream is stored in the processed stream buffer. Configure access permission tables through the memory management unit, trusted execution environment, or bus access control unit; Configure the video capture DMA to write data only to the raw stream buffer, and configure the encoder DMA to read data only from the processed stream buffer; Direct access to the original stream buffer is prohibited by network modules, local storage modules, encoding output modules, or external interfaces. It also locks the transfer address range of the DMA descriptor to prevent the raw video stream from being written to a storage area accessible by an external interface during operation.
8. The method of claim 6, wherein, In step S4, the human-shaped target in the current video frame is segmented into pixels based on a lightweight instance segmentation network to generate a human-shaped instance mask corresponding to the human-shaped target; In step S5, the pixel-level intersection of the humanoid instance mask and the privacy region mask is calculated, and only the intersection area that belongs to both the humanoid instance mask and the privacy region mask is determined as the area to be desensitized. The desensitization process includes at least one of mosaic processing, blurring processing, solid color masking processing, or silhouette processing. In step S6, a tracking identifier is assigned to the target entering the privacy region in consecutive video frames, the position of the target in the next frame is predicted using Kalman filtering, the predicted position is verified based on the optical flow field between adjacent frames, and the position, size or boundary of the desensitized region or the desensitized region in consecutive frames is smoothed. When the target is briefly occluded or missed in consecutive video frames, the corresponding desensitized area or desensitized area is maintained based on the position predicted by Kalman filter. If the number of consecutive missed frames is less than or equal to the preset frame number threshold, continue to perform the desensitization process; When the number of consecutive missed frames exceeds the preset frame threshold, the tracking and desensitization of the region corresponding to the target is suspended.
9. The method of claim 6, wherein, In step S7, a corresponding desensitization strategy is determined based on the risk level of the privacy area, and desensitization processing is performed on the smoothed desensitized area according to the desensitization strategy; Among them, a strong desensitization strategy is used in high-risk areas, a medium desensitization strategy is used in medium-risk areas, and a weak desensitization strategy is used in low-risk areas. The desensitization strategy includes at least one of the following: desensitization method, desensitization intensity, mosaic pixel block size, blur kernel parameters, occlusion color, and desensitization duration. When there are multiple privacy regions with different risk levels in the same video frame, different levels of desensitization processing are performed according to the risk level corresponding to each privacy region. When the home camera device includes a pan-tilt mechanism, a pan-tilt coordinate mapping step is included before step S4: Get the current horizontal rotation angle and pitch angle of the gimbal; Update the gimbal rotation matrix based on the horizontal rotation angle and the pitch angle; Map the user-defined privacy region from the world coordinate system or the PTZ coordinate system to the image coordinate system corresponding to the current video frame; The privacy region mask is updated based on the mapped image coordinates; Mapping the user-defined privacy region from the world coordinate system to the image coordinate system corresponding to the current video frame includes: The coordinates of the privacy region vertices in the camera coordinate system are calculated using the following formula: P_camera=R_PT·R_base·(P_world-T_base), Where P_world is the coordinate of the privacy region vertex in the world coordinate system, P_camera is the coordinate of the privacy region vertex in the camera coordinate system, R_PT is the gimbal rotation matrix determined based on the current gimbal horizontal rotation angle and pitch angle, R_base is the base rotation matrix corresponding to the camera mounting posture, and T_base is the translation vector corresponding to the camera mounting position. The coordinates of the privacy region vertices in the image coordinate system are calculated using the following formula: p_image=K·[P_camera.x / P_camera.z, P_camera.y / P_camera.z]^T, Where p_image is the coordinate of the privacy region vertex in the image coordinate system, K is the camera intrinsic parameter matrix, and P_camera.x, P_camera.y, and P_camera.z are the three-dimensional coordinate components of P_camera in the camera coordinate system, respectively. When the mapped privacy region extends beyond the current video frame boundary, the corresponding privacy region is marked as invisible, and the desensitization process for that privacy region is paused. When a portion of the mapped privacy region extends beyond the current video frame boundary, a privacy region mask is generated for the visible portion within the current video frame, and the desensitization process for the visible portion continues. When the camera pan-tilt unit rotates to the privacy region and re-enters the current video frame, the corresponding privacy region is marked as visible, and the dynamic desensitization process for that privacy region is resumed.
10. The method of claim 6, wherein, In step S8: When AI inference times out, AI inference returns an error code, the output data format is abnormal, or the confidence level of the target mask is lower than the preset threshold, switch to fixed privacy area masking mode. When an illegal access to the original stream buffer is detected but the current video frame to be output or the cached video frame is still available, full-screen desensitization is performed on the current video frame to be output or the cached video frame. When a valid video frame cannot be obtained, stop encoding output and log the exception. When the processor usage, memory usage, or device temperature exceeds the corresponding safety threshold, stop video encoding output or network upload, and save the exception log; When a network anomaly prevents the upload of the anonymized video stream, retain the anonymized video stream or the anomaly log, do not write the original video stream to local storage, and record the network anomaly event. Furthermore, the target detection, target segmentation, pixel intersection calculation, desensitization processing, temporal consistency processing, and encoding output are all performed on the home camera device. The video stream uploaded to the cloud or output to an external interface is a video stream that has undergone desensitization processing.