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

EfficientNetLiteB0Backbone in KerasHub #20593

Open
cjohn001 opened this issue Dec 4, 2024 · 4 comments
Open

EfficientNetLiteB0Backbone in KerasHub #20593

cjohn001 opened this issue Dec 4, 2024 · 4 comments
Assignees

Comments

@cjohn001
Copy link

cjohn001 commented Dec 4, 2024

Hello together,
I am currently trying to migrate my code to KerasHub, as it seems for KerasCV the documentation is gone now. In the past I was using the EfficientNetLiteB0Backbone. Seems like it has not been ported to KerasHub. Is there a chance to see this model in KerasHub as well? As I am not seeing it yet I am wondering, is there nowadays maybe a better model to use? I need something small with good classification results for a mobile phone, I think EfficientNetLite was doing the job best with KerasCV.

And in case it will be moved to KerasHub, it would also be great if one could get a pretrained weights for it. Thanks for consideration.

@edge7
Copy link
Contributor

edge7 commented Dec 6, 2024

Hi, am not part of the Keras team, so this is my personal opinion.

I understand your issue, though. As Keras Hub is still WIP, the Keras CV documentation should still be around. I got a similar issue for an other model recently.
EfficientNetLiteB0 is not ported yet, it probably will.
You can still use Keras CV for the time being, look here in particular at the tests, you might be able to load it correctly even without official documentation.

@sachinprasadhs
Copy link
Collaborator

Hi, We have a EfficientNet Lite model for the edge devices here https://www.kaggle.com/models/keras/efficientnet/keras/efficientnet_lite0_ra_imagenet which has been ported from Timm.
For more details about the model check https://huggingface.co/timm/efficientnet_lite0.ra_in1k

@cjohn001
Copy link
Author

cjohn001 commented Dec 6, 2024

Hello, thanks for the directions. For the moment this code works for me, I am primary missing pretrained weights and the docs. If it get ported all is fine. For the moment I can live without the docs. Some kind of versioning in the docs would be great.

efnetlite_backbone = keras_cv.models.EfficientNetLiteB0Backbone(include_rescaling=True,
                                                                input_shape=(HEIGHT,WIDTH,3))
efnetlite_classifier = keras_cv.models.ImageClassifier(efnetlite_backbone, num_classes=len(class_mapping), activation='sigmoid')
efnetlite_classifier.compile(loss=keras.losses.CategoricalCrossentropy(label_smoothing=0.1),
                   optimizer=keras.optimizers.SGD(momentum=0.9),
                   metrics=["accuracy"])

@cjohn001
Copy link
Author

@sachinprasadhs I am still trying to figure out how I can get the EfficientNetliteB0Backbone trained to a similar accuracy like was state in the papers of the models. Is there maybe somewhere the training script from ImageNet training available for the model you referenced? Would be a great help to see how the hyperparameters have to be set for training. Thanks for your help!

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