By My Eyes: Grounding Multimodal Large Language Models with Sensor Data via Visual Prompting (EMNLP '24)
This is the official Python implementation of "By My Eyes: Grounding Multimodal Large Language Models with Sensor Data via Visual Prompting (EMNLP '24 main track, long paper)" by Hyungjun Yoon, Biniyam Aschalew Tolera, Taesik Gong, Kimin Lee, and Sung-Ju Lee.
To set up the project, we recommend using Python 3.9.16 in a conda environment. Follow the steps below to install and configure the environment.
- Download and install Anaconda.
- Create and activate the conda environment using the commands below:
conda create -n bymyeyes python=3.9.16
conda activate bymyeyes- Once the environment is activated, install the required packages:
python -m pip install -r requirements.txtTo use the ChatGPT API, follow these steps to acquire your API key:
- Visit OpenAI and sign in.
- Generate an API key in the API section.
- Save the key to a file in your private directory.
echo "<your_openai_key>" > openai_keyTo run the benchmarks, download the datasets from the following links:
Download and store the datasets in your storage directory.
We provide preprocessing scripts for the raw datasets. You can implement your own preprocessing with different settings. Ensure your data is in a compatible format with our framework by referring to the output structure from the provided script.
To run the preprocessing, use the following command:
python data_utils/preprocess.py --dataset <dataset_name> --data_dir <path_to_raw_data_directory> --out_dir <path_to_processed_data_directory>We use YAML files for configuration. To set up your own configurations, refer to the sample_config.yaml file, which includes detailed comments to guide you in customizing the settings.
After the configuratin, run the framework using the following command:
python run.py --config <config_file>We tested our codes in this environment.
- OS: Ubuntu 20.04.4 LTS
- GPU: NVIDIA GeForce RTX 3090
- GPU Driver Version: 470.74
- CUDA Version: 11.2
@inproceedings{yoon-etal-2024-eyes,
title = "By My Eyes: Grounding Multimodal Large Language Models with Sensor Data via Visual Prompting",
author = "Yoon, Hyungjun and
Tolera, Biniyam Aschalew and
Gong, Taesik and
Lee, Kimin and
Lee, Sung-Ju",
editor = "Al-Onaizan, Yaser and
Bansal, Mohit and
Chen, Yun-Nung",
booktitle = "Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing",
month = nov,
year = "2024",
address = "Miami, Florida, USA",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2024.emnlp-main.133/",
doi = "10.18653/v1/2024.emnlp-main.133",
pages = "2219--2241",
abstract = "Large language models (LLMs) have demonstrated exceptional abilities across various domains. However, utilizing LLMs for ubiquitous sensing applications remains challenging as existing text-prompt methods show significant performance degradation when handling long sensor data sequences. In this paper, we propose a visual prompting approach for sensor data using multimodal LLMs (MLLMs). Specifically, we design a visual prompt that directs MLLMs to utilize visualized sensor data alongside descriptions of the target sensory task. Additionally, we introduce a visualization generator that automates the creation of optimal visualizations tailored to a given sensory task, eliminating the need for prior task-specific knowledge. We evaluated our approach on nine sensory tasks involving four sensing modalities, achieving an average of 10{\%} higher accuracy compared to text-based prompts and reducing token costs by 15.8 times. Our findings highlight the effectiveness and cost-efficiency of using visual prompts with MLLMs for various sensory tasks. The source code is available at https://github.com/diamond264/ByMyEyes."
}