In this paper, an improvement for the Moth-flame Optimization (MFO) algorithm is proposed based on Opposition-Based Learning (OBL), that enhances the exploration of the search space through computing the opposition values of solutions generated by MFO. Moreover, such an approach increases the efficiency of MFO as multiple regions in the search space are investigated at the same time. The proposed algorithm (referred to as OBMFO) avoids the limitations of MFO (and other swarm intelligence algorithms) that result from the moving in the direction of the best solution, especially if this direction does not lead to the global optimum. Experiments are run using classical six benchmark functions to compare the performance of OBMFO against MFO. Moreover, OBMFO is used to solve the feature selection problem, using eight UCI datasets, in order to improve the classification performance through removing irrelevant and redundant features. The comparison results show that the OBMFO superiors to MFO for the tested benchmark functions. It also outperforms another three swarm intelligence algorithms in terms of the classification performance.