Improved YOLOX fall detection system

By introducing simAM and ECA attention modules into the YOLOX fall detection system and adopting the EIoU loss function, the problems of missed detection and low accuracy in complex scenarios are solved, and more efficient fall target detection is achieved.

CN116092179BActive Publication Date: 2026-05-01HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAIYIN INSTITUTE OF TECHNOLOGY
Filing Date
2022-11-28
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing fall detection systems suffer from missed detections and low detection accuracy in complex scenarios, especially in complex backgrounds, low light conditions, and occlusion situations, making it difficult to effectively detect falling targets.

Method used

In the YOLOX fall detection system, the simAM attention module and ECA channel attention module are introduced, and combined with the EIoU loss function, key information is extracted by improving the backbone network and feature fusion module, thereby improving the detection accuracy of the model.

Benefits of technology

It significantly improves the model's detection accuracy and recall in complex environments, effectively detects occlusion and small targets, and enhances the overall performance of fall detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116092179B_ABST
    Figure CN116092179B_ABST
Patent Text Reader

Abstract

An improved YOLOX fall detection system includes a backbone network, a feature fusion module, and a prediction head. The backbone network incorporates a simAM attention module, while the feature fusion module includes an ECA channel attention module. The system uses the EIoU loss function to calculate the difference between the predicted and ground truth bounding boxes. The specific steps for image detection are as follows: the input image undergoes uniform scaling preprocessing; then, it passes through a CSPlayer layer with residual structure and simAM attention mechanism, followed by a backbone network constructed from basic convolutions. Next, the feature fusion module with ECA attention mechanism further extracts feature information. Finally, the detection results are output through YOLOHead and displayed on the detected image. This invention, through its improved algorithm, significantly improves target detection performance in mAP, recall, precision, F1 score, and under complex environments. It effectively detects both complete and occluded fallen targets in blurred backgrounds and low-light conditions, improving the accuracy of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to an improved YOLOX fall detection system. Background Technology

[0002] In recent years, machine learning and deep learning algorithms have been widely applied in the field of fall detection. The currently commonly used fall detection architecture is the Convolutional Neural Network (CNN). A CNN is a feedforward neural network with a deep structure that includes convolutional computations. Its artificial neurons can respond to surrounding units within a certain coverage area, exhibiting excellent performance in large-scale image processing and is one of the representative algorithms of deep learning. Deep learning-based object detection algorithms are divided into two-stage and one-stage algorithms. Two-stage algorithms generate candidate bounding boxes in the first stage and classify and regress the content within the candidate bounding boxes in the second stage. Representative algorithms include R-CNN, SPP-Net, Fast R-CNN, and Faster R-CNN. One-stage algorithms do not directly generate candidate bounding boxes but treat the object detection task as a regression task on the entire image. Representative algorithms include the YOLO series. Among current convolutional neural network-based methods, the YOLO series of object detection methods performs well in object detection and has been widely used by researchers for fall detection.

[0003] To reduce injuries caused by falls, researchers both domestically and internationally have developed various fall detection systems in conjunction with current information technology research trends. Currently commonly used fall detection systems include remote fall detection systems based on smart homes, systems that utilize video images and acoustic signals, and sensor-based fall detection systems. However, these systems have many external limitations, hindering their widespread adoption in practical applications. Furthermore, their detection accuracy in complex scenarios is not high enough, sometimes even failing to detect the target. Summary of the Invention

[0004] To address the issues of missed detections and low detection accuracy in complex scenarios found in existing pedestrian fall detection algorithms, this invention proposes an improved YOLOX fall detection system. This system introduces a simAM attention module into the backbone network and adds an ECA channel attention module to the Bottleneck and feature fusion modules to further extract key information from the feature layer. The loss function uses EIoU, which more effectively calculates the difference between the predicted and ground truth bounding boxes, improving model accuracy. This effectively solves the aforementioned technical problems.

[0005] This invention is achieved through the following technical solution:

[0006] An improved YOLOX fall detection system is proposed, comprising a backbone network, a feature fusion module, and a prediction head. The backbone network incorporates a simAM attention module, while the feature fusion module includes an ECA channel attention module to further extract key information from the feature layer. The loss function uses EIoU, which more effectively calculates the difference between the predicted and ground truth bounding boxes, improving model accuracy. The specific steps for image detection are as follows: Step 1: Data Collection: Collect fall videos from public cameras. Extract different frames from each image as the dataset and label it using labelimg software. The ground truth bounding boxes are categorized into five types: stand, fall, sit, squat, and run. Training, validation, and test sets are also defined.

[0007] Step 2: Text preprocessing: Preprocess the collected image dataset, uniformly put the image path information of the training set and validation set into a TXT document, and specify the correct reading path text information and category information so that the model can read it;

[0008] Step 3: Building the training model: Constructing a YOLOX fall detection system with a CSPDarknet backbone network with residual structure and simAM attention mechanism. The uniformly scaled image is used as the input of the network, and the output of the backbone network is fed into the feature fusion module with ECA attention mechanism to further extract feature information. Finally, the detection result is output through YOLOHead.

[0009] Step 4: Model Training: Divide the processed dataset into training, validation, and test sets, and train the model using the constructed model to obtain the optimal weight model;

[0010] Step 5: Model Detection: Input the images or surveillance videos into the trained model for detection, label and locate the detected fallen targets, and issue alarm information.

[0011] Furthermore, the YOLOX fall detection system described in step three, which constructs a CSPDarknet backbone network with residual structure and simAM attention mechanism, introduces the simAM attention mechanism into the CSPDarknet backbone network. The simAM attention mechanism is introduced into the non-residual part of the CSP of the backbone network, that is, the part where multiple bottlenecks are superimposed and the final output part. This can deepen the network structure and further extract deeper feature information.

[0012] The simAM attention mechanism described is a parameter-free attention module. Based on neuroscience theory, it constructs an energy function to mine the importance of neurons, assigning each neuron a unique weight. An analytical solution for this is derived to accelerate computation. The final energy function is:

[0013]

[0014] in,

[0015]

[0016]

[0017]

[0018] In the above formula, t and x i The input features X∈R C×H×W The target neuron and other neurons in a single channel; i is the index in the spatial dimension, M = H × W is the number of neurons in that channel; w t and b t Both are transformations of weights and biases, μ t and σ t 2 It represents the mean and variance of all neurons except t;

[0019] Assuming all pixels in a single channel follow the same distribution, the mean and variance of all neurons can be calculated, and all neurons in that channel can be reused. Therefore, the minimum energy can be obtained by the following formula:

[0020]

[0021] The above formula implies that the lower the energy, the greater the difference between neuron t and surrounding neurons, and the higher its importance; therefore, the importance of a neuron can be determined by… We obtain the feature enhancement process using the sigmoid scaling operator, as shown in the following formula:

[0022]

[0023] Here, E is a grouping of e* across all channels and spatial dimensions of energy, and Sigmoid is used to limit the value of E to be too large so as not to affect the relative importance of neurons.

[0024] Furthermore, the simAM attention mechanism introduced in the multiple bottleneck stacking part involves first performing two convolutions on the input feature map, then using simAM to better extract the 3D attention weights and map them onto the feature layer, then adding the feature layers of the two branches, and finally using ECA attention to extract channel information and map it onto the feature layer.

[0025] Furthermore, the final output section introduces the simAM attention mechanism by dividing the input feature map into two branches, performing convolution on each branch separately, and passing the left branch through n bottlenecks after convolution. Then, the two branches are concatenated into one branch, and the concatenated feature layer is convolved. Finally, simAM is used to extract the three-dimensional weight information and map it onto the feature layer to output the final feature map.

[0026] Furthermore, the convolution process for each branch is as follows: first, the input feature layer is subjected to basic convolution, then three branches of global average pooling (5×5, 9×9, 13×13) and one invariant branch are applied respectively, then the results of the four branches are summed and convolved, and then simAM attention is used to extract three-dimensional weight information, further extracting important information and mapping it onto the feature layer for output.

[0027] Furthermore, the feature fusion module of the ECA attention mechanism described in step three introduces the simAM mechanism after the feature fusion algorithm after upsampling and downsampling in the feature fusion module. At the output end of the feature fusion module, the ECA attention mechanism is introduced after the three output feature layers.

[0028] Furthermore, the ECA attention mechanism learns effective channel attention with low model complexity. This module generates channel attention through fast 1×1 convolutions, and its kernel size can be adaptively determined through nonlinear mapping of channel size. Compared with other attention mechanisms, the ECA attention mechanism avoids dimensionality reduction and efficiently realizes local cross-channel interaction with 1-dimensional convolutions, extracting the dependencies between channels.

[0029] Furthermore, in step three, the output of the backbone network is fed into a feature fusion module with an ECA attention mechanism to further extract feature information. The specific steps are as follows: first, the input feature map undergoes global average pooling; then, a 1D convolution operation with a kernel size of k is performed, followed by a Sigmoid activation function to obtain the weights w for each channel, as shown in the following formula:

[0030] w = Sigmoid(C1D) k (X)) (8);

[0031] Among them, C1D represents one-dimensional convolution, k is the convolution kernel size, and x is the input feature map;

[0032] Finally, multiply the weights by the corresponding elements of the original input feature map to obtain the final output feature map.

[0033] Furthermore, the EIoU loss function contains three parts: overlap loss, center distance loss, and width-height loss. The first two parts follow the methods in CIOU; EIoU proposes a loss function that directly penalizes the prediction results of W and H, directly minimizing the difference between the width and height of the true box and the predicted box, making the convergence speed faster; the specific formula is:

[0034]

[0035] Among them, C w and C h are the width and height of the smallest bounding box covering the two boxes; ρ represents calculating the Euclidean distance between the two center points; b, b gt represent the center points of the predicted box and the true box respectively; w, w gt represent the widths of the true box and the predicted box respectively; h, h gt represent the heights of the true box and the predicted box respectively; c represents the diagonal distance of the smallest closed region that can contain both the predicted box and the true box.

[0036] Furthermore, the specific operation method of using the constructed model for training in step four is: perform mosaic data augmentation on the pictures in the training set, that is, read one image, and then randomly read three other images. Subsequently, these four images are spliced in the form of a "field" grid, and the label information of the spliced mosaic image is adjusted to further enhance the detection performance of small targets. And uniformly scale the pictures to 640×640×3 size, and the remaining part is filled with padding to solve the problem of image distortion.

[0037] Beneficial effects

[0038] An improved YOLOX fall detection system proposed by the present invention has the following beneficial effects compared with the prior art:

[0039] (1) In this technical solution, by introducing the simAM attention module in the backbone network and adding the ECA channel attention module in the Bottleneck and feature fusion modules, the key information of the feature layer is further extracted. The EIoU is used as the loss function, which can more effectively calculate the gap between the predicted box and the true box and improve the accuracy of the model.

[0040] (2) In this technical solution, when training the model, the images in the training set are enhanced with mosaic data. That is, one image is read and then three other images are randomly read. Subsequently, these four images are stitched together in a grid pattern and the label information of the stitched mosaic image is adjusted to further enhance the small target detection performance. The images are uniformly scaled to 640×640×3 and the remaining part is filled with padding to solve the image distortion problem. Attached Figure Description

[0041] Figure 1 This is a model architecture diagram of the improved YOLOX target detection method in this invention.

[0042] Figure 2 This is a flowchart of the improved YOLOX target detection method in this invention.

[0043] Figure 3 This is a diagram of the improved backbone network architecture in this invention.

[0044] Figure 4 This is an architecture diagram of the improved feature fusion module in this invention.

[0045] Figure 5 These are the loss curves for different loss functions used in the experiments of this invention.

[0046] Figure 6 This is a test result image of a fallen image against a complex background, as presented in the experiment of this invention.

[0047] Figure 7 This is a comparison of the detection results under low-light conditions in the experiment of this invention.

[0048] Figure 8 This is a comparison of the detection results of occluded targets in the experiment of this invention.

[0049] Figure 9 This is a comparison of the detection results for small targets in the experiments of this invention.

[0050] Figure 10 This is a comparison of the detection results of some targets in the experiment of this invention. Detailed Implementation

[0051] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described examples are only some examples of the present invention, and not all examples.

[0052] Example 1:

[0053] An improved YOLOX fall detection system is based on an improved YOLOX network structure, which includes a backbone network, a feature fusion module, and a prediction head.

[0054] Backbone Network: The YOLOX backbone network is CSPDarknet53. Taking a 640×640×3 image as input, it first passes through a Focus network structure, where a value is taken from every other pixel to obtain four independent feature layers. These four feature layers are then stacked to obtain a 320×320×12 feature layer. Next, convolutional normalization and SiLU activation are applied to obtain a 320×320×64 feature layer. Finally, four ResBlock operations are performed, consisting of basic convolutions and CSPlayers. In the final ResBlock, an SPP structure is used to increase the network's receptive field.

[0055] Enhanced Feature Fusion: YOLOX employs the PAN algorithm for feature fusion. The three feature layers extracted at the end of the backbone network are 80×80×256, 40×40×512, and 20×20×1024. By upsampling the deep feature layers and fusing them with the shallow feature layers, and then downsampling the shallow fused feature layers and fusing them with the deep feature layers, richer feature information is obtained, ultimately outputting three feature layers.

[0056] Prediction Header: Unlike previous versions of YOLO (where classification and regression were on the same convolution), YOLOX's prediction head is a simple decoupled head that separates classification and regression. It first performs a 1×1 convolution on the input feature layer to reduce the dimensionality of the channels, then two parallel branches, each containing two 3×3 convolutions, and finally outputs the classification and regression results respectively.

[0057] like Figure 1 As shown, the improved YOLOX fall detection system includes a backbone network, a feature fusion module, and a prediction head, as well as a simAM attention module introduced into the backbone network and an ECA channel attention module added to the feature fusion module to further extract key information from the feature layer; the loss function adopts EIoU, which can more effectively calculate the difference between the predicted box and the ground truth box, thereby improving the accuracy of the model.

[0058] like Figure 2 As shown, the specific steps for the improved YOLOX fall detection system to detect images are as follows: Step 1: Data acquisition;

[0059] We collected fall videos from public cameras, extracted different frames from each image to create an image dataset, and used the labelimg software to annotate the data. The ground truth bounding boxes were divided into five types: stand, fall, sit, squat, and run. We also divided the dataset into training, validation, and test sets.

[0060] The videos will primarily consist of surveillance footage from various public places and roads, with a total quantity exceeding 3,000. During the experiment, images of people falling, standing, sitting, running, and squatting in various public places can also be collected online as part of the dataset.

[0061] Step 2: Text preprocessing;

[0062] The collected image dataset is preprocessed, and the image path information of the training set and validation set is uniformly placed in a TXT document. The correct reading path text information and category information are specified so that the model can read them.

[0063] When labeling images, choose a bounding box that is appropriately sized for the target; it should not be too large or too small. The division of the training and validation sets should maintain a consistent data distribution as much as possible. For example, if the ratio of positive to negative samples in the training set is 2:1, the ratio in the validation set should also be 2:1.

[0064] Step 3: Build the training model;

[0065] A fall detection system for YOLOX is constructed using a CSPDarknet backbone network with residual structure and simAM attention mechanism. The uniformly scaled images are used as input to the network, and the output of the backbone network is fed into a feature fusion module with ECA attention mechanism to further extract feature information. Finally, the detection results are output through YOLOHead.

[0066] Building YOLOX's fall detection system involves the following steps:

[0067] Step 1: Introduce the simAM attention mechanism into the CSPDarknet backbone network to obtain an improved backbone network architecture. The improved backbone network architecture is achieved by introducing the simAM attention mechanism into the non-residual part of the CSP of the backbone network, that is, the part where multiple bottlenecks are superimposed and the final output part. This can deepen the network structure and further extract deep feature information.

[0068] The simAM attention mechanism described is a parameter-free attention module. Based on neuroscience theory, it constructs an energy function to mine the importance of neurons, assigning each neuron a unique weight. An analytical solution for this is derived to accelerate computation. The final energy function is:

[0069]

[0070] in,

[0071]

[0072]

[0073]

[0074] In the above formula, t and x i The input features X∈R C×H×W The target neuron and other neurons in a single channel; i is the index in the spatial dimension, M = H × W is the number of neurons in that channel; w t and b t Both are transformations of weights and biases, μ t and σ t 2 It represents the mean and variance of all neurons except t.

[0075] Assuming all pixels in a single channel follow the same distribution, the mean and variance of all neurons can be calculated, and all neurons in that channel can be reused. Therefore, the minimum energy can be obtained by the following formula:

[0076]

[0077] The above formula implies that the lower the energy, the greater the difference between neuron t and surrounding neurons, and the higher its importance; therefore, the importance of a neuron can be determined by… We obtain the feature enhancement process using the sigmoid scaling operator, as shown in the following formula:

[0078]

[0079] Here, E is a grouping of e* across all channels and spatial dimensions of energy, and Sigmoid is used to limit the value of E to be too large so as not to affect the relative importance of neurons.

[0080] Attention mechanisms are applied to the CSPlayer and SPP of the backbone network to further extract key information from the network, thereby improving detection accuracy. Specific improvements include... Figure 3 As shown.

[0081] Figure 3In the middle (a), there is a bottleneck in CSPlayer. The part where multiple bottlenecks are superimposed introduces the simAM attention mechanism. The input feature map is first convolved twice, and then simAM is used to better extract the 3D attention weights and map them onto the feature layer. Then the feature layers of the two branches are added together, and finally ECA attention is used to extract channel information and map it onto the feature layer.

[0082] Figure 3 In the middle (b), CSPlayer is used. The final output part introduces the simAM attention mechanism, which divides the input feature map into two branches, performs convolution on each branch, and the left branch goes through n bottlenecks after convolution. Then, the two branches are concatenated into one branch, and the concatenated feature layer is convolved. Finally, simAM is used to extract the three-dimensional weight information and map it onto the feature layer to output the final feature map.

[0083] Figure 3 (c) is the SPP module, used to increase the receptive field of the network. Convolution is performed on each branch separately. The convolution process is as follows: first, the input feature layer is subjected to basic convolution, then three branches of global average pooling (5×5, 9×9, and 13×13) and one invariant branch are applied respectively. The results of the four branches are then summed and convolved. SimAM attention is then used to extract the three-dimensional weight information, and important information is further extracted and mapped onto the feature layer for output.

[0084] The second step involves inserting a SimAM attention module in the middle of the feature fusion module to extract 3D weight information. This module's flexibility and effectiveness significantly improve the expressive power of many convolutions. An ECA attention module is added at the end to further extract channel information from the feature layers. The ECA attention mechanism is extremely simple in concept and operation, with minimal impact on network processing speed. Specifically... Figure 4 As shown.

[0085] The ECA attention mechanism learns effective channel attention with low model complexity. This module generates channel attention through fast 1×1 convolutions, and its kernel size can be adaptively determined by nonlinear mapping of channel size. Compared with other attention mechanisms, the ECA attention mechanism avoids dimensionality reduction and efficiently realizes local cross-channel interaction with 1-dimensional convolutions to extract the dependencies between channels.

[0086] The ECA attention mechanism feature fusion module introduces the simAM mechanism after the feature fusion algorithm after upsampling and downsampling in the feature fusion module. At the output of the feature fusion module, the ECA attention mechanism is introduced after the three output feature layers.

[0087] Figure 4The backbone network outputs three feature layers, from bottom to top: feat3, feat2, and feat1, which serve as the input layers for the feature fusion module.

[0088] After performing a 1×1 convolution to adjust the channels of the feature layer feat3 = (20,20,1024), P5 is obtained. P5 is then upsampled using UmSampling and combined with the feature layer feat2 = (40,40,512). Finally, csplayer_simAM is used to extract features to obtain P5_upsample, at which point the obtained feature layer is (40,40,512).

[0089] After performing a 1×1 convolution to adjust the channels of the feature layer P5_upsample=(40,40,512), P4 is obtained. After upsampling P4 with UmSampling, it is combined with the feature layer feat1=(80,80,256). Then, csplayer_simAM is used to extract features P3_out, and the resulting feature layer is (80,80,256).

[0090] The feature layer P3_out = (80, 80, 256) is downsampled by a 3×3 convolution. After downsampling, it is stacked with P4, and then csplayer_simAM is used to extract features P4_out. At this time, the feature layer obtained is (40, 40, 512).

[0091] The feature layer P4_out = (40, 40, 512) is downsampled by a 3×3 convolution. After downsampling, it is stacked with P5, and then CSPlayer is used to extract features P5_out. At this time, the feature layer obtained is (20, 20, 1024).

[0092] Finally, ECA attention is inserted after the outputs P3_out, P4_out, and P5_out to extract channel attention information and thus extract better features.

[0093] The output of the backbone network is then fed into a feature fusion module with ECA attention mechanism to further extract feature information. The specific steps are as follows: first, the input feature map is subjected to global average pooling; then, a 1D convolution operation with a kernel size of k is performed, and the weights w of each channel are obtained by passing the sigmoid activation function, as shown in the following formula:

[0094] w = Sigmoid(C1D) k (X)) (8);

[0095] Where C1D represents one-dimensional convolution, k is the kernel size, and x is the input feature map;

[0096] Finally, multiply the weights by the corresponding elements of the original input feature map to obtain the final output feature map.

[0097] The EIoU loss function consists of three parts: overlap loss, center distance loss, and width-height loss. The first two parts follow the methods in CIOU; EIoU proposes a loss function that directly penalizes the prediction results of W and H, directly minimizing the difference between the widths and heights of the true and predicted bounding boxes, resulting in a faster convergence speed. The specific formula is:

[0098]

[0099] where C w and C h are the width and height of the smallest enclosing box covering the two boxes; ρ represents the Euclidean distance between the centers of the two boxes; b, b gt represent the centers of the predicted box and the true box respectively; w, w gt represent the widths of the true box and the predicted box respectively; h, h gt represent the heights of the true box and the predicted box respectively; c represents the diagonal distance of the smallest closed region that can contain both the predicted box and the true box.

[0100] Step Four: Model training; divide the processed dataset into a training set, a validation set, and a test set, and use the constructed model for training to obtain an optimal weight model.

[0101] The specific operation method of using the constructed model for training is as follows: perform mosaic data augmentation on the images in the training set, that is, read one image, and then randomly read three other images. Subsequently, splice these four images in the form of a "field" grid, and adjust the label information of the spliced mosaic image to further enhance the performance of small target detection. Also, uniformly scale the images to 640×640×3 size, and fill the remaining part with padding to solve the problem of image distortion.

[0102] Step Five: Model detection;

[0103] Input the image or surveillance video into the trained model for detection, label and locate the detected fall targets, draw the predicted bounding box on the original image according to the predicted two coordinate point information using matplotlib, and display the behavior of the target with text. If a fall target is detected, output a fall warning message.

[0104] To verify the performance advantages of the system, the inventor conducts experimental verification on the above system and analyzes the experimental results; the specific experiments and analyses are as follows:

[0105] Experimental environment

[0106] The experiment was conducted under the Windows 10 operating system for training and testing. GPU computing was used, specifically an RTX 2080 Ti with 11GB of VRAM and 64GB of RAM. The YOLOX network's learning framework was PyTorch, utilizing the CUDA 11.1 parallel architecture to enhance computational power. The initial learning rate was 0.01, and the weight decay was 0.0005.

[0107] Dataset

[0108] The dataset for this experiment was primarily extracted from publicly available internet data and news video recordings, with images labeled using Labelme. A total of 4576 images were collected, with 3706 images in the training set. Each training batch contained 926 images, and each training epoch contained 4 training batches. The experiment ran for a total of 50 epochs and 200 batches. During training, the learning rate was adjusted after each training batch was completed using the Cosine Annealing (CDWR) algorithm.

[0109] Evaluation indicators

[0110] Factors reflecting the performance of a network model mainly include its detection accuracy, detection speed, and model weights. This experiment uses recall (R), precision (P), F1 score, and mean average precision (mAP) to evaluate the model's performance.

[0111] Recall rate R

[0112] Recall rate R is expressed as the proportion of correctly predicted positive results out of all actual positive results, and is calculated using the following formula:

[0113]

[0114] In the formula, TP represents the number of correctly predicted positive samples, and FN represents the number of incorrectly predicted negative samples.

[0115] Precision P

[0116] Precision P is expressed as the proportion of correctly predicted positive out of all correctly predicted positive predictions, and is calculated using the following formula:

[0117]

[0118] In the formula, FP represents the number of positive samples that are predicted incorrectly.

[0119] Average F1

[0120] F1 is the harmonic mean of precision and recall, calculated using the following formula:

[0121]

[0122] In the formula, FN represents the number of negative samples with prediction errors.

[0123] mAP

[0124] The AP metric represents the average precision of a class, while mAP is the average of the AP across all classes, measuring the average precision of the model across all classes.

[0125] With R as the horizontal axis and P as the vertical axis, draw a line segment to the left of each point until it intersects the perpendicular line from the previous point. The area enclosed by this line segment and the coordinate axes is the AP value. The formula for calculating AP is as follows:

[0126]

[0127] The formula for calculating mAP is as follows:

[0128]

[0129] In the formula, N represents the number of all classes. The AP value is used to evaluate the model's performance on a single detection class. The average AP of all classes is the mAP value. The higher the model's mAP value, the better its detection performance.

[0130] The improved algorithm significantly enhances mAP, recall, precision, F1 score, and target detection performance in complex environments.

[0131] Analysis of the experimental effects of different loss functions:

[0132] The SIoU loss function considers the vector angle between the desired regressions, the distance between the center points, the shape, the overlap area, and the normalized coordinate scale; IoU considers the overlap area and the normalized coordinate scale; EIoU considers the overlap area, the distance between the center points, and the true difference between the length and width. Based on CIoU, it solves the fuzzy definition of aspect ratio and adds Focal Loss to solve the sample imbalance problem in bounding box regression.

[0133] To compare the performance of models using different loss functions, experiments were conducted using the YOLOX-s model with the SIoU loss function as the baseline model, and different loss functions were used. The final loss curves are shown below. Figure 5 As shown. Among them, Figure 5 (a) is the SIoU loss function. Figure 5 (b) is the IoU loss function. Figure 5 The (c)EIoU loss function.

[0134] As Figure 5The experimental results show that the loss curves of the baseline model using different loss functions have significant differences. The training loss and validation loss in Figure (b) are more closely matched than those in Figure (a), with a smaller gap. The training loss and validation loss in Figure (c) change faster than those in Figure (b), and the gap gradually narrows, indicating that the model has better learning ability.

[0135] Although the SIoU loss function considers more aspects of loss among the three loss functions, the EIoU loss function performs significantly better than SIoU in experimental results. Therefore, EIoU was ultimately selected as the loss function for the proposed YOLOX-s-EsE model. Analysis of ablation experiments with the added attention module:

[0136] To verify the impact of each attention module on the detection performance of YOLOX-s, ablation experiments were conducted on the dataset. With EIoU as the loss function, the ablation experiment results for models with added simAM and ECA attention modules are shown in Table 1. The experimental results for the YOLOX-s-EsE model are highlighted in bold.

[0137] Table 1. Experimental results with the addition of the attention module

[0138]

[0139]

[0140] The data in Table 1 shows that after adding simAM to the YOLOX-s model, the mAP improved by 0.48%, the recall improved by 6.77%, and the precision improved by 0.31%. After adding ECA, the mAP improved by 0.11%, the recall improved by 2.84%, and the precision improved by 0.77%.

[0141] Compared with YOLOX-s and YOLOX-s-EsE, mAP was improved by 0.59%, recall by 9.61%, and precision by 1.08%, indicating that the inserted attention module can reasonably allocate weights to feature points in each layer, improve the network's attention to target objects, and obtain category and location information of key regions.

[0142] 1) Comparison of detection performance under complex backgrounds

[0143] The detection results of the original baseline model (YOLOX-SIoU) and YOLOX-s-EsE for falling images with complex backgrounds are as follows: Figure 6 As shown. Figure 6 (a) is the detection result of the baseline model. Figure 6 (b) is the result of YOLOX-s-EsE detection.

[0144] It is obvious Figure 6 In (a), no target was detected, while in (b), a target that had fallen after the rain was detected with a confidence level of 0.7. It is clear that the improved algorithm can still detect targets normally in complex backgrounds.

[0145] 2) Comparison of detection results under low light conditions

[0146] The detection results of the original baseline model (YOLOX-SIoU) and YOLOX-s-EsE for falling images under low light conditions are as follows: Figure 7 As shown. Figure 7 (a) shows the detection results for baseline model image 1. Figure 7 (b) shows the detection results of YOLOX-s-EsE image 1. Figure 7 (c) represents the detection results of the baseline model image 2. Figure 7 (d) is the detection result of YOLOX-s-EsE image 2.

[0147] exist Figure 7 In the results, the original baseline model's detection results are (a) and (c), while the YOLOX-s-EsE detection results are (b) and (d). It is clear that the improved algorithm performs better in low-light conditions, correctly detecting fallen targets with high confidence even in dim light. Analysis of comparative experimental results between different models:

[0148] To verify the performance of the proposed model, comparative experiments were conducted with YOLOv3-s, YOLOv4-s, YOLOv5-s and YOLOX-s-EsE models respectively. The experimental results are shown in Table 2, where the experimental results of the YOLOX-s-EsE model are marked in bold.

[0149] Table 2. Comparison of experimental results for different models

[0150] Method mAP(%) F1 Recall (%) Precious (%) YOLOv3-s 82.98 0.75 67.69 82.89 YOLOv4-s 76.58 0.60 46.72 82.31 YOLOv5-s 77.96 0.58 44.32 85.29 YOLOX-s-EsE 89.23 0.84 82.10 91.79

[0151] As can be seen, the YOLOX-s-EsE model performs better than other models in the experiment. YOLOv4 has the lowest mAP, indicating relatively poor detection performance, while YOLOv5's recall rate only reached 44.32, suggesting that while YOLOv5 can detect falls, it struggles to detect all instances. In contrast, the YOLOX-s-EsE model achieved an mAP of 89.23%, a recall rate of 82.10%, and a precision of 91.79%, demonstrating superior detection performance compared to other models.

[0152] The following are comparisons of the model's detection performance in scenes with occluded targets, small targets, and partial targets:

[0153] 1) Comparison of occluded target detection results

[0154] The detection results of YOLOv3-s and YOLOX-s-EsE for images of occluded targets falling are as follows: Figure 8 As shown. Figure 8 (a) shows the YOLOv3-s detection results. Figure 8 (b) is the result of YOLOX-s-EsE detection.

[0155] The detection results of YOLOv3-s in the figure are (a) and YOLOX-s-EsE are (b). It is clear that YOLOv3-s cannot detect occluded targets, while YOLOX-s-EsE can.

[0156] 2) Comparison of small target detection performance

[0157] The detection results of YOLOv4-s and YOLOX-s-EsE for images of small objects falling are as follows: Figure 9 As shown. Figure 9 (a) shows the YOLOv4-s detection results. Figure 9 (b) is the result of YOLOX-s-EsE detection.

[0158] The detection results of YOLOv4-s in the figure are (a) and YOLOX-s-EsE are (b). It is clear that YOLOv4-s cannot detect smaller targets, while YOLOX-s-EsE can.

[0159] 3) Comparison of partial target detection results

[0160] The detection results of YOLOv5-s and YOLOX-s-EsE on some images of falling targets are as follows: Figure 10 As shown. Figure 10 (a) shows the YOLOv5-s detection results. Figure 10 (b) shows the YOLOX-s-EsE detection results.

[0161] The detection results of YOLOv5-s in the figure are (a) and YOLOX-s-EsE are (b). It is clear that YOLOv5-s cannot detect some targets, while YOLOX-s-EsE can.

[0162] The results of ablation experiments and comparative experiments show that YOLOX-s-EsE significantly improves the recall, precision, F1 score, and mAP of the algorithm, whether in complex environments and low light conditions, or for the detection of small targets, occluded targets, and partial targets.

[0163] Experimental results show that the improved algorithm significantly improves the detection performance of targets in complex environments, including mAP, recall, precision, F1 score, and overall performance. It can effectively detect both complete and occluded fallen targets under blurred background and low light conditions, thus improving the accuracy of target detection.

Claims

1. An improved YOLOX fall detection system, characterized in that: The improved YOLOX fall detection system includes a backbone network, a feature fusion module, and a prediction head, as well as a simAM attention module introduced into the backbone network and an ECA channel attention module added to the feature fusion module. The system uses the EIoU loss function. The specific steps for image detection are as follows: Step 1: Data Collection: Collect fall videos from public place cameras, extract different frames of each image as an image dataset, and use labelimg software to annotate the information. The ground truth bounding boxes are divided into 5 types: stand, fall, sit, squat, and run. Training set, validation set and test set are also divided. Step 2: Text preprocessing: Preprocess the collected image dataset, uniformly put the image path information of the training set and validation set into a TXT document, and specify the correct reading path text information and category information so that the model can read it; Step 3: Building the training model: Constructing a YOLOX fall detection system with a CSPDarknet backbone network with residual structure and simAM attention mechanism. The uniformly scaled image is used as the input of the network, and the output of the backbone network is fed into the feature fusion module with ECA attention mechanism to further extract feature information. Finally, the detection result is output through YOLOHead. The YOLOX fall detection system, which constructs a CSPDarknet backbone network with residual structure and simAM attention mechanism, introduces the simAM attention mechanism into the CSPDarknet backbone network. The simAM attention mechanism is introduced into the non-residual part of the CSP of the backbone network, that is, the part where multiple bottlenecks are superimposed and the final output part, to deepen the network structure and further extract deep feature information. The aforementioned introduction of the simAM attention mechanism in the overlapping part of multiple bottlenecks involves first performing two convolutions on the input feature map, then using simAM to better extract the 3D attention weights and map them onto the feature layer, then adding the feature layers of the two branches, and finally using ECA attention to extract channel information and map it onto the feature layer. The simAM attention mechanism introduced in the final output part is to divide the input feature map into two branches, perform convolution on each branch, and then convolve the left branch after convolution through n bottlenecks. The two branches are then concatenated into one branch, and the concatenated feature layer is convolved. Finally, simAM is used to extract the three-dimensional weight information and map it onto the feature layer to output the final feature map. Step 4: Model Training: Divide the processed dataset into training, validation, and test sets, and train the model using the constructed model to obtain the optimal weight model; Step 5: Model Detection: Input the images or surveillance videos into the trained model for detection, label and locate the detected fallen targets, and issue alarm information.

2. The improved YOLOX fall detection system according to claim 1, characterized in that: The simAM attention mechanism described in step three is a parameter-free attention module. Based on neuroscience theory, it constructs an energy function to mine the importance of neurons, assigning each neuron a unique weight. An analytical solution for this is derived to accelerate computation. The final energy function is: (1); in, (2); (3); (4); (5); In the above formula, t and x i The input features X∈R C×H×W The target neuron and other neurons in a single channel; i is the index in the spatial dimension, M = H×W is the number of neurons in that channel; w t and b t Both are transformations of weights and biases, μ t and σ t 2 It represents the mean and variance of all neurons except t; If all pixels in a single channel follow the same distribution, then the mean and variance of all neurons are calculated, and all neurons in that channel are reused. Therefore, the minimum energy can be obtained by the following formula: (6) ; The above formula implies that the lower the energy, the greater the difference between neuron t and surrounding neurons, and the higher its importance; therefore, the importance of a neuron can be determined by… We obtain the feature enhancement process using the sigmoid scaling operator, as shown in the following formula: (7); Here, E is a grouping of e* across all channels and spatial dimensions of energy, and Sigmoid is used to limit the value of E to be too large so as not to affect the relative importance of neurons.

3. The improved YOLOX fall detection system according to claim 1, characterized in that: The convolution process for each branch is as follows: First, the input feature layer is subjected to basic convolution. Then, it is subjected to three branches of global average pooling (5×5, 9×9, and 13×13) and one invariant branch. The results of the four branches are summed and then convolved. SimAM attention is used to extract three-dimensional weight information, and important information is further extracted and mapped onto the feature layer for output.

4. The improved YOLOX fall detection system according to claim 1, characterized in that: The feature fusion module of the ECA attention mechanism described in step three introduces the simAM mechanism after the feature fusion algorithm after upsampling and downsampling in the feature fusion module. At the output of the feature fusion module, the ECA attention mechanism is introduced after the three output feature layers.

5. An improved YOLOX fall detection system according to claim 4, characterized in that: The ECA attention mechanism learns effective channel attention with low model complexity. This module generates channel attention through fast 1×1 convolutions, and its kernel size can be adaptively determined by nonlinear mapping of channel size. Compared with other attention mechanisms, the ECA attention mechanism avoids dimensionality reduction and efficiently realizes local cross-channel interaction with 1-dimensional convolutions to extract the dependencies between channels.

6. An improved YOLOX fall detection system according to claim 1, 4, or 5, characterized in that: Step three involves feeding the output of the backbone network into a feature fusion module with an ECA attention mechanism to further extract feature information. The specific steps are as follows: first, perform global average pooling on the input feature map; then, perform a 1D convolution with kernel size k, and pass it through a Sigmoid activation function to obtain the weights w for each channel, as shown in the formula below: (8); Where C1D represents one-dimensional convolution, k is the kernel size, and X is the input feature map; Finally, the weights are multiplied by the corresponding elements of the original input feature map to obtain the final output feature map.

7. An improved YOLOX fall detection system according to claim 1, characterized in that: The EIoU loss function comprises three parts: overlap loss, center distance loss, and width / height loss. The first two parts follow the method in CIOU. EIoU proposes a loss function that directly penalizes the predicted W and H, minimizing the difference in width and height between the ground truth bounding box and the predicted bounding box, thus resulting in faster convergence. The specific formula is as follows: (9); Among them, c w and c h It represents the width and height of the smallest bounding box that covers both boxes; This represents the calculation of the Euclidean distance between two center points; , These represent the center points of the predicted bounding box and the ground truth bounding box, respectively. , These represent the widths of the ground truth bounding box and the predicted bounding box, respectively. , These represent the heights of the ground truth bounding box and the predicted bounding box, respectively. It represents the diagonal distance of the smallest closure region that can simultaneously contain both the predicted bounding box and the ground truth bounding box.

8. The improved YOLOX fall detection system according to claim 1, characterized in that: The specific operation method of using the constructed model for training described in Step 4 is as follows: perform mosaic data augmentation on the pictures in the training set, that is, read one image, and then randomly read three other images. Subsequently, these four pictures are to be spliced in the form of a "field" grid, and the label information of the spliced mosaic image is adjusted to further enhance the small target detection performance. Moreover, the pictures are uniformly scaled to a size of 640×640×3, and the remaining part is filled with padding to solve the problem of image distortion.

Citation Information

Patent Citations

  • Fall detection method and system based on improved YOLOX network

    CN114882532A

  • Automatic driving target detection algorithm based on SimAM-YOLOv4

    CN114943953A