pythonlessons / mltu

Machine Learning Training Utilities (for TensorFlow and PyTorch)
MIT License
160 stars 100 forks source link

Model configuration for new captcha type #45

Closed Firdavsbek07 closed 3 months ago

Firdavsbek07 commented 4 months ago

Hello brother, thanks for code and the model that you have made. I'm new to neural networks and ai training.

0asA

image_1708442297 0910537 image_1708442297 0910537

I'm trying to train captcha solver model on this captcha types. I didn't succeed yet. First of all, because of when the training is reaching Epoch 200-350/1000, it's printing Epoch: early stopping. At first I tried to change the batch size, number of workers and training speed. Tried 32, 64 (default), 128, 256, 270, 512 batch size and 10, 20, 30, 40 training worker amount.

I used 1000 of those captchas as a dataset and 101 different captchas for testing. The "best" result i got at batch_size=256, train_workers = 30 on a machine with 24GB RAM, used intel i5-12th CPU for training. A trained model result below: 202402212032.zip

Also thought maybe my machine was not powerful enough, so i tried a different machine with 64GB RAM, i9-13th CPU, Nvidia GeForce RTX 2080. Still got the Epoch early stopping error around 313/1000 epoch. The "trained" model folder is in below: 202402232009 i9.zip

Now, i know that i can use of of those models and continue training them.

i was hoping if you can help to configure the model architcture or configs for those captcha images. I think maybe need to make fit the image size, because while training, I was getting "libpng warning: pHYs: CRC error" a lot. I'd very grateful if you could help me with that. Thanks for your valueable time.

Firdavsbek07 commented 4 months ago

Also i was wondering whether i can use an svg files for training and use the trained model to predict svg file images image_1708442297 0910537

ThanhLD24 commented 3 months ago

i got the same issue with new dataset of captcha. could @pythonlessons please help us the way how to adjust model architecture to solve other type of captcha. Here is my one of captcha image: 12845 Thank you.

pythonlessons commented 3 months ago

Make sure you read your images correctly, to do so you can use OpenCV to show your images while iterating dataProvider. Batch size doesn't have any considerable impact on this; you need to work on model architecture. I made a tutorial just as an example that you can use to continue working on similar tasks.

Firdavsbek07 commented 3 months ago

Thank you for your reply, it worked better after edited the image sizes in configs.py. Now it's working well.