Child anti-addiction control method and terminal based on deep learning and behavior recognition

By using deep learning and behavior recognition technologies, the system accurately identifies children and dynamically calculates viewing distances. Combined with a tiered intervention mechanism, it addresses the issues of insufficient intelligence and poor environmental adaptability in existing technologies, achieving intelligent and precise management of children's eye health.

CN121985179APending Publication Date: 2026-05-05SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN COOCAA NETWORK TECH CO LTD
Filing Date
2026-01-30
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing technologies for managing children's TV viewing time and eye health suffer from insufficient intelligence, poor environmental adaptability, inaccurate identity recognition, inability to achieve dynamic response and remote management, resulting in a high rate of identity misjudgment, poor environmental adaptability, and inability to form a closed-loop control.

Method used

Using a deep learning and behavior recognition approach, the improved YOLOv5 model accurately identifies children, constructs a 3D facial model to dynamically calculate viewing distance, and analyzes behavior in real time through a dual-thread monitoring system. Combined with a differentiated gradient adjustment algorithm, it performs graded interventions, achieving a closed-loop technology of detection-analysis-intervention-feedback.

Benefits of technology

It achieves accurate identification of children's identities and highly adaptable eye health management. It can dynamically adjust intervention measures according to children's actual behavior, reduce the misjudgment rate, provide personalized parameter settings and remote management, and improve the intelligence and accuracy of eye health management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121985179A_ABST
    Figure CN121985179A_ABST
Patent Text Reader

Abstract

The invention discloses a child anti-addiction control method and terminal based on deep learning and behavior recognition, and relates to the technical field of computer vision, and the method comprises the steps: carrying out the real-time analysis of a watching object in front of a terminal; when the current watching object is identified as the child identity, the watching distance between the current watching object with the child identity and the screen is calculated by constructing a three-dimensional model of the child face; after the child identity and the watching distance are determined, the watching distance is judged and analyzed in real time, and when it is detected that the watching distance is continuously lower than a preset safety threshold in continuous preset time, first-level early warning is controlled to be carried out; the watching behavior of the current watching object of the child identity is continuously monitored; and when monitoring that the watching behavior of the child violates the preset rule, executing hierarchical intervention reminding and control processing according to a preset differential gradient adjustment algorithm. According to the invention, the method is high in viewer identity recognition accuracy, is high in environment adaptability, and is high in viewer behavior intervention processing efficiency and is accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision processing technology, and in particular to a method, device, smart terminal, and storage medium for preventing child addiction based on deep learning and behavior recognition. Background Technology

[0002] Currently, the management of children's television viewing time and eye health mainly relies on traditional parental control methods, such as physical password locks, preset timer shutdown functions, or single distance detection devices based on infrared sensors. While these technologies can provide basic protection, they suffer from shortcomings such as insufficient intelligence and poor environmental adaptability. Specifically, infrared sensors cannot accurately distinguish the user's identity and are easily affected by ambient light; the timer function lacks a real-time behavior judgment mechanism and cannot dynamically adjust according to the child's actual viewing posture; and the parental control functions are limited, failing to achieve remote parameter configuration and data visualization.

[0003] In addition, existing technical solutions still have technical gaps in areas such as accurate identity recognition, multi-dimensional behavior analysis, dynamic response mechanisms, and intelligent management for parents. They have failed to form a complete technical closed loop of "detection-analysis-intervention-feedback", resulting in problems such as high identity misjudgment rate, poor environmental adaptability, and inability to form closed-loop control.

[0004] Therefore, existing technologies still need improvement and development. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a child anti-addiction control method, device, smart terminal, and storage medium based on deep learning and behavior recognition. This invention forms a complete technical closed loop of detection-analysis-intervention-feedback, achieving high accuracy in identifying viewers, strong environmental adaptability, and fast and accurate intervention in viewer behavior.

[0006] The technical solution of this application is as follows: A method for preventing and controlling child addiction based on deep learning and behavior recognition, comprising: The system uses a pre-defined improved network model to analyze the viewers in front of the terminal in real time, identify whether the current viewers are children, and exclude occasional viewers. When the current viewing object is identified as a child, a three-dimensional model of the child's face is constructed, and a dynamic calibration process is used to calculate the viewing distance between the current viewing object (identified as a child) and the screen. Based on the determined child's identity and viewing distance, the viewing distance is analyzed in real time. If the viewing distance is continuously lower than a preset safety threshold for a predetermined period of time, a level one warning is issued. The viewing behavior of the child's current viewing object is continuously monitored. When a child's viewing behavior is detected to violate preset rules, a tiered intervention reminder and control process is implemented based on a preset differentiated gradient adjustment algorithm.

[0007] The aforementioned method for preventing child addiction based on deep learning and behavior recognition includes the step of analyzing the viewing objects in front of the terminal in real time through a preset improved network model to identify whether the current viewing object is a child and exclude occasional viewing objects. The system collects publicly available datasets and video images captured by the terminal's built-in camera in advance, and annotates the video images to define the child's facial region, as well as the adult face and pet interference objects, to construct a multi-scene child facial dataset. The YOLOv5 model is improved with lightweight design by replacing the standard convolutional layers with the GhostNet module and optimizing the loss function. The improved YOLOv5 model is used to analyze the images of the viewing objects captured by the terminal camera in real time, identify whether the current viewing object is a child, and exclude occasional viewing objects. If the current viewing object is detected to be a child within a continuously predetermined time period, then the current viewing object is identified as a child.

[0008] The aforementioned child anti-addiction control method based on deep learning and behavior recognition, wherein the step of identifying the current viewing object as a child, constructing a three-dimensional model of the child's face, and calculating the viewing distance between the current viewing object (identified as a child) and the screen using a dynamic calibration process includes: When used for the first time, the child is temporarily positioned facing the center of the TV screen; the built-in camera captures the child's facial image and performs dynamic calibration to calculate the camera's focal length and sensor physical size, establishing a mapping relationship between the pixel coordinate system and the real spatial scale. A three-dimensional facial feature model is constructed. The user's facial image is captured in real time through the terminal's built-in camera. The coordinate data of a predetermined number of three-dimensional feature points are extracted. A dynamic calibration process is set up, and the tip of the nose, the inner corners of the left and right eyes, and the center of the chin are selected as key distance measurement reference points. The Euclidean distance between the child's current viewing position and the screen is calculated in real time as the viewing distance.

[0009] The aforementioned child anti-addiction control method based on deep learning and behavior recognition includes the following steps: Based on a determined child's identity and viewing distance, the viewing distance is analyzed in real time; if the viewing distance is continuously detected to be below a preset safety threshold for a predetermined period of time, a first-level warning is issued; and the viewing behavior of the currently viewed object identified as the child is continuously monitored. A dual-threaded monitoring system is constructed to perform real-time analysis of children's dynamic behavior. Thread 1 acquires the data stream from the built-in camera in real time and calculates the viewing distance between the user's eyes and the screen, writing it into a circular buffer. Thread 2 reads the viewing distance data from the buffer. When the viewing distance value is detected to be less than the preset safety threshold in a series of predetermined frames, the cumulative timer is started and the sliding window warning mechanism is activated for judgment. If the user is detected to be off the screen, the timer is paused and reset. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with the first predetermined time as a window unit. When the weighted average of consecutive predetermined window units is continuously lower than the safety threshold, a first-level warning is triggered. Continue to monitor the viewing behavior of the current viewers who are children.

[0010] The aforementioned child anti-addiction control method based on deep learning and behavior recognition, wherein the step of executing graded intervention reminders and control processing according to a preset differentiated gradient adjustment algorithm when a child's viewing behavior is detected to violate preset rules includes: Sensitivity adjustment based on time decay function is adopted. In the initial stage of viewing, the safety distance threshold is relaxed by using an exponential decay function. When the cumulative viewing exceeds the second predetermined time, the control switches to linear decay mode to gradually tighten the threshold, and finally reaches the strict threshold at the third predetermined time. The control system implements graded intervention based on a preset differential gradient adjustment algorithm. When the viewing distance is continuously lower than a preset safety threshold, it is determined that the child's viewing behavior violates the preset rules, and the screen brightness is adjusted linearly according to the degree of violation. If the viewing time exceeds the set threshold, the system will trigger screen lock and start a fourth pre-defined cooldown period.

[0011] The aforementioned child anti-addiction control method based on deep learning and behavior recognition, wherein, after the step of executing graded intervention reminders and control processing according to a preset differentiated gradient adjustment algorithm when a child's viewing behavior is detected to violate preset rules, it further includes: All intervention records and behavioral data are synchronized to the parent's app via the MQTT protocol, allowing for remote modification of thresholds and analysis of historical data, as well as personalized parameter settings by receiving parent's operation commands. The YOLOv5 model is trained to improve its recognition accuracy using a federated learning framework, and a light intensity-range error compensation model is established to dynamically correct the range measurement value.

[0012] The aforementioned child anti-addiction control method based on deep learning and behavior recognition, wherein the steps of determining the child's identity and viewing distance, performing real-time judgment and analysis on the viewing distance, and issuing a first-level warning when the viewing distance is continuously detected to be below a preset safety threshold for a predetermined period of time; and continuously monitoring the viewing behavior of the child's current viewing object, further include: A dual-threaded monitoring system is constructed to perform real-time analysis of children's dynamic behavior. Thread 1 acquires data streams from the built-in camera in real time and calculates the viewing distance between the user's eyes and the screen, writing the data into a circular buffer. Thread 2 reads viewing distance data from the buffer. When the viewing distance value is less than the preset safety threshold in consecutive predetermined frames, it controls the start of the cumulative timer and sends the distance data of the consecutive predetermined frames and the corresponding extracted coordinate data of a predetermined number of three-dimensional feature points to the preset attitude stability evaluation module. The preset posture stability evaluation module analyzes the distance data of the consecutive predetermined frames and the coordinate data of the corresponding extracted three-dimensional feature points to determine the relative position change of the key facial feature points of the child corresponding to the consecutive predetermined frames; and calculates the average displacement and maximum displacement of the key feature points in three-dimensional space. The stability of the child's head posture corresponding to the consecutive predetermined frames is calculated by measuring the angle changes of the child's head in the pitch, yaw, and roll directions to determine whether there are continuous, directional posture changes rather than random, small-amplitude swaying. If it is detected that within N consecutive frames, the average displacement and maximum displacement of the key feature points are both lower than or equal to the preset slight shaking threshold, and the angular changes of the head posture in the three directions are all less than or equal to the preset posture stability threshold, then it is determined that the currently viewing child user is slightly shaking or making slight posture adjustments, rather than actively moving closer; then data filtering is performed and a first-level warning is not triggered. If it is detected that the average displacement and maximum displacement of the key feature points are both greater than the preset slight shaking threshold within N consecutive frames, and the angle change of the head posture in three directions is greater than the preset posture stability threshold, it is determined that the currently viewing child user has actively approached or changed posture beyond the preset range, and then the sliding window warning mechanism is activated for judgment. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with the first predetermined time as a window unit. When the weighted average of consecutive predetermined window units is continuously lower than the safety threshold, a level one warning is triggered.

[0013] A child anti-addiction control device based on deep learning and behavior recognition, wherein the device includes: The viewing object identification module is used to analyze the viewing object in front of the terminal in real time through a preset improved network model, identify whether the current viewing object is a child, and exclude occasional viewing objects. The viewing distance calculation module is used to calculate the viewing distance between the current viewing object (identified as a child) and the screen by constructing a 3D model of the child's face and using a dynamic calibration process when the current viewing object is identified as a child. The early warning judgment module is used to perform real-time judgment and analysis of the viewing distance based on the determined child's identity and viewing distance. If the viewing distance is detected to be continuously lower than a preset safety threshold for a predetermined period of time, a first-level early warning is issued; and the viewing behavior of the current viewing object identified as the child is continuously monitored. The graded intervention reminder and processing control module is used to execute graded intervention reminders and control processing according to the preset differential gradient adjustment algorithm when the child's viewing behavior is detected to violate the preset rules. The data push module is used to synchronize all intervention records and behavioral data to the parent's app via the MQTT protocol, receive parent's operation commands to remotely modify thresholds and analyze historical data, and set personalized parameters.

[0014] A smart terminal includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs including steps for performing any of the methods described herein.

[0015] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it enables an electronic device to perform the steps of any of the methods described.

[0016] As can be seen from the above, this application provides a child anti-addiction control method, device, smart terminal, and storage medium based on deep learning and behavior recognition. This invention first achieves accurate identification of children through the YOLOv5 model, constructs a 468-point facial 3D mesh using MediaPipeFaceMesh, and calculates the Euclidean distance between the user and the screen in real time; then, a dynamic timer and a dual threshold triggering mechanism are established. When the viewing distance is detected to be lower than the safety threshold or the single viewing time exceeds the set value, the screen brightness is automatically adjusted or the screen is locked; finally, the intervention records and behavior data are synchronized to the parent's app through the Internet of Things protocol, supporting remote modification of thresholds and analysis of historical data. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the child anti-addiction control method based on deep learning and behavior recognition according to Embodiment 1 of the present invention.

[0019] Figure 2 This is a flowchart illustrating the child anti-addiction control method based on deep learning and behavior recognition according to Embodiment 2 of the present invention.

[0020] Figure 3 The present invention provides a schematic diagram of an embodiment of a child anti-addiction control device based on deep learning and behavior recognition.

[0021] Figure 4 This is a block diagram illustrating the internal structure of a smart terminal provided in an embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0023] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.

[0024] Currently, the management of children's television viewing time and eye health mainly relies on traditional parental control methods, such as physical password locks, preset timer shutdown functions, or single distance detection devices based on infrared sensors. While these technologies can provide basic protection, they suffer from shortcomings such as insufficient intelligence and poor environmental adaptability: infrared sensors cannot accurately distinguish the user's identity and are easily affected by ambient light; the timer function lacks a real-time behavior judgment mechanism and cannot dynamically adjust according to the child's actual viewing posture; and the parental control functions are limited, failing to achieve remote parameter configuration and data visualization.

[0025] To address the aforementioned technical problems, this invention provides a child anti-addiction control method based on deep learning and behavior recognition, as detailed in the following embodiments.

[0026] Example 1 like Figure 1 As shown in the figure, an embodiment of the present invention provides a child anti-addiction control method based on deep learning and behavior recognition, which includes the following steps: Step S100: Analyze the viewing objects in front of the terminal in real time through a preset improved network model, identify whether the current viewing object is a child, and exclude occasional viewing objects. The improved network model in this embodiment refers to an AI algorithm model that is optimized and upgraded based on the traditional image recognition model. In this embodiment, the YOLOv5 model (object detection model) is lightened and improved by replacing the standard convolutional layer with the GhostNet module and optimizing the loss function. It has higher identity recognition accuracy, anti-interference ability and real-time processing efficiency. It can be specifically trained for children's facial features and body features, and can effectively distinguish between children and adults, static objects and other different viewing objects.

[0027] In this embodiment, the occasional viewing objects refer to non-target monitoring objects (such as adults briefly passing by, pets approaching the screen, etc.). Such objects do not need to be included in the scope of eye health management and should be automatically filtered by the algorithm to avoid false intervention.

[0028] The core of this step is to use a pre-trained and optimized AI network model to continuously and in real-time capture and analyze the features of viewers in front of the TV screen. The model extracts multi-dimensional information such as facial features (e.g., facial proportions, facial contours) and body features (e.g., height, build) of the viewers, and compares it with a pre-set database of children's features to accurately determine whether the current viewer is a child. At the same time, by setting a feature stability threshold, it automatically excludes non-continuous and non-targeted viewers such as adults who stay briefly or pets that move around, and only initiates subsequent management processes for children who are consistently watching.

[0029] This step-by-step embodiment can solve the problem of misidentification in traditional technologies. Because the present invention is inferior to infrared sensing in that it cannot distinguish the identity of the user, the improved network model can accurately identify the identity of children, avoid misinterpretation of adult viewing behavior, and improve the targeting of management.

[0030] Furthermore, this invention can eliminate interference factors and reduce invalid processing because it automatically filters out occasional non-target objects, reduces redundant algorithm calculations, ensures that resources are concentrated on children's eye management, and improves system operating efficiency.

[0031] Step S200: When the current viewing object is identified as a child, a three-dimensional model of the child's face is constructed, and a dynamic calibration process is used to calculate the viewing distance between the current viewing object (identified as a child) and the screen. The three-dimensional model in this embodiment can be constructed using MediaPipeFaceMesh (facial mesh detection) technology. Through multi-dimensional image acquisition, a three-dimensional model of a child's face containing length, width, and height information is constructed. Compared with two-dimensional images, it can more accurately reflect the spatial relationship between the face and the screen.

[0032] The dynamic calibration process in this embodiment refers to the process of updating the coordinates of facial feature points in real time and dynamically adjusting the measurement benchmark as the child's head movements and body position changes. This process can adapt to changes in the child's posture during viewing and avoid distance calculation deviations caused by fixed calibration.

[0033] In this embodiment, the viewing distance refers to the vertical distance between the child's key facial feature points (such as the center of the pupil) and the plane of the television screen. It is one of the core indicators for judging eye health and needs to be measured accurately to avoid vision damage caused by close-range viewing.

[0034] In this specific implementation, once step S100 confirms that the current viewing object is a child, multi-view image acquisition is initiated, such as using a high-definition camera or depth camera built into the TV, to capture multi-angle image information of the child's face. Based on computer vision technology, a three-dimensional model of the child's face is constructed, marking key feature points such as the pupils and bridge of the nose. Subsequently, through a dynamic calibration process, the spatial position changes of these feature points are tracked in real time. Combined with preset parameters such as screen size and installation position, the real-time viewing distance between the child and the screen is accurately calculated. Moreover, the distance data is updated synchronously with changes in the child's posture, such as leaning forward, leaning back, or moving left or right, ensuring the dynamic accuracy of the measurement results.

[0035] As can be seen, compared with the shortcomings of traditional infrared sensing which is easily affected by light interference, the present invention, which combines three-dimensional modeling and dynamic calibration, can accurately output distance data without being affected by ambient light or screen brightness, and has stronger environmental adaptability. This step can improve the accuracy of distance detection and overcome environmental interference.

[0036] Furthermore, this invention can adapt to children's dynamic viewing behavior. Since children's posture is easily changed during viewing, the dynamic calibration process can adjust the measurement benchmark in real time, avoiding distance misjudgment caused by fixed measurement methods and ensuring that the data matches the actual viewing state of children.

[0037] Step S300: Based on the determined child's identity and viewing distance, the viewing distance is analyzed in real time. If the viewing distance is continuously lower than a preset safety threshold for a predetermined period of time, a first-level warning is issued. The viewing behavior of the current viewing object with the child's identity is continuously monitored. The safety threshold in this embodiment refers to the critical viewing distance value preset based on the characteristics of children's visual development and ophthalmological medical standards. For example, different sizes of TVs correspond to different safety distances. The safety distance for a 55-inch TV is usually no less than 1.5 meters. If it is lower than this value, there is a risk of visual impairment.

[0038] In this embodiment, the first-level warning refers to a mild intervention signal preset by the system, which aims to remind children to adjust their viewing distance without affecting normal viewing behavior. This could include screen pop-up prompts or gentle voice reminders, and the intensity is lower than subsequent graded interventions.

[0039] The continuous predetermined time in this embodiment refers to a preset time threshold (such as 3 seconds or 5 seconds) to avoid false alarms caused by accidental close-up viewing. An alarm is only triggered when the close-up state continues for more than this time, thereby improving the rationality of intervention.

[0040] In this step, after confirming the child's identity and obtaining the real-time viewing distance, the system continuously compares and analyzes the dynamic distance data with a preset safety threshold, while simultaneously activating a timing mechanism. If the system detects that the child's viewing distance is below the safety threshold and this state persists for more than a preset time (e.g., 5 seconds), it determines that there is a mild risk of eye strain, and the system triggers a level one warning. After the warning is activated, the system does not interrupt distance monitoring and child behavior monitoring, continuously tracking whether the child adjusts their viewing distance and exhibits other undesirable viewing behaviors, providing a basis for deciding whether to escalate interventions.

[0041] As can be seen, this invention, through a continuous predetermined time judgment mechanism, filters out children's occasional short-term close-range behaviors such as looking down or bending over, avoiding frequent warnings that interfere with children's viewing experience and reducing unnecessary parental anxiety. Furthermore, this invention enables early intervention and protection, as the first-level warning is a mild reminder that can guide children before they develop bad viewing habits, reducing the risk of vision damage and embodying a prevention-oriented health management philosophy. Moreover, this invention enables dynamic monitoring in a closed loop, as continuous monitoring after a warning allows for real-time tracking of children's behavioral adjustments, providing data support for deciding whether to escalate interventions and avoiding management loopholes where there is no follow-up after a single warning.

[0042] Step S400: When a child's viewing behavior is detected to violate preset rules, a graded intervention reminder and control process is executed according to the preset differentiated gradient adjustment algorithm.

[0043] The preset rules in this embodiment refer to a list of undesirable viewing behaviors set based on eye health standards, including various violation scenarios such as continuous close-range viewing, tilting the head while viewing, prolonged viewing (exceeding the preset duration), and viewing in dimly lit environments.

[0044] The differentiated gradient adjustment algorithm in this embodiment refers to an algorithm that sets different intensity intervention measures according to the severity and duration of the violation, avoiding the rigidity of a single intervention method and realizing mild intervention for mild violations and enhanced intervention for severe violations.

[0045] The graded intervention reminder and control processing in this embodiment refers to intervention measures divided according to the level of violation. From low to high, these measures may include voice reminders, pop-up prompts, reducing screen brightness, shortening viewing time, and forced pausing of viewing, balancing the reminder effect with a user-friendly experience.

[0046] In the specific implementation of this step, while continuously monitoring children's viewing behavior, the system compares the child's behavior against preset rules for inappropriate viewing behaviors to determine whether the child has violated the rules and the severity of the violation. Based on a differentiated gradient adjustment algorithm, interventions of corresponding intensity are implemented for different violation scenarios: for example, if a child continues to watch at close range after a level one warning (moderate violation), a level two intervention is initiated, such as reducing screen brightness and repeating voice reminders; if a child tilts their head for a long time while watching, or continues to watch in a dimly lit environment (severe violation), a level three intervention is initiated, such as forcibly pausing viewing for 10 minutes and sending a reminder message to the parents. All intervention actions are dynamically adjusted based on the algorithm, and normal viewing behavior can be gradually restored after the violation is corrected.

[0047] As can be seen from the above, this embodiment can achieve the following benefits: 1) It enables humanized intervention, balancing protection and user experience. Because the differentiated gradient design adopted in this invention avoids "one-size-fits-all" mandatory control, minor violations are primarily addressed with reminders, while severe violations require stronger control. This protects children's eye health while respecting their normal viewing needs, thus increasing acceptance. 2) This invention solves the rigidity problem of traditional timer functions. Compared to the lack of behavioral judgment in traditional timer shutdowns, this step can dynamically adjust intervention measures based on the child's real-time violations, achieving on-demand intervention and more intelligent management.

[0048] In a further embodiment of the present invention, the child anti-addiction control method based on deep learning and behavior recognition further includes, after step S400: S500 synchronizes all intervention records and behavioral data to the parent app via the MQTT protocol, receives parent operation commands to remotely modify thresholds and analyze historical data, and sets personalized parameters. In this embodiment, intervention records and behavioral data are synchronized to the parent's app via the MQTT protocol, enabling parents to remotely modify thresholds and analyze historical data, and supporting personalized parameter settings.

[0049] S600 uses a federated learning framework to train the YOLOv5 model to improve its recognition accuracy and establishes a light intensity-range error compensation model to dynamically correct the range value.

[0050] This step introduces a federated learning framework to improve the recognition accuracy of the YOLO model and establishes a light intensity-range error compensation model to dynamically correct the range measurement values ​​of MediaPipe (a cross-platform machine learning framework).

[0051] In this embodiment of the invention, all intervention records and behavioral data can be synchronized to the parent's app in real time via the MQTT protocol. Parents can remotely modify monitoring parameters, view historical data analysis, and make personalized settings based on the child's age and vision on the app. Simultaneously, the system also has a self-optimization mechanism, continuously improving recognition accuracy through federated learning and dynamically correcting distance measurement values ​​through a light intensity compensation model, ensuring the long-term stability and accuracy of the system.

[0052] In summary, this invention fully covers the technical loop of "detection-analysis-intervention-feedback," from accurate identity recognition to dynamic distance detection, and then to graded early warning and intervention. It effectively solves the pain points of existing technologies such as misjudgment of identity, poor environmental adaptability, and rigid management, and provides intelligent and precise management support for children's eye health.

[0053] In a further embodiment of the present invention, the child anti-addiction control method based on deep learning and behavior recognition, step S100 specifically includes: S101. Pre-collect publicly available datasets and video images captured by the terminal's built-in camera, and annotate the video images to define the child's facial region, as well as the adult's face and the interference objects such as pets, to construct a multi-scene child's facial dataset; This embodiment primarily focuses on collecting a dataset of children's facial samples. Specifically, to achieve accurate identification of children, this invention first constructs a multi-scenario children's facial dataset. Data sources include publicly available datasets and surveillance video clips captured by the terminal's built-in camera, covering various indoor and outdoor lighting conditions, occlusion situations, and diverse viewing postures. The Labelme tool (an annotation tool) can be used for fine-grained image annotation, defining two types of target objects: children's facial areas are labeled as `child_face`, and adult faces, pets, and other interfering objects are labeled as `non_child`. The annotation specifications require the bounding box to completely cover the area from the hairline to the chin, and side-view annotations are allowed to extend 15% beyond the image edge. To further improve the model's generalization ability, a dynamic data augmentation strategy is adopted: randomly applying geometric transformations such as horizontal flipping, rotation, and scaling to the images, adjusting brightness and contrast, and simulating real-world scenarios by adding virtual mask or glasses textures. Finally, the dataset is divided into a training set, a validation set, and a test set in a 7:2:1 ratio. S102. Lightweight improvements were made to the YOLOv5 model by replacing the standard convolutional layers with the GhostNet module and optimizing the loss function. In this embodiment, the network model is then trained, and the YOLOv5 model is improved by lightweighting it by replacing the standard convolutional layers with the GhostNet module and optimizing the loss function.

[0054] Specifically, during the model training phase, this invention makes lightweight improvements based on the YOLOv5 architecture (a single-stage object detection architecture). The original YOLOv5 model consists of a CSPDarknet53 backbone network, a PANet feature fusion layer, and a detection head. Although it has strong multi-scale feature extraction capabilities, it requires a large amount of computation.

[0055] To address this, this invention replaces the standard convolutional layer with a GhostNet module: 1×1 convolutions generate partial feature maps, followed by depthwise separable convolutions to efficiently generate redundant features, reducing the number of model parameters and improving inference speed. The specific training process in this invention is divided into two stages: the first 50 epochs load COCO pre-trained weights and freeze the backbone network, training only the detector head for rapid convergence; the next 150 epochs unfreeze the entire network, using the AdamW optimizer and cosine annealing strategy to dynamically adjust the learning rate, while simultaneously enabling mixed-precision training to accelerate computation. The loss function in this invention balances classification and localization accuracy. Specifically, FocalLoss is used to strengthen the learning weights for occluded samples, CIoULoss (Complete Intersection over Union Loss) is used to optimize the aspect ratio and overlap of the bounding boxes, and confidence loss is used to suppress false background detections.

[0056] Here, epoch refers to a round, which is the process of completely traversing the training dataset once. One epoch means that all training samples have participated in one model parameter update. COCO, short for Common Objects in Context, is a classic open-source dataset in the field of computer vision. AdamW is an Adam optimizer with weight decay. It separates weight decay from the gradient update step based on the classic Adam optimizer, solving the problem of poor performance of the original Adam weight decay.

[0057] FocalLoss is an improved loss function proposed to address the class imbalance problem; CIoULoss is an advanced and improved version of IoULoss and GIoULoss, which solves the gradient vanishing problem of traditional IoULoss when the predicted box and the ground truth box do not overlap. At the same time, it considers the shape similarity of the bounding box, which can make the bounding box regression of the object detection model more accurate and converge faster.

[0058] In this embodiment of the invention, in order to more accurately measure the performance of the algorithm of the present invention, multiple evaluation indicators, including intersection-union ratio, precision, recall, and F1 score, are used to quantify the accuracy of children's face recognition.

[0059] Here, mIoU represents the Intersection over Union (IoU), a core evaluation metric for semantic segmentation tasks, and can also be used to evaluate the performance of bounding box regression in object detection. The calculation logic is as follows: First, calculate the IoU value for each category separately, then take the arithmetic mean of the IoU values ​​for all categories. The IoU formula is:

[0060] Where k is the number of categories; The accuracy formula is as follows:

[0061] Wherein, TP: True Positive (positive sample is correctly predicted as positive), FP: False Positive (negative sample is incorrectly predicted as positive); The recall rate formula is:

[0062] The formula for the F1 score is:

[0063] Among them, TP is a true positive, FP is a false positive, TN is a true negative, and FN is a false negative.

[0064] S103. Using the improved YOLOv5 model, the view of the object captured by the terminal camera is analyzed in real time to identify whether the current view is a child and exclude occasional viewers. In this embodiment, the terminal camera refers to a camera installed on a display device such as a television, used to capture real-time images of objects viewing the screen. In this embodiment, "occasional viewing objects" refers to distracting objects that are not continuously viewed, such as an adult passing by the screen or a pet briefly approaching.

[0065] In this embodiment, the camera on the television captures the scene in front of the screen in real time. Using the optimized and improved YOLOv5 model of this invention, the system quickly analyzes the viewers in the scene to determine if they are children. Simultaneously, it automatically filters out occasional, unmanaged objects (such as passing adults or pets). This step, compared to the limitations of traditional infrared sensing in identifying individuals, accurately identifies children, avoids misjudging or intervening in non-target objects such as adults, reduces unnecessary calculations, and improves system response efficiency.

[0066] S104. If the current viewing object is detected to be a child within a continuously predetermined time period, then it is determined that the current viewing object is a child.

[0067] In this embodiment, the continuous predetermined time refers to a time threshold preset by the system (e.g., 5 seconds, 10 seconds) to filter out brief interference and ensure stable recognition results. In this embodiment, determining that a child's identity has been identified means that the system has completed identity verification, formally determined that the currently continuously viewed object is a child, and triggered subsequent processes such as distance detection and behavior monitoring.

[0068] In the specific implementation of this step, when the model continuously detects for a set duration (e.g., 5 seconds) and all viewers in the screen are identified as children, the system of this invention will finally confirm that the person watching TV is a child, and then start the next step of the health management process.

[0069] In this way, the present invention can avoid misjudgment of identity due to situations such as children leaving briefly or adults staying briefly, ensuring that subsequent distance monitoring and behavioral intervention are only for children who are continuously watching, thereby improving the accuracy and reliability of the entire management plan.

[0070] This invention uses an improved YOLOv5 model to perform real-time analysis of images captured by a camera, accurately identifying children's faces in the scene and distinguishing between adults, pets, and other interfering objects, ensuring that only children's viewing behavior is included in the monitoring scope; it solves the problem of inaccurate identification in traditional methods.

[0071] In a further embodiment of the present invention, the child anti-addiction control method based on deep learning and behavior recognition, wherein step S200 specifically includes: S201. When used for the first time, the child is temporarily positioned facing the center of the TV screen. The built-in camera captures the facial image of the child, performs dynamic calibration, calculates the camera focal length and sensor physical size, and establishes a mapping relationship between the pixel coordinate system and the real spatial scale. S202. Construct a three-dimensional facial feature model, capture the user's facial image in real time through the terminal's built-in camera, extract the coordinate data of a predetermined number of three-dimensional feature points, and set up a dynamic calibration process. Select the tip of the nose, the inner corners of the left and right eyes, and the center of the chin as key distance measurement reference points, and calculate the Euclidean distance between the child's current viewing position and the screen in real time as the viewing distance.

[0072] In this invention, to achieve accurate measurement of children's viewing distance, a three-dimensional facial feature model is constructed using MediaPipeFaceMesh technology. First, the user's facial image is captured in real-time by the TV's built-in camera and input into the FaceMesh model to extract the coordinates of 468 three-dimensional feature points, with the tip of the nose, the inner corners of the left and right eyes, and the center of the chin serving as key distance measurement reference points. To address distance measurement deviations caused by differences in camera installation positions, this invention designs a dynamic calibration process: during system initialization, the user is temporarily positioned directly facing the center of the screen. Based on this posture, the camera focal length f and the sensor physical size s are calculated, establishing a mapping relationship between the pixel coordinate system and the real-world spatial scale.

[0073] Then, distance calculation is performed. In the distance calculation stage, the midpoint of the line connecting the inner angles of both eyes is selected as the distance measurement reference point. Combining the camera's intrinsic parameter matrix K with the three-dimensional coordinates X, Y, Z of the feature points, the Euclidean distance between the user and the screen is inversely calculated through perspective projection transformation.

[0074] in This represents the average distance between the eyes of an actual human face. The width of the corresponding pixel in the image. In this embodiment of the invention, to further improve robustness in complex environments, a light intensity compensation mechanism is introduced: the real-time light intensity L is obtained through an ambient light sensor. When L < 50, a multi-frame weighted average algorithm is used to smooth the ranging jitter; when L > 1000, a backup infrared auxiliary ranging module is activated to perform data fusion, reducing the risk of facial feature point loss.

[0075] This invention addresses distance measurement accuracy, conducting multi-scenario tests within a 0.5-3 meter range: under standard lighting and with the user stationary, the distance measurement error rate is <2%; in dynamic scenarios, by predicting motion trajectories using a Kalman filter, the error rate is controlled within 4.5%. Compared to traditional monocular distance measurement solutions, this invention demonstrates significant accuracy advantages when measuring the user's profile. Furthermore, the system automatically triggers a calibration process every 30 days, dynamically updating the internal parameter matrix based on false alarm data from the parent's app, ensuring long-term stability.

[0076] In this embodiment of the invention, the user's facial image is captured by a camera, the coordinates of 468 three-dimensional feature points are extracted, and a dynamic calibration process is designed to solve the distance measurement deviation caused by the difference in camera installation position, thereby accurately calculating the distance between the child and the screen.

[0077] Furthermore, this invention utilizes MediaPipeFaceMesh technology to construct a 3D model of a child's face, extracting 468 feature points, and using the tip of the nose, the inner corners of the left and right eyes, and the center of the chin as key distance measurement reference points. Through a dynamic calibration process, the system can accurately calculate the Euclidean distance between the child's face and the screen, solving the problems of large errors and significant influence from posture in traditional monocular distance measurement.

[0078] In a further embodiment of the present invention, the child anti-addiction control method based on deep learning and behavior recognition, wherein step S300 specifically includes: S301. Construct a dual-thread monitoring system to perform real-time analysis of children's dynamic behavior. Thread 1 acquires the data stream from the built-in camera in real time and calculates the viewing distance between the user's eyes and the screen, writing it into a circular buffer. Thread 2 reads the viewing distance data from the buffer. When the viewing distance value is detected to be less than the preset safety threshold in consecutive predetermined frames, the cumulative timer is started and the sliding window warning mechanism is entered for judgment. If the user is detected to be off the screen, the timer is paused and reset. In this embodiment of the invention, a dual-threaded monitoring system is constructed. Thread one acquires camera data streams in real time via an asynchronous I / O mechanism. For example, it calls the MediaPipeFaceMesh interface (MediaPipe face mesh interface) every 33ms to calculate the Euclidean distance between the user's eyes and the screen, which is the viewing distance, and writes the viewing distance data into a circular buffer. In this embodiment, thread one adopts a priority scheduling strategy to ensure that the real-time performance of distance data is prioritized even when CPU utilization is >80%, and the latency jitter is controlled within ±5ms.

[0079] Then thread two reads distance data from the circular buffer according to the first-in-first-out principle. For example, when the distance value is detected to be less than the safety threshold for 5 consecutive frames, the cumulative timer is started; if the user is detected to be off-screen, the timer is paused and the counter is reset.

[0080] After obtaining the child's identity and viewing distance, this invention employs dual-thread monitoring. One thread acquires camera data in real time and calculates the distance, storing the data in a circular buffer. The other thread reads data from the buffer and determines whether the child is within a safe distance based on distance data from multiple consecutive frames. When the detected distance consistently falls below the safe threshold, the system starts a cumulative timer. If the child leaves the screen, the timer pauses and resets, preventing invalid timing.

[0081] S302. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with the first predetermined time as a window unit. When the weighted average of consecutive predetermined window units is continuously lower than the safety threshold, a first-level warning is triggered. In this embodiment of the invention, to achieve stability in distance monitoring and reduce interference from instantaneous actions, a time-series-based sliding window early warning mechanism is employed. Using a 5-second window unit, an exponentially decaying weighted average is calculated for the effective distance data, assigning higher weight to recent data. A Level 1 early warning is triggered when the weighted average of three consecutive windows remains below a safety threshold.

[0082] In this embodiment of the invention, to improve the stability and adaptability of monitoring, a sliding window early warning mechanism and a time decay function sensitivity adjustment are introduced. The sliding window mechanism effectively filters out instantaneous motion interference by weighted averaging of recent distance data, ensuring the accuracy of the early warning. The time decay function provides a relaxed adaptation period in the initial viewing stage, and then gradually tightens the threshold, making the intervention more humane and reasonable.

[0083] S303. Continue to monitor the viewing behavior of the current viewers who are children.

[0084] In a further embodiment of the present invention, the child anti-addiction control method based on deep learning and behavior recognition, wherein step S400 includes: S401. Sensitivity adjustment based on time decay function is adopted. In the initial stage of viewing, the safety distance threshold is relaxed by using an exponential decay function. When the cumulative viewing exceeds the second predetermined time, the control switches to linear decay mode to gradually tighten the threshold, and finally reaches the strict threshold at the third predetermined time. In this embodiment of the invention, sensitivity adjustment based on a time decay function is employed. Specifically, for example, in the initial stage of viewing, an exponential decay function is used to relax the safe distance threshold, allowing children sufficient time to adapt; after accumulating more than 20 minutes of viewing, the system switches to a linear decay mode, eventually reaching the strict threshold at 30 minutes.

[0085] S402. Control the implementation of graded intervention based on a preset differential gradient adjustment algorithm. When the detected viewing distance is continuously lower than the preset safety threshold, it is determined that the child's viewing behavior violates the preset rules, and the screen brightness is adjusted linearly according to the degree of violation. S403. When the viewing time exceeds the set threshold, the screen will be locked and a fourth predetermined cooling-off period will be initiated.

[0086] Intelligent intervention measures and data synchronization strategies will be adopted in the embodiments of the present invention; In practical implementation, this invention employs tiered intervention. To achieve a user-friendly design for tiered intervention, this invention sets up a differentiated gradient adjustment algorithm. Specifically, when the detection distance continuously exceeds the limit, the brightness is adjusted linearly according to the degree of violation, and hue and saturation are kept stable through HSV color space conversion to avoid image distortion. If the viewing time exceeds a set threshold, screen locking is immediately triggered and a 5-minute cooling-off period is initiated.

[0087] In this embodiment of the invention, when a child's viewing behavior (such as being too close or exceeding the viewing time limit) violates preset rules, a tiered intervention is executed based on a differentiated gradient adjustment algorithm. For example, if the viewing distance is consistently exceeded, the screen brightness is linearly adjusted as a reminder; if the viewing time exceeds the limit, the screen is locked and a cooling-off period is initiated, forcing the child to rest. This tiered intervention mechanism avoids a rigid, one-size-fits-all approach and improves the user experience.

[0088] This invention also enables data synchronization. For example, to achieve real-time monitoring and security auditing on the parent's end, this invention uses the MQTT protocol (Message Queuing Telemetry Transport Protocol) to build a low-latency communication channel and transmits intervention events to the parent's app in encrypted form through a TLS (Transport Layer Security) encrypted tunnel.

[0089] This invention also allows for personalized parameter settings. By deploying a threshold adaptive module in the parent's app, parents can set personalized parameters based on their child's age and vision.

[0090] The present invention will be further described in detail below through specific application examples: like Figure 2 As shown in the illustration, the child anti-addiction control method based on deep learning and behavior recognition described in this specific application embodiment includes the following steps: S10: Collect and obtain the face dataset from your own videos, then proceed to S12; S11. Collect and obtain publicly available face datasets, then proceed to S12; S12, Train the improved model based on YOLOv5, and then proceed to S13; S13. Perform child face detection. If no child face is detected, proceed to S14. If a child face is detected, proceed to S15. S14. Maintain normal mode; S15. Trigger the child anti-addiction mode and simultaneously proceed to steps S16 and S17. S16. Calculate the off-screen distance, and then proceed to S18; S17. Start timing synchronously, then proceed to S18; S18, time-distance graded early warning and intervention, then proceed to S19; S19. Warning results are synchronized to the parent's app.

[0091] For example, in a family, the parents want to use the system implemented by the method of this invention to manage their child Xiaoming's TV watching habits in order to protect his eyesight.

[0092] During the initialization and setup of the TV system, the parent app is configured first. Parents set Xiaoming's age to 8 years old in the parent mobile app and, based on his eyesight, set the safe viewing distance threshold to 1.5 meters and the single viewing time threshold to 30 minutes.

[0093] Upon initial system startup, a calibration process will be performed, prompting Xiaoming to temporarily face the center of the TV screen. The built-in camera captures Xiaoming's facial image, and the system uses MediaPipeFaceMesh technology for dynamic calibration, calculating the camera's focal length and sensor's physical size to establish a mapping between the pixel coordinate system and the real-world spatial scale, ensuring the accuracy of subsequent distance measurements.

[0094] Then, when watching TV, follow these steps: 1) First, identify the child: Xiaoming is sitting on the sofa, ready to watch TV. The TV's built-in camera captures the image in real time. The TV system of this invention analyzes the image using an improved YOLOv5 model, accurately identifying Xiaoming (child_face) and excluding the pet dog passing by (non_child) or the parent who occasionally appears in the frame.

[0095] 2) Then, distance monitoring is performed: The system of this invention uses MediaPipeFaceMesh technology to extract 468 three-dimensional feature points of Xiaoming's face in real time, and calculates the real-time Euclidean distance between Xiaoming and the TV screen based on key points such as the tip of the nose and the inner corners of the left and right eyes.

[0096] 3) Then conduct behavioral analysis and early warning: If Xiaoming moves too close to the TV out of curiosity or unconsciously, and the distance between Xiaoming and the TV screen is detected to be less than the safety threshold of 1.5 meters for 5 consecutive frames (approximately 165 milliseconds), the system of this embodiment of the invention will start a cumulative timer.

[0097] Then, a sliding window warning will be triggered. The system uses a 5-second window unit to perform an exponentially decaying weighted average of Xiaoming's distance data within the window. If the weighted average of three consecutive windows is less than 1.5 meters, the system will trigger a level one warning.

[0098] Then, a tiered intervention (distance) will be implemented. At this point, the system will linearly reduce the brightness of the TV screen according to a differentiated gradient adjustment algorithm, for example, from 100% to 80%, gently reminding Xiaoming to move away. If Xiaoming continues to approach, the brightness will be further reduced.

[0099] If Xiaoming continues watching TV within a safe distance and exceeds the viewing time limit, the system will start timing. In the initial viewing phase (e.g., the first 20 minutes), the system uses a time decay function to leniently handle the distance threshold, allowing Xiaoming a brief period of adjustment. However, once the cumulative viewing time reaches 20 minutes, the system switches to a linear decay mode, strictly judging the threshold. When the cumulative viewing time reaches 30 minutes, the system immediately triggers a screen lock operation, the TV screen goes black, and a 5-minute cooldown period begins, forcing Xiaoming to rest.

[0100] If Xiaoming leaves the sofa to get a drink while watching, the system will detect that the user has left the screen, immediately pause the timer and reset it to prevent the timer from continuing when Xiaoming is not present.

[0101] The invention will then incorporate feedback and system optimization from parents, including: 1) In this embodiment of the invention, all behavioral data of Xiaoming watching TV, such as viewing time, distance changes, and intervention records, will be transmitted to the parent's App in real time via the MQTT protocol with encryption.

[0102] 2) In this embodiment of the invention, parents can view Xiaoming's viewing report on the App to understand his viewing habits. If parents find that the system's distance measurement is occasionally inaccurate under certain lighting conditions, they can provide feedback in the App.

[0103] 3) In this embodiment of the invention, the system collects feedback data from multiple terminals, including the household, and updates the YOLOv5 model weights through a federated learning framework to improve the robustness of recognition under different children's clothing and occlusion scenarios. Simultaneously, the system dynamically corrects the MediaPipe ranging value based on ambient light sensor data to further improve ranging accuracy.

[0104] Through the above embodiments, the present invention can achieve intelligent, dynamic, and humanized management of children's television viewing behavior, effectively prevent children's television addiction, and protect children's vision health.

[0105] Furthermore, regarding the slight, unintentional movements children may make while watching television, such as minor head movements or slight adjustments to their body posture, these movements, while not constituting a substantial change in viewing posture, can cause the ranging results to fluctuate frequently around the safety threshold due to MediaPipeFace Mesh's distance measurement based on facial feature points. This can trigger unnecessary warnings or interventions, affecting the child's viewing experience and potentially causing resistance and reducing the system's acceptance. To further optimize the implementation, this invention provides an optimization scheme that, based on a time-series-based sliding window warning mechanism, introduces multi-frame posture stability assessment and performs deeper semantic analysis on the ranging data to distinguish between genuine violations and occasional slight movements. Specifically, this optimized scheme includes a child anti-addiction control method based on deep learning and behavior recognition, comprising the following steps: S901. Construct a dual-thread monitoring system to perform real-time analysis of children's dynamic behavior. Thread 1 acquires the data stream from the built-in camera in real time and calculates the viewing distance between the user's eyes and the screen, writing it into a circular buffer. In this optimized embodiment, the same mechanism as in Embodiment 1 is used for data acquisition and preliminary judgment. Thread 1 continues to acquire camera data streams in real time and calculates the Euclidean distance between the user's eye and the screen, writing it into a circular buffer. Thread 2 reads distance data from the buffer, and when the distance value is detected to be less than the safety threshold for 5 consecutive frames, a cumulative timer is started.

[0106] S902, Thread 2 reads viewing distance data from the buffer. When the viewing distance value detected in consecutive predetermined frames is less than the preset safety threshold, the cumulative timer is started, and the distance data of the consecutive predetermined frames and the corresponding extracted coordinate data of the predetermined three-dimensional feature points are sent to the preset attitude stability evaluation module. In this embodiment, for example, when thread 2 detects that the distance is less than the safety threshold for 5 consecutive frames and starts the cumulative timer, this embodiment will not immediately send these data to the sliding window warning mechanism. Instead, it will first send the distance data of these consecutive N frames (e.g., N=15 frames, about 0.5 seconds) and the coordinate data of the 468 three-dimensional feature points extracted by the MediaPipe Face Mesh to the preset attitude stability evaluation module.

[0107] S903. Analyze the distance data of the consecutive predetermined frames and the coordinate data of the corresponding extracted three-dimensional feature points through the preset posture stability evaluation module to determine the relative position change of the key facial feature points of the child corresponding to the consecutive predetermined frames; calculate the average displacement and maximum displacement of the key feature points in three-dimensional space. In this embodiment, the preset posture stability evaluation module analyzes the relative positional changes of key facial feature points of the child within N consecutive frames, including key ranging points such as the tip of the nose and the inner corners of the left and right eyes. Specifically, this embodiment calculates the average and maximum displacement of these key feature points in three-dimensional space within these N frames.

[0108] S904. The stability of the child's head posture corresponding to the consecutive predetermined frames is calculated by measuring the angle changes of the child's head in the three directions of pitch, yaw, and roll, and determining whether there are continuous, directional posture changes rather than random, small-amplitude swaying. In addition, this embodiment also evaluates the stability of the child's head posture within these N frames. For example, by calculating the angle changes of the child user's head in the pitch, yaw, and roll directions, it is determined whether there are continuous, directional posture changes, such as continuous head-down or continuous sideways movement, rather than random, small-amplitude swaying.

[0109] S905. When it is detected that within N consecutive frames, the average displacement and maximum displacement of the key feature points are both lower than or equal to the preset slight shaking threshold, and the angle changes of the head posture in the three directions are all less than or equal to the preset posture stability threshold, it is determined that the currently viewing child user is slightly shaking or making slight posture adjustments, rather than actively approaching; then data filtering is performed to prevent the triggering of the first-level warning. In this embodiment, if within N frames, the average displacement and maximum displacement of key feature points are both lower than a preset slight swaying threshold, for example, the average displacement is less than 2 cm and the maximum displacement is less than 5 cm, and the angle changes of head posture in three directions are all less than a preset posture stability threshold, for example, less than 5 degrees, then the system of the present invention judges it as a slight swaying or posture adjustment of the child, rather than an active approach.

[0110] In this situation, the system of the present invention will mark the distance data of these N frames as unstable data and exclude them from the valid distance data of the subsequent sliding window warning mechanism, or assign them a very low weight. The timer continues to run, but will not trigger a warning, that is, it will not trigger a level one warning.

[0111] S906. When it is detected that within N consecutive frames, the average displacement and maximum displacement of the key feature points are both greater than the preset slight shaking threshold, and the angle changes of the head posture in three directions are all greater than the preset posture stability threshold, it is determined that the currently viewing child user has actively approached or changed posture beyond the preset range, and the sliding window warning mechanism is activated for judgment. In this embodiment, if within N consecutive frames, the displacement of key feature points of a child user or the change in head posture exceeds the preset slight sway threshold and / or preset posture stability threshold, indicating that the child has indeed actively approached or significantly changed posture, then this distance data is considered valid violation data and is normally sent to the sliding window warning mechanism for subsequent processing.

[0112] S907. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with the first predetermined time as a window unit. When the weighted average of consecutive predetermined window units is continuously lower than the safety threshold, a first-level warning is triggered.

[0113] In this embodiment of the invention, only valid violation data filtered by the attitude stability assessment module will enter the time-series-based sliding window early warning mechanism for exponential decay weighted average calculation. A first-level early warning is triggered only when the weighted average of three consecutive windows remains below the safety threshold, and a differentiated gradient adjustment algorithm is initiated for tiered intervention.

[0114] As can be seen, by analyzing the relative displacement of feature points and changes in head posture within multiple frames, this invention can more intelligently distinguish between noise and signals that indicate the child is actually close.

[0115] This invention utilizes rich information from three-dimensional feature points. The 468 three-dimensional feature points provided by MediaPipe Face Mesh technology are not only used for distance measurement, but their relative position changes between consecutive frames also contain rich posture information. By analyzing the displacement and head rotation of these points, the nature of a child's movements can be determined more accurately. Furthermore, this invention avoids frequently triggering unnecessary warnings and interventions due to children's unconscious slight movements, reducing false alarm rates, thereby improving the system's intelligence and humanization, reducing children's resistance to the system, and making them more willing to accept system management.

[0116] As can be seen, through this optimization, the present invention can more accurately understand children's viewing intentions and only activate warnings and adjustments when intervention is truly needed, making anti-addiction management more intelligent, precise and humane.

[0117] Exemplary device like Figure 3 As shown, this embodiment of the invention provides a child anti-addiction control device based on deep learning and behavior recognition. The device includes: The viewing object identification module 310 is used to perform real-time analysis of the viewing object in front of the terminal through a preset improved network model, identify whether the current viewing object is a child, and exclude occasional viewing objects. The viewing distance calculation module 320 is used to calculate the viewing distance between the current viewing object (identified as a child) and the screen by constructing a three-dimensional model of the child's face and using a dynamic calibration process when the current viewing object is identified as a child. The early warning judgment module 330 is used to perform real-time judgment and analysis on the viewing distance based on the determined child's identity and viewing distance. If the viewing distance is detected to be continuously lower than a preset safety threshold for a predetermined period of time, a first-level early warning is controlled; and the viewing behavior of the current viewing object with the child's identity is continuously monitored. The graded intervention reminder and processing control module 340 is used to execute graded intervention reminders and control processing according to the preset differential gradient adjustment algorithm when the child's viewing behavior is detected to violate the preset rules. The data push module 350 is used to synchronize all intervention records and behavioral data to the parent's app via the MQTT protocol, receive parent's operation instructions to remotely modify thresholds and analyze historical data, and set personalized parameters, as described above.

[0118] Based on the above embodiments, the present invention also provides a smart terminal, which can be a smart TV, and its principle block diagram can be as follows. Figure 4 As shown. The intelligent terminal includes a processor, memory, network interface, display screen, and database connected via a system bus.

[0119] The memory stores one or more programs configured to be executed by a processor to implement the child anti-addiction control method based on deep learning and behavior recognition described in the above embodiments.

[0120] Here, "intelligent terminal" refers to a smart computer or similar device with data processing capabilities. The memory can be internal memory, flash memory, hard disk, or cloud storage, used to store program code and various other data, including pre-collected publicly available datasets and video image data captured by the terminal's built-in camera. The processor can be a central processing unit (CPU), used to execute the algorithmic logic within the program. The program includes child anti-addiction control methods based on deep learning and behavior recognition.

[0121] In a further embodiment, a smart terminal of this embodiment includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: The system uses a pre-defined improved network model to analyze the viewers in front of the terminal in real time, identify whether the current viewers are children, and exclude occasional viewers. When the current viewing object is identified as a child, a three-dimensional model of the child's face is constructed, and a dynamic calibration process is used to calculate the viewing distance between the current viewing object (identified as a child) and the screen. Based on the determined child's identity and viewing distance, the viewing distance is analyzed in real time. If the viewing distance is continuously lower than a preset safety threshold for a predetermined period of time, a level one warning is issued. The viewing behavior of the child's current viewing object is continuously monitored. When a child's viewing behavior is detected to violate preset rules, a tiered intervention reminder and control process is executed according to a preset differentiated gradient adjustment algorithm, as described above.

[0122] The step of analyzing the viewers in front of the terminal in real time using a preset improved network model to identify whether the current viewers are children and exclude occasional viewers includes: The system collects publicly available datasets and video images captured by the terminal's built-in camera in advance, and annotates the video images to define the child's facial region, as well as the adult face and pet interference objects, to construct a multi-scene child facial dataset. The YOLOv5 model is improved with lightweight design by replacing the standard convolutional layers with the GhostNet module and optimizing the loss function. The improved YOLOv5 model is used to analyze the images of the viewing objects captured by the terminal camera in real time, identify whether the current viewing object is a child, and exclude occasional viewing objects. If the current viewing object is detected to be a child within a continuously predetermined time period, then the current viewing object is identified as a child.

[0123] The step of identifying the current viewing object as a child, constructing a 3D model of the child's face, and calculating the viewing distance between the current viewing object (identified as a child) and the screen using a dynamic calibration process includes: When used for the first time, the child is temporarily positioned facing the center of the TV screen; the built-in camera captures the child's facial image and performs dynamic calibration to calculate the camera's focal length and sensor physical size, establishing a mapping relationship between the pixel coordinate system and the real spatial scale. A three-dimensional facial feature model is constructed. The user's facial image is captured in real time through the terminal's built-in camera. The coordinate data of a predetermined number of three-dimensional feature points are extracted. A dynamic calibration process is set up, and the tip of the nose, the inner corners of the left and right eyes, and the center of the chin are selected as key distance measurement reference points. The Euclidean distance between the child's current viewing position and the screen is calculated in real time as the viewing distance.

[0124] The steps of determining the child's identity and viewing distance, performing real-time analysis of the viewing distance, and issuing a level-one warning when the viewing distance is continuously below a preset safety threshold for a predetermined period of time, and continuously monitoring the viewing behavior of the child's current viewing object, include: Thread 1 acquires the built-in camera data stream in real time and calculates the viewing distance between the user's eyes and the screen, writing it into a circular buffer; Thread 2 reads the viewing distance data from the buffer, and when the viewing distance value is detected to be less than the preset safety threshold in consecutive predetermined frames, it controls the start of the cumulative timer and controls the entry of the sliding window warning mechanism for judgment. If the user is detected to be off the screen, the timer is paused and reset. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with the first predetermined time as a window unit. When the weighted average of consecutive predetermined window units is continuously lower than the safety threshold, a first-level warning is triggered. Continue to monitor the viewing behavior of the current viewers who are children.

[0125] The step of executing graded intervention reminders and control processing according to a preset differentiated gradient adjustment algorithm when a child's viewing behavior is detected to violate preset rules includes: Sensitivity adjustment based on time decay function is adopted. In the initial stage of viewing, the safety distance threshold is relaxed by using an exponential decay function. When the cumulative viewing exceeds the second predetermined time, the control switches to linear decay mode to gradually tighten the threshold, and finally reaches the strict threshold at the third predetermined time. The control system implements graded intervention based on a preset differential gradient adjustment algorithm. When the viewing distance is continuously lower than a preset safety threshold, it is determined that the child's viewing behavior violates the preset rules, and the screen brightness is adjusted linearly according to the degree of violation. If the viewing time exceeds the set threshold, the system will trigger screen lock and start a fourth pre-defined cooldown period.

[0126] The step of executing graded intervention reminders and control processing according to a preset differential gradient adjustment algorithm when a child's viewing behavior is detected to violate preset rules also includes: All intervention records and behavioral data are synchronized to the parent's app via the MQTT protocol, allowing for remote modification of thresholds and analysis of historical data, as well as personalized parameter settings by receiving parent's operation commands. The YOLOv5 model is trained to improve its recognition accuracy using a federated learning framework, and a light intensity-range error compensation model is established to dynamically correct the range measurement value.

[0127] The step of determining the child's identity and viewing distance, and then performing real-time analysis on the viewing distance, and issuing a level-one warning when the viewing distance is continuously below a preset safety threshold for a predetermined period of time; and continuously monitoring the viewing behavior of the child's current viewing object, further includes: A dual-threaded monitoring system is constructed to perform real-time analysis of children's dynamic behavior. Thread 1 acquires data streams from the built-in camera in real time and calculates the viewing distance between the user's eyes and the screen, writing the data into a circular buffer. Thread 2 reads viewing distance data from the buffer. When the viewing distance value is less than the preset safety threshold in consecutive predetermined frames, it controls the start of the cumulative timer and sends the distance data of the consecutive predetermined frames and the corresponding extracted coordinate data of a predetermined number of three-dimensional feature points to the preset attitude stability evaluation module. The preset posture stability evaluation module analyzes the distance data of the consecutive predetermined frames and the coordinate data of the corresponding extracted three-dimensional feature points to determine the relative position change of the key facial feature points of the child corresponding to the consecutive predetermined frames; and calculates the average displacement and maximum displacement of the key feature points in three-dimensional space. The stability of the child's head posture corresponding to the consecutive predetermined frames is calculated by measuring the angle changes of the child's head in the pitch, yaw, and roll directions to determine whether there are continuous, directional posture changes rather than random, small-amplitude swaying. If it is detected that within N consecutive frames, the average displacement and maximum displacement of the key feature points are both lower than or equal to the preset slight shaking threshold, and the angular changes of the head posture in the three directions are all less than or equal to the preset posture stability threshold, then it is determined that the currently viewing child user is slightly shaking or making slight posture adjustments, rather than actively moving closer; then data filtering is performed and a first-level warning is not triggered. If it is detected that the average displacement and maximum displacement of the key feature points are both greater than the preset slight shaking threshold within N consecutive frames, and the angle change of the head posture in three directions is greater than the preset posture stability threshold, it is determined that the currently viewing child user has actively approached or changed posture beyond the preset range, and then the sliding window warning mechanism is activated for judgment. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with a first predetermined time as a window unit. When the weighted average of a series of predetermined window units is continuously lower than the safety threshold, a first-level warning is triggered, as described above.

[0128] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, enables an electronic device to perform the steps of any of the methods described above, specifically as described above.

[0129] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0130] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for preventing and controlling child addiction based on deep learning and behavior recognition, characterized in that, include: The system uses a pre-defined improved network model to analyze the viewers in front of the terminal in real time, identify whether the current viewers are children, and exclude occasional viewers. When the current viewing object is identified as a child, a three-dimensional model of the child's face is constructed, and a dynamic calibration process is used to calculate the viewing distance between the current viewing object (identified as a child) and the screen. Based on the confirmed child's identity and viewing distance, the viewing distance is analyzed in real time. If the viewing distance is continuously lower than a preset safety threshold for a predetermined period of time, a level one warning is issued. And continuously monitor the viewing behavior of the current viewers who are identified as children; When a child's viewing behavior is detected to violate preset rules, a tiered intervention reminder and control process is implemented based on a preset differentiated gradient adjustment algorithm.

2. The child anti-addiction control method based on deep learning and behavior recognition according to claim 1, characterized in that, The step of analyzing the viewers in front of the terminal in real time using a preset improved network model to identify whether the current viewers are children and exclude occasional viewers includes: The system collects publicly available datasets and video images captured by the terminal's built-in camera in advance, and annotates the video images to define the child's facial region, as well as the adult face and pet interference objects, to construct a multi-scene child facial dataset. The YOLOv5 model is improved with lightweight design by replacing the standard convolutional layers with phantom network modules and optimizing the loss function. The improved YOLOv5 model is used to analyze the images of the viewing objects captured by the terminal camera in real time, identify whether the current viewing object is a child, and exclude occasional viewing objects. If the current viewing object is detected to be a child within a continuously predetermined time period, then the current viewing object is identified as a child.

3. The child anti-addiction control method based on deep learning and behavior recognition according to claim 1, characterized in that, The step of identifying the current viewing object as a child, constructing a 3D model of the child's face, and calculating the viewing distance between the current viewing object (identified as a child) and the screen using a dynamic calibration process includes: When used for the first time, the child is temporarily positioned facing the center of the TV screen; the built-in camera captures the child's facial image and performs dynamic calibration to calculate the camera's focal length and sensor physical size, establishing a mapping relationship between the pixel coordinate system and the real spatial scale. A three-dimensional facial feature model is constructed. The user's facial image is captured in real time through the terminal's built-in camera. The coordinate data of a predetermined number of three-dimensional feature points are extracted. A dynamic calibration process is set up, and the tip of the nose, the inner corners of the left and right eyes, and the center of the chin are selected as key distance measurement reference points. The Euclidean distance between the child's current viewing position and the screen is calculated in real time as the viewing distance.

4. The child anti-addiction control method based on deep learning and behavior recognition according to claim 1, characterized in that, Based on the determined child's identity and viewing distance, the viewing distance is analyzed in real time. If the viewing distance is detected to be continuously lower than a preset safety threshold for a predetermined period of time, a first-level warning is issued. The steps for continuously monitoring the viewing behavior of the current viewers who are children include: A dual-threaded monitoring system is constructed to perform real-time analysis of children's dynamic behavior. Thread 1 acquires the data stream from the built-in camera in real time and calculates the viewing distance between the user's eyes and the screen, writing it into a circular buffer. Thread 2 reads the viewing distance data from the buffer. When the viewing distance value is detected to be less than the preset safety threshold in a series of predetermined frames, the cumulative timer is started and the sliding window warning mechanism is activated for judgment. If the user is detected to be off the screen, the timer is paused and reset. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with the first predetermined time as a window unit. When the weighted average of consecutive predetermined window units is continuously lower than the safety threshold, a first-level warning is triggered. Continue to monitor the viewing behavior of the current viewers who are children.

5. The child anti-addiction control method based on deep learning and behavior recognition according to claim 1, characterized in that, The step of executing graded intervention reminders and control processing according to a preset differential gradient adjustment algorithm when a child's viewing behavior is detected to violate preset rules includes: Sensitivity adjustment based on time decay function is adopted. In the initial stage of viewing, the safety distance threshold is relaxed by using an exponential decay function. When the cumulative viewing exceeds the second predetermined time, the control switches to linear decay mode to gradually tighten the threshold, and finally reaches the strict threshold at the third predetermined time. The control system implements graded intervention based on a preset differential gradient adjustment algorithm. When the viewing distance is continuously lower than a preset safety threshold, it is determined that the child's viewing behavior violates the preset rules, and the screen brightness is adjusted linearly according to the degree of violation. If the viewing time exceeds the set threshold, the system will trigger screen lock and start a fourth pre-defined cooldown period.

6. The child anti-addiction control method based on deep learning and behavior recognition according to claim 1, characterized in that, The step of executing graded intervention reminders and control processing according to a preset differential gradient adjustment algorithm when a child's viewing behavior is detected to violate preset rules also includes: All intervention records and behavioral data are synchronized to the parent's app via the MQTT protocol, allowing for remote modification of thresholds and analysis of historical data, as well as personalized parameter settings by receiving parent's operation commands. The YOLOv5 model is trained to improve its recognition accuracy using a federated learning framework, and a light intensity-range error compensation model is established to dynamically correct the range measurement value.

7. The child anti-addiction control method based on deep learning and behavior recognition according to claim 1, characterized in that, Based on the determined child's identity and viewing distance, the viewing distance is analyzed in real time. If the viewing distance is detected to be continuously lower than a preset safety threshold for a predetermined period of time, a first-level warning is issued. The steps to continuously monitor the viewing behavior of the current viewers who are children also include: A dual-threaded monitoring system is constructed to perform real-time analysis of children's dynamic behavior. Thread 1 acquires data streams from the built-in camera in real time and calculates the viewing distance between the user's eyes and the screen, writing the data into a circular buffer. Thread 2 reads viewing distance data from the buffer. When the viewing distance value is less than the preset safety threshold in consecutive predetermined frames, it controls the start of the cumulative timer and sends the distance data of the consecutive predetermined frames and the corresponding extracted coordinate data of a predetermined number of three-dimensional feature points to the preset attitude stability evaluation module. The preset posture stability evaluation module analyzes the distance data of the consecutive predetermined frames and the coordinate data of the corresponding extracted three-dimensional feature points to determine the relative position change of the key facial feature points of the child corresponding to the consecutive predetermined frames; and calculates the average displacement and maximum displacement of the key feature points in three-dimensional space. The stability of the child's head posture corresponding to the consecutive predetermined frames is calculated by measuring the angle changes of the child's head in the pitch, yaw, and roll directions to determine whether there are continuous, directional posture changes rather than random, small-amplitude swaying. If it is detected that within N consecutive frames, the average displacement and maximum displacement of the key feature points are both lower than or equal to the preset slight shaking threshold, and the angular changes of the head posture in the three directions are all less than or equal to the preset posture stability threshold, then it is determined that the currently viewing child user is slightly shaking or making slight posture adjustments, rather than actively moving closer; then data filtering is performed and a first-level warning is not triggered. If it is detected that the average displacement and maximum displacement of the key feature points are both greater than the preset slight shaking threshold within N consecutive frames, and the angle change of the head posture in three directions is greater than the preset posture stability threshold, it is determined that the currently viewing child user has actively approached or changed posture beyond the preset range, and then the sliding window warning mechanism is activated for judgment. When entering the sliding window warning mechanism, a time-series-based sliding window warning mechanism is set up. The viewing distance data is calculated by exponential decay weighted average with the first predetermined time as a window unit. When the weighted average of consecutive predetermined window units is continuously lower than the safety threshold, a level one warning is triggered.

8. A child anti-addiction control device based on deep learning and behavior recognition, characterized in that, The device includes: The viewing object identification module is used to analyze the viewing object in front of the terminal in real time through a preset improved network model, identify whether the current viewing object is a child, and exclude occasional viewing objects. The viewing distance calculation module is used to calculate the viewing distance between the current viewing object (identified as a child) and the screen by constructing a 3D model of the child's face and using a dynamic calibration process when the current viewing object is identified as a child. The early warning judgment module is used to perform real-time judgment and analysis of the viewing distance based on the determined child's identity and viewing distance. If the viewing distance is detected to be continuously lower than a preset safety threshold for a predetermined period of time, a first-level early warning is issued; and the viewing behavior of the current viewing object identified as the child is continuously monitored. The graded intervention reminder and processing control module is used to execute graded intervention reminders and control processing according to the preset differential gradient adjustment algorithm when the child's viewing behavior is detected to violate the preset rules. The data push module is used to synchronize all intervention records and behavioral data to the parent's app via the MQTT protocol, receive parent's operation commands to remotely modify thresholds and analyze historical data, and set personalized parameters.

9. A smart terminal, characterized in that, It includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, wherein the one or more programs include steps for performing the method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it enables the electronic device to perform the steps of the method as described in any one of claims 1-7.