DOI: 10.17617/3.z8w2jr
title: Paintings Gemma-Enriched Dataset. Fotothek - Bibliotheca Hertziana

description: &lt;h1
id="gemälde-dataset---ai-enhanced-art-historical-descriptions"&gt;Gemälde
Dataset - AI-Enhanced Art Historical Descriptions&lt;/h1&gt;
&lt;p&gt;This dataset contains 224x224 images and relative metadata extracted
from the MIDAS XML of the Catalogue of the Photographic Collection of
the Bibliotheca Hertziana enriched with AI-generated prose texts. The
dataset is limited to photographs of objects classified as painting
(Gemälde), and has been processed using &lt;a
href="https://huggingface.co/google/gemma-2-9b-it"&gt;Google Gemma 2 9B
Instruct&lt;/a&gt; large language model on the &lt;a
href="https://docs.hpc.gwdg.de/"&gt;KISSKI HPC cluster&lt;/a&gt; of the GWDG.
Scripts to process the data on KISSKI have been elaborated with Claude
Code in Virtual Studio Code.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id="dataset-overview"&gt;Dataset Overview&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Source Data:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Original dataset: &lt;code&gt;gemalde.tsv&lt;/code&gt; (19,051 rows)&lt;/li&gt;
&lt;li&gt;Extracted from: MIDAS XML format (&lt;code&gt;combined.xml&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Institution: &lt;a href="https://www.biblhertz.it/"&gt;Photographic
Collection. Bibliotheca Hertziana - Max Planck Institute for Art
History&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Photographic Collection Catalogue: &lt;a
href="https://foto.biblhertz.it/"&gt;Fotothek der Bibliotheca
Hertziana&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Enriched metadata:&lt;/strong&gt; TSV files with AI-generated
German and English descriptions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;224x224 images downloaded from IIIF Image Api of the
Photographic Collection&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2 id="processing-pipeline"&gt;Processing Pipeline&lt;/h2&gt;
&lt;h3 id="data-extraction"&gt;1. Data Extraction&lt;/h3&gt;
&lt;p&gt;Source data was extracted with gemalde.xql from &lt;a
href="https://edmond.mpg.de/dataset.xhtml?persistentId=doi:10.17617/3.8GPSDJ"&gt;MIDAS
XML format combined.xml&lt;/a&gt; containing structured art historical
metadata including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Object titles and descriptions (&lt;code&gt;textobj&lt;/code&gt;,
&lt;code&gt;textfoto&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Artist information (&lt;code&gt;aob30&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Location data (&lt;code&gt;aob26&lt;/code&gt;, &lt;code&gt;aob28&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Dating and provenance&lt;/li&gt;
&lt;li&gt;Image references (&lt;code&gt;a8540&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="images-download"&gt;Images Download&lt;/h4&gt;
&lt;p&gt;224x224 images downloaded in advance from the IIIF Service based on
&lt;code&gt;gemalde.tsv&lt;/code&gt;. The script processing for AI Text Enrichment
from the metadata checks that the image has been downloaded, so the
output data has a 100% certainty of having a matching image. 17,657
images downloaded from 19,051 rows. This is due to known missing digital
images. The dataset corresponds to published data and each row contains
the licence and accessibility of the single image, date of creation and
last update of the catalogue object.&lt;/p&gt;
&lt;h3 id="ai-text-generation"&gt;2. AI Text Generation&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Model Used:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Name:&lt;/strong&gt; &lt;a
href="https://huggingface.co/google/gemma-2-9b-it"&gt;Google Gemma 2 9B
Instruct&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parameters:&lt;/strong&gt; 9 billion&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Quantization:&lt;/strong&gt; FP16 (no quantization)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context window:&lt;/strong&gt; 8,192 tokens&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;License:&lt;/strong&gt; Gemma Terms of Use&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Processing Workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;ol type="1"&gt;
&lt;li&gt;&lt;strong&gt;Input cleaning:&lt;/strong&gt; Removal of numeric codes,
normalization of Unicode characters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paragraph generation:&lt;/strong&gt; German text from structured
metadata&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Translation:&lt;/strong&gt; German → English&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Categories processed:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;paragraph foto DE/EN&lt;/code&gt; - Photograph description&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph obj DE/EN&lt;/code&gt; - Object/artwork description&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph verwalter DE/EN&lt;/code&gt; - Collection/custodian
information&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph standort DE/EN&lt;/code&gt; - Location information&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr /&gt;
&lt;h2 id="ai-prompts-used"&gt;AI Prompts Used&lt;/h2&gt;
&lt;h3 id="paragraph-generation-prompt"&gt;Paragraph Generation Prompt&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;Convert the following structured information into a coherent text in German.
The text contains field data that should be transformed into flowing prose while preserving all information.

IMPORTANT:
- Write a MAXIMUM of 2 paragraphs
- Do NOT include any URLs or web links
- Do NOT include reference codes or numerical codes
- Do NOT add any comments or explanations
- Only output the paragraph text itself

Field: {field_name}
Text: {cleaned_text}

German text (maximum 2 paragraphs):&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Example Input:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Field: textobj
Text: Bildnis Filippo Neri Hl. Filippo Neri geboren 1515 Florenz gestorben 1595
Rom Priester Ordensgründer Gründer Oratorium Kongregation des Oratoriums&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Example Output:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Filippo Neri, geboren 1515 in Florenz und gestorben 1595 in Rom, war ein Priester
und bedeutender Ordensgründer. Er gründete das Oratorium und die Kongregation des
Oratoriums, die bis heute eine wichtige Rolle in der katholischen Kirche spielen.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id="translation-prompt"&gt;Translation Prompt&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;Translate the following German text to English.
Preserve the meaning and style as much as possible.

IMPORTANT:
- Do NOT include any URLs or web links in the translation
- Do NOT include reference codes starting with &quot;bh&quot; followed by numbers
- Do NOT include numerical codes like 08012353
- Do NOT add any comments or explanations
- Only output the translated text itself

German text: {text}

English translation:&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Example Translation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Input (DE): Filippo Neri, geboren 1515 in Florenz und gestorben 1595 in Rom,
war ein Priester und bedeutender Ordensgründer.

Output (EN): Filippo Neri, born 1515 in Florence and died 1595 in Rome, was
a priest and important founder of a religious order.&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2 id="kisski-cluster-resources"&gt;KISSKI Cluster Resources&lt;/h2&gt;
&lt;h3 id="hardware-configuration"&gt;Hardware Configuration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;GPU:&lt;/strong&gt; NVIDIA A100 (80GB VRAM)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Architecture: Ampere&lt;/li&gt;
&lt;li&gt;Tensor Cores: 432&lt;/li&gt;
&lt;li&gt;FP16 Performance: ~312 TFLOPS&lt;/li&gt;
&lt;li&gt;Memory Bandwidth: 2 TB/s&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Allocation per job:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GPUs: 1× A100&lt;/li&gt;
&lt;li&gt;CPUs: 4 cores&lt;/li&gt;
&lt;li&gt;RAM: 64 GB&lt;/li&gt;
&lt;li&gt;Time limit: 6 hours per job&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="job-array-configuration"&gt;Job Array Configuration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Array setup:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Total jobs:&lt;/strong&gt; 38 (indices 0-37)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chunk size:&lt;/strong&gt; 500 rows per job&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parallel jobs:&lt;/strong&gt; 10 simultaneous&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total rows processed:&lt;/strong&gt; 19,000 (rows 0-18,999)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="performance-metrics"&gt;Performance Metrics&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;AI operations per row:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;4 paragraph generations (foto, obj, verwalter, standort)&lt;/li&gt;
&lt;li&gt;4 translations (DE → EN)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total:&lt;/strong&gt; 8 LLM inference calls per row&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Resource consumption:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GPU hours:&lt;/strong&gt; ~125 GPU hours total (38 jobs × 3.3
hours)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Model size in memory:&lt;/strong&gt; ~18 GB (FP16)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Peak VRAM usage:&lt;/strong&gt; ~25 GB per job&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2 id="output-structure"&gt;Output Structure&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;data_gemalde/
├── enriched_data/
│ ├── data_0-499.tsv # Rows 0-499
│ ├── data_500-999.tsv # Rows 500-999
│ ├── data_1000-1499.tsv # Rows 1000-1499
│ └── ...
├── images/
│ ├── {image_id_1}.jpg # IIIF thumbnail (224×224)
│ ├── {image_id_2}.jpg
│ └── ...
└── README.md # This file&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id="output-fields"&gt;Output Fields&lt;/h3&gt;
&lt;p&gt;Each TSV file contains the original metadata plus AI-generated
fields:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original fields:&lt;/strong&gt; All fields from
&lt;code&gt;gemalde.tsv&lt;/code&gt; including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;a8540&lt;/code&gt; - Image ID (BILDDATEI-NR.)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;textobj&lt;/code&gt; - Original object text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;textfoto&lt;/code&gt; - Original photo text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;aob26&lt;/code&gt;, &lt;code&gt;aob28&lt;/code&gt;, &lt;code&gt;aob30&lt;/code&gt; -
Relations&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Generated fields:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;paragraph foto DE&lt;/code&gt; - German description of
photograph&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph foto EN&lt;/code&gt; - English translation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph obj DE&lt;/code&gt; - German description of
object/artwork&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph obj EN&lt;/code&gt; - English translation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph verwalter DE&lt;/code&gt; - German description of
collection&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph verwalter EN&lt;/code&gt; - English translation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph standort DE&lt;/code&gt; - German description of
location&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph standort EN&lt;/code&gt; - English translation&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2 id="technical-details"&gt;Technical Details&lt;/h2&gt;
&lt;h3 id="model-configuration"&gt;Model Configuration&lt;/h3&gt;
&lt;div class="sourceCode" id="cb7"&gt;&lt;pre
class="sourceCode python"&gt;&lt;code class="sourceCode python"&gt;&lt;span id="cb7-1"&gt;&lt;a href="#cb7-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;model &lt;span class="op"&gt;=&lt;/span&gt; AutoModelForCausalLM.from_pretrained(&lt;/span&gt;
&lt;span id="cb7-2"&gt;&lt;a href="#cb7-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt; &lt;span class="st"&gt;&quot;google/gemma-2-9b-it&quot;&lt;/span&gt;,&lt;/span&gt;
&lt;span id="cb7-3"&gt;&lt;a href="#cb7-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt; device_map&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="st"&gt;&quot;cuda&quot;&lt;/span&gt;,&lt;/span&gt;
&lt;span id="cb7-4"&gt;&lt;a href="#cb7-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt; torch_dtype&lt;span class="op"&gt;=&lt;/span&gt;torch.float16,&lt;/span&gt;
&lt;span id="cb7-5"&gt;&lt;a href="#cb7-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt; local_files_only&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;True&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb7-6"&gt;&lt;a href="#cb7-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="generation-parameters"&gt;Generation Parameters&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Paragraph generation:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;max_new_tokens&lt;/code&gt;: 500&lt;/li&gt;
&lt;li&gt;&lt;code&gt;temperature&lt;/code&gt;: 0.7&lt;/li&gt;
&lt;li&gt;&lt;code&gt;top_p&lt;/code&gt;: 0.9&lt;/li&gt;
&lt;li&gt;&lt;code&gt;do_sample&lt;/code&gt;: True&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Translation:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;max_new_tokens&lt;/code&gt;: 500&lt;/li&gt;
&lt;li&gt;&lt;code&gt;temperature&lt;/code&gt;: 0.3 (lower for more deterministic
translation)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;top_p&lt;/code&gt;: 0.9&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2 id="kisski-documentation"&gt;KISSKI Documentation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Main documentation:&lt;/strong&gt; https://docs.hpc.gwdg.de/&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GPU partitions:&lt;/strong&gt;
https://docs.hpc.gwdg.de/how_to_use/compute_partitions/gpu_partitions/&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Account types:&lt;/strong&gt;
https://docs.hpc.gwdg.de/start_here/account_types/&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2 id="data-usage-citation"&gt;Data Usage &amp; Citation&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Source Institution:&lt;/strong&gt; Bibliotheca Hertziana - Max
Planck Institute for Art History&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Website: https://www.biblhertz.it/&lt;/li&gt;
&lt;li&gt;Fotothek: https://fotothek.biblhertz.it/&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;AI Processing:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Model: Google Gemma 2 9B Instruct&lt;/li&gt;
&lt;li&gt;Infrastructure: KISSKI (GWDG Göttingen)&lt;/li&gt;
&lt;li&gt;Processing date: November 2024&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;License:&lt;/strong&gt; Please refer to the Bibliotheca Hertziana
for source data licensing terms.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id="quality-notes"&gt;Quality Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;AI-generated texts are meant to enhance discoverability and
accessibility&lt;/li&gt;
&lt;li&gt;Generated descriptions may contain inaccuracies or
interpretations&lt;/li&gt;
&lt;li&gt;Always refer to original structured metadata (&lt;code&gt;textobj&lt;/code&gt;,
&lt;code&gt;textfoto&lt;/code&gt;) for authoritative information&lt;/li&gt;
&lt;li&gt;Translations preserve meaning but may not capture all nuances of art
historical terminology&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Generated:&lt;/strong&gt; November 2024 &lt;strong&gt;Processing
location:&lt;/strong&gt; KISSKI HPC Cluster, GWDG Göttingen
&lt;strong&gt;Contact:&lt;/strong&gt; pietro.liuzzo@biblhertz.it&lt;/p&gt;