I'm trying to create data set for convolution neural network which consist of 50x50 images. Making this manually with photoshop is very long (automatic export works for some reason very slow and it looks very unefficient). Is there a way to make it fast?
Related
I wish to train a robot about the indoor environment with multiple obstacles. To save the trained data by this, is there anyway in verilog..!! This training data should be used by robot while deploying with dynamic data to move from one point to another in the trained indoor environment. What will be the best way of implementation in Verilog..!!
Verilog is a Hardware Design Language. Thus you should think it terms of 'hardware'. There does not exist something like a "hardware database".
The nearest and simplest I can think off, would be to make an SD-card interface and write raw data sectors to the SD-card.
You will then need a special program to extract the data as computers like to see a FAT32-data structure.
By the way: the option to read or write files only exists in a simulation environment. I don't know any synthesis tool which supports file I/O.
I have trained a convolutional neural network to classify six different land cover classes using 50*50 patches. Now, my next task is to use this model to classify 500*500 image containing these six land cover types and display my map. Please can anyone help me write code for this task?
I have a list of images and tags like these (presently in a pandas Dataframe)
tag_cat tag_dog tag_house tag_person url
--------------------------------------------------------------------------
True True False False http://example.com/...JPG
False False False True http://example.com/...JPG
which means that in the first image there ia a cat and a dog. Images are not preprocessed.
How to proceed? Should I download all the images, preprocess them and store locally? I would prefer to avoid it, I would prefer to download some images, preprocess them and to feed them to the optimization. As an alternative I would prefer a hybrid approac with a disk-cache: download few images, preprocess them, feed them to the optimization and in addition save the image to disk so that if I rerun I don't need to re-download the images.
Is there something that can help me with this?
When you train a machine learning model, you usually train the model for several cycles (epochs) of the data. In other words, you have to show all the data to your algorithm several times (tens-hundreds).
From that perspective, downloading the images over and over is inefficient.
Another important point is models that take raw image pixels, usually take a lot of resources, and in order to avoid bottlenecks, and exploit your computational resources, you would like to feed the data as fast as you can to your machine. Downloading images for every batch, again sounds very inefficient.
Although I think it is inefficient, if you would still like to fetch the images from the web during training, you could write up a custom python generator for fetching the images from URLs, and then train the model in keras with fit_generator() method, which
Fits the model on data generated batch-by-batch by a Python generator.
Another alternative I can suggest, is that you can extract the image features once (with an already trained CNN), save them locally on your filesystem, and train a simpler model. Usually such features have a very low space footprint (e.g. 2048 float32 array per image), and therefore you could even store them within your pandas dataframe.
Look here under 'Extract features with VGG16' for an example of how to extract image features
WRT the hybrid caching approach, it might be doable, but I am not sure that the machine-learning community is where you should inquire. But anyway, machine learning has enough complexities of its own and it might be better to focus your efforts on the algorithms and models, instead of a smart cachable software-pipeline
I have only little background knowledge about Neural Networks (NN).
However, up to know I learnt, that training the network is the actual expensive part. Processing data by an already trained network is much cheaper/faster, ultimately.
Still, I'm not entirely sure what the expensive parts are within the processing chain. As far as I know, it's mostly Matrix-Multiplication for standard layers. Not the cheapest operation, but definitly doable. On top, there are are other layers, like max-pooling, or activation-functions at each node, which might have higher complexities. Are those the bottle-necks?
Now, I wonder if "simple" Hardware provided by Smartphones or even cheap stand-alone Hardware like Raspberry PIs are capable of utilizing a (convolutional-) Neuronal Networks to do, for example, Image Processing, like Object Detection. Of course, I mean doing the calculations on the device itself, not by transmitting the data to a second, powerful machine or even a cloud, which does the calculations, before sending back the results to the smartphone.
If so, what are the maximum Neurons such a Network should have (e.g. how many layers and how many neurons per layer), roughly estimated. And last, are there any good either projects, or librarys, using NNs for reduced simpler Hardware?
Current neural networks use convolutional layers, which perform a convolution on the input image. Also the high amount of parameters and dimensions is a real problem for low budget hardware. But anyways there are approaches that work on android for newer smartphones, like the SqueezeNet. Much of the work is actually done on gpus nowadays and so I am not sure if it works on a rasperry.
A better description than I could ever write on the topic can be found here: https://hackernoon.com/how-hbos-silicon-valley-built-not-hotdog-with-mobile-tensorflow-keras-react-native-ef03260747f3?gi=adb83ae18a85, where they actually built a neural network for a mobile phone. You can actually download the app and try it on your mobile phone if you have android or ios.
There are a lot of research going on in this area. There are roughly two lines of areas that deal with this:
Efficient network architectures
Some post-processing for an already trained model
You can have a look at ICNet Figure 1, where some architectures for fast inference for semantic segmentation are shown. Many of these models can be tweaked to do classification or other image processing tasks in real time. These models all have a low number of parameters compared to other networks and can be evaluated on embedded platforms.
For "post-hoc" optimizations you can look at TensorFlows Graph Transform Tool that do many of such for you: Graph Transform Tool
or maybe look into the paper by Song Han Deep Compression where many of these ideas are described. Song Han has also given many great lectures in this area and you can e.g. find one in the CS231n class at Stanford.
The speed of the inference phase depend on a lot of other things than the number of parameters or neurons. So I don't think there is a rule of thumb for saying how many neurons are the maximum.
do you know any good set of training images for my test neural network
preferably a tagged set of images of numbers or letters
or simple symbols
faces or real images might be too complex at this stage.
(i am tiring to implement a Boltzmann machine)
The UCI Machine Learning Repository has a bunch of different sets of training data, including handwritten digits, for example Optical Recognition of Handwritten Digits Data Set
Another large repository of datasets, organized by application domain (classification, regression, segmentation, ...) is MLcomp. It also allow you to compare the performance of your algorithm with many other standard methods.