Flatness of cold rolled strip is an extremely important indicator of quality, and flatness control is the key technology of the modern high-accuracy rolling mill. The establishment of an efficient and accurate flatness prediction model is conducive to improving the flatness accuracy and realizing the effective control of flatness. Inspired by the error minimization principle, error minimized extreme learning machine with two hidden layers (EM-TELM) used to automatically determine the optimum hidden nodes is proposed in the paper, which is applied to establish the flatness prediction model of cold rolled strip. EM-TELM uses the block matrices to solve the output matrix of the second hidden layer. EM-TELM randomly adds one or a group of hidden nodes to the current network every time. During the increasing process of the network structure, the weights matrix connecting the hidden layer and the output layer are updated incrementally. Since EM-TELM is a no analytic method, it can be used in a kind of prediction problem for complex and difficult modeling systems. The experimental results indicated that the accuracy of EM-TELM is higher than that of EM-ELM, and EM-TELM reduces the computational complexity and training time compared to TELM which recalculates the parameters between different hidden layers when the network structure changes. INDEX TERMS Block matrices, cold rolled strip, error minimization, extreme learning machine, flatness prediction, two-hidden-layer.