A novel method for optimizing nonlinear filters is proposed. This method utilizes an analogy between the rank-order filter and the feed-forward neural network with shift-invariant interconnections. The optimization problem of the filter results in the learning of the interconnection weights of the network. It is shown that the weighted median filter (WMF) and the rank-order based nonlinear differential operator (RONDO) can be also optimized by this method. It is also shown that a cascade of RONDO and the WMF can be optimized by the learning method of multilayer network.