# Applying Automatic Translation for Optical Music Recognition's Encoding Step
## 2 Methodology  
Several approaches to obtain a digital score file from an image have been proposed so far [1]. When leaving aside any considerations of image processing and document analysis, and focusing on how the final standard notation encoding is obtained, two main approaches can be found: an end-to-end, image-to-semantics approach; and systems that produce an intermediate representation that needs to be converted into a standard format, such as the Music Encondig Initiative (MEI) [13,14], MusicXML [15] and \"_kern_[16]. In the first approach, a semantic format is obtained directly from an input image [17]. It has been shown that the main drawback of these methods is that they are very sensitive to distortion in input images. In the second approach, an intermediate representation that tries to explain the content of the score in terms of graphical elements is used. However,this graphics-based encoding needs to be converted to a standard music notation encoding. Meaningful examples of this category include that of [PERSON] et al. [18], where a notation graph is generated from a set of primitives, such as note heads, stems, beams and accidentals. Additionally, in [17], a simpler representation denoted as agnostic is used that consists of musical symbol sequences instead of considering their constitutive primitives. This approach has been shown to be more robust than the image-to-semantic one.  
This work focuses on the second phase of this latter approach: the translation between the agnostic encoding of single monodic staves into a standard semantic format, which is an extension of the **_kern_ encoding described and discussed below in Section 2.1. We expect that the lessons learned from this work can be adapted to other intermediate to semantic conversion approaches.  
Specifically, a sequence of symbols is extracted from the segmented image (Figure 1a), using any method. These are agnostic symbols characterized by a graphic glyph, such as accidental, rest, clef or note, and their vertical positions on the staff (see Figure 1b), and they do not have a direct and unambiguous semantic meaning. For instance, in the excerpt from Figure 1a, the second sharp is not assigned either the function of key signature, or an alteration of the next eighth note in the staff. They are just a sequence of two pitch alteration symbols detected at a particular vertical position, in this case the fifth line and the third space. The digit \"3\" found in the second part of the example image is labeled as a digit \"3\", and its actual meaning (it may be a numerator in a fractional time signature, or a triplet number in a triplet) will be assigned later when this representation is translated to semantic coding. The reader can find more detailed information about this agnostic encoding in [17; 19].  
Therefore, the task under analysis is the translation of this sequence of graphical symbols into a semantic encoding expressed as a standard music representation encoding.  
Figure 1: An example of the translation of the agnostic encoding corresponding to a common western music manuscript excerpt shown in (**a**) to a semantic encoding, see their representations in (**b**) and (**c**). Note how the meaning of the two accidentals after the clef is disambiguated into a G major key and an accidental of the first eighth note.  
The **_\"kern_ encoding is used in the example in Figure 1c and an extension of it will be considered as the output language for the approaches described below in Sections 2.2 and 2.3.