A geometric perception prompt-based railway plummet small target detection method
By combining geometric prior information from railway overhead contact lines, using line segment detection and geometric filtering techniques, spatial cues are generated. Combined with cue-enabled segmentation and semantic verification modules, accurate positioning and identification of railway weights are achieved. This solves the problems of insufficient positioning accuracy and recall in existing technologies, reduces false alarm rate, and improves detection efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI JIAOTONG UNIV
- Filing Date
- 2026-04-07
- Publication Date
- 2026-07-31
AI Technical Summary
Existing automatic monitoring methods for railway weights struggle to balance positioning accuracy and recall when dealing with small targets that have highly similar backgrounds and drastic scale variations. Furthermore, data acquisition costs are high in industrial settings, especially for segmentation tasks requiring high-precision pixel-level annotation, where the annotation costs are extremely high. Existing general-purpose large models also struggle to stably focus on the target area in complex backgrounds.
By leveraging the strong geometric prior information inherent in railway catenary scenarios, structured anchor points are extracted through line segment detection and geometric filtering techniques to generate spatial cues. Combined with a cue-enabled segmentation module and a semantic verification module, accurate positioning and identification of the weights are achieved.
It achieves sub-pixel-level positioning accuracy and efficient detection of small railway targets, reduces false alarm rate, enhances adaptability and detection efficiency in complex backgrounds, and provides high-quality data support.
Smart Images

Figure CN122493038A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of railway safety monitoring technology, and in particular to a method for detecting small railway weights based on geometric perception cues. Background Technology
[0002] In modern electrified high-speed railway systems, the overhead contact system is a core infrastructure ensuring stable power transmission to the traction units. As a crucial component of the overhead contact system, tension compensation devices, commonly known as weights, play a vital role. These weights, made of concrete or cast iron, typically weigh 25 kg each and are suspended from ratchet mechanisms at the ends of the catenary and contact wire. Through gravity, the weights effectively counteract the dynamic slack in the conductor caused by temperature fluctuations and pantograph interaction, thus maintaining the conductor's rated tension and alignment under various environmental conditions. However, during long-term operation, if the weights malfunction due to component wear, thermal expansion, or mechanical fatigue, their position may drop excessively. This abnormal fluctuation directly leads to sag in the contact wire, causing it to lose close contact with the pantograph. In extreme cases, this poor contact can trigger pantograph bouncing, severe electrical arcing, or even grid disconnection, not only disrupting power supply stability but also potentially causing costly equipment damage and service interruptions. Therefore, real-time, precise positioning and abnormal descent detection of the compensation weights are an indispensable part of ensuring railway operational safety and preventative maintenance.
[0003] Currently, the maintenance of the overhead contact system mainly relies on manual inspections and periodic checks. Maintenance personnel typically use onboard cameras to capture continuous images, which are then manually reviewed offline. This traditional method suffers from drawbacks such as low efficiency, high labor costs, and strong subjectivity. With the increase in railway mileage and operating speed, manual inspections are no longer sufficient to meet the demands of frequent monitoring.
[0004] With the rapid development of computer vision and deep neural network technologies, the automated identification and defect detection of overhead contact line components using image classification, object detection, and semantic segmentation has become an important research direction in this field. Existing technological explorations include modifying convolutional neural networks (CNNs) for the detection of components such as insulators, using generative adversarial networks (GANs) for sample augmentation, and employing YOLO series networks for contact line localization. For example, Chinese patent CN109300114A discloses a method for detecting missing tightness of extremely small target components in high-speed railway overhead contact line support devices. Based on the Faster R-CNN framework, it introduces a dynamic anchor point mechanism to generate candidate bounding boxes that are closer to the center of the real object. Combined with Pascal VOC2007 data format and Delta-Anchor layers, it trains an object detection model to improve the accuracy and efficiency of small object detection. However, this method not only relies on a large amount of manually labeled data but also faces severe challenges such as large localization errors and high false negative rates when dealing with small object detection scenarios. In high-speed railway inspection images, the weights are often presented as extremely small targets, sometimes occupying only a few dozen pixels. Moreover, due to changes in camera distance and perspective angle, the scale of the target in the image exhibits great uncertainty.
[0005] Meanwhile, the complex industrial operating environment introduces severe background interference to the detection task. Railway inspection images are filled with numerous interfering elements structurally similar to the target, such as utility poles, guy wires, and insulators. Combined with drastic changes in lighting, shadow occlusion, and visual clutter caused by inclement weather, this significantly increases the risk of false alarms and missed alarms. Furthermore, diagnosing the condition of fallen weights places extremely high demands on positioning accuracy; any significant coordinate deviation can lead to incorrect assessments of equipment health by maintenance personnel, thereby weakening the effectiveness of the entire monitoring system. To improve segmentation accuracy, some studies have attempted to construct multi-scale context coding modules or fuse features from different receptive fields through skip connections. However, these methods often involve a large parameter scale and high computational complexity, and are highly dependent on large-scale, high-quality labeled data, making them difficult to meet the needs of real-time onboard detection.
[0006] In summary, the current application of computer vision for automatic monitoring of railway weights still faces numerous challenges and research gaps. First, existing deep learning object detection methods struggle to balance localization accuracy and recall when dealing with small targets in highly similar backgrounds with drastic scale variations. Second, data acquisition in industrial settings is costly, especially for segmentation tasks requiring high-precision pixel-level annotation. Furthermore, while existing general-purpose models possess generalization capabilities, their application in specific industrial fields often fails to stably focus on target areas in complex contexts due to a lack of guidance from spatial location and structural features. Therefore, achieving high-precision and efficient localization of small railway targets with limited training data has become a pressing technical challenge. Summary of the Invention
[0007] The purpose of this invention is to provide a method for detecting small railway weights based on geometric perception cues. This method utilizes the strong geometric prior information inherent in railway overhead contact system scenarios to organically combine low-level structural features with the resolution capability of large models, thereby achieving accurate positioning and identification of weights in complex environments.
[0008] The objective of this invention can be achieved through the following technical solutions: A method for detecting small railway weights based on geometry-aware cues includes the following steps: Acquire images of the railway catenary onboard inspection and input them into the geometric prompt generation module; Based on the geometric prompt generation module, structured anchor points are extracted and spatial prompts are generated using line detection and geometric filtering techniques; The onboard inspection images of the railway catenary and the generated spatial cues are loaded into the cue-enabled segmentation module to guide the basic model in generating fine-grained candidate masks. The semantic verification module is used to extract features and classify the mask regions corresponding to the candidate masks. Combined with the post-processing filtering mechanism, the final detection result of the railway weight is output.
[0009] The geometry hint generation module performs the following steps: Convert each input video frame image into a single-channel grayscale image; The single-channel grayscale image is input into the line segment detector, which automatically identifies real line segments through pixel-level gradient consistency grouping and statistical tests, and simultaneously achieves sub-pixel-level localization through the minimum parameter model to obtain the original line segments. Based on the original line segments, a cascaded geometric filter is used to screen candidate utility poles. The cascaded geometric filter discards short line segments whose length projection occupies less than a preset proportion of the image width or height, discards line segments whose tangent value is less than a preset value, and discards line segments whose distance from the image edge is less than a preset pixel. For each surviving line segment, select the endpoint with the larger ordinate value as the seed point; Based on the type of cues required downstream, a structured cue point cloud, i.e., a spatial cue, is generated for each seed point.
[0010] The line segment detector specifically performs the following steps: Calculate the gradient magnitude and gradient direction of each pixel in a single-channel grayscale image; Sort all edge pixels according to the gradient direction; After sorting, potential same-direction pixels are searched within the local orientation bands of the pixels to construct chains; For each pixel within the chain, a straight line is fitted using the least squares method or the full least squares method to obtain the parametric form. Sub-pixel accuracy positioning is achieved by calculating the endpoint coordinates of the fitted line segment on the chain projection, thus obtaining candidate chains. The number of false alarms is calculated, which is defined as the probability that random gradient pixels in a pure noise image are precisely arranged into a chain of that length and direction. When the number of false alarms is lower than a preset threshold, the identified candidate chain is taken as the original line segment; otherwise, it is discarded.
[0011] The method for constructing the chain is: using the pixel with the strongest gradient. As seed point, in pixels gradient direction With the central axis as the axis, the chain grows bidirectionally along the gradient direction; ; ; in, Indicates the angle of the region. Represents the pixels within the region. The width of the local directional band. For pixels The gradient direction; each chain represents a candidate support region segment; The method for generating the cue point cloud is as follows: for points located at... Seed points, cue points are placed in a predefined spatial pattern, where the horizontal spacing is determined by parameters. The vertical spacing is controlled by the aspect ratio parameter. Scaling: ; ; ; in, This indicates the number of tooltips generated along a single direction. Indicates the distance between two prompts. coordinate pixel interval, Indicates the total number of prompts. Indicates the distance between two prompts. coordinate pixel interval and The ratio of coordinate pixel intervals, The final generated points are the coordinates of the given points. The prompt points constitute a prompt point cloud.
[0012] The cue-enabled segmentation module includes an image encoder, a cue encoder, and a mask decoder, wherein, The image encoder uses a pre-trained visual Transformer encoder for feature extraction, divides the input railway catenary vehicle inspection image into non-overlapping image blocks, performs linear projection on each image block, and generates a global image embedding by processing the word sequence obtained through stacked multi-head self-attention layers. The prompt encoder performs position encoding on the prompt points in the spatial prompt to obtain the prompt embedding; The mask decoder uses cascaded multi-head attention blocks and cross-attention blocks to jointly process global image embedding and cue embedding, generating a binary mask for each cue embedding, and finally outputting a mask with shape […]. The mask tensor, and a length of The relevant confidence score vector, where... Indicates the total number of prompts. Indicates the height of the image. Indicates the width of the image; The mask tensor is sorted and filtered based on the relevant confidence score vector to obtain candidate masks.
[0013] The method for encoding the location of the prompt points in the spatial prompt is as follows: ; in, It is a randomly initialized zeta matrix. Provide the coordinates of the prompt point. For prompts The location encoding result.
[0014] The semantic verification module uses a finely tuned EfficientNet-B0 validator.
[0015] During the prediction process, each candidate mask generated by the cueable segmentation module is first converted into a minimum bounding box aligned with the image axis, and the cropping region is extracted from it. After resizing and normalizing the axis-aligned cropped image, it is fed into the EfficientNet-B0 validator for processing, and the class probability is output.
[0016] The post-processing filtering mechanism specifically includes: Geometric feature filtering: Discard candidate boxes whose width exceeds their height; Repeat detection suppression: Perform nonmaximum suppression to eliminate duplicate detection results.
[0017] Compared with the prior art, the present invention has the following beneficial effects: I. This invention achieves sub-pixel-level positioning accuracy by deeply mining the unique geometric prior information in railway catenary scenarios and effectively filtering out interference in complex backgrounds using line segment detectors, thus ensuring the reliability of structured anchor points from the source. In conjunction with cascaded geometric filters, non-target interference line segments are further eliminated by using length projection, tilt angle and boundary constraints, so that the generated geometric prompts can accurately lock the potential area of the falling weight, effectively solving the technical problem that small targets are easily submerged in global scanning.
[0018] Second, this invention designs a parameterized controlled spatial cue point cloud generation strategy. By constructing a structured point cloud through predefined horizontal spacing, vertical scaling ratio, and number of points, compared with traditional single-point or bounding box cueing, this strategy can more comprehensively cover the long strip-shaped physical space of the weight, providing rich local spatial context for the subsequent cueable segmentation module. Combined with the powerful global feature extraction capability of the visual Transformer encoder, fine-grained binary mask generation is achieved through deep cross-attention fusion of image embedding and cue embedding. This not only accurately delineates the pixel-level outline of the weight, but also overcomes the coarseness of traditional target detectors when dealing with irregular edges, providing high-quality data support for the precise condition assessment of railway facilities.
[0019] Third, this invention constructs a rigorous classification and verification closed loop by introducing a finely tuned EfficientNet-B0 validator and multiple post-processing filtering mechanisms. The semantic verification module compensates for the lack of category perception capability of the basic segmentation model, ensuring the accuracy of candidate regions at the semantic level. At the same time, by combining geometric feature filtering based on physical characteristics and non-maximum suppression, and further eliminating false targets that do not conform to the geometric shape of the weight through aspect ratio constraints and duplicate detection suppression, the false alarm rate is greatly reduced, and the adaptability to changes in lighting, complex backgrounds, and small-sized targets in vehicle inspection images is significantly enhanced. Attached Figure Description
[0020] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the image encoder structure of the present invention; Figure 3 This is a schematic diagram of the mask decoder structure of the present invention; Figure 4This is a visual comparison of the weight recognition results in one embodiment of the present invention. Detailed Implementation
[0021] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0022] This embodiment provides a method for detecting small targets such as railway weights based on geometric perception cues, such as... Figure 1 As shown, it includes the following steps: S1, acquire images of the railway catenary onboard inspection and input them into the geometric prompt generation module.
[0023] S2, Based on the geometric prompt generation module, structured anchor points are extracted and spatial prompts are generated using line detection and geometric filtering techniques.
[0024] The geometric cue generation module first converts each input video frame image into a single-channel grayscale image, which serves as the input for the subsequent Line Segment Detector (LSD). In this invention, the luminance component... The calculation method is shown in formula (1). This index is used to measure the brightness of pixels in a grayscale image: in, Indicates the intensity of red. Indicates green intensity, Indicates the intensity of blue. (Obtained) The value serves as a pixel brightness index in a single-channel grayscale image. The coefficients in the formula originate from the ITU-R BT.601 standard and reflect the differences in human eye sensitivity to different colors. Since the human visual system is most sensitive to green light, followed by red and blue light, these weights ensure that the calculated brightness closely matches the perceived brightness during grayscale image conversion.
[0025] Subsequently, the single-channel grayscale image is input into a line segment detector, aiming to directly extract continuous and geometrically meaningful line segments from image edges or gradient maps. Its core principle is to automatically identify real line segments through pixel-level gradient consistency grouping and statistical testing, while simultaneously achieving sub-pixel-level localization through a minimum parameter model to obtain the original line segments.
[0026] The specific execution steps for LSD are as follows: (1) Calculation of gradient direction LSD first calculates the gradient magnitude of each pixel in the input grayscale image. and gradient direction : in, and They represent and Sobel gradient components in the direction: (2) Gradient direction sorting Sort all edge pixels according to gradient direction to quickly identify pixel neighborhoods with consistent orientation. After sorting, each pixel can be located in its local orientation band ( Search for potential pixels in the same direction within the range to build a chain.
[0027] (3) Region growth and pixel chain generation With the pixel with the strongest gradient As seed point, in pixels gradient direction With the central axis as the axis, the chain grows bidirectionally along the gradient direction, that is: in, Indicates the angle of the region. Represents the pixels within the region. The width of the local directional band. For pixels The gradient direction; each chain represents a candidate support region segment.
[0028] (4) Parametric fitting of candidate line segments For each pixel within the chain, fit a straight line using the least squares method or full least squares method to obtain the parametric form: in and This represents the average value of the coordinates of each pixel within the current chain. , These are the slope and intercept of the fitted line, respectively. This indicates the number of pixels in the current chain. This represents the estimated slope.
[0029] This invention achieves sub-pixel precision positioning by calculating the endpoint coordinates of the fitted line segments on the chain projection, thereby obtaining candidate chains.
[0030] (5) Verification of the number of false alarms (NFA) LSD introduces the concept of False Alarm Count (NFA), defined as the probability that random gradient pixels in a purely noisy image are precisely arranged into a chain of length and orientation. Only when the NFA value is below a preset threshold (usually set to 1) is the identified candidate chain considered a genuine line segment; otherwise, it is discarded. The formula for NFA is: in, and This indicates the number of columns and rows after scaling. This refers to the number of alignment points. The NFA test automatically determines the optimal threshold, significantly reducing the need for manual parameter adjustments.
[0031] After obtaining the original line segments, a cascaded geometric filter is used to filter candidate utility poles: short line segments whose length projection occupies less than 10% of the image width or height are discarded; line segments with a tangent value less than 6 are discarded; and line segments within 200 pixels of the image edge are discarded. For each remaining line segment, a selection is made. The endpoint with the larger coordinates is used as the seed point. Through this series of constraints, long line segments representing the edge of a weight restraint frame or utility pole can be effectively filtered out.
[0032] For each surviving line segment, select the endpoint with the larger ordinate value as the seed point; Based on the type of cues required downstream, a structured cue point (Prompt) cloud, i.e., a spatial cue, is generated for each seed point. For those located in... Seed points, cue points are placed in a predefined spatial pattern, where the horizontal spacing is determined by parameters. The vertical spacing is controlled by the aspect ratio parameter. Scaling: in, This indicates the number of tooltips generated along a single direction. Indicates the distance between two prompts. coordinate pixel interval, Indicates the total number of prompts. Indicates the distance between two prompts. coordinate pixel interval and The ratio of coordinate pixel intervals, The final generated points are the coordinates of the given points. The prompt points constitute a prompt point cloud.
[0033] This layout ensures that the cues effectively cover the local neighborhood around the seed and provide information-rich spatial clues for the segmentation network. The module outputs a complete set of generated cues for use in subsequent segmentation stages.
[0034] S3, the onboard inspection image of the railway catenary and the generated spatial prompts are loaded into the prompting segmentation module to guide the basic model to generate fine-grained candidate masks.
[0035] After completing line segment detection and generating point / box hints, this invention employs a hint-based segmentation strategy based on the SegmentAnything Model (SAM) to perform fine-grained mask prediction for each candidate region.
[0036] Specifically, the prompting segmentation module includes an image encoder, a prompt encoder, and a mask decoder.
[0037] (1) Image Encoder This invention first uses a pre-trained Vision Transformer (ViT) encoder for feature extraction. This encoder divides the input railway catenary vehicle inspection image into non-overlapping image patches, performs linear projection on each patch, and processes the resulting token sequence through stacked multi-head self-attention layers. This process produces a global image embedding with rich semantic representation while preserving long-range contextual dependencies. The structure of the image encoder is as follows... Figure 2 As shown, the process of dividing the input image into image patches, performing linear embedding, and processing it through stacked multi-head self-attention layers to generate a global semantic representation is illustrated.
[0038] (2) Prompt Encoder Cue points generated by the geometric cue generation module are embedded as input conditions to guide the segmentation process. In this invention, cue points are encoded into high-dimensional vectors through positional encoding. These cue embeddings are then fused with the image embedding to ensure that the segmentation process focuses on the spatial region of interest, rather than indiscriminately processing the entire image. Specifically, the cue encoder generates a set of cue tokens, which interact with the image embedding within the decoder.
[0039] For the cue point, its location encoding method is as shown in formula (15): in, Indicates the width of the image. Indicates the height of the image. It is a randomly initialized ensemble matrix whose entries are independent and identically distributed random variables that follow a standard normal distribution.
[0040] (3) Mask Decoder The mask decoder jointly processes global image embedding and cue embedding through cascaded multi-head attention blocks and cross-attention blocks, and its structure is as follows: Figure 3 As shown, this illustrates how image embeddings and cue embeddings interact through a cascaded attention mechanism to generate the final mask, thus producing a binary mask for each cue embedding, ultimately outputting a mask of shape [shape missing]. The mask tensor, and a length of The relevant confidence score vector.
[0041] The mask tensor is sorted and filtered based on the relevant confidence score vector to suppress redundant or low-confidence regions, thus obtaining candidate masks.
[0042] By leveraging the cue-conditional reasoning capabilities of SAM, this invention generates high-quality, fine-grained contours of the bob even in challenging environments such as cluttered backgrounds, occlusion, or varying lighting. Furthermore, the modular design allows for efficient parallel reasoning across multiple cues, maintaining interaction throughput while ensuring robustness. The generated mask serves as input to subsequent semantic verification and non-maximum suppression (NMS) stages.
[0043] S4 utilizes the semantic verification module to extract features and classify the mask regions corresponding to the candidate masks, and combines the post-processing filtering mechanism to output the final detection result of the small railway weight.
[0044] To verify whether each candidate region is a boulder or background interference, this invention uses a finely tuned EfficientNet-B0 validator as a semantic verification module.
[0045] EfficientNet introduces a compound scaling strategy to unify and balance the network's depth, width, and input resolution, thereby achieving higher accuracy with fewer parameters than traditional convolutional neural networks (CNNs). Its backbone network consists of move-flip bottleneck convolutional (MBConv) blocks combined with a squeeze-and-excitation attention mechanism. This allows for efficient feature extraction while maintaining strong feature representation capabilities within a limited computational budget. The basic unit of EfficientNet-B0 is MBConv. Given a given... The input tensor (where (Representing height, width, and channel dimensions respectively), the MBConv operation is defined as: in, Represents a deep convolutional layer. This represents convolution. The network structure of EfficientNet-B0 can be represented as: in, Contains one The system consists of a layer, a pooling layer, and a fully connected layer. It contains the original validation score for each category, and the category corresponding to the highest score is the predicted category.
[0046] In this invention, each masked region is cropped from the input frame and processed by a fine-tuned EfficientNet-B0 validator to generate class probabilities, thereby obtaining the final compensated weight confidence. This invention initializes an EfficientNet-B0 pre-trained on ImageNet and replaces its final validator head with a 1280→6 linear projection layer, subsequently generating probabilities for six classes through a Softmax activation function. These six classes correspond to common elements in railway images: grass, utility poles, utility pole signs, ground between tracks, other obstacles, and weights.
[0047] During the prediction process, each candidate mask generated by the cue-enabled segmentation module is first converted into a minimum bounding box aligned with the image axis, and the cropping region is extracted from it. After resizing and normalizing the axis-aligned cropped image, it is fed into the EfficientNet-B0 validator for processing, and the output class probability vector is obtained. The confidence level of the sinker is extracted from this data. For regions verified as not containing a sinker, their confidence level is assigned to zero to suppress false alarms.
[0048] Finally, a post-processing filtering mechanism is applied to the recognition results, specifically including: Geometric feature filtering: Considering that the weights mainly exhibit vertical geometric features, candidate boxes with a width exceeding their height are discarded; Repeat detection suppression: Non-maximum suppression (NMS) is performed to eliminate repeated detection results.
[0049] After the above processing, the remaining candidate boxes with the highest confidence scores are selected as the final prediction results for the falling weight.
[0050] By adopting the technical solution provided by this invention, it is helpful to utilize the inherent geometric prior information of railway scenarios to organically combine low-level structural features with the resolution capability of large models, which can effectively improve the positioning and identification accuracy of weights in railway catenary systems, and enhance the safety and inspection efficiency of railway operations.
[0051] To evaluate the model's performance, this embodiment uses real high-speed railway surveillance videos obtained from Central China for a case study. The video recordings were segmented into independent frames with a pixel resolution of 1920x1080 to construct training and testing datasets. To construct a dedicated dataset for the semantic verification module, this invention extracted 800 labeled objects from 140 video frames and divided them into six categories: (1) weights (208 instances), (2) utility poles (112 instances), (3) utility pole signs (164 instances), (4) grass (168 instances), (5) track surface (112 instances), and (6) miscellaneous distractions (36 instances). These labeled samples were used to verify the supervised learning and testing of the network, with a training set to test set ratio of 3:1. In addition, to evaluate the performance of the complete framework under real-world conditions, this invention prepared an independent test set consisting of 300 full-frame images, including 100 positive samples containing weights and 200 negative samples, to ensure a rigorous evaluation of the framework's ability to distinguish targets from complex backgrounds. The experimental evaluation of this invention was conducted on a workstation equipped with an NVIDIA GeForce RTX 4070 Ti Super GPU, an Intel Core i7-14700K CPU, and 32GB of DDR5 memory (2×16GB modules), using the PyTorch deep learning framework.
[0052] In specific embodiments of this invention, to verify the advancement of the proposed framework, detailed comparative and ablation experiments were conducted. For the comparative experiments, six representative deep neural network architectures were selected as the backbone networks of the semantic validator: ResNet-34, EfficientNet-B0, DenseNet-121, MobileNetV2, ViT-B-16, and ViT-B-32. To ensure fairness in the comparison, all models were initialized with weights pre-trained on the ImageNet dataset and fine-tuned for the specific task of this invention. A unified training protocol was used: an initial learning rate of 0.01 and weight decay of [missing information]. The batch size is 16, and the total number of iterations is 30. Furthermore, to assess the effectiveness of the prompt generation strategy, this invention sets up two benchmark strategies for comparison: one is a random prompting strategy, which randomly distributes 300 prompt points across the entire map; the other is a uniform prompting strategy, which uniformly samples 300 prompt points across the entire map grid. It is worth noting that these benchmark strategies use a significantly larger number of prompt points than the geometric prompt generation (GA) strategy of this invention, aiming to verify the superiority of this invention in achieving "few but precise" localization using geometric priors.
[0053] In terms of ablation experiment setup, this invention quantifies the contribution of each core module by constructing four representative configurations: Configuration (1) uses "uniform cueing + EfficientNet-B0" as a benchmark verification combination without localization priors and segmentation processes, used to evaluate basic verification capabilities; Configuration (2) uses "GA + EfficientNet-B0" to evaluate the gains brought by the geometric cueing generation strategy alone (without SAM segmentation); Configuration (3) uses "uniform cueing + SAM + EfficientNet-B0", which introduces a segmentation stage, but the cue points do not contain geometric priors, used to isolate and evaluate the role of the segmentation module; Configuration (4) is the complete "GA + SAM + EfficientNet-B0" pipeline of this invention. Through this progressive configuration comparison, this invention can clearly reveal the specific functions and synergistic effects of geometrically aware cueing, cueable segmentation, and semantic verification in improving overall detection performance.
[0054] The embodiments of this invention comprehensively evaluated the performance of the proposed framework through the above experimental setup. In the comparative experiments on the semantic validator backbone network, the results show that the combination of GA+SAM+EfficientNet-B0 exhibits the best overall performance, with an Intersection over Union (IoU) of 0.85 and average precisions of 0.95, 0.92, and 0.91 at IoU thresholds of 0.25, 0.5, and 0.75, respectively. This combination also leads in validation metrics, with precision, recall, and F1 score of 0.96, 0.89, and 0.92, respectively, while maintaining an inference speed of 0.39 FPS. In contrast, although ResNet34 provides the highest inference efficiency of 0.51 FPS, it is slightly inferior to EfficientNet-B0 in precision metrics such as the F1 score (0.90). Standard Transformer architectures such as ViT-B-16 and ViT-B-32 performed poorly in this task environment, with IoU not exceeding 0.83 and AP@0.75 not exceeding 0.82, indicating that standard models without specific optimization are difficult to adapt to such small-sample industrial monitoring tasks.
[0055] Effectiveness analysis of the cue generation strategy shows that the GA strategy incorporating geometric priors has significant advantages. When using a random strategy that randomly distributes 300 cue points in the image, the IoU and F1 score are only 0.33 and 0.36, respectively; the uniform strategy that uniformly samples 300 cue points also has an IoU of only 0.36 and an F1 score of 0.40. In stark contrast, the GA strategy proposed in this invention improves the IoU to 0.85 and the F1 score to 0.92 by generating a small number of geometrically significant cue points near row endpoints. Ablation experiments on the framework module further verify the necessity of the three-stage pipeline. When using only a single validator, the performance is extremely low due to the lack of localization priors; when the GA module is introduced but not combined with SAM segmentation, the IoU is improved to 0.37, but the performance improvement is still insufficient because the target edges cannot be accurately obtained; only under the fully integrated framework do all the indicators reach their peak.
[0056] Figure 4 This is a visual comparison of the weight recognition results in an embodiment of the present invention, used to intuitively demonstrate the localization and segmentation capabilities of the present invention's architecture. Wherein: Figure 4 Figures (a) to (c) show the recognition results obtained using the complete architecture of this invention. In the figures, the yellow rectangles represent the predicted bounding boxes, and the pink outlines represent the edges of the segmentation mask. Figure 4 (d) through (f) show the recognition results after removing the geometry prompt generation module, which is used to demonstrate the key role of the geometry prompt generation module in improving boundary fit and segmentation integrity.
[0057] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A railway plummet small target detection method based on geometric perception cues, characterized in that, Includes the following steps: Acquire images of the railway catenary onboard inspection and input them into the geometric prompt generation module; Based on the geometric prompt generation module, structured anchor points are extracted and spatial prompts are generated using line detection and geometric filtering techniques; The onboard inspection images of the railway catenary and the generated spatial cues are loaded into the cue-enabled segmentation module to guide the basic model in generating fine-grained candidate masks. The semantic verification module is used to extract features and classify the mask regions corresponding to the candidate masks. Combined with the post-processing filtering mechanism, the final detection result of the railway weight is output.
2. The method according to claim 1, wherein, The geometry hint generation module performs the following steps: Convert each input video frame image into a single-channel grayscale image; The single-channel grayscale image is input into the line segment detector, which automatically identifies real line segments through pixel-level gradient consistency grouping and statistical tests, and simultaneously achieves sub-pixel-level localization through the minimum parameter model to obtain the original line segments. Based on the original line segments, a cascaded geometric filter is used to screen candidate utility poles. The cascaded geometric filter discards short line segments whose length projection occupies less than a preset proportion of the image width or height, discards line segments whose tangent value is less than a preset value, and discards line segments whose distance from the image edge is less than a preset pixel. For each surviving line segment, select the endpoint with the larger ordinate value as the seed point; Based on the type of cues required downstream, a structured cue point cloud, i.e., a spatial cue, is generated for each seed point.
3. The method according to claim 2, wherein, The line segment detector specifically performs the following steps: Calculate the gradient magnitude and gradient direction of each pixel in a single-channel grayscale image; Sort all edge pixels according to the gradient direction; After sorting, potential same-direction pixels are searched within the local orientation bands of the pixels to construct chains; For each pixel within the chain, a straight line is fitted using the least squares method or the full least squares method to obtain the parametric form. Sub-pixel accuracy positioning is achieved by calculating the endpoint coordinates of the fitted line segment on the chain projection, thus obtaining candidate chains. The number of false alarms is calculated, which is defined as the probability that random gradient pixels in a pure noise image are precisely arranged into a chain of that length and direction. When the number of false alarms is lower than a preset threshold, the identified candidate chain is taken as the original line segment; otherwise, it is discarded.
4. The method for detecting small railway weights based on geometric perception cues according to claim 3, characterized in that, The method for constructing the chain is: using the pixel with the strongest gradient. As seed point, in pixels gradient direction With the central axis as the axis, the chain grows bidirectionally along the gradient direction; ; ; in, Indicates the angle of the region. Represents the pixels within the region. The width of the local directional band. For pixels The gradient direction; each chain represents a candidate support region segment.
5. The method for detecting small railway weights based on geometric perception cues according to claim 2, characterized in that, The method for generating the cue point cloud is as follows: for points located at... Seed points, cue points are placed in a predefined spatial pattern, where the horizontal spacing is determined by parameters. The vertical spacing is controlled by the aspect ratio parameter. Scaling: ; ; ; in, This indicates the number of tooltips generated along a single direction. Indicates the distance between two prompts. coordinate pixel interval, Indicates the total number of prompts. Indicates the distance between two prompts. coordinate pixel interval and The ratio of coordinate pixel intervals, The final generated points are the coordinates of the given points. The prompt points constitute a prompt point cloud.
6. The method for detecting small railway weights based on geometric perception cues according to claim 1, characterized in that, The cue-enabled segmentation module includes an image encoder, a cue encoder, and a mask decoder, wherein, The image encoder uses a pre-trained visual Transformer encoder for feature extraction, divides the input railway catenary vehicle inspection image into non-overlapping image blocks, performs linear projection on each image block, and generates a global image embedding by processing the word sequence obtained through stacked multi-head self-attention layers. The prompt encoder performs position encoding on the prompt points in the spatial prompt to obtain the prompt embedding; The mask decoder uses cascaded multi-head attention blocks and cross-attention blocks to jointly process global image embedding and cue embedding, generating a binary mask for each cue embedding, and finally outputting a mask with shape […]. The mask tensor, and a length of The relevant confidence score vector, where... Indicates the total number of prompts. Indicates the height of the image. Indicates the width of the image; The mask tensor is sorted and filtered based on the relevant confidence score vector to obtain candidate masks.
7. The method for detecting small railway weights based on geometric perception cues according to claim 6, characterized in that, The method for encoding the location of the prompt points in the spatial prompt is as follows: ; in, It is a randomly initialized zeta matrix. Provide the coordinates of the prompt point. For prompts The location encoding result.
8. The method for detecting small railway weights based on geometric perception cues according to claim 1, characterized in that, The semantic verification module uses a finely tuned EfficientNet-B0 validator.
9. A method for detecting small railway weights based on geometric perception cues according to claim 8, characterized in that, During the prediction process, each candidate mask generated by the cueable segmentation module is first converted into a minimum bounding box aligned with the image axis, and the cropping region is extracted from it. After resizing and normalizing the axis-aligned cropped image, it is fed into the EfficientNet-B0 validator for processing, and the class probability is output.
10. The method for detecting small railway weights based on geometric perception cues according to claim 1, characterized in that, The post-processing filtering mechanism specifically includes: Geometric feature filtering: Discard candidate boxes whose width exceeds their height; Repeat detection suppression: Perform nonmaximum suppression to eliminate duplicate detection results.