Giter Club home page Giter Club logo

Comments (12)

ypwhs avatar ypwhs commented on July 24, 2024

可能是因为图像是 0~255的范围,所以要加 BN。

from captcha_break.

ypwhs avatar ypwhs commented on July 24, 2024

我使用过很多字体去生成数据,训练集和验证集的表现是接近的。

from captcha_break.

chrisyoung2017 avatar chrisyoung2017 commented on July 24, 2024

请问
“我使用过很多字体去生成数据,训练集和验证集的表现是接近的。”
这里的很多字体去训练,是每次训练和测试用的是同一字体生成的数据集是吗?我想知道能否混合多种字体一起训练。
因为我遇到的问题是训练集25000张验证码(每种字体大约1300张),然后固定切分5000张做验证集(每种字体大约250张)。在这个数据集下,模型能很好在训练集收敛,但是训练出来的模型目前看来只能记住训练集那部分的样本,对和训练集同种方式生成的验证码却不能识别。因为算力有限,我也不确定继续加大验证码的样本集会不会work。感谢回复,祝好。

from captcha_break.

ouyangde avatar ouyangde commented on July 24, 2024

我之前做过一个,能识别不定长的最大10位数字验证码,也是用ImageCaptcha生成验证码的。经验就是不限制训练集数量;结构合理的情况下,最终一定会收敛。因为本来就没有限制训练集,收敛后对新样本的识别率不会有变化。

from captcha_break.

ypwhs avatar ypwhs commented on July 24, 2024

@tmpacc1 不是的,是按图片随机字体的混合训练,具体你可以参考这个地址:https://github.com/ypwhs/baiduyun_deeplearning_competition

from captcha_break.

chrisyoung2017 avatar chrisyoung2017 commented on July 24, 2024

@ypwhs
可能我没表述清楚我的问题,我看到你的代码中都是这么写的,并没有定义fonts参数。
generator = ImageCaptcha(width=width, height=height)
其中ImageCaptcha类是如下定义的

class ImageCaptcha(_Captcha):
"""Create an image CAPTCHA.
省略一些注释
"""
def init(self, width=160, height=60, fonts=None, font_sizes=None):
self._width = width
self._height = height
self._fonts = fonts or DEFAULT_FONTS
self._font_sizes = font_sizes or (42, 50, 56)
self._truefonts = []

缺省了fonts参数后直接用的是DroidSansMono.ttf字体的验证码
DEFAULT_FONTS = [os.path.join(DATA_DIR, 'DroidSansMono.ttf')]
我现在假设真实场景是有20种不同字体的验证码,这个时候在用你的模型就只能在训练集上收敛,在验证集完全没学到,我想弄明白这个有没有什么解决方案?感谢耐心的回答。

from captcha_break.

ypwhs avatar ypwhs commented on July 24, 2024

https://github.com/ypwhs/baiduyun_deeplearning_competition/blob/master/初赛代码/四则混合运算识别%20深度学习应用大赛3.ipynb

from captcha_break.

oneoy avatar oneoy commented on July 24, 2024

我怎么看不懂cnn.ipynb文件里的代码呢 有直接改好的.py文件吗

from captcha_break.

kwaneGX avatar kwaneGX commented on July 24, 2024

请问怎么设置不同的字体,怎么修改呢?

from captcha_break.

LIMU2 avatar LIMU2 commented on July 24, 2024

您好,请问怎么加入BN层,初学,不太懂,loss一直不收敛

from captcha_break.

oloeye avatar oloeye commented on July 24, 2024

您好,请问怎么加入BN层,初学,不太懂,loss一直不收敛

主要是图片的数据是 0~255,在梯度进行更新时候,loss = (y - wx+b)^2,当 输入 x 比较大的时候,那么w就需要变化很小范围就可以达到最优的权重,但是当输入的 x 比较小时候,那么 w 需要更新比较大的范围达到最优解。(注意:初始化 权重 的时候,几乎所有权重都是接近的 )更新梯度的学习率是几乎不变,那么对于当输入的 x 比较小时候,需要很长时间来更新 w,所以你会看到很久没有收敛。如果进行 BN, 那么输入对更新 w 的影响都一样,所以比较快收敛。BN 层一般都是加在输入前,或者在激活函数前。

from captcha_break.

ypwhs avatar ypwhs commented on July 24, 2024

2019 年更新的代码已经添加了预处理,所有的图片都是以 [0, 1] 的浮点数输入到模型中。另外每一层 Conv 后面都加了 BN,既能在一定程度上防止过拟合问题,又极大加速了模型的训练。

from captcha_break.

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.