Giter Site home page Giter Site logo

captcha_ocr's Introduction

captcha_ocr

2022DCIC-基于文本字符的交易验证码识别-baseline

比赛地址

https://www.dcic-china.com/competitions/10023

介绍

验证码作为性价较高的安全验证方法,在多场合得到了广泛的应用,有效地防止了机器人进行身份欺骗,其中,以基于文本字符的静态验证码最为常见。随着使用的深入,噪声点、噪声线、重叠、形变等干扰手段层出不穷,不断提升安全防范级别。RPA技术作为企业数字化转型的关键,因为其部署的非侵入式备受企业青睐,验证码识别率不高往往限制了RPA技术的应用。一个能同时过滤多种干扰的验证码模型,对于相关自动化技术的拓展使用有着一定的商业价值。 赛题任务:本次大赛以已标记字符信息的实例字符验证码图像数据为训练样本,参赛选手需基于提供的样本构建模型,对测试集中的字符验证码图像进行识别,提取有效的字符信息。训练数据集不局限于提供的数据,可以加入公开的数据集。

代码环境

    baseline是基于pytorch框架的,版本为1.6+
    其他库如OpenCV、torchvision自行安装
    如果使用efficientnet模型,
        安装命令:pip install efficientnet_pytorch 
        使用请参考 https://github.com/lukemelas/EfficientNet-PyTorch

数据处理

    需要将训练数据解压到data/train
    需要将测试数据解压到data/test

代码介绍

    captcha_dataset.py
        数据处理、加载
    config.py
        训练配置文件
    train.py
        训练文件
        模型切换,如果使用resnet34,则需要将下面的注释开,同时注释efficientnet模型
            # 使用框架封装好的模型,使用预训练模型resnet34
            # model = models.resnet34(pretrained=True)
            # # 使用预训练模型需要修改fc层
            # num_fcs = model.fc.in_features
            # # print(num_fcs)
            # model.fc = nn.Sequential(
            #     nn.Linear(num_fcs, num_classes)
            # )
            # 使用efficientnet网络模型
            model = EfficientNet.from_pretrained('efficientnet-b1', num_classes=248)
        如果使用多卡训练需要设置
        os.environ['CUDA_VISIBLE_DEVICES'] = '0,1,2'  指定使用的GPU
        然后取消236、237行的注释
        # device_ids = [0, 1, 2]
        # model = torch.nn.DataParallel(model, device_ids=device_ids)
    predict.py
        预测文件,并生成提交文件

关于分数

没有提交成绩,贴出部分训练过程 resnet34 分数88+ 20epoch efficientb1 分数92+ 20epoch

关于上分点

    1.使用更好的模型如repvgg、efficientb2-b7等
    2.使用数据增强mixup和cutmix等策略,暂未开源

captcha_ocr's People

Contributors

zyf-xtu avatar

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.