Training Deep Learning Model On Different Machine - machine-learning

Since I have low GPU resources, I wanna know how to train a deep learning model on multiple GPU on different machines.
I found this link
But couldn't use it due to lack of proper documentation and heavy dependencies.
Please help me if anybody knows it.

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?

How to work with machine learning algorithms in embedded systems?

I'm doing a project to detect (classify) human activities using a ARM cortex-m0 microcontroller (Freedom - KL25Z) with an accelerometer. I intend to predict the activity of the user using machine learning.
The problem is, the cortex-m0 is not capable of processing training or predicting algorithms, so I would probably have to collect the data, train it in my computer and then embed it somehow, which I don't really know how to do it.
I saw some post in the internet saying that you can generate a matrix of weights and embed it in a microcontroller, so it would be a straightforward function to predict something ,based on the data you providing for this function. Would it be the right way of doing ?
Anyway my question is, how could I embedded a classification algorithm in a microcontroller?
I hope you guys can help me and give some guidance, I'm kind of lost here.
Thank you in advance.
I've been thinking about doing this myself to solve a problem that I've had a hard time developing a heuristic for by hand.
You're going to have to write your own machine-learning methods, because there aren't any machine learning libraries out there suitable for low-end MCUs, as far as I know.
Depending on how hard the problem is, it may still be possible to develop and train a simple machine learning algorithm that performs well on a low-end MCU. After-all, some of the older/simpler machine learning methods were used with satisfactory results on hardware with similar constraints.
Very generally, this is how I'd go about doing this:
Get the (labelled) data to a PC (through UART, SD-card, or whatever means you have available).
Experiment with the data and a machine learning toolkit (scikit-learn, weka, vowpal wabbit, etc). Make sure an off-the-shelf method is able to produce satisfactory results before moving forward.
Experiment with feature engineering and selection. Try to get the smallest feature set possible to save resources.
Write your own machine learning method that will eventually be used on the embedded system. I would probably choose perceptrons or decision trees, because these don't necessarily need a lot of memory. Since you have no FPU, I'd only use integers and fixed-point arithmetic.
Do the normal training procedure. I.e. use cross-validation to find the best tuning parameters, integer bit-widths, radix positions, etc.
Run the final trained predictor on the held-out testing set.
If the performance of your trained predictor was satisfactory on the testing set, move your relevant code (the code that calculates the predictions) and the model you trained (e.g. weights) to the MCU. The model/weights will not change, so they can be stored in flash (e.g. as a const array).
I think you may be limited by your hardware. You may want to get something a little more powerful. For your project you've chosen the M-series processor from ARM. This is the simplest platform that they offer, the architecture doesn't lend itself to the kind of processing you're trying to do. ARM has three basic classifications as follows:
M - microcontroller
R - real-time
A - applications
You want to get something that has strong hardware support for these complex calculations. You're starting point should be an A-series for this. If you need to do floating point arithmetic, you'll definitely need to start with the A-series and probably get one with NEON-FPU.
TI's Discovery series is a nice place to start, or maybe just use the Raspberry Pi (at least for the development part)?
However, if you insist on using the M0 I think you might be able to pull it off using something lightweight like ROS-C. I know there are packages with ROS that can do it, even though its mainly for robotics you may be able to adapt it to what you're doing.
Dependency Free ROS
Neural Networks and Machine Learning with ROS

Problems not suitable for machine learning

I know there is a lot of problem suitable for machine learning, but what about the problem that are not suitable for it?
When we should not use machine learning?
Too broad question for SO, but i'll try to answer theoretically:
The only problem in ML is a good generalization on unseen data, that has some pattern, because you can get some info (predict label, cluster) about new unseen data only if you learned something about distribution before. Theoretically you can force machine to learn any task that has non-random distribution relative to available features, but you need to have enough data for desired accuracy. That's why it's sometimes impossible in practice. Because to capture hard distribution rules you need to have big variative (more universal), or more specific (but it's includes your own knowledge about data) model, and to learn this model without overfitting you need to have big dataset, for all of this you need to have powerful computational resources and so on.
If you are interested in a more detailed explanation about theoretical aspect, you can watch lectures from caltech, starting from this CaltechX - CS1156x Learning from data.
Also there are theoretical equations to predict generalization abilities of model with respect to available amount of data: Vapnik–Chervonenkis theory
Akaike_information_criterion

How many hidden layers are there in a Deep Neural Network

can anybody tell me "usually" how many layers does a Deep Neural Network have? How deep is deep enough?
To my knowledge, it is still difficult to say the specific number of the hidden layers. But can anyone tell me, like some examples, how many hidden layers will researchers, developers use in their deep learning projects?
Many thanks.
It totally depends on the problem you try do model. The more layers you have, the harder it's to train the network (more computation power needed). The deeper the layer is however, the more complex problems it can solve.
Geoffrey Hinton wrote in his tutorial:
How many lines of code should an AI program use and how long should
each line be? – This is obviously a silly question.
• Deep belief nets
give the creator a lot of freedom.
– How best to make use of that
freedom depends on the task.
– With enough narrow layers we can model
any distribution over binary vectors (Sutskever & Hinton, 2007)
• If freedom scares you, stick to convex optimization of shallow models
that are obviously inadequate for doing Artificial Intelligence.
From what I know the number of layers usually is not really big. Here ( ImageNet Large-Scale Visual Recognition Challenge 2014) e.g. google team used a net with 22 layers.

Failure prediction from sensor data using Machine Learning

I am going to do a research project which involves predicting imminent failure of an engine using time data obtained from sensors. The data basically contains the readings of various embedded sensors every 10 minutes for many months. Such data is available for about 100 or so different units (all are the same engine model), along with the time of failure.
While I do have a reasonably good understanding of Machine Learning, I am at a loss of approaching this. I have done a few projects that involved static datasets (using SVMs, Neural Nets, Logistic Regression etc.) and even one on predicting time series. But this is quite different. While the project involves time data, it is hardly a matter of predicting the future values. Rather it is a case of anomaly detection on sequential time data.
Please could you give some ideas as to how I could approach it?
I'm particularly interested in Neural Networks/ Deep Learning, so any ideas on using them for this task would also be welcome. I would prefer to use Python or R, although I would be open to using something else if it was particularly geared for this sort of task.
Also could you give me some formal terms using which I could search for relevant literature?
Thanks
As a general comment, try hard to express everything that you know about the physical system in a model, then use that model for inference. I worked on such problems in my dissertation: Unified Prediction and Diagnosis in Engineering Systems by means of Distributed Belief Networks (see chapter 6). I can say more if you provide additional details about your problem domain.
Don't expect general machine learning models (neural networks, SVM, etc) to figure out the structure of the problem for you. Having the right form of the model is much, much more important than having a general model + lots of data -- this is the summary of my experience.

Resources