Giter VIP home page Giter VIP logo

dl-alva / focal-loss-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yatenglg/focal-loss-pytorch

0.0 1.0 0.0 566 KB

全中文注释.(The loss function of retinanet based on pytorch).(You can use it on one-stage detection task or classifical task, to solve data imbalance influence).用于one-stage目标检测算法,提升检测效果.你也可以在分类任务中使用该损失函数,解决数据不平衡问题.

Home Page: https://ptorch.com/news/253.html

Python 46.09% Jupyter Notebook 53.91%

focal-loss-pytorch's Introduction

GIthub使用指北:

1.想将项目拷贝到自己帐号下就fork一下.

2.持续关注项目更新就star一下

3.watch是设置接收邮件提醒的.

jupyter-notebook用法例子 请见:由于Github是国外网站,加载会稍慢

retainnet的实现请见:Retinanet-pytorch


pytorch 实现 focal loss

retinanet论文损失函数

实现过程简易明了,全中文备注.

阿尔法α 参数用于调整类别权重

伽马γ 参数用于调整不同检测难易样本的权重,让模型快速关注于困难样本

交叉熵损失

cross_empty

带平衡因子的交叉熵

α-cross_empty

Focal损失

加入 (1-pt)γ 平衡难易样本的权重,通过γ缩放因子调整,retainnet默认γ=2

focal loss

带平衡因子的Focal损失

论文中最终为带平衡因子的focal loss, 本项目实现的也是这个版本

α-focal loss

最终retainnet的效果

不同γ 值收敛效果

focal loss_效果

retainnet与其他检测模型对比

retainnet对比图

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.