Fall behavior detection method and system and storage medium thereof
By improving the YOLOv5s+ algorithm model and combining the C3GC global attention mechanism, SIoU loss function, and decoupling head, the problems of low accuracy and easy false detection in the detection of fall behavior of elderly people at home are solved, and high-precision detection is achieved in occluded and complex environments.
Patent Information
- Application Number
- CN202510521502.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-11-21
AI Technical Summary
In existing technologies, the accuracy of fall detection for elderly people living at home is low, and it is prone to false positives and false negatives, especially in indoor obstructed and complex environments.
An improved YOLOv5s+ algorithm model is adopted, which combines the C3GC global attention mechanism, SIoU loss function and decoupling head to enhance feature extraction and target localization capabilities. The model is trained by constructing an indoor human occlusion dataset.
It improves the accuracy and robustness of fall detection, especially significantly enhancing detection precision in obstructed and complex environments, reducing false detection rates, and meeting the safety monitoring needs of elderly people living at home.
Smart Images

Figure CN120997898A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of target detection and image recognition, in particular to a fall behavior detection method and system and a storage medium thereof. BACKGROUND
[0002] With the growth of age, the ability of the elderly to control body movement steadily is gradually weakened, which leads to an increase in body imbalance and thus increases the risk of falling. Therefore, it is necessary to solve the problem of low detection accuracy of fall behavior of home-dwelling elderly and easy misjudgment and missed detection. SUMMARY
[0003] To solve the problems mentioned in the background, the purpose of the present application is to provide a fall behavior detection method, system and storage medium thereof.
[0004] In a first aspect, the purpose of the present application can be achieved by the following technical solution: a fall behavior detection method, the method comprising the following steps:
[0005] Obtaining a to-be-processed image, based on a pre-established YOLOv5s+ algorithm model, after the to-be-processed image is input based on an Input layer, the to-be-processed image is subjected to slicing operation by Backbone, and then is processed by a convolution layer and a pooling layer to obtain a processed image;
[0006] The pre-established YOLOv5s+ algorithm model extracts features from the processed image to obtain extracted features, and the extracted features are subjected to detection processing by Head to output a fall behavior detection result.
[0007] In combination with the first aspect, in some implementation manners of the first aspect, the method further comprises: the acquisition process of the to-be-processed image comprises: using a camera to acquire standing, squatting and falling images of a detected person as the to-be-processed image.
[0008] In combination with the first aspect, in some implementation manners of the first aspect, the method further comprises: when the pre-established YOLOv5s+ algorithm model extracts features from the processed image, the extraction is performed by a C3GC global attention mechanism module.
[0009] In combination with the first aspect, in some implementation manners of the first aspect, the method further comprises: a C3 layer of the C3GC global attention mechanism module is composed of a 1x1 convolution, a Bottleneck module, a cross-layer connection and feature fusion, the extracted input features are divided into two groups by the C3 layer, one group is directly passed through the Bottleneck module, the Bottleneck module is composed of a plurality of convolution layers and a cross-layer connection, the other group is subjected to convolution module, the cross-layer connection enables the input features to be directly transmitted to an output layer, and then the two output features are fused to obtain the extracted features.
[0010] With reference to the first aspect, in some implementations of the first aspect, the method further includes that the GC Block global context module of the C3GC global attention mechanism module is composed of three parts of context modeling, feature conversion and feature aggregation, and an expression of the GC Block is as follows.
[0011]
[0012] In the formula, Z i represents the feature representation output by the Z i th position, and the result after processing by the global context module, W v2 represents the weight matrix of the second 1x11x1 convolution, ReLU represents the rectified linear unit activation function, and LN represents layer normalization (Layer Normalization) for stabilizing the training process. W v1 represents the weight matrix of the first 1x11x1 convolution for feature conversion. The attention weight of the jth position is calculated, where W k is a weight matrix for generating an attention score, and x j is a feature vector of the input feature map at the jth position.
[0013] The GC Block extracts the attention weight by using the 1x1 convolution and the softmax function, realizes the attention modeling by matrix multiplication, and performs global average pooling on the feature map.
[0014] With reference to the first aspect, in some implementations of the first aspect, the method further includes that the loss function of the pre-established YOLOv5s+ algorithm model includes a classification loss, a positioning loss and a confidence loss, and a loss function calculation formula of the YOLOv5s is as follows:
[0015] L = L bbox + L cls + L obj (2)
[0016] Wherein, L is a loss function, L bbox is a bounding box regression loss function, L cls is a classification loss function, and L bbox is a confidence loss function.
[0017] With reference to the first aspect, in some implementations of the first aspect, the method further includes that the pre-established YOLOv5s+ algorithm model uses L CIoU to measure the loss of the rectangular frame, and the IoU is the intersection over union, and the calculation formula is as follows:
[0018]
[0019] L IoU = 1 - IoU (4)
[0020] wherein S1 represents a real box region, and S2 represents a predicted box region.
[0021] In the formula,
[0022] L CIoU The calculation formula is as follows:
[0023]
[0024] wherein d is the distance between the center points of the predicted box and the real box, c is the diagonal distance of the minimum circumscribed rectangle, and a is a weight function; the calculation formula of a is as follows:
[0025]
[0026] v is a correction factor, which considers the shape and direction of the target box, and the calculation formula is as follows:
[0027]
[0028] wherein w G and h G represent the width and height of the real box, and w P and h P are the width and height of the predicted box.
[0029] In combination with the first aspect, in some implementations of the first aspect, the method further comprises: the L CIoU Scale invariance is introduced, and the formula is as follows:
[0030]
[0031] wherein Ω is a shape loss, and Δ is a distance loss, which redefines the distance cost and considers the angle cost, and the definitions are as follows:
[0032]
[0033] γ = 1 - 2Λ (12)
[0034]
[0035] In the formula, θ represents the attention value for controlling the shape cost, x is the angle of the predicted bounding box, y is the angle of the real bounding box, Λ is an angle loss, which represents the angle difference between the predicted box and the real box, c h is the coordinate difference of the center points of the real box and the predicted box on the y-axis, and γ is a sensitivity index.
[0036] In a second aspect, to achieve the above object, the application discloses a fall behavior detection system, comprising:
[0037] An image processing module is configured to acquire a to-be-processed image, and perform slicing operation on the to-be-processed image based on an Input layer input and a Backbone after the to-be-processed image is input based on a pre-established YOLOv5s+ algorithm model, and then perform processing through a convolution layer and a pooling layer to obtain a processed image.
[0038] A fall behavior detection module is configured to perform feature extraction on the processed image based on the pre-established YOLOv5s+ algorithm model, perform detection processing on the extracted features through a Head, and output a fall behavior detection result.
[0039] In another aspect of the application, to achieve the above object, a computer readable storage medium is disclosed, the computer readable storage medium stores a computer program, and the computer program is loaded and executed by a processor.
[0040] The application has the following beneficial effects:
[0041] The application optimizes the YOLOv5s network, and in addition to training the model based on the constructed indoor human occlusion dataset, a C3GC global attention mechanism based on a GC Block is constructed to help the model capture global context information, so that the model better understands the relationship between the target in the image and its environment, enhances the feature extraction capability of the Backbone, and thus improves the detection accuracy; the loss function is replaced by SIoU, so that the model can more accurately evaluate the overlapping area between the predicted frame and the real frame, thereby improving the accuracy of target positioning; meanwhile, a decoupling head is introduced, which separates the classification and regression tasks, so that the model can more effectively learn the key features of each task, thereby improving the detection accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, brief introductions will be given to the drawings needed to be used in the embodiments or prior art descriptions. Obviously, for those skilled in the art, other drawings can also be obtained from these drawings without creative labor;
[0043] Figure 1 is a method flowchart of the application;
[0044] Figure 2is a schematic diagram of the YOLOv5s structure of the present application;
[0045] Figure 3 is a schematic diagram of the YOLOv5s+ network structure of the present application;
[0046] Figure 4 is a schematic diagram of the C3 structure of the present application;
[0047] Figure 5 is a schematic diagram of the GC Block structure of the present application;
[0048] Figure 6 is a schematic diagram of the GCC3 structure of the present application;
[0049] Figure 7 is a schematic diagram of the IoU structure of the present application;
[0050] Figure 8 is a schematic diagram of the decoupling head structure of the present application;
[0051] Figure 9 is a schematic diagram of the partial human fall behavior detection image display of the present application;
[0052] Figure 10 is a schematic diagram of the detection comparison of YOLOv5s and YOLOv5s+ of the present application;
[0053] Figure 11 is a schematic diagram of the system structure of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0055] Embodiment one:
[0056] As shown in Figure 1 , the fall behavior detection method comprises the following steps:
[0057] S101: acquiring a to-be-processed image, and after the to-be-processed image is input based on the Input layer in the pre-established YOLOv5s+ algorithm model, performing slicing operation by Backbone, and then performing processing by convolution layer and pooling layer, obtaining a processed image;
[0058] The acquisition process of the to-be-processed image comprises: using a camera to acquire standing, squatting and falling images of a detected person as to-be-processed images.
[0059] The pre-established YOLOv5s+ algorithm model extracts the processed image through a C3GC global attention mechanism module.
[0060] The C3 layer is a network structure module used in target detection. It is composed of 1x1 convolution, bottleneck module, cross-layer connection (Residual Connection) and feature fusion. In YOLOv5, the C3 layer is constructed through a series of convolution operations and bottleneck modules. The input features are divided into two groups by the C3 layer, one of which directly passes through a bottleneck module, and each bottleneck module is composed of multiple convolution layers and cross-layer connections for extracting high-level features. The input features are directly added to the output features to facilitate the flow of features and prevent gradient disappearance. The other group is processed through the convolution module. Cross-layer connection allows input features to be directly transmitted to the output layer to facilitate the flow of features. Finally, the output features of the two bottleneck modules are fused, usually through concatenation. The final output features contain features processed through different paths, enhancing the diversity and expression ability of the features.
[0061] A global context module GC block is proposed. In the YOLO algorithm, GCBlock is a module used to enhance feature representation, which aims to capture global context information to help the network better understand the content of the entire image, thereby improving the accuracy and robustness of detection.
[0062] The GC Block is composed of three parts: context modeling, feature transformation and feature aggregation. The GC Block expression is as follows.
[0063]
[0064] In the formula, Z i represents the feature representation output at the Z i th position, W v2 represents the weight matrix of the second 1x11x1 convolution, ReLU represents the rectified linear unit activation function, LN represents layer normalization, and W v1 represents the weight matrix of the first 1x11x1 convolution, The attention weight of position j is calculated, where W k is the weight matrix used to generate attention scores, x jis the feature vector of the input feature map at the jth position;
[0065] The GC Block extracts attention weights using a 1x1 convolution and a softmax function, realizes context modeling through matrix multiplication, performs global average pooling on the feature map, and compresses the entire feature map into a vector that contains information about the entire feature map. This step enables the network to understand the relationship between global context and local features, thereby producing more rich global information. Layer normalization (LayerNorm+ReLU) is introduced in the two 1x1 convolutions to realize feature transformation, and finally the locally reweighted feature map is fused with the original feature map in an additive manner through Fusion to enhance the model's understanding of global context. The GC Block structure diagram is shown in Figure 5 where C is the number of channels of the feature map, H and W are the height and width of the feature map, and r is the channel compression ratio.
[0066] The Backbone part of YOLOv5 is used for preliminary processing and feature extraction of the input image, especially shallow features. Shallow features that are easily overlooked are difficult to extract when the network structure is deep. In this paper, based on YOLOv5s, GC Block is fused with the C3 structure of Backbone, and a new structure C3GC global attention mechanism is proposed.
[0067] GC Block can generate rich feature maps with fewer parameters, which helps the network to maintain performance while more efficiently capturing more detailed information. C3 can effectively enhance the transmission and fusion of features through its unique Partial DenseBlock structure, and after fusion, the network can simultaneously utilize the feature generation capability of GC block and the feature fusion capability of C3 to improve the overall feature expression capability.
[0068] S102: The pre-established YOLOv5s+ algorithm model extracts features from the processed image, and outputs the fall behavior detection result after detection processing by Head.
[0069] The loss function of YOLOv5s includes classification loss, positioning loss, and confidence loss. The loss function calculation formula of YOLOv5s is:
[0070] L=L bbox +L cls +L obj (2)
[0071] where L is the loss function, Lbbox For the bounding box regression loss function, L cls For the classification loss function, L bbox For the confidence loss function. L CIoU is used in yolov5s to measure the loss of rectangular frames, L CIoU is an improved version of YOLOv4 based on the original L IoU It takes into account the complete intersection between target frames and introduces a correction factor to more accurately measure the similarity between target frames. L CIoU The calculation method of L IoU is more complex than the traditional L
[0072] IoU is the intersection over union, which is the ratio between the target frame and the predicted frame. The value of IoU is between 0 and 1, 0 means no overlap, 1 means complete overlap, which can reflect the detection effect of the predicted detection frame and the real detection frame.
[0073]
[0074] L IoU = 1 - IoU (4)
[0075] Where S1 represents the real frame area, and S2 represents the predicted frame area.
[0076] L CIoU The loss function takes into account the shape information of the target frame in the design, and by introducing a correction factor, the loss is more robust to target frames of different shapes. This makes it easier for the model to capture the accurate shape of the target.
[0077]
[0078] Where d is the distance between the center points of the predicted frame and the real frame, c is the diagonal distance of the minimum enclosing rectangle, and α is the weight function:
[0079]
[0080] ν is the correction factor, which is used to further adjust the loss function and consider the shape and direction of the target frame:
[0081]
[0082] Where w G and h G represent the width and height of the real frame, and w P and h P are the width and height of the predicted frame.
[0083] LCIoU Although it considers the overlap area, center point distance, and aspect ratio differences between the predicted and ground truth bounding boxes, it is sensitive to scale changes. L... SIoU By introducing scale invariance, the loss function behaves more consistently across boxes of different scales.
[0084]
[0085] Where Ω represents shape loss and Δ represents distance loss, the distance cost is redefined and angular cost is considered, as follows:
[0086]
[0087] γ=1-2Λ (12)
[0088]
[0089] In the formula, θ represents the focus value controlling shape cost, x is the angle of the predicted bounding box, and y is the angle of the ground truth bounding box. Λ is the angle loss, representing the angle difference between the predicted and ground truth boxes, and c h γ is the difference in coordinates between the center points of the ground truth bounding box and the predicted bounding box on the y-axis, γ is the sensitivity index, which adjusts the sensitivity of the loss function to targets of different sizes, and ρ represents the Euclidean distance between the centers of the predicted and ground truth bounding boxes.
[0090] L SIoU By introducing scale invariance, the loss function behaves more consistently across boxes of different scales. In some cases, the size and scale of the anchor points can affect the L... CIoU The calculation of the loss function has a significant impact. SIoU By reducing this influence, the loss function focuses more on the essential differences between the predicted and ground truth boxes, which is particularly important for improving the detection performance of targets of different sizes. Meanwhile, L SIoU The design aims to provide more stable gradients, especially in the early stages of training and when the predicted bounding boxes do not overlap with the ground truth boxes. This helps the model converge faster and reduces oscillations during training. Therefore, this paper replaces the loss function with L... SIoU .
[0091] The YOLOv5s algorithm uses a coupled prediction head in target detection, which places the classification task and the regression task in the same detection head. However, during the training process, the two tasks often conflict, resulting in reduced detection accuracy and slower convergence speed of the model. In the target detection task, class classification and bounding box regression are usually required simultaneously. The decoupled head design can optimize these two tasks separately, allowing the network to better learn the different features of classification and positioning. In multi-task learning, there may be interference between different tasks. The decoupled head design helps to reduce the mutual interference between tasks, allowing each task to be better trained in its dedicated head network. Therefore, this paper introduces the decoupled head in YOLOv5s.
[0092] The introduced decoupled head contains a 1x1 conversion layer, two parallel branches, and each branch has two 3x3 convolution layers. First, the human fall state map output by the backbone network is input to the decoupled head, and a 1x1 conversion layer is used to reduce the feature channels to 256. Then, two convolution layers are used as two parallel branches, one for the classification task of the human fall state map, and the other for the regression task of the human fall state map. After replacement, the network can better solve the conflict between classification and regression tasks, improving the accuracy of target detection.
[0093] Specifically, the following embodiments further illustrate the present application:
[0094] Data set collection and production
[0095] To reduce the problem of missed detection and false detection caused by partial occlusion of the human torso and squatting and bending in the home environment, in addition to using the network public data set of 4500 images, this paper also occludes part of the human torso in the home environment, and self-made occlusion data set of 3000 images, labeled in LabelImg, with labels of "up", "down", and "bending". The data set is divided into a training set in the ratio of 8:2. Part of the indoor human behavior images are shown in Figure 9 .
[0096] The experiment uses a computer Window 11x64 operating system, the GPU used for training is an RTX4060 graphics card with 16G of video memory, the training model uses Python 3.8, the Pytorch version is 1.8.0, and the Cuda version is 11.6.0. The image size (Img-Size) is set to 640x640, the batch size (Batch-Size) is set to 16, the number of rounds (Epochs) is set to 200 rounds, the initial learning rate is set to 0.01, and the best training model is determined according to the evaluation index when the training is completed.
[0097] Evaluation index
[0098] The evaluation index uses the accuracy P, the recall rate R and the average precision mean mAP to evaluate. Among them, P is used to measure the accuracy of the model detection, the greater the accuracy, the more accurate the class detection, the recall rate is used to measure the comprehensiveness of the detection, and the average precision mean is averaged after the single-class precision AP is summed. The greater the average precision mean mAP, the higher the overall precision of the model. The calculation formula is as follows:
[0099]
[0100]
[0101] In the formula, TP (True Positives) is the number of correct identification, FP (False Positives) is the number of false identification, and FN (PalseNegatives) represents the number of positive samples identified as negative samples.
[0102] Ablation experiment
[0103] The purpose of the ablation experiment is to verify the optimization effect of each improved module. Taking YOLOv5s model as the benchmark, √ indicates the introduction of the improved module, and the ablation experiment results are as follows.
[0104] Table 1 Comparison of ablation experiment results
[0105]
[0106] In the second group of experiments, in the original YOLOv5s, the GC Block is fused with the C3 structure of the Backbone part to form a new structure C3GC global attention mechanism, which helps the model to capture global context information, which helps the model to better understand the relationship between the target and its environment in the image, and enhances the feature extraction ability of the backbone network, thereby improving the detection accuracy. The average precision mean (mAP) is improved to 93.2%, which shows that the fusion of C3GC global attention mechanism plays an important role in improving the average precision of the model.
[0107] In the third group of experiments, the original YOLOv5s loss function is replaced by the SIOU loss function, and the average precision mean (mAP) is significantly improved to 93.4%, which shows that the SIOU loss function optimizes the bounding box regression by introducing more geometric factors, so that the model can more accurately evaluate the overlapping area between the predicted box and the real box, improve the detection performance of targets of different sizes, and have obvious effect on improving the precision of target positioning.
[0108] In the fourth group of experiments, the recall rate increased to 89.5% by introducing the decoupling head, indicating that the introduction of the decoupling head can make the model learn key features more effectively by separating classification and regression tasks, enabling the model to learn key features for each task more effectively, successfully resolving the conflict between classification and regression tasks, and enabling them to work better together.
[0109] From the ablation experiment results, the improved three modules all improve the overall accuracy of the model. In the fifth group of experiments, the C3GC global attention mechanism is introduced, the loss function is replaced with SIoU, and the decoupling head is introduced. The average precision of the model reaches the optimal value.
[0110] Comparison of detection effects before and after improvement
[0111] In order to more intuitively feel the on-site effect of the actual model in the detection process, some data set verification pictures and non-data set pictures are selected for comparison before and after model improvement. As shown in Figure 10 ;
[0112] It can be clearly observed that the accuracy of the YOLOv5s+ model in the person falling detection task has been significantly improved compared to the original YOLOv5 network. This improvement not only reflects the effectiveness of algorithm optimization, but also shows that YOLOv5s+ has higher reliability in handling actual scene falling events.
[0113] In the case of the person's torso being blocked, the image recognition ability of the YOLOv5s+ model has been uniformly and significantly improved compared to the original network. As can be seen from the figure, the recognition accuracy of YOLOv5s+ in handling occluded images is 11 percentage points higher than that of the original network, which fully proves the superior performance of the improved model in dealing with portrait occlusion scenarios.
[0114] In the complex road multi-person scene, YOLOv5s+ model also performs well, and can identify the falling behavior in complex scenes and the normal squatting action similar to falling with high accuracy. This indicates that YOLOv5s+ has high recognition ability in distinguishing different behaviors and feature extraction ability in complex scenes, effectively reducing the false positive rate.
[0115] In summary, the improved network has superior performance in terms of perception details and spatial modeling, and can more accurately capture the abnormal behavior of falling. This performance improvement not only effectively solves the problems of real-time detection and insufficient feature extraction of falling behavior detection, but also prevents the occurrence of events such as falling into a coma and being unable to be discovered and rescued in time, providing a strong guarantee for the safety of homebound elderly people. This research result further proves the superiority of the improved network in the task of homebound elderly fall detection. In practical applications, the YOLOv5s+ model can better meet the needs of family care, intelligent monitoring and other scenarios, providing an effective technical solution for the problem of home-based care for the aging society in China. With continuous optimization and popularization of technology, the YOLOv5s+ model is expected to play an important role in more fields and provide protection for people's life safety.
[0116] Embodiment two: in the second aspect, as Figure 11 shown, in order to achieve the above-mentioned purpose, the application discloses a fall behavior detection system, comprising:
[0117] An image processing module 11 is configured to acquire a to-be-processed image, and based on a pre-established YOLOv5s+ algorithm model, the to-be-processed image is input based on an Input layer, subjected to a slicing operation by a Backbone, and then processed by a convolution layer and a pooling layer to obtain a processed image.
[0118] A fall behavior detection module 12 is configured to perform feature extraction on the processed image by the pre-established YOLOv5s+ algorithm model, obtain extracted features, perform detection processing on the extracted features by a Head, and output a fall behavior detection result.
[0119] Based on the same inventive concept, the present application further provides a computer device, comprising: one or more processors, and a memory for storing one or more computer programs; the program comprises program instructions, and the processor is configured to execute the program instructions stored in the memory. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, and are configured to implement one or more instructions, and are specifically configured to load and execute one or more instructions in the computer storage medium to implement the above method.
[0120] It needs to be further explained that, based on the same inventive concept, the present application further provides a computer storage medium, which stores a computer program, and the computer program is executed by the processor to perform the above method. The storage medium can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electrical, magnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.
[0121] In the description of the present application, the description of the terms "one embodiment", "an example", "a specific example" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in one or more embodiments or examples.
[0122] The foregoing presents and describes the basic principles, main features and advantages of the present disclosure. It should be understood by those skilled in the art that the present disclosure is not limited to the above-mentioned embodiments, and the above-mentioned embodiments and descriptions in the specification are only to illustrate the principles of the present disclosure. Without departing from the spirit and scope of the present disclosure, various changes and improvements can be made to the present disclosure, and all these changes and improvements fall within the scope of the present disclosure.
Claims
1. A fall behavior detection method, characterized by, The method comprises the following steps: An image to be processed is acquired, and after the image to be processed is input into a pre-established YOLOv5s+ algorithm model based on an Input layer, slice operation is performed on the image to be processed by a Backbone, and then the image to be processed is processed by a convolution layer and a pooling layer to obtain a processed image; The pre-established YOLOv5s+ algorithm model performs feature extraction on the processed image to obtain extracted features, and the extracted features are detected by a Head to output a fall behavior detection result.
2. The fall behavior detection method according to claim 1, characterized in that, The acquisition process of the image to be processed comprises: acquiring standing, squatting and falling images of a person to be detected by using a camera as the image to be processed.
3. The fall behavior detection method according to claim 1, characterized by, When the pre-established YOLOv5s+ algorithm model performs feature extraction on the processed image, the feature extraction is performed by a C3GC global attention mechanism module.
4. The fall behavior detection method according to claim 3, characterized in that, The C3 layer of the C3GC global attention mechanism module is composed of a 1x1 convolution, a Bottleneck module, cross-layer connection and feature fusion, the input features are divided into two groups by the C3 layer, one group is directly processed by the Bottleneck module, the Bottleneck module is composed of a plurality of convolution layers and cross-layer connection, and the other group is processed by a convolution module, the cross-layer connection enables the input features to be directly transmitted to an output layer, and then the two output features are fused to obtain the extracted features.
5. The fall behavior detection method according to claim 4, characterized in that, The GC Block global context module of the C3GC global attention mechanism module is composed of three parts of context modeling, feature conversion and feature aggregation, and the expression of the GC Block is as follows: In the formula, Z i represents the feature representation output by the Z i th position, and the result after processing by the global context module, W v2 represents the weight matrix of the second 1×11×1 convolution, ReLU represents the rectified linear unit activation function, LN represents layer normalization, W v1 represents the weight matrix of the first 1×11×1 convolution, The attention weight of the jth position is calculated, wherein W k is the weight matrix for generating the attention score, x j is the feature vector of the input feature map at the jth position; The GC Block adopts 1x1 convolution and a softmax function to extract attention weights, and attention modeling is realized by matrix multiplication to perform global average pooling on the feature map.
6. The fall behavior detection method according to claim 3, characterized by, The loss function of the pre-established YOLOv5s+ algorithm model comprises a classification loss, a positioning loss and a confidence loss, and the loss function calculation formula of YOLOv5s is as follows: L = L bbox + L cls + L obj (2) wherein L is a loss function, L bbox is a bounding box regression loss function, L cls is a classification loss function, L bbox is a confidence loss function.
7. The fall behavior detection method according to claim 6, characterized in that, The pre-established YOLOv5s+ algorithm model adopts L CIoU The loss of the rectangular frame is measured by IoU, and the calculation formula of IoU is as follows: L IoU = 1 - IoU (4) Wherein, S1 represents a real box region, and S2 represents a predicted box region. In the formula, L CIoU The calculation formula is as follows: Wherein, d is the distance between the center points of the predicted box and the real box, c is the diagonal distance of the minimum enclosing rectangle, and a is a weight function; the calculation formula of a is as follows: ν is a correction factor, which considers the shape and direction of the target box, and the calculation formula is as follows: where w G and h G are the width and height of the ground-truth box, respectively, while w P and h P are the width and height of the predicted box.
8. The fall behavior detection method of claim 7, wherein, The L CIoU Introducing scale invariance, the formula is as follows: Wherein, Ω is a shape loss, and Δ is a distance loss, the distance cost is redefined and the angle cost is considered, and the definition is as follows: γ=1-2Λ (12) In the formula, θ represents a concern value of a control shape cost, x is an angle of a predicted bounding box, y is an angle of a real bounding box; Λ is an angle loss, indicating an angle difference between a predicted box and a real box, c h is a coordinate difference of the real box and the predicted box center points on the y-axis, and γ is a sensitivity index.
9. A fall behavior detection system characterized by, The method comprises the following steps: An image to be processed is acquired, and after the image to be processed is input into a pre-established YOLOv5s+ algorithm model based on an Input layer, slice operation is performed on the image to be processed by a Backbone, and then the image to be processed is processed by a convolution layer and a pooling layer to obtain a processed image; The method comprises the following steps: A fall behavior detection module is configured to perform feature extraction on the processed image by the pre-established YOLOv5s+ algorithm model to obtain extracted features, and the extracted features are detected by a Head to output a fall behavior detection result.
10. A computer-readable storage medium having stored therein a computer program, characterized in that, The computer program is loaded and executed by the processor, and the fall behavior detection method in any one of claims 1 to 8 is adopted.