Aiming at the problems of small key space, low security, and low algorithm complexity in a low-dimensional chaotic system encryption algorithm, an image encryption algorithm based on the ML neuron model and DNA dynamic coding is proposed. The algorithm first performs block processing on the R, G, and B components of the plaintext image to obtain three matrices, and then constructs a random matrix with the same size as the image components through logistic mapping and performs DNA encoding, DNA operation, and DNA decoding on the two parts. Second, it performs determinant permutation on the matrix by two different chaotic sequences obtained by logistic mapping iteration. Finally, it merges the block and image components to complete the image encryption and obtain the ciphertext image. Wherein, DNA encoding, DNA operation, and DNA decoding methods are all randomly and dynamically determined by the chaotic sequence generated by the ML neuron chaotic system. According to simulation results and performance analysis, the algorithm has a larger key space, can effectively resist various statistical and differential attacks, and has better security and higher complexity.