GithubHelp home page GithubHelp logo

re-training the model about logohunter HOT 4 CLOSED

earlng avatar earlng commented on August 23, 2024
re-training the model

from logohunter.

Comments (4)

ilmonteux avatar ilmonteux commented on August 23, 2024 1

For re-training the feature extractor, you will have to train the model on a logo dataset, instead of using the one pre-trained on ImageNet that comes with keras. Instead of retraining the whole model, you can probably just fine-tune it (by freezing most layers up to the very end, for example see this guide (the fine-tuning section)).
If you got the logos from the LogosInTheWild authors and followed the instructions in the data/ folder, after running src/create_clean_dataset.py you have a data/LogosInTheWild-v2/data_cleaned/brandROIs folder that contains truth-level logos extracted from the features, which should be great for fine-tuning the feature extractor. The job there would be to associate each logo to its class, and the last layers of the model would learn more logo-specific combinations of high-level features from the frozen layers. This should help with the similarity comparison (which is just the simplest decision function).

Note that re-training even the last layers of a huge model like Inception might be very hard to do even on a GPU machine. You could try a simpler model like a VGG16 first (check out load_extractor_model and model_flavor_from_name in src/utils.py for models and different truncations I tried, those can be called via the --features flag in logohunter.py).

from logohunter.

ilmonteux avatar ilmonteux commented on August 23, 2024

That would only retrain the YOLO model. You are correct that retraining the inception model on more relevant data (instead of ImageNet) would likely increase the performance for logo similarity. For example, it could be fine-tuned on a dataset made by taking the logo cut-outs from the Logosinthewild dataset (the data_cleaned/brandROIs folders mentioned here). The features extracted at the end of the encoder layers would then be more relevant to distinguish logos, so the similarity step should achieve better performance

from logohunter.

earlng avatar earlng commented on August 23, 2024

I see, right, so the model you use for the Inception model is inception_logo_features.hdf5, which we download from your S3 bucket as part of the build.sh. I looked through your repo, but couldn't find any instruction on how to train an inception model. Do you have any notes for that? or point me in the right direction?

from logohunter.

earlng avatar earlng commented on August 23, 2024

I see, thank you so much for the advice!

from logohunter.

Related Issues (11)

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.