---
title: AI攻防对抗子系统约定
tags: Work
description: View the slide with "Slide Mode".
---
# AI攻防对抗子系统约定
## 1. System Definition
### 1.1 系统页面说明
1. 训练数据导入、管理页面
2. 神经网络导入、管理页面
3. 第三方包导入、管理页面
4. AI任务增、删、改、查页面
5. AI进程管理、展示页面(展示会显示AI执行参数、状态、输入、输出等)
6. 攻防对抗展示页面
### 1.2 调度说明
> // ...还没想好
### 1.3 第三方包约定
*输出文件的地址,在配置文件中写出,一般为绝对目录*
需包含文件以及说明如下:
1. requirements.txt - python依赖包文件
2. conf.json - 包信息文件,包含接口等说明
```json=
{
name: String,
version: String,
note: String, // 包说明,可以省略
interface: String, // 调研接口,e.g., attack.Attack.run
release: Datetime, // 修改日期,e.g., 2021.03.01
output: String, // 输出文件的目录,绝对目录
aicycle: String, // 参考AI生命周期9步骤
dtype: String, // 支持的数据格式:graph, image, language.
dataset: [String,..] // 支持的数据集:CIFAR10, Imagenet, CelebA.
// some other configures...
}
```
3. params.json - 算法的参数,根据算法而制定的默认参数(格式不定)
```json=
{
learning_rate: Float,
optimizer: String,
// some other configures...
}
```
4.建议目录格式:
```shell=
|--/conf.json
|--/torchattcks/
|----/main.py
|----/params.json
|----/output/
...
```
---
## 2.DB(Redis) Definition
1. user - dict -- 系统用户,关闭注册
```json=
{
uid: Int,
uname: String,
upass: String,
login: Datetime, // last login
utype: Int, // 1=admin, 2=user, 3=guest, other=not login
}
```
2. process - dict - 运行的AI进程
```json=
{
id: Int,
pid: Int,
state: Int, // from AI life cycle
name: String, // definition
conf: String, // json config file path
}
```
3. task - dict - 预设任务,只读
```json=
{
id: Int,
dataset: list, // e.g., CIFAR10, Tinyimagenet, etc.
network: list, // e.g., VGG-face, Resnet, etc. (only id)
}
```
4. network - dict - 预设神经网络,只读
```json=
{
id: Int,
name: String,
hash: String, // data hash id
download: String, // download url
path: String, // saved path
note: String, // note of network
dtype: String, // e.g., graph, image, language, etc.
}
```
5. dataset - dict - 预设数据集,只读
```json=
{
id: Int,
name: Int,
hash: String,
download: String,
path: String,
note: String,
classes_num: Int, // num of class number
feature_num: Int, // num of feature
data_shape: [], // input shape
dtype: String, // e.g., graph, image, language, etc.
}
```
6. package - dict - 第三方数据包,可读写 (待进一步确定)
```json=
{
id: Int,
name: String,
hash: String,
mtime: Datetime, // modify time
atime: Datetime, // add time
priority: Int, // 调用的优先顺序,越小越先调用,约定1最小
ai_cycle: Int, // AI cycle 时间段,对应AI生命周期
ai_role: Int, // AI 攻防对抗双方
path: String, // 存放的地址
download: String, // 是否可以下载,可以即为url,不可以即为空
}
```
7. output - dict - 输出数据定义,可读写
```json=
{
id: Int,
pid: Int, // process id, 对应进程id
pack_id: Int, // 来源的第三方工具包名称
pack_name: String, // 来源的第三方工具包名称
atime: Datetime, // add time
ai_cycle: Int, // AI cycle 时间段,对应AI生命周期
path: String, // 存放的地址
dtype: String, // 输出数据格式,e.g., table, image, etc.
}
```
8. message - list - 系统消息队列
```json=
```
9. running - list - 系统执行进程队列
```json=
```
<br>
---
## 3.Element Definition
训练数据类型:
- graph
- image
- language
<br>
业务场景分类:
- 人脸识别
- 图像识别
- 语言分析
- 自动驾驶
- 图网络分析
<br>
AI生命周期:
1. data_collecting 数据收集
2. data_cleaning 数据清洗
3. data_transformation 数据标准化
4. model_training 模型训练
5. model_pruning 模型精修
6. model_testing 模型测试
7. model_deployment 模型部署
8. platform_compatible 系统兼容
9. platform_testing 系统测试
<br>
数据库元素:
- process
- task (dataset/network/conf...)
---
## 4.Reference
<br><br><br><br><br><br><br><br><br><br><br><br>
-- 2021.03.03