In the traditional peripheral-security-early-warning system, the endpoint detection and pattern recognition of the signals generated by the distributed optical fiber vibration sensors is completed step-by-step and in an orderly manner. The method by which these two processes may be placed end-to-end in a network model and processed simultaneously to improve work efficiency has increasingly become the focus of research. In this paper, the target detection algorithm combines the endpoint-detection and pattern-recognition processes of the vibration signal, which can not only quickly locate the start and end vibration positions of the signal but also accurately identify a certain type of signal. You Only Look Once v4 (YOLOv4) is one of the most advanced target detection algorithms, achieving the optimal balance of speed and accuracy. To reduce the complexity of the YOLOv4 model and solve the dataset's unbalanced sample classification problem, we use a deep separable convolution (DSC) network and a focal loss function to improve the YOLOv4 model. In this paper, the five kinds of signals collected in real-time are visualized as two different datasets in oscillograph and time-frequency diagrams as detection objects. According to the experimental results, we obtained 98.50% and 93.48% mean Average Precision (mAP) and 84.8 and 69.9 frames per second (FPS), respectively, which are improved compared to YOLOv4. Comparing the improved algorithm with other optical fiber vibration signal recognition algorithms, the mAP and FPS values were improved, and the detection speed was about 20 times faster than that of other algorithms. The improved algorithm in this paper can quickly and accurately identify the vibration signal of external intrusion, reduce the false-alarm rate of the early-warning system, and improve the real-time detection rate of the system while ensuring high recognition accuracy.