# Segmentation and Classification of Zn-Al-Mg-Sn SEM BSE Microstructure
## 1 Introduction  
Industrially used materials are characterised by various properties. One of the forms of their investigation is modern electron microscopy, which offers coded information about the investigated substance in the form of a microstructure. It represents the individual material phases or components, including their mutual relationships. One of the most important aspects in the field of micrography is the presence of contrast differences and their physical origin. Overall, microscopic relationships have their direct counterparts at the normal macroscopic level, which the user can assess as strength, susceptibility to corrosion, etc. It is therefore natural that the user tries to create an algorithm that would, if possible, automatically examine and decode the necessary information content of microstructures. Each such piece of information is largely unique in electron microscopy, and therefore, the algorithms used in practice have their own special features and success rates. It is usually necessary to consider the appropriate ratio between the time needed to acquire the input data and the time needed to create a method for these data, as well as the time for the actual processing and evaluation. Scanning Electron Microscopy (SEM)--The essential character of the image is determined by an electron gun, more specifically by the beam of electrons that this device emits. By setting the operational parameters of SEM, the operator controls the characteristics of the beam that interacts with the sample: energy, diameter, gun current, incident angle, etc. [1, 2]. The electrons from the beam interact with the atoms of the sample through a number of physical processes described as scattering. From these interactions arise backscattered electrons (BSEs), secondary electrons (SEs) and X-rays, which carry information aboutthe sample: topographical features, composition, crystal structure and local electric and magnetic fields [2; 3; 4; 5]. Different types of materials and different imaging modalities place different demands on the sample preparation, even before the sample is introduced into the microscope [1; 6; 7; 8; 9]. There is a general recommendation that efforts should be devoted to the acquisition of the highest-quality data and less data processing than the other way around [10]. Contrast mechanism--By scanning the emissions from the interaction of the incident electron beam on the sample, a grayscale image is created, which is characterised by the information with a certain contrast [5]. The successful interpretation of the information seen is conditional on understanding the physical events that gave a rise to it. The overall contrast is made up of the following components with a varying degree:  
* topographic contrast--dominantly the SE signal, which is more sensitive to the 3D topography of the surface of the scanned sample;
* composition contrast--dominantly the BSE signal, which is more dependent on the atomic number of the individual atoms in the sample;
* channelling contrast--electrons from the beam penetrate more easily along the crystal lattice than in a random orientation. The phase represents a homogeneous body of matter physically different from its surroundings in the investigated microstructure. Each pure metal solidifies with a specific crystal lattice while some of them, with a polymorphic nature, can also create different crystal structures on specific conditions (pressure, temperature). When pure metals are combined in alloys, additional crystal structures are formed in certain compositions and stable temperature and pressure ranges [11]. The microstructure of metallic materials is formed by the distribution and topological arrangement of the grains, phases, their interfaces and other defects in three dimensions. It is a direct result of the chemical composition of the alloy and the production procedure applied. This is most often represented in the form of heat, mechanical or chemical treatment [12; 13].