Case Study

Generating Historical Maps with AI: Custom Diffusion Models for an R&D Project

3x

faster model training

40%

improvement in image quality

20,000+

map-text pairs curated

Services provided

AI research and custom development

Fine-tuning diffusion models

Dataset engineering

About the Client

Client
Non-commercial organization
Industry
Historical Research / Generative AI
Location
Estonia
Company Size
10+ employees
Duration
4 months

The client is an innovative organization specializing in creating digital tools for visualizing historical events. Their goal is to develop a platform that enables users to generate precise maps of any historical period based on textual descriptions.

Challenge

Usually, standard diffusion models—such as Stable Diffusion—struggle with map generation:

~60

hours per week

a private equity agent spends for market research and networking

Inaccurate geographical borders

Artifacts and low detail

Incorrect representation of historical events (conquests, border changes)

Text prompt length limitations (up to 77 tokens)

Solution

The Anadea team joined the client as a full-cycle R&D partner, delivering a series of research initiatives, prototypes, and optimizations. We focused on adapting Stable Diffusion v2.1 for historical map generation.

/01

Custom Dataset

We compiled and curated a 20+K dataset of “historical map – description” pairs, including the LIT source, which contains over 80,000 images. For experiments, datasets ranging from 700 to 8000 examples were used.

/02

Model Training

The focus was on the U-Net component of the model architecture. We trained the model to better interpret textual prompts (e.g., “Europe in 1400” or “French borders in the 18th century”) and generate corresponding images with higher accuracy.

/03

Process Enhancement

By leveraging memory-efficient optimizers, modifying network structures, and implementing aggressive training strategies, we reduced model training time by at least threefold.

/04

Modular Approach

We developed a “maps-only” diffusion model concept—a network specializing exclusively in map generation. It allows eliminating distractions from other image types.

/05

Geographic Detailing

Separate experiments were conducted to generate maps at the province, region, and smaller-unit levels, achieving high precision at micro-scales.

/06

Stylistic Layer Design

We laid the architectural groundwork for future scalability—enabling maps to be generated with distinct thematic layers: borders, geography, culture, and languages.

Work Stages

Dataset Preparation

Creation of a "toy" dataset (1000-1800 AD) for initial experiments

Formation of "map-text" pairs (700-8000 pairs per experiment) with clear parameters: year, region, list of countries

Basic Experiments with Stable Diffusion

Generating maps by year ("Map of Europe in 1400")

Quality analysis: border accuracy, absence of artifacts, readability of country names

Dataset Preparation

Use of cropped map sections (768 x 768 pixels)

Training the model to display specific countries and their interactions

Manipulating Historical Events

Implementing prompts like "Country A conquered Country B"

Using Instruct Pix2Pix to edit existing maps according to historical changes

Working with Long Texts

Splitting texts into 77-token fragments

Integration of data from DBPedia (descriptions of battles, political shifts)

Training on Real Data

Filtering the WiT dataset: 80 000 historical maps and 4 million texts selected

Training Stable Diffusion 2.1 on the filtered data to improve generation quality

Process Optimization

Speeding up training by 3X using memory-efficient optimizers

Applying SuperResolution to enhance map resolution (up to 12288 x 12288 pixels)

Result Validation

Quality assessment using the LPIPS (Learned Perceptual Image Patch Similarity) metric

Comparison with standard Stable Diffusion (40% quality improvement)

Technologies

LPIPS
Stable Diffusion
LoRA
U-Net
CLIP
WiT Dataset (80,000 filtered historical maps)
DBPedia

Business Value & Outcomes

High Accuracy

Generation of maps with correct borders and readable country names.

Flexibility

Ability to adjust to any historical period (1000–1800 AD) and region.

Scalability

Reduced training costs and ensured potential integration with GIS systems (OpenStreetMap).

Prototype Development

The solution serves as a foundation for further development of educational, analytical, or visualization tools.

Need to validate an AI hypothesis or launch an R&D initiative?

We’ll help you shape, test, and implement an idea to help you attain the desired value!

Get in touch