The development of renewable energy sources such as solar and wind based on distributed generators are growing rapidly in the face of the global energy crisis. As a connection between distributed generation and the main grid, microgrids are also growing rapidly. However, due to the randomness and uncertainty of the output of the solar and wind power, as well as the bidirectional characteristic of current flow, the faults in microgrids are difficult to identify using the traditional fault detection methods. To address this problem, this paper proposes a machine learning-based fault identification method for microgrids. First, the modified K-means algorithm is implemented to cluster the voltage data. Then, FP-growth algorithm is using to extract the association rules. Third, the mini-batch gradient descent (MBGD) algorithm is using to train the fault identification model based on machine learning theory. To verify the validity of this method, a case study considering single-phase short-circuit fault and two-phase phase short-circuit fault is simulated. The method presented in this work is with a high accuracy according to the simulation results.