目录

AI on the edge: “the OPS-SAT case” - Starter kit


Scripts to clean and prepare the OPSSAT competition dataset.

Table of Contents
  1. About The Project
  2. Directory content
  3. Getting started
  4. Competition data

About The Project

This is the starting kit for the competition: AI on the edge: "the OPS-SAT case" - Starter kit.

Directory content

The competition_toolkit includes:

  • efficientnet_lite.py, this is a slightly edited version of the Keras-based implementation of the EfficientNet-lite-0 deep neural network included in efficientnet-lite-keras. This is the Deep Neural Network model that shall be used for the competition. Submissions exploiting different architecture will be discarded.
  • starter_kit_notebook.ipynb: this notebook shows how to load the competition dataset, instatiate and train an EfficientNet-lite-0 model, included in efficientnet_lite.py and evaluate it by using the metrics described in here.
  • serverside_evaluation.ipynb: this script shows the pipeline used to evaluate a submission. Such a pipeline includes, HDF5 weights loading and model checking, conversion from TF (Keras) model to tflite by using float16 quantization format (please, refer to post-training float16 - quantization) and score calculation by using the metrics described here.
  • pytorch_to_tf_conversion.ipynb: this notebook provides a utility to converts EfficientNet-lite-0 models trained in PyTorch by using the efficientnet-lite-pytorch and efficientnet_lite0_pytorch_model python packages to the TF (Keras) model included in efficientnet_lite.py.
  • model_pytorch_baseline.pth: This is an example of a valid PyTorch model (same as the competition baseline) which is used to showcase its translation to a valid submission file.

Getting started

Clone this repository:

git clone https://gitlab.com/EuropeanSpaceAgency/the_opssat_case_starter_kit.git
cd the_opssat_case_starter_kit

In our servers, where the submissions are evaluated, the following version of core packages are running:

  • python 3.9
  • tensorflow 2.7.0
  • numpy 1.21.1
  • sciki_learn 1.0.2
  • cudatoolkit 11.2
  • cudnn 8.1.0

To create a similar environment on your machine, assuming you are in an updated conda base environment, you can run:

 conda create --name opssat python=3.9 numpy jupyter scikit_learn
 conda activate opssat
 python3 -m pip install tensorflow==2.7

If you have GPUs (not strictly needed fot he notebooks, but highly useful for the competition) you will also need to install the correct versions of cudatoolkit and cudnn before the tensorflow installation.

Note that we pinned the tensorflow version and python version: the notebooks in this starter kit may break if different versions are used, since the tensorflow/keras API is not stable.

Eventually, to test the correct installation of tensorflow, you can run:

python
import tensorflow

If you get a PROTOBUF error, you can fix it by running:

conda install protobuf=3.20.1

If you want to use the pytorch_to_tf_conversion.ipynb notebook to convert a model trained on Pytorch and based on efficientnet-lite-pytorch and efficientnet_lite0_pytorch_model, you need to run the following commands to install efficientnet_lite0_pytorch_model and efficientnet_lite0_pytorch_model:

pip install efficientnet_lite_pytorch
pip install efficientnet_lite0_pytorch_model

Competition data

The competition dataset can be downloaded from the following Zenodo link. Consecutively to the download, proceed as follows:

  1. Create a directory ops_sat_competiton_official.
  2. Unzip ops_sat_competiton_official.zip in the ops_sat_competiton_official.

Once unzipped, the ops_sat_competiton_official will contain:

  • a subdirectory for each of the 8 competition class: Agricultural, Cloud, Mountain, Natural,River, Sea_ice, Snow, and Water. Each of this subdirectory includes 10 200x200x3-patches of that class (labeled traing data).

  • a subdirectory images containing 26 2048x1944x3 or 2048x1942x3 raw OPS-SAT satellite images. The competitors can dispose of these images to implement a training strategy to improve their models.

  • *N.B.**: images DOES NOT contain data of one of the competition class. Therefore, to run the notebooks correctly, the directory images shall be removed from the ops_sat_competiton_official directory to run the previous notebooks correctly.

关于

ESA 官方 GitLab 组织入口,集中托管 ESA 官方开源项目(OPS-SAT 竞赛套件等),是获取 ESA 官方航天开源软件的主要入口。来源 https://gitlab.com/EuropeanSpaceAgency,License 见文末许可证核查表

37.5 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号