Method and system for crowd counting
A method for counting number of people in an image includes feeding an image into an object counting model to generate a first result for the image that is indicative of a number of human heads detected in one or more regions of the image. The image is fed into a regression model to generate a second result for the image that is indicative of a regression count of people detected in the one or more regions of the image. An estimate of people detected in the image is obtained based on the first result and the second result using one or more rules.
1. A method for counting number of people in an image comprising:
feeding the image into an object counting model to generate a first heat map for the image that is indicative of a number of human heads detected in one or more regions of the image;
feeding the image into a regression model to generate a second heat map for the image that is indicative of a regression count of people detected in the one or more regions of the image; and
obtaining an estimate of people detected in the image based on the first heat map and the second heat map using one or more rules, including stacking the first heat map and the second heat map to form a multiple channel input and feeding the multiple channel input into a Convolutional Neural Network (CNN) based regression model.
2. The method of claim 1 , wherein the object counting model comprises a first CNN model and the regression model comprises a second CNN model.
3. The method of claim 2 , wherein the object counting model comprises two or more CNN models.
4. The method of claim 1 , wherein the CNN based regression model utilizes a Mean Absolute Error (MAE) loss function.
5. The method of claim 1 , wherein each of the first heat map and the second heat map has a fixed size or a variable size.
6. The method of claim 5 , wherein a cell of each fixed size CNN based regression model comprises 8×8 pixels.
7. The method of claim 5 , wherein the one or more rules are used to identify one or more events in the image.
8. A system for counting number of people in an image comprising:
a hardware processor configured to:
feed the image into an object counting model to generate a first heat map for the image that is indicative of a number of human heads detected in one or more regions of the image;
feed the image into a regression model to generate a second heat map for the image that is indicative of a regression count of people detected in the one or more regions of the image; and
obtain an estimate of people detected in the image based on the first heat map and the second heat map using one or more rules, including stacking the first heat map and the second heat map to form a multiple channel input and feeding the multiple channel input into a Convolutional Neural Network (CNN) based regression model.
9. The system of claim 8 , wherein the object counting model comprises a first CNN model and the regression model comprises a second CNN model.
10. The system of claim 9 , wherein the object counting model comprises two or more CNN models.
11. The system of claim 8 , wherein the CNN based regression model utilizes a Mean Absolute Error (MAE) loss function.
12. The system of claim 8 , wherein each of the first heat map and the second heat map has a fixed size or a variable size.
13. The system of claim 12 , wherein a cell of each fixed size CNN based regression model comprises 8×8 pixels.
14. The system of claim 12 , wherein the one or more rules are used to identify one or more events in the image.