OpenCV can do the inference on deep neural networks (i.e. run the classification), but not train them.
So you’ll need a DNN library (like PyTorch or Tensorflow), a network architecture (check the model zoo) and a database to train the network.
Then use the same framework - or OpenCV* to run the classification.
[*] sometimes there are compatibility problems, and OpenCV won’t read correctly the network from other frameworks. So better stay with the same framework.