# Byzantine Notation

*English translation by SOTA – AI Community of the Romanian original, published with the permission of Asociația Nitro. Organisers who would like this translation removed can email team@sota-ai.org.*

## Statement

Byzantine music is a genre of music with ancient origins, widespread in the Balkan region, with a history of more than a millennium. Its specific notation consists of a series of signs called neumes. The most important neumes are the vocal ones, which direct the singing in an ascending, descending or stationary manner along the tonal scale of the melody, with a meaning relative to the last note sung.

Implement an AI model that classifies the neumes in a sequence stored in an image, and use this model to produce a sequence representing, for each neume encountered, in the order in the image, the number of steps accumulated up to the current neume relative to the initial step (taken at the beginning of the sequence).

For training, you are given a number of labelled sample images of size 48 by 48 pixels, each representing a single sign.

The training dataset is a CSV file containing the following fields, with these meanings:
- `Path`: the path, relative to the working directory, at which the sample image is located.
- `Effect`: the label applied to the image at the address in Path, which can be an integer or a capital letter. If it is an integer, it also represents the number of steps by which the pitch changes as a result of the sign's effect. If it is a capital letter (`A` or `B`), then the neume represented has no vocal value and the pitch remains unchanged.

## Notes on the training dataset
* The samples in the dataset are taken from multiple printed works and manuscripts.
* Besides the typical differences between samples of the same sign, the training set contains a group of neumes of distinct shape that have the same effect (label).

## Notes on the evaluation dataset
* The evaluation dataset is a CSV file with two fields: `subtaskID`, whose value is always 1, and `datapointID`, which contains the relative path to the image representing the sequence of neumes to be recognised
* The neume sequences in the photographs are between 1 and 15 distinct signs long and are ordered from left to right.
* All the neumes present in the sequences to be recognised can be found in the training dataset.
* The images may contain small artefacts or visual defects, so they need to be preprocessed.

## Notes on the output data format
The output file is a CSV file and contains 3 fields:
  - `subtaskID`: always the value 1
  - `datapointID`: the relative path to the image representing the sequence of neumes, in the same order as in the training set (in other words, the value of the "Path" field)
  - `answer`: the sequence that was recognised, in the form of a sequence of integers separated by the character `|`, where each number represents the accumulated relative distance from the initial step up to and including the current sign.

### Example
For the following sequence:

# 𝁇𝁕𝁇𝁇𝁇𝁑𝁘 𝁇𝁑𝁑

the neumes have the *individual* tonal meanings: `1, -2, 1, 1, 1, -1, none, 1, -1, -1`.

and the sequence `1|-1|0|1|2|1|1|2|1|0` will be written in the output file.

**Attention:** The sequence above is rendered in Unicode. To view it in more detail, as an image, open `example-image.png` in the Starting Kit.

## Scoring
For each sequence in the output file, 1 point is awarded for correctly determining the *number* of neumes.

If the number of neumes is correct, 1 additional point is awarded for each correctly classified neume.

For example, if the expected output was `1|2|0|0|1` but the actual output is `1|2|0|2|3`, the score for this result is 5 (out of a maximum of 6).

The final score is the ratio between the total points obtained and the maximum possible total (3354), expressed as a percentage and rounded up to an integer.
