All Projects → AIOpenData → baai-federated-learning-crane-baseline

AIOpenData / baai-federated-learning-crane-baseline

Licence: Apache-2.0 License
电力人工智能数据竞赛——液压吊车目标检测赛道

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to baai-federated-learning-crane-baseline

baai-federated-learning-helmet-baseline
电力人工智能数据竞赛——安全帽未佩戴行为目标检测赛道基准模型
Stars: ✭ 26 (+52.94%)
Mutual labels:  federated-learning, yolov3
Awesome-Federated-Machine-Learning
Everything about federated learning, including research papers, books, codes, tutorials, videos and beyond
Stars: ✭ 190 (+1017.65%)
Mutual labels:  federated-learning
backdoors101
Backdoors Framework for Deep Learning and Federated Learning. A light-weight tool to conduct your research on backdoors.
Stars: ✭ 181 (+964.71%)
Mutual labels:  federated-learning
Federated-Learning-Mini-Framework
Federated Learning mini-framework with Keras
Stars: ✭ 38 (+123.53%)
Mutual labels:  federated-learning
Accident-avoidance-deepsortyoloFCRN
An accident avoidance program that raises alert when nearby vehicles are moving at a relative speed faster than a threshold value, additionally it logs some data onto NEM-Mijin blockchain network
Stars: ✭ 18 (+5.88%)
Mutual labels:  yolov3
drone-net
https://towardsdatascience.com/tutorial-build-an-object-detection-system-using-yolo-9a930513643a
Stars: ✭ 126 (+641.18%)
Mutual labels:  yolov3
live-cctv
To detect any reasonable change in a live cctv to avoid large storage of data. Once, we notice a change, our goal would be track that object or person causing it. We would be using Computer vision concepts. Our major focus will be on Deep Learning and will try to add as many features in the process.
Stars: ✭ 23 (+35.29%)
Mutual labels:  yolov3
Challenge
The repo for the FeTS Challenge
Stars: ✭ 21 (+23.53%)
Mutual labels:  federated-learning
car-crash-accident
Car Crash Accident Project
Stars: ✭ 14 (-17.65%)
Mutual labels:  yolov3
PFL-Non-IID
The origin of the Non-IID phenomenon is the personalization of users, who generate the Non-IID data. With Non-IID (Not Independent and Identically Distributed) issues existing in the federated learning setting, a myriad of approaches has been proposed to crack this hard nut. In contrast, the personalized federated learning may take the advantage…
Stars: ✭ 58 (+241.18%)
Mutual labels:  federated-learning
yolo3 tensorflow
yolo3 implement by tensorflow, including mobilenet_v1, mobilenet_v2
Stars: ✭ 48 (+182.35%)
Mutual labels:  yolov3
h5 to weight yolo3
convert keras (tensorflow backend) yolov3 h5 model file to darknet yolov3 weights
Stars: ✭ 39 (+129.41%)
Mutual labels:  yolov3
YOLO-V3-TensorFlow
The reimplementation of YOLO-V3 in TensorFlow.(comming soon)
Stars: ✭ 12 (-29.41%)
Mutual labels:  yolov3
yolo-deepsort-flask
Target detection and multi target tracking platform based on Yolo DeepSort and Flask.
Stars: ✭ 29 (+70.59%)
Mutual labels:  yolov3
Front-End
Federated Learning based Deep Learning. Docs: https://fets-ai.github.io/Front-End/
Stars: ✭ 35 (+105.88%)
Mutual labels:  federated-learning
KD3A
Here is the official implementation of the model KD3A in paper "KD3A: Unsupervised Multi-Source Decentralized Domain Adaptation via Knowledge Distillation".
Stars: ✭ 63 (+270.59%)
Mutual labels:  federated-learning
FedLab-benchmarks
Standard federated learning implementations in FedLab and FL benchmarks.
Stars: ✭ 49 (+188.24%)
Mutual labels:  federated-learning
easyFL
An experimental platform to quickly realize and compare with popular centralized federated learning algorithms. A realization of federated learning algorithm on fairness (FedFV, Federated Learning with Fair Averaging, https://fanxlxmu.github.io/publication/ijcai2021/) was accepted by IJCAI-21 (https://www.ijcai.org/proceedings/2021/223).
Stars: ✭ 104 (+511.76%)
Mutual labels:  federated-learning
miemiedetection
Pytorch implementation of YOLOX、PPYOLO、PPYOLOv2、FCOS an so on.
Stars: ✭ 52 (+205.88%)
Mutual labels:  yolov3
federated-xgboost
Federated gradient boosted decision tree learning
Stars: ✭ 39 (+129.41%)
Mutual labels:  federated-learning

电力人工智能数据竞赛—液压吊车目标检测赛道

以下为电力人工智能数据竞赛—液压吊车目标检测赛道基准模型介绍。其中包含了智源联邦学习框架的简化版本(真实版本后期会以论文的形式发布)、智源整理标注的初赛吊车数据集和基于YOLOv3模型完成的实验。

环境要求

  • Python==3.7.6
  • Flask==1.1.1
  • gevent==20.9.0
  • loguru==0.5.3
  • numpy==1.18.1
  • Pillow==7.0.0
  • torch==1.6.0
  • terminaltables==3.1.0
  • torchvision==0.7.0
  • tqdm==4.42.1

详情请参考baai-federated-learning-crane-baseline下面的requirements.txt

项目结构

.
├── README.md
├── baai-client  # 智源联邦学习客户端
│   ├── api
│   │   ├── __init__.py
│   │   └── my_api.py  # 选手联邦学习服务端需要调用智源联邦学习客户端的函数(训练、测试等)
│   ├── config
│   │   ├── __init__.py
│   │   └── project_conf.py  # 本机端口号和环境配置
│   ├── log
│   │   ├── D_preliminary_contest_crane_federal_M_yolov3_SE_25_CE_4_ID_1.json  # 最后测试集提交结果
│   │   └── D_preliminary_contest_crane_federal_M_yolov3_SE_25_CE_4_ID_1.log  # 训练、测试过程完整日志
│   ├── main.py  # 智源联邦学习客户端启动主函数
│   ├── service
│   │   └── federated
│   │       ├── client.py  # 智源联邦学习客户端类
│   │       ├── config
│   │       │   └── preliminary_contest_crane_federal
│   │       │       ├── create_preliminary_contest_crane_federal_model.sh  # 构建yolov3模型的bash脚本
│   │       │       ├── preliminary_contest_crane_federal.data  # 本地初赛吊车数据集路径信息
│   │       │       └── yolov3_preliminary_contest_crane_federal.cfg  # 根据bash脚本生成的cfg文件
│   │       ├── models
│   │       │   └── models.py  # yolov3模型相关类
│   │       ├── utils
│   │       │   ├── data.py  # 处理加载数据集相关函数
│   │       │   ├── options.py  # 初始化参数函数
│   │       │   └── utils.py  # 辅助功能函数
│   └── utils
│       ├── __init__.py
│       ├── common_utils.py  # 常用功能函数
│       ├── http_request_utils.py  # 通信功能函数(GET、POST)
│       ├── request_api.py  # 调用通信功能函数api
│       └── result_utils.py  # 通信结果封装类
├── contestant-server  # 选手联邦学习服务端
│   ├── config
│   │   ├── __init__.py
│   │   └── project_conf.py  # 本机端口号和环境配置
│   ├── log
│   │   └── D_preliminary_contest_crane_federal_M_yolov3_SE_25_CE_4.log  # 训练、测试过程完整日志
│   ├── service
│   │   └── federated
│   │       ├── config
│   │       │   └── preliminary_contest_crane_federal
│   │       │       ├── create_preliminary_contest_crane_federal_model.sh  # 构建yolov3模型的bash脚本
│   │       │       └── yolov3_preliminary_contest_crane_federal.cfg  # 根据bash脚本生成的cfg文件
│   │       ├── models
│   │       │   └── models.py  # yolov3模型相关类
│   │       ├── server.py
│   │       ├── utils
│   │       │   ├── options.py  # 初始化参数函数
│   │       │   └── utils.py  # 辅助功能函数
│   │       └── weights  # 保存yolov3预训练模型
│   └── utils
│       ├── __init__.py
│       ├── common_utils.py  # 常用功能函数
│       ├── http_request_utils.py  # 通信功能函数(GET、POST)
│       ├── request_api.py  # 调用通信功能函数api
│       └── result_utils.py  # 通信结果封装类
├── requirements.txt  # 需要安装的python库
└── sgcc-client  # 国网电力联邦学习客户端(功能与智源联邦学习客户端相同,此处不展开介绍)
    ├── api
    │   ├── __init__.py
    │   └── my_api.py
    ├── config
    │   ├── __init__.py
    │   └── project_conf.py
    ├── log
    │   ├── D_preliminary_contest_crane_federal_M_yolov3_SE_25_CE_4_ID_2.json
    │   └── D_preliminary_contest_crane_federal_M_yolov3_SE_25_CE_4_ID_2.log
    ├── main.py
    ├── service
    │   └── federated
    │       ├── client.py
    │       ├── config
    │       │   └── preliminary_contest_crane_federal
    │       │       ├── create_preliminary_contest_crane_federal_model.sh
    │       │       ├── preliminary_contest_crane_federal.data
    │       │       └── yolov3_preliminary_contest_crane_federal.cfg
    │       ├── models
    │       │   └── models.py
    │       ├── utils
    │       │   ├── data.py
    │       │   ├── options.py
    │       │   └── utils.py
    └── utils
        ├── __init__.py
        ├── common_utils.py
        ├── http_request_utils.py
        ├── request_api.py
        └── result_utils.py

下载地址

  • 初赛吊车数据集
    • 其中智源客户端的数据集包括
      • preliminary_contest_crane_federal/annotations下面的/train1.jsonval1.jsontest.jsontest_image_info.json
      • preliminary_contest_crane_federal/images下面的/train1val1test
    • 国网电力客户端的数据集包括
      • preliminary_contest_crane_federal/annotations下面的train2.jsonval2.jsontest.jsontest_image_info.json
      • preliminary_contest_crane_federal/images下面的train2val2test
  • yolov3预训练模型
    当前主要采用weights下面的darknet53.conv.74

运行方式

智源联邦学习客户端

  • 进入baai-client/service/federated/config/preliminary_contest_crane_federal目录

    • 修改preliminary_contest_crane_federal.data当中的数据路径
    • 生成yolov3模型的cfg文件(先删除旧的cfg文件)
      bash create_preliminary_contest_crane_federal_model.sh 1
  • 进入baai-client/config

    • 修改project_conf.py当中的hostport
  • 进入baai-client/service/federated/utils目录

    • 配置参数,特别是data_configmodel_defserver_ipserver_portclient_ipclient_port
  • 启动智源联邦学习客户端

    • 进入baai-client,运行以下指令
      python main.py

国网电力联邦学习客户端

  • 进入sgcc-client/service/federated/config/preliminary_contest_crane_federal目录

    • 修改preliminary_contest_crane_federal.data当中的数据路径
    • 生成yolov3模型的cfg文件(先删除旧的cfg文件)
      bash create_preliminary_contest_crane_federal_model.sh 1
  • 进入sgcc-client/config

    • 修改project_conf.py当中的hostport
  • 进入sgcc-client/service/federated/utils目录

    • 配置参数,特别是data_configmodel_defserver_ipserver_portclient_ipclient_port
  • 启动国网电力联邦学习客户端

    • 进入sgcc-client,运行以下指令
      python main.py

选手联邦学习服务端

  • 把下载好的yolov3预训练模型拷贝到contestant-server/service/federated/weights

  • 进入contestant-server/service/federated/config/preliminary_contest_crane_federal目录

    • 生成yolov3模型的cfg文件(先删除旧的cfg文件)
      bash create_preliminary_contest_crane_federal_model.sh 1
  • 进入contestant-server/config

    • 修改project_conf.py当中的hostport
  • 进入contestant-server/service/federated/utils目录

    • 配置参数,特别是pretrained_weightsmodel_defserver_ipserver_portclient_ipsclient_ports
  • 启动选手联邦学习服务端

    • 进入contestant-server,运行以下指令
      PYTHONPATH=your/project/path/contestant-server python service/federated/server.py

实验指标

  • 正确率:P (Precision) = TP / (TP + FP),所有预测出来的正例中有多少是真的正例
  • 召回率:R (Recall) = TP / (TP + FN),所有真实正例中预测出了多少真实正例
  • F1值:F1 Score = 2 * P * R / (P + R),精确率和召回率的调和均值
  • mAP (mean Average Precision): 目标检测模型的评估指标
  • 国网电力指标:电力人工智能数据竞赛指标计算方法和自动评测脚本的详细介绍

实验结果

基于默认实验参数,初赛吊车测试集基于YOLOv3模型的结果:

false detection rate missed detection rate object detection correct rate sgcc crane image score
0.5656324582338902 0.10780669144981413 0.7336343115124153 0.723133779107409

选手问题答疑

问题1:

File "your/python/path/python3.7/site-packages/torch/nn/modules/container.py", line 74, in _get_item_by_idx  
raise IndexError('Index {} is out of range'.format(idx))  
IndexError: index 0 is out of range  

解决方案:在客户端和服务端生成新的cfg文件之前,先把旧的cfg文件删除掉。

问题2:

File "service/federated/server.py", line 81, in call_federated_train_size  
federated_train_size = Common.get_dict_by_json_str_func(train_job.value['data'])["federated_train_size"]  
TypeError: 'NoneType' object is not subscriptable

解决方案:查看客户端报错信息,如果是Flask包相关错误,将Flask升级为1.1.1版本。

问题3:

Start executing step: call federated train size  
Segmentation fault (core dumped)

解决方案:很可能是gevent版本的问题,升级到20.9.0版本。

问题4:
电力指标相关的问题。
已经在官网更新国网电力指标说明。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].