Answers.Body: <p>OpenCV does include 2D filter convolution functions for custom <a href="https://docs.opencv.org/3.4/d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d" rel="nofollow noreferrer">separable</a> and <a href="https://docs.opencv.org/3.4/d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04" rel="nofollow noreferrer">non-separable</a> filters. The latter uses DFT for large filters, which may or may not be faster than the conventional method. It also includes (partial?) support for <a href="https://docs.opencv.org/3.4/d6/d0f/group__dnn.html" rel="nofollow noreferrer">deep nets</a> with <a href="https://docs.opencv.org/3.4/d6/d87/group__dnnLayerList.html" rel="nofollow noreferrer">various types of layers</a>. Theoretically, you should be able to stitch everything together into a complete CNN. However, I have not used any of those, and I have no idea about the level of maturity of the implementation.</p>
  
  <p>That said, if you are willing to implement a custom CNN from scratch, you will probably get more control over the implementation using a generic (BLAS / OpenCL / CUDA) matrix library.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-04T12:09:20.330Z
Answers.LastActivityDate: 2018-07-04T12:09:20.330Z
Answers.UserDisplayName: cantordust
Body: <p>I have practiced building CNNs for image classification with TensorFlow, which is a nice library with good documentation and tutorials. However, I found that TensorFlow is too complicated and cumbersome.</p>
  <p>Can I build a CNN for image classification tasks just with OpenCV?</p>
  
Tags: <deep-learning><convolutional-neural-networks><tensorflow><image-recognition><opencv>
Title: Can I build a CNN for image classification tasks just with OpenCV?
UserDisplayName: guesswho
ThreadText: # Can I build a CNN for image classification tasks just with OpenCV?
  
  (Asked by: username_0 on 2018-07-04)
  
  I have practiced building CNNs for image classification with TensorFlow, which is a nice library with good documentation and tutorials. However, I found that TensorFlow is too complicated and cumbersome.
  
  Can I build a CNN for image classification tasks just with OpenCV?
  
  **Tags:** deep-learning, convolutional-neural-networks, tensorflow, image-recognition, opencv
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-04. Score: 4 | Accepted answer
  
  OpenCV does include 2D filter convolution functions for custom [separable](https://docs.opencv.org/3.4/d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d) and [non-separable](https://docs.opencv.org/3.4/d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04) filters. The latter uses DFT for large filters, which may or may not be faster than the conventional method. It also includes (partial?) support for [deep nets](https://docs.opencv.org/3.4/d6/d0f/group__dnn.html) with [various types of layers](https://docs.opencv.org/3.4/d6/d87/group__dnnLayerList.html). Theoretically, you should be able to stitch everything together into a complete CNN. However, I have not used any of those, and I have no idea about the level of maturity of the implementation.
  
  That said, if you are willing to implement a custom CNN from scratch, you will probably get more control over the implementation using a generic (BLAS / OpenCL / CUDA) matrix library.
  
  
  ---
  
  