A self-organizing network is used to perform invariance extraction and recognition of handwritten digits. To extract the invariance effectively, we propose to combine the trace learning rule and the on-line dual extended Kalman filter (DEKF) algorithm. Furthermore, a new activation function is suggested to replace the traditional sigmoid activation function so as to reduce the sensitivity of the extracted features to samples with large variance. Computer simulations show that both the learning speed and the recognition rate are improved using a compact network.