In this paper, an adaptive learning technique based on the classification of activity measure is proposed for compression artifacts reduction. All the coding artifacts are treated as digital noise and are removed in a unified framework. Pixels are explicitly classified into object details or various coding artifacts using the combination of local entropy and dynamic range. A least mean square optimization technique is applied on a training set that is composed of the original images and the compressed versions of the original images. The optimal filter coefficients for each class are obtained by making the mean square error (MSE) between the original pixels and the filtered outputs of the compressed apertures minimized statistically. Evaluation results show that the proposed algorithm outperforms more expensive state-of-the-art structure based methods.