## 1 Introduction: State of the Art
### Surfaces Roughness Modelling and Prediction  
Various experimental studies aimed at deepening the knowledge on the phenomena and relationships occurring during machining processes are increasingly supported by mathematical modelling and computer simulation. This includes the analysis of the surface layer quality of workpieces. Different models may be employed for the prediction of surface roughness data after machining. Equipped with the dependable results from these simulations, engineers may set the parameters of machining processes with a higher certainty of obtaining the desired surface texture. Mathematical modelling was, e.g., employed by [PERSON] et al. [29] to produce 3D area topography after helical milling. The model accounted for such factors as the tool eccentricity, the secondary cutting, and the effect of size. [PERSON] [30], on the other hand, developed a geometrical model for the prediction of the surface topography in flank-milling with the use of circle-segment end mills. The analysis considered the tool geometry, the feed rate, the radial immersion, and the tool run-out. [PERSON] and [PERSON]'s model [31] served to determine the Ra of the surface following milling, thus aiding the correct specification of machining parameters as per the desired properties of surface roughness. The model of the Polish scholars is also similar to other models by sharing the key problem, the inaccuracy of predictions, resulting from the included simplifying assumptions. The result is the discrepancy between the modelled and actual surface roughness parameters, which may produce a 1.5 to 5 times lower prediction. The machining process is highly complex, involving numerous random factors, and therefore it is difficult to obtain fully accurate simulation results. Given the inaccuracies, new artificial network-based models of machining processes began to emerge. They implemented the experimental models, thus providing superior precision of predictions and representation of the characteristics of machining processes. ANN prediction models are employed in numerous works, e.g., by [PERSON] et al. [32], who determined optimum machining parameters from the perspective of minimizing the surface roughness. The genetic algorithm (GA) was also used in the study. Neural networks' performance is further confirmed in predicting surface quality and optimization of process parameters [33], machining performance [34], or the cutting force and vibration [19]. The use of ANNs is by no means restricted to the cases listed in the preceding paragraph, as they are used, e.g., to model the surface roughness in turning. Several examples of such applications can be given, e.g., the model for predicting the surface roughness of AISI316 stainless steel following low-speed turning based on multiple linear regression and ANN by [PERSON] and [PERSON] [35]; empirical models for tool life, surface roughness, and cutting force determination in turning [36]; or the implementation of Edgeworth-Pareto optimization of ANN in the prediction of the surface roughness (Ra) of a component subjected to CNC turning over a minimal machining time and at the prime machining cost [37]. Based on the analyzed literature, it appears that extending the scope of investigations to include a greater number of surface roughness parameters allows a deeper insight into the condition or utilitarian features of surfaces, including, e.g., its fatigue strength characteristics. Therefore, the study reportedin this paper employed 2D roughness parameters (Rz, Rku, Rsk, RSm, Ra) and 3D area roughness parameters (Sa, Sz, Sku, Ssk) to describe in detail the surface of AZ91D and AZ31 magnesium alloy substrates after trochoidal milling and brushing. The choice of the workpiece material followed the preliminary search of the literature, which revealed few studies on the machinability of Mg alloys using the trochoidal path and brushing.