Human body key point detection and SVM (Support Vector Machine) personnel falling detection method based on machine vision
By using machine vision-based human key point detection and SVM, the shortcomings of existing fall detection technologies in terms of accuracy, real-time performance, and ease of use are solved. Real-time fall detection is achieved without the need for wearing devices or human supervision, making it suitable for complex scenarios, reducing false alarm rates, and improving detection accuracy and real-time performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-03-13
AI Technical Summary
Existing fall detection technologies have significant shortcomings in terms of accuracy, real-time performance, cost, and ease of use. They are unable to meet the demands for high accuracy, low latency, and low cost in complex scenarios such as public places and elderly living environments. In particular, when dealing with complex scenarios or multi-angle shooting, it is difficult to balance accuracy and efficiency.
We employ a machine vision-based approach to human keypoint detection and support vector machine (SVM). We capture video streams using a high-definition network camera, use the YOLOPose algorithm to detect human bodies and extract keypoints, and train an SVM classifier with an RBF kernel for real-time pose classification. We also set a time window for verification to reduce the false alarm rate.
It achieves real-time fall detection without the need for wearing equipment or human supervision, with a low false alarm rate, wide applicability, and adaptability to complex scenarios, reducing the false alarm rate and improving the accuracy and real-time performance of detection.
Smart Images

Figure CN121661554A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent security and computer vision technology, specifically to a method for detecting human key points and SVM-based human fall detection. Background Technology
[0002] Falls are a common but potentially serious safety incident in public places, elderly living environments, medical rehabilitation facilities, and high-risk work areas. This is especially true for the elderly, patients, or those with mobility issues; if they do not receive timely assistance after a fall, it can lead to fractures, brain injuries, or even death. Current mainstream fall detection technologies include wearable sensor devices, human video surveillance, and end-to-end image classification methods based on deep learning. However, these technologies generally have significant limitations and are insufficient to meet practical needs.
[0003] Wearable sensor devices require active user wearing, resulting in a poor user experience and susceptibility to forgetting, losing, or running out of power. Their low cost also hinders large-scale adoption, making them unsuitable for children, the elderly with dementia, and other groups unable to cooperate. Manual video surveillance is highly dependent on human resources; security personnel are prone to fatigue and missing details after prolonged viewing, and its real-time performance is poor, with limited monitoring range, often resulting in delayed detection and an inability to provide 24 / 7 coverage. Deep learning-based image classification models require extensive labeled data for training, leading to high costs, a black-box nature, and a lack of interpretability, hindering debugging and optimization. Furthermore, this method is prone to misclassifying normal actions like "squatting to pick something up" or "bending over to tidy up" as falls, resulting in a high false alarm rate. Additionally, the high computational resource requirements of deep learning models make real-time performance difficult to guarantee, especially when handling complex scenes or multi-angle shooting, where accuracy and efficiency are difficult to balance, further limiting their practical application feasibility.
[0004] In summary, existing technologies have significant shortcomings in terms of accuracy, real-time performance, cost, and ease of use, making it difficult to achieve a balance between high accuracy, low latency, and low cost, and thus failing to meet the fall detection needs in complex scenarios. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a method for detecting human key points and detecting fallen persons based on machine vision and SVM, comprising the following steps:
[0006] S1: The camera is installed and captures video streams from the monitored area, and transmits the video frames to the back-end processing unit; Select high-definition network cameras and install them at indoor and outdoor target locations to ensure coverage of the activity area. After capturing video streams, transmit them to the back-end processing unit at a preset frame rate. At the same time, the back-end processing unit has built-in local storage. When the network is temporarily interrupted, the caching function is automatically triggered to temporarily store the video stream locally. When the network is restored, it will be automatically retransmitted to prevent data loss. Preferably, for indoor scenes such as nursing home corridors and hospital wards, cameras must meet a minimum illumination of ≥0.01Lux to adapt to low-light environments at night, and support wide dynamic range (WDR) technology to avoid local overexposure or underexposure of the image due to backlighting from windows (for example, if there is no wide dynamic range function in the area near the window of the ward, the outline of people is easily blurred); the interface type should preferably be RJ45 network port and support PoE power supply, which can reduce the cost of laying separate power cables and ensure stable power supply to the device, especially suitable for scenarios that require flexible deployment such as nursing homes and factory workshops.
[0007] Ideally, for scenarios with slower-paced activity, such as nursing homes and hospital wards, a video frame rate of 15-20fps is sufficient. At this frame rate, the interval between each frame is approximately 50-66ms, which ensures real-time performance while reducing the processing load on the backend. For scenarios with faster-moving people, such as factory workshops and school corridors, the video frame rate needs to be increased to 25-30fps to ensure that the complete process of rapid movement or sudden changes in posture (such as a factory worker turning around quickly) is captured.
[0008] S2: Human body detection and key point extraction, resulting in a set of key points. ; The YOLOPose algorithm is used to preprocess the video frames transmitted by S1: the input size of the video frame is adjusted to 640×640 pixels, the original frame is scaled according to the aspect ratio of 16:9, and then black pixels are filled at the top and bottom of the height direction. The preprocessed image is input into the CSPDarknet backbone network in the YOLOPose algorithm to capture the features of shallow and deep convolutional layers. The features of shallow and deep convolutional layers are then fused across layers using PANet to obtain multi-scale feature maps. The human detection branch of the YOLOPose model head generates anchor boxes at multiple scales. For each grid cell on the feature map, the YOLOPose model is used to obtain its human confidence score, and then anchor boxes with a human confidence score ≥ are selected. The candidate boxes are then processed using a non-maximum suppression algorithm to remove overlapping and redundant boxes, ultimately yielding the human target box. ; Ideally, the human detection branch of the YOLOPose model's head generates anchor boxes at three different scales: 116×90, 156×198, and 373×326, which are suitable for the common height and distance dimensions of human bodies in indoor scenes.
[0009] The This is the confidence threshold, and 0.4 ≤ ≤0.6; Preferably, the confidence threshold is preset to 0.5.
[0010] Then from the human body target bounding box In the process, the pose regression branch of YOLOPose is simultaneously launched to extract specified key points. The pose regression branch is designed for... Nine key point heatmaps with the same size as the multi-scale feature map described in S21 are output from the region. For each pixel in the heatmap, its value is compared with the value of its eight neighboring pixels. If the pixel value is the largest in the neighborhood, it is determined to be a peak pixel, and its coordinates are the position of the key point in the heatmap. Next, based on the scaling ratio between the preprocessed frame and the original frame, as well as the black border fill offset, the pixel coordinates of the key points in the original frame are obtained by reverse mapping. In this way, the original frame coordinates (x, y) of all human body keypoints and the visibility confidence v of the keypoints are extracted simultaneously to form a keypoint set. ; The key points include the top of the head (H), left shoulder (LS), right shoulder (RS), left hip (LH), right hip (RH), left knee (LK), right knee (RK), left ankle (LA), and right ankle (RA).
[0011] Furthermore, the key points should not be limited to the above nine points. This invention is only illustrating a more general situation using this as an example. In practical applications, the selection range of key points can be flexibly expanded or adjusted according to other special scenarios and needs to adapt to a wider range of human posture detection and analysis scenarios, ensuring the universality of the technical solution.
[0012] S3: Yes All key points in the data are normalized to obtain a normalized set of key points. ; Using the center point of the human hip as the relative coordinate origin, specifically, if the coordinates of the left hip are (xLH, yLH) and the coordinates of the right hip are (xRH, yRH), then the coordinates of the hip center are calculated as follows: The coordinates of the center point of the hip are obtained. , ); Perform a translation transformation on the key points to eliminate positional differences and obtain relative coordinates. The calculation formula is as follows: , ;in The x and y coordinates of each key point, '、 ' represents the relative coordinates after translation; Then, based on the shoulder-hip distance... To eliminate height differences, the units are scaled to obtain normalized key points; specifically, ,in( , ( ) represents the coordinates of the average point S of the left and right shoulders of the human body. The left shoulder is extracted first during the calculation. , with right shoulder , The original coordinates, through = , = Obtain; the coordinates of each key point after translation ( ', ') Perform scale scaling, the formula is ,in , For the final normalized coordinates.
[0013] S4: Based on the normalized set of key points Construct the feature vector F; Normalized keypoint set based on S3 All coordinates in the vector are included. Each keypoint contains two dimensions: a normalized x-coordinate x'' and a normalized y-coordinate y''. The normalized x and y coordinates of each keypoint are concatenated in a fixed order according to anatomical logic to form a feature vector F. During the splicing process, each coordinate value needs to be precision processed to retain 4 significant digits after the decimal point.
[0014] S5: Train the SVM classifier using the feature vector F to obtain the trained SVM classifier; Construct an offline training dataset D with labels "normal" and "fallen down". Divide D into a training set D_train and a validation set D_val. When dividing, the ratio of "normal" and "fallen down" samples should be consistent with the original dataset D. The model is trained using an RBF kernel to train an SVM. The core principle is to learn the classifier by solving the following constrained optimization problem: The original objective function is... ,in , C is the penalty parameter and C And satisfy the following constraints: ( ), The high-dimensional mapping function corresponding to the RBF kernel satisfies ,in, For kernel parameters and ; The mathematical expression for the RBF kernel function is: ; Parameter optimization employs a combination of 5-fold cross-validation and grid search, finding the optimal C and values by traversing a pre-defined parameter grid. The optimal combination of parameter values is denoted as ( , ); Then use parameter combinations ( , Train the model on the complete D_train and solve for the Lagrange multipliers. (Only supports vector correspondence) >0) and bias terms ; After training, the model's generalization ability is evaluated using D_val: The model outputs a classification result, which is compared with the true label. The recall of fallen samples and the accuracy of normal samples are calculated. If the recall is ≥98% and the accuracy is ≥95%, the model is effective; otherwise, return to S523 and adjust the grid range, i.e., expand C and... Within a certain range, capture better parameters.
[0015] Finally, the core parameters of the qualified model, namely the support vectors, are recorded and stored. Lagrange multipliers Bias terms nuclear parameters Penalty parameters and standardized parameters This yields the final trained SVM classifier.
[0016] S6: Real-time pose classification and fall detection based on a trained SVM classifier; Loading the model and standardized parameters stored in S5, the integrated detection system, consisting of a front-end camera, edge computing unit, and back-end processing unit, first receives the feature vector F of the current frame output by S4 and denotes it as... Normalization of the corresponding 9 key points Then, load the SVM classifier trained by S5, and... Input the model for inference, where t is the current frame timestamp; obtain the classification result. If the classification result is "fallen down", then... =1, then t, , The original image path of the current frame is packaged into an event message and the process proceeds to the next step, S7, for judgment; if the classification result is "normal", then... If the value is 0, skip the frame and continue processing the next frame. If any abnormal situation occurs (such as (Due to issues such as missing dimensions or inference timeouts), the detection system automatically uses the classification results from the previous frame. And mark "abnormal frame: t, using the result of frame t−1" in the log to avoid detection interruption due to a single frame abnormality.
[0017] S7: Time continuity verification and alarm; First, set the time window. Let the video frame rate of S1 be fps, then the time window Corresponding frame rate window ; Next, set the fall frame threshold K= kth, where kth is the coverage rate and kth∈[0.6,1]; For frames that S6 determines as "knocked down", count the number of knocked-down frames within the window and record the window's start timestamp. Initialize N=1 and create a temporary buffer list L to store event messages for all frames in the window, and add the current S6 event message to L; After the window is started, the edge computing unit receives S6 event messages of subsequent frames in timestamp order until it collects... Frames or time reached 1000; For each event message within the window, check it one by one: if the received current message contains... If = 1, then N + 1, and add the current message to L; if =0, only add the message to L but do not update N; After the window ends, if N≥K, the current video frame image is determined to be a real fall and an alarm is triggered to remind the user. The alarm methods include, but are not limited to, the alarm sounding, the APP or mini-program message push, and the speaker voice reminder.
[0018] This invention proposes a method for detecting human key points and SVM-based human fall detection based on machine vision, which has the following beneficial effects: (1) No need to wear a device, wide applicability, solving the problems of wearable devices needing to be actively worn, easy to lose, and unsuitable for elderly people with dementia. Through contactless key point extraction, detection is not required without any wearable device; (2) No need for manual supervision, strong real-time performance. Through real-time classification and automatic time window verification and alarm, the reliance on human manpower is greatly reduced, and the problems of human fatigue and lag are improved; (3) Low false alarm rate and accurate classification. Through normalization to eliminate feature differences, RBF kernel SVM to optimize classification boundaries and time window secondary verification, the false alarm rate is significantly reduced, and the accuracy of fall detection is improved; (4) Through standardized features to improve generalization and the characteristics of SVM to adapt to small sample high-dimensional feature classification, accurate model training can be completed without massive labeled data. Attached Figure Description
[0019] Figure 1This is a schematic diagram illustrating the overall workflow of the human key point detection and SVM-based method for detecting fallen people based on machine vision in this invention. Figure 2 The flowchart of step S7 is a schematic diagram of the invention of a human key point detection and SVM-based method for detecting fallen people. Detailed Implementation
[0020] To provide a further understanding of the purpose, structure, features, and functions of the present invention, detailed descriptions are provided below with reference to specific embodiments.
[0021] like Figure 1-2 As shown, the human keypoint detection method based on machine vision and SVM for detecting fallen people includes the following steps:
[0022] S1: The camera is installed and captures video streams from the monitored area, and transmits the video frames to the back-end processing unit; Choose a standard high-definition network camera and install it in locations including, but not limited to, indoor and outdoor ceilings or walls. Ensure that the camera covers the target activity area and that the captured images meet the clarity and coverage requirements for subsequent human key point extraction. When selecting a camera, prioritize standard high-definition network cameras with at least 1080P resolution, and match key parameters to the application scenario. Preferably, for indoor scenes such as nursing home corridors and hospital wards, cameras must meet a minimum illumination of ≥0.01Lux to adapt to low-light environments at night, and support wide dynamic range (WDR) technology to avoid local overexposure or underexposure of the image due to backlighting from windows (for example, if there is no wide dynamic range function in the area near the window of the ward, the outline of people is easily blurred); the interface type should preferably be RJ45 network port and support PoE power supply, which can reduce the cost of laying separate power cables and ensure stable power supply to the device, especially suitable for scenarios that require flexible deployment such as nursing homes and factory workshops.
[0023] The installation process requires determining specific parameters based on the spatial structure of the target area. Specifically, the installation height should be controlled between 2.5 and 3 meters. This height prevents the camera from being accidentally blocked by people or mobile devices. At the same time, a single camera can cover a horizontal range of 4-5 meters, meeting the coverage needs of most indoor scenes. The installation angle should be adjusted to a horizontal downward angle of 15-20°. This angle can balance the proportion of the human body in the image. It will not cause compression and deformation of the upper and lower body due to an excessive downward angle (for example, when the downward angle exceeds 30°, standing people are easily photographed as "short and fat", affecting the accuracy of subsequent key point coordinates), nor will it miss ground areas due to an insufficient downward angle (such as bedside, under chairs and other key locations where falls are likely to occur).
[0024] After installation, coverage calibration needs to be performed through the camera management backend. View the footage in real time and mark the target areas (such as bedside areas, entrances and exits, and rest seating areas in nursing home corridors) to confirm that all key areas are in the frame. If there are blind spots, adjust the installation position or increase the number of cameras to ensure there are no blind spots.
[0025] The key is to achieve stable acquisition and efficient transmission of video streams, ensuring that data is delivered to the backend processing unit in real time and completely. Frame rate settings need to be dynamically adjusted based on the intensity of human movement in the scene. Ideally, for scenarios with slower-paced activity, such as nursing homes and hospital wards, a video frame rate of 15-20fps is sufficient. At this frame rate, the interval between each frame is approximately 50-66ms, which ensures real-time performance while reducing the processing load on the backend. For scenarios with faster-moving people, such as factory workshops and school corridors, the video frame rate needs to be increased to 25-30fps to ensure that the complete process of rapid movement or sudden changes in posture (such as a factory worker turning around quickly) is captured.
[0026] The video stream transmission uses the RTSP real-time streaming protocol. Unnecessary high compression levels (such as H.265's ultra-high compression mode) are disabled through the camera's backend configuration, retaining only basic compression to balance bandwidth and latency. The backend processing unit (such as an industrial control computer, edge computing box, or server) must have matching access capabilities. For example, choosing an NVIDIA Jetson Nano series edge box, with its quad-core Cortex-A57 CPU and 4GB of memory, can support simultaneous access of four 1080P video streams, avoiding stuttering in multi-camera scenarios.
[0027] In addition, the back-end processing unit has built-in local storage of 8GB or more. When the network is temporarily interrupted, the caching function is automatically triggered to temporarily store the video stream locally. It will be automatically retransmitted after the network is restored to prevent data loss and establish a data fault tolerance mechanism.
[0028] Taking the video capture deployment on the west side of the third floor corridor of a nursing home as an example, the specific workflow is as follows: The corridor is 12 meters long, with 4 beds for elderly people on both sides. The nighttime lighting intensity is about 0.03 Lux, and it is necessary to cover the bedside areas and the middle corridor. First, a Hikvision DS-IPC-T12H-I3 1080P camera was selected, whose minimum illumination of 0.01 Lux, PoE power supply, and wide dynamic range function can adapt to the scene requirements. During installation, a bracket was fixed in the middle of the corridor ceiling (6 meters away from each end), the camera height was adjusted to 2.8 meters, and after calibration with a level, the downward angle was set to 18°. The camera was connected to a PoE switch via an RJ45 network cable. After powering on, the camera was logged into the management backend to check the screen and confirm that the bedside areas of the 4 beds and the entrances and exits at both ends of the corridor were within the coverage area with no blind spots.
[0029] Subsequent configuration parameters: Due to the slow pace of elderly individuals' activities, the frame rate was set to 20fps, using the RTSP protocol for transmission. Latency was optimized to 150ms using network testing tools. The backend processing unit was an NVIDIA Jetson Nano edge box, with local caching enabled after the camera video stream was connected. In actual operation, the camera captures one frame every 20fps and transmits it to the edge box in real-time via RTSP. The edge box then forwards the image to subsequent steps for human detection. Even if the network experiences a brief one-minute interruption, the edge box can cache the video stream for that period and retransmit it after the network is restored, ensuring uninterrupted detection.
[0030] The S1 achieves non-contact data acquisition by selecting high-definition network cameras, eliminating the need for users to wear any equipment; precise installation height and tilt angle settings ensure no blind spots in monitoring; RTSP protocol transmission and local caching guarantee real-time and stable video streaming without data loss during network interruptions, avoiding detection delays due to data loss and providing a high-quality data foundation for subsequent human detection and model training.
[0031] S2: Human body detection and key point extraction, resulting in a set of key points. This step accurately locates the human body region in the original video frames transmitted by S1 and extracts quantifiable human pose features, specifically including the following sub-steps:
[0032] S21. The YOLOPose algorithm is used to process each frame of the transmitted image and detect all human-shaped targets in the image; In practice, each single video frame transmitted via S12 undergoes targeted preprocessing. To best match the YOLOPose model, the input size of the video frame is adjusted to 640×640 pixels. The original frame needs to be scaled to 640×360 pixels with an aspect ratio of 16:9. Then, 140-pixel black borders are added at the top and bottom of the height to prevent key point coordinate shifts caused by human body stretching and deformation. Simultaneously, the formula... By normalizing the intra-frame pixel values from the integer range of 0-255 to the floating-point range of 0-1, the computational load of the model is reduced by decreasing the numerical magnitude, significantly reducing the processing time per frame and ensuring real-time performance. This refers to the original brightness value of each pixel in the RGB color channel of the input image, which is an integer between 0 and 255.
[0033] The preprocessed image is input into the CSPDarknet backbone network of the YOLOPose algorithm, which consists of multiple convolutional layers. Shallow convolutional layers capture details such as clothing texture and edge contours, extracting local features; deep convolutional layers form high-level features such as the overall human body contour and pose trends, aggregating global features. Subsequently, the PANet (Path Aggregation Network) neck layer performs cross-layer fusion of the features from the shallow and deep convolutional layers. After concatenation along the channel dimension, a multi-scale feature map is obtained, containing high-level semantic information such as human body edges, textures, and contours. This solves the problem of blurred human body features at long distances and enhances the adaptability of human body detection at different distances and in different poses.
[0034] The human detection branch of the YOLOPose model's head generates anchor boxes at multiple scales, which are then analyzed using the intersection-union formula. Calculate the intersection-union ratio (IoU) between the anchor frame and the actual human body contour, and the human body confidence score; The Area of Overlap refers to the area of the overlapping region between the anchor box and the actual human body contour of the two candidate bounding boxes. Area of Union refers to the total area after merging two candidate bounding boxes. The calculation formula is: Area of box A + Area of box B - Area of the overlapping area between A and B. Intersection over Union (IOU) is a metric that measures the degree of overlap between two bounding boxes, with a value ranging from 0 to 1. An IOU of 0 indicates that the two boxes do not overlap at all, while an IOU of 1 indicates that the two boxes completely overlap. The IOU value is used to determine the similarity between boxes. Ideally, the human detection branch of the YOLOPose model's head generates anchor boxes at three different scales: 116×90, 156×198, and 373×326, which are suitable for the common height and distance dimensions of human bodies in indoor scenes.
[0035] Human body confidence is a probability value ranging from 0 to 1, representing the model's degree of certainty that a candidate bounding box actually contains a human body. The human body confidence is obtained by the YOLOPose model through multi-task learning and synchronous output, as follows: The CSPDarknet backbone network outputs feature maps at three scales, corresponding to the detection of small, medium, and large targets, respectively. Then, for each grid cell in the feature map, anchor boxes at three scales are generated. Each anchor box is used to predict a bounding box and its corresponding human confidence score and class probability. Each anchor box predicts the bounding box coordinates (x, y, w, h), where (x, y) are the coordinates of the bounding box center, and (w, h) are the width and height of the bounding box. For each anchor box, the model predicts a human confidence score C, representing the probability that the anchor box contains a human body.
[0036] The human confidence score C is output through a sigmoid function, ensuring its value ranges between 0 and 1. The formula is: ; in It is the sigmoid function. This indicates a 1×1 convolution operation on the feature map.
[0037] Then, candidate boxes with a human confidence score ≥ 0.5 are selected, and non-maximum suppression (NMS) algorithm (IOU threshold set to 0.45) is used to remove overlapping and redundant boxes, finally obtaining the human target box. The coordinate format is (x1, y1, x2, y2), where (x1, y1) is the top left corner of the bounding box and (x2, y2) is the bottom right corner of the bounding box. This achieves accurate segmentation of the human body area and the background, ensuring that subsequent key point extraction focuses only on the effective human body area and avoids background interference.
[0038] Furthermore, in addition to using the YOLOPose algorithm, other similar human pose estimation models, such as OpenPose and HRNet, can also be used.
[0039] S22. Extract the coordinates of multiple human body key points for each human figure target; The human target bounding box defined in S21 Based on this, the pose regression branch of YOLOPose is started simultaneously to extract specified key points, including the top of the head (H), left shoulder (LS), right shoulder (RS), left hip (LH), right hip (RH), left knee (LK), right knee (RK), left ankle (LA), and right ankle (RA).
[0040] Furthermore, the key points should not be limited to the above nine points. This invention is only illustrating a more general situation using this as an example. In practical applications, the selection range of key points can be flexibly expanded or adjusted according to other special scenarios and needs to adapt to a wider range of human posture detection and analysis scenarios, ensuring the universality of the technical solution.
[0041] The attitude regression branch is for Nine keypoint heatmaps with the same dimensions as the multi-scale feature map described in S21 are output from the region. The pixel value of each heatmap represents the probability that the corresponding location is the keypoint. The peak pixel of each heatmap is located using a 3×3 neighborhood maximum value filtering algorithm (the peak position is the coordinate of the keypoint in the 640×640 preprocessing frame). Specifically, for each pixel in the heatmap, its value is compared with the values of its eight neighboring pixels. If the pixel value is the largest in the neighborhood, it is determined to be the peak pixel, and its coordinates are the position of the keypoint in the heatmap (which needs to be mapped to the original image later), and its value is the peak pixel value. This method eliminates secondary peaks caused by noise in the heatmap, ensuring that each key point corresponds to only one most probable location, thus improving the accuracy of coordinate positioning.
[0042] Next, based on the scaling ratio between the preprocessed frame and the original frame (e.g., 1080P corresponds to 1920*1080, so the scaling ratio is 1920 / 640=3 times) and the black border fill offset (140 pixels), the pixel coordinates of the key points in the original frame are obtained by reverse mapping. Specifically, if the coordinates of a key point in the preprocessed frame are (x', y'), then the formula for calculating the coordinates (x, y) in the original frame is x = x'×3, y = (y' 140)×3 (if y'<140 or y'>500, it needs to be corrected to y=0 or y=1080 to avoid exceeding the range of the original frame).
[0043] Simultaneously, the peak pixel values of the heatmap are converted into keypoint visibility confidence scores v (v∈[0,1]). If v≥0.3, the keypoint is considered valid (not obscured, such as the shoulder or hip of a standing person); if v<0.3, it is marked as invalid (such as the knee obscured by the bed). Finally, the keypoints are organized into a set according to a fixed order of "top of head → left shoulder → right shoulder → left hip → right hip → left knee → right knee → left ankle → right ankle". =
[0044] },in These are the original pixel coordinates. This represents the visibility confidence level.
[0045] The keypoint visibility confidence score (v) measures whether the detected keypoints are truly valid (not occluded). Its core is to normalize the peak pixel values of the heatmap to the range [0,1]. The specific process is as follows: First, after extracting the human target bounding box, the model generates a heatmap for each specified keypoint (e.g., top of the head, left shoulder, etc.). The size of the heatmap corresponds to the features of its scale. Figure 1In a 40×40 grid, each pixel's value represents the raw probability (unnormalized, potentially any non-negative value) that "this location corresponds to a key point." For example, in the heatmap of the top of the head, the value of pixel (20, 10) is 5.2, meaning the raw probability that this location is the top of the head is 5.2, significantly higher than surrounding pixels (where surrounding pixels are mostly between 0.3 and 1.2). Subsequently, a 3×3 neighborhood maximum value filtering algorithm is used to locate the peak pixels in the heatmap. As mentioned above, the top of the head =5.2. To make To convert the visibility confidence score v to the range [0,1], normalization is required: During model training, the original output of the heatmap is constrained by the sigmoid activation function to ensure peak pixel values. After activation, it falls within the [0,1] interval, and the formula is: .For example, When =5.2, This indicates that the key point (top of the head) is almost unobstructed, and the height is effective; if further obstruction leads to... = -1.0, then The value is approximately 0.269, which is less than the threshold of 0.3, and is therefore deemed invalid. In practical applications, the threshold of 0.3 is determined statistically from a large amount of labeled data (containing keypoints with different degrees of occlusion).
[0046] S2 uses the YOLOPose model algorithm (integrated single-stage detection and pose estimation) to accurately extract core key points of the human body (head, shoulders, hips, etc.). Compared with the end-to-end model with whole image input, key points can accurately depict the topological structure of human posture and effectively distinguish similar actions such as "bending over to tie shoelaces", "squatting down to pick up an object" and "falling down", reducing the false alarm rate from the source.
[0047] S3: Yes All key points in the data are normalized to obtain a normalized set of key points. Specifically, it includes the following sub-steps:
[0048] S31. Taking the center points of the left and right hips as the relative coordinate origin, if the coordinates of the left hip are (xLH, yLH) and the coordinates of the right hip are (xRH, yRH), then the coordinates of the hip center are calculated as follows: ; Because the positions of people in surveillance footage are random and the heights of different individuals vary significantly, the original coordinates of key points on different people are not directly comparable. If used directly for subsequent processing, the classifier will misclassify "positional differences" as "posture differences." For example, two people may both be standing, but their feature vectors will be completely different due to their different positions, resulting in misclassification. Therefore, it is necessary to normalize the key points of the human body. The center point of the hip is used as the relative coordinate origin. This reference is chosen based on the anatomical characteristics that the hip (pelvic region) is the core support part of the human torso. In various postures such as standing, walking, squatting, and falling, its position relative to the torso remains stable and is not affected by limb movements (such as raising hands, bending knees, and turning) (for example, when a person bends over, the position of the shoulder changes, but the position of the hip center relative to the torso remains unchanged). This can ensure the consistency of posture features after normalization to the greatest extent. In contrast, parts such as the head and shoulders are prone to shift due to posture changes and are not suitable as fixed references.
[0049] This step is based on the set of 9 specified key points output by S2. You need to start from The original pixel coordinates of the left hip (LH) and right hip (RH) are accurately extracted. Let the coordinates of the left hip be (xLH, yLH) and the coordinates of the right hip be (xRH, yRH). These two coordinates are directly derived from the effective key points extracted by the YOLOPose model in S2.
[0050] The coordinates of the hip center point C were then calculated using the mean value formula. , The formula is: , This calculation process is achieved by summing and then equally dividing the pixel coordinates. For example, when the left hip is (800, 600) and the right hip is (860, 600), the center of the hip... The coordinates are (800+860) / 2=830. The coordinates are (600+600) / 2=600, and the final result is ( , This will serve as the reference origin for all subsequent key point coordinate offsets, ensuring that the posture characteristics of different human bodies unfold around their own torso center.
[0051] By unifying the origin of all key points of the human body to the center of the hip, the posture features of the human body in different positions are made relatively comparable. That is, no matter which area of the human body is in the image, the relative relationship of core posture indicators such as the height of the head relative to the hip and the position of the knee relative to the hip remains consistent, providing a clear offset benchmark and ensuring that subsequent processing revolves around the posture itself rather than the position.
[0052] S32. Offset all keypoint coordinates relative to the hip center point to obtain relative coordinates. The calculation formula is as follows: , ; In the specific implementation, the original coordinates of all 9 specified key points in S2 are used. (i represents any one of the above 9 key points) and the hip center point calculated by S31 ( , For each key point The coordinates are offset calculated separately, using the following formula: ' = , ' = ,in '、 ' represents the relative coordinates after translation. The core logic of this step is to unify the origin of all key points' coordinates to the hip center. For example, if the original coordinates of the top of the head are (830, 300), then the coordinates of the hip center (830, 600) will be translated... The coordinates are 830-830=0. The coordinates are 300-600=-300, which is (0, -300); the original coordinates of the left knee (780, 750) are translated to (780-830, 750-600)=(-50, 150).
[0053] Through translation transformation, the relative positions of key points remain consistent regardless of whether the human body is on the left or right side of the screen. This eliminates the interference of coordinate differences and positional shifts caused by different positions of the human body in the monitoring screen on subsequent scale uniformity. Furthermore, the coordinates after translation retain the relative relationship of the original posture (e.g., the head is always above the hips and the ankles are below the hips).
[0054] The translation transformation only moves the origin from the top left corner of the image (the original pixel coordinate origin) to the center of the hip (the reference point determined by S31). This relative coordinate transformation is achieved simply by subtracting the x and y coordinates of the hip center from the x and y coordinates of each keypoint. This process involves minimal computation and has a very short processing time, allowing for efficient operation on edge devices. After the translation transformation, the coordinates only reflect the positional relationship of the keypoints relative to the human torso, not relative to the monitoring screen, thus eliminating the interference of positional fluctuations on the features.
[0055] S33. The distance from the average point S of the left and right shoulders to the center point H of the hip. As a unit length, the coordinates of the translated key points are normalized, and the calculation formula is as follows: , ; S33 eliminates the scale differences of key points for people of different heights through scaling. First, based on the translated coordinates obtained in S32 ( ', The original coordinates of the left and right shoulders output by S2 are used to calculate the center point of the hip using S31. , Calculate the shoulder-hip distance per unit length. Shoulder-hip distance It is a core length indicator of the human torso, strongly positively correlated with height, and effectively represents the overall dimensions of the human body. The left shoulder is extracted first during calculation. , with right shoulder , The original coordinates are used to obtain the coordinates of the average point S of the left and right shoulders using the mean formula. , The formula is: = , = Then, the distance from the average point S of the left and right shoulders to the center point H of the hip is calculated using the Euclidean distance formula. , The straight-line distance, i.e. To obtain the actual spatial distance Then, the coordinates of each key point after the translation of S32 are... ', ') Perform scale scaling, the formula is ,in , For the final normalized coordinates.
[0056] After scaling, the coordinates of all key points are in shoulder-hip distance. Using units as the unit, we finally obtain the normalized set of key points. For example, after the top of the head is translated, the coordinates (0, -300) become (0 / 150, -300 / 150) = (0, -2) after scaling; after the left knee is translated, the coordinates (-50, 150) become (-50 / 150, 150 / 150) = (-0.33, 1) after scaling. At this point, regardless of whether the height of the person is 1.5 meters or 1.8 meters, the relative distance from the head to the hip is uniformly 2 shoulder-hip units, eliminating scale differences.
[0057] Shoulder-hip distance It is a core length indicator of the human torso, strongly positively correlated with height, and relatively stable in different postures (except bending over or falling), effectively representing the overall dimensions of the human body; by converting all key point coordinates into shoulder-hip distance. The multiples of the number of points ensure that the scale of key points is consistent for people of different heights and shooting distances. Moreover, the process only involves division operations, which is highly efficient and does not affect real-time performance.
[0058] Because individuals vary significantly in height, and cameras are installed at different positions and angles, directly using the original pixel coordinates can lead to inconsistent feature distributions, affecting classification accuracy. This step eliminates the inconsistency in feature distribution caused by individual height differences and camera shooting angles in the original keypoint coordinates of S2. Step S3, through three consecutive steps—S31 determining the reference baseline, S32 translation transformation, and S33 scaling—processes the original keypoint coordinates to obtain normalized keypoint coordinates that are independent of height and shooting distance. This provides reliable input for subsequent construction of feature vectors with unified dimensions and classifier training, making the features more universal and comparable, and greatly improving the model's generalization ability.
[0059] S4: Based on the normalized set of key points Construct the feature vector F; The normalized set of key points By concatenating them in a fixed order, a high-dimensional feature vector F is formed. The feature vector F can comprehensively reflect the current human posture information.
[0060] The core task of this step is to transform the discrete normalized keypoint coordinates output by S3 into high-dimensional feature vectors that can be directly input into machine learning models. By concatenating them in a fixed order, the integrity and consistency of the features are ensured, providing structured input for subsequent pose classification.
[0061] In practice, the system first uses all coordinates from the normalized keypoint set output by S3. Each keypoint contains two dimensions: a normalized x-coordinate (x'') and a normalized y-coordinate (y''). Therefore, the total dimension of the feature vector is 9 × 2 = 18. The pre-defined splicing order follows the anatomical logic from head to torso to limbs, specifically: top of head (H), left shoulder (LS), right shoulder (RS), left hip (LH), right hip (RH), left knee (LK), right knee (RK), left ankle (LA), and right ankle (RA). This order is fixed by a pre-defined index list in the code to avoid mismatches in the meaning of feature dimensions between different samples due to disordered order.
[0062] Then, the x'' and y'' of each keypoint are extracted sequentially in this fixed order, and concatenated according to the rule of x'' first and y'' last. On the one hand, this ensures that the same pose features of different samples are in the same dimension in the vector (e.g., the x-coordinate of the top of the head of all samples is in the first dimension, and the y-coordinate is in the second dimension), avoiding misjudgment by the SVM classifier due to disordered order; on the other hand, it maintains the topological structure of the human pose, so that the vector can intuitively reflect the relative positional relationship of various parts of the human body (e.g., the vertical position of the head and shoulders, and the front-back relationship of the hips and knees).
[0063] During the stitching process, each coordinate value needs to be precision processed, retaining four decimal places. This avoids redundant calculations due to excessive precision while ensuring that subtle differences in features are not lost. The final feature vector F is a 1×18 row vector, expressed as: F .
[0064] The feature vector F fully preserves the pose features, and intuitively reflects the human pose features through the differences in the numerical distribution of the normalized coordinates (x'', y'') of all key points. For example: In an upright posture, the human body is vertically distributed, with the head at the top of the torso, the hips as the center, and the limbs hanging naturally. In the feature vector, the y'' value of the head (H) is significantly negative (e.g., -1.8 to -2.2, representing upward relative to the center of the hip), the y'' value of the shoulders (LS, RS) is -0.8 to -1.2 (located above the hip), and the y'' values of the knees (LK, RK) and ankles (LA, RA) are positive (e.g., knee 1.0 to 1.2, ankle 2.0 to 2.2, located below the hip). Furthermore, the absolute values of the x'' values of the left and right symmetrical key points (e.g., LS and RS, LK and RK) are close but opposite in sign (e.g., x'' ≈ -0.3 for LS, x'' ≈ 0.3 for RS), reflecting the left and right symmetry of the body when upright.
[0065] In a squatting position, the knees are bent, the hips descend closer to the knees, and the body's center of gravity shifts downward. In the feature vector, the y'' value of the hips (LH, RH) is close to 0 (because the center of the hips is the origin of the coordinate system), but the y'' value of the knees (LK, RK) decreases from about 1.0 when standing to 0.5 to 0.7 (the distance between the hips and knees shortens), the y'' value of the head (H) increases from about -2.0 to -1.0 to -1.5 (the head descends as the body leans forward), and the difference in the x'' value between the left and right shoulders increases slightly (the forward lean causes slight asymmetry).
[0066] In the fallen posture, the body is horizontally or diagonally extended, with the torso parallel to the ground. In the feature vector, the difference in y'' values between the head (H) and ankles (LA, RA) is significantly reduced (e.g., y'' of H ≈ -0.2, y'' of LA ≈ 0.3, the relative height difference decreases from 4.0 in the upright position to less than 0.5), while the difference in x'' values is significantly increased (e.g., x'' of H ≈ -1.5, x'' of RA ≈ 1.5, the horizontal span increases from 0.6 in the upright position to more than 3.0). At the same time, the y'' values of the shoulders (LS, RS) and hips (LH, RH) are close (e.g., shoulder y'' ≈ -0.1, hip y'' ≈ 0, reflecting the horizontal position of the torso).
[0067] The key to selection is the core joints of human movement. Their relative position changes directly determine the posture type. For example, the positional relationship between the head and the torso (shoulders, hips) distinguishes "standing / squatting", and the positional relationship between the torso and the lower limbs (knees, ankles) distinguishes "squatting / falling". Moreover, these joints have high stability in human movement (less affected by clothing and range of motion).
[0068] By using structured joint relative position features, the discrimination boundary of human posture is clearly distinguishable (e.g., when falling, x'' span > 2.5, when standing, < 1.0), which solves the problem of misjudgment of similar postures (e.g., when squatting, x'' span < 1.5, which is significantly different from falling).
[0069] The x'' span represents the direction of the human body's main axis in space. Standing upright is the vertical main axis (small x'' span), falling is the horizontal main axis (large x'' span), and squatting is a transitional state between the two. This allows the classifier to find clear boundaries, thereby greatly reducing false alarms such as "bending over being misjudged as falling" or "squatting being misjudged as falling."
[0070] Normalized feature vectors have strong generalization ability. Because the feature distribution of the same pose is concentrated, there is no need to cover massive scene data. Only a small number of samples are needed to train a stable SVM model, reducing the labeling cost.
[0071] Each dimension of the feature vector corresponds to the coordinates of a specific joint. If the model misjudges, the abnormal dimension can be located directly. For example, the abnormally low y'' value of the knee may mistakenly identify squatting as falling. This makes it easier to trace the cause and optimize, such as by adjusting the kernel parameters of the SVM.
[0072] S4 transforms the scattered keypoint coordinates output by S3 into structured feature vectors, preserving the topological relationships of the human posture while converting discrete coordinates into structured input, thus meeting the format requirements of SVM classifiers. Each dimension in the feature vector corresponds to specific joint coordinates, providing strong interpretability. If the model misjudges (e.g., classifying a squatting position as a fall), the abnormal dimension (e.g., an abnormal y'' value for the knee) can be directly located. The feature vectors can then be directly input into the SVM classifier of S5 for training or real-time determination of whether the posture is a fall. This process preserves all the key information of the human posture and meets the input format requirements of machine learning models, ensuring that S5 can be effectively trained based on features with a unified structure.
[0073] S5: Train the SVM classifier using the feature vector F to obtain the trained SVM classifier; this includes the following sub-steps:
[0074] S51. Prepare the offline training dataset D; To build a sample library that is "comprehensive, accurately labeled, and consistent in features" to support the model's generalization ability, it is necessary to collect a large number of surveillance video clips containing human "normal" and "falling" postures, manually label the status of people in each frame of the image, and then extract normalized key point features from each frame of the image to form labeled training samples. Specifically, the collected video clips need to cover typical situations of the target application scenario. The scenarios include, but are not limited to, nursing home wards (beds, wheelchairs, low light at night), corridors (pedestrian traffic, different lighting), and hospital wards (medical equipment obstruction). In terms of posture, "normal" should include standing, walking, sitting, squatting, bending over, and other actions that are easily confused with falling, while "falling" should include lying on your back, side, and prone. In terms of personnel characteristics, the samples should cover different heights and body types (thin, medium, and overweight) to ensure sample diversity.
[0075] The total video duration collected must be ≥50 hours. For all collected video frames, the ratio of "normal" to "falling" samples should be controlled at 3:1. In real-world applications, the frequency of the "normal" state is usually much higher than that of the "falling" state. In most cases, people are in normal states such as standing, walking, or sitting, while "falling" is a low-frequency but high-risk event. Therefore, this ratio closely reflects the natural distribution of the two states in real-world scenarios, enabling the model to better adapt to the distribution of real data during training.
[0076] Next, manual annotation is performed. Each video frame is independently labeled with a status tag by two annotators, for example, "normal" is marked as 0 and "falling down" is marked as 1. The following is an example annotation standard: Standing: The body is upright with both feet on the ground, and the body's center of gravity is between the two feet, without any obvious tilt.
[0077] Walking: The human body is in a state of movement, with both feet alternating on the ground, the body posture is natural, and there are no obvious signs of loss of balance.
[0078] Sitting posture: The person sits on a chair, wheelchair or other support with the buttocks on the ground and the upper body upright or slightly tilted, without a significant tendency to lean forward or backward.
[0079] Squatting: When a person squats down, both feet are on the ground, the hips are lower than the knees, the back remains relatively upright, and there is no obvious backward movement.
[0080] Bending over: The upper body bends forward, the legs may be slightly bent, and the hands may touch the ground or an object, but the body's center of gravity remains on the supporting surface, and there is no obvious loss of balance.
[0081] Lying on your back: The human body lies flat on the ground with the back in contact with the ground, the limbs naturally extended or slightly bent, and the body in a horizontal position.
[0082] Side-lying position: The body lies on its side on the ground, with one side of the body in contact with the ground and the other side of the body slightly raised or bent, possibly accompanied by supporting movements of the arms or legs.
[0083] Prone position: The human body lies face down on the ground with the abdomen and chest in contact with the ground, and the limbs may be extended or bent, with the body in a horizontal position.
[0084] Annotators must independently label the people in each video frame according to the above standards to ensure the consistency and reliability of the annotation results; frames with inconsistent annotations will be arbitrated by a third senior annotator to ensure the accuracy of the labels.
[0085] After annotation, the complete process S2-S4 is performed for each frame, which involves extracting human key points using YOLOPose, normalizing them in S3, and obtaining high-dimensional feature vectors in S4, ultimately forming a labeled offline training dataset D. , where Fᵢ is the feature vector of the i-th frame, yᵢ∈{0,1} is the corresponding label, and n is the total number of samples.
[0086] S52. Train the model using the offline training dataset D; An SVM classifier was trained using the S51 offline training dataset D. A radial basis function kernel (RBF kernel) was selected to enhance the handling of non-linear separable cases. The penalty parameter C and kernel parameter γ were adjusted to optimize classification performance, resulting in a trained model that could output either "normal" or "fallen" results. The key to model training was optimizing parameters to enable the SVM classifier to accurately learn the boundaries between "normal" and "fallen" features. This included the following sub-steps:
[0087] S521. Dataset partitioning and preprocessing; To provide a reliable benchmark for model training and evaluation, the dataset D obtained from S51 is randomly divided into a training set D_train in an 8:2 ratio. With the validation set D_val D_train is used for model parameter learning, and D_val is used to evaluate the model's generalization ability (to avoid overfitting). When splitting the dataset, the ratio of "normal" to "fallen" samples should be kept consistent with the original dataset D (3:1) to ensure that the distribution characteristics of the two classes remain unchanged in the subset. For example, if the original dataset D contains 300,000 normal samples (y=0) and 100,000 fallen samples (y=1), then D_train contains 240,000 normal samples and 80,000 fallen samples, and D_val contains 60,000 normal samples and 20,000 fallen samples. After splitting the dataset, the feature vectors are standardized: for each feature vector... The k-th dimension is denoted as Calculate the mean of each dimension of all feature vectors in D_train. with standard deviation = (k=1,2,…,18, corresponding to 18-dimensional features), for each Perform z-score standardization, the formula is as follows: To eliminate the influence of differences in units of measurement for features of different dimensions (e.g., the numerical ranges of x'' and y'' may be different), standardize parameters ( This data needs to be saved for unified processing of input features during subsequent S6 real-time classification.
[0088] S522. SVM Model Construction and Objective Function Definition; The model training phase utilizes the SVC module from the scikit-learn library. Core parameter configuration revolves around the RBF kernel. The core approach is to learn the classifier by solving the following constrained optimization problem: The original objective function is... ,in , C is the penalty parameter and C And satisfy the following constraints: ( ), The high-dimensional mapping function corresponding to the RBF kernel satisfies ,in, For kernel parameters and ; The mathematical expression for the RBF kernel function is: The RBF kernel function maps 18-dimensional features to a high-dimensional space, transforming the originally non-linearly separable "normal" and "falling" features (such as the boundary between squatting and lying on one's side) into linearly separable features, thus adapting to the complex non-linear distribution of human posture features. The penalty parameter C (C>0) controls the severity of the penalty for misclassified samples: a larger C value indicates that the model is more inclined to correctly classify samples in the training set, potentially leading to overfitting (good performance on the training set but poor performance on the validation set); a smaller C value allows for more misclassifications, potentially leading to underfitting (poor performance on both the training and validation sets).
[0089] Through the Lagrange dual transformation, the above problem is transformed into solving the dual variables. The maximization problem, i.e. , constraint is 0 and .
[0090] S523. SVM Model Construction and Objective Function Definition; Parameter optimization employs a combination of 5-fold cross-validation and grid search, finding the optimal combination by traversing a predefined parameter space. Specifically, D_train is divided into 5 mutually exclusive subsets. Each iteration uses 4 subsets for training and 1 subset for validation, repeating this process 5 times and averaging the performance as the evaluation result for that parameter combination. The candidate values for the predefined parameter grid C are... Candidate values; the preferred evaluation metric is "recall rate of fallen samples". TP represents the number of correctly identified fallen samples, and FN represents the number of missed fallen samples, while also considering the "accuracy rate for normal samples". (TN represents the number of correctly identified normal samples, and FP represents the number of misidentified normal samples). Since the fall-down event is a high-risk scenario, it is necessary to prioritize a recall rate of ≥98% (to avoid false negatives), and on this basis, pursue an accuracy rate of ≥95% (to reduce false positives).
[0091] Ideally, the parameter grid setting combines prior knowledge and scene characteristics, setting the candidate values of C to [0.1, 1, 10, 100] (covering the range from weak penalty to strong penalty). The candidate values are set to [0.01, 0.1, 1, 10] (covering the influence range of the kernel function from wide to narrow), for a total of 16 parameter combinations.
[0092] By performing a grid search, traversing the preset parameter grid (C∈[0.1,1,10,100], γ∈[0.01,0.1,1,10]), each parameter combination (C, Find the average precision and recall (recognition rate of fallen samples) in cross-validation, and determine the C and C values that best meet the preset metrics and perform optimally in 5-fold cross-validation. The optimal combination of parameter values is denoted as ( , ).
[0093] S524. Model Training and Validation; Then use parameter combinations ( , Train the model on the complete D_train and solve for the Lagrange multipliers. (Only supports vector correspondence) >0) and bias terms .
[0094] After training, the model's generalization ability is evaluated using D_val: The model outputs a classification result, which is compared with the true label. The recall of fallen samples and the accuracy of normal samples are calculated. If the recall is ≥98% and the accuracy is ≥95%, the model is effective; otherwise, return to S523 and adjust the grid range, i.e., expand C and... The range (e.g., C∈[0.1,500], γ∈[0.001,50]) captures better parameters.
[0095] S525. Model serialization and storage; Model serialization storage stores the model's core parameters, namely support vectors. Lagrange multipliers Bias terms nuclear parameters Penalty parameters and standardized parameters Save the file as "falldetectorsvm.pkl" using a serialization tool (such as Python pickle), store it on the local hard drive of the edge computing unit, and finally obtain the final trained SVM classifier, which can be loaded and called for subsequent real-time classification.
[0096] S5 maps features to a high-dimensional space using an RBF kernel and optimizes the process using a grid search. The parameters make the classification boundaries of similar poses clear and distinguishable; and through the support vector mechanism of SVM, high accuracy can be achieved with only a few frames, and it has good classification performance for small samples and high-dimensional features. Combined with key point input, the weighted penalty of fallen samples by C parameter can effectively reduce the false alarm rate; moreover, the SVM model only needs to store support vectors and a small number of parameters, which is suitable for scenarios with limited edge computing resources.
[0097] S6: Real-time pose classification and fall detection based on a trained SVM classifier; S6, as the core execution step of real-time detection, relies on an integrated detection system composed of a front-end camera, an edge computing unit, and a back-end processing unit. Its core objective is to input the feature vector F obtained from the preceding steps into a pre-trained SVM classifier in real time to quickly determine whether the current human posture is "falling down," and to decide whether to trigger subsequent verification processes based on the result. The overall process in actual operation is as follows: The detection system acquires human video frames through S1, then detects the human body and extracts key points through S2, then normalizes the key points through S3, then constructs the feature vector F through S4, and then inputs the feature vector F into the pre-trained SVM classifier in S5. Finally, this step obtains the classification result of the SVM classifier. If the classification result is "falling down," the next judgment step is performed; if it is "normal," the next frame is processed.
[0098] In practice, the detection system first receives the feature vector F of the current frame output by S4, denoted as... (t is the current frame timestamp) and the normalization of the corresponding 9 key points Then, the detection system loads the SVM model that has been trained by S5 and pre-stored in the memory of the edge computing unit, and... The input model is used for inference, relying entirely on the CPU and cache of the edge computing unit.
[0099] Because S5 performs standardization (eliminating dimensional differences) on the input features during the training phase, the standardized parameters stored in the S5 serialization process need to be called to ensure inference consistency. (k=1,2,...,18), for Perform standardization calculations on each dimension of the feature: the standardized eigenvalues of the k-th dimension For example, if 3rd dimension (left shoulder) The original value of the coordinates was -0.33, stored in S5. =−0.2、 =0.5, then .
[0100] Then, SVM model inference computation is performed. The edge computing unit loads the core parameters of the model trained by S5 from memory: the set of support vectors. ( Lagrange multipliers in S5 The feature vector of the training samples; Next, the classification result is determined based on the decision function value. The positive or negative sign determines the pose category, where This is the RBF kernel function, used to calculate real-time feature vectors. With support vectors similarity, This is the 18-dimensional feature vector after standardization of the current frame, corresponding to the normalized coordinates of the 9 key points after standardization, and the original feature vector output by S4. Combined with the standardized parameters pre-stored in S5 The calculation yields the following formula: ; The set of support vectors, i.e., the Lagrange multipliers in the SVM model. The feature vectors of the training samples are obtained in S5 by solving the dual optimization problem; For support vectors The corresponding real pose label, Corresponding to "normal", 1 corresponds to "falling to the ground"; For standardized real-time feature vectors With support vectors The Euclidean distance between the two reflects their pose similarity (the smaller the distance, the closer their poses).
[0101] Specifically, if If the value is greater than 0, the current frame's pose is determined to be "falling down" (denoted as...). 1) This threshold originates from the solution to the dual problem of S5, i.e., when When >0, the sample is located on one side of the "inverted" hyperplane in high-dimensional space; if If the value is greater than or equal to 0, it is considered "normal" (denoted as ). =0), corresponding to one side of the "normal" class hyperplane. After the determination, an "Inference Result Log" needs to be generated to record the results. The logs are stored in local log files in the edge computing unit for subsequent troubleshooting and performance analysis.
[0102] Finally, the execution results are distributed and exceptions are handled. If the result is determined to be "normal": the system clears the "suspected fall counter" (this counter is used to accumulate the number of consecutive fall frames, with an initial value of 0), retains only the inference result log, and immediately releases the feature vector memory of the current frame to prepare for receiving the next frame. Prepare; if determined to be "falling down": the system will... , The event message, which is packaged into a JSON format and contains the original image path of the current frame, is pushed to the S7 time window verification module via the MQTT protocol (ensuring message transmission latency ≤5ms). At the same time, the event message is cached in the 8GB eMMC storage of the edge computing unit to prevent message loss due to network interruption. If any abnormal situation occurs (such as (Due to issues such as missing dimensions or inference timeouts), the detection system automatically uses the classification results from the previous frame. And mark "abnormal frame: t, using the result of frame t−1" in the log to avoid detection interruption due to a single frame abnormality.
[0103] S6 processes data in real time on edge devices with short single-frame processing time and no need for manual supervision, solving the problems of lag in manual monitoring and strong reliance on human resources; feature standardization ensures consistent inference and avoids misjudgments caused by differences in units; the anomaly fallback mechanism ensures uninterrupted detection and reduces the impact of single-frame anomalies on the overall process.
[0104] S7: Time continuity verification and alarm; The core of S7 is based on the "falling" judgment result output by S6. It uses a time window to verify and filter false judgments, triggering multi-dimensional alarms only for genuine fall events. The entire process relies on the event scheduling module of the edge computing unit to work in conjunction with external hardware (alarms, speakers) and communication interfaces. It is based on the "falling" event message pushed by S6 (including timestamp t, feature vector) Judgment Result =1. Original image path), the output is an alarm signal or a "temporary pose" determination result. Specifically, it includes the following sub-steps:
[0105] S71. Time window verification; Set time window First, the time window needs to be set. This is converted into a quantifiable "frame rate window" to ensure that the parameters match the video frame rate of S1: Let the frame rate of S1 be fps, then the time window... (e.g., 3 seconds) corresponding frame window For example, a 3-second time window at 15fps corresponds to 45 frames; Set the fall frame threshold K (the minimum number of consecutive fall frames required to determine a true fall) = kth, where kth is the coverage rate and kth∈[0.6,1], represents the frame window. The ratio of kth originates from scenario testing. After configuration, kth is stored in the edge computing unit and can be adjusted according to the scenario.
[0106] Preferably, the coverage kth value is set to 0.8 by default.
[0107] Next, the window starts and frames are collected: only when the edge computing unit receives an S6 push via the MQTT protocol. The time window is activated only when the event message =1 ("falling down") is received. The specific process is as follows: (1) Window initialization: Record the window start timestamp (Taken from S6 event news) ), Start Frame Sequence Number (Depend on S1 frame rate conversion: ,because (in milliseconds), initialize the "in-window knockdown frame counter" (N=1, the current frame has been determined to be knocked down), and create a temporary buffer list L to store the event messages of all frames in the window, and add the current S6 event message to L;
[0108] (2) Frame collection within the window: After the window starts, the edge computing unit receives the S6 event messages of subsequent frames in timestamp order until the collected frames are completed. Frames or time reached 1000 (milliseconds). Each event message within the window is evaluated individually: If the received current message contains =1, then N +1, and add the current message to L; if =0, only add the message to L (do not update N); if a frame is lost due to network jitter, read the judgment result of that frame from the local cache of S6 (eMMC storage of the edge computing unit) (S6 has cached all frames). This ensures that no frames are missing within the window.
[0109] Actual fall detection: After the window closes, immediately execute the following detection logic: like : If the event is determined to be a "real fall event", a "fall confirmation signal" is generated, which includes window information. , The image paths of all frames in N and L (obtained from the S6 event message) are passed to S72; If : It is determined as "temporary posture change", clear the temporary cache list L and counter N, and only record in the log "window : The number of frames of falling to the ground N < K, no alarm is triggered", and wait for the next S6 push Restart the window when = 1.
[0110] In this step, by setting a time window, it is judged whether there are multiple consecutive frames within the window that are determined as "falling to the ground" by SVM. If it is satisfied, it is determined as a real fall event. If it is not satisfied, it is regarded as a temporary posture change and no alarm is triggered.
[0111] S72 triggers the alarm mechanism; After receiving the "fall confirmation signal" from S71, synchronously trigger four types of alarm operations. All operations are based on the output data of the previous steps (such as timestamp, image path, area information) to ensure the accuracy and traceability of the alarm content.
[0112] The edge computing unit is linked with the integrated alarm deployed in the detection area (such as the HS-102 type alarm powered by DC12V) through the GPIO interface (general purpose input / output interface): When the "fall confirmation signal" arrives, the edge computing unit outputs a high-level signal (lasting for 5 minutes, or until the on-site personnel press the alarm reset button), and the alarm is immediately activated: Emits intermittent beeps of 85 decibels (frequency 2000Hz, 1 second on, 0.5 second off cycle) to ensure that people within 5 meters can clearly hear; Preferably, the ID of the alarm is bound to the installation area of the S1 camera. For example, the "Alarm in Ward 302" corresponds to the camera in Ward 302 to ensure the accuracy of the alarm location.
[0113] At the same time, relying on the pre-configured communication module of the edge computing unit, push the alarm information to the duty personnel or family members. The message content includes the key data of the previous steps. Specifically, send real-time messages to the family members through the WebSocket protocol to the relevant APP or applet. The message content includes the fall area (such as Ward 302), the fall time ( Converted to the yyyy-MM-dd HH:mm:ss format), with an attached short video clip of the fall (intercepted from the video stream cached in S1 to The content contains the complete process of the fall); and send graphic messages to the nursing work group through the enterprise WeChat robot interface, including on-site screenshots (obtained from the image path of S6) and area positioning links (clickable to jump to the real-time monitoring screen of the area).
[0114] Furthermore, if wall-mounted speakers are deployed in the detection area, the edge computing unit can also call the local audio playback library to play a pre-stored MP3 format prompt voice when the alarm is triggered. The prompt voice will be played in a loop 3 times (with an interval of 2 seconds each time) and then automatically stop to avoid continuous voice interference to other areas.
[0115] Furthermore, upon alarm triggering, the event information is also stored in a structured manner for subsequent tracing and analysis; specifically, a record is inserted into the relevant table in the MySQL database, with fields including: Alarm ID (auto-incrementing primary key), Area Number (e.g., "302", from the S1 camera area), Trigger Time (… Convert to yyyy-MM-dd HH:mm:ss.SSS format, window parameters ( K, N (from S71), and processing status (default "unprocessed", which will be updated to "processed" by the on-duty personnel in the APP). Finally, a TXT format log file is generated to record the detailed process.
[0116] As the final decision-making and response stage for fall detection, S7 uses time continuity verification to prevent frequent alarms and interference with normal operation caused by single-frame misjudgments from S6 (such as single fall judgments caused by sudden bending over or lens reflections). Through time window and fall frame threshold verification, it filters temporary posture changes, significantly reducing the false alarm rate. A multi-dimensional alarm mechanism after a fall ensures that real fall events are promptly known and responded to by remote personnel. Its implementation requires close integration with the real-time classification results of S6, using rigorous window verification logic to reduce false alarms, and relying on hardware and software interfaces to complete multi-channel transmission of alarm information, balancing the timeliness of on-site response and remote notification.
[0117] The present invention has been described in the above-described embodiments; however, these embodiments are merely examples for implementing the present invention. It must be noted that the disclosed embodiments do not limit the scope of the present invention. Conversely, any modifications and refinements made without departing from the spirit and scope of the present invention are within the scope of patent protection of the present invention.
Claims
1. A method for detecting human key points and detecting fallen persons based on machine vision and SVM, characterized in that, Includes the following steps: S1: The camera is installed and captures video streams from the monitored area, and transmits the video frames to the back-end processing unit; Select high-definition network cameras and install them at indoor and outdoor target locations to ensure coverage of the activity area. After capturing video streams, transmit them to the back-end processing unit at a preset frame rate. At the same time, the back-end processing unit has built-in local storage. When the network is temporarily interrupted, the caching function is automatically triggered to temporarily store the video stream locally. When the network is restored, it will be automatically retransmitted to prevent data loss. S2: Human body detection and key point extraction, resulting in a set of key points. ; The YOLOPose algorithm is used to input the video frame images transmitted by S1 into the CSPDarknet backbone network of the YOLOPose algorithm to capture the features of shallow and deep convolutional layers. Then, PANet is used to fuse the features of shallow and deep convolutional layers across layers to obtain multi-scale feature maps. The human detection branch of the YOLOPose model head generates anchor boxes at multiple scales. For each grid cell on the feature map, the YOLOPose model is used to obtain its human confidence score, and then anchor boxes with a human confidence score ≥ are selected. The candidate boxes are then processed using a non-maximum suppression algorithm to remove overlapping and redundant boxes, ultimately yielding the human target box. The This is the confidence threshold, and 0.4 ≤ ≤0.6; Then from the human body target bounding box In the process, the pose regression branch of YOLOPose is simultaneously launched to extract specified key points. The pose regression branch is designed for... Nine key point heatmaps with the same size as the multi-scale feature map described in S21 are output from the region. For each pixel in the heatmap, its value is compared with the value of its eight neighboring pixels. If the pixel value is the largest in the neighborhood, it is determined to be a peak pixel, and its coordinates are the position of the key point in the heatmap. Next, the pixel coordinates of the keypoints in the original frame are obtained through reverse mapping; in this way, the original frame coordinates (x, y) of all human keypoints and the visibility confidence v of the keypoints are extracted simultaneously to form a keypoint set. ; S3: Yes All key points in the data are normalized to obtain a normalized set of key points. ; Using the center point of the human hip as the relative coordinate origin, specifically, if the coordinates of the left hip are (xLH, yLH) and the coordinates of the right hip are (xRH, yRH), then the coordinates of the hip center are calculated as follows: The coordinates of the center point of the hip are obtained. , ); Perform a translation transformation on the key points to eliminate positional differences and obtain relative coordinates. The calculation formula is as follows: , ;in The x and y coordinates of each key point, '、 ' represents the relative coordinates after translation; Then, based on the shoulder-hip distance... To eliminate height differences, the units are scaled to obtain normalized key points; specifically, ,in( , ( ) represents the coordinates of the average point S of the left and right shoulders of the human body. The left shoulder is extracted first during the calculation. , with right shoulder , The original coordinates, through = , = Obtain; the coordinates of each key point after translation ( ', ') Perform scale scaling, the formula is ,in , For the final normalized coordinates; S4: Based on the normalized set of key points Construct the feature vector F; Normalized keypoint set based on S3 All coordinates in the vector are included. Each keypoint contains two dimensions: a normalized x-coordinate x'' and a normalized y-coordinate y''. The normalized x and y coordinates of each keypoint are concatenated in a fixed order according to anatomical logic to form a feature vector F. S5: Train the SVM classifier using the feature vector F to obtain the trained SVM classifier; Construct an offline training dataset D with labels "normal" and "fallen down". Divide D into a training set D_train and a validation set D_val. When dividing, the ratio of "normal" and "fallen down" samples should be consistent with the original dataset D. The model is trained using an RBF kernel to train an SVM. The core principle is to learn the classifier by solving the following constrained optimization problem: The original objective function is... ,in , C is the penalty parameter and C And satisfy the following constraints: ( ), The high-dimensional mapping function corresponding to the RBF kernel satisfies ,in, For kernel parameters and ; The mathematical expression for the RBF kernel function is: ; Parameter optimization employs a combination of 5-fold cross-validation and grid search, finding the optimal C and values by traversing a pre-defined parameter grid. The optimal combination of parameter values is denoted as ( , ); Then use parameter combinations ( , Train the model on the complete D_train and solve for the Lagrange multipliers. (Only supports vector correspondence) >0) and bias terms ; Finally, the core parameters of the qualified model, namely the support vectors, are recorded and stored. Lagrange multipliers Bias terms nuclear parameters Penalty parameters and standardized parameters This yields the final trained SVM classifier. S6: Real-time pose classification and fall detection based on a trained SVM classifier; Loading the model and standardized parameters stored in S5, the integrated detection system, consisting of a front-end camera, edge computing unit, and back-end processing unit, first receives the feature vector F of the current frame output by S4 and denotes it as... Normalization of the corresponding 9 key points Then, load the SVM classifier trained by S5, and... Input the model for inference, where t is the current frame timestamp; obtain the classification result. If the classification result is "fallen down", then... =1, then t, , The original image path of the current frame is packaged into an event message and the process proceeds to the next step, S7, for judgment; if the classification result is "normal", then... If the value is 0, skip the frame and continue processing the next frame. S7: Time continuity verification and alarm; First, set the time window. Let the video frame rate of S1 be fps, then the time window Corresponding frame rate window ; Next, set the fall frame threshold K= kth, where kth is the coverage rate and kth∈[0.6,1]; For frames that S6 determines as "knocked down" within a given time window, count the number of knocked-down frames within the window and record the window's start timestamp. Initialize N=1 and create a temporary buffer list L to store event messages for all frames in the window, and add the current S6 event message to L; After the window is started, the edge computing unit receives S6 event messages of subsequent frames in timestamp order until it collects... Frames or time reached 1000; For each event message within the window, check it one by one: if the received current message contains... If = 1, then N + 1, and add the current message to L; if =0, only add the message to L but do not update N; After the window ends, if N≥K, the current video frame image is determined to be a real fall and an alarm is triggered to remind the user. The alarm methods include, but are not limited to, the alarm sounding, the APP or mini-program message push, and the speaker voice reminder.
2. The method for detecting human key points and detecting fallen persons based on machine vision and SVM according to claim 1, characterized in that, In step S1, the high-definition network camera has a resolution of ≥1080P, a minimum illumination of ≥0.01Lux for indoor scenes and supports wide dynamic range (WDR) technology, an installation height of 2.5-3 meters and a horizontal tilt angle of 15-20°, the video stream is transmitted using the RTSP protocol, the back-end processing unit has built-in ≥8GB of local storage, and the video stream is automatically cached when the network is interrupted.
3. The method for detecting human key points and detecting fallen persons based on machine vision and SVM according to claim 1, characterized in that, The process of obtaining human confidence in step S2 is as follows: the CSPDarknet backbone network outputs feature maps at three scales, which correspond to the detection of small, medium and large targets, respectively; Then, for each grid cell on the feature map, anchor boxes of three scales are generated; each anchor box is used to predict a bounding box and its corresponding human confidence score and class probability. Each anchor box predicts the coordinates (x, y, w, h) of the bounding box, where (x, y) are the coordinates of the center of the bounding box, and (w, h) are the width and height of the bounding box. For each anchor box, the model predicts a human confidence score C, which represents the probability that the anchor box contains a human body. The human confidence score C is output through a sigmoid function, ensuring its value is between 0 and 1. The formula is as follows: ;in It is the sigmoid function. This indicates a 1×1 convolution operation on the feature map.
4. The method for detecting human key points based on machine vision and detecting fallen persons using SVM according to claim 1, characterized in that, The key point set is obtained as described in step S2. The specific process is as follows: The peak pixel is denoted as... The raw output of the heatmap is constrained by the sigmoid activation function to ensure peak pixel values. After activation, it falls within the [0,1] interval, and the formula is: ; If v ≥ 0.3, the keypoint coordinates are considered valid; if v < 0.3, the keypoint coordinates are marked as invalid. Finally, the keypoints are organized into a set according to a fixed anatomical logical order. = },in These are the original pixel coordinates of the key points. This represents the visibility confidence level for the corresponding key point.
5. The method for detecting human key points and detecting fallen persons based on machine vision and SVM according to claim 1, characterized in that, The specific process of constructing the offline training dataset in step S5 is as follows: Collect a large number of surveillance video clips containing human "normal" and "falling" postures. The total duration of the collected videos must be ≥50 hours. For all collected video frames, the ratio of "normal" to "falling" samples is controlled at 3:
1. Each video frame image is independently labeled with a status tag by two annotators. The annotators independently label the people in each video frame to ensure the consistency and reliability of the labeling results. Frames with inconsistent labels are arbitrated by a third senior annotator. After annotation, the complete process S2-S4 is performed for each frame, which involves extracting human key points using YOLOPose, normalizing them in S3, and obtaining high-dimensional feature vectors in S4, ultimately forming a labeled offline training dataset D. , where Fᵢ is the feature vector of the i-th frame, yᵢ∈{0,1} is the corresponding label, and n is the total number of samples.
6. The method for human key point detection and SVM-based person fall detection based on machine vision according to claim 1, characterized in that, After dividing the training set D_train and the validation set D_val in step S5, the feature vectors are also standardized: for each feature vector... The k-th dimension is denoted as Calculate the mean of each dimension of all feature vectors in D_train. with standard deviation = k=1,2,…,18, corresponding to 18-dimensional features; For each Perform z-score standardization, the formula is as follows: This eliminates the influence of differences in dimensions on features of different dimensions.
7. The method for detecting human key points and detecting fallen persons based on machine vision and SVM according to claim 1, characterized in that, In step S5, through the Lagrange dual transformation, the process of learning a classifier to solve a constrained optimization problem is transformed into solving a dual variable problem. The maximization problem, i.e. , constraint is 0 and .
8. The method for human key point detection and SVM-based person fall detection based on machine vision according to claim 1, characterized in that, In step S5, the specific implementation process of the 5-fold cross-validation combined with grid search is as follows: D_train is divided into 5 mutually exclusive subsets. Each time, 4 subsets are used for training and 1 subset for validation. This process is repeated 5 times, and the average performance is taken as the evaluation result of the parameter combination. The parameter grid presets candidate values for C and... Candidate values; The preferred evaluation metric is "recall rate of samples that have fallen to the ground". TP represents the number of correctly identified fallen samples, and FN represents the number of missed fallen samples, while also considering the "accuracy rate for normal samples". TN represents the number of correctly identified normal samples, and FP represents the number of misidentified normal samples. Since the fall-down event is a high-risk scenario, it is necessary to prioritize a recall rate of ≥98%, and then pursue an accuracy rate of ≥95% on this basis. By performing a grid search, traversing the preset parameter grid, and calculating each parameter combination (C, ... Find the average precision and recall in cross-validation, and determine the C and C values for the model that best meet the preset metrics and perform optimally in 5-fold cross-validation. The optimal combination of parameter values is denoted as ( , ).
9. The method for human key point detection and SVM-based person fall detection based on machine vision according to claim 1, characterized in that, The SVM classifier model inference process in step S6 is as follows: calling the normalized parameters stored in S5 serialization. ,right Perform standardization calculations on each feature dimension, and the standardized feature value of the k-th dimension is... ; The edge computing unit then loads the core parameters of the model trained by S5 from memory: the set of support vectors. Lagrange multipliers in S5 The feature vector of the training samples; Based on the decision function value The positive or negative sign determines the pose category, where For RBF kernel function, The normalized feature vector of the current frame corresponds to the normalized coordinates of the key points after normalization processing, and is the original feature vector output by S4. Combined with the standardized parameters pre-stored in S5 The calculation yields the following formula: ; The set of support vectors, i.e., the Lagrange multipliers in the SVM model. The feature vectors of the training samples are obtained in S5 by solving the dual optimization problem; For support vectors The corresponding real pose label, Corresponding to "normal" 1 corresponds to "falling to the ground"; For standardized real-time feature vectors With support vectors The Euclidean distance between the two reflects their pose similarity; like If the value is greater than 0, then the current frame's posture is determined to be "falling down" and recorded as...
1. This threshold originates from the solution to the dual problem of S5, i.e., when When >0, the sample is located on one side of the "fallen" hyperplane in high-dimensional space; if If the value is greater than or equal to 0, it is considered "normal" and recorded as 0. =0, corresponding to one side of the "normal" class hyperplane.
10. The method for detecting human key points and detecting fallen persons based on machine vision and SVM according to claim 1, characterized in that, In step S7, when judging the video frame image after the window ends, specifically, if This is then determined to be a "real fall event," generating a "fall confirmation signal" based on window information. , The image paths of all frames in N and L provide precise prompts for subsequent alarms; like If the condition is determined to be a "temporary attitude change", the temporary cache list L and counter N are cleared, and no alarm is triggered. Wait for the next S6 push. Restart the window when =1.