Giter Club home page Giter Club logo

Comments (5)

bparaj avatar bparaj commented on August 16, 2024 1

Thanks @PavlosMelissinos! That clarifies a ton!

from enet-keras.

PavlosMelissinos avatar PavlosMelissinos commented on August 16, 2024

Have you done any finetuning?

You've changed the last layer to recognize fewer classes, so the weights that assign an image to a class are indeed random (kinda, it's actually glorot_uniform). You need to train the last layer in order to get results that make sense with your new setup.

from enet-keras.

PavlosMelissinos avatar PavlosMelissinos commented on August 16, 2024

Closing this for now, feel free to reopen it if you still have issues.

from enet-keras.

bparaj avatar bparaj commented on August 16, 2024

I changed the setup as per your suggestion (Thank you!) as follows:

  1. Set the number of classes to 20: get_model(20)
    I chose 20 because when I called transfer_weights() with keep_top=True, I got the error:
    ValueError: Layer weight shape (2, 2, 11, 16) not compatible with provided weight shape (2, 2, 20, 16)
    And I assumed the weights were trained for 20 classes. Did I make a wrong assumption?

  2. Didn't discard the top layer: autoencoder = transfer_weights(model=autoencoder, keep_top=True)
    Since I didn't discard the top layer, is it okay to use the function save_output() as defined above?

This time, for the same input image included above, the segmented output created with save_output() is as follows:
out_2015-11-08t13 52 54 655-0000011482

Also, by finetuning, do you mean retraining the model?

from enet-keras.

PavlosMelissinos avatar PavlosMelissinos commented on August 16, 2024

I'm not sure what I'm seeing. You're assigning random colors to each class so you can't see what class e.g. the pink color corresponds to. The most dominant one should be the background class though.

  1. How many classes do you have in your dataset? class 0 corresponds to some concept, you can't just assume it will translate well to your problem. If you want to do inference for 11 classes on a furniture dataset you can't reuse the 20 classes that were trained on a dataset that recognizes cars and pedestrians. You have to retrain in order to reassign the internal representation of the intermediate layers to actual high-level concepts that we understand.

  2. If you discard the (weights of the) top layer, then it makes sense to get random outputs like the ones you got before. On the other hand, if you don't discard the (weights of the) top layer, then you'll only be able to segment the objects that exist in the original dataset.

Prediction works with argmax and there's no threshold to filter noise, so if you look more closely to the actual one-hot-vector predictions for each (non-background) pixel, you should be seeing low values for all classes (low confidence). Technically you should get 100% background but the network isn't perfect and I'm pretty sure there's a bug somewhere in my implementation of enet that I haven't pinpointed yet.

Re: Finetuning. Come on, it's pretty common stuff, you could have looked it up. ;)

from enet-keras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.