language: cn
model_unique_abbr: MaskRCNN
version: 1.0
identification:
  docker_image_name: maskrcnn:1.1.0_gpu
  model_name: Mask R-CNN
  semantic: Mask Regional Convolutional Neural Network
  description: 用于图像的目标检测和实例分割的深度学习模型
  category_application: 预测型
  category_data:
    - 遥感影像数据
    - 图像数据
  keywords:
    - 目标检测
    - 图像分类
    - 实例分割
parameter_info:
  parameters:
    - arg_name: -data_path
      param_type: input_data
      name: 数据路径
      description: 指定训练数据的路径,图片数据格式为jpg
      data_type: str
      data_semantic: Path to the dataset
      specification:
        default: "./COCO2017"

    - arg_name: -img_path
      param_type: input_data
      name: 测试数据路径
      description: 存储测试数据图片的路径，测试图片格式为jpg
      data_type: str
      data_semantic: data root directory
      specification:
        default: "./src/test.jpg"

    - arg_name: -save_weights_pre
      param_type: input_data
      name: 模型权重目录
      description: 模型权重文件的路径,权重为pth格式
      data_type: str
      data_semantic: model save path
      specification:
        default: "./save_weights"

    - arg_name: -img_out
      param_type: output_data
      name: 输出图像文件名
      description: 预测结果图像的文件
      data_type: str
      data_semantic: filename for the output prediction image
      specification:
        default: "./result/img_out"

    - arg_name: -resnet_path
      param_type: input_data
      name: ResNet50预训练权重路径
      description: ResNet50模型的预训练权重文件的路径，不可替换
      is_required: true
      data_type: str
      data_semantic: file path
      specification:
        default: "resnet50.pth"

    - arg_name: -coco_path
      param_type: input_data
      name: COCO预训练权重路径
      description: Mask R-CNN模型在COCO数据集上的预训练权重文件的路径，不可替换
      is_required: true
      data_type: str
      data_semantic: file path
      specification:
        default: "maskrcnn_resnet50_fpn_coco.pth"

    - arg_name: -num_classes
      param_type: param
      name: 类别数
      description: 数据集中的目标类别数，默认值90
      is_required: false
      data_type: int
      data_semantic: number of classes
      specification:
        default: 90

    - arg_name: -start_epoch
      param_type: param
      name: 起始训练周期
      description: 模型训练的起始周期数，可根据需求取值，取值范围[1,)
      is_required: false
      data_type: int
      data_semantic: start epoch
      specification:
        default: 1
        range:
          - \[1,)

    - arg_name: -epochs
      param_type: param
      name: 训练周期
      description: 模型训练的总周期，可根据需求取值，取值范围[1,)
      is_required: false
      data_type: int
      data_semantic: number of epochs
      specification:
        default: 3
        range:
          - \[1,)

    - arg_name: -lr
      param_type: param
      name: 学习率
      description: 模型训练的学习率，可根据需求取值，取值范围（0,1)
      is_required: false
      data_type: float
      data_semantic: learning rate
      specification:
        default: 0.004
        range:
          - (0,1)

    - arg_name: -momentum
      param_type: param
      name: 动量
      description: SGD的momentum参数，可根据需求取值，取值范围（0,2)
      is_required: false
      data_type: float
      data_semantic: momentum for sgd
      specification:
        default: 0.9
        range:
          - (0,2)

    - arg_name: -weight_decay
      param_type: param
      name: 权重衰减
      description: 权重衰减正则项，防止过拟合，可根据需求取值，取值范围（0,1)
      is_required: false
      data_type: float
      data_semantic: weight decay for sgd
      specification:
        default: 1e-4
        range:
          - (0,1)

    - arg_name: -lr_steps
      param_type: param
      name: 学习率下降步长
      description: 在每个步长周期后减少学习率，默认值1
      is_required: false
      data_type: int
      data_semantic: learning rate steps
      specification:
        default: 1


    - arg_name: -lr_gamma
      param_type: param
      name: 学习率衰减因子
      description: 按照 lr_gamma 因子减少学习率，默认值0.1
      is_required: false
      data_type: float
      data_semantic: learning rate gamma
      specification:
        default: 0.1

    - arg_name: -batch_size
      param_type: param
      name: 批次大小
      description: 每个批次处理的图像数量，可根据需求取值，取值范围[1,)
      is_required: false
      data_type: int
      data_semantic: batch size
      specification:
        default: 1
        range:
          - \[1,)

application:
  domain: 图像目标检测与分割
  objective: 使用Mask R-CNN模型对图像进行目标检测与实例分割，识别并标注图像中的目标。
  link_models:
    alternative:
      - FasterRCNN
  mechanism: 使用区域建议网络生成候选区域，并通过卷积网络对这些区域进行分类和边界框回归，同时生成像素级的分割掩码。

operation:
  usage: 在命令行中通过指定参数运行模型训练、测试和预测任务。
  exec_example:
      - docker run --gpus all -v $(pwd):/data maskrcnn:1.1.0-gpu --data_path ./COCO2017 --img_path test.jpg --save_weights_pre ./save_weights --epochs 3 --lr 0.004 --batch_size 1
license:
  - Apache-2.0
technique:
  language:
    - Python
  os:
    - Linux
  hardware:
    - GPU
dependencies:
  - name: python
    version: 3.8
  - name: numpy
    version: '1.24.4'
  - name: opencv-python
    version: '4.5.1.48'
  - name: tensorflow
    version: '2.4.1'
  - name: lxml
    version: '5.2.1'
  - name: matplotlib
    version: '3.7.5'
  - name: tqdm
    version: '4.66.4'
  - name: pycocotools
    version: '2.0.7'
  - name: Pillow
    version: '9.5.0'
  - name: torch
    version: '1.10.0'
  - name: torchvision
    version: '0.11.1'

source:
  maintainer: Bingsai Liu
  organization: Beijing University of Civil Engineering and Architecture
  contact: liubingsai2023@163.com
  references:
    - "He, K., Gkioxari, G., Dollár, P., & Girshick, R. (2017). Mask R-CNN. In Proceedings of the IEEE international conference on computer vision (pp. 2961-2969)."
