Fall detection method for home human body based on improved YOLOv8
By improving the YOLOv8 network and channel attention mechanism, and combining it with the pose loss function, the accuracy and false positive problems of fall detection in complex environments are solved, and efficient home fall detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2024-12-09
- Publication Date
- 2026-06-09
Smart Images

Figure CN119763184B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of human posture detection and relates to a home-based human fall detection method based on YOLOv8 improvement. Background Technology
[0002] The main focus of fall detection research is to efficiently identify fall movements from various daily behaviors. The ability to promptly identify falls and the timeliness of rescue measures after a fall are crucial for those who have experienced them and are also standards for evaluating the quality of a fall detection system. In recent years, many researchers have begun studying fall behavior detection. Current fall detection methods can be divided into three main categories: the first is wearable-based detection methods, the second is environment-based detection methods, and the third is computer vision-based detection methods. Wearable sensor-based fall detection methods use devices equipped with sensors such as accelerometers and gyroscopes worn on the waist, wrists, or ankles. These sensors collect human motion information, and the analysis of this information determines whether a fall has occurred. The second category, environment-based fall detection methods, involves installing environmental sensors within the user's activity range. Common environmental sensors include pressure sensors, infrared sensors, and sound sensors. These sensors acquire information related to the user's state and behavior, and the analysis of this information determines whether a fall has occurred. The third type of fall detection method is based on computer vision. This type of method mainly uses a camera to collect video data of the human body and uses image frame processing methods to process the video data in order to determine whether the human body has fallen.
[0003] 1.2.1 Research on wearable human fall detection
[0004] Fall detection methods based on wearable embedded sensors primarily involve embedding sensors such as triaxial accelerometers, infrared sensors, or gyroscopes into belts, wristbands, or clothing to collect data. The collected data is then processed to determine whether a fall has occurred. Depending on the data processing methods, fall detection methods can be categorized into thresholding and machine learning approaches.
[0005] The advantage of fall detection methods based on wearable embedded sensors is that they can be carried at all times, whether indoors or outdoors, and are unaffected by changes in the external environment. However, they also have certain drawbacks. Some elderly people have poor memory and may easily forget to wear them. Furthermore, prolonged wear of some devices may cause discomfort or even lead to aversion. Since falls are infrequent events in daily life, if no falls occur for a long time, the elderly may become unwilling to wear the device. Indoors, the elderly may perceive it as a safe environment and, for comfort reasons, be less likely to wear the device. In such cases, the risk of a fall by an elderly person living alone going unnoticed is significantly increased.
[0006] 1.2.2 Environment-based research on human fall detection
[0007] Fall detection technology based on environmental sensors involves pre-installing external environmental sensors such as sound sensors, barometric pressure sensors, or accelerometers on the ground, ceiling, walls, etc. After collecting and processing this information, data analysis is performed to determine whether a fall has occurred.
[0008] Fall detection methods based on environmental sensors do not require elderly people to wear sensors or have direct contact with their bodies, offering good comfort while also providing sufficient personal space. However, they also have certain drawbacks. If environmental sensor devices are to be installed, they must be placed in fixed locations, and a good set of environmental sensor-based fall detection equipment is not inexpensive, making it difficult to popularize in ordinary households. Furthermore, they are greatly affected by environmental factors; once interfered with, they are prone to false alarms and have a relatively low accuracy rate.
[0009] 1.2.3 Research on Human Fall Detection Based on Computer Vision
[0010] Fall detection methods based on computer vision sensors offer numerous advantages over the previous two types of methods due to the advancements in artificial intelligence and machine learning. Currently, it is the most prevalent method. This approach primarily involves collecting image data in specific environments using visual sensors and then analyzing this data using big data analytics and feature extraction techniques to determine if a fall has occurred. It does not interfere with human movement, is less affected by environmental factors, and can detect multiple falls simultaneously. Therefore, fall detection methods based on computer vision are the subject of extensive research.
[0011] (1) Before the advent of artificial intelligence, traditional fall detection methods mainly relied on manual methods to extract human contour features and analyze the geometric changes of the features to determine whether a fall had occurred.
[0012] Zhang et al. proposed a fall detection method based on dual cameras. The main problem is that the Vibe algorithm is prone to ghosting when detecting moving targets. The inter-frame difference method effectively eliminates the ghosting problem. By using the height of the human body during movement, the aspect ratio of the circumscribed rectangle, and the Hu invariant moment characteristics, a corresponding threshold is set to determine whether the human body is in a fall state.
[0013] Liang et al. designed an automatic fall detection system. First, they used background subtraction to segment moving targets, then used a Gaussian mixture model to better segment the targets. Next, they fused five human features: the aspect ratio of the bounding rectangle of the human body, the effective area ratio of the human body, the distance between the center of mass of the human body and the bottom edge, the rate of change of the center of the human body, and the change in height, to determine whether a fall event has occurred.
[0014] Zhang Hong proposed a fall detection algorithm based on target bounding boxes. It uses background subtraction to find the external contour of the human body in the video, and then feeds the extracted external contour area into a support vector machine (SVM) to distinguish between fall events and non-fall events.
[0015] Ma proposed a method combining limit learning classification and shape to distinguish whether a fall has occurred. This involves extracting scale features of the curvature change rate of the human body's external contour from video frames, then using limit learning to evaluate these features, and finally employing a variable-length particle swarm optimization algorithm to optimize the parameters of the limit learning algorithm.
[0016] Harrou proposed a multivariate exponential average weighted detection algorithm, which calculates human behavioral features by multivariate exponential average weighting and uses support vector machines to enhance the differentiation of whether a fall has occurred.
[0017] CW et al. used a fall reconstruction method based on the principle of symmetry. They first used a posture recognition algorithm to extract the human skeleton and set three parameters: the descent speed of the hip joint, the angle between the human body's centerline and the ground, and the aspect ratio of the human body's outer rectangle. They used these parameters to determine various human states and achieved good results on their self-built dataset.
[0018] Zerrouki et al. proposed a method to detect human falls based on changes in human contours in videos. They identified human posture images through curve transformation and area ratio, used support vector machines to identify postures, and used hidden Markov chains to distinguish between falls and non-fall events in the video.
[0019] Traditional computer vision-based fall detection algorithms all require manual feature selection. In contrast, deep learning-based fall detection algorithms have powerful data analysis capabilities, can automatically mine the relationships between human motion features between frames, and have strong robustness and generalization ability.
[0020] (2) Deep learning-based detection methods: After the emergence of machine learning, people use deep learning convolutional networks to train and judge whether a fall has occurred more quickly.
[0021] Yu et al. proposed a real-time fall detection method. First, they used deep learning to detect the joint features of the human body. Then, they calculated the descent speed of the human body's center of mass, the change of the ordinate of the neck joint, and the relative position of the waist joint. They set thresholds to judge and analyze the human body's state.
[0022] Deng et al. proposed a method for fall detection based on convolutional neural networks and human elliptical contour features. They used a Gaussian mixture algorithm to detect the target human body and its minimum bounding ellipse contour. Then, they fitted a multi-kinematic feature representing the time series using features such as the ratio of the major and minor axes, orientation angle, and longitudinal velocity of the centroid of the minimum bounding ellipse. These features were then fed into a CNN network for training to determine various motion characteristics of the human body.
[0023] Lu proposed a fall detection model based on the combination of 3DCNN and LSTM. It uses a 3D convolutional network to extract spatiotemporal features, and then uses LSTM to discriminate these temporal features.
[0024] Yhdego et al. used YOLOv3 as the object detection network combined with an LSTM model to identify fall events.
[0025] Khaled et al. used transfer learning and pre-training to train a region-feature-based convolutional network, forming an efficient deep feature detection network that improved the accuracy of fall detection.
[0026] Chen et al. used an RGB camera to extract human motion features, then used a two-dimensional skeleton model to detect changes in the angle and distance of human skeletal nodes, and finally used principal component analysis to determine whether a fall had occurred.
[0027] Feng et al. proposed a fall detection method based on an attention mechanism, which uses Mask-RCNN as a human behavior decision maker.
[0028] Yang Xueqi et al. used an improved YOLO target detection model to detect human targets, and then used a two-level support vector machine to classify human morphological features, thereby realizing the detection of human bodies in indoor home environments.
[0029] Anishchenko et al. used the Alexnet architecture to detect falling actions. In order to better learn the correlation between spatial features and time, they studied 3D-CNN and LSTM mechanisms to achieve better detection results.
[0030] Mehmood et al. used a CNN-based dual-stream network detection method to effectively distinguish various behaviors in videos, such as falls, crowding, and violence. They used two independent 3D CNNs to receive the video, using optical flow as input to improve prediction performance, and incorporated transfer learning to complete action detection.
[0031] Kong et al. proposed a view-independent fall detection system based on third-rate CNNs, which can learn spatiotemporal features from different types of inputs.
[0032] Lu et al. proposed a method based on 3D-CNN combined with LSTM, which incorporates an LSTM-based spatial visual attention mechanism to locate the falling action in each frame of the video.
[0033] De et al. proposed a combined analysis of fall actions based on multiple reference spatial features. The modeling is divided into four steps: frame extraction, moving target detection, fall event analysis, and keyframe judgment. The background subtraction method of Gaussian mixture model is used to segment the foreground and moving target, and the combined displacement of foreground spatial features is analyzed to determine the fall action.
[0034] Alanazi et al. proposed a fall detection system that integrates multi-stream networks. The system is based on a 16-frame multi-level fusion image method of the input video. It feeds four consecutive preprocessed images into an efficient and lightweight CNN network and uses a four-branch fusion network to classify human fall behavior and non-fall behavior.
[0035] Computer vision-based fall detection methods not only avoid the discomfort and forgetfulness associated with wearing devices, but also solve the problems of environmental sensor-based fall detection methods being easily affected by the environment and being costly. However, research on computer vision-based detection methods both domestically and internationally still faces many challenges, such as low detection accuracy under occlusion, poor real-time performance, and susceptibility to interference from occlusion, lighting, and angle, requiring further research.
[0036] Human fall detection in complex environments faces numerous technical challenges, primarily centered on two core issues. First, the interference of complex environments poses a significant obstacle to accurate human identification. Real-life scenes often feature complex backgrounds filled with various objects, varied textures, and complex colors. These elements can easily be confused with the features of a falling human body, making it difficult for algorithms to accurately distinguish the fallen target from the background. Simultaneously, occlusion is a frequent problem. Whether obscured by other objects or crowds, a fallen person may become partially or completely invisible, undoubtedly increasing the difficulty of target detection. Furthermore, changes in the angle and scale of the human body during a fall are also a major challenge, significantly altering the shape and appearance of the fallen target and thus affecting the accuracy of the detection algorithm.
[0037] Another major technical challenge lies in the misjudgment of similar behaviors. Current human fall detection technology is not yet perfect, and its accuracy still needs improvement. In practical applications, detection algorithms may mistake other daily activities or movements for falls, or conversely, they may overlook genuine falls. Such false alarms or missed alarms not only reduce the reliability of the system but may also cause unnecessary panic or delay emergency rescue. Therefore, how to effectively reduce the false alarm rate while maintaining a high detection rate has become a key issue that current human fall detection technology urgently needs to address. In summary, accurate human recognition in complex environments and the problem of misjudging similar behaviors are the two core challenges currently facing human fall detection technology. Summary of the Invention
[0038] In view of this, the purpose of this invention is to provide a home-based human fall detection method based on YOLOv8.
[0039] To achieve the above objectives, the present invention provides the following technical solution:
[0040] An improved home-based human fall detection method based on YOLOv8 is proposed. This method is based on the YOLOv8 network model and incorporates a channel attention mechanism to establish an improved CA-YOLOv8 network for human fall detection. The method includes the following steps:
[0041] S1. Obtain the dataset, annotate the dataset using annotation tools, and divide the dataset according to a preset ratio;
[0042] S2. Input the acquired image data into the backbone network of the CA-YOLOv8 model for multi-scale feature extraction;
[0043] S3. The output of the backbone network is passed to the neck network for further feature fusion.
[0044] The feature map after S4 and neck fusion is input into the detection head of the CA-YOLOv8 model for processing, and the detection head generates the detection result;
[0045] S5. Establish the loss function of the CA-YOLOv8 model, train the CA-YOLOv8 model, and use the trained CA-YOLOv8 model to perform real-time detection of human falls in residential settings.
[0046] Furthermore, in step S1, various datasets are extracted from videos of people's home activities by using frame extraction. Each image is labeled using a labeling tool such as LabelImg, and the labeling information includes normal activities and falling behavior. The labeled images are then randomly divided into training and validation sets according to a preset ratio.
[0047] Furthermore, in step S2, in the backbone network, the acquired image is used as input, and then preliminary feature extraction is performed through a basic layer ConvModule to obtain feature map P0;
[0048] Then, features are further extracted through multiple stages of SE-C2F feature extraction layers. Each stage module contains multiple convolutional layers, activation functions, and connection operations, resulting in feature maps P2, P3, P4, and P5.
[0049] The feature maps are then fused through the SPPF feature fusion layer and input into the neck network of the CA-YOLOv8 model.
[0050] Furthermore, in the SE-C2F module, the feature maps are first downsampled or pre-processed by ConvModule, and then processed through multiple CSP branches. One branch, the residual branch, is directly connected to the output of another branch for concatenation. The other branch undergoes multiple convolutions to concatenate the feature maps of the two branches along the channel dimension. Then, the concatenation is input into the channel attention module SE for processing, and finally, it is fused through a convolutional layer.
[0051] Furthermore, in the SE-C2F module, the input feature map F is processed by introducing the SENet channel attention mechanism, and MaxPooling and AvgPooling are applied at each spatial location to obtain two C×1×1 vectors.
[0052] These two vectors are fed into an MLP containing two fully connected (FC) layers. The first FC layer reduces the dimension to C / r; the second FC layer increases the dimension to C, resulting in a channel attention (CAM).
[0053] Multiply CAM by the original F to obtain the weighted F'; then concatenate F' with the residual branch in the CSP module along the channel dimension.
[0054] Finally, a convolutional layer is used for feature fusion to obtain the output of the SE-C2F module;
[0055] The process is represented as follows:
[0056]
[0057] In the formula, F is the input feature map, AvgPool(·) and MAXPool(·) are the average pooling and max pooling functions, respectively, MLP(·) is the multilayer perceptron processing function, and W0(·) and W1(·) are the weights of the input layer and the hidden layer, and the weights from the hidden layer to the output layer, respectively. This indicates that the input feature map F undergoes average pooling of the c channels. This indicates that the input feature map F undergoes c-channel max pooling, and σ(·) represents the activation function ReLU.
[0058] Furthermore, in step S3, in the neck network, the output feature maps of multiple SE-C2F modules in the backbone network are received and spliced together by the Concat module;
[0059] The stitched feature maps are then fed into the next SE-C2F module for deeper feature extraction. Some feature maps are upsampled by the Upsample module to ensure effective fusion of feature information at different scales.
[0060] Furthermore, in step S4, the head network uses a "decoupled head" to predict the target's category and bounding box.
[0061] Furthermore, in step S5, the pose loss is introduced into the CA-YOLOv8 network for network training or a weighted loss function, assigning higher weights to the bounding boxes of the fall category to improve the model's attention to the fall target. The pose loss, which enhances the ability to recognize pose changes, uses the cross-entropy loss function, expressed as:
[0062]
[0063] In the formula, N is the number of samples; t i,j p is a one-hot vector representing the true label; i,j This is the model's prediction. The model's original output score, logits, is transformed into a probability distribution using the softmax function, i.e.:
[0064]
[0065] Among them, F i,j It is the logits of the i-th sample in the model output that belong to the j-th pose category.
[0066] The beneficial effects of this invention are as follows:
[0067] First, this invention introduces a channel attention mechanism, enabling the CA-YOLOv8 model to more effectively focus on important features in images, especially key information related to human falls, thereby improving detection accuracy and robustness. This mechanism allows the model to accurately identify falls even in complex and changing home environments, reducing the probability of false positives and false negatives.
[0068] Furthermore, by introducing the EIoU loss function and pose loss, this invention allows the model to place greater emphasis on the accuracy of the bounding box of the falling target and the ability to recognize pose changes during training. This not only improves the model's detection accuracy for falling behavior but also enables the model to better adapt to various falling postures, further enhancing the accuracy and reliability of detection.
[0069] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0070] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0071] Figure 1 This is a schematic diagram of the overall architecture of the home human fall detection method based on YOLOv8 improved according to the present invention;
[0072] Figure 2 A schematic diagram of the network structure for the channel attention mechanism (SE);
[0073] Figure 3 This is a schematic diagram of the compression process in the channel attention mechanism (SE).
[0074] Figure 4 This is a schematic diagram of the activation process in the channel attention mechanism (SE).
[0075] Figure 5 Here is a flowchart of the feature processing for SE-C2F;
[0076] Figure 6 This is a schematic diagram of the SE-C2F network structure. Detailed Implementation
[0077] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0078] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0079] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0080] Please see Figures 1-6 This is a method for detecting human falls in the home based on an improvement of YOLOv8.
[0081] Example
[0082] This embodiment provides a specific implementation process for a home-based human fall detection method based on an improved YOLOv8 network model. It establishes an improved CA-YOLOv8 network based on the YOLOv8 network model and incorporates a channel attention mechanism for human fall detection. Figure 1 As shown, it includes the following steps:
[0083] S1. Obtain the dataset, annotate the dataset using annotation tools, and divide the dataset according to a preset ratio;
[0084] The dataset can be obtained by extracting videos of people's home activities. Various datasets are obtained by frame extraction. Each image is labeled using a labeling tool such as LabelImg. The labeling information includes normal activities and falling behavior. The labeled images are randomly divided into training and validation sets in an 8:2 ratio.
[0085] S2. Input the acquired image data into the backbone of the CA-YOLOv8 network for feature extraction;
[0086] In the backbone network, the acquired 640×640×3 image is used as input. Then, a basic layer ConvModule is used for preliminary feature extraction. In the ConvModule layer, k=3, s=2, p=1, k is the convolution kernel size, s is the stride of the convolution operation, and p is the number of zeros padded around the kernel to obtain a 320×320×64×w feature map P0.
[0087] Then, features are further extracted through multiple stages of SE-C2F feature extraction layers. Each stage module contains multiple convolutional layers, activation functions, and connection operations, which effectively realizes feature extraction and fusion, and successively obtains feature maps P2, P3, P4, and P5.
[0088] The feature maps are then fused through the SPPF feature fusion layer and input into the neck network of the CA-YOLOv8 model.
[0089] In the SE-C2F module, the feature maps are first downsampled or pre-processed by ConvModule, and then processed through multiple CSP branches. One branch (residual branch) is directly connected to the output of another branch for concatenation. The other branch undergoes multiple convolutions to concatenate the feature maps of the two branches along the channel dimension. Then, the concatenation is input into the channel attention module SE for processing, and finally, it is fused through a convolutional layer.
[0090] SENet (Squeeze-and-Excitation Network) is a classic channel attention mechanism, such as... Figure 2 As shown, its main structure consists of three parts: Squeeze, Excitation, and Scale operations. Figure 3 As shown, compression refers to processing the W×H×C feature map using a global pooling layer to output a 1×1×C feature map; for example... Figure 4 As shown, the activation process consists of two fully connected layers, where SERatio is a scaling parameter designed to reduce the number of channels and thus decrease computational cost. The first fully connected layer has C*SERatio neurons, with an input of 1×1×C and an output of 1×1×C×SERadio. The second fully connected layer has C neurons, with an input of 1×1×C×SERadio and an output of 1×1×C. The final scaling operation involves multiplying the channel weights. The original feature vector is W×H×C; the channel weight values calculated by the SE module are multiplied by the corresponding two-dimensional matrices of the original feature map, and the result is output.
[0091] Here we can derive the properties of the SE module:
[0092] Parameter quantity = 2 × C × C × SERatio
[0093] Computational complexity = 2 × C × C × SERatio
[0094] Overall, the SE module will increase the total number of network parameters and the total computational cost. Although the computational cost of fully connected layers is not much larger than that of convolutional layers, the number of parameters will increase significantly.
[0095] Therefore, in the SE-C2F module, such as Figure 5 and Figure 6 As shown, by introducing the SENet channel attention mechanism, the input feature map F is processed. MaxPooling and AvgPooling are applied at each spatial location to obtain two C×1×1 vectors. For example, if C = 512, then two 512×1×1 vectors are obtained. These two vectors are fed into an MLP containing two fully connected (FC) layers. The first FC layer reduces the dimension to C / r. For example, if r = 16, then it is reduced to 32 dimensions. The second FC layer increases the dimension to C, resulting in the channel attention CAM. The CAM is multiplied by the original feature map F to obtain the weighted feature map F'. Then, F' is concatenated with the residual branch in the CSP module in terms of channel dimensions. For example, if the dimension of F' is 512×H×W and the dimension of the residual branch is 256×H×W, then the concatenated dimension is 768×H×W. Finally, a 3×3 convolutional layer is used for feature fusion to obtain the output of the SE-C2F module, with a dimension of 512×H×W. The process is represented as follows:
[0096]
[0097] In the formula, F is the input feature map, AvgPool(·) and MAXPool(·) are the average pooling and max pooling functions, respectively, MLP(·) is the multilayer perceptron processing function, and W0(·) and W1(·) are the weights of the input layer and the hidden layer, and the weights from the hidden layer to the output layer, respectively. This indicates that the input feature map F undergoes average pooling of the c channels. This indicates that the input feature map F undergoes c-channel max pooling, and σ(·) represents the activation function ReLU.
[0098] S3. The output of the backbone network is passed to the neck network for further feature fusion.
[0099] In the Neck network, the output feature maps from multiple SE-C2F modules in the backbone network are first received and concatenated using the Concat module to form a feature map containing richer information. The concatenated feature map is then further input into the next SE-C2F module for deeper feature extraction. In some paths, the feature map is upsampled using the Upsample module to match the resolution of feature maps from other paths, ensuring effective fusion of feature information at different scales.
[0100] The feature map fused from S4 and neck is input into the detection head of the CA-YOLOv8 model for processing, and the detection head generates the detection results. The head network uses a "decoupled head" which is responsible for predicting the target's category and bounding box.
[0101] S5. Establish the loss function for the CA-YOLOv8 model, train the CA-YOLOv8 model, and use the trained CA-YOLOv8 model for real-time human fall detection in residential settings. To improve the detection accuracy of the YOLOv8 algorithm in fall detection, the pose loss (PoseLoss) is introduced into the YOLOv8 network for network training or as a weighted loss function. Higher weights can be assigned to the bounding boxes of fall categories, thereby increasing the model's focus on the fall target. This allows the model to concentrate more on learning fall behavior, enhancing its ability to detect fall behavior.
[0102] Human fall detection requires accurate identification of changes in human posture, which may involve introducing posture loss or motion recognition loss.
[0103] Pose loss is introduced to enhance the ability to recognize pose changes.
[0104] Given n distinct pose classes, each sample predicts its pose class in each grid cell using an anchor box. Let p be the ground truth pose class of the i-th sample. i,j The probability that the i-th sample belongs to the j-th pose category is predicted by the model (logits are usually converted to probabilities through softmax).
[0105] The formula for the Cross-Entropy Loss function is as follows:
[0106] Represented as:
[0107]
[0108] In the formula, N is the number of samples; t i,jLet t be a one-hot vector representing the true label. For example, if the true pose class of the i-th sample is class 2, then t i,j=2 =1, other t i,j =0; p i,j This refers to the model's predictions. Typically, the model's output logits are converted into a probability distribution using a softmax function.
[0109]
[0110] Among them, F i,j It is the logits of the i-th sample in the model output that belong to the j-th pose category.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for detecting human falls in the home based on an improved version of YOLOv8, characterized in that: The method is based on the YOLOv8 network model and incorporates a channel attention mechanism to establish an improved CA-YOLOv8 network for human fall detection. It includes the following steps: S1. Obtain the dataset, annotate the dataset using annotation tools, and divide the dataset according to a preset ratio; S2. Input the acquired image data into the backbone network of the CA-YOLOv8 model for multi-scale feature extraction. In step S2, the acquired image is used as input in the backbone network, and then a basic layer ConvModule is used for preliminary feature extraction to obtain feature map P0. Then, features are further extracted through multiple stages of SE-C2F feature extraction layers. Each stage module contains multiple convolutional layers, activation functions, and connection operations, resulting in feature maps P2, P3, P4, and P5. The feature maps are then fused by the SPPF feature fusion layer and input into the neck network of the CA-YOLOv8 model; In the SE-C2F module, the feature maps are first downsampled or pre-processed by ConvModule, and then processed by multiple CSP branches. One branch, the residual branch, is directly connected to the output of another branch for concatenation. The other branch undergoes multiple convolutions to concatenate the feature maps of the two branches in the channel dimension. Then, the feature maps are input into the channel attention module SE for processing, and finally fused by a convolutional layer. In the SE-C2F module, the input feature map F is processed by introducing the SENet channel attention mechanism. MaxPooling and AvgPooling are applied at each spatial location to obtain two C×1×1 vectors. These two vectors are fed into an MLP containing two fully connected (FC) layers. The first FC layer reduces the dimension to C / r; the second FC layer increases the dimension to C, resulting in a channel attention (CAM). Multiply CAM by the original F to obtain the weighted F'; then concatenate F' with the residual branch in the CSP module along the channel dimension. Finally, a convolutional layer is used for feature fusion to obtain the output of the SE-C2F module; The process is represented as follows: In the formula, F is the input feature map. These are the average pooling and max pooling functions, respectively. This is a multi-layer sensing processing function. These represent the weights of the input layer and hidden layer, and the weights from the hidden layer to the output layer, respectively. This indicates that the input feature map F undergoes average pooling of the c channels. This indicates that the input feature map F undergoes c-channel max pooling. Represents the activation function ReLU; S3. The output of the backbone network is passed to the neck network for further feature fusion; In step S3, in the neck network, the output feature maps of multiple SE-C2F modules in the backbone network are received and spliced by the Concat module; The stitched feature maps are then fed into the next SE-C2F module for deeper feature extraction. Some feature maps are upsampled by the Upsample module to ensure effective fusion of feature information at different scales. The feature map after S4 and neck fusion is input into the detection head of the CA-YOLOv8 model for processing, and the detection head generates the detection result; S5. Establish the loss function of the CA-YOLOv8 model, train the CA-YOLOv8 model, and use the trained CA-YOLOv8 model to perform real-time detection of human falls in residential settings.
2. The method for detecting human falls in the home based on YOLOv8 as described in claim 1, characterized in that: In step S1, various datasets are extracted from videos of people's home activities by frame extraction. Each image is labeled using a labeling tool such as LabelImg, and the labeling information includes normal activities and falling behavior. The labeled images are then randomly divided into training and validation sets according to a preset ratio.
3. The method for detecting human falls in the home based on YOLOv8 as described in claim 2, characterized in that: In step S4, the head network uses a "decoupled head" to predict the target's category and bounding box.
4. The method for detecting human falls in the home based on YOLOv8 as described in claim 3, characterized in that: In step S5, the pose loss is introduced into the CA-YOLOv8 network for network training or a weighted loss function. Higher weights are assigned to the bounding boxes of the fall category to increase the model's focus on the fall target. The pose loss, which enhances the ability to recognize pose changes, uses the cross-entropy loss function, expressed as: In the formula, N is the number of samples; This is a one-hot vector representing the true label; This is the model's prediction. The model's original output score, logits, is transformed into a probability distribution using the softmax function, i.e.: in, It is the first output of the model The sample belongs to the first Logits for each pose category.