Answers.Body: <blockquote>
    <p>My question is: is it possible to deploy a NN model trained with images all coming from a single parking area in another parking area? Is not such a model for parking detection occupancy supposed to generalize independently from the location where training images have been taken?</p>
  </blockquote>
  
  <p>Generalisation in machine learning has limits, and for complex systems such as computer vision, it is very easy to exceed them. This is why the state-of-the-art systems use huge amounts of training data which is often augmented with automated variations, plus trained on for many days.</p>
  
  <p>If you want some factor in your model to generalise well, you should:</p>
  
  <p>a) Train with variations in that factor</p>
  
  <p>b) Test with variations in that factor that have not already been seen in the training set</p>
  
  <p>For the factor you wish to have the model generalise in, then it looks like (a) has not been done, and that you have just done (b) and found that the first attempt has failed an important test that you care about.</p>
  
  <p>I suspect the trained model you have used will generalise well by time of day, type of vehicle and some other details. It does not appear to generalise to a new location because it was trained on only one location.</p>
  
  <p>If you have limited training data, you may want to look at approaches to fine-tuning against more general image classifiers (such as the many ImageNet-trained classifiers, which are available to download). However, even then you should train with a few varieties of parking space, or at the very least with the spaces that you care about (if you do the latter then it probably won't generalise to other spaces, but you won't care).</p>
  
  <hr>
  
  <p>It may also be worth seeing what you can do to transform the input that you are working with to have similar view over the new parking area that the training images have. Using a transform to align the outline of the new area with the old one, and possibly some colour correction could help a lot.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T13:44:16.467Z
Answers.LastActivityDate: 2018-10-25T13:51:54.437Z
Answers.LastEditDate: 2018-10-25T13:51:54.437Z
Answers.UserDisplayName: Neil Slater
Body: <p>I loaded a neural network model trained with Caffe by other people in OpenCV. </p>
  
  <p>The model should detect the presence of a car in a single parking spot outputting the probability of it being free/occupied.</p>
  
  <p>The model was trained with images all belonging to the same parking area, taken at different hours of day and with different light conditions. Images were taken by different cameras but the cameras are all of the same model (raspberry cameras).</p>
  
  <p>I tried to run the model with a few images some of them taken from their dataset and other downloaded from google.</p>
  
  <p>The images taken from their dataset are correctly classified while the ones taken from google are not correctly classified.</p>
  
  <p>My question is: is it possible to deploy a NN model trained with images all coming from a single parking area in another parking area? Is not such a model for parking detection occupancy supposed to generalize independently from the location where training images have been taken?</p>
  
  <p>If you know about an already existing trained model that works good please let me know.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-25T13:50:57.910Z
Comments.Text: It is unlikely anyone will know of or be willing to search for an existing model - such requests are generally off-topic in Stack Exchange.
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-25T13:52:48.177Z
Comments.Text: That is not my main question and I am not asking for people looking for it. I am just asking that if they know about the existance of such models please let me know.
Comments.UserDisplayName: Francesco Boi
Tags: <neural-networks><image-recognition><classification><training>
Title: Influence of location on a Neural Network trained for parking detection occupancy
UserDisplayName: Francesco Boi
ThreadText: # Influence of location on a Neural Network trained for parking detection occupancy
  
  (Asked by: username_0 on 2018-10-25)
  
  I loaded a neural network model trained with Caffe by other people in OpenCV.
  
  The model should detect the presence of a car in a single parking spot outputting the probability of it being free/occupied.
  
  The model was trained with images all belonging to the same parking area, taken at different hours of day and with different light conditions. Images were taken by different cameras but the cameras are all of the same model (raspberry cameras).
  
  I tried to run the model with a few images some of them taken from their dataset and other downloaded from google.
  
  The images taken from their dataset are correctly classified while the ones taken from google are not correctly classified.
  
  My question is: is it possible to deploy a NN model trained with images all coming from a single parking area in another parking area? Is not such a model for parking detection occupancy supposed to generalize independently from the location where training images have been taken?
  
  If you know about an already existing trained model that works good please let me know.
  
  **Tags:** neural-networks, image-recognition, classification, training
  
  > **Comments:**
  > **username_1**: It is unlikely anyone will know of or be willing to search for an existing model - such requests are generally off-topic in Stack Exchange.  
  > **username_0**: That is not my main question and I am not asking for people looking for it. I am just asking that if they know about the existance of such models please let me know.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-10-25. Score: 1
  
  > My question is: is it possible to deploy a NN model trained with images all coming from a single parking area in another parking area? Is not such a model for parking detection occupancy supposed to generalize independently from the location where training images have been taken?
  
  Generalisation in machine learning has limits, and for complex systems such as computer vision, it is very easy to exceed them. This is why the state-of-the-art systems use huge amounts of training data which is often augmented with automated variations, plus trained on for many days.
  
  If you want some factor in your model to generalise well, you should:
  
  a) Train with variations in that factor
  
  b) Test with variations in that factor that have not already been seen in the training set
  
  For the factor you wish to have the model generalise in, then it looks like (a) has not been done, and that you have just done (b) and found that the first attempt has failed an important test that you care about.
  
  I suspect the trained model you have used will generalise well by time of day, type of vehicle and some other details. It does not appear to generalise to a new location because it was trained on only one location.
  
  If you have limited training data, you may want to look at approaches to fine-tuning against more general image classifiers (such as the many ImageNet-trained classifiers, which are available to download). However, even then you should train with a few varieties of parking space, or at the very least with the spaces that you care about (if you do the latter then it probably won't generalise to other spaces, but you won't care).
  
  ---
  
  It may also be worth seeing what you can do to transform the input that you are working with to have similar view over the new parking area that the training images have. Using a transform to align the outline of the new area with the old one, and possibly some colour correction could help a lot.
  
  
  ---
  
  