Personnel detection method and system for rail transit
By combining video stream data processing and the YOLOv8 model with spatial correlation logic, a method for detecting personnel in rail transit has been developed. This method solves the problems of low efficiency and high false alarm rate in existing railway intrusion detection, achieving efficient and accurate identification of construction personnel and intruders, and improving the level of intelligence in railway safety management.
Patent Information
- Application Number
- CN202511836177.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-02-10
AI Technical Summary
Existing railway intrusion detection methods are inefficient, have a high false alarm rate, and are not adaptable to complex environments, making it difficult to meet the high standards required for safe operation of modern railways.
A method for detecting people in rail transit based on video stream data is adopted, including image preprocessing, background modeling, foreground detection, morphological optimization, connected component analysis, and target detection using the YOLOv8 model. This method is combined with the spatial association logic of pre-set safety objects to identify people.
It achieves accurate identification of target personnel, has a low false alarm rate, strong anti-interference capabilities, high computational efficiency, and provides intelligent security management support.
Smart Images

Figure CN121505520A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of safety detection technology, and in particular to a method and system for detecting personnel in rail transit. Background Technology
[0002] With the continuous expansion of global rail transit lines, railways are playing an increasingly crucial role in driving economic development. However, railway safety issues, especially the detection of unauthorized intrusions into construction areas, have become a focus of public concern and a core challenge for the development of high-speed railways. Current railway intrusion detection methods are mainly divided into two categories: contact and non-contact. However, these traditional methods generally suffer from low detection efficiency, high false alarm rates, and insufficient adaptability to complex environments, making it difficult to meet the high standards required for safe operation of modern railways. Summary of the Invention
[0003] This invention provides a method and system for personnel detection in rail transit, addressing the shortcomings of existing technologies such as low detection efficiency, high false alarm rate, and insufficient adaptability to complex environments. This invention can accurately identify target personnel, has a low false alarm rate, strong anti-interference capabilities, and high computational efficiency, providing intelligent support for the safety management of rail transit.
[0004] This invention provides a method for personnel detection in rail transit, comprising: acquiring video stream data from railway site monitoring; performing region extraction based on the video stream data to determine a dynamic region of interest; performing target personnel detection based on a pre-trained personnel detection model within the dynamic region of interest to determine the personnel detection result; wherein the personnel detection result is a construction worker or an intruder; wherein the personnel detection model is trained based on personnel detection samples.
[0005] According to a personnel detection method for rail transit provided by the present invention, after acquiring video stream data from railway site monitoring, the method further includes: performing image preprocessing on the video stream data to obtain preprocessed video stream data, and performing the region extraction step based on the preprocessed video stream data.
[0006] According to a method for personnel detection in rail transit provided by the present invention, the step of extracting regions based on the video stream data to determine the dynamic region of interest includes: matching the distribution of the video stream data with the distribution of a preset background model to determine background information; performing foreground detection on the video stream data based on the background information and the background model to determine a foreground mask; and performing connected component analysis on the foreground mask to extract the dynamic region of interest.
[0007] According to a method for personnel detection in rail transit provided by the present invention, after performing foreground detection on the video stream data based on the background information and the background model to determine the foreground mask, the method further includes: performing morphological optimization on the foreground mask to obtain a morphologically optimized foreground mask, and performing the connected component analysis based on the morphologically optimized foreground mask.
[0008] According to the present invention, a method for detecting people in rail transit includes a person detection model comprising a cropping module, a model inference module, and a decision logic module. The method further comprises: cropping image blocks from the video stream data using the cropping module, wherein the cropped image blocks are located within the dynamic region of interest; inputting the cropped image blocks into a pre-trained YOLOv8 model using the model inference module to obtain the output of the YOLOv8 model; the output includes target bounding boxes, target categories, and confidence scores; and parsing and associating the output to determine the person detection result using the decision logic module.
[0009] According to a personnel detection method for rail transit provided by the present invention, the step of parsing and associating the output result through the determination logic module to determine the personnel detection result includes: performing a global coordinate transformation on the target bounding box to obtain a global bounding box; expanding the region based on the global bounding box of the target personnel, and searching for the detection box of a preset safety object within the expanded region; if the detection box of the preset safety object is found within the expanded region, the target personnel is a construction worker; if the detection box of the preset safety object is not found within the expanded region, the target personnel is an intruder.
[0010] This invention also provides a personnel detection system for rail transit, comprising: an acquisition module for acquiring video stream data from railway site monitoring; a region determination module for extracting regions based on the video stream data to determine a dynamic region of interest; and a result determination module for detecting target personnel within the dynamic region of interest based on a pre-trained personnel detection model to determine the personnel detection result; wherein the personnel detection result is a construction worker or an intruder; and wherein the personnel detection model is trained based on personnel detection samples.
[0011] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the personnel detection method for rail transit as described above.
[0012] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the personnel detection method for rail transit as described above.
[0013] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a personnel detection method for rail transit as described above.
[0014] The present invention provides a method and system for personnel detection in rail transit, which can accurately identify target personnel, has a low false alarm rate, strong anti-interference ability and high computational efficiency, and provides intelligent support for the safety management of rail transit. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a personnel detection method for rail transit provided by the present invention.
[0017] Figure 2 This is a schematic diagram illustrating the specific process of a personnel detection method for rail transit provided by the present invention.
[0018] Figure 3 This is a schematic diagram of the structure of a personnel detection system for rail transit provided by the present invention.
[0019] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0021] In existing railway safety monitoring systems, traditional moving target detection methods are widely used in early intrusion detection tasks due to their simplicity and low computational cost. However, these methods rely solely on pixel-level changes and are highly sensitive to changes in lighting, weather interference, camera shake, and non-threatening movements such as trees, flags, and animals in the scene, making them prone to false alarms.
[0022] Considering the limitations of existing railway safety monitoring solutions in the complex and ever-changing railway construction environment, particularly in terms of robustness, identification capabilities, real-time performance, and adaptability to large-scale deployment, these solutions struggle to effectively address the diverse intrusion detection needs arising from the complex conditions at railway construction sites. This invention provides a personnel detection method for rail transit that boasts high robustness, low false alarm rate, and high real-time performance. This method not only maintains stable detection performance under adverse lighting and weather conditions but also effectively identifies personnel and equipment status, reducing reliance on hardware resources and enhancing its practicality and scalability in railway construction scenarios.
[0023] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a personnel detection method for rail transit provided by the present invention.
[0024] Please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the specific process of a personnel detection method for rail transit provided by the present invention.
[0025] This invention provides a method for personnel detection in rail transit, comprising: 101: Obtain video stream data from railway site monitoring.
[0026] In this embodiment, image acquisition equipment (such as high-definition cameras) is deployed at the railway construction site to capture video stream data of the monitored area in real time. The cameras transmit video signals to an edge computing server via wired or wireless networks. The server uses the VideoCapture function of the OpenCV library to read the video stream frame by frame, converting the continuous analog or digital video signal into a series of discrete digital image frames. t , where t represents the time series. Each frame I t It is a two-dimensional matrix composed of pixels, used for subsequent processing.
[0027] As a preferred embodiment, after acquiring the video stream data from the railway site monitoring, the method further includes: performing image preprocessing on the video stream data to obtain preprocessed video stream data, and performing region extraction based on the preprocessed video stream data.
[0028] In this embodiment, the acquired digital image frame I tPreprocessing is performed, including noise reduction and size normalization.
[0029] Denoising is achieved by using a Gaussian filter on image frame I. t Convolution operations are performed to suppress image noise. This operation uses a Gaussian kernel to perform a sliding window calculation on the image, weighting each pixel and its neighboring pixels to effectively suppress image noise. Its mathematical expression simplifies to: ,in The standard deviation is Gaussian kernel, This represents the convolution operation.
[0030] Size normalization is the process of scaling the denoised image to a preset fixed size (e.g., ...). (pixels). This is achieved through interpolation algorithms (such as bilinear interpolation) to ensure that all input frames are the same size, meeting the input requirements of subsequent deep learning models.
[0031] Of course, preprocessing methods can also include contrast enhancement. In scenes with poor lighting conditions, contrast enhancement can be performed on the normalized image to further optimize image quality. For example, histogram equalization can be used to adjust the brightness distribution of the image, making image details clearer and thus improving the accuracy of subsequent detection.
[0032] Of course, an adaptive preprocessing strategy can also be introduced to dynamically adjust the preprocessing parameters based on real-time lighting and weather information to improve image quality.
[0033] Image preprocessing plays a crucial role in personnel detection methods for rail transit. It not only effectively removes image noise and improves image quality, but also ensures the efficient and accurate operation of subsequent detection models through operations such as size normalization and contrast enhancement. This preprocessing method is particularly suitable for complex environments such as railway construction sites, significantly improving the robustness and practicality of the system and providing a solid technical foundation for the safety monitoring of rail transit.
[0034] 102: Extract regions based on video stream data to determine dynamic regions of interest.
[0035] As a preferred embodiment, region extraction based on video stream data to determine dynamic regions of interest includes: matching the distribution of video stream data with that of a preset background model to determine background information; performing foreground detection on the video stream data based on the background information and the background model to determine a foreground mask; and performing connected component analysis on the foreground mask to extract dynamic regions of interest.
[0036] As a preferred embodiment, after performing foreground detection on video stream data based on background information and a background model to determine the foreground mask, the method further includes: performing morphological optimization on the foreground mask to obtain a morphologically optimized foreground mask, and performing connected component analysis based on the morphologically optimized foreground mask.
[0037] In this embodiment, the background modeling module maintains a background model B. t This invention preferably uses a Gaussian Mixture Model (GMM). This module models each pixel using K Gaussian distributions. The processing flow includes: For the current frame I of the preprocessed video stream data t For each pixel (x, y) in the model, its pixel value (e.g., RGB value) is compared with the background model B. t The system matches the corresponding K Gaussian distributions at that position to determine the background information. If a matching distribution is found, the parameters (mean and variance) of that distribution are updated, and its weights are increased; otherwise, a new Gaussian distribution is created or the distribution with the smallest weight is replaced.
[0038] A Gaussian distribution with large weights and small variance is considered as the background. The current frame I... t Each pixel of the background model B t Compare the pixel values; if the pixel value does not belong to the background distribution, mark the point as 255 (white, representing the foreground); otherwise, mark it as 0 (black, representing the background). Generate a foreground mask.
[0039] In addition, a multimodal sensing module can be introduced, combined with infrared thermal imaging data to assist in foreground detection, so as to enhance the detection robustness under low light and severe weather conditions.
[0040] Morphological optimization of the foreground mask is performed. First, an erosion operation is performed to eliminate small noise points; then, a dilation operation is performed to connect broken foreground regions and fill voids. This is achieved by using specific structural elements (such as...) Morphological operations are performed on the rectangular kernel and the foreground mask to obtain the morphologically optimized foreground mask.
[0041] In addition, deep learning-assisted morphological optimization algorithms can be introduced to automatically learn the optimal morphological operation parameters through convolutional neural networks, thereby further improving the quality of the foreground mask.
[0042] The ROI extraction module performs connected component analysis on the morphologically optimized foreground mask. This algorithm scans the foreground mask, identifies all connected white pixel regions, and calculates the minimum bounding rectangle (Rect) for each region. i (i=1,2,...,N). These rectangles... i The set {Rect1,Rect2,...,Rectn This is the region of interest (ROI) that needs to be analyzed in this frame.
[0043] This invention filters out dynamic regions of interest (ROIs) in a scene by using background modeling (such as Gaussian mixture models), and confines the computationally intensive YOLOv8 object detection process to these dynamic ROIs, rather than scanning the entire image. This method significantly reduces computational load, improves system processing speed and real-time performance, enabling the system to run in real-time on low-cost devices and facilitating wider adoption. It also effectively filters out a large number of false alarms caused by static background interference such as changes in lighting and swaying leaves, making the system more stable and reliable.
[0044] 103: Within a dynamically generated region of interest, target personnel are detected based on a pre-trained personnel detection model to determine the personnel detection result; the personnel detection result is either a construction worker or an intruder; wherein, the personnel detection model is trained based on personnel detection samples.
[0045] In a preferred embodiment, the person detection model includes a cropping module, a model inference module, and a decision logic module. The method further includes: cropping image blocks from video stream data using the cropping module, with the cropped image blocks located within a dynamic region of interest; inputting the cropped image blocks into a pre-trained YOLOv8 model using the model inference module to obtain the output of the YOLOv8 model; the output includes the target bounding box, target category, and confidence score; and parsing and associating the output results using the decision logic module to determine the person detection result.
[0046] In this embodiment, the cropping module uses Rect for each rectangular region. i From the original preprocessed frame I t Crop the corresponding image patch from the middle t Patch all the cropped image patches i The data is sequentially fed into a pre-trained YOLOv8 model. This model is a deep convolutional neural network that extracts features through multiple layers of convolution and pooling operations, ultimately outputting detection results through a detection head. The model's output is specific to each patch. i The detection list (output results), where each element contains: the target bounding box (in the Patch) i The relative coordinates and dimensions within the target area, the target category (person, reflective vest, or safety helmet), and the confidence level.
[0047] The YOLOv8 model is a single network model trained on a specific dataset that can simultaneously output detection results for three categories: "personnel," "reflective vest," and "safety helmet." This setup provides a unified and aligned multi-target detection data foundation for subsequent collaborative decision-making logic, ensuring the spatiotemporal consistency and reliability of the decision criteria.
[0048] In addition, a multi-model fusion mechanism can be introduced to fuse the output of the YOLOv8 model with other deep learning models (such as SSD or Faster R-CNN) to improve the accuracy and robustness of detection.
[0049] In a preferred embodiment, the output results are parsed and correlated through a judgment logic module to determine the personnel detection result, including: performing a global coordinate transformation on the target bounding box to obtain a global bounding box; expanding the region based on the global bounding box of the target personnel, and searching for the detection box of a preset safety object within the expanded region; if the detection box of the preset safety object is found within the expanded region, the target personnel are construction workers; if the detection box of the preset safety object is not found within the expanded region, the target personnel are intruders.
[0050] In this embodiment, the decision logic module parses and correlates the output results of the YOLOv8 model. First, it sets each target in the Patch... i The bounding box coordinates in the rectangle are determined by the rectangle to which it belongs. i In the original frame I t The position in the coordinate system is converted back to global coordinates.
[0051] Iterate through all global bounding boxes P that are detected as "people" (target personnel). box For each P box Calculate its extended region (e.g., P) boxThe system expands the width and height proportionally within this expanded area. It then searches for detection boxes for "reflective vests" and "safety helmets" (preset safety items). This is a logical judgment based on spatial overlap (such as IoU, Intersectionover Union) or simple spatial inclusion relationships. If both vest and helmet boxes with confidence levels above a threshold exist simultaneously, the association is considered successful. If a "person" is successfully associated with both a "reflective vest" and a "safety helmet," the target person is identified as a construction worker. The system marks the person's boundary box in green and logs the information without triggering an alarm. If a "person" fails to be associated with both a "reflective vest" and a "safety helmet," the target person is identified as an intruder. The system immediately executes an alarm: highlighting the person with a red box on the screen and calling the alarm interface to trigger subsequent actions such as audible and visual alarms and information push notifications. The judgment logic of this invention not only relies on the detection of "personnel" targets, but also considers the spatial relationship of three targets: "personnel", "reflective vest" and "safety helmet". By judging whether the vest and helmet overlap or contain a specific personnel target in space, it realizes the intelligent differentiation between construction workers and intruders, fundamentally solving the problem that general target detection algorithms cannot perform identity subdivision, and has strong practicality.
[0052] After processing the current frame I t After that, the process returns to the video stream data acquisition step to obtain the next frame I. t+1 This initiates a new processing cycle, thereby enabling real-time and uninterrupted monitoring.
[0053] In addition, the method of the present invention may also include: combining an environmental perception module to acquire real-time information on lighting, weather and noise at the railway site, and dynamically adjusting the parameters of the personnel detection model based on this information to optimize detection performance.
[0054] A behavior analysis module can also be introduced to analyze the behavior patterns of construction workers and intruders. Combined with the identity determination results, it can further determine whether there are abnormal behaviors (such as falling, running, etc.) and trigger the corresponding early warning mechanism.
[0055] As can be clearly seen from the detailed steps described above, the technical solution of this invention is not a simple accumulation of functions, but an automated implementation method with interconnected steps, a clear signal processing flow, and logical judgment. The output of each step is the input of the next step, and ultimately, accurate recognition is achieved through collaborative judgment logic.
[0056] The personnel detection system for rail transit provided by the present invention will be described below. The personnel detection system for rail transit described below can be referred to in correspondence with the personnel detection method for rail transit described above.
[0057] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of a personnel detection system for rail transit provided by the present invention.
[0058] The present invention also provides a personnel detection system for rail transit, comprising: an acquisition module 301 for acquiring video stream data from railway site monitoring; a region determination module 302 for extracting regions based on the video stream data and determining a dynamic region of interest; and a result determination module 303 for detecting target personnel within the dynamic region of interest based on a pre-trained personnel detection model and determining the personnel detection result; wherein the personnel detection result is a construction worker or an intruder; and the personnel detection model is trained based on personnel detection samples.
[0059] As a preferred embodiment, after acquiring the video stream data from the railway site monitoring, the method further includes: performing image preprocessing on the video stream data to obtain preprocessed video stream data, and performing region extraction based on the preprocessed video stream data.
[0060] As a preferred embodiment, region extraction based on video stream data to determine dynamic regions of interest includes: matching the distribution of video stream data with that of a preset background model to determine background information; performing foreground detection on the video stream data based on the background information and the background model to determine a foreground mask; and performing connected component analysis on the foreground mask to extract dynamic regions of interest.
[0061] As a preferred embodiment, after performing foreground detection on video stream data based on background information and a background model to determine the foreground mask, the method further includes: performing morphological optimization on the foreground mask to obtain a morphologically optimized foreground mask, and performing connected component analysis based on the morphologically optimized foreground mask.
[0062] In a preferred embodiment, the person detection model includes a cropping module, a model inference module, and a decision logic module. The method further includes: cropping image blocks from video stream data using the cropping module, with the cropped image blocks located within a dynamic region of interest; inputting the cropped image blocks into a pre-trained YOLOv8 model using the model inference module to obtain the output of the YOLOv8 model; the output includes the target bounding box, target category, and confidence score; and parsing and associating the output results using the decision logic module to determine the person detection result.
[0063] In a preferred embodiment, the output results are parsed and correlated through a judgment logic module to determine the personnel detection result, including: performing a global coordinate transformation on the target bounding box to obtain a global bounding box; expanding the region based on the global bounding box of the target personnel, and searching for the detection box of a preset safety object within the expanded region; if the detection box of the preset safety object is found within the expanded region, the target personnel are construction workers; if the detection box of the preset safety object is not found within the expanded region, the target personnel are intruders.
[0064] Figure 4 An example is a schematic diagram of the structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 401, a communications interface 402, a memory 403, and a communication bus 404. The processor 401, communications interface 402, and memory 403 communicate with each other via the communication bus 404. The processor 401 can call logical instructions in the memory 403 to execute a personnel detection method for rail transit. This method includes: acquiring video stream data from railway site monitoring; performing region extraction based on the video stream data to determine a dynamic region of interest; within the dynamic region of interest, detecting target personnel based on a pre-trained personnel detection model to determine the personnel detection result; the personnel detection result is either a construction worker or an intruder; wherein the personnel detection model is trained based on personnel detection samples.
[0065] Furthermore, the logical instructions in the aforementioned memory 403 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0066] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the personnel detection method for rail transit provided by the above methods. The method includes: acquiring video stream data of railway site monitoring; performing region extraction based on the video stream data to determine a dynamic region of interest; performing target personnel detection based on a pre-trained personnel detection model within the dynamic region of interest to determine the personnel detection result; the personnel detection result is a construction worker or an intruder; wherein the personnel detection model is trained based on personnel detection samples.
[0067] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the personnel detection method for rail transit provided by the methods described above. The method includes: acquiring video stream data from railway site monitoring; performing region extraction based on the video stream data to determine a dynamic region of interest; within the dynamic region of interest, performing target personnel detection based on a pre-trained personnel detection model to determine the personnel detection result; the personnel detection result being either a construction worker or an intruder; wherein the personnel detection model is trained based on personnel detection samples.
[0068] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0069] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for personnel detection in rail transit, characterized in that, include: Acquire video stream data from railway on-site monitoring; Based on the video stream data, region extraction is performed to determine the dynamically dynamic region of interest; Within the dynamically defined region of interest, target personnel are detected based on a pre-trained personnel detection model to determine the personnel detection result; the personnel detection result is either a construction worker or an intruder. The personnel detection model is trained based on personnel detection samples.
2. The personnel detection method for rail transit according to claim 1, characterized in that, After acquiring the video stream data from the railway site monitoring, the process also includes: The video stream data is preprocessed to obtain preprocessed video stream data, and the region extraction step is performed based on the preprocessed video stream data.
3. The personnel detection method for rail transit according to claim 1, characterized in that, The step of extracting regions based on the video stream data to determine dynamically interesting regions includes: The video stream data is matched with the distribution of a preset background model to determine the background information; Based on the background information and the background model, foreground detection is performed on the video stream data to determine the foreground mask; Connectivity component analysis is performed on the foreground mask to extract the dynamic region of interest.
4. The personnel detection method for rail transit according to claim 3, characterized in that, After performing foreground detection on the video stream data based on the background information and the background model to determine the foreground mask, the method further includes: The foreground mask is morphologically optimized to obtain a morphologically optimized foreground mask, and the connected component analysis step is performed based on the morphologically optimized foreground mask.
5. The personnel detection method for rail transit according to any one of claims 1 to 4, characterized in that, The personnel detection model includes a cropping module, a model inference module, and a decision logic module. The method further includes: The cropping module performs image block cropping on the video stream data, and the cropped image blocks are located within the dynamic region of interest. The cropped image patch is input into the pre-trained YOLOv8 model through the model inference module to obtain the output of the YOLOv8 model; the output includes the target bounding box, the target category, and the confidence score. The judgment logic module parses and correlates the output results to determine the personnel detection results.
6. The personnel detection method for rail transit according to claim 5, characterized in that, The step of parsing and correlating the output results through the determination logic module to determine the personnel detection results includes: Perform a global coordinate transformation on the target bounding box to obtain the global bounding box; The region is expanded based on the global bounding box of the target personnel, and the detection boxes of preset safety objects are searched within the expanded region. If the detection frame of the preset safety object is found within the extended area, the target personnel are construction workers; If no detection frame of the preset security object is found within the extended area, the target person is an intruder.
7. A personnel detection system for rail transit, characterized in that, include: The acquisition module is used to acquire video stream data from railway on-site monitoring. The region determination module is used to extract regions based on the video stream data and determine the dynamic region of interest. The result determination module is used to detect target personnel based on a pre-trained personnel detection model within the dynamic region of interest and determine the personnel detection result; the personnel detection result is either a construction worker or an intruder. The personnel detection model is trained based on personnel detection samples.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the personnel detection method for rail transit as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the personnel detection method for rail transit as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the personnel detection method for rail transit as described in any one of claims 1 to 6.