The increasing integration of renewable sources into distributed networks results in multiple protection challenges that would be insufficient for conventional protection strategies to tackle because of the characteristics and functionality of distributed generation. These challenges include changes in fault current throughout various operating modes, different distribution network topologies, and high-impedance faults. Therefore, the protection and reliability of a photovoltaic distributed network relies heavily on accurate and adequate fault detection. The proposed strategy utilizes the Variational Mode Decomposition (VMD) and ensemble bagged trees method to tackle these problems in distributed networks. Primarily, VMD is used to extract intrinsic mode functions from zero-, positive-, and negative-sequence components of a three-phase voltage signal. Next, the acquired intrinsic mode functions are supplied into the ensemble bagged trees mechanism for detecting fault events in a distributed network. Under both radial and mesh-soft normally open-point (SNOP) topologies, the outcomes are investigated and compared in the customarily connected and the island modes. Compared to four machine learning mechanisms, including linear discriminant, linear support vector mechanism (SVM), cubic SVM and ensemble boosted tree, the ensemble bagged trees mechanism (EBTM) has superior accuracy. Furthermore, the suggested method relies mainly on local variables and has no communication latency requirements. Therefore, fault detection using the proposed strategy is reasonable. The simulation outcomes show that the proposed strategy provides 100 percent accurate symmetrical and asymmetrical fault diagnosis within 1.25 milliseconds. Moreover, this approach accurately identifies high- and low-impedance faults.