teachablemachine-community icon indicating copy to clipboard operation
teachablemachine-community copied to clipboard

Knowing the details of the model trained

Open Ankit-Vohra opened this issue 3 years ago • 6 comments

I'm using teachable to train a binary classifier, it is giving me some very good results so I exported the model and have deployed it. When I load the model and print model.summary() I'm only able to go through 2 sequential layers. image

Is there any way to identify the entire architecture of the model which is built on teachable that will be really helpful to those who want to dive deep into the model. Thanks

Ankit-Vohra avatar Apr 05 '21 08:04 Ankit-Vohra

Which type of model are you training? (image/audio/pose)

HalfdanJ avatar Apr 05 '21 14:04 HalfdanJ

I'm training a Binary image classification It's giving me very good accuracy so I want to know the entire architecture of the model I can share the teachable model file if required

On Mon, Apr 5, 2021, 7:51 PM Jonas Jongejan @.***> wrote:

Which type of model are you training? (image/audio/pose)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googlecreativelab/teachablemachine-community/issues/189#issuecomment-813417863, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKRUWNW4BLGFUGUVNLNS3ZTTHHBM3ANCNFSM42MOSSLQ .

Ankit-Vohra avatar Apr 05 '21 14:04 Ankit-Vohra

The model is standard Mobilenet v2 without tops, and then an added a new top layer for the custom transfer learning. https://github.com/googlecreativelab/teachablemachine-community/blob/master/libraries/image/src/custom-mobilenet.ts#L303

HalfdanJ avatar Apr 05 '21 14:04 HalfdanJ

Hi, I am also interested in knowing more about the base model in Teachable Machine. I am wondering that how did you shrink down the size of mobilenet v2? I used "tf.keras.applications.mobilenet_v2.MobileNetV2" to import the MobileNet 2; however the total parameters is over 2 millions. Also, I think MobileNet is expected to accept the image in 3 channels (RGB), how did you make it to adapt grayscale images? Thank you in advance.

yo80106 avatar Aug 13 '21 15:08 yo80106

The model we load is an unmodified version of mobilenet v2 with alpha 0.35, image size 224. The model takes rgb. Then after truncaing the top layer, all we do is adding globalAveragePooling2d to the model in the code linked above.

To convert to keras, we are using the tensorflowjs commandline utility, I dont know what that does in its internals, but I think it should just do a 1:1 conversion.

HalfdanJ avatar Aug 13 '21 15:08 HalfdanJ

@Ankit-Vohra Use this code model.summary(expand_nested=True)

ansariahmad avatar Aug 17 '23 17:08 ansariahmad