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".
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.
If this implementation helped your work, please consider starring ⭐ the repository and citing our paper. Your promotion and citations are truly important to us.
@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}
}- Python 3.12.10
- 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
- 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.
- Download Dataset: e.g., the UrbanRoad self-driving dataset, https://public.roboflow.com/object-detection/self-driving-car
The UrbanRoad self-driving dataset contains 15,000 RGB video frames at native resolution
- Gaussian pyramid downsampling
Applying Gaussian pyramid downsampling to the UrbanRoad self-driving dataset to generate
- Task inference
For all
- Create your own SelfDriving_yolo11x.pickle and place it in directory:
data/prepared_data/SelfDriving_yolo11x.pickle
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.jsonLAB Project Structure
main.py- Main entry point scriptconfigs/- Configuration files (.json format)data/- data required for implementationprepared_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 implementationsmodel.py- Core LAB algorithm and its variaions LAB_OT and LAB_Xbenchmarks.py- Benchmark model implementations
networks/- The DNN-based actor and BO-based critic modulesdrl_network.py- The DNN-based actorbo_network.py- The BO-based criticmy_kernels.py- kernels used for BO
objs/- Optimization objectives definitionsresults/- Output results including log and result data. The file pathcheckpointandsamplesare also created for future extension.utils/- Some utility functionsdatamanager.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 modelsREADME.md- Project documentationrequirements.txt- dependencies file