AUTHOR=Haihua Ju , Li Wang , Jie Yang , Gaochuan Liu , Zhong Xia , Jian Jiao , Le Zhang , Bo Dai TITLE=A high-precision edge detection technique for magnetic anomaly signals based on a self-attention mechanism JOURNAL=Frontiers in Earth Science VOLUME=Volume 13 - 2025 YEAR=2025 URL=https://www.frontiersin.org/journals/earth-science/articles/10.3389/feart.2025.1600631 DOI=10.3389/feart.2025.1600631 ISSN=2296-6463 ABSTRACT=Magnetic data boundary detection is a key technology in potential field data processing, providing an effective basis for the division of geological units and fault structures. It holds significant importance in geological structure analysis and mineral exploration. Deep learning methods, which can automatically capture complex magnetic anomaly features, have been widely applied in boundary detection. However, convolution-based neural networks are limited by the local receptive field of the convolution paradigm, making it difficult to effectively establish long-range dependencies. This poses a challenge for high-precision magnetic data boundary detection. Additionally, traditional loss functions fail to guide the network in effectively extracting boundary information, limiting the accuracy of boundary detection. To address these issues, this paper proposes a magnetic data boundary detection method based on a self-attention mechanism. This method fully leverages the self-attention mechanism in Transformers to effectively extract global features, allowing the model to focus on key regions within the input data, thereby enhancing its ability to recognize complex boundaries. Meanwhile, an edge-enhanced loss function is introduced to further strengthen the model’s ability to extract boundary information. Synthetic experiments demonstrate that the proposed method achieves higher prediction accuracy and more precise boundary localization. Furthermore, validation using magnetic anomaly observation data from the Yushishan area in Gansu, China, confirms the reliability of the boundary detection results.