In Google AutoML vision, is it possible to generate a localization map of the important regions in the image (heatmap)? - google-cloud-automl

I’m new to machine learning. I am working with a public dataset of medical images and Google’s AutoML vision. My goal is to create a multi-class classifier using single-label classification to diagnose different diseases based on labeled photos.
I was wondering if it was possible to obtain heat maps of regions in the photos that the learning algorithm relied on to make its prediction. This would make the algorithm more clinician-friendly and more understandable. In CNNs, I think this concept is called gradient-weighted class activation mapping (grad-cam).
Please let me know if this is possible with Google AutoML. Thanks a lot

Related

Foreground extraction using opencv

I am working on a dataset (training + testing) which contains a different shopping cart items (eg: biscuits, soaps etc..) with different backgrounds and I need to predict the product id for all testing images (product ids are unique for each product, Let's say Good-day 10 rs is having product id 1 and so on... for different products )
My approach was to :
1) extract the foreground from the image.
2) Apply sift/surf algorithm for finding matching keypoints (or) train a faster RCNN...
I was thinking to build a Haar Cascade classifier, can anyone suggest an easy foreground extraction algorithm possible for this scenario in python ?
For real-time purposes I don't recommend the RCNN models since they are not built for realtime but for precision. Sift or surf can recognise scenes but if the object is deformed in some way they would fail easily. Haar cascade seems to be a good solution. I also recommend checking out Yolo or SSD models since they can be easily trained with transfer learning and they are very successfull at realtime object classification. Opencv also has a DNN module for running these kinds of neural networks.

What machine learning algorithm would be best suited for a scenario when you are not sure about the test features/attributes?

Eg: For training, you use data for which users have filled up all the fields (around 40 fields) in a form along with an expected output.
We now build a model (could be an artificial neural net or SVM or logistic regression, etc).
Finally, a user now enters 3 fields in the form and expects a prediction.
In this scenario, what is the best ML algorithm I can use?
I think it will depend on the specific context of your problem. What are you trying to predict based on what kind of input?
For example, recommender systems are used by companies like Netflix to predict a user's rating of, for example, movies based on a very sparse feature vector (user's existing ratings of a tiny percentage of all of the movies in the catalog).
Another option is to develop some mapping algorithm from your sparse feature space to a common latent space on which you perform your classification with, e.g., an SVM or neural network. I believe this paper does something similar. You can also look in to papers like this one for a classifier that translates data from two different domains (your training vs. testing set, for example, where both contain similar information, but one has complete data and the other does not) into a common latent space for classification. There is a lot out there actually on domain-independent classification.
Keywords to look up (with some links to get you started): generative adversarial networks (GAN), domain-adversarial training, domain-independent classification, transfer learning.

Obtaining a HOG feature vector for implementation in SVM in Python

I am new to sci-kit learn. I have viewed the online tutorials but they all seem to leverage existing data (e.g., digits, iris, etc). I need the information on how to process images so that they can be used by scikit learn.
Details of my Study: I have a webcam set up outside my office. It captures all of the traffic on my street that passes in the field of view. I have cropped several hundred images of sedans, trucks and SUV's. The goal is to predict whether a vehicle is one of these categories. I have applied Histogram Oriented Gradients (HOG) to these images which I have attached for your review to see the differences in the categories. This blog will not allow me to post any images but you can see them here https://stats.stackexchange.com/questions/149421/obtaining-a-hog-feature-vector-for-implementation-in-svm-in-python. I posted the same question at this site but no response. This post is the closest answer I have found. Resize HOG feature for Scikit-Learn classifier
I wish to train an SVM classifier based on these images. I understand that there are algorithms that exist in scikit-image that prepares the HOG images for use in scikit-learn. Can someone help me understand this process. I am also grateful for any thoughts based on your experience as to the probability of success of this classification study. I also understand that I need to train the model using a negative images ( ones with no vehicles. How is this done?
I know I am asking a lot but I am surprised no one that I am aware of has done a tutorial on these early steps. It seems like a fairly elementary study.

Smart video thumbnail generator algorithm

Hello I'm a Java developer and I'm a part of video on demand website team.
I'm currently doing research on how to implement a back-end component that we are planning to build; the component is expected to automatically generate a meaningful thumbnail representing the content of the videos like the algorithm used in YouTube to generate default thumbnails.
However, I can't seem to find any good open source or payed implementation that can do so, and building the algorithm from scratch is very complicated and needs a lot of time that I don't think the company is willing to invest at the current stage (maybe in the future though)
I would appreciate if someone can refer to any implementation that can help me or even vendors that sell an implementation or a product that can serve my component's objective.
Thanks!
As explained by google research blog:
https://research.googleblog.com/2015/10/improving-youtube-video-thumbnails-with.html
The key component is using a convolutional neural network to predict the score for each sampled frame.
There are so many open sourced CNN implementation like caffe or tensorflow. The only efforts are preparing some training data.

How compare two images and check whether both images are having same object or not in OpenCV python or JavaCV

I am working on a feature matching project and i am using OpenCV Python as the tool for developed the application.
According to the project requirement, my database have images of some objects like glass, ball,etc ....with their descriptions. User can send images to the back end of the application and back end is responsible for matching the sent image with images which are exist in the database and send the image description to the user.
I had done some research on the above scenario. Unfortunately still i could not find a algorithm for matching two images and identifying both are matching or not.
If any body have that kind of algorithm please send me.(I have to use OpenCV python or JavaCV)
Thank you
This is a very common problem in Computer Vision nowadays. A simple solution is really simple. But there are many, many variants for more sophisticated solutions.
Simple Solution
Feature Detector and Descriptor based.
The idea here being that you get a bunch of keypoints and their descriptors (search for SIFT/SURF/ORB). You can then find matches easily with tools provided in OpenCV. You would match the keypoints in your query image against all keypoints in the training dataset. Because of typical outliers, you would like to add a robust matching technique, like RanSaC. All of this is part of OpenCV.
Bag-of-Word model
If you want just the image that is as much the same as your query image, you can use Nearest-Neighbour search. Be aware that OpenCV comes with the much faster Approximated-Nearest-Neighbour (ANN) algorithm. Or you can use the BruteForceMatcher.
Advanced Solution
If you have many images (many==1 Million), you can look at Locality-Sensitive-Hashing (see Dean et al, 100,000 Object Categories).
If you do use Bag-of-Visual-Words, then you should probably build an Inverted Index.
Have a look at Fisher Vectors for improved accuracy as compared to BOW.
Suggestion
Start by using Bag-Of-Visual-Words. There are tutorials on how to train the dictionary for this
model.
Training:
Extract Local features (just pick SIFT, you can easily change this as OpenCV is very modular) from a subset of your training images. First detect features and then extract them. There are many tutorials on the web about this.
Train Dictionary. Helpful documentation with a reference to a sample implementation in Python (opencv_source_code/samples/python2/find_obj.py)!
Compute Histogram for each training image. (Also in the BOW documentation from previous step)
Put your image descriptors from the step above into a FLANN-Based-matcher.
Querying:
Compute features on your query image.
Use the dictionary from training to build a BOW histogram for your query image.
Use that feature to find the nearest neighbor(s).
I think you are talking about Content Based Image Retrieval
There are many research paper available on Internet.Get any one of them and Implement Best out of them according to your needs.Select Criteria according to your application like Texture based,color based,shape based image retrieval (This is best when you are working with image retrieval on internet for speed).
So you Need python Implementation, I would like to suggest you to go through Chapter 7, 8 of book Computer Vision Book . It Contains Working Example with code of what you are looking for
One question you may found useful : Are there any API's that'll let me search by image?

Resources