fellow community!
I have next problem: I want to evaluate my model after each epoch using F1/AUC or other related scores in Keras. I use Tensorflow as backend.
I have searched the internet, but didn't found anything meaningful that would create a picture of a solution.
Can anyone propose something? Do I need to write my custom Sequence generator? Right now I am using ImageDataGenerator to get images from folder
in Google Drive.
Any answers are very appreciated. Thanks in advance!
All of it is in tf.metrics which is aliased also as tf.keras.metrics. It's both in the new 2.0 API and in the 1.x API.
In particular, you will use classes:
AUC
Precision and Recall from wich you can compute the F1 score
Related
this is a basic question.
Currently I am using one available 1.x model for object detection.
For this I am re-training this model with my own data and can detect the objects I want.
I would like to port all my logic to 2.x version in order to use the new released tools for converting models to TFLite.
Do I need to retrain the weights of the reference model (coco for example) once I modify the code to 2.0 ?
Or only retrain my customized data ?
if yes, is there any recommendation to do this without much effort ?
Thanks for the advice
Luckily for all users, tensorflow has a lot of documentation and the developers of tensorflow thought you would ask this question and therefore have answered it already for you. This post should help you perfectly migrating your model from 1.x to 2.x.
To sum it up quickly, if you are using high level APIs like keras it is basically no work at all. If you want to make use of of the performance improvements made in tensorflow 2 or if you are not using said high level APIs it might be a bit more work.
Weights of your network should generally not have to be retrained, except if you want to change your model obviously. If you want to just use the same model but then in tensorflow 2, the link above should help you transfer your code to tensorflow 2 and you should not have to retrain the weights of your model.
Keras has preprocessing.image.flow_from_directory() to read the gray scale and rgb image formats. Is there some way i can read HDR images with 4 channels ('rgbe') using keras or similar library? Any ideas will be appreciated.
Thank you in advance.
The function preprocessing.image.flow_from_directory() is a very powerful one. Sadly it has only the two modes you mentioned. I would suggest you two things since there is not a similar library that could work for you:
Go from RGBE to RGB and use preprocessing.image.flow_from_directory()
Checkout this Github link. They talk about keras having preprocessing with 4 channels, I suggest you update keras.
If you want to use the E value, because you think it will have importance in your net, just build your own reader. This might help.
My problem statement is as follows :
" Object Detection and Localization using Tensorflow and convolutional neural network "
What i did ?
I am done with the cat detection from images using tflearn library.I successfully trained a model using 25000 images of cats and its working fine with good accuracy.
Current Result :
What i wanted to do?
If my image consist of two or more than two objects in the same image for example cat and dog together so my result should be 'cat and dog' and apart from this i have to find the exact location of these two objects on the image(bounding box)
I came across many high level libraries like darknet , SSD but not able to get the concept behind it.
Please guide me about the approach to solve the problem.
Note : I am using supervised learning techniques.
Expected Result :
You have several ways to go about it.
The most straight forward way is to get some suggested bounding boxes using some bounding box suggestion algorithm like selective search and run on each on of the suggestion the classification net that you already trained. This approach is the approach taken by R-CNN.
For more advanced algorithm based on the above approach i suggest you read about Fast-R-CNN and Faster R-CNN.
Look at Object detection with R-CNN? for some basic explanation.
Darknet and SSD are based on a different approach if you want to undestand them you can read about them on
http://www.cs.unc.edu/~wliu/papers/ssd.pdf
https://pjreddie.com/media/files/papers/yolo.pdf
Image localization is a complex problem with many different implementations achieving the same result with different efficiency.
There are 2 main types of implementation
-Localize objects with regression
-Single Shot Detectors
Read this https://leonardoaraujosantos.gitbooks.io/artificial-inteligence/content/object_localization_and_detection.html to get a better idea.
Cheers
I have done a similar project (detection + localization) on Indian Currencies using PyTorch and ResNet34. Following is the link of my kaggle notebook, hope you find it helpful. I have manually collected images from the internet and made bounding box around them and saved their annotation file (Pascal VOC) using "LabelImg" annotation tool.
https://www.kaggle.com/shweta2407/objectdetection-on-custom-dataset-resnet34
I am a beginner with Tensorflow and machine learning in general.For my project I have to classify urban sound data.
I have extracted mfccs of my sample data and now I want to classify them by using a CNN in Tensorflow. I don't know how many channels I should use and why. Can anyone help me? Thanks.
I was working on a similar project and I found this paper useful with this.
http://karol.piczak.com/papers/Piczak2015-ESC-ConvNet.pdf
This is a newbie question for the tensorflow experts:
I reading lot of data from power transformer connected to an array of solar panels using arduinos, my question is can I use tensorflow to predict the power generation in future.
I am completely new to tensorflow, if can point me to something similar I can start with that or any github repo which is doing similar predictive modeling.
Edit: Kyle pointed me to the MNIST data, which I believe is a Image Dataset. Again, not sure if tensorflow is the right computation library for this problem or does it only work on Image datasets?
thanks, Rajesh
Surely you can use tensorflow to solve your problem.
TensorFlowâ„¢ is an open source software library for numerical
computation using data flow graphs.
So it works not only on Image dataset but also others. Don't worry about this.
And about prediction, first you need to train a model(such as linear regression) on you dataset, then predict. The tutorial code can be found in tensorflow homepage .
Get your hand dirty, you will find it works on your dataset.
Good luck.
You can absolutely use TensorFlow to predict time series. There are plenty of examples out there, like this one. And this is a really interesting one on using RNN to predict basketball trajectories.
In general, TF is a very flexible platform for solving problems with machine learning. You can create any kind of network you can think of in it, and train that network to act as a model for your process. Depending on what kind of costs you define and how you train it, you can build a network to classify data into categories, predict a time series forward a number of steps, and other cool stuff.
There is, sadly, no short answer for how to do this, but that's just because the possibilities are endless! Have fun!