I'm wondering if the approach I'm thinking of could even work. I want to use dictionary learning for image classification. The first step would be to learn the dictionary from a set of similar yet different images to be able to extract background from an image. For example, I have a set (e.g. 500 photos) of images of the same object, but the scenes differ (light, the angle the photo was taken at etc.) Basically, the main object is the same, or more precisely, the objects are very similar, they all show the main object. Is it possible to use dictionary learning to model the main object? My next step would be to model the main object (the background) with sparse coding techniques and detect "unexpected" objects. This is so called a contrario approach in object detection problems.

I'm inspired by these publications:

  1. https://ijpam.eu/contents/2013-89-2/5/5.pdf
  2. https://arxiv.org/pdf/2007.15757.pdf

Next, what software would let me do this? I found the mlpack package (for R and Python). It has a function sparse_coding that performs dictionary learning. I tried it on MNIST dataset and I can model digits, denoise them etc. But haven't tried on images of my interest so far. The learning process will take a lot of time, I guess. I took a while for MNIST 28 x 28px images.

Does my experiment has sense? What do you recommend? Do You know any tutorials with code samples I can take a look?


1 Answer 1


Your experiment has sense, please take a look at this paper about the same topic. Here another document about some details in methodology. But I would prefer to use deep learning approaches, for instance: Convolutional layers for images.

  • $\begingroup$ Thanks for Your answer. Is Your recommendation on using deep learning dictated the fact today's networks outperforms old-fashion techniques or are there any other reasons? I'm not a domain expert and I know nowadays researchers (and practitioners ) use deep learning commonly, but is dictionary learning obsolete? $\endgroup$ Sep 23, 2021 at 15:33
  • $\begingroup$ are two different approaches. You can choose and compare. There is not a conclusion about what technique is better.... just they are different. $\endgroup$
    – Paul Goyes
    Sep 23, 2021 at 21:37
  • $\begingroup$ Just to point out that the 2 papers by OP are at least 10 years old... I am biased to believe that mankind have made some progress in research. $\endgroup$
    – lpounng
    May 23, 2022 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.