Recognizing whose face it is in iOS Swift [closed] - ios

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 research about face recognition. But not just "recognizing that there's a face feature on the video" but also "recognizing whose face it is", on iOS Swift language. So far, the resource I get on the internet about this is only detecting, not truly face recognition (which I suspect there must be some kind of machine learning training and database to store all those training results for future recognition), like this tutorial using Vision framework, or this tutorial about face features, but none of them has machine learning. This tutorial talks about machine learning framework, OpenML, but no details whatsoever.
I did find a promising article about face recognition using Local Binary Patterns Histograms, even though the recognition part is very short, but it didn't say anything about where the data model stored, or whether I can send the "trained data" to the server to be integrated with the training data already in the server. And then there also that rumor of OpenCV being native on C++, and only can be implemented in Objective C++ and not on Swift?
To have a centralized face recognition database (by which a device train to recognize a face, upload the result to the server, and then another device can use that information to recognize the face earlier), I suspect the training is done on the client side (iOS), but the recognition is done on the server side (the device detect a face, upload a cropped image of that face to the server, and the server do a facial recognition on that image). Is that correct? Or is it more possible and practical to download all the server training data to the device, and then use that to do face recognition on the client? Or all the training and recognizing are done on the server?
This all is only in my head, but I actually don't know where to start looking for for my use case. I feel like the one that has to train and store model and do all the recognition is the server, where the client just only sent the detected face.

What you're talking about, if I understand it correctly, is that you're looking for FaceID. Unfortunately, Apple only gives this feature to developers as a means to authenticate the user and not recognize the face, per se. What you can do is take a picture of the face in the app; create a machine learning model with Apple's CoreML framework and train the model to recognize faces. But the problem with this is that you'd have to virtually train the model with every face, which is not possible. If you're keen, you can write your own algorithm for face recognition and analyze the taken picture with your model. For this, you'd need a really large amount of data.
Edits
Explore the following links. Maybe they can help.
https://gorillalogic.com/blog/how-to-build-a-face-recognition-app-in-ios-using-coreml-and-turi-create-part-1/
https://blog.usejournal.com/humanizing-your-ios-application-with-face-detection-api-kairos-60f64d4b68f7
Keep in mind, however, that these will not be secure like FaceID is. They can easily be spoofed.

Related

Suspicious facial expression and foreign object recognition using machine learning and image processing

I am stuck with a project on detecting suspicious facial expression along with detection of foreign objects (e.g. guns, metal rods or anything). I know nothing much of ML or image processing. I need to complete the project as soon as possible. It would be helpful if anyone could direct me with some things.
How can I manage a dataset?
Which type of code should I follow?
How do I present the final system?
I know it is a lot to ask but any amount of help is appreciated.
I have tried to train a machine using transfer learning following this link in in youtube:
https://www.youtube.com/watch?v=avv9GQ3b6Qg\
The tutorial uses mobilenet as the model and a known dataset of 7 subset (Angry, Disgust, Fear, Happy, Neutral, Sad, Surprised). I was able to successfully train the model get the face detected based on these 7 emotions.
How do I further develop it to achieve what I want?

Face recognition using deep learning

I am trying to build face recognition system using siemens network. I am using PubFig database. It is a large, real-world face dataset consisting of 58,797 images of 200 people collected from the internet. So from scratch I am trying to build this face recognition system using siemes network. So is this approach is good for face recognition from scratch? (I don't want to use transfer learning I want to build it from scratch)
See Papers With Code https://paperswithcode.com/task/face-recognition for the State of the Art on this task. A review of how other people have approached a particular task is the best starting point for developing a new solution.

Use machine learning to analyze sports bets [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 5 years ago.
Improve this question
Lets say I have database with over 1 Million bets (all kinds of sports) made by couple thousands of users, over a period of 2 years (and still growing).
These data are just lying around doing nothing, so I thought if it would be possible to use something like https://www.tensorflow.org/, do a bit of tinkering and it would analyze all the bets in database and learn from it some patterns, whats good and whats not.
The point being is we dont have resources to employ dozens of people for god knows how long to write some complicated software from the ground up. So I was thinking we could use some module from TensorFlow and go from there.
So then I would feed the network with new open bets that are currently in the system (those would be bets that are on matches that are about to be played) and it would pick for me what I should bet on, for example there is a 90% chance this bet will win, because 10 very successful players made this bet, and they have very high success when betting on this particular sport.
We have lots of experienced users, they make lots of money from betting. So the system could be trained on the data we have and then it would know, for example, if user A bets on this league/team, its very likely he will win.
The question is, where do we go from here? Can anybody point us in the right direction? Or is this just too difficult to do, for 2 people in few months? Can we use some pre-programmed solutions, like TensorFlow?
Without having a look of the data, it is impossible to suggest what direction should you take your next steps but anyway your first step should be to explore your data throughly, create model on small subset of data and test your hypothesis.
Overall you can try to:
Use Python or R to Load and Clean Data
Take a random subset of data(some 10,000 rows) and create a simple model using SVM or Random Forest looks like a classification Win/Lose.
Test your results and verify your hypothesis with some data.
Explore about your data to see if you can generate better features
Design a small neural network first and then think about a deep neural network using tensorflow or keras etc.
Have a look at this: https://hackernoon.com/how-to-create-your-own-machine-learning-predictive-system-in-the-nba-using-python-7189d964a371
Yes, this is possible but can be more difficult than it appears.
Consider Microsoft's Cortana which (while only picking if a game will win outright and not ATS) is only approx. 63% accurate; which is quite good but not exactly 90% as you mention in your question (1).
The size of your database should be great for ANN models. It would be a very interesting project for sure!
To your question "where I go from here..." my answer is to simply explore the data in RStudio or using a cloud service such as Microsoft's Azure ML Studio (2) or Amazon's Machine Learning services (3).
Good luck!
Ref. 1: http://www.businessinsider.com/nfl-picks-microsoft-cortana-elo-week-5-2017-10
Ref. 2: https://studio.azureml.net/
Ref. 3: https://aws.amazon.com/amazon-ai/

Looking for training data for music accompaniment [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am building a system that uses machine learning to generate an accompanying melody in real time as a leading melody is being played. It uses a type of Recurrent Neural Networks and at every step it tries to predict the next note on the accompanying track. At this point I am satisfied with just working with midi files.
I am having serious trouble finding training data. My original idea was to just download midi files from sites such as mididb and convert them to csv, but the problem is that it's hard to come up with a way to distinguish between the leading melody and the accompanying melody. Sometimes this is possible, but then again I would prefer the accompanying tracks to be always from the same (or similar) instrument(s), because different instruments are used differently (the duration and pitch of notes is very different from one instrument to the other etc.) and that would just get the network really confused.
I found Bach Corales on the UCI Machine Learning repository . The problem with this dataset though, is that it only has melodies with 1 voice. I want datasets with 2 voices, one of which is the leading melody and the other the accompanying melody.
I understand that this is difficult, so any advice on how to approach the problem would be very appreciated. I have tools that convert midi files to csv format, and if you can think of certain types/genres of songs, for which it would be easy to distinguish between leading and accompanying tracks (programmatically or manually), please let me know. Any advice will be greatly appreciated.
Exciting Topic. There aren't much other databases out there for data mining other than the set you mentioned. So you'll need to get a bit creative.
Have you read Jürgen Schmidhuber's approach on music composition using LSTM Reccurent Neural Networks? If not, you should definitely do so:
A First Look at Music Composition using LSTM Recurrent Neural Networks
Finding Temporal Structure in Music: Blues Improvisation with LSTM Recurrent Networks
You can browse through his work on his site
Now, the first paper created their own dataset, you might try asking the authors. The training set of the latter paper can be seen on their webpage to the study.
The best approach I think is to generate your own dataset:
1) Note that they have used sheets (pdf) and audio (not only midi but also wav/mp3) so you might want to think about extracting chords from wav files and labeling them with possible melody harmonies manually.
2) You can search directly for single scores instead of data mining datasets. E.g. www.free-scores.com to find specific scores. You can edit them, import them to Sibelius or Finale and convert them to midi in these programs. The easiest way would be if you can find scores written in Sibelius/Finale itself so you can export them to midi right away.
Edit:
One more comment on your chord/melody structure. Try to keep it simple at the beginning. Try to maintain a format like in the "First Look at.." paper: Melody+Chord Structure. No Instruments. After this is working you can try to reach the same results building this representation from multiple instrument scores. If that's working, try to build the multiple instrumentation scores from midi. If that works, start with real audio files.

Steps for successful image recognition [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I have been doing image processing and machine learning course for couple of weeks . Everyday I learn something new about image manipulation and as well as how to train a system to recognize patterns in an image .
My question is in order to do successful image recognition what are the steps one has to follow ,for example denoising , use of LDA , PCA , then use of neural network . I am not looking for any algorithm , just a brief outline of each of the steps(5 -6) from capturing an image to test an input image for similarity.
P.S# To the mods , before labelling this question as not constructive , I know its not constructive , but I don't know which site to put this so . So please redirect me that site of stackexchange .
Thanks.
I would describe the pipeline as follows, and I omitted many bullet items.
acquire images with ground truth labeling.
amazon M-turk
image and label from flickr
compute feature for that image
direct stretch the image as a column vector
use more complicated features such as bag of words, LBP.
post-process the features to reduce the effect of noise if needed
sparse coding
max pooling
whitening
train a classifier/regressor given the (feature,label) pair
SVM
boosting
neural network
random forest
spectral clustering
heuristic methods...
use the trained model to recognize the unseen images and evaluate the result with some metrics.
BTW. traditionally, we will use dimension reduction methods such as PCA to make the problem tractable, but recent research seems cares nothing about that.
Few months back I developed a face recognition system using local binary pattern.
In this method I first took a image either from local storage or camera, then using local binary pattern method I considered each block of the input image. After getting LBP of input image, I found chi-square distance for lbp feature histogram. comparing its value with the stored database image using same process. I was able to get same face.
amazon M-turk is a service to make people do work for you. (and you pay them)
SIFT is a descriptor for interest points. By comparing those descriptors, you can find the correspondence between images. (SIFT fits into step 2.)
when doing step 4. you can choose to combines the result of different classifier, or simply trust the result of one classifier. That depends on situation.
Are you going to label the location of affected region? I am not sure what you are going to do.
couldn't use comment so I post another answer.

Resources