YanJieWen / GJADet-crash-pytorch

Full-Scale Train Collision Multi-Structure Automated Detection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GJADet-crash-pytorch

Full-Scale Train Collision Multi-Structure Automated Detection

Gradient-guided Joint Representation Loss with Adaptive Neck for Train Crash Detection

Central south university

Model

Contents

  • Abstract

  • Train

  • Test

  • Contributing

  • License

  • Abstract

    Conducting real train crash experiments is the most straightforward and effective methods to research the train's crashworthiness and enhance passive safety protection. As a non-contact measurement method, high-speed camera can efficiently capture the evolving motion patterns of trains under the high-speed states. Traditional data extraction methods rely on expert-based manual annotations, which are susceptible to factors such as lighting changes, scale variance, and impact debris. Inspired by the tremendous success of Deep Neural Networks (DNNs) in the computer vision community, we first collect 75 real-world train crash scenes and manually annotated them to form the Crash2024 dataset, enriching the community's data resources. Moreover, we propose the novel Gradient-guided Joint representation loss with Adaptive neck Detection network (GJADet). At the macro level, we embed the adaptive module into the Path Aggregation Feature Pyramid Network (PAFPN), which combines multiple self-attention mechanisms to achieve scale-awareness, spatial-awareness, and task-awareness approaches, significantly improving the detector's representation ability and alleviating the dense-small characteristics of target points in train crash without significant computational overhead. At the micro level, due to the extreme imbalance of target points compared to other classes, we propose a gradient-guided joint representation classification loss to mitigate the long-tailed distribution problem, and the classification and regression are joint representation to maintain consistency between training and inference. On the Crash2024, our model achieves the performance improvement of 3.5AP and significantly alleviate the accuracy loss problem for rare categories. Our code are open source at URL

  • Train

The overall of framework

image

We have supplied 7 baseline backbone: Convnext, DLA, Resnet,Swin-Transformer,Darknet, CSPDarknet, VGG.
You can follow the following Tips: Donwload the pretrained backbone weight from offical or Google Change the train.py

  • the super parameter are shown in line 254-line 276

  • the obj_loss in line 261 for Focal loss and QualityLoss

  • the cls_loss in line 262 for Focal loss, QualityLoss, EQ, and GradientJointRepresentation.

  • the iou_loss in line 144 for CIou, DIoU and Iou

  • the backbone in line 271

  • Download the datasets into the datasets file and transform the data into COCO-like

  • python train.py

  • Test

  • Run eval.py, change the line 102 to line 112 for detection results. You can get:

model.npy save the detection results
record_mAP.txt mAP@0.5, mAP(@.5:.95) per class based on COCO
  • If you get the model.npy file, you can run the visual_anlysis.py to visualization of detections, which show the TP (Red RECT), FP (BLUE RECT), and FN(GREE RECT). image

  • If you get the model.npy file, you can transform the npy-like file into the COCO json. Then run the get_pr.py, you can output the pr_curve.xlsx for 101 points (Recall 0:0.01:1).

  • Run demo.py, you can get the visualization of demo and the responses of detection based on Grad-cam, the explaination of deep learning tools.

  • Contributing

mmdetection
YOLO family

  • License

MIT © YanjieWen

About

Full-Scale Train Collision Multi-Structure Automated Detection

License:MIT License


Languages

Language:Python 100.0%