<sub>The signal recognition of the casing coupling (CCL) is achieved through locating the coupling position for well logging depth correction. However, due to the significant interference from downhole noise, signal distortion, and the lack of high-quality labeled data, the existing supervised learning methods are limited in practical applications. Therefore, this paper proposes an improved self-supervised learning framework - TF-SCL, which is trained using unlabeled well logging data. To address the above issues, the proposed method in this paper improves the baseline method from two dimensions: one is to introduce a signal time-frequency enhancement strategy in data augmentation, using frequency domain features to improve noise resistance; the other is to integrate a relative position-aware Transformer in the temporal comparison module to capture the temporal dependencies in the signal. This framework adopts the "unsupervised pre-training + small sample fine-tuning" mode. Experimental results on real datasets show that the model only requires 1% of labeled data for fine-tuning to achieve an accuracy of 97.98%, and the classification accuracy on the full test set is close to 100%. The results indicate that compared with machine learning methods and traditional supervised models, the method used in this paper has superior generalization performance and robustness in scenarios with scarce labels and imbalanced categories.</sub>