Railway pedestrian warning system and method based on improved YOLOv7 algorithm

By improving the YOLOv7 algorithm, the railway pedestrian alert system is built, the warning areas are dynamically divided and the risk score is calculated in combination with the potential energy field, the problem of insufficient detection accuracy and risk quantification of railway pedestrians is solved, and efficient pedestrian safety protection is achieved.

CN120299063APending Publication Date: 2025-07-11ELECTRICAL ENG CO LTD OF CTCE GRP +1

Patent Information

Application Number
CN202510375655.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The existing railway pedestrian detection system has insufficient detection accuracy, high false alarm rate and insufficient dynamic risk quantification capabilities in complex intercity railway scenarios, and cannot issue early warnings in a timely and accurate manner, resulting in an increase in pedestrian safety hazards.

Method used

The improved YOLOv7 algorithm is used to build a railway pedestrian alert system. Through the area division module, data processing module and risk scoring module, the warning area is dynamically divided, the pedestrian coordinates are identified using a high-resolution camera, the risk score is calculated based on the potential energy field and motion vector, and the hierarchical warning is performed.

Benefits of technology

It improves detection accuracy and robustness, realizes the quantification of dynamic risks of pedestrians, improves the intelligence level and response timeliness of railway pedestrian safety protection, and reduces the false alarm rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299063A_ABST
    Figure CN120299063A_ABST
Patent Text Reader

Abstract

The invention discloses a railway pedestrian warning system and method based on an improved YOLOv7 algorithm, and the method comprises the steps: dynamically dividing a warning region according to the GPS positioning of a train and a train timetable, and obtaining a plurality of regions; performing pedestrian recognition on the monitoring area by using a high-resolution camera deployed with a pedestrian target detection model to obtain pedestrian coordinates; wherein the pedestrian target detection model is constructed based on an improved YOLOv7 algorithm; calculating pedestrian dynamic potential energy fields and potential energy gradients in real time according to the pedestrian coordinates and the plurality of areas, and obtaining risk scores according to the potential energy gradients and pedestrian motion vectors; and performing graded early warning and voice warning on the pedestrians according to the risk scores. The invention relates to the technical field of railway security and protection, and solves the technical problems of insufficient detection precision, high false alarm rate and insufficient dynamic risk quantification capability of an existing security and protection system in a complex inter-city railway scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of railway safety, involves deep learning technology, and specifically relates to a railway pedestrian warning system and method based on an improved YOLOv7 algorithm. Background Art

[0002] As an important means of transportation, intercity railways connect the transportation networks between cities and provide people with a fast and efficient way to travel. However, the safety issue of pedestrians on intercity railways has always been a concern. The appearance of pedestrians on railway tracks may trigger serious safety accidents, such as pedestrians straying into the railway, crossing the railway, or waiting for transportation on the railway. These situations may lead to collision accidents, endangering the lives of pedestrians, and at the same time bringing certain safety hazards and operating pressures to railway operation and management.

[0003] However, in the face of the complex background environment of railway platforms, such as numerous interfering objects like billboards standing in great numbers and luggage stacked randomly, and the crowded scene of the platform, traditional detection technologies are difficult to accurately identify pedestrians, prone to problems of missed detection and false detection, and unable to reliably guarantee pedestrian safety. Moreover, the existing systems lack effective integration of multi-dimensional data such as the real-time position of trains and the movement trajectories of pedestrians, making it difficult to dynamically quantify the risk levels of pedestrians, and unable to intelligently adjust the warning area range according to the train operation status. As a result, when sudden dangerous behaviors occur, warnings cannot be issued in a timely and accurate manner, delaying the response time. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; for this purpose, the present invention proposes a railway pedestrian warning system and method based on an improved YOLOv7 algorithm to solve the technical problems of insufficient detection accuracy, high false alarm rate, and insufficient dynamic risk quantification ability existing in the existing security systems in complex intercity railway scenarios.

[0005] To achieve the above object, the first aspect of the present invention provides a railway pedestrian warning system based on an improved YOLOv7 algorithm, including:

[0006] A region division module: used to dynamically divide a warning area according to the train GPS positioning and train schedule to obtain several regions; wherein the several regions include a dangerous area, a buffer area, and a safe area;

[0007] A data processing module: used to identify pedestrians in a monitoring area by using a high-resolution camera deploying a pedestrian target detection model to obtain pedestrian coordinates; wherein, the pedestrian target detection model is constructed based on an improved YOLOv7 algorithm.

[0008] Risk scoring module: used to calculate the dynamic potential energy field and potential energy gradient of pedestrians in real time according to pedestrian coordinates and several regions, and obtain a risk score based on the potential energy gradient and the pedestrian movement vector;

[0009] Hierarchical warning module: used to conduct hierarchical warnings and voice alerts for pedestrians according to the risk score.

[0010] Furthermore, the dynamic division of the warning area according to the train GPS positioning and train timetable includes:

[0011] A1. Obtain the longitude and latitude coordinates (x train , y train ) and speed v train of the train in real time according to the train GPS positioning, and obtain the estimated arrival time t ETA of the next train from the train timetable;

[0012] A2. Calculate the dynamically expanding radius R according to the formula R = R base + v train · (t ETA - t current ) · k; where, R base represents the basic radius, t current represents the current time, and k represents the adjustment coefficient for controlling the expansion speed;

[0013] A3. Before the train enters the platform, the warning area is divided as follows:

[0014] Divide the area with the train as the center and a radius of R into a dangerous area;

[0015] Divide the annular area with an extension of D distance from the dangerous area into a buffer area;

[0016] Divide the remaining area into a safe area;

[0017] A4. When the train enters the platform, the warning area is divided as follows:

[0018] Divide the area on both sides of the center line of the railway track with a distance of a into a dangerous area;

[0019] Divide the area on both sides of the center line of the railway track with a distance of (a, b] into a buffer area;

[0020] Divide the remaining area into a safe area;

[0021] A5. Map the coordinates of the dangerous area, buffer area, and safe area to the field of view of the high-resolution camera to generate a virtual electronic fence.

[0022] It should be noted that if there are overlapping areas in the divided regions, the overlapping areas shall be subject to the higher-level regions, and the ranking of several regions is: dangerous area > buffer area > safe area; for example, if there is an overlapping part between the dangerous area and the buffer area, the overlapping part shall be divided into the dangerous area.

[0023] During the dynamic area division process, before the train enters the platform, the radius of the dangerous area can be dynamically adjusted according to factors such as the train speed, the estimated arrival time, and the current time; when the train enters the platform, different areas are divided according to the distance on both sides of the track center line. By flexibly adjusting the warning range, various actual factors during the train operation are fully considered, which can effectively improve the safety guarantee ability for railway pedestrians in different scenarios, and by mapping the area coordinates to the camera field of view to generate a virtual electronic fence, it is convenient for subsequent personnel monitoring and early warning in combination with video surveillance.

[0024] Furthermore, the pedestrian target detection model is constructed based on the improved YOLOv7 algorithm, including:

[0025] B1. Improve the original YOLOv7 network:

[0026] Replace the backbone feature extraction network of the original YOLOv7 network with the lightweight network FasterNet;

[0027] And replace the upsampling operator of the original YOLOv7 network with the lightweight upsampling operator CARAFE to reduce the model parameters and improve the model feature extraction ability;

[0028] Introduce the SimAM attention mechanism to improve the model's perception ability for people in complex backgrounds near intercity railways;

[0029] And further enhance the robustness of the model in dense places near intercity railways based on the EIOU loss function in the post-processing part to obtain the YOLOv7-FasterNet network model;

[0030] B2. Retrieve the videos of the cameras at the platforms near intercity railways, use the frame extraction algorithm every other second to obtain pedestrian picture data and conduct manual screening to obtain a picture set;

[0031] B3. Use the annotation tool to annotate the picture set to obtain the original data set containing pictures and pedestrian labels;

[0032] B4. After data augmentation of the original data set according to a preset ratio, divide it into a training set, a validation set, and a test set according to a preset division ratio;

[0033] B5. Pre-train the YOLOv7-FasterNet network using the ImageNet data set, save the pre-trained weights to obtain the pre-trained model;

[0034] B6. Fine-tune the parameters of the pre-trained model using the training set, validation set, and test set to obtain a pedestrian target detection model that meets the preset accuracy requirements.

[0035] In the YOLOv7-FasterNet network model, the FasterNet lightweight backbone network reduces redundant calculations through partial convolution (PConv) technology and can effectively adapt to the computing power limitations of edge devices such as NVIDIA Jetson Xavier NX. Secondly, the CARAFE dynamic upsampling operator improves the fusion efficiency of the feature pyramid by predicting the exclusive convolution kernel at each position, thereby improving the accuracy of pedestrian detection. At the same time, the SimAM parameter-free attention mechanism adaptively assigns weights through the energy function, which can suppress interference information in complex backgrounds and reduce the false detection rate of the model. In addition, by applying the EIoU loss function, the combination of overlap loss, center distance, and aspect ratio constraints is enhanced to improve the localization accuracy of the model in dense scenarios, providing an efficient solution for pedestrian safety protection in intercity railways.

[0036] Furthermore, the deployment process of the pedestrian target detection model includes:

[0037] After configuring the deep learning environment on NVIDIA Jetson Xavier NX, deploy the pedestrian target detection model on NVIDIA Jetson Xavier NX;

[0038] Use TensorRT to accelerate the inference of the deployed pedestrian target detection model to improve the real-time processing performance of the pedestrian target detection model.

[0039] Furthermore, the real-time calculation of the pedestrian dynamic potential field according to the pedestrian coordinates and several regions includes:

[0040] Use the pedestrian target detection model to obtain the coordinates (x t , y t ) of the pedestrian at time t in real time;

[0041] According to the formula Calculate the pedestrian dynamic potential field U(x t , y t ); where t acc represents the cumulative time when the pedestrian enters the monitoring area, k z (t) represents the dynamic potential strength in the region z at time t, T Y represents the time series when the pedestrian entered the buffer area in history, λ1 represents the spatial weight, which is set according to the pedestrian in the region z, λ2 represents the historical memory weight, and λ3 represents the time decay coefficient.

[0042] Furthermore, the dynamic potential strength kz The acquisition method of (t) includes:

[0043] Mark the dangerous area as set Ω R , mark the buffer area as set Ω Y , mark the safe area as set Ω G ;

[0044] Among them, k R , k Y , k G respectively represent the basic potential energy intensities of the dangerous area, the buffer area and the safe area, and k R > k Y > k G , α(t) represents the time-sensitive coefficient, which is calculated according to the formula Calculate, t train represents the arrival time of the next train, N(t) represents the cumulative number of pedestrians entering the buffer area Ω Y .

[0045] The potential energy field is used to describe the potential energy that an object has at different positions in space. In the present invention, the position and behavior of a pedestrian are mapped into an energy field, and the higher the energy, the greater the risk. Therefore, the dynamic potential energy field constructs a multi-dimensional risk perception model through spatial partition quantization, time sensitivity enhancement and historical behavior cumulative effect. Its mathematical expression combines the concept of physical potential energy with pedestrian behavior science, enabling the system to accurately identify high-risk scenarios (such as pedestrians approaching the dangerous area quickly and the train is about to arrive), thereby triggering hierarchical early warnings and improving the intelligent level of intercity railway safety protection.

[0046] Furthermore, the calculation formula of the potential energy gradient is:

[0047] Furthermore, obtaining the risk score according to the potential energy gradient and the pedestrian motion vector includes:

[0048] According to the formula Calculate the pedestrian motion vector; where, Δt represents the preset time interval;

[0049] According to the risk score formula: Calculate the risk score S; where, η1 represents the position term coefficient, η2 represents the acceleration term coefficient, and |||| represents the modulus length.

[0050] In the risk scoring formula, the pedestrian motion vector predicts the behavior trend by quantifying the speed and direction (the risk increases when moving towards the high potential energy area); the potential energy gradient reflects the spatial mutation characteristics of the dangerous area (the steep rise in gradient represents the risk boundary effect); the acceleration term captures the severity of the speed change (such as sudden acceleration suggesting the intention to break in). Through the real-time updated dynamic potential energy field model, the train position, time decay factor and pedestrian behavior data are continuously integrated, so that the scoring mechanism can accurately respond to instantaneous state changes - automatically strengthen the potential energy field strength when the train approaches, and dynamically correct the gradient distribution when the pedestrian movement trajectory deviates, so as to achieve accurate spatial and temporal matching of risk warning.

[0051] Furthermore, the step of providing graded warning and voice warning to pedestrians according to risk scores includes:

[0052] Set the first level threshold A and the second level threshold B, and A>B;

[0053] When the risk score S∈(0,B], a green safety signal is sent to the staff;

[0054] When the risk score is S∈(B,A], a yellow warning signal is sent to the staff;

[0055] When the risk score S∈[A,+∞), a red danger signal is sent to the staff and a voice alarm is broadcast.

[0056] The second aspect of the present invention provides a railway pedestrian warning method based on an improved YOLOv7 algorithm, comprising:

[0057] S1, dynamically dividing the warning area according to the train GPS positioning and the train schedule to obtain a number of areas; wherein the number of areas include a dangerous area, a buffer area and a safe area;

[0058] S2, using a high-resolution camera equipped with a pedestrian target detection model to identify pedestrians in the monitoring area to obtain pedestrian coordinates; wherein the pedestrian target detection model is constructed based on an improved YOLOv7 algorithm;

[0059] S3, calculates the pedestrian's dynamic potential field and potential gradient in real time based on the pedestrian's coordinates and several regions, and obtains a risk score based on the potential gradient and the pedestrian's motion vector;

[0060] S4, provides graded warnings and voice alerts to pedestrians based on risk scores.

[0061] Compared with the prior art, the present invention has the following beneficial effects:

[0062] In terms of detection accuracy and robustness, the present invention achieves a balanced optimization of detection efficiency and accuracy through the improvement of the YOLOv7 algorithm. Replacing the original backbone network with FasterNet significantly reduces the number of model parameters, and combining with the CARAFE lightweight upsampling operator enhances the computational efficiency, which is particularly suitable for the deployment requirements of edge devices; the introduced SimAM attention mechanism effectively improves the pedestrian recognition accuracy under the complex background of railway platforms (such as interference objects like billboards and stacked luggage) through parameter-free feature enhancement. The EIOU loss function optimizes by fusing the center point distance and aspect ratio, which can reduce the missed detection rate in the scenario of dense crowds and enhance the robustness of the model;

[0063] In terms of dynamic risk quantification, the present invention constructs a risk scoring model by integrating multi-dimensional data such as the real-time position of trains and pedestrian movement trajectories to achieve dynamic quantification of risk levels; and based on the train operation status, it intelligently adjusts the range of the warning area, avoiding resource waste while ensuring safety coverage, and can improve the response timeliness to sudden dangerous behaviors;

[0064] At the system deployment level, the present invention's hardware adaptation solution based on NVIDIA Jetson Xavier NX cooperates with the TensorRT acceleration engine to boost the model inference speed to meet the real-time video stream processing requirements; and the hierarchical warning mechanism implements a differentiated warning strategy according to the risk score, ensuring that high-risk events can trigger strong warnings while reducing the false alarm rate, forming a complete warning system from safety reminders to emergency alarms. Brief Description of the Drawings

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0066] Figure 1 It is a schematic diagram of the technical process of the railway pedestrian warning system based on the improved YOLOv7 algorithm provided by the present invention;

[0067] Figure 2 It is a schematic diagram of the framework of the railway pedestrian warning system based on the improved YOLOv7 algorithm provided by the present invention;

[0068] Figure 3 It is a schematic diagram of the working process of the area division module provided by the present invention;

[0069] Figure 4 It is a framework diagram of the pedestrian target detection model constructed based on the improved YOLOv7 algorithm provided by the present invention. Specific Embodiments

[0070] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative work shall fall within the protection scope of the present invention.

[0071] Please refer to Figures 1-4 , the first aspect embodiment of the present invention provides a railway pedestrian warning system based on an improved YOLOv7 algorithm, including:

[0072] Area Division Module: It is used to dynamically divide the warning area according to the train GPS positioning and train schedule to obtain several areas; among them, several areas include dangerous areas, buffer areas and safe areas;

[0073] Data Processing Module: It is used to identify pedestrians in the monitoring area by using a high-resolution camera deployed with a pedestrian target detection model to obtain pedestrian coordinates; among them, the pedestrian target detection model is constructed based on an improved YOLOv7 algorithm;

[0074] Risk Scoring Module: It is used to calculate the pedestrian dynamic potential field and potential gradient in real time according to the pedestrian coordinates and several areas, and obtain the risk score according to the potential gradient and the pedestrian motion vector;

[0075] Hierarchical Warning Module: It is used to conduct hierarchical warnings and voice warnings for pedestrians according to the risk score.

[0076] It should be noted that the area division module, data processing module, risk scoring module and hierarchical warning module of the present invention are in communication connection.

[0077] In this embodiment, the area division module realizes real-time dynamic area division by fusing train dynamic information and track geographical data. The specific steps are as follows:

[0078] First, obtain the real-time longitude and latitude coordinates (x train , y train ), running speed v train through train GPS positioning, and extract the expected arrival time t ETA of the next train from the train schedule;

[0079] Then set the basic radius R base , adjustment coefficient k (used to control the expansion speed, set based on historical experience), extension distance D (used to control the width of the buffer area), track safety distances a and b;

[0080] Then use the formula R = R base + vtrain ·(t ETA -t current )·k Calculate the dynamic expansion radius R of the danger area, where t current is the current time;

[0081] Then, conduct area division according to the train operation position:

[0082] Before the train enters the platform: (It can be judged whether the train enters the platform through GPS positioning)

[0083] Danger area: A circular area with a radius of R centered on the train;

[0084] Buffer area: An annular area D meters outside the danger area;

[0085] Safe area: The remaining area;

[0086] When the train enters the platform:

[0087] Danger area: a meters on both sides of the track center line;

[0088] Buffer area: a to b meters on both sides of the track center line;

[0089] Safe area: The remaining platform area.

[0090] Then, convert the geographical coordinates of the danger area, buffer area, and safe area into pixel coordinates in the camera's field of view, generate a virtual electronic fence, and overlay it on the monitoring screen;

[0091] When the divided areas overlap, they are overlaid according to the priority: danger area > buffer area > safe area. For example, when the danger area of a certain train overlaps with the safe area of another train, the overlapping area is the danger area.

[0092] The area division module improves the accuracy and adaptability of railway pedestrian safety protection through a spatio-temporal coupling intelligent area division strategy. Based on the real-time speed and remaining time of the train, this module dynamically expands the radius of the danger area. In the non-station approach phase, it uses a dynamic circular area to cover the potential risks in the train's traveling direction, and switches to a fixed-distance division on both sides of the track center line after entering the station to adapt to the dense passenger flow scenario on the platform. At the same time, combined with the train timetable, it dynamically adjusts the potential energy intensity of the danger area through a time-sensitive coefficient, so that the risk level gradually increases as the train approaches. In addition, the module integrates GPS positioning, track geographical data, and the camera's field of view, realizes the accurate mapping from the physical space to the virtual monitoring area, ensures that the electronic fence fits well with the actual scenario, and provides guarantee for the safety of railway pedestrians.

[0093] In the area division module, assume a certain intercity railway station, the train approaches the platform at 80 km / h, and the expected arrival time t ETA = 14:05:00, the current time tcurrent = 14:00:00, then t ETA -t current = 5 min = 0.0833 h, set R base = 50 m, k = 0.03;

[0094] Then calculate the dynamic radius: R = 50 + 80 × 0.0833 × 0.03 × 1000 = 249.92 m ≈ 250 m; (where multiplying by 1000 means converting the unit km to m)

[0095] Before entering the station: The danger zone is a circular area with a radius of 2500 meters centered on the train; the buffer zone is an annular area with an extension of 50 meters (D = 50 m);

[0096] After entering the station: The danger zone is 3 meters on each side of the center line of the track; the buffer zone is the area from 3 meters to 8 meters.

[0097] Then map the coordinates of the above areas to the platform camera screen and overlay red (dangerous) and yellow (buffer) warning frames.

[0098] To improve the safety of pedestrians on intercity railways, an effective pedestrian monitoring and warning system needs to be established. Since traditional pedestrian detection algorithms are prone to problems such as low detection accuracy, high false alarm rate, and insufficient detection ability for small targets in the face of complex intercity railway scenarios. Therefore, in the data processing module, a pedestrian target detection model is constructed based on the improved YOLOv7 algorithm and deployed on a high-resolution camera to perform real-time recognition of the monitoring area, obtain pedestrian coordinates, and provide a data basis for subsequent risk scoring.

[0099] In this embodiment, the specific improvement and deployment process of the YOLOv7 algorithm may include the following steps:

[0100] S1: Obtain the video data of pedestrians near the intercity railway platform by retrieving the camera, write video frame extraction code to perform video frame extraction operations to obtain picture data and perform screening, filter out pictures with a high repetition rate, and retain pictures with a low repetition rate;

[0101] Perform data augmentation on the screened pictures through data augmentation code, expand the original pictures by a ratio of 1:7 for data augmentation, and the data augmentation methods include: flipping, rotating, cropping, scaling, translation, Gaussian noise, and mosaic. Divide the data set into a training set, a validation set, and a test set according to 6:2:2;

[0102] S2: Perform lightweight improvement on the YOLOv7 algorithm to obtain the YOLOv7-FasterNet network model:

[0103] Replace the backbone feature extraction network of the original YOLOv7 algorithm with the lightweight network FasterNet;

[0104] Replace the upsampling operator with the lightweight upsampling operator CARAFE to reduce model parameters and improve the model's feature extraction ability;

[0105] Introduce the SimAM attention mechanism to enhance the model's perception ability of people in complex backgrounds near intercity railways;

[0106] And in the post-processing part, further enhance the robustness of the model in dense places near intercity railways based on Soft-EIOU-NMS.

[0107] Specifically, in order to minimize model parameters as much as possible and solve problems such as poor real-time performance at the edge end caused by excessive parameter quantities. In this embodiment, the backbone feature extraction network in the object detection network YOLOv7 is replaced with the lightweight network FasterNet. Compared with the traditional YOLOv7 backbone convolutional network, FasterNet consists of three main parts: a basic network module, a feature fusion module, and an upsampling module, and can be divided into four hierarchical stages as a whole. Each stage is equipped with a set of FasterNet blocks, and an embedding or merging layer is set in front of each stage, and the last three layers are used for feature classification. Inside each FasterNet block, its structure is a partial convolution (PConv) layer followed by two pointwise convolution (PWConv) layers, and normalization (BN) layers and activation layers (ReLU) are only placed after the middle layer. This design can retain the diversity of features and achieve lower latency;

[0108] For example, if a set of feature maps with dimensions of H in ×W in ×C in are used as input data, where H in , W in , C in correspond to the height, width, and number of channels of the input feature map respectively, and the output is H out ×W out ×C out , then the relationship between the input layer and the output layer of n standard convolutional layers with convolution kernels of k×k×c is as follows:

[0109]

[0110] C in =c

[0111] C out =n

[0112] Where: p represents the patch; c represents the number of channels of the convolutional kernel; n represents the number of convolutional kernels; w×h represents the convolutional dimension; s represents the stride;

[0113] Then the calculation formulas for the amount of computation FLOPs and the number of parameters params of this operation are as follows:

[0114] FLOPs = C in × k 2 × C out × W in × H in

[0115] params = C out × (k 2 × C in + 1)

[0116] Where: FLOPs is the number of floating-point operations, used to measure the computational complexity of the model; C in represents the number of input channels; k represents the size of the standard convolutional kernel; C out represents the number of output channels, which is also the number of convolutional kernels n.

[0117] The main reason that the FasterNet module found that the existing operator DWConv leads to the problem of low FLOPs is the frequent memory access. Therefore, based on the redundancy of the features of the convolutional neural network, partial convolution (PConv) is proposed. The purpose of the partial convolution design is to reduce both memory access and computational redundancy at the same time. The calculation method of its FLOPs1 is as follows:

[0118]

[0119] If the ratio operation is performed on the two, it can be seen that the partial convolution of FasterNet can significantly reduce the amount of computation and achieve the purpose of a lightweight network:

[0120]

[0121] Since the present invention needs to be deployed on edge devices, therefore, in this embodiment, the ordinary upsampling operator in the original YOLOv7 algorithm is replaced with the lightweight upsampling operator CARAFE;

[0122] The CARAFE lightweight upsampling operator is mainly divided into two modules, namely the upsampling kernel prediction module and the feature recombination module;

[0123] Among them, the upsampling kernel prediction module is divided into three steps: feature map channel compression, content encoding, upsampling kernel prediction, and upsampling kernel normalization;

[0124] In the compression of the feature map channels, for an input feature map with the shape of H×W×C, first use a 1×1 convolution to compress its number of channels to C m , and the main purpose of this step is to reduce the computational complexity of the subsequent steps;

[0125] In content encoding and upsampling kernel prediction, for the compressed input feature map in the first step, use a k encoder ×k encoder convolutional layer to predict the upsampling kernel, with the number of input channels being C m , and the number of output channels being Then expand it in the spatial dimension to obtain an upsampling kernel with the shape of ;

[0126] In upsampling kernel normalization, use softmax to normalize the upsampling kernel obtained in the second step so that the sum of the convolutional kernel weights is 1.

[0127] Feature recombination module: For each position in the output feature map, map it back to the input feature map, extract a k up ×k up region centered on it, and take the dot product with the predicted upsampling kernel at this point to obtain the output value. Different channels at the same position share the same upsampling kernel.

[0128] The background near the intercity railway is complex and the population is dense. In order to improve the model's spatio-temporal perception ability of people, the SimAM attention mechanism is introduced:

[0129] Given a query sequence Q and a key-value pair sequence K, the attention mechanism determines the attention weights by calculating the similarity between the query sequence and the key sequence. The specific process is divided into the following three steps: For each element q in the query sequence Q, calculate its cosine similarity with each element k in the key sequence K; for each query sequence element q, obtain the attention weights by normalizing its similarity with the key sequence element k; use the attention weights to perform weighted summation on the value sequence V to obtain the final attention representation.

[0130] Next, in terms of the loss function, the general loss function does not take into account the direction problem between the true box and the predicted box, and the convergence speed is also slow. In this embodiment, EIoU is introduced into the improved YOLOv7 model to improve the training speed, including the non-overlapping loss (L IoU ), the center distance loss (L dis ), and the width and height loss (L asp ) by introducing appropriate loss functions, and their calculation formulas are as follows:

[0131]

[0132] Where: IoU represents the IoU loss, ρ 2 (b, b gt ) represents the Euclidean distance between the center points of the predicted box and the ground truth box, ρ 2 (w, w gt ), ρ 2 (h, h gt ) represent the Euclidean distances between the width and height of the predicted box and the width and height of the ground truth box respectively; where c represents the diagonal length of the smallest bounding rectangle that can simultaneously contain the predicted box and the ground truth box; and are the width and height of the smallest bounding box covering the two Boxes.

[0133] Through the above steps, the most effective pedestrian target detection network YOLOv7-FasterNet can be obtained.

[0134] S3: In the training of the model, first pre-train through the ImageNet dataset, then use the collected pedestrian dataset near the intercity railway to train the improved model, and perform parameter fine-tuning on it. After the training is completed, obtain the final weights and various training data evaluation indicators. At the same time, test the improved model on the test set to obtain a pedestrian target detection model that meets the preset accuracy requirements;

[0135] S4: By analyzing the comparison between the model parameter quantity and the computing power of the edge device, in this embodiment, NVIDIA Jetson Xavier NX is selected as the intelligent hardware processing device at the edge end of the data processing module;

[0136] Deploy the pedestrian target detection model on the edge-end embedded device NVIDIA Jetson Xavier NX, configure the deep learning environment for the hardware device, and at the same time use TensorRT to perform inference acceleration on the deployed target detection model to further improve the real-time processing performance of the lightweight YOLOv7 model at the edge device end.

[0137] After the data processing module obtains the pedestrian coordinates (x t , y t ), it is transmitted to the risk scoring module to perform real-time pedestrian motion feature recognition and dynamic potential field calculation, and then calculate the risk score according to the potential gradient and the pedestrian motion vector to achieve risk quantification. The specific steps are as follows:

[0138] First, mark the dangerous area as the set Ω R , mark the buffer area as the set Ω Y , and mark the safe area as the set Ω G ; Dynamically calculate the potential strength k z (t):

[0139] When the pedestrian is in the danger area, k z (t) = k R ·α(t), where it means that the closer the time is to the arrival of the train, the stronger the potential energy;

[0140] When the pedestrian is in the buffer area, k z (t) = k Y ·(1 + β·N(t)), where β represents the cumulative effect coefficient of the buffer area, determined based on historical experience, and N(t) represents the cumulative number of times the pedestrian enters the buffer area Ω Y ; that is, the more times the pedestrian enters the buffer area, the stronger the potential energy;

[0141] When the pedestrian is in the safe area, k z (t) = k G ;

[0142] Among them, k R , k Y , k G respectively represent the basic potential energy intensities of the danger area, the buffer area, and the safe area, and k R > k Y > k G ;

[0143] Then, calculate the dynamic potential energy field of the pedestrian according to the formula: Among them, t acc represents the cumulative time when the pedestrian enters the monitoring area, T Y represents the time series of the pedestrian entering the buffer area in history, λ1 represents the spatial weight, set according to the pedestrian in the area z, λ2 represents the historical memory weight, and λ3 represents the time decay coefficient, which weights and decays the past behavior of entering the buffer area, all set based on historical experience;

[0144] Calculate the gradient vector of the potential energy field:

[0145] Calculate the instantaneous pedestrian motion vector based on the coordinate differences of several consecutive frames: Among them, Δt represents the preset time interval;

[0146] According to the risk scoring formula: Calculate the risk score S; among them, η1 represents the position term coefficient, η2 represents the acceleration term coefficient, and |||| represents the modulus.

[0147] Exemplarily, assume that the basic potential energy intensities of each area are: k R = 100, k Y = 50, k G= 10;

[0148] In the calculation formula of buffer potential energy intensity, β = 0.5;

[0149] In the calculation formula of the dynamic potential energy field, the coefficients are: λ1 = 0.6, λ2 = 0.4, λ3 = 0.1;

[0150] In the risk scoring formula, the coefficients are: η1 = 0.3, η2 = 0.2;

[0151] If the predicted arrival time of the train is 14:00 and the current time t = 13:57, then t train - t = 180s. At this time, after detecting that a certain pedestrian enters the monitoring area, the cumulative time t acc = 150s, and the pedestrian has entered the buffer area 3 times historically, and the time series is T Y = {100, 120, 140};

[0152] Then the weighted sum of historical items is calculated:

[0153] If the current pedestrian is in the buffer area, then the potential energy intensity at this time is: k z (t) = k Y ·(1 + β·N(t)) = 50×(1 + 0.5×3) = 125;

[0154] Dynamic potential energy field

[0155] Assume the pedestrian coordinates (x t , y t ) = (5, 3), and the potential energy gradient is (example value, actually needs to be calculated by differentiation);

[0156] Δt = 0.5s, (x t+Δt , y t+Δt ) = (5.5, 3.2); (x t+2Δt , y t+2Δt ) = (6.1, 3.5);

[0157] Acceleration

[0158] Then the risk score

[0159] Finally, in the hierarchical warning module: according to the risk score, the pedestrian is given a hierarchical warning and voice warning, including:

[0160] Set the first-level threshold A and the second-level threshold B, and A > B;

[0161] When the risk score S ∈ (0, B], send a green safety signal to the staff;

[0162] When the risk score S ∈ (B, A], send a yellow warning signal to the staff;

[0163] When the risk score S ∈ [A, +∞), send a red danger signal to the staff and conduct a broadcast voice warning.

[0164] Assume that the set threshold A = 5 and B = 2. If the score result in the above example ∈ (2, 5], the system will send a yellow warning signal to the visualization device of the staff. The staff will quickly find the pedestrian and give a prompt and warning.

[0165] The second aspect of the embodiments of the present invention provides a railway pedestrian warning method based on an improved YOLOv7 algorithm, including:

[0166] S1, Dynamically divide the warning area according to the train GPS positioning and the train timetable to obtain several areas; among them, several areas include a dangerous area, a buffer area, and a safe area;

[0167] S2, Use a high-resolution camera deployed with a pedestrian target detection model to identify pedestrians in the monitoring area to obtain pedestrian coordinates; among them, the pedestrian target detection model is constructed based on an improved YOLOv7 algorithm;

[0168] S3, Calculate the pedestrian dynamic potential field and potential gradient in real time according to the pedestrian coordinates and several areas, and obtain the risk score according to the potential gradient and the pedestrian motion vector;

[0169] S4, Conduct hierarchical warnings and voice warnings for pedestrians according to the risk score.

[0170] Some of the data in the above formula are calculated by removing the dimension and taking its numerical value. The formula is obtained by software simulation of a large amount of collected data to get a formula closest to the real situation; the preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through a large amount of data simulation.

[0171] The working principle of the present invention:

[0172] First, dynamically divide the area according to information such as the real-time position, speed, and arrival time of the train. When the train is not in the station, dynamically adjust the radius of the dangerous area; when entering the station, divide the fixed area according to the center line of the track, and then form a virtual electronic fence including three levels of areas: dangerous, buffer, and safe;

[0173] Next, a high-resolution camera based on the improved YOLOv7-FasterNet model is used to identify pedestrian positions in real time, and the detection accuracy and efficiency in complex scenarios are improved with the help of lightweight networks and attention mechanisms.

[0174] Then, a dynamic potential field is constructed by combining the pedestrian’s current location, train approach time, and historical crossing behavior to quantify the risk, and the risk score is calculated by comprehensively considering the pedestrian’s movement direction (risk increases when moving toward the dangerous area), potential gradient (steepness of the dangerous boundary), and acceleration (drastic changes in speed);

[0175] Finally, three levels of warnings, green (safety), yellow (warning), and red (danger and voice alarm), are triggered based on the risk score to achieve differentiated safety responses, forming a closed-loop protection system from detection to warning, and improving the intelligence and timeliness of railway pedestrian safety protection.

[0176] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A railway pedestrian warning system based on an improved YOLOv7 algorithm, characterized in that, Including: Area division module: used to dynamically divide the warning area according to the train GPS positioning and train timetable, and obtain several areas; Among them, the several areas include a dangerous area, a buffer area, and a safe area; Data processing module: used to identify pedestrians in the monitoring area by using a high-resolution camera deployed with a pedestrian target detection model to obtain pedestrian coordinates; among them, the pedestrian target detection model is constructed based on the improved YOLOv7 algorithm; Risk scoring module: used to calculate the pedestrian dynamic potential field and potential gradient in real time according to the pedestrian coordinates and several areas, and obtain a risk score according to the potential gradient and the pedestrian motion vector; Hierarchical warning module: used to conduct hierarchical warnings and voice warnings for pedestrians according to the risk score.

2. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 1, characterized in that, The dynamic division of the warning area according to the train GPS positioning and train timetable includes: A1. Obtain the longitude and latitude coordinates (x train , y train ) and speed v train of the train in real time according to the train GPS positioning, and obtain the estimated arrival time t ETA of the next train from the train timetable; A2, the dynamic expansion radius R is calculated according to the formula R = R base + v train · (t ETA - t current ) · k; where R base represents the base radius, t current represents the current time, and k represents the adjustment coefficient used to control the expansion speed; A3. When the train has not entered the platform, the division of the warning area is: The area with a radius of R centered on the train is divided into a dangerous area; The annular area with an extension of D distance from the dangerous area is divided into a buffer area; The remaining area is divided into a safe area; A4. When the train enters the platform, the division of the warning area is: The area with a distance of a on both sides of the center line of the railway track is divided into a dangerous area; The area with a distance of (a, b] on both sides of the center line of the railway track is divided into a buffer area; The remaining area is divided into a safe area; A5. Map the coordinates of the dangerous area, buffer area, and safe area to the field of view of the high-resolution camera to generate a virtual electronic fence.

3. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 1, characterized in that, The pedestrian target detection model is constructed based on the improved YOLOv7 algorithm, including: B1. Improve the original YOLOv7 network: Replace the backbone feature extraction network of the original YOLOv7 network with the FasterNet network, and replace the upsampling operator of the original YOLOv7 network with the CARAFE upsampling operator; Introduce the SimAM attention mechanism and the EIOU loss function to obtain the YOLOv7-FasterNet network model; B2. Retrieve the videos of the cameras near the intercity railway platforms, and use the frame extraction method every other second to obtain pedestrian picture data and conduct manual screening to obtain a picture set; among them, the frame extraction method every other second means extracting a video frame every other second; B3. Use the annotation tool to annotate the picture set to obtain the original data set containing pictures and pedestrian labels; B4. After performing data augmentation on the original data set according to a preset ratio, divide it into a training set, a validation set, and a test set according to a preset division ratio; B5. Pre-train the YOLOv7-FasterNet network using the ImageNet data set, save the pre-trained weights, and obtain a pre-trained model; B6. Fine-tune the parameters of the pre-trained model using the training set, validation set, and test set to obtain a pedestrian target detection model that meets the preset accuracy requirements.

4. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 3, characterized in that, The deployment process of the pedestrian target detection model includes: After configuring the deep learning environment on the NVIDIA Jetson Xavier NX, deploy the pedestrian target detection model on the NVIDIA Jetson Xavier NX; Use TensorRT to accelerate the inference of the deployed pedestrian target detection model and improve the real-time processing performance of the pedestrian target detection model.

5. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 1, characterized in that, The real-time calculation of the pedestrian dynamic potential energy field according to the pedestrian coordinates and several regions includes: Obtain the coordinates (x t , y t ) of the pedestrian at time t in real time using the pedestrian target detection model; According to the formula calculate the dynamic potential energy field U(x t ,y t ) of the pedestrian; where, t acc represents the cumulative time when the pedestrian enters the monitoring area, k z (t) represents the dynamic potential energy intensity in the area z at time t, T Y represents the time series when the pedestrian enters the buffer area in history, τ represents each specific time point when the pedestrian enters the buffer area in history, λ1 represents the spatial weight, which is set according to the pedestrian in the area z, λ2 represents the historical memory weight, and λ3 represents the time decay coefficient.

6. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 5, characterized in that, The acquisition method of the dynamic potential energy intensity k z (t) includes: Mark the dangerous area as set Ω R , mark the buffer area as set Ω Y , mark the safe area as set Ω G ; Among them, k R , k Y , k G respectively represent the basic potential energy intensities of the danger area, the buffer area, and the safety area, and k R > k Y > k G , α(t) represents the time-sensitive coefficient, t train represents the time when the train arrives at the platform, N(t) represents the cumulative number of pedestrians entering the buffer area Ω Y , and β represents the cumulative effect coefficient of the buffer area.

7. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 6, characterized in that, The time-sensitive coefficient is calculated according to the formula as follows.

8. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 5, characterized in that, Obtaining the risk score according to the potential energy gradient and the pedestrian motion vector includes: According to the formula the pedestrian motion vector is calculated; where, Δt represents a preset time interval; According to the risk scoring formula: The risk score S is calculated; where, η1 represents the position term coefficient, η2 represents the acceleration term coefficient, |||| represents the modulus length, represents the potential energy gradient, and the calculation formula is:

9. The railway pedestrian warning system based on the improved YOLOv7 algorithm according to claim 1, characterized in that, Performing hierarchical warning and voice warning on pedestrians according to the risk score includes: Set the first-level threshold A and the second-level threshold B, and A > B; When the risk score S ∈ (0, B], send a green safety signal to the staff; When the risk score S ∈ (B, A], send a yellow warning signal to the staff; When the risk score S ∈ [A, +∞), send a red danger signal to the staff and conduct a broadcast voice warning.

10. A railway pedestrian warning method based on an improved YOLOv7 algorithm, which is applied to the railway pedestrian warning system based on the improved YOLOv7 algorithm described in any one of claims 1-9, and is characterized in that, Includes: S1. Dynamically divide the warning area according to the train GPS positioning and the train schedule to obtain several regions; where the several regions include a dangerous area, a buffer area, and a safe area; S2. Use a high-resolution camera deployed with a pedestrian target detection model to identify pedestrians in the monitoring area to obtain pedestrian coordinates; among them, the pedestrian target detection model is constructed based on the improved YOLOv7 algorithm; S3. Calculate the pedestrian dynamic potential energy field and the potential energy gradient in real time according to the pedestrian coordinates and several regions, and obtain the risk score according to the potential energy gradient and the pedestrian motion vector; S4. Perform hierarchical warning and voice warning on pedestrians according to the risk score.

Citation Information

Patent Citations

  • Data aggregation method with attribute correlation

    CN102118819A

  • Construction alert area monitoring and early warning system and method based on image recognition

    CN112216049A

  • Classroom student attendance counting method based on AI

    CN118470633A

  • Collision prevention system of mobile robot in unknown environment and method thereof

    KR1020130094533A

  • Pedestrian road-crossing behavior prediction method for plane intersection

    WO2022110611A1

Cited By

  • Warning method and system for high-risk area of structural fatigue loading laboratory

    CN121148089A

  • A structural fatigue loading laboratory high-risk area warning method and system

    CN121148089B

  • Skin mucosa disinfection preparation production filling monitoring system based on deep learning

    CN121686367A

  • Deep Learning-Based Monitoring System for the Production and Filling of Skin and Mucous Membrane Disinfectants

    CN121686367B