The intelligent architecture based on the microgrid (MG) system enhances distributed energy access through an effective line network. However, the increased paths between power sources and loads complicate the system’s topology. This complexity leads to multidirectional line currents, heightening the risk of current loops, imbalances, and potential short-circuit faults. To address these challenges, this study proposes a new approach to accurately locate and identify faults based on MG lines. Initially, characteristic indices such as fault voltage, voltage fundamentals at each MG measurement point, and extracted features like peak voltage values in specific frequency bands, phase-to-phase voltage differences, and the sixth harmonic components are utilized as model inputs. Subsequently, these features are classified using the Lightweight Gradient Boosting Machine (LightGBM), complemented by the bagging (Bootstrap Aggregating) ensemble learning algorithm to consolidate multiple strong LightGBM classifiers in parallel. The output classification results of the integrated model are then fed into a neural network (NN) for further training and learning for fault-type identification and localization. In addition, a Shapley value analysis is introduced to quantify the contribution of each feature and visualize the fault diagnosis decision-making process. A comparative analysis with existing methodologies demonstrates that the LightGBM-NN model not only improves fault detection accuracy but also exhibits greater resilience against noise interference. The introduction of the bagging method, by training multiple base models on the initial classification subset of LightGBM and aggregating their prediction results, can reduce the model variance and prevent overfitting, thus improving the stability and accuracy of fault detection in the combined model and making the interpretation of the Shapley value more stable and reliable. The introduction of the Shapley value analysis helps to quantify the contribution of each feature to improve the transparency and understanding of the combined model’s troubleshooting decision-making process, reduces the model’s subsequent collection of data from different line operations, further optimizes the collection of line feature samples, and ensures the model’s effectiveness and adaptability.