Skip to content

Ethan-Xian-Li/LAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LAB Algorithm Implementation (PyTorch)

arXiv Cite Paper

This repository provides implementations related to our paper: Xian Li, Suzhi Bi, and Ying-Jun Angela Zhang, "Task-Oriented Computation Offloading for Edge Inference: An Integrated Bayesian Optimization and Deep Reinforcement Learning Framework".


Overview

LAB is a hybrid learning framework integrating Deep Reinforcement Learning (DRL) and Bayesian Optimization (BO) for online optimization control in edge intelligence systems.

Key Features:

  • Solving black-box MINLP.
  • An online learning algorithm adapting to dynamic wireless environments and input image content.
  • Resolving the inherent data-intensive learning constraint of DRL via BO's sample-efficient surrogate modeling, while circumventing the fundamental combinatorial optimization barrier of BO by leveraging DRL's real-time decision-making.

Table of Contents


Support our research

If this implementation helped your work, please consider starring ⭐ the repository and citing our paper. Your promotion and citations are truly important to us.

BibTeX

@article{li2025taskoriented,
  title={Task-Oriented Computation Offloading for Edge Inference: An Integrated Bayesian Optimization and Deep Reinforcement Learning Framework},
  author={Li, Xian and Bi, Suzhi and Zhang, Ying-Jun Angela},
  journal={arXiv preprint arXiv:2509.21090},
  year={2025},
  doi={10.48550/arXiv.2509.21090},
  url={https://doi.org/10.48550/arXiv.2509.21090}
}

1. Installation

Prerequisites

  • Python 3.12.10

Setup Steps

  • Create and activate virtual environment (Optional)
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
.venv\Scripts\activate     # Windows
  • Install dependencies
pip install -r requirements.txt

2. Data Preparation

Option 1

  • Use the data in directory: data/prepared_data/SelfDriving_yolo11x.pickle, which has the following keys with each storing an $15,000 \times A$ array, where $A$ is the number of degradation levels:
    • 'inference_time': inference latency.
    • 'degradation_time': degradation latency.
    • 'cum_confidence': cumulative confidence value.
    • 'accuracy_0.75': detectioin accuracy using IoU with threshold 0.75.
    • 'accuracy_0.5': detectioin accuracy using IoU with threshold 0.5.

Option 2 (Prepare your own data)

The UrbanRoad self-driving dataset contains 15,000 RGB video frames at native resolution $(1920 \times 1200)$. Note that the total number of frames in the package may be 30,000 due to duplicates, so we need to extract the 15,000 unique frames.

  • Gaussian pyramid downsampling

Applying Gaussian pyramid downsampling to the UrbanRoad self-driving dataset to generate $A$ degraded datasets, each containing 15,000 frames at distinct degradation levels. Recording the degradation latency for each frame.

  • Task inference

For all $A$ degraded datasets, performing task inference using YOLO and recording the inference results, e.g., inference time, confidence, detection boxes, etc. Also, computing and recoding the accuracy results (for performance validation only).

  • Create your own SelfDriving_yolo11x.pickle and place it in directory: data/prepared_data/SelfDriving_yolo11x.pickle

3. Running the Algorithm

Note

Before running the code: please set your project base_dir in 'configs/config.py' to ensure all the data and results paths are correcly resolved.

cd .../path/to/your/LAB
python main.py --config_file=UCB_CAT_RBF_wdelay1_clip256.json

4. Project Structure

LAB Project Structure

  • main.py - Main entry point script
  • configs/ - Configuration files (.json format)
  • data/ - data required for implementation
    • prepared_cp/ - the checkpoint of the DNN-based CVX solver. It will be automatically created during implementation.
    • prepared_data/ - SelfDriving_yolo11x.pickle is nessesary. Other pickle data will be automatically created during implementation.
  • DBAG/ - Baseline DBAG algorithm (for comparison)
  • models/ - Algorithm implementations
    • model.py - Core LAB algorithm and its variaions LAB_OT and LAB_X
    • benchmarks.py - Benchmark model implementations
  • networks/ - The DNN-based actor and BO-based critic modules
    • drl_network.py - The DNN-based actor
    • bo_network.py - The BO-based critic
    • my_kernels.py - kernels used for BO
  • objs/ - Optimization objectives definitions
  • results/ - Output results including log and result data. The file path checkpoint and samples are also created for future extension.
  • utils/ - Some utility functions
    • datamanager.py - A class for saving and loading .pickle (suggested)/.np/.mat/dataset and .pt/.pth model file.
    • logger.py - A custom logging class for tracking running dynamics.
    • utils.py - Some custom utility functions.
  • wirelesscom/ - Wireless communication models
  • README.md - Project documentation
  • requirements.txt - dependencies file

About

**LAB** is a hybrid learning framework integrating Deep Reinforcement Learning (DRL) and Bayesian Optimization (BO) for online optimization control in edge intelligence systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages