Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Train other images #5

Open
Adilmar opened this issue Dec 13, 2018 · 23 comments
Open

Train other images #5

Adilmar opened this issue Dec 13, 2018 · 23 comments

Comments

@Adilmar
Copy link

Adilmar commented Dec 13, 2018

Hi Congratulations on the application, I would like to train with another image base to buy the results in my experiment, could you help me how to perform the training to generate the models of the tensorflow, I would be very grateful beyond mentioning your work clear.

@kittinan
Copy link
Member

kittinan commented Dec 14, 2018

We'll upload the code to train over the weekend. We will tag you when the code is ready!

oarriaga/face_classification is original repository we use to train

@Adilmar
Copy link
Author

Adilmar commented Dec 14, 2018

Hi, thank you very much, awaiting you.

Regards

@Adilmar
Copy link
Author

Adilmar commented Dec 14, 2018

Thanks friends I will carry out the training with new base, thank you very much for the help, any contribution notice you.

Regards

@titipata
Copy link
Member

@kittinan should we make the PR to this repository? It should be a good idea to move everything into one place.

@Adilmar
Copy link
Author

Adilmar commented Dec 15, 2018

I have managed to generate the json templates but when I load it into the application it appears Unknown layer: ReLU, do you know what it can be?

@Adilmar
Copy link
Author

Adilmar commented Dec 15, 2018

I converted your keras and it returned a different error on the shape, see in the image the errors.
rrrr

@kittinan
Copy link
Member

I'm not sure why the error happens, I tested to convert Keras model to tfjs model and it works for me.

Can you navigate that page with the only HTTP? (http://localhost/face_tensor)

  • My software verion:
tensorflowjs==0.6.7
keras=2.2.2
tensorflow==1.12.0 (GPU Version)
  • My command to convert Keras model to tfjs
tensorflowjs_converter --input_format keras \
                       /home/tun/git/face_classification/trained_models/gender_models/gender_mobilenet_0.25.24-0.94.hdf5 \
                       /tmp/gender


tensorflowjs_converter --input_format keras \
                       /home/tun/git/face_classification/trained_models/emotion_models_mobilenet_alpha_adam_0.25/fer2013_mobilenet.96-0.63.hdf5 \
                       /tmp/emotion2
  • Test the new tfjs model

screenshot at 2018-12-16 11 20 37

@kittinan
Copy link
Member

@titipata I will move kittinan/face_classification to this repo

@Adilmar
Copy link
Author

Adilmar commented Dec 16, 2018

@kittinan converting your template worked was https, now my still problems will generate it with these settings.

How did you install the tensorflow for GPU can this be?

And this little boy there? cute

Here are my packages, apparently they're ok

Regards

ok

@Adilmar
Copy link
Author

Adilmar commented Dec 16, 2018

Personally it did not work out, I generated the hdf5 from fer2013, converti is the ReLU error persists, the only other thing I noticed is that my tensoflow is not the one for GPU how do I use it? I have to install ?

Thanks !!!

@Adilmar
Copy link
Author

Adilmar commented Dec 16, 2018

I've changed mine for only 1 epoch so what's this? see your hdf5 files and mine is a size difference.

config

@Adilmar
Copy link
Author

Adilmar commented Dec 16, 2018

I found the problem despite the version of keras being the same it is using the mobilenet_0.50_64 and the one of you the mobilenet_0.25_64.

The version 50_64 adds this class relu, have idea of how to solve?

@kittinan
Copy link
Member

I use Anaconda for Tensorflow GPU installation (this package) on my ubuntu 16.04

A little boy is my son 😃

The ReLU activation function is very famous and it implemented on tfjs, I don't know why you got the error about it.

Size of file difference because of an Alpha parameter for Mobilenet. My trained model use alpha=0.25, in the code I uploaded that use alpha=0.5 because I try to find better accuracy model and I forgot to change it back.

You should to use alpha=0.25 for better size model

model = MobileNet(input_shape=(64, 64, 1), include_top=True, alpha=0.25, classes=7, weights=None)

@Adilmar
Copy link
Author

Adilmar commented Dec 16, 2018

@kittinan understood in your output file Json there is no RELU class, it is in the js file I do not know how to add it to vanish with the error.

Familly happy 👍

@Adilmar
Copy link
Author

Adilmar commented Dec 16, 2018

@kittinan I was able to resolve updated to the latest version of tensorflow.js, thanks for the help.

Another question you ran 10,000 epochs to get this result?

@kittinan
Copy link
Member

This is my converted model today https://drive.google.com/drive/folders/1Ev-ttC3xRnx6G--Vl7kU5kEM2d5TdcCm?usp=sharing

I ran around 100 epochs. In the code has EarlyStopping to stop training model when not improvement.

@Adilmar
Copy link
Author

Adilmar commented Dec 16, 2018

@kittinan Thank you very much, I'll try with other image bases now, other thing have you already tried adding UAS points as an attribute to improve the rating?

@kittinan
Copy link
Member

@Adilmar I don't know about UAS points. Can you explain it?

Did you try MobileNetV2?

@Adilmar
Copy link
Author

Adilmar commented Dec 19, 2018

Hi @kittinan my Test MobileNetV2 is running the experiment with a base FER2013, I wonder if you can help me create another csv 40x40 like the other with the images.

As the Action Unit is muscle points on the face used to classify emotions, it is part of my PhD research, see the theory at https://pt.wikipedia.org/wiki/Facial_Action_Coding_System

This is my article

https://www.researchgate.net/publication/300237689_Application_for_recognition_document_of_emocracies_in_virtuals_of_learning

Regards, nice day.

@Adilmar
Copy link
Author

Adilmar commented Dec 21, 2018

Hi @kittinan I generated the json of the last hdf5 in 100 epoch but the results for classification are very low even for emotion joy what can be friend?

Did I refine the tests by returning their original models gave a little improvement? One detail that I realized is that my final product is only 1 json and 1 group1-shard1of1 yours has several what would it be?
My
fer2013_emotion_training.log

My
0001

You
00013

@kittinan
Copy link
Member

You got the same validation accuracy on my model. The model is not accurate because has a bias on training data (FER2013), the dataset has a bit Asian or Latin Ameria faces.

You got only 1 json and 1 group1-shard1of1 because of the new version tfjs converter increase size on a sharding file

@Adilmar
Copy link
Author

Adilmar commented Dec 22, 2018

I understand @kittinan thank you very much, I'm putting together a mixed base that could help me make some program that converts the image to 40x40 pixels as well as the base FER2013?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants