File size: 2,687 Bytes
703fb21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0dbe804
703fb21
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
task_categories:
- visual-question-answering
language:
- en
pretty_name: Scientific Figures and Captions
size_categories:
- 1M<n<10M
---
# Scientific Figures and Captions Dataset from research papers

This repository contains the Scientific Figures and Captions dataset, which includes approximately 2.5 million entries of scientific figures and their corresponding captions extracted from academic papers on arXiv. This dataset is intended for research purposes in the fields of computer vision and natural language processing, particularly for tasks related to image captioning and automated figure analysis.

## Dataset Description

The dataset is structured as a Parquet dataframe with two columns:
- `image_filename`: This column contains the relative paths to image files.
- `caption`: This column contains the textual captions associated with each image.

Images are stored under `dataset/figures/` and are compressed into multiple parts (.z01, .z02, ..., .z103) with a final `.zip` file that encompasses all parts. This format is used for efficiently handling large datasets.

## Extraction Instructions

To access the images, you must first decompress the multi-part ZIP archive. Make sure you have all parts of the archive (.z01 to .z103 and the .zip file) in the same directory. Most decompression tools will recognize and handle multi-part ZIP files seamlessly.

Here is an example using the command line with `unzip`:
```bash
# Navigate to the directory containing the compressed parts
cd dataset/figures

# Use unzip to extract the images
unzip compressedfigures.zip
```

This will extract the contents into the `dataset/figures/` directory. Ensure that you have enough storage space to accommodate the uncompressed images.

## Usage Example

To use the dataset in your Python projects, you'll need to read the Parquet file into a DataFrame. Here is an example using `pandas`:
```python
import pandas as pd

# Load the dataset into a DataFrame
df = pd.read_parquet('dataset.parquet')

# Display the first few entries
df.head()
```

Once the dataset is loaded, you can use it as follows:
```python
from PIL import Image
import matplotlib.pyplot as plt

# Example function to display an image with its caption
def show_image_with_caption(image_path, caption):
    img = Image.open(image_path)
    plt.imshow(img)
    plt.title(caption)
    plt.axis('off')  # Hide the axis
    plt.show()

# Display the first image and its caption
first_image_path = df.loc[0, 'image_filename']
first_caption = df.loc[0, 'caption']
show_image_with_caption(first_image_path, first_caption)
```

## Acknowledgment

Special thanks to arxiv for providing access to all of the research papers.