Recently, Dozens of applications for sparse representation has been developed. The model with l0-norm as constraint is an NP hard problem. How to find the global optimal solution is a difficult point of this area. For genetic algorithm is good at solving NP hard problem, a dictionary training method based on it is proposed in this paper. The samples are first classified randomly for generate original population and residual of approximate the sample class with a rank-1 matrix as fitness is calculated. Then, select better individuals using league matches. After that new individuals are generated from crossover and mutation and the residual of the representation is used as data samples for training the dictionary for the next layer. The experimental results show the algorithm are effective.