Which classifier should I use for game automation? [closed] - machine-learning

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I suppose I have to pick one from this list:
http://scikit-learn.org/stable/modules/scaling_strategies.html
As I need incremental learning.
I'm trying to get machine learning to learn how to play a simple NES game. I'm going to teach the machine some basic data from the game such as player x & y, enemy x & y, points etc.
Based on the data mentioned above the machine should predict which button to press.
So what classifier do you recommend for such project?

Here, let me do a browser search for you:
machine learning train computer to play video game
first hit
To summarize, this is not a problem you will solve well by choosing a classifier off a menu. Now, this article is extreme learning: the model trains from the screen image alone (an array of pixels). If you extract game abstractions (identify objects on the screen), you will have a quicker training period. However, the matter remains that to play a visual game well, you will likely need the learning strategy outlined in the papers from this research: time-based input with delayed reward recognition.
This means that your machine learning gets its feedback from points, lives, or playing time awarded somewhat after a particular good action. For instance, in Pong, you might make a 2-shot combination: one to pull your opponent's paddle out of position, the second to slap the ball past him in the opposite corner. Only after the opponent fails the second defence, do you get the point.
This is not a trivial problem to do well.

Related

Is it possible to gather the image matrix of a pygame gameboard without rendering the image to the screen? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I wrote a 2d simulation (very similar to the Atari- OpenAi games) in pygame, which I need for an reinforcement learning project. I'd like to train a neural network using mainly image data, i.e. screenshots of the pygame gameboard.
I am able to make those screenshots, but:
- Is possible to gather this image data - or, more precisely, the
corresponding rgb image matrix - also without rendering the whole
playing ground to the screen?
As I figured out there is the possibility to do such in pyglet ... But I would like to avoid to rewrite the whole simulation.
Basically, yes. You don't have to actually draw anything to the screen surface.
Once you have a Surface, you can use methods like get_at, the PixelArray module or the surfarray module to access the RGB(A)-values of each pixel.

Preparing Dataset for a Convolutional Neural Network [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am trying to implement a Convolutional Neural Network (CNN) model to classify hand gestures. Dataset is not readily available and hence I need to prepare it.
How should i prepare the dataset? Should the images I capture contain objects other than the hand or only the hand? Which will give me an accurate model that will work accurately despite of background and other objects in the frame?
Good Dataset for your problem:
You should consider involving different backgrounds and objects in background.
Following links might help you:
https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html
https://www.quora.com/Computer-Vision-What-is-the-best-way-to-collect-Train-and-Test-data-images-for-object-recognition-job
here is an example:
http://cims.nyu.edu/~tompson/NYU_Hand_Pose_Dataset.htm
it containing other images would just mean you have to implement something in your pipeline to isolate the hand. i would recommend having only the hand in the images so you can just start modelling on the images right away.
a lot of cnn architectures in this area using multi-resolution CNNs. so in your data preparation just make multiple resolutions and feed to a multi input CNN. you can make this using Keras functional API. low res images are fine for differentiating between certain very different poses and the higher res can focus on small differences.
obviously, standard data augmentation is not that suitable for hand pose. stuff like mirroring or changing the angle could make your data unsuitable for the given label. so be a bit more conservative with your data augmentation if you don't have that much.

Vehicle Detection and Tracking unisng Lucas kanade [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have an image processing project, clearly the title reveals what it is.
Assume I have a camera on top of the one of the traffic lights beside a four way in a heavy crowded city. The project should get the recorded video from that camera.
Identify the cars on the scene and track their movements.
for the tracking part I believe Lucas Kanade with pyramids or even Lucas Kanade Tomasi would be sufficient.
But before tracking I should Identify the cars coming into the scene. I wonder how I can do that. I mean how I can distinguish between people/trees/building/... and cars.
what should I do for identifying ?
I want you to be kind enough with me and share your ideas.
thanks.
I detected contours and filtered them by size. That worked for me using the same video available on the link posted by GiLevi (http://www.behance.net/gallery/Vehicle-Detection-Tracking-and-Counting/4057777). You could also perform background sutraction, and detect blobs, on the foreground mask; again filtering by size, so as to differentiate from cars, people etc.

Image processing surveillance camera [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I was given this question on a job interview and think I really messed up. I was wondering how others would go about it so I could learn from this experience.
You have one image from a surveillance video located at an airport which includes line of people waiting for check-in. You have to assess if the line is big/crowded and therefore additional clerks are necessary. You can assume anything that may help your answer. What would you do?
I told them I would try to
segment the area containing people from the rest by edge detection
use assumptions on body contour such as relative height/width to denoise unwanted edges
use color knowledges; but then they asked how to do that and I didn't know
You failed to mention one of the things that makes it easy to identify people standing in a queue — the fact that they aren't going anywhere (at least, not very quickly). I'd do it something like this (Warning: contains lousy Blender graphics):
You said I could assume anything, so I'll assume that the airport's floor is a nice uniform green colour. Let's take a snapshot of the queue every 10 seconds:
We can use a colour range filter to identify the areas of floor that are empty in each image:
Then by calculating the maximum pixel values in each of these images, we can eliminate people who are just milling around and not part of the queue. Calculating the queue length from this image should be very easy:
There are several ways of improving on this. For example, green might not be a good choice of colour in Dublin airport on St Patrick's day. Chequered tiles would be a little more difficult to segregate from foreground objects, but the results would be more reliable. Using an infrared camera to detect heat patterns is another alternative.
But the general approach should be fairly robust. There's absolutely no need to try and identify the outlines of individual people — this is really very difficult when people are standing close together.
I would just use a person detector, for example OpenCV's HOG people detection:
http://docs.opencv.org/modules/gpu/doc/object_detection.html
or latent svm with the person model:
http://docs.opencv.org/modules/objdetect/doc/latent_svm.html
I would count the number of people in the queue...
I would estimate the color of the empty floor, and go to a normalized color space (like { R/(R+G+B), G/(R+G+B) } ). Also do this for the image you want to check, and compare these two.
My assumption: where the difference is larger than a threshold T it is due to a person.
When this is happening for too much space it is crowded and you need more clerks for check-in.
This processing will be way more robust than trying to recognize and count individual persons, and will work with quite row resolution / low amount of pixels per person.

best Segmentation algorithm [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm trying to develop a system, which recognizes various objects present in an image based on their primitive features like texture, shape & color.
The first stage of this process is to extract out individual objects from an image and later on doing image processing on each one by one.
However, segmentation algorithm I've studied so far are not even near perfect or so called Ideal Image segmentation algorithm.
Segmentation accuracy will decide how much better the system responds to given query.
Segmentation should be fast as well as accurate.
Can any one suggest me any segmentation algorithm developed or implemented so far, which won't be too complicated to implement but will be fair enough to complete my project..
Any Help is appreicated..
A very late answer, but might help someone searching for this in google, since this question popped up as the first result for "best segmentation algorithm".
Fully convolutional networks seem to do exactly the task you're asking for. Check the paper in arXiv, and an implementation in MatConvNet.
The following image illustrates a segmentation example from these CNNs (the paper I linked actually proposes 3 different architectures, FCN-8s being the best).
Unfortunately, the best algorithm type for facial recognition uses wavelet reconstruction. This is not easy, and almost all current algorithms in use are proprietary.
This is a late response, so maybe it's not useful to you but one suggestion would be to use the watershed algorithm.
beforehand, you can use a generic drawing(black and white) of a face, generate a FFT of the drawing---call it *FFT_Face*.
Now segment your image of a persons face using the watershed algorithm. Call the segmented image *Water_face*.
now find the center of mass for each contour/segment.
generate an FFT of *Water_Face*, and correlate it with the *FFT_Face image*. The brightest pixel in resulting image should be the center of the face. Now you can compute the distances between this point and the centers of segments generated earlier. The first few distances should be enough to distinguish one person from another.
I'm sure there are several improvements to the process, but the general idea should get you there.
Doing a Google search turned up this paper: http://www.cse.iitb.ac.in/~sharat/papers/prim.pdf
It seems that getting it any better is a hard problem, so I think you might have to settle for what's there.
you can try the watershed segmentation algorithm
also you can calculate the accuracy of the segmentation algorithm by the qualitative measures

Resources