[Objective] Addressing the challenges of strong non-linearity and the tendency of traditional inversion methods to fall into local extrema in deep complex target detection, as well as the poor generalization across different observation arrays and insufficient resolution in existing deep learning methods for borehole-to-surface resistivity. [Methods] This paper proposes a deep learning inversion method (OAM-SwinUNet) that integrates spatial geometric mapping with a learnable soft mask mechanism. First, a multi-channel spatial geometric mapping strategy is designed to introduce prior physical information—such as apparent resistivity, source depth, and measurement positions—into the feature space. Second, the Swin-UNet architecture is refined by integrating partial convolution during the feature embedding stage to suppress feature dilution caused by sparse data. A learnable soft mask mechanism is also introduced to enhance the network's ability to suppress invalid padding regions and model global spatial features. Finally, a dataset comprising 30, 000 groups of complex geometric anomalies (including single/double rectangles and convex quadrilaterals) was constructed using Gmsh for training and validation. [Results] Theoretical model tests and ablation experiments demonstrate that the model reduces the root mean square error (RMSE) to 25.023 Ω·m and improves the structural similarity index (SSIM) to 0.9626 on the test set. Compared to the standard Swin-UNet, the proposed model shows significant improvements in prediction accuracy and boundary characterization. Furthermore, the network remains stable in recovering the position and overall morphology of anomalies when confronted with out-of-distribution (OOD) electrode configurations, 5% gaussian noise, and complex triple-rectangular models. [Conclusion] This method effectively fuses local feature extraction with global physical constraints, significantly enhancing the precision of borehole-to-surface resistivity inversion and its adaptability to different observation arrays. It provides a reliable technical method for the real-time and high-resolution inversion of various geological structures.