C3

derAIled

rAIlify is a challange pitched by Siemens at the 2024 BaselHack

Demo

rAIlify

rAIlify is a challenge pitched by Siemens at the 2024 BaselHack.

Logo derailed

Task of Challenge (User Story)

As a railway engineer at Siemens Mobility, I want to utilize a digital node-edge model of my railway network. Unfortunately, information gets delivered in old school vectorized PDF and TIFF formats. I’m far too lazy to manually engineer that huge variety of visual data.

Help me to recognize tracks, switches , signals, annotations and other entities and to arrange them in a standardized model for my work. Bring us on the engineering fast track when we e.g. have to modernize interlockings or determine optimized and safe routes through the rail network. This is much more than just image recognition! The real challenge lies in the variability of how plans are drawn and how information is arranged.

My vision is to use the extracted topology data as input for further sophisticated railway solutions. To have a digital model that spans the entire engineering process and life cycle.

Workflow Diagram

Workflow Diagram

Team Members

  • Amar Tabakovic
  • Johannes Casaburi
  • Adrian Altermatt
  • Zora Fuchs
  • Sarah Rebecca Meyer
  • Patrick Schwartz
  • Noah Grun

Setup

Visualiztion

Requirements

installation

  1. Navigate to visualization folder: cd code/visualization
  2. Install libraries: bundle install

Run

The application can be run with multiple files. The results will be stored in the output folder.

  • Run application: ruby visualizer.rb path/filename1.json path/filename2.json ...
  • Run with given example files: ruby visualizer.rb input/example.json input/tiefengrund.json

Input / Structured Data Structure

The following data structure is expected out of the image analysis. It is used for forming a graph data structure that can easily be visualized and be used for further processes. Nodes are fixed points on the tracks, edges are tracks connecting two nodes and objects are any objects that are objects that are not directly connected to the tracks on the plans. There can be multiple of each type.

[
  {
    "type": "node",
    "uuid": "1111-1111-1111",
    "originX": 10.0,
    "originY": 100.0,
    "width": 1.0,
    "height": 1.0,
    "element": "Radzähler",
    "name": "ZP1",
    "parents": []
  },
  {
    "type": "edge",
    "uuid": "1212-1212-1212",
    "originX": null,
    "originY": null,
    "width": null,
    "height": null,
    "element": "Gleisabschnitt",
    "name": "100",
    "parents": ["1111-1111-1111", "2222-2222-2222"]
  },
  {
    "type": "object",
    "uuid": "cccc-cccc-cccc",
    "originX": 70.0,
    "originY": 70.0,
    "width": 1.0,
    "height": 2.0,
    "element": "Mainsignal",
    "name": "B2",
    "parents": ["1111-1111-1111"]
  }
]

Output

Visualized Graph Example

Sliding Window Approach

One challenge we needed to handle was detecting symbols across a large, high-resolution image. YOLO models are typically designed for object detection on images with 640 x 640 dimensions. Since railway plans can be significantly larger than the standard input size, containing intricate details spread across a wide area, downsizing that image to a 640x640 format led to a worse recognition of the symbols by our algorithm.

Using a sliding window approach allowed us to systematically scan the large image, splitting it into smaller, manageable segments that matched the input size required by the YOLO model. We used a window of 640 with a stride of 320. Each window was then analyzed separately, ensuring that small and detailed features present in the image are captured. Without the sliding window approach, it would have been challenging for the model to accurately identify small or densely packed symbols in the high-resolution image, as downscaling would likely lead to loss of crucial information.

This allowed us to maximize object detection without compromising the ability of the model to recognize fine details across a large-scale image.

Extra Challenge

We ran our detection algorithms on the extra challenge that was available at 11am. To compare, we ran the same model once without the sliding window approach and once with it. This were the results:

Without the sliding window approach, the following symbols were recognised in the first page of the extra challenge: 2 radzaehlers, 2 tracknumbers, 1 weiche

Extra 1 Before

With the sliding window approach, these symbols were recognised:

2 radzaehlers, 6 tracknumbers, 1 weiche

Extra 1 After

9 trackjoints, 9 tracknumbers, 10 weiches

Extra 2 Before

15 radzaehler, 17 trackjoints, 14 tracknumbers, 21 weiches,

Extra 2 After

1 trackjoint, 2 tracknumbers, 2 weiches

Extra 3 Before

6 radzaehlers, 6 tracknumbers, 9 trackjoints, 1 weiche

Extra 3 After

This content is a preview from an external site.
 

Repository updated

2 months ago ~ loleg

Project

Event finish

Merge pull request #12 from 513-3-5/readme-with-screenshots

More text and fix image (@zorafuchs)

More text and fix image (@zorafuchs)

Merge pull request #11 from 513-3-5/readme-with-screenshots

Readme with screenshots (@zorafuchs)

Change text a bit (@zorafuchs)

Change json a bit (@zorafuchs)

Add information about image analysis (@zorafuchs)

corrected image2 (@Sarah)

corrected images (@Sarah)

Merge pull request #10 from 513-3-5/network-topology-recognition

Network topology recognition (@AmarTabakovic)

extrachallenge docu (@Sarah)

Minor changes (@Amar Tabakovic)

added images of extrachallenge (@Sarah)

Added sliding windows code (@Adrian Altermatt)

Merge branch 'main' into network-topology-recognition (@Amar Tabakovic)

Minor changes (@Amar Tabakovic)

Generate json from parsed railway plan (@Amar Tabakovic)

Merge pull request #9 from 513-3-5/feature/readme-instructions-for-visualization

Merge pull request #8 from 513-3-5/feature/visualization-refactoring (@zorafuchs)

Merge pull request #8 from 513-3-5/feature/visualization-refactoring

Have input files in a separate folder (@zorafuchs)

Have input files in a separate folder (@zorafuchs)

Merge pull request #7 from 513-3-5/feature/objects-in-graph

Feature/objects in graph (@zorafuchs)

Change style of nodes (@zorafuchs)

Refactor and align track graph independently of objects (@zorafuchs)

Add related object to graph (@zorafuchs)

Clean up network topology recognition (@Amar Tabakovic)

Merge branch 'main' into network-topology-recognition (@Amar Tabakovic)

WIP network recognition (@Amar Tabakovic)

Präsentation added (@Adrian Altermatt)

Merge pull request #6 from 513-3-5/feature/tiefengrund

Feature/tiefengrund (@zorafuchs)

Add manually written tiefengrund json and enable script to accept params of the files to convert (@zorafuchs)

Add json for tiefengrund plan (@zorafuchs)

Merge pull request #5 from 513-3-5/features/schwarzarbeit

Features/schwarzarbeit (@zorafuchs)

Use graph library for visualizing json (@zorafuchs)

Adapt dataflow diagram (@noahgrun)

convert pdf to png implemented (@noahgrun)

Added YOLO and some documentation (@Adrian Altermatt)

Add new json format example (@zorafuchs)

Add dependencies for graph handling (@zorafuchs)

Add basic graph functionality (@Schwarzarbeit)

Merge pull request #4 from 513-3-5/feature/datastructure

Adapt to new standard (@zorafuchs)

Adapt to new standard (@zorafuchs)

add bg (@tmp32t)

Update dataflow diagram (@noahgrun)

Update img sources (@noahgrun)

update readme (@noahgrun)

new logo (@noahgrun)

Add logo (@noahgrun)

Open PDF directly when generated (@noahgrun)

Start

 

The application that powers this site is available under the MIT license.