Morphological analysis of ballast particles: Characterization and simplified analysis of particle morphology using imaging data

This paper introduces a novel algorithm for the rigorous characterization of three-dimensional (3D) particles, particularly for railway ballast. Degraded railway ballast must be replaced with fresh material for efficient functioning. This study examined the shape and form of degraded (used) ballast to guide future maintenance efforts. Laboratory-generated used ballast, obtained via the Los Angeles abrasion test, was compared to fresh ballast. Thirteen fundamental morphological parameters of fresh and used ballasts were investigated by utilizing the shape information obtained through 3D scanning. The algorithm efficiently processed datasets comprising multiple irregular particles and monitored the morphological characteristics of ballasts based on the shape of the particles. The trimesh library was imported for 3D processing, facilitating the mathematical calculation of diverse parameters using the developed algorithm. The algorithm also incorporated mechanisms for simultaneously storing parameters provided in various 3D configuration models. With the support of the trimesh library, a morphology analyzer was used to analyze various 3D model file formats, such as .stl, .obj, and csg. This method demonstrated its efficacy with reduced runtime and computation cost. Thus, the proposed algorithm has emerged as a valuable resource for researchers investigating the influence of ballast particle shape on the mechanical behavior of granular assemblies.


Introduction
In the rail infrastructure, the ballast bed layer stands as a cornerstone within the intricate framework of the ballasted track system, assuming a pivotal role encompassing a spectrum of essential functions.Its foremost responsibilities include transmitting wheel loads from moving trains, providing resilience, absorbing energy and unwaveringly guarding the vertical, lateral, and longitudinal forces of track stability, facilitating an efficient track drainage mechanism, and preserving the structural integrity of the underlying track substructures.
The particles of ballast rail tracks can be classified based on the following three distinct morphological aspects: form, roundness, and roughness [1].In previous studies, these aspects provided a multilayered description of the shape of a particle, each offering unique insights [2][3][4].Importantly, we must note that roughness measurements are scale dependent, implying that the chosen scale corresponds to the problem under investigation.For instance, if the focus is on a microscale phenomenon, roughness should be assessed at the microscale level.This categorization of particle morphology, considering form, roundness, and roughness, provides a comprehensive understanding of the shape of a 1332 (2024) 012016 IOP Publishing doi:10.1088/1755-1315/1332/1/012016 2 ballast particle.Importantly, it exhibits significant implications for understanding the mechanical behaviors corresponding to particulate and granular assemblies [5].Moreover, using this categorization technique, a significant quantity of particles can be examined within a relatively brief duration, thereby facilitating a more extensive understanding of the deterioration of ballast particles [2,[6][7][8].
Furthermore, this classification system enables the creation of simplified particle shapes for numerical simulations.Numerical approaches such as the discrete element method and molecular dynamics can then employ these simplified shapes to characterize and analyze the mechanical behavior of particulate assemblies [2,[9][10][11][12].This analytical framework offers valuable insights for optimizing ballast rail tracks and predicting their performance under varying conditions.Typically, the ballast shape classifications are determined based on the ratios of the orthogonal dimensions of a ballast particle, which are classified as short (S), intermediate (I), and long (L).Particularly, the ratio S/I is employed to evaluate the flatness of the particle, whereas the ratio I/L indicates its elongation [13][14][15][16].According to the Zingg classification system, a particle is considered to be oblate if the S/I ratio is less than 2/3, signifying that the particle is flat, with its short dimension measuring less than two-thirds of the intermediate dimension.This classification system is widely used in academic research and practical applications owing to its simplicity and ease of use.It provides a direct means for categorizing and describing the shapes of pebbles and particles, making it valuable for various fields, including geology, materials science, and engineering [17] The investigation of particle shape characterization has been a subject of academic research since the early 20th century.Initially, researchers employed various shape indices to describe key morphological aspects of particulate materials, commonly based on two-dimensional (2D) images [18,19].However, the results of the 2D shapes are significantly affected by the selection plane for projecting real particles, limiting accuracy.In the previous 20 years, significant progress has occurred in this field, primarily because of the adoption of new experimental techniques such as micro-computed tomography, laser scanning [20], white light interferometry, and advanced algorithms that allow for the reconstruction of three-dimensional (3D) particle geometries from 2D images [16].Numerous research investigations have focused on the actual shape of ballast particles.Literature reviews indicate that laser scanning is the typical method that is predominantly used [8,16,21,22].These innovations have enabled more accurate and extensive investigations of particle shapes.However, the shape indicators suggested in the 20th century are clearly restricted in their scope.Consequently, various shape indicators have been recently proposed [23].Despite this, a lack of consensus remains within the scientific community regarding universally accepted shape indicators for the all-encompassing characterization of particles.
Previous studies have reflected a common approach in academic research regarding rail track ballast.Several prior studies have utilized photo or image-processing-aided particle modeling techniques for numerical simulations in railway engineering and track ballast analysis [2,22,24,25].These simulations help researchers to better understand the behavior of ballast materials under various conditions, such as train loading, vibrations, and track maintenance.Angelidakis et al. developed a software tool called Shape Analyzer for Particle Engineering (SHAPE) to automate the characterization of 3D particle shapes with precision [26].The software is designed to handle complex scenarios, such as analyzing thousands of irregularly shaped particles.It is versatile and can work with various input data formats, including segmented labeled images, surface meshes, tetrahedral meshes, or point clouds.Moreover, several researchers have also indicated that the simplification feature in SHAPE is the key feature based on desired shape descriptor values.This makes it well-suited for large particle assemblies and enhances shape characterization efficiency and accuracy in academic research, particularly, in materials science, geology, and particle physics.However, the limitations of high computational time and cost hinder the progress in this research.
In response to this challenge, the development of specialized software to calculate the primary shape indicators from diverse experimental methodologies has emerged as a potentially transformative tool.The morphological analysis of 3D models is a multifaceted task that is pivotal in domains ranging from biological studies to engineering applications.The complexity and diversity of 3D models necessitate a comprehensive, accurate, and efficient methodology.This paper proposes a sophisticated methodology that amalgamates automated, multi-core processing with the robust capabilities of the Trimesh and Numerical Python ("NumPy") libraries, ensuring a meticulous morphological examination of 3D models.The subsequent sections present the intricate steps and processes involved, emphasizing their coherence and symbiotic contributions to the overall efficacy of the methodology.This software is a valuable resource for researchers, allowing them to estimate shape indicators conveniently, quickly, and accurately for current and future particle datasets.
Over time, this approach will allow researchers to identify the most suitable set of shape indicators tailored to their specific particulate materials.Moreover, this software has the potential to significantly contribute to industrial applications, particularly, those that continue to depend extensively on 3-D image analysis.This software can enhance the understanding and optimization of materials used in various industries and achieve the accurate delineation of particle shape; the proposed software possesses the capacity to augment comprehension and improvement of materials that are employed in diverse sectors, such as ballast rail track construction and maintenance.

Methodology
This research concentrated on developing a specialized software to calculate the primary shape indicators from diverse experimental methodologies, which can emerged as a potentially transformative tool.It allows the convenient and accurate estimation of shape indicators for current and future particle datasets.Figure 1 illustrates an overview of the sequential phases involved.The initial step involves the creation of data of 3D ballast particles through 3D scanning, excluding diminutive particles (< 9.5 mm).The 3D visual representation data were subsequently analyzed using the Blender software to set the geometrical position and capture the surface morphology.The multithread Python method was utilized to generate the software to assess the morphology of the ballast granules.Finally, the data of the ballast granule morphology was analyzed using the proposed ballast morphology analysis (BMA) software.

Material properties and preparation
The material under investigation was obtained from the ballast stockpiles of the Chiang Mai main line operated by the State Railway of Thailand.The parent rock of this material is granite, with a material density of 2921 mg/m 3 and bulk specific gravity of 2.92, which is referred to as fresh ballast.During the ballast preparation, all ballast materials were washed, oven dried, and cooled at room temperature.Next, blending and quartering methods were employed to properly prepare the ballast material for testing.For the sieving analysis test, the ballast material was subjected to three separate weights of 100 kg each, based on the ASTM C136 standard, to determine the particle-size distribution.
Based on the recommendations of Kwunjai et al., the degraded ballast examined in this study was obtained by milling the fresh ballast material in the specific milling machine employed in the Los Angeles abrasion (LAA) tests [23,27,28].A sample of 10 kg of the ballast material was placed within a rotating drum containing 12 steel balls, with a particle-size range of 31.5-50mm, as per the guidelines outlined in the ASTM C535 standard.All particles were washed, dried in an oven, and finally cooled in ambient air.However, in a variation from previous research, this study incorporated multiple repeated loads (more rotations) over an extended duration to observe the fouling effects of the material more comprehensively.Upon completion of a specific number of LAA tests, the ballast material underwent sieving to determine the fouling index and particle-size distribution [6,23].The degree of fouling in the ballast was evaluated based on the weight percentages of the ballast sample that passed through two different sieves: 4.75 mm (No. 4) and 0.075 mm (No. 200) sieves, which is referred to as the fouling index (FI) [29].The testing process was repeated in a laboratory until FI value > 40% was measured [29] and the tests were performed thrice.This outcome indicates that the ballast condition exhibited a high level of fouling, necessitating track maintenance.Figure 2 shows the deteriorated ballast after 3,000-3,500 rounds in the LAA testing process.The degraded ballast conditions exhibit a high confidence level (FI > 40%).This ballast that was obtained after 3,500 rounds of LAA is referred to as "used ballast" [15,30].The particle-size distribution curve of the fresh and degraded ballast particles in this study were compared to the American Railway Engineering and Maintenance-of-Way Association standard of ballast gradation, as shown in figures 3 and 4.

Morphology and degradation evaluation
The performance of granular materials such as sands, rock fills, and railway ballast is influenced by various factors, including particle morphology, encompassing both size (particle-size distribution, volume, surface area) and shape (form, angularity, surface texture).However, traditional approaches for assessing particle morphology have proven inadequate, resulting in inconclusive test outcomes.In contrast, advanced image analysis techniques offer a more precise means of evaluation, incorporating parameters such as particle-size distribution, volume, surface area, form, angularity, and surface texture.Furthermore, note that ballast degradation also impacts both the performance and deformation [16].The use of image analysis techniques is also beneficial for assessing the decline in particulate substances, relying on morphological parameters to quantify alterations in dimensions, structure, angularity, and surface characteristics.Furthermore, 3D deterioration evaluation methodologies provide encouraging approaches for evaluating ballast degradation.

Image processing preparation
The image analysis methods used in this study are based on static image analysis, which analyzes images of particles in a stationary position.To avoid both the significant amount of effort related to the 3D scanning of the 110 ballast particles and the common errors associated with such measurements, an automated digital measuring tool was developed in the Python environment.This tool could determine dimensions, including maximum, I, and S dimensions, as well as volume, surface area, and sphericity.The procedure for this method is as follows.In the initial stage, the 3D image processing machine was established and the EinScan-SE scanning software was calibrated.Subsequently, the particle was secured at the reference point system to acquire the 3D coordinate values of the point cloud of the particle.The scanning process with the camera was performed using a turntable with eight steps and a speed of 10, completing one full rotation from 0° to 360° with a precision of 0.1 mm, as shown in figure 5. Note that capturing a large number of points results in a more precise 3D model.Laser scanning technology created a detailed 3D representation of ballast particles, producing mesh and surface data.A triangular mesh representation was employed, with automatic gap filling using point cloud interpolation.The resulting 3D model could be saved in different formats such as STL and OBJ for calculations and simulations.
The initial preparatory phases can profoundly influence every analytical procedure.In the context of 3D model analysis, the preparation stage involved the meticulous organization and optimization of 3D models.These models, often stored in .objor .stlformats, were systematically organized to ensure compatibility with the automated multi-core processing environment.Each model was rigorously inspected to certify its readiness for subsequent stages, ensuring the identification and rectification of potential anomalies.The Blender application, an open-source software, was used to position the ballast particles and set up the STL file for subsequent analysis [30].

Three-dimensional morphology analysis
The software code consisted of two primary components: characterization and simplification of particle shape.The latter component also has the objective of validating the data result.Furthermore, a supplementary module was designed to offer utility functions that compute the geometric properties of the ballast particles and perform fundamental geometric transformations with multi-core processing integration.

Software architecture
Figure 6 shows the architectural characteristics of the BMA software.The code can incorporate image data of a particle, which can be in the form of a point cloud, surface, or tetrahedral.The geometrical properties of a particle can be determined by calculating various parameters, such as the centroid, radius, volume, surface area, inertia tensor, and center of the inscribed and bounding spheres.To simplify the particle shape, mesh-reduction techniques were employed, preserving the geometrical characteristics and achieving a matching volume through an isochoric transformation.

Sphere-fitting algorithm
A cornerstone of morphological analysis is the sphere-fitting algorithm, which embodies the integration of mathematical precision and computational efficiency.This algorithm uses the least squares method to calculate the optimal sphere encapsulating each 3D model.The resultant sphere-fitting data forms the bedrock for extracting intricate morphological features, unveiling insights into the geometric and spatial attributes of the models.The preliminary stage entails the application of the trimesh library to import 3D models from designated file paths, thus making them ready for subsequent analytical methodologies.An intricately designed code was released, meticulously designed to analyze each model, revealing its inherent morphological characteristics.Numerous file formats, including .obj and .stl,are compatible and can be seamlessly integrated into the analytical framework.

Incorporation of trimesh
The "trimesh" library is a pivotal component known for its adeptness in loading, processing, and analyzing 3D triangle meshes.Each model is loaded, and its geometric computations and oriented bounding boxes are precisely calculated, laying the groundwork for an in-depth morphological analysis.It offers simplicity and efficiency, making it an invaluable tool for analyzing the source code of this study for 3D models.In the provided source code, the source code of trimesh is instrumental for loading the 3D models, calculating their morphological features, and handling geometrical computations.
The operational mechanism of trimesh is as follows.In the initial phase, the trimesh library is used to load 3D models from designated file paths, thereby preparing them for subsequent analytical procedures.Multiple file formats, including .obj and .stl,are accommodated for a seamless integration to the analytical framework.Following model loading, the trimesh library is pivotal for conducting intricate geometrical computations on the loaded 3D models.This encompasses the determination of volumetric metrics, surface areas, and other geometric attributes essential for a comprehensive understanding of the spatial characteristics of the model.Moreover, the bounding box calculation of the particle, a crucial aspect of the computational process, involves the application of trimesh to calculate the oriented bounding box associated with the 3D models.This bounding box computation is indispensable for extracting precise dimensions and other morphological features that are vital for subsequent analyses and simulations.However, although the trimesh library can visually represent 3D models, this feature remains untapped in the provided source code.Despite its accessibility, the visualization element is presently omitted from the codebase, thus highlighting a possible avenue for future improvements or alternative framework implementations.Trimesh plays a crucial role in morphological analysis by indirectly supporting sphere fitting by extracting vital vertices and coordinates.Furthermore, it excels in feature extraction, calculating metrics such as volume and surface area to unveil essential morphological characteristics such as sphericity and convexity.Figure 7(a) illustrates a simple line of code demonstrating the use of trimesh in loading 3D models, emphasizing its user-friendly nature for researchers engaged in morphological analyses.

Computational details and NumPy integration
NumPy was integrated into the trimesh framework to enhances its mathematical precision and computational efficiency.This collaboration was achieved by the adept management of an array of experts, robust mathematical operations, and the optimization of geometric calculations.From the process of sphere fitting to morphological feature extraction, this alliance ensures unparalleled accuracy and speed, ensuring the precise analysis of 3D models and enhancing the speed of completion.NumPy, an influential library for numerical computation in the Python programming language, offers extensive assistance for arrays, including multidimensional arrays, along with a diverse array of mathematical functions that are designed to manipulate these arrays.When employed within the context of source code, NumPy effectively enables the execution of computationally efficient operations that are indispensable for morphological analysis.
Among the computational processes, NumPy performs a pivotal role in managing and manipulating arrays, which are of utmost importance for storing vertices and other crucial data points of the 3D models.Moreover, this library offers an array of functions that cater to various mathematical operations, thereby facilitating calculations involving norms, means, and an array of other statistical and geometrical computations.The role of NumPy within the working mechanism is multifaceted, encompassing various array operations.The proficiency of NumPy lies in its ability to perform both element-wise and matrix operations, thereby ensuring efficiency, particularly, in largescale computations.Similarly, NumPy plays a crucial role in statistical computations by enhancing the precision in the analysis of morphological features as it is employed for significant statistical metrics such as mean and standard deviation.Furthermore, the involvement of NumPy in geometrical computations facilitates the management of coordinates and vertices, making it indispensable in geometric calculations, including distances and areas.This cohesive functionality significantly enhances the overall analytical capacity for understanding morphological features.
Figure 7 illustrates sample BMA code functions and libraries, demonstrating the simplicity of the proposed approach and its optimized support for various formats.The integration of NumPy in the source code can aid in computing the norm, mean, and other necessary calculations to fit a sphere to the vertices of the 3D model.The morphological calculation features involve the proficient management of the necessary mathematical operations.This library facilitates the computation of features such as elongation and flatness.For example, in the provided Python code, the residual is derived by subtracting the radius from the norm of the points subtracted by the value of the center, showcasing the proficiency of NumPy in evaluating the norm, which is a fundamental component of the sphere-fitting algorithm, as shown in figure 7 (b).

Integration of multi-core processing
The incorporation of multi-core processing, which is concomitant with parallel processing, emerges as a salient feature within the framework of this methodology.This dual integration significantly distinguishes the proposed approach, enhancing computational efficiency and bolstering its analytical attributes.This approach leverages the concurrent features of Python, which empower concomitant and comprehensive analyses of individual 3D models.This strategic use of Python programming enhances the efficiency in conducting simultaneous and thorough examinations for each model.This feature guarantees the accurate retrieval of morphological data, boosting the speed, efficiency, and precision of data processing.The data recording and output are built-in automated recording systems that ensure that the extracted data is methodically documented, structured, and saved.In a multi-core setting, this system protects data integrity, ensuring that the data from each core is precisely documented and stored.
This methodology integrates trimesh, NumPy, and multi-core processing, a new area frontier in the analysis of 3D model morphology.The exhaustive and meticulous analysis of each model results in data characterized by precision and systematic recording, accompanied by visual representations for enhanced comprehension.Moreover, owing to its adaptability, this methodology is suitable for a wide range of domains.It may be an alternative solution for 3D granular-material shape analysis, such as ballast rail track.Moreover, the utilization of multiple processing nodes within the software contributes to a reduction in analysis time.

Ballast particle characterization
The image analysis process can precisely measure the shape of particles; however, room for improvement still exists in terms of assessing the size and addressing the research gaps.Several researchers have suggested various approaches to quantitatively analyze the shape of particles, which have conventionally involved examining the outlines of particles using 2D spectral analyses.Although numerous morphological attributes have been suggested in previous scholarly works, the parameters of elongation, flatness, convexity, sphericity, and roughness have been frequently employed in related investigations.The feature indices primarily pertain to the fundamental geometric measurements, which typically encompass the length and width of an object, such as elongation, which is precisely defined in equation ( 1) by representing the shortest and longest axes of the minimum bounding box of the particle as the intermediate to longest dimension ratio (I/L).In this study, the following formulas were considered: convexity is the ratio of the volume of the convex hull of the particle to the actual volume of the particle, sphericity is calculated based on the volume and surface area of the particle, roundness is determined based on the average distance between the fitted sphere and surface of the model, normalized by the radius of the fitted sphere, and aspect ratio is calculated as the ratio of the longest dimension of the particle to its shortest dimension.

Roundness= Long mean distance between fitted sphere and surface
Intermediate Radius of fitted sphere (5)

Aspect ratio=
Longest dimension Shortest dimension (6) The angularity index is calculated as the ratio of the volume of the particle to the volume of its bounding box.The volume of the bounding box is calculated from its dimensions.A bounding box is a box that encloses the 3D model and is aligned with the coordinate axes.The volume of the bounding box is calculated as Vbounding box=width × height × depth, where the width, height, and depth of the bounding box are along the x-, y-, and z-axes, respectively.10 Angularity = V particle V bounding box (7) Each formula corresponds to a specific aspect of the geometric or morphological properties of the 3D model.Adjustments and refinements can be made depending on the specific requirements and constraints of the analysis.The existing techniques for analyzing morphology employ Fourier and spherical harmonic transforms.However, these particular transformations are limited to stationary signals.Therefore, the use of time-frequency analysis methods would be more appropriate when examining nonstationary signals in characterizing irregular particle morphology [31].The empirical mode decomposition (EMD) technique is utilized in signal processing to analyze nonstationary and nonlinear data as well as for wildly irregular particle morphology analysis [32].EMD breaks down signals into intrinsic mode functions representing various scales.The EMD method has been modified to effectively address surface fluctuations in irregular particles.A methodology has been devised to convert the 3D surface fluctuations of particles into 2D spherical images for analysis.Particularly, it emphasizes the issue of boundary distortion caused by disparities in the Gaussian curvature.The EMD algorithm was adjusted to accommodate the characteristics of spherical surfaces, considering the principles of EMD and the distinct attributes of irregular particle morphology.The radius corresponding to each direction of the 3D particles can be represented on a sphere through mapping.This enables the transformation of surface fluctuation into a 2D spherical image.By utilizing 3D scanning, the the particles were accurately reconstructed.The contour of the radius, originating from the center of gravity, was then mapped onto the sphere.This study used surface mapping to validate the BMA software.Moreover, when utilizing 3D data for examining ballast morphology, open-source software were used to assess the fundamental architectural attributes of SHAPE using MATLAB algorithm [26], drawing comparisons with the features of the BMA software used in this study.

Image processing
This investigation employed surface mapping to confirm the legitimacy of the BMA software.The mapping of particles to a spherical shape entails a series of steps.First, the total number of corners (N) and great-circle distance (Gc) between two corners of the particle were established.A data-adaptive spatial filtering method, such as the spherical method, was then implemented.This method offers greater accuracy and efficiency when mapping particles to a spherical shape.Finally, the effectiveness of the mapping technique was assessed via ballast particle morphology analyses of an ellipsoid [31] using the BMA model.The process involves representing the radii of 3D particles on a sphere through mapping, thereby converting surface fluctuations into a 2D spherical image.This transformation is facilitated by 3D scanning, achieving the actual reconstruction of particle structures.The resulting contour of radii emanating from the center of gravity was then accurately mapped onto the sphere, providing a comprehensive visualization of the spatial distribution of the particles.Figure 9 shows that the 3D model obtain via surface mapping validates the effectiveness of the mapping technique by conducting particle morphology analyses of a ballast using BMA simulants similar to an ellipsoid with this attribute.

Characterization of ballast particles
The BMS software used the terminal or command line with Python to execute Python scripts of 3D particles.The algorithm was designed with the capacity to concurrently store parameters from diverse 3D configuration models.It can simultaneously analyze 13 morphological parameters of ballast particles.Figure 10 illustrates the execution of the terminal for simultaneously running a 3D ballast simulation involving 110 particles.This figure reveals detailed information about the 3D particles, encompassing the morphology, dimensions, volume, faces, and runtime.The obtained results include the intermediate, shortest, and longest boundary box dimensions.Moreover, the analysis provided indicator indices for particle characteristics such as elongation, flatness, convexity, sphericity, roundness, aspect ratio, angularity, and roughness.Furthermore, the output includes the positional data of each particle along the X-, Y-, and Z-axes, featuring details such as radius, Principal Axis 1, Principal Axis 2, and Principal Axis 3 in a CSV file.
The ballast 3D files were analyzed using the proposed BMA mtechnique and the SHAPE method suggested by Angelidakis et al.The analysis involves comparing the SHAPE method to automate the precise characterization of 3D particle shapes [26].The proposed BMA required some time to initiate and complete the process, averaging to 2 s per sample.For instance, the processing runtime was 0.0214 s for normal execution fixes and 0.863 s for vector checks.The computational efficiency of the implemented solution surpassed that of MATLAB when processing an identical sample (more than one hour per sample).The reduced runtime signifies superior performance in terms of execution speed, presenting a noteworthy advancement in the proposed methodology.Furthermore, the result derived from MATLAB software to evaluate the essential morphology of ballast particle was compared with that of BMA software, as shown in figures 11 and 12.The result of the morphology data for the analysis of ballast morphology enabled a comparison with the attributes of the BMA software utilized in this study.A particle with a perfectly spherical shape has an elongation value of zero, whereas a more elongated or flattened particle exhibits a higher elongation value.Observations of fresh and used ballast, as shown in figures 11 and 12, indicate that both BMA and MATLAB exhibit a uniform elongation, flatness, convexity, and sphericity distribution.Furthermore, the values of elongation were practically indistinguishable.The distribution of the elongation, flatness, convexity, and sphericity index is shown in the figures, indicating that the distribution is relatively uniform for both software.Notably, the index of the ballast trend is similar.Although a difference in value exists, which is exemplified by the used ballast particles demonstrating a flatness index approaching one, the sphericity index for fresh ballast is notably below 0.7, indicating a high degree of irregularity.In accordance with the morphological classification proposed by the Zingg diagram [17], the particles were categorized based on their morphology.Figure 13 illustrates the morphology of all selected particles through a modified graph.The diagram shows that most particles were initially classified as equant or sub-equant.However, in the overall morphology analysis conducted by BMA and MATLAB, an approximate level of particle classification heterogeneity was maintained.This classification ranges from moderately elongated and moderately flat to non-elongated and non-flat and from significantly non-equant to equant.
Figure 14 illustrates a morphological comparison between fresh and used ballast particles using the BMA software.The software provides multiple index characteristics, demonstrating its capability to analyze simplified depictions of 3D particles based on imaging data.For example, this study employed techniques such as surface profilometry and roughness parameters.The quantification of these parameters is commonly conducted in micrometers or nanometers.Surfaces that exhibit a high degree of smoothness with minimal irregularities can be classified as having low roughness.This can be discerned through the utilization of lower roughness values, as illustrated in the case of the ballast material shown in figure 14.Typically, researchers in railway engineering might establish specific criteria for angularity based on higher angularity values that may indicate a more angular or jagged shape.Conversely, particles with rounded or smooth contours that lack sharp corners tend to have lower angularity values, indicating a shape that is more rounded or smooth (which is referred to as low angularity).This study proposes an efficient geometric analysis method through direct computational techniques for a quick assessment of ballast particle morphology.These simplified techniques are suitable for providing rapid insights in preliminary research.In contrast, Xiao et al. [33] explored ballast morphology through deep learning.They employ advanced statistical and machine learning techniques for detailed engineering applications, aiming at comprehensive simulations to enhance the realism of ballast scenarios [33].

Conclusion
The study examined the fundamental morphology parameters of both fresh and used ballast materials.By utilizing shape information obtained through automated and rigorous 3D scanning algorithms, samples containing irregular particles were accurately processed.The results obtained using the proposed BMA and MATLAB models were compared.The following conclusions were drawn: 1. Morphological analysis of ballast particles is pivotal in the context of granular assemblies.
The versatility of the algorithm is showcased by its ability to seamlessly process a variety of 3D model file formats, enabling the precise and efficient extraction and analysis of 13 distinct morphological parameters.
2. The innovation portrayed by this algorithm is accentuated by its adaptability, providing researchers with the flexibility to adjust the degree of simplification in particle representation.This is instrumental in ensuring the analyses are contextually aligned and tailored to meet the specific nuances and requirements of diverse research paradigms and industrial applications.
3. One of the defining attributes of the algorithm is its capacity to adeptly handle multiple formats when executing geometric calculations and mesh-reduction techniques, and this underscores its potency as a universal tool for granular assembly analysis.

4.
The BMA algorithm provides a streamlined and efficient approach, significantly reducing the runtime and computation costs.These simplified and logical processes make it a valuable resource for researchers studying the morphology of particles.The proposed method is relatively simple, involves low computational effort, and can be applied to different types of particles.
This algorithm is a testament to the synergy between computational efficiency and analytical precision.The goal was to analyze particle morphology via BMA using imaging data related to ballast shapes.This will allow researchers to identify shape indicators, facilitating the development of coding for specific equations.However, the utilization of 3D files is restricted to high-resolution files, and challenges may arise in cases of low-resolution or inadequate data filtering.The next stage in this research initiative entails laboratory experimentation through largescale triaxial testing.Consequently, the ballast morphology must be precisely ascertained both before and after testing, serving as an essential prerequisite for the comprehensive analysis of ballast particles.This software exhibits the potential to make a significant contribution.It is poised to significantly contribute to the evolution of design and maintenance protocols, heralding an era of enhanced accuracy and innovation in the academic and industrial spectrums of granular-material studies.The insights gleaned through this algorithm are expected to enrich the existing body of knowledge and catalyze the advent of optimized and sustainable practices in related fields.

Figure 1 .
Figure 1.Flow chart of the methodology.

Figure 2 .
Figure 2. Increase in the fouling index (FI) value with the increase in the number of Los Angeles abrasion (LAA) tests.

Figure 3 .
Figure 3. Gradation properties of fresh and used ballast materials

Figure 4 .
Figure 4. Samples of fresh (FI=0) and degraded ballast (used ballast) based on the LAA test (FI ≥40%) conducted for the materials obtained from Chiang Mai, Thailand.

Figure 7 .
Figure 7. Example functions and libraries of Python code in BMA.

Figure 8 .
Figure 8. Schematic for the connected portion of the particle.

Figure 10 .
Figure 10.Terminal for running Python scripts with BMA.

Figure 11 .Figure 12 .
Figure 11.Analysis of fresh ballast particles using BMA and MATLAB

Figure 14 .
Figure 14.Sample results of morphology indices between fresh and used ballast obtained using BMA

Figure 13 .
Figure 13.Morphological classification of particles using BMA and MATLAB.