Escalator passenger falling detection method and device
By using the improved Yolov8 target recognition model in the escalator intelligent monitoring system, combined with the BiFormer_ROI module and lightweight Neck network, the problem of false alarms caused by interference from non-escalator background areas in the traditional system is solved, and the accuracy of passenger fall detection is improved. and security.
Patent Information
- Application Number
- CN202410777610.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-18
AI Technical Summary
In traditional escalator intelligent monitoring systems, passenger fall detection based on the Yolo algorithm is easily interfered by the complex environment in non-escalator background areas, resulting in false alarms and low safety detection accuracy. It is difficult to effectively shield small targets from the complex environment in non-escalator background areas. Detect interference.
The improved Yolov8 target recognition model is used to extract features through the BiFormer_ROI module, combined with depth separable convolution, layer regularization, dual-layer routing attention mechanism and multi-layer perceptron processing, to shield the interference of non-escalator background areas, and in Neck VoV-GSCSP and GSConv modules are used in the network to optimize the loss function to improve detection accuracy.
It effectively improves the detection rate of small targets, reduces the false alarm rate of escalator safety detection, and significantly improves the detection accuracy of passenger fall accidents and the safety of the system.
Smart Images

Figure CN118799799A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of escalator passenger detection, and in particular relates to an escalator passenger fall detection method and device. Background Art
[0002] In daily life, escalators are very common facilities for transporting passengers, and are widely used in public places such as shopping malls, subways, airports, and hospitals. Traditional escalator inspection-style daily management consumes a lot of manpower, and the huge passenger flow often creates potential safety hazards. It is difficult to detect emergencies immediately, and the escalator operation is often terminated due to the inability to press the "emergency stop button" in time, resulting in continuous tumbling and other serious personal injuries.
[0003] At present, the intelligent monitoring and management system of escalators detects the passenger's fall through video image recognition technology, then issues a warning message in real time and immediately implements an emergency stop command to ensure the safety of passengers. Common computer vision fall detection methods mainly use the Yolo series fall detection algorithm.
[0004] However, the traditional Yolo algorithm will detect pedestrian falls outside the escalator. If a pedestrian fall accident occurs in the non-escalator background area, it will affect the subsequent warning of the monitoring management system and the escalator safety emergency stop processing, thereby causing the escalator safety detection false alarm problem. Summary of the invention
[0005] The purpose of the present invention is to provide an escalator passenger fall detection method, which shields the interference of the complex environment of the non-escalator background area on the small target detection and solves the problem of false alarm of escalator safety detection.
[0006] The present invention adopts the following technical solution: a method for detecting a passenger falling on an escalator, comprising the following steps:
[0007] Acquire an image to be identified and a first region of interest in the image to be identified, wherein the first region of interest is an escalator region in the image to be identified;
[0008] The improved Yolov8 target recognition model is used to perform target recognition on the image to be recognized, and the passenger fall detection information in the area of interest is obtained;
[0009] Among them, the BiFormer_ROI module is used to extract feature information in the feature extraction stage of the backbone network of the improved Yolov8 target recognition model.
[0010] Furthermore, the BiFormer_ROI module is used for feature extraction, which includes depthwise separable convolution processing, layer regularization processing, region of interest two-layer routing attention mechanism processing and multi-layer perceptron processing.
[0011] Furthermore, the two-layer routing attention mechanism processing of the region of interest includes:
[0012] The feature map output by the convolution module of the backbone network in the improved Yolov8 target recognition model is divided into several regional blocks;
[0013] Extending the boundary line of the first region of interest outward to the boundary line of the corresponding region block to obtain a second region of interest;
[0014] Extract feature information of the second region of interest.
[0015] Furthermore, extracting feature information of the second region of interest includes:
[0016] A two-layer routing attention mechanism is used to extract the feature information of each region block in the second region of interest.
[0017] Furthermore, the double-layer routing attention mechanism is used to extract the feature information of each region block in the second region of interest, including:
[0018] Obtaining a query vector and a key vector for each region block in the second region of interest;
[0019] Calculate the query vector average value of all pixels in the query vector, calculate the key vector average value of all pixels in the key vector, and generate the adjacency matrix of the region block according to the query vector average value and the key vector average value;
[0020] Determine the index matrix of each region block according to the adjacency matrix, and generate the key vector and the value vector of each region block after aggregation and integration according to the index matrix;
[0021] The feature information of the region block is calculated according to the value vector of the region block, the key vector after aggregation and integration, and the value vector after aggregation and integration.
[0022] Furthermore, the BiFormer_ROI module is used to extract feature information in the first, second and third stages of the feature extraction stage in the backbone network of the improved Yolov8 target recognition model.
[0023] Furthermore, the VoV-GSCSP module is used in the Neck network of the improved Yolov8 target recognition model to replace the original C2f module.
[0024] Furthermore, the GSConv module is used in the Neck network of the improved Yolov8 target recognition model to replace the original CBS convolution module.
[0025] Furthermore, the loss function of the improved Yolov8 target recognition model is:
[0026] L=λ1LCls +λ2L DFL +λ3L PIoU-v2 ,
[0027] Among them, L represents the loss function of the improved Yolov8 target recognition model, L Cls represents the binary cross entropy loss, L DFL represents the distribution focal loss, L PIoU-v2 represents the PIoU_v2 loss, λ1 represents the weight coefficient of the binary cross entropy loss, λ2 represents the weight coefficient of the distribution focus loss, and λ3 represents the weight coefficient of the PIoU_v2 loss.
[0028] Another technical solution of the present invention: an escalator passenger fall detection device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the above method is implemented when the processor executes the computer program.
[0029] The beneficial effects of the present invention are as follows: by adding a BiFormer_ROI module to the Yolov8 target recognition model to extract feature information, the present invention can shield the complex environmental interference of the non-escalator background area, effectively improve the detection rate of small targets, and effectively solve the problem of false alarm of escalator safety detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Schematic diagram of the network structure of the improved Yolov8 target recognition model in an embodiment of the present invention;
[0031] Figure 2 It is a schematic diagram of the structure of some modules in the network structure of the improved Yolov8 target recognition model in an embodiment of the present invention;
[0032] Figure 3 Schematic diagram of the structure of the Biformer_ROI module in an embodiment of the present invention;
[0033] Figure 4 A schematic diagram of the structure of a two-layer routing attention mechanism for a region of interest in an embodiment of the present invention;
[0034] Figure 5 Schematic diagram of the training process of the improved Yolov8 target recognition model in an embodiment of the present invention;
[0035] Figure 6 Schematic diagram of image processing and region of interest extraction results in an embodiment of the present invention;
[0036] Figure 7 This is a schematic diagram of Yolo v8 target detection results in an embodiment of the present invention;
[0037] Figure 8 A schematic diagram of a workflow in which the improved Yolov8 target recognition model in an embodiment of the present invention is applied to an escalator intelligent monitoring system;
[0038] Fig. 9 This is a comparison chart of the visualized heat map of the method of the present invention and the Yolo v8 algorithm in the embodiment of the present invention:
[0039] Fig.10 This is a schematic diagram of the visual results of passenger fall detection using a self-built data set in the verification embodiment of the present invention;
[0040] Fig.11 This is a visual comparison diagram of the image of the passenger fall detection result in the actual escalator accident in the verification embodiment of the present invention;
[0041] Fig.12 This is a visual comparison diagram of video frames of passenger fall detection results in an actual escalator accident in the verification embodiment of the present invention. DETAILED DESCRIPTION
[0042] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] In public places, escalators are common facilities for transporting passengers. However, passenger falls are difficult to detect in time, which can easily cause serious personal injuries. Intelligent monitoring of escalators has become an important means to prevent accidents. The operating environment of escalators is relatively complex, and the size of passengers is constantly changing. The detection of small-target passengers at long distances can easily lead to missed detection and false detection.
[0044] There may be small target passengers at the far end of the escalator far away from the surveillance camera. The general Yolo target detection model is difficult to extract sufficient detection feature information. The detection accuracy of small target passengers is relatively low, and false detection and missed detection are prone to occur.
[0045] In the application of escalator passenger safety detection, the escalator range is the core target area of detection. Therefore, the present invention sets the escalator area as the area of interest, thereby limiting the attention to the escalator area of interest. Target detection in the area of interest can effectively shield the complex environmental interference of the non-escalator background area.
[0046] The attention mechanism can effectively improve the model's attention to important key information, filter out the feature information of the key areas of small targets from a large amount of irrelevant complex backgrounds, retain the detailed information of fine-grained features, and effectively improve the detection accuracy of small target passenger fall accidents.
[0047] The invention discloses a method for detecting a passenger fall on an escalator, comprising the following steps: obtaining an image to be identified and a first region of interest in the image to be identified, wherein the first region of interest is an escalator region in the image to be identified; using an improved Yolov8 target recognition model to perform target recognition on the image to be identified, and obtaining passenger fall detection information in the region of interest; wherein a BiFormer_ROI module is used in the feature extraction stage of a backbone network of the improved Yolov8 target recognition model to extract feature information.
[0048] The present invention adds a BiFormer_ROI module to the Yolov8 target recognition model to extract feature information, which can shield the complex environmental interference of the non-escalator background area, effectively improve the detection rate of small targets, and effectively solve the problem of false alarm of escalator safety detection.
[0049] The network structure of the Yolov8 target recognition model improved in the present invention is as follows Figure 1 As shown in Figure 2, the network structures of some specific modules are as follows: Figure 2 shown.
[0050] In the Yolov8 backbone network, shallow feature information has a small receptive field and strong spatial information, which is suitable for detecting small target objects. Most of the small target feature information is gradually lost through multiple downsampling extraction processes. In order to focus more on the key escalator passenger area of monitoring concern and improve the model's ability to pay attention to key features, the present invention designs a BiFormer_ROI attention mechanism strategy based on the region of interest, which can better extract the fine-grained feature information of the small target area and improve the detection accuracy of fall accidents.
[0051] like Figure 1 As shown, the present invention uses BiFormer_ROI module to replace the C2f module of the original network in the first three stages of feature extraction of 160×160 ultra-shallow layer, 80×80 shallow layer and 40×40 middle layer of Yolov8 backbone network, and the whole process is realized by the following steps:
[0052] First, the image is preprocessed to obtain the escalator region of interest. For the 640×640×3 RGB sampling image, the Yolov8 pre-trained model (or other existing target detection models) is used for target detection. The detected escalator area is set as the region of interest, and the target position coordinates (x, y, w', h') of the escalator region of interest are extracted and saved to provide effective parameter variables for the subsequent BiFormer_ROI attention feature extraction process based on the region of interest.
[0053] Secondly, the 640×640×3 RGB image is input into the CBS module for convolution layer (Conv), batch normalization layer (Batch Normalization, BN) and SiLU activation function processing, so as to extract 320×320×64×w dimensional feature information, where w=0.5 in this embodiment.
[0054] In the embodiment of the present invention, the first stage, the second stage and the third stage of the feature extraction stage in the backbone network of the improved Yolov8 target recognition model all use the BiFormer_ROI module to extract feature information.
[0055] Subsequently, feature information at different resolutions is obtained through four feature learning stages, thereby expanding the receptive field layer by layer.
[0056] The process from stage 1 (i.e., the first stage of feature extraction) to stage 3 respectively uses the ROI position coordinate information of the escalator, and is combined and processed by the CBS module and the BiFormer_ROI attention enhancement module (i.e., the BiFormer_ROI module), thereby effectively improving the network's perception of small targets. Stage 1, stage 2, and stage 3 use 3, 6, and 6 BiFormer_ROI modules, respectively. Stage 2 and stage 3 extract shallow and middle-level feature information of 80×80×128 and 40×40×256, respectively.
[0057] The stage 4 process extracts 20×20×512 high-level feature information through the CBS module and the C2f module, where stage 4 uses 3 C2f modules.
[0058] Finally, the Spatial Pyramid Pooling-Fast (SPPF) module is used to enhance the expression of 20×20×1024 high-level feature information. The backbone network in this paper extracts the three scales of 80×80×128, 40×40×256, and 20×20×512 from the stage 2, stage 3, and SPPF modules to form a feature pyramid and output it to the Neck network.
[0059] In the application of escalator passenger safety detection, the key target area is only the escalator range, and the complex environmental interference of the non-escalator background area needs to be shielded. Therefore, the present invention designs an improved region of interest BiFormer_ROI module.
[0060] like Figure 4As shown in the figure, the position coordinates (x, y, W′, H′) of the ROI area are obtained. The escalator range in the pink rectangular frame in the figure is the detected target area of interest. Then, the BiFormer module feature extraction is performed in the ROI area of interest. The Biformer_ROI module structure is as follows Figure 3 As shown in the figure, it includes depthwise convolution (DWConv), layer normalization (LN), bi-level routing attention based ROI (BRA_ROI) and multi-layer perceptron (MLP) through residual operation.
[0061] That is to say, the feature extraction using the BiFormer_ROI module includes depthwise separable convolution processing, layer regularization processing, region of interest two-layer routing attention mechanism processing and multi-layer perceptron processing.
[0062] The improved BiFormer_ROI module of the present invention can more effectively enhance the escalator target area perception ability through the bi-level routing attention based on ROI (BRA_ROI) mechanism, shield the background interference, significantly improve the accident detection accuracy and reduce the false detection rate, and the BRA_ROI attention mechanism can further significantly reduce the computing and storage consumption. The improved BRA_ROI attention mechanism implementation includes the following process:
[0063] The feature map output by the convolution module of the backbone network in the improved Yolov8 target recognition model is divided into several area blocks; the boundary line of the first region of interest is extended outward to the boundary line of the corresponding area block to obtain the second region of interest; and the feature information of the second region of interest is extracted.
[0064] In an embodiment of the present invention, a double-layer routing attention mechanism is used to extract feature information of each region block in the second region of interest. Specifically, the double-layer routing attention mechanism is used to extract feature information of each region block in the second region of interest, including:
[0065] Obtain the query vector and key vector of each regional block in the second region of interest; calculate the query vector average of all pixels in the query vector, calculate the key vector average of all pixels in the key vector, and generate the adjacency matrix of the regional block according to the query vector average and the key vector average; determine the index matrix of each regional block according to the adjacency matrix, and generate the clustered and integrated key vector and the clustered and integrated value vector of each regional block according to the index matrix; calculate the feature information of the regional block according to the value vector of the regional block, the clustered and integrated key vector and the clustered and integrated value vector.
[0066] More specifically, the ROI area is first divided, and the input features are linearly projected to obtain vector parameters. Figure X ∈R HxWxC Divide into S x S non-overlapping area blocks, S is a positive integer, H represents the height of the two-dimensional feature map, W represents the width of the two-dimensional feature map, and C represents the number of channels of the two-dimensional feature map. Figure 4 The yellow image blocks in the figure are segmented area blocks. Each area block contains feature vectors (each pixel corresponds to a feature vector). Then, the four sides of the ROI area (i.e., the first region of interest) are expanded outward to the nearest area block. Figure 4 The red rectangle H'xW' is the adjusted ROI area (i.e., the second ROI), H' represents the height of the second ROI, W' represents the width of the second ROI, and X' contains It can be clearly seen from the figure that the introduction of the ROI area will filter out most of the background blocks that are not of interest. Finally, the feature information of the rth block of the region of interest is obtained by integer recombination. X' r It is actually a three-dimensional matrix, which is linearly mapped through formula (1) to obtain the query vector Q, key vector K and value vector V.
[0067] Q=X′ r W q ,K=X′ r W k ,V=X′ r W v (1)
[0068] Among them, W q , W k , W v ∈R C×C are the projection weights of query Q, key K and value V respectively.
[0069] Then, a region-to-region routing index matrix is constructed at a coarse-grained level.
[0070] Calculate the average value of the query vector Q and key vector K for each region block (that is, the average value of all pixel information in each region block) The adjacency matrix of the inter-region correlation is obtained
[0071] A r =Q r (K r ) T (2)
[0072] At a coarse granularity, some of the area blocks with low relevance are filtered out. Then, the topkIndex operation is performed on each area block, and only the top k area block key-value pairs with the strongest relevance are retained. A routing index matrix is derived from formula (3):
[0073] I r =topkIndex(A r ) (3)
[0074] Among them, I r The i-th row parameter Represents the index value of the k most related region blocks of the ith region block.
[0075] Finally, token-to-token attention relationships are captured at a fine-grained level.
[0076] The key vector K and value vector V of the roughly selected k region blocks are gathered and integrated by formula (4) to obtain
[0077]
[0078] Finally, the double-layer routing attention is calculated by formula (5):
[0079]
[0080] In the formula, the scalar factor Used to avoid gradient disappearance; the LCE(·) function uses a 5×5 depth-separable convolution for local enhancement operations.
[0081] For BRA_ROI, due to different input resolutions, the improved method of the present invention uses a regional segmentation factor S = 16 for the four stages in the backbone network, retaining only the first k = 1, 4, 8, S 2 The most relevant area blocks.
[0082] In the embodiment of the present invention, the VoV-GSCSP module is used in the Neck network of the improved Yolov8 target recognition model to replace the original C2f module. The GSConv module is used in the Neck network of the improved Yolov8 target recognition model to replace the original CBS convolution module.
[0083] In order to promote the efficient detection model of the improved algorithm to be deployed on the embedded hardware platform of the front-end intelligent escalator monitoring system, the present invention adopts the GhostSlimPAFPN lightweight model to optimize the Yolov8 Neck network, which can effectively reduce the number of model parameters while maintaining the model detection accuracy. Its structural design is as follows Figure 1 The Neck network adopts the PAFPN framework for bidirectional multi-scale feature reconstruction and fusion, further improving the diversity and expression ability of feature maps; the model introduces Ghost-Shuffle Conv (GSConv) and VoV-GSCSP modules to construct a Slim-neck lightweight network, in which the GSConv module replaces the CBS convolution module in the Yolov8 Neck network, and the VoV-GSCSP module replaces the C2f module in the original network. The module structure is as follows Figure 1 shown.
[0084] The GSConv convolution module combines the advantages of SC standard convolution, DSC deep separable convolution and Shuffle channel shuffling operations, effectively enhancing the nonlinear expression ability. First, SC convolution is used to generate multiple groups of channel information for the input feature information; DSC convolution is performed separately for each group of channel features; then the feature information generated by SC convolution and DSC convolution is spliced and fused; finally, the shuffle strategy is used to reorganize the fused channel features. The GSConv module effectively retains the information interaction between channels, which can better balance the model accuracy and computational complexity.
[0085] The GS bottleneck module and VoV-GSCSP module designed on the basis of GSConv use a one-time aggregation method to form a cross-stage local network structure, which can achieve richer gradient combinations. The module structure is as follows: Figure 1 The VoV-GSCSP module increases the depth of the multi-scale feature fusion network, taking into account the semantic information of deep features and the detail information of shallow features, further improving the accuracy of the model while reducing the amount of calculation, especially significantly improving the performance of small target detection.
[0086] In addition, the improved method of the present invention retains the decoupled detection head, anchor-free frame mechanism and label assignment strategy of the Yolov8 Head network. However, the CIoU loss function adopted by Yolov8 has a fuzzy effect because the aspect ratio penalty term is a relative value, and cannot effectively reflect the true relationship between the anchor frame and the target frame, which may lead to undesirable convergence. The improved PIoU loss function combines the target size adaptive penalty factor and the gradient adjustment function based on the anchor frame quality. The PIoU v2 loss function has the ability to enhance the focusing ability of medium-quality anchor frames, thereby achieving faster convergence and higher detection accuracy. Therefore, the present invention uses the PIoU v2 loss function to replace the CIoU algorithm of Yolov8 to calculate the regression positioning loss. The entire Head network prediction process first uses the decoupled detection head network to integrate the features of each branch to obtain a predicted feature vector; then the task alignment assigner (Task Aligned Assigner) dynamic label assignment strategy without an anchor frame mechanism is used to select the positive sample prediction frame; finally, the loss function is calculated to determine the detection target.
[0087] That is to say, the loss function of the improved Yolov8 target recognition model is:
[0088] L=λ1L Cls +λ2L DFL +λ3L PIoU-v2 (6)
[0089] Among them, L represents the loss function of the improved Yolov8 target recognition model, L Cls represents the binary cross entropy loss, L DFL represents the distribution focal loss, L PIoU-v2 represents the PIoU_v2 loss, λ1 represents the weight coefficient of the binary cross entropy loss, λ2 represents the weight coefficient of the distribution focus loss, and λ3 represents the weight coefficient of the PIoU_v2 loss. The weight coefficients are set to 0.5, 1.5, and 7.5, respectively.
[0090] The Neck network outputs three sets of enhanced pyramid feature information of 80×80×128, 40×40×256, and 20×20×512, such as Figure 1 The Head prediction network structure shown in Figure 1 uses two decoupling heads for each set of feature information of different scales to obtain the Cls. classification branch for predicting the target type and the Reg. boundary regression branch for predicting the target position. The generated classification and regression prediction vectors are then fused and transposed to obtain (N cls +4×reg_max)×8400 two-dimensional prediction feature information, where N cls Indicates the number of detected target categories, reg_max indicates the number of channels output by each anchor point (the default value is 64), 4 indicates the target bounding box parameters (x, y, w, h), (Ncls +4×reg_max) is the (Cls., Reg.) feature information of each prediction box, and 8400 is the number of prediction boxes. The fused feature information is finally input into the distortion evaluation system to complete the classification and regression detection tasks.
[0091] The present invention uses a task alignment allocator to implement a positive and negative sample dynamic allocation strategy to improve the detection accuracy and robustness of the model. 8400 annotated prediction boxes are compared with the true target boxes, and appropriate positive sample prediction boxes are selected through preliminary and fine screening. First, (N cls +4×reg_max)×8400 feature vector If the feature point falls within the target frame, it is initially screened as a positive sample prediction frame, and the others are negative samples; secondly, the true target frame is compared with the initial screening positive sample prediction frame, and the alignment score t=S is obtained according to the weighted result of the classification and regression scores. α +U β , in order to select the appropriate positive sample prediction box, where S is the prediction score of the labeled category, U is the IoU score between the prediction box and the true target box, and α and β are weight hyperparameters; finally, for each true target box, the alignment score t is sorted, and the top k prediction boxes with the largest t value are selected as positive samples, and the remaining prediction boxes are used as negative samples.
[0092] The positive sample prediction box assigned by the Task-Aligned Assigner label is compared with the true target box, and the classification loss L is obtained using the binary cross-entropy loss function (BCELoss) method of formula (7) Cls The regression positioning loss is calculated using the Distribution Focal Loss (DFL) of formula (8) and the PIoU_v2 loss function of formula (9).
[0093]
[0094] Among them, N pos is the number of positive samples, N cls Indicates the number of detected target categories, O ij ∈{0, 1} indicates whether there is a j-th type of target in the i-th predicted target box, c ij is the predicted category, and σ(·) represents the Sigmoid function.
[0095] DFL loss function L DFL By using the cross entropy loss method to optimize the prediction box regression task, the predicted coordinates gradually approach the target box area.
[0096]
[0097] Among them, y represents the true label, y i and i+1 are the i-th and i+1-th predicted labels close to the true label y.
[0098] Then use the PIoU v2 loss function to further accurately locate the target box position:
[0099]
[0100] Here, B and B gt Represent the prediction box and target box respectively; w gt and h gt represents the width and height of the target box; dw1, dw2, dh1 and dh2 are the absolute values of the distances between the predicted box and the corresponding edges of the target box; λ is a hyperparameter that controls the behavior of the attention function.
[0101] like Figure 5 As shown in the figure, the training process based on the improved Yolo_BFROI target detection model is given, which mainly includes three parts: training image set preprocessing, region of interest detection and positioning, and Yolo_BFROI target detection algorithm model parameter training.
[0102] This embodiment collects 425 video sequences by simulating falling actions in places such as shopping malls, hospitals, airports, railway stations, subways and outdoor escalators, and extracts 11,850 key frame images from the videos, including 7,350 images of normal passengers and 6,800 images of escalator passengers falling, with an image scale of 720×1280. In addition, 3,500 images of escalator and non-escalator passenger fall accidents were collected and added through the network, and a total of 15,350 images were built. Some escalators installed indoors and outdoors cannot obtain clear escalator operation images due to insufficient lighting intensity, resulting in low fall detection accuracy. Therefore, this embodiment uses a fast and effective histogram equalization algorithm to enhance the low-light input image preprocessing.
[0103] like Figure 6 (a) shows the original image. Figure 6 (b) shows the enhanced image, which has significantly improved clarity. In addition, in order to obtain a richer training data set, two data enhancement strategies, Mosaic and Mixup, are also used.
[0104] In addition, the image data set is annotated into two types: passenger fall targets (fall) and escalator targets (lift). By comparing the performance of the current mainstream Yolo series target detection algorithms, the Yolov8 algorithm can obtain an average accuracy of 91.5% and 99.5% for passenger fall and escalator detection respectively, and the detection frame rate reaches 121.9 frames / s. The Yolov8 target detection algorithm can realize fast and efficient escalator target detection, and the accuracy of passenger fall detection needs to be improved. Therefore, the Yolov8 model is used as the network pre-training model of the improved method of the present invention.
[0105] Then the size of the preprocessed escalator image dataset is uniformly adjusted to 640×640×3, as shown in Figure 6 As shown in (c), the pre-trained Yolov8 network model is used for target detection. If the escalator target is detected in the input image X, it is set as the region of interest, that is, ROI = X(x, y, w', h'), as shown in Figure 6 The green area in (d) is the escalator area detected by the Yolov8 algorithm, which is the region of interest. Here (x, y) is the coordinate position of the upper left corner of the ROI area, and (w', h') is the width and height of the ROI area. The escalator area position coordinates (x, y, w', h') are extracted and saved as ROI position information to provide effective parameter variables for the subsequent BiFormer_ROI attention mechanism feature extraction method.
[0106] In addition, if the escalator target is not detected in the input image, the entire image is set as the region of interest, that is, ROI=X(0,0,640,640), and (0,0,640,640) is output as the ROI position information for extraction and storage.
[0107] Figure 7 In (a), the Yolov8 algorithm can detect the escalator target, but it fails to accurately detect the small target falling down at a long distance. The improved BiFormer_ROI attention mechanism introduced in the method of the present invention will effectively improve the detection accuracy of small targets. Figure 7 In (b), the Yolov8 algorithm detects a pedestrian target who falls on the background stairs. Since the embodiment of the present invention focuses on the monitoring area only in the escalator range, detecting a fallen pedestrian target in the non-escalator background area will affect the subsequent safety emergency stop measures for the escalator. Therefore, the region of interest Yolo_BFROI improved method proposed in the present invention can effectively shield the false detection interference of pedestrian falling behavior in the non-escalator background area.
[0108] Finally, load the training on the improved Yolo_BFROI model to obtain the model parameters for escalator region of interest positioning.
[0109] In the present invention, the above detection method is applied to the escalator intelligent monitoring system. Accidents of escalator passengers falling usually occur in an instant, and it is difficult for personnel inspection mode to detect safety hazards in time, which may cause serious personal injury. The modern escalator safety intelligent monitoring system can make up for these defects. The 24-hour efficient video monitoring system deploys the improved Yolo_BFROI escalator passenger fall detection method of the present invention. The system can detect the escalator passenger fall behavior in real time and accurately, and at the same time issue voice broadcasts, send early warning information to managers, and send emergency measures signals for emergency slowing down to the escalator control system. The intelligent monitoring system can eliminate various safety hazards in advance, reduce the level of accident hazards, ensure passenger safety, and significantly reduce the workload of safety managers.
[0110] The escalator intelligent monitoring system designed by the present invention is as follows Figure 8 As shown. First, the current video image is acquired through the escalator monitoring camera acquisition device. In view of the problem of insufficient indoor environmental lighting intensity, the histogram equalization algorithm is used to enhance the low-light input image for preprocessing. Subsequently, the escalator passenger fall detection method based on the Yolo_BFROI network model proposed in the present invention is used to detect the fall event on the current sampled video frame. Finally, the detection results of the escalator target and the fall target are analyzed: if the escalator target is detected, it is set as the region of interest, and the escalator area position coordinates (x, y, w', h') are extracted and saved as ROI position information, and the feedback is passed to the next frame detection method; if a fall is detected, a voice broadcast prompt is immediately given, a warning message is sent to the management personnel in real time, and an emergency measure signal for emergency slow stop is sent to the escalator control system.
[0111] The improved method of the present invention can effectively improve the detection accuracy of small targets and shield the false detection interference of pedestrian falls in the non-escalator background area. The average detection accuracy of escalator passenger falls is 93.8%, and the detection frame rate is 87.7 frames / s. It can quickly and accurately detect the occurrence of passenger fall accidents and take safety emergency measures in time.
[0112] In addition, the lightweight model design of the improved method of the present invention can realize the model deployment of the embedded hardware platform, thus laying the foundation for the subsequent development of front-end intelligent escalator detection equipment.
[0113] Verification example:
[0114] In the embodiments of the present invention, the hardware platform is Intel i9-10900X 3.70GHz CPU, NVIDIA GeForce RTX 3090 GPU, and 32GB memory. The computer operating system is Ubuntu 20.04, and Python 3.8.13 programming language is used to program and implement PyTorch 1.12.0, Anconda 4.10.3, CUDA 11.1, and CUDNN 8.5.0 deep learning frameworks. When the network model is trained, the input image size is adjusted to 640 × 640 × 3, and the 15350 data sets are divided into two types: passenger falls (fall) and escalator areas (lift). The training set, validation set, and test set are randomly divided according to the ratio of 8:1:1. The stochastic gradient descent (SGD) optimizer is used, the number of iterations epoch is set to 300, the initial learning rate is set to 0.01, the final learning rate is set to 0.001, and the batch size is 16.
[0115] According to the different network model depths and module parameters, the Yolov8 model has a variety of network model structures, including Nano, Small, Medium, Larger, and Extra Large. Considering the actual industrial application needs, the network model of the improved method of the present invention selects Yolov8 s as the basic model through experiments to comprehensively weigh the detection performance, memory, and running rate requirements, in which the network model depth d = 0.33, the ratio r = 2.0, and the width w = 0.5.
[0116] Precision (P), recall (R), comprehensive evaluation index F1 value (F1), average precision (AP), mean average precision (mAP), and frame rate (FPS) are used to evaluate model performance. Floating-point operations (FLOPs) describe the model calculation amount and evaluate the model's requirements for hardware computing power.
[0117] AP refers to the average precision of a single category, which is obtained by the area enclosed by the PR curve and the coordinate axis. The calculation formula is as follows:
[0118]
[0119] mAP refers to the mean of the average precision of all categories, calculated as follows:
[0120]
[0121] Where n represents the total number of sample categories; APi It represents the average precision of samples in the i-th category.
[0122] The size of escalator passengers is constantly changing, and the detection accuracy of small target passengers at a long distance is low, which is easy to cause missed detection and false detection problems. Based on the Yolov8 model, Table 1 shows that the backbone network stag1 to stage4 uses the BiFormer_ROI attention mechanism module to replace the C2f module of the original network, extracting 160×160×64 shallow layers, 80×80×128 shallow layers, 40×40×256 middle layers, and 20×20×512 high-level feature information.
[0123] By analyzing the test results of the ablation experiment on escalator passenger falls, it can be seen that the shallow feature information of the Yolov8 backbone network has a small receptive field and strong spatial information, which is suitable for detecting small target objects. Most of the small target feature information is gradually lost through multiple downsampling extraction processes. At the same time, in order to balance the detection performance and the number of model parameters, the improved method of this embodiment finally chooses to use the BiFormer_ROI module to replace the C2f module of the original network in the shallow and middle-level feature extraction stages from stag1 to stage3, and the C2f module is still retained in the high-level feature extraction stage of stage4. This method can capture more details, thereby significantly improving the small target detection rate and reducing the false detection and missed detection rate. The experimental results are shown in Table 1, which shows that the Yolo_BFROI method of the embodiment of the present invention obtains higher detection performance with fewer model parameters.
[0124] Table 1
[0125] method Passenger falls AP@0.5(%) Params(M) FLOPs(G) Yolov8 91.5 11.1 28.4 +Stage 1 BiFormer_ROI 92.1 11.3 29.8 +Stage 2 BiFormer_ROI 92.6 12.7 33.8 +Stage 3 BiFormer_ROI 93.3 13.2 37.9 +Stage 4 BiFormer_ROI 93.1 13.6 39.2
[0126] This embodiment conducts a large number of ablation experiments on a self-built data set to verify the impact of the improved strategy on the detection performance. As shown in Table 2, the Yolov8 algorithm is used as a benchmark for testing. When the backbone network is integrated with the BiFormer_ROI attention mechanism, the AP@0.5 detection accuracy of escalator passenger falls is improved by 1.8%. The use of the GhostSlimPAFPN lightweight Neck network can effectively reduce the number of model parameters and the amount of calculation. The introduction of the PIoU v2 loss function in the Head network improves the AP@0.5 detection accuracy of escalator passengers falling by 0.4%. Finally, the improved Yolo_BFROI algorithm in this paper can obtain 93.8% of the passenger fall AP@0.5 detection accuracy, which is 2.3% higher than the Yolov8 algorithm. Therefore, the BiFormer_ROI attention mechanism integrated with the region of interest has a stronger feature extraction capability, and the escalator passenger fall detection accuracy is significantly improved. Other improvement strategies also have a significant contribution to the improvement of detection performance and model optimization.
[0127] Table 2
[0128] method Passenger falls AP@0.5(%) Params(M) FLOPs(G) Yolov8 91.5 11.1 28.4 +BiFormer_ROI 93.3 13.2 37.9 +GhostSlimPAFPN 93.4 12.2 35.5 +PIoU v2 93.8 12.2 35.5
[0129] Table 3 gives the performance comparison results of the improved Yolo-BFROI method of the present invention and the current mainstream passenger fall detection algorithms of Yolo v5, Yolo v6, Yolo v7, and Yolov8. Except for the Yolo v7 algorithm which uses the standard model, the other four algorithms all use the Small model. The experimental results show that all five algorithms can obtain relatively accurate escalator targets, and their AP@0.5 average detection accuracy exceeds 99%. The AP@0.5 average detection accuracy of escalator passenger falls of the improved algorithm of the present invention reaches 93.8%, which is 5.5%, 2.9%, 1.1%, and 2.3% higher than that of Yolov5, Yolov6, Yolov7, and Yolov8 algorithms, respectively. In addition, the passenger fall detection of the Yolo-BFROI algorithm of the present invention obtains 92.9% accuracy, 90.3% recall rate, and 91.6% F1 value, which is significantly better than other detection algorithms. The improved algorithm of the present invention not only significantly improves the detection performance, but also achieves a detection frame rate of 87.7 frames / s, and has better real-time performance.
[0130] Table 3
[0131]
[0132] About visualization and analysis.
[0133] Fig. 9 Shown are the visualized heat map results of the Yolov8_BFROI improved method of the present invention and the Yolov8 method. Fig. 9 (a) is the original image, Fig. 9 (b) is the heat map obtained by the Yolov8 method. It can be seen that the high activation area (red area) has a significantly wider coverage area. In addition to the passenger escalator area and part of the area outside the escalator, there are also high activation energy areas. Fig. 9 (c) shows a method that increases the region of interest but does not increase the attention mechanism. It can be seen from the figure that the distribution range of the highly activated area of the Yolov8 method in the region of interest is mainly concentrated in the escalator area and can accurately cover most areas of the body of the fallen passenger. Fig. 9(d) The Yolov8_ROI method that integrates the BiFormer attention mechanism uses the routing index and attention score extracted from the last BiFormer_ROI module in stage 3. If the query location is on the body of the fallen passenger (marked with a red dot), the corresponding routing area covers the same or similar entities. From the visualized heat map, it can be seen that the distribution range of the high-activation areas of the improved method of the present invention is more concentrated on the body of the fallen passenger. The BiFormer_ROI module filters out irrelevant area blocks and only retains the top k most relevant area blocks. Therefore, the target features to be detected can be more effectively enhanced and most of the important feature information can be focused on. The ablation experiment further confirmed that the backbone network integrated with the BiFormer_ROI attention mechanism can improve the average detection accuracy of escalator passenger falls by 1.8%.
[0134] Fig.10 The visual qualitative results of escalator passenger fall detection in a self-built data set using the improved Yolo-BFROI method of the present invention are demonstrated. The experimental results show that the fall events of small target passengers can still be accurately detected regardless of single elevator detection or double-row elevator detection, upward exit camera detection or downward exit camera detection.
[0135] In actual escalator passenger fall accidents, Fig.11 and Fig.12 Visual comparison charts of the detection results of five methods, Yolov5, Yolov6, Yolov7, Yolov8 and Yolo-BFROI, are given for images and video sequences respectively.
[0136] Depend on Fig.11 The experimental results show that the improved Yolo-BFROI method of the present invention can accurately detect fall accidents for the six images displayed, and the positioning and framing of the fallen passengers are also more accurate; the other four methods have missed detection and false detection. In particular, in the fifth image, the passenger fell on the stairs outside the escalator. The four methods Yolov5, Yolov6, Yolov7, and Yolov8 all detected the passenger's fall, while the improved method of this paper can shield the interference of pedestrians falling outside the escalator, and will not affect the operation of the escalator.
[0137] Depend on Fig.12 As shown in FIG. 1 , it can be seen from the detection results of the escalator accident video sequence that in the 65th frame where the fall accident occurs at the beginning of the video, part of the body of the fallen passenger is blocked, and only the improved Yolo-BFROI method and the Yolov8 method of the present invention can detect the passenger fall accident; subsequently, for the 195th and 415th frames of the small target passenger fall event, only the improved method of the present invention can detect the fall target, and the other four methods all miss detections.
[0138] In summary, the escalator operating environment is relatively complex, and the detection of small-target passengers at a distance is prone to missed detection and false detection. The improved region of interest Yolo_BFROI escalator passenger fall detection method of the present invention can quickly and accurately detect passenger fall accidents. The region of interest BiFormer_ROI attention mechanism module designed by the present invention can effectively shield the complex environmental interference of the non-escalator background area and effectively improve the detection rate of small targets. At the same time, the GhostSlimPAFPN lightweight structure is used to optimize the Neck network, which effectively reduces the model complexity and parameter quantity while maintaining the detection accuracy.
[0139] The improved method of the present invention adopts end-to-end prediction, which has the advantages of fast speed, high detection accuracy and easy deployment. The escalator safety intelligent monitoring and management platform can issue early warning information in time and take safety emergency stop measures immediately to ensure the safety of passengers. The escalator intelligent monitoring system can perform efficient detection throughout the day, significantly reducing the work of daily escalator safety managers. Subsequent work will deploy the improved lightweight method model of the present invention on the embedded hardware platform equipment of the front-end intelligent escalator monitoring system, develop front-end intelligent escalator detection equipment, and realize the video acquisition and intelligent detection functions of local monitoring equipment.
[0140] The present invention also discloses an escalator passenger fall detection device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor. The above method is implemented when the processor executes the computer program.
[0141] The present invention also discloses an embodiment that provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0142] The present invention also provides a computer program product. When the computer program product runs on a data storage device, the data storage device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
Claims
1. A method for detecting escalator passenger falls, It is characterized in that The following steps are involved: Acquire an image to be identified and a first region of interest in the image to be identified, wherein the first region of interest is an escalator region in the image to be identified; Using an improved Yolov8 target recognition model to perform target recognition on the image to be recognized, and obtaining passenger fall detection information in the region of interest; Among them, the BiFormer_ROI module is used to extract feature information in the feature extraction stage of the backbone network of the improved Yolov8 target recognition model.
2. An escalator passenger fall detection method as claimed in claim 1, It is characterized in that The BiFormer_ROI module is used for feature extraction, which includes depth-wise separable convolution processing, layer regularization processing, region-of-interest two-layer routing attention mechanism processing, and multi-layer perceptron processing.
3. An escalator passenger fall detection method as claimed in claim 2, It is characterized in that The region of interest dual-layer routing attention mechanism processing includes: The feature map output by the convolution module of the backbone network in the improved Yolov8 target recognition model is divided into several regional blocks; Extending the boundary line of the first region of interest outward to the boundary line of the corresponding region block to obtain a second region of interest; Extract feature information of the second region of interest.
4. An escalator passenger fall detection method as claimed in claim 2, It is characterized in that Extracting the characteristic information of the second region of interest includes: A double-layer routing attention mechanism is used to extract feature information of each of the region blocks in the second region of interest.
5. An escalator passenger fall detection method as claimed in claim 4, It is characterized in that Using a double-layer routing attention mechanism to extract feature information of each of the area blocks in the second region of interest includes: Obtaining a query vector and a key vector for each of the area blocks in the second region of interest; Calculating a query vector average value of all pixels in the query vector, calculating a key vector average value of all pixels in the key vector, and generating an adjacency matrix of the region block according to the query vector average value and the key vector average value; Determine an index matrix of each of the region blocks according to the adjacency matrix, and generate a key vector and a value vector after aggregation and integration of each of the region blocks according to the index matrix; The feature information of the region block is calculated according to the value vector of the region block, the key vector after clustering and integration, and the value vector after clustering and integration.
6. An escalator passenger fall detection method according to any one of claims 2 to 5, It is characterized in that The BiFormer_ROI module is used to extract feature information in the first, second and third stages of the feature extraction stage in the backbone network of the improved Yolov8 target recognition model.
7. An escalator passenger fall detection method according to any one of claims 2 to 5, It is characterized in that The VoV-GSCSP module is used in the Neck network of the improved Yolov8 target recognition model to replace the original C2f module.
8. An escalator passenger fall detection method as claimed in claim 6, It is characterized in that The GSConv module is used in the Neck network of the improved Yolov8 target recognition model to replace the original CBS convolution module.
9. An escalator passenger fall detection method as claimed in claim 8, It is characterized in that The loss function of the improved Yolov8 target recognition model is: L=λ 1 L Cls +λ 2 L DFL +λ 3 L PIoU-v2 , Among them, L represents the loss function of the improved Yolov8 target recognition model, L Cls represents the binary cross entropy loss, L DFL represents the distribution focal loss, L PIoU-v2 represents the PIoU_v2 loss, λ 1 Represents the weight coefficient of the binary cross entropy loss, λ 2 represents the weight coefficient of the distribution focal loss, λ 3 Represents the weight coefficient of PIoU_v2 loss.
10. An escalator passenger fall detection device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
