Estimating carbon content in crucible steel using image analysis

: Pre-industrial crucible steel ingots, produced in both Central and South Asia, are an important class of iron-carbon alloys. Their microstructure reflects their formation from a liquid alloy at a carbon content of 1.0–2.5wt%, which is higher than most mild steels but lower than most cast irons. This article introduces a tool to quantify the carbon content of such alloys based on an operator-supervised image analysis which determines the relative proportions of austenite/pearlite and cementite, respectively, from high-contrast back-scatter electron images of un-etched samples. Using examples from a recently discovered hoard of crucible steel ingots in Telangana, south-central India, we demonstrate the capabilities of the tool and test its usefulness. The main benefit is in improving accuracy and precision in metallography-based carbon content determination in such alloys by reducing the uncertainty in area estimation in complex microstructures based on visual impression alone.


Introduction
The production of crucible steel was a major industry spanning most of the second millennium CE, first in Central and then in South Asia, where it was known as pulad and wootz, respectively.During the 18th and 19th centuries, the study of crucible steel ingots imported from India spurred significant developments in early modern metallography and steel-making technology in Europe.Despite this, very few of these original crucible steel ingots are currently known to be preserved in major collections, and few studies of their metallography have been published.Crucible steel ingots, typically high carbon alloys of iron, are generally thought to be hypereutectoid steel, although few quantitative carbon determinations exist.In the literature, the carbon content estimates of crucible steel are often not stated, or are reported to range widely from 1.0-1.8wt%.This broad range leaves large gaps in our understanding of the nature of the ingots, as well as their production recipes and technology.In this study, we present a novel approach to estimate the carbon content of un-etched high carbon steel micrographs, using an image analysis tool called Crucible Steel Carbon Estimator, CSCE.This paper introduces and discusses the data generated by CSCE, in particular the precision and accuracy of the carbon content estimated from un-etched crucible steel micrographs.
Telangana in south-central India is a well-known crucible steel production region of the second half of the second millennium CE, and more recently was home to the discovery of sixty crucible steel ingots in a single hoard (Jaikishan et al 2021).Their study triggered the re-opening of the discussion on the carbon content of such ingots more generally.The established methods of carbon analysis are based on metallographic characterization by optical and scanning electron microscopy of etched samples (Scott 2013, 118-20, 153-4, 264, 269;Wayman and Juleff 1999), sometimes aided by comparison to reference samples and informed by the iron-carbon phase diagram.These reports typically report an estimated value, or range of values, based on the microscopist's personal experience.
Quantifying carbon content by traditional metallography is necessarily subjective, skills-based and hence user dependent.In the iron-carbon system, two phases dominate: austenite/pearlite and cementite; their correct identification is normally relatively straightforward.The total carbon content of a sample is reflected in the relative proportion of these two phases, and the determination of the bulk carbon content therefore based on the assessment of this proportion by the microscopist.The carbon content of the two phases is well-defined, while the subjective estimation of their proportion introduces a potential large error in the determination of the total carbon content.For example, previous studies on archaeological crucible steel ingots (Juleff and Wayman 1999; Scott 1991) used traditional metallography for estimating carbon content.They report carbon greater than 1 and around 1.1wt%, respectively.The published images show a clear hypereutectoid microstructure of these ingots, and the carbon content greater than 1% could be any value between 1 and 2wt%, since the microstructures are not of cast iron, leaving a very wide range of total carbon content.For the reconstruction of archaeological production processes through reverse engineering, this wide range poses a challenge.A more accurate determination is needed, especially for the determination of the melting point of the alloy, identifying potential raw materials for the crucible charge, deducing details of furnace design and operation, and more generally understanding the craftsmen's skills in controlling the carbon content of the final ingots.Instrumental analytical methods commonly used in archaeometallurgy, such as X-ray fluorescence (XRF) analysis, laser induced breakdown spectroscopy  used in industrial metallography more generally (eg Das 1999, Vander Voort 2015).Several image analysis software packages are available and others are emerging online for microstructure analysis.These include paid software such as PRECiV by Olympus and Image Analysis Software by Pace Technologies.The current study presents a cost-effective solution specifically aiming to determine carbon content in SEM micrographs of un-etched steel.The CSCE tool, developed using the widely used programming language Python, processes high carbon steel micrographs and reports their carbon content.Python is regarded one of the most suitable languages for image processing, with its free use and wide range of libraries and tools.It also efficiently automates visualisation workflows (Alaa and Abidne 2021, 5-7).This communication presents the results of preliminary trials and future possibilities, discussing the proposed method's reproducibility, precision and accuracy.

Materials and methods
Digital image processing includes image acquisition, image analysis or manipulation, and output generation.These are also the steps adopted in the CSCE, whose output is a calculation of carbon content.

Image acquisition
Polished but un-etched samples from two crucible steel ingots (Ing 06 and Ing 26) from Konasamudram and one (Ing Kp) from Konapuram, both in Telangana, south-central India, were characterised using a Zeiss EVO 15 SEM.Since curatorial concerns often limit the opportunity to etch cultural heritage samples, we decided to explore the usefulness of back-scatter electron (BSE) imaging as a substitute for etching, exploiting the BSE density contrast between pearlite regions and large cementite crystals.We used Oxford Instrument's AZtec 4.4 software to collect the micrograph images, recording the BSE signal with a manually adjusted high-contrast setting.To optimise the BSE contrast, the working distance was kept at 8.50mm, the accelerating voltage at 20kV, the aperture size at 30μm, and the beam current at 2.5nA.Previous XRF and EDS analysis had shown the (LIBS), or scanning electron microscopy with energydispersive spectrometry (SEM-EDS) are of limited use in carbon quantification, while more established quantification methods from modern metallurgy are typically not applicable to historic samples due to the large sample size required.
Here, we approach this problem by building on the fact that the microstructure of these binary iron-carbon steels is a direct reflection of their chemical composition.Their structure consists of two discrete phases, with a defined carbon content of 0.8wt% for pearlite and 6.6wt% for cementite.Thus, an accurate determination of the volume proportions of the two phases can be used to calculate the overall chemical composition of the sample.Ideally, this would require a 3D method to determine phase proportions, such as microCT or a bulk phase analysis using neutron diffraction.Initial studies on large sections have shown that the ingots retain their un-worked 'as-cast' microstructure of randomly oriented crystal growth, with no directional preference or layering in the distribution of either of the phases (unpublished own data).We therefore contend that a series of 2-dimensional representations can be used as a proxy for the true 3-dimensional structure, and that the relative area proportions of the two phases in a 2-dimensional image of the material are likely to be very similar to the 3-dimensional volume proportions.This premise enables us to use image analysis to determine relative volume percentages of the two phases as a proxy for more classical instrumental carbon analysis.Importantly, the underlying principle of the Crucible Steel Carbon Estimator is methodologically identical to classical metallography in that it determines the relative proportions of the two phases within a given area, and therefore generates data that is fully compatible with pre-existing data.However, it calculates the relative proportions rather than estimating them, thus reducing operator bias and the need for extensive reference materials for comparison.While the use of image analysis in ceramic microscopy is well established (eg Reedy et al 2014; Maritan et al 2020 and references therein), this is not so much the case for archaeometallurgy (but see, eg Ferrer-Eres et al 2010), even though it has long been samples to be free of any alloying elements other than carbon relative to the detection limits of the instruments used, estimated to be about 0.1wt% for most relevant elements.
Phase contrast in BSE imaging is based primarily on the average atomic weight of the phases, with higher reflectivity and therefore lighter grey shades of heavier phases.The average atomic weight of cementite (Fe 3 C) is 44.9atu, while that of pearlite, with a nominal carbon content of 0.8wt%, is 55.5atu.Accordingly, in BSE images, cementite appears darker grey in colour and pearlite is lighter grey.Porosity, whether open or filled with resin, does not back-scatter at all, and appears black or near-black in most settings.The bulk of the crucible steel samples showed a high-carbon microstructure with primary and grain boundary cementite in a pearlite matrix along with some shrinkage porosity.This limits the images to three different bands of grey shade: cementite, pearlite, and porosity.Unfortunately, the intensity of the BSE signal is affected by the orientation of the crystal relative to the surface of the image, which affects the likelihood that an incoming electron is back-scattered.Accordingly, even a single phase such as pure ferrite does not have a fixed grey shade in high contrast BSE imaging, but presents a range of grey shades depending on the crystal lattice orientation relative to the incoming electron beam (Fig 1).In some circumstances, this can lead to an overlap in grey shade between the two phases of interest here, as will be discussed below.
We therefore selected a high image contrast setting at a brightness level that showed clear phase distinction between cementite and pearlite, improving the readability of the image for the image analysis program.For image analysis, we decided to work with relatively low magnifications in order to capture a large area to enhance representativeness, and to ensure that the eutectoid micro-structure of pearlite is not resolved into discrete ferrite and cementite platelets, but is registered as a homogenous light grey area.The selection of micrographs to test this tool for precision consisted of three images from each sample, taken at both 100x and 200x magnifications in order to match commonly used magnifications in both optical and scanning electron microscopy.

Coding
The commands were coded in Python 3 script using the libraries of OpenCV, tkinter and NumPy (Fig 2).The mathematical formulae in Figure 3 formed the basis of the automated calculations.First, the program fills the black porosity pixels with white to aid visual recognition, and to ensure a proper starting position for the subsequent operations.It then calculates the percentage of carbon on the basis of the total number of non-white pixels and the proportion of lighter vs darker pixels, ie pixel coloration, as a representation of cementite (darker) and pearlite (lighter), respectively.The coloration is manually set as a threshold for darkness; all pixels below that threshold are considered 'dark', ie cementite.No absolute value can be given for this threshold, since it is driven by the individual brightness and contrast settings of the original BSE images.Therefore, it has to depend on operator judgement based on the comparison of the original BSE image and the processed image where all 'dark' pixels are coloured green.An increase of threshold setting leads to fewer pixels being recognised as 'dark', and hence a lower calculated carbon content.The operator has to judge whether the given threshold setting over-estimates or under-estimates the true cementite presence, and decide a 'best fit' setting; the effect of potential operator errors on the calculated result is discussed below.For best results, the contrast setting of the BSE detector when capturing the images should be optimised to enhance the ability of the operator to read and distinguish these phases with ease (Figs 4a and 4b).However, BSE image contrast adjustments or editing is also possible at a later stage with many widely used image processing tools.

Testing CSCE
We tested the relationship between image contrast, threshold settings, and calculated carbon content through two series of analyses using high and low contrast versions of the same image.The aim was to find the threshold setting for the processed image that best matched the operator assessment of the phase identification in the BSE image, and to document the effect that the different contrast setting has on the utility of CSCE.

Optimising the threshold value through visual interpretation in high contrast images
Sample Ing 06t is a high-carbon steel with predominantly pearlite and large plates of cementite, mostly at grain boundaries.We distinguish primary cementite by its large size, separating it from the tiny cementite platelets within the pearlite structure which begin to be individually resolved only at 200x magnification.
In order to demonstrate the identification of the 'best fit' threshold value, various threshold settings were used to analyse an image (Figs 6a-6c) and calculate the carbon from CSCE.When the threshold function is set to 130, CSCE captures a significant amount of the pearlite-hosted cementite (Fig 6a).The calculated carbon content is 3.23wt%, which is clearly too high due to an erroneous reading of cementite in pearlite and thus an overestimation of the total carbon content.Therefore, the threshold must be increased to reduce capture of cementite in the pearlite.At threshold 145 (Fig 6c) the CSCE does not account for all the primary cementite, narrowing down the ideal threshold value to between 130 and 145.By adjusting the threshold value in that range and observing the extent of cementite read, a subjective 'best fit' is achieved; in this example, at a setting of 139 (Fig 6b).In addition, output image and empirical values were also examined by setting the threshold to ±2 from the ideal threshold value to gauge the effect and relationship of the threshold value to %carbon (Table 1).

Influence of low image contrast on CSCE
As discussed in the section on coding, a high image contrast aids the visual identification of the best fit between the operator's assessment of the image, and the CSCE capture of cementite.However, CSCE's result in determining the carbon content in a low-contrast image shows no significant difference compared to the high contrast image.However, a deviation of 1 threshold step from the best fit value results in a much larger difference in calculated carbon content.Furthermore, the operator's ability to identify the best image fit is hampered for low contrast images (Fig 7), and the change of calculated carbon content for a change in threshold setting by 1 point equals about 0.2-0.4wt%(Table 2).For high-contrast settings (Figs 6a-6c, Table 1), each step only changes the calculated carbon content by about 0.1-0.15wt%,allowing for a much finer resolution of carbon calculation, and lower likelihood of operator error, since the visual phase interpretation is easier in high-contrast images (Fig 8).

Carbon content in Telangana ingots
When applied to suitably processed images with distinct grey shades for cementite and pearlite, the CSCE calculates a reasonable carbon content based on the input formulae (Fig 3) and user-defined thresholds and blur settings.The images were taken from three different hyper-eutectoid steel ingots from Telangana, with relatively coarse primary and grain-boundary cementite as well as pearlite.Based on our preliminary assessment of the images prior to the analysis, their microstructures correspond to a high carbon steel, where carbon content is above 1.5wt%, but below the minimum carbon threshold for cast iron, conventionally set at 2wt% C (Fig 9).
Across the 18 images from three different ingots initially analysed, the individual calculated carbon content ranges from 1.63wt% to 2.08wt% (Table 3), while the average compositions for each ingot have a narrower range, from 1.75wt% to 1.87wt% carbon.Note there is no reason to assume that the carbon content of the three ingots is identical, limiting the comparison of the data to the six individual results obtained from each ingot.

Testing effect of magnification
As-cast crucible steel is relatively coarse-grained, with large austenite dendrites and cementite plates forming during cooling.In order to further test the effect of the chosen magnifications, we conducted a second series of five image analyses of Ing 26 at both 100x and 200x (Tables 3 and 4).The average carbon content of three measurements at 100x and 200x in Table 3 has a relatively high difference of nearly 0.1wt%, a much wider spread than in the other two ingots, pointing to a higher overall compositional variability in Ing 26.For five further measurements at each magnification (Table 4), the difference is only 0.02wt%, for an absolute value of 1.8wt%.While this is only a pilot test, it seems that a larger number of analyses is likely to result in the average value being a more accurate representation of the total carbon content, regardless of magnification.However, at both the magnifications the composition is very similar, and therefore using a single magnification should be able to generate reliable data.

Discussion
The results obtained from the CSCE are reasonable, as defined by matching the expected values based on classical metallography for similar ingot samples.The results of individual analyses scatter within a range, as one would expect for analyses based on small areas of a relatively coarse-grained material.However, the range is very narrow and certainly smaller than would have been possible by visual assessment alone.It is observed that lower magnification works marginally better with the blur factor due to the smaller pixel number for cementite platelets, and also giving a higher representativity of the sample due to the larger area covered.Differences in the calculated carbon content within a given sample could arise from several factors ranging from operatorbased processing error to actual heterogeneity of carbon content (eg, values for Ing 26); this requires followup study to explore further.Regarding the effect of processing and possible related errors, the calculated values clearly depend on the chosen threshold value for the 'dark' level, and the selected 'blur' factor to suppress counting of pearlite-based cementite.This is a specific problem for un-etched steel samples which have less contrast between cementite and pearlite regions compared to etched samples, even when using BSE images at high contrast settings (cf Fig 1 and Figs  6a-6c).If the grey shades of the two phases overlap due to the crystal orientation this will affect their BSE signal (ie cementite and pearlite are shown with the same grey shade or pearlite appears darker than the selected threshold) and the bimodal image histogram therefore has overlapping peaks; this could lead to larger errors (Figs 10a,10b).Wider peaks in the image histogram (ie increased contrast settings in the original image) would make it easier to select a suitable threshold level and provide higher image analysis precision; however, it cannot fully compensate for the grain orientation effect on the BSE signal.This could be one of the reasons that some images show different carbon contents compared to others within the same sample and at the same magnification.
One of the variables we tested for the specific application presented here was the number of images that needed to be analysed to obtain a stable average.The initial set of three images per sample and magnification setting provided average data which differed by around 5 percent relative to the calculated value (1.75 and 1.87wt%, and 1.87 and 1.79wt%, respectively, for Ing 06 and Ing 26; Table 3).When the sample size is increased from 3 to 5, the average carbon contents at different magnifications are closer to one another (1.79 and 1.81wt%, for Ing 26; Table 4), while remaining in line with the earlier averages.Based on this, the average of three analyses appears less representative of the sample content compared to a set of five repeats, regardless of magnification, but still within a few percent relative of the value obtained by averaging a larger set of analyses.Therefore, even in the absence of a large set of images, the user can work with a smaller set and obtain data with considerable precision.
The blur and threshold value settings are operatordetermined and directly affect the carbon content calculations (Doane and Seward 2011).Therefore, the operator needs to make a careful and consistent selection of these values, based on the best visual fit with the original image.The tool allows for a full documentation of the image being processed (see Fig 6a -6c), and thus facilitates inter-operator comparison and data reproducibility.To prevent misinterpretation of data, it is best to include both the original and processed images in any publication, for instance as supplementary material, and demonstrate this in the text with selected examples.
Ing 26 stood out as having a more variable carbon content than the other samples studied here.A possible explanation for the difference in the calculated carbon content could be small variations in the carbon content within this sample.This, of course, will lead to a broader scatter of calculated values, and is related to the general problem of sampling complex objects, but unrelated to the quality of the tool itself.Beyond the issue of precision, it is important to understand accuracy, ie whether the tool underestimates, matches, or overestimates the true carbon content.the analysis of the images, generating the same carbon values within five percent relative to the expected absolute value, points to the precision of the tool.

Conclusion and future work
CSCE is a promising tool for the determination of carbon content in un-etched samples of hyper-eutectoid steel, using the contrast in brightness between cementite and pearlite regions in BSE images.After the initial development and testing presented here, it now requires further training to improve its precision and repeatability across different users, as well as calibration against independently determined true carbon contents.However, the calculated carbon values of repeat analyses already fall within a very narrow range and provide good estimates that agree with the expected values based on traditional metallography.Testing the accuracy of the calculated carbon content requires further work, including analysing well-characterised reference samples.This is planned for future work, together with other tools, such as instrumental carbon analysis and conventional metallography based on etching using a set of experimentally produced samples.We stress that CSCE is designed for samples that have no directional preference in their microstructure, and where the grain size and BSE phase contrast are sufficiently large to enable an experienced operator to select suitable dark threshold and blur factor settings.Thus, we do not recommend using this tool for the carbon estimation of worked crucible steel samples with their often highly directional microstructures and small grain sizes, which negatively affect the distinction between broken primary cementite and cementite in spheroidized pearlite (Czarski et al 2015).
Future work will use experimentally produced crucible steel ingots of a size, shape and microstructure similar to those from Telangana used here to further test CSCE.

Threshold value vs wt% carbon
Ing 06t low contrast Ing 06t high contrast This will include verification of their carbon content using established industrial instrumental analysis methods and traditional metallography by experienced colleagues.As part of the further development of CSCE, we intend to provide sets of BSE images to different users to test the tool independently to obtain an idea of user dependent precision or variability in results, hopefully leading to full data compatibility and comparability between different studies and laboratories.
In the long term, we want to estimate process temperatures based on ingot metallography and discuss the change in carbon content from the ingot to the object.We aim for an accuracy of 5-10% relative to the absolute value, ie so that the first decimal place is reliable.

Figure 1 :
Figure 1: BSe contrast in a pure bloomery iron sample, showing the different grey shades of ferrite (Fe) depending on grain orientation when recorded at a high contrast setting.Slag inclusions appear black.Iron beam from the Roman limes fortification, Castle Saalburg (after Rehren and Hauptmann 1994, Abb 3).

Figure 2 :
Figure 2: The flowchart of image analysis in CSCE.

Figure 3 :
Figure3: equations used in calculation of wt% carbon in CSCe.Note 'total no' is the total number of non-white pixels.
To avoid the capture of cementite pixels within the pearlite, CSCE has a 'blur' function (Alaa and Abidne 2021, 69), which removes very small 'dark' pixels that are typically part of the pearlite texture.The aim is for the tool to only detect cementite formed from the parent austenite beyond the eutectoid composition, and not to detect any cementite within the eutectoid pearlite texture (Fig5).Effectively, this function exploits the strongly bimodal grain size distribution of the two types of cementite in this material, by suppressing pixels representing the small platelets of cementite in the pearlite region.Since the contrast and brightness values of the BSE images are not absolute functions of the material but are manually adjusted to maximise the differentiation between cementite and pearlite, the blur and threshold settings have to be manually adjusted (Figs6a-6c) based on the user's experience and interpretation of the resulting image.This necessary subjective step allows the CSCE to analyse any greyscale image across a wide range of different brightness and contrast settings, while also introducing potential operator bias, both systematic and random.The initial trials performed by a single operator with three images of each sample at two different magnifications yielded consistent values within the expected range and established the functionality of the tool.

Figure 4b :
Figure 4b: Same image as 4a, at enhanced brightness and contrast setting of the BSe detector.The microstructure is clearly visible.Mid-grey is pearlite (P), darker grey cementite (Cm), black is porosity.

Figure 4a :
Figure 4a: SeM-BSe image of sample Ing 06t without contrast adjustment.The microstructure is visible as slightly different grey shades in the image, but not very clearly.Black is porosity.

Figure 5 :
Figure 5: SeM-BSe image of an etched sample of crucible steel (Ing 26), showing smooth grains of cementite (Cm) in a matrix of pearlite (P).The thin platelets in the pearlite region are also cementite, but their carbon content is included in the overall pearlite composition.Therefore the CSCe should not count the thin platelets but only the large cementite grains and the cementite at grain boundaries.

Figure 10b :
Figure 10b: Bi-modal grey shade distribution of a sample of hypereutectoid steel (Ing 26) with predominant pearlite regions (lighter grey) and large cementite (darker grey).Note the partial overlap of the two peaks in the histogram.

Figure 10a :
Figure 10a: Mono-modal histogram of grey shades for a sample consisting of pure ferrite, showing the distribution of grey shades due to grain orientation at very high BSe contrast (Fig 1).
The close clustering of the data from

Table 3 :
Initial results and average carbon content in three different BSE images at 100x and 200x.The carbon content is reported in wt%.

Table 4 :
Additional image processing trials of sample Ing 26 with separate images at two different magnifications.The carbon content is reported in wt%.
CSCe reads the cementite even in low contrast image, even though it is more difficult for the operator to compare the two images and identify the best fit, which is more likely to introduce error.
higher contrast has a narrower range between threshold values so the best fit is easier for the operator to identify (cf Figs 7 and 6b), leading to a higher precision of the result.The calculated carbon values for the two visually identified 'best fit' threshold settings are 1.65wt% and 1.69wt% for the low and high contrast images, respectively.Figure 7: Meghna Desai is a PhD student at the Cyprus Institute supervised by Prof Thilo Rehren.Meghna studies high carbon crucible steel from South-central India and elsewhere.Apart from crucible steel, she studies technical ceramics, slags, production fuel ash glazes and other non-ferrous metals.Address: The Cyprus Institute , 20 Konstantinou Kavafi, Aglantzia, Nicosia 2121 Email: m.desai@cyi.ac.cyORCID: https://orcid.org/0000-0002-3018-9735Thilo Rehren holds the A. G. Leventis Chair in Archaeological Sciences at The Cyprus Institute.He studied Earth Sciences in Germany and worked for ten years as a research scientist at Deutsches Bergbau-Museum in Bochum before moving to UCL in 1999.Following a five-year secondment to establish UCL Qatar in Doha, Qatar, he moved in 2017 to his current position in Cyprus.His main research interests are in understanding the primary production of metals and glass across time and space and how this relates to the use and development of technical ceramics.Address: The Cyprus Institute , 20 Konstantinou Kavafi, Aglantzia, Nicosia 2121 Email: th.rehren@cyi.ac.cyORCID: https://orcid.org/0000-0002-9169-1198