Context-aware bainite–martensite classification in light microscopy: fusion of dilatometric process data and warm-started LLM hyperparameter optimisation
AGH University of Krakow, Faculty of Metals Engineering and Industrial Computer Science, Al. A. Mickiewicza 30, 30-059 Krakow, Poland.
DOI:
https://doi.org/10.7494/cmms.2026.3.1049
Abstract:
Automated quantitative metallography of advanced high-strength steels is constrained by two practical difficulties: bainite and martensite can be morphologically similar in light microscopy, and image-only models often degrade when transferred between thermal processes. This work proposes a context-aware classification framework that combines light-microscopy image regions with dilatometric process data. Low-alloy steel specimens were austenitised at 1,000°C and cooled in nitrogen at 6 bar; two geometries (approximately 46 K∙s−1 for a solid specimen and 63 K∙s−1 for a hollow specimen) generated distinct cooling profiles. Expert-annotated bainite/martensite regions were processed using SLIC-based image segmentation and a ResNet-50 backbone. Dilatometric curves were represented by compact window-based features describing slope, range, variance, step change, and local dynamics around transformation regions. Three configurations were compared: an image-only baseline, late fusion, and feature-wise linear modulation (FiLM). In an in-distribution cross-validation regime, the image-only model achieved the highest validation F1macro (0.896). On held-out expert-annotated test regions excluded from training and validation, under process diversity, F1macro on the combined P1 + P2 set increased from 0.701 to 0.753 for late fusion and 0.786 for FiLM. On the more shifted P2 process, FiLM improved F1macro from 0.652 to 0.799. At an equal budget of 20 trials, warm-started LLM-HPO was competitive with Optuna-based Bayesian optimisation but not uniformly superior: it improved the late-fusion internal test F1macro from 0.753 to 0.784, while underperforming for FiLM (0.710 vs. 0.729). The results are a proof of concept on a two-process dataset, showing that process context can reduce cross-process degradation and that LLM-guided HPO may serve as an interpretable warm-started assistant and as an initialiser for Bayesian optimisation under small evaluation budgets.
Cite as:
Jażdżewski, T. (2026). Context-aware bainite–martensite classification in light microscopy: fusion of dilatometric process data and warm-started LLM hyperparameter optimisation. Computer Methods in Materials Science, 26(3), XX-XX. https://doi.org/10.7494/cmms.2026.3.1049
Article (PDF):

Accepted manuscript: the final PDF will be available soon.
Keywords:
bainite, martensite, advanced high-strength steels, light microscopy, dilatometry, multimodal data fusion, FiLM, ResNet-50, Bayesian optimisation, large language models, hyperparameter optimisation
Publication dates:
Received: 16.07.2026, Accepted: 23.10.2026, Published: XX.11.2026
Publication type:
Original scientific paper
References:
Achanta, R., Shaji, A., Smith, K., Lucchi, A., Fua, P., & Süsstrunk, S. (2012). SLIC superpixels compared to state-of-the-art superpixel methods. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(11), 2274–2282. https://doi.org/10.1109/TPAMI.2012.120
Akiba, T., Sano, S., Yanase, T., Ohta, T., & Koyama, M. (2019). Optuna: A next-generation hyperparameter optimization framework. In KDD ‘19: Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 2623–2631). Association for Computing Machinery. https://doi.org/10.1145/3292500.3330701
Andrews, K. W. (1965). Empirical formulae for the calculation of some transformation temperatures. Journal of the Iron and Steel Institute, 203(7), 721–727.
Bachmann, B.-I., Müller, M., Britz, D., Staudt, T., & Mücklich, F. (2023). Reproducible quantification of the microstructure of complex quenched and quenched and tempered steels using modern methods of machine learning. Metals, 13(8), Article 1395. https://doi.org/10.3390/met13081395
Bhadeshia, H. K. D. H. (2019). Bainite in Steels: Theory and Practice (3rd ed.). CRC Press. https://doi.org/10.1201/9781315096674
Bhadeshia, H. K. D. H., & Christian, J. W. (1990). Bainite in steels. Metallurgical Transactions A, 21, 767–797. https://doi.org/10.1007/BF02656561
Felzenszwalb, P. F., & Huttenlocher, D. P. (2004). Efficient graph-based image segmentation. International Journal of Computer Vision, 59, 167–181. https://doi.org/10.1023/B:VISI.0000022288.19776.77
Fonstein, N. (2015). Advanced high strength sheet steels: Physical metallurgy, design, processing, and properties. Springer Cham. https://doi.org/10.1007/978-3-319-19165-2
Frazier, P. I. (2018). A Tutorial on Bayesian Optimization. ArXiv. https://doi.org/10.48550/arXiv.1807.02811
Gola, J., Webel, J., Britz, D., Guitar, A., Staudt, T., Winter, M., & Mücklich, F. (2019). Objective microstructure classification by support vector machine using morphological parameters and textural features for low carbon steels. Computational Materials Science, 160, 186–196. https://doi.org/10.1016/j.commatsci.2019.01.006
Hallo, F., Jażdżewski, T., Bała, P., Korpała, G., & Regulski, K. (2026). Optimizing image segmentation for microstructure analysis of high-strength steel: Histogram-based recognition of martensite and bainite. Materials, 19(2), Article 429. https://doi.org/10.3390/ma19020429
Jażdżewski, T., Regulski, K., Bułka, A., Malara, P., Czeszkiewicz, A., & Trajer, M. (2024). Information extraction from time series in the EDM drilling process. In J. Kusiak, Ł. Rauch, K. Regulski (Eds.), Numerical Methods in Industrial Forming Processes. Numiform 2023 (pp. 149–160). Springer, Cham. https://doi.org/10.1007/978-3-031-58006-2_12
Jażdżewski, T., Hallo, F., Korpała, G., & Regulski, K. (2025). Knowledge integration in steel microstructure analysis using unsupervised image segmentation and supervised machine learning techniques. Applied Sciences, 15(4), 1810. https://doi.org/10.3390/app15041810
Liu, T., Astorga, N., Seedat, N., & van der Schaar, M. (2024). Large language models to enhance Bayesian optimization. The Twelfth International Conference on Learning Representations. https://doi.org/10.48550/arXiv.2402.03921
Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., Berg, A. C., & Fei-Fei, L. (2015). ImageNet large scale visual recognition challenge. International Journal of Computer Vision, 115, 211–252. https://doi.org/10.1007/s11263-015-0816-y
Tornede, A., Deng, D., Eimer, T., Giovanelli, J., Mohan, A., Ruhkopf, T., Segel, S., Theodorakopoulos, D., Tornede, T., Wachsmuth, H., & Lindauer, M. (2024). AutoML in the age of large language models: Current challenges, future opportunities and risks. Transactions on Machine Learning Research. https://doi.org/10.48550/arXiv.2306.08107
van Bohemen, S. M. C. (2012). Bainite and martensite start temperature calculated with exponential carbon dependence. Materials Science and Technology, 28(4), 487–495. https://doi.org/10.1179/1743284711Y.0000000097
Vincent, L., & Soille, P. (1991). Watersheds in digital spaces: An efficient algorithm based on immersion simulations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 13(6), 583–598. https://doi.org/10.1109/34.87344
Wada, K. (2016). Labelme: Image polygonal annotation with Python [Computer software]. https://github.com/wkentaro/labelme