I have just managed to train a model using tensorflow to identify the digits from SVHN dataset using regression head. And I want to know the location of each classified digit. Here is a similar question. I have been googling around the terms RCNN (faster RCNN), regression head and classification head, and read the source code from some github projects solving the localization problem using different solutions, but it feels like I am hitting the wall in each of the solution

  1. Use regression head to train on the bounding box. I face two difficulties here. First, to generate bounding box for digits as training data. Second, I don't know if it is possible combining classification + localization into one training label (vector with 5 elements), Here is the related project that I found.

  2. RCNN is like a complete pipeline of many different things,and I am not ready for that. There is this method shown in leonardoaraujosantos. Step1. find the activation map that yields highest probability for classification in the fully connected layer Step2. resize the selected activation map to the size of original image size. The position with dot product value over certain threshold is the location, mark it. Found this project and wonder if it is the way to go, it is a bit difficult for me to understand the math though


You're going to have a tough time doing this without a training set on bounding boxes. Why not just use the SVHN dataset with bounding boxes, found here?


To actually detect bounding boxes, you'll likely need some kind of RCNN network, because the difficulty is always with region proposals.

If you want an unsupervised method you could try this:

Fast Unsupervised Object Localization - Anjan, et. al.:


| cite | improve this answer | |
  • $\begingroup$ I will go for the supervised method after reading the paper you refer to. My plan is to step1: replicate the implementation here, use tensorflow intead of keras, so single cat face can be localized. step2: add the work from step1 to my existing solution which is able to classify maximally 5 digits using the dataset. I will post another comment with sub-questions $\endgroup$ – user3453552 Jan 7 '18 at 22:58
  • $\begingroup$ fundamental problem: I don't know how to treat the fully connect layer as regression instead of classification, any resource I can read on? Second problemto get the identity is classification problem with corss_entropy as loss function and to get the bounding box is regression problem with mse as loss function. Is that possible to have labels like ["3",x,y,height,width], just use one regression model to predict them at one shot? if the identity and the bouding box are predicted as totally unrelated result from ex. two different softmax models, then localization will lose its meaning. $\endgroup$ – user3453552 Jan 7 '18 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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