Abstract
In order to facilitate the study of the structure of cement components, this paper uses image processing technology to achieve multi-threshold segmentation for cement scanning electron microscope image under different conditions and applies an optimized Otsu multi-threshold segmentation based on fireworks algorithm. The method designs fitness function with Otsu multi-threshold segmentation method and searches optimal solution by iteration with the fireworks algorithm. Finally, the search problem of optimization is transformed into a multi-variable solution. The experimental results show that this method can achieve the same result as the classical algorithm and it has better convergence and stability, and the method can be widely used in many fields.
Introduction
Materials science research is undergoing a shift from macro-research to micro-research, from equilibrium research to non-equilibrium research, and from qualitative research to quantitative research. At present, through computer technology, analysis and research has become a third important part of solving practical problems of materials science in addition to experiment and theory.1,2
The largest interclass variance method, also known as Otsu, was proposed and named by the Japanese Otsu. According to the gray information of the image, the pixel is divided into two regions of the image segmentation optimization algorithm. However, it is to be practically seldom applied because of the increase to the threshold after the calculation is huge.
In recent years, many scholars have proposed various groups of intelligent algorithms to optimize. In order to solve the problem of premature maturing algorithms such as particle swarm optimization algorithm, 3 this paper proposes an image segmentation method combining fireworks algorithm (FWA) with Otsu multi-threshold. Since Tan and Zhu proposed the fireworks algorithm in 2010, it have been applied in many fields. 4 Debkalpa et al. combined gravitational search and FWA for parameter optimization in the ultrasonic machining process. 5 Yu et al. proposed a hybrid multi-objective fireworks optimization algorithm (MOFOA) to solve the problem of variable-rate fertilization in oil crop production. 6 They also proposed a hybrid fireworks optimization method with differential evolution operators. 7 The main idea of the FWA is to complete the global optimal solution search by simulating the process of fireworks explosion. The optimized Otsu multi-threshold segmentation based on FWA can effectively play the optimization ability of fireworks algorithm, and it shows good stability, good image segmentation effect, and segmentation efficiency that is compared with the traditional particle swarm algorithm.
Materials and methods
Image data
With the high strength and the high performance concrete becoming one of the main directions of the development of building materials technology, the research of cement materials has been paid more and more attention. The microstructure of cement-based materials is the most important understanding and explanation of cement science methods.
The slurry initially has plasticity and fluidity that is made of cement and water. As the hydration reaction continues, the slurry gradually loses its ability to flow and turns into a solid with a certain degree of strength. This process is called cement coagulation and hardening. The hardened cement slurry contains both the cement hydration product in the solid phase and the residual clinker that has not been hydrated, and water or air is filled in various pores. It is an uneven three-phase system. 8
The hydration products of silicate cements can be classified into two categories according to their degree of crystallinity. One of these is a poorly crystallized hydration product. Its grain size is about the size of colloidal calcium silicate hydrate. It is not only that the microcrystalline substances can cross and connect with each other, but also that they have gel properties because their size is within the colloidal size range. We refer to hydrated calcium silicate as a gel according to its special physical properties, abbreviated as C-S-H gel. Another hydrated product has relatively complete crystallinity and relatively large crystalline particles such as calcium hydroxide, hydrated calcium sulfoaluminate, and hydrated calcium aluminate. Through electron microscopy, it can be observed that different compound compositions often have various shape characteristics under the microstructure of the cement hardened paste. For example, C-S-H colloids often exhibit cloud-like, granular and grid-like forms. Figures 1 and 2 show typical scanning electron microscopic (SEM) images of the microstructure of ettringite and calcium hydroxide crystals.

Ettringite crystal SEM image. SEM: scanning electron microscope.

calcium hydroxide crystals of hexagonal plate SEM image. SEM: scanning electron microscope.
The hydrated substances (gels and crystals) and their relative contents have an important influence on the properties of the cement. In the different stages of cement hydration, the content and proportion of various hydration products are also different. There are not many hydration products in the early stage of the hydration process. Through an electron microscope, most of the area was observed as cement particles covered with gel. At this stage, the content of ettringite and calcium hydroxide crystals is small, and the volume of crystal particles is small. During the hydration process, clusters of rod-shaped ettringite crystals, plate-like or hexagonal plate-like calcium hydroxide crystals, and bulk gels of various shapes can be observed. Because the hydration products of cement often have special morphological features, the microstructure of the cement can be analyzed by SEM images. And the morphologies of some representative hydration products can be segmented and located to calculate their relative contents. If a large number of cement microstructure images are processed over a period of time, the variation of these hydration products in time series can be counted. These data can provide valuable reference information for the simulation of cement hydration process and have important significance for establishing the three-dimensional model of the cement hydration process.
In this paper, five representative cement images were used. Figure 3 shows the SEM spectra of the five sets of images and the histogram of the gray-scale distribution.

Five groups of cement images of SEM electron microscopy and their gray distribution histogram. SEM: scanning electron microscope.
Otsu image segmentation method
The basic idea of the Otsu algorithm is to divide the image into foreground and background with a single threshold. When the variance of the two regions takes the maximum value, the Otsu single threshold segmentation of the image is completed. Assuming that the total number of pixels of the image is M, the probability of all pixel points for a certain gray scale value is
In formula (1),
And the interclass variance of the two regions divided by the threshold
In formula (4),
The same can infer the case of multi-threshold segmentation. Assuming that the image gray level is
In formula (5),
A fireworks algorithm based on roulette strategy
Fireworks algorithm is a new optimization algorithm based on the fireworks observed in the air explosion sparking. The location vector of each fireworks represents the solution of each group. The fireworks produce the offspring spark with the explosion iteration to complete the search for the optimal solution. Good fireworks can generate more sparks in a certain range and have faster convergence. But the poor fireworks sparks generated less, and its search range is expanded. Fireworks algorithms include local and global search capabilities. Therefore, it is a good method to find the global optimal solution by using the fast convergence speed and better searching ability of FWA.
9
The basic idea of FWA based on roulette strategy:10–12
Some fireworks are randomly generated in the feasible solution space. After the initialization, the fitness value is calculated with fitness degree and is evaluated. The number of sparks produced by the
In formula (6), 2. Because the fireworks that have better performance have a greater impact on the offspring, it is easy to be reduced of population diversity. There are needs to limit the number 3. Explosion radius
In formula (8), RC is the maximum explosion radius preseted. 4. Randomly selected part of the fireworks for displacement operation
In formula (9), 5. Randomly selected part of the fireworks for Gaussian displacement
In formula (10), 6. For the above two kinds of displacement operations, it needs to be mapped to the search interval if the new location is beyond the search interval
In formula (11), 7. In each iteration, all optimization of individuals (including fireworks and sparks) selected with the roulette strategy will be into the next generation. The probability of the
In formula (12), both
Determine whether it is the iterations maximum number preseted, end the iteration if meet the conditions, and continue to implement step 4 otherwise.
The proposed algorithm
The design idea of optimized Otsu multi-threshold segmentation method based on FWA is: each fireworks that generated randomly represents a set of thresholds, and its dimension is the number of segmentation thresholds. Then each firework is evaluated with the fitness function formula (5). The segmentation threshold group is updated by the search strategy of combine parental fireworks search with offspring sparks search, so that the optimal segmentation threshold group can be found quickly and accurately and finally the corresponding segmentation image is obtained.13,14
The main steps are as follows:
Read and preprocess the image need to be split; Fireworks initialization and set the parameters; Calculate the fitness function with FWA and get the optimal threshold group when it meet the end condition; Image segmentation according to the threshold set.
Results and discussion
The results based on fireworks algorithm
This experiment run environment for Win10, Intel5.20GHz CPU, and 8G RAM, programming language for the Matlab2016b.
The image segmentation results of different thresholds (threshold number n = 1, 2, 3, 4, 5) of the optimized Otsu multi-threshold segmentation based on fireworks algorithm are shown in Figures 4 to 8 (Tables 1 to 5).

The first group of images segmentation effect (threshold number n = 1, 2, 3, 4, 5). (a) Original Image; (b) Threshold Number n = 1; (c) Threshold Number n = 2; (d) Threshold Number n = 3; (e) Threshold Number n = 4; (f) Threshold Number n = 5.

The segmentation effect of the second set of images (the number of thresholds n = 1, 2, 3, 4, 5). (a) Original Image; (b) Threshold Number n = 1; (c) Threshold Number n = 2; (d)Threshold Number n = 3 (e) Threshold Number n = 4 (f) Threshold Number n=5.

The segmentation effect of the third set of images (the number of thresholds n = 1, 2, 3, 4, 5). (a) Original Image; (b) Threshold Number n = 1; (c) Threshold Number n = 2; (d) Threshold Number n = 3; (e) Threshold Number n = 4; (f) Threshold Number n = 5.

The segmentation effect of the fourth set of images (the number of thresholds n = 1, 2, 3, 4, 5). (a) Original Image; (b) Threshold Number n = 1; (c) Threshold Number n = 2; (d) Threshold Number n = 3; (e) Threshold Number n = 4; (f) Threshold Number n=5.
The i-th (i = 1, 2, 3, 4, 5) threshold of the first set of images, the number of thresholds n = 1, 2, 3, 4, 5.
The i-th (i = 1, 2, 3, 4, 5) threshold of the second set of images, the number of thresholds n = 1, 2, 3, 4, 5.
The i-th (i = 1, 2, 3, 4, 5) threshold of the third set of images, the number of thresholds n = 1, 2, 3, 4, 5.
The i-th (i = 1, 2, 3, 4, 5) threshold of the fourth set of images, the number of thresholds n = 1, 2, 3, 4, 5.
The i-th (i = 1, 2, 3, 4, 5) threshold of the fifth set of images, the number of thresholds n = 1, 2, 3, 4, 5.
The comparison results of several classical algorithms
In order to test the applicability and efficiency of the fireworks algorithm, we compare the parameters such as the segmentation effect and the threshold calculation with the other two classical algorithms. Participate in the comparison algorithm are FWA, firefly algorithm (FA) 15 and particle swarm optimization (PSO). 16 In order to ensure the unity of the results before and after the experiment, we selected three groups of cement images for experiments. And set the number of segmentation thresholds to n = 1, 2, 3, respectively. (Figure 9 to 11; Tables 6 to 8).

The segmentation effect of the fifth set of images (the number of thresholds n = 1, 2, 3, 4, 5). (a) Original Image; (b) Threshold Number n = 1; (c) Threshold Number n = 2; (d) Threshold Number n = 3; (e) Threshold Number n = 4; (f) Threshold Number n = 5.

When number of thresholds is n = 1, the segmentation effect of FWA, FA, and PSO. F. (a) Original Image 1; (b) the Result of FWA; (c) the Result of FA; (d) the Result of PSO; (e) Original Image 2; (f) the Result of FWA; (g) the Result of FA; (h) the Result of PSO; (i) Original Image 3; (j) the Result of FWA; (k) the Result of FWA; (l) the Result of PSO.WA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.

When number of thresholds is n = 2, the segmentation effect of FWA, FA, and PSO. (a) Original Image 1; (b) the Result of FWA; (c) the Result of FA; (d) the Result of PSO; (e) Original Image 2; (f) the Result of FWA; (g) the Result of FA; (h) the Result of PSO; (i) Original Image 3; (j) the Result of FWA; (k) the Result of FA; (l) the Result of PSO. FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.

When number of thresholds is n = 3, the segmentation effect of FWA, FA, and PSO. (a) Original Image 1; (b) the Result of FWA; (c) the Result of FA; (d) the Result of PSO; (e) Original Image 2; (f) the Result of FWA; (g) the Result of FA; (h) the Result of PS; (i) Original Image 3; (j) the Result of FWA; (k) the Result of FA; (l) the Result of PSO.FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.
When number of thresholds is n = 1, the resulting threshold of FWA, FA, and PSO.
Note: Pic represents the serial number of the graph.
FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.
When number of thresholds is n = 2, the resulting threshold of FWA, FA, and PSO.
Note: Pic represents the serial number of the graph.
FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.
When number of thresholds is n = 3, the resulting threshold of FWA, FA, and PSO.
Note: Pic represents the serial number of the graph.
FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.
By comparing the above three experimental results, it is clear that the segmentation results and the optimal threshold groups obtained by the three algorithms are very similar in the case of a small number of thresholds. This supports the feasibility of the fireworks algorithm. To further analyze the feasibility of the FWA, we also compare the case of n = 4 and n = 5, and set the number of iterations to 1000 (Figures 12 and 13; Tables 9 and 10). To avoid errors caused by chance and to test the optimization performance of each algorithm, we run each algorithm experiment 50 times. Considering the increase in the number of thresholds, the fitness value obtained by each algorithm is used as a comparison parameter.

When number of thresholds is n = 4, the segmentation effect of FWA, FA, and PSO. (a) Original Image 1; (b) the Result of FWA; (c) the Result of FA; (d) the Result of PSO; (e) Original Image 2; (f) the Result of FWA; (g) the Result of FA; (h) the Result of PSO; (i) Original Image 3; (j) the Result of FWA; (k) the Result of FA; (l) the Result of PSO.FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.

When number of thresholds is n = 5, the segmentation effect of FWA, FA, and PSO. (a) Original Image 1; (b) the Result of FWA; (c) the Result of FA; (d) the Result of PSO; (e) Original Image 2; (f) the Result of FWA; (g) the Result of FA; (h) the Result of PSO; (i) Original Image 3; (j) the Result of FWA; (k) the Result of FA; (l) the Result of PSO.FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.
When number of thresholds is n = 4, the fitness value of FWA, FA, and PSO.
Note: Max represents the maximum of the fitness value in 50 experiments, min corresponds to the minimum of the fitness value, mean represents the average value, and std represents the standard deviation of the fitness values obtained from 50 experiments.
FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.
When number of thresholds is n = 5, the fitness value of FWA, FA, and PSO.
Note: Max represents the maximum of the fitness value in 50 experiments, min corresponds to the minimum of the fitness value, mean represents the average value, and std represents the standard deviation of the fitness values obtained from 50 experiments.
FWA: fireworks algorithm; FA: firefly algorithm; PSO: particle swarm optimization.
Through the comparison of the above two groups of experimental results, it is obvious that the maximum and minimum of the fitness value of the fireworks algorithm are very close when the fitness values of the three algorithms are similar. And the standard deviation of FWA is far less than of the other two algorithms. It shows that the ability of fireworks algorithm to find the optimal solution is very stable and the global search performance is superior. In contrast, the standard deviations of the firefly algorithm and the particle swarm optimization are large. This exposes the instability of the firefly algorithm and the disadvantages of the PSO algorithm being easily trapped in a local optimal solution.
The experimental results show that the optimized Otsu multi-threshold segmentation based on FWA is not easy to fall into the local optimal solution, and its stability is better than the other two algorithms. With the wide application of firefly algorithm and particle swarm optimization, it is shown that the optimized Otsu multi-threshold segmentation method based on the brilliant algorithm can also be applied in various fields.
Conclusion
The analysis of cement SEM images has a very important influence on the engineering performance of cement and concrete. This paper deals with this problem with computer image processing technology and applies an optimized Otsu multi-threshold segmentation based on fireworks algorithm, which solves the problem of inefficient and early maturation caused by classical intelligent optimization algorithm in this field. The experimental results show that the optimized algorithm can achieve the same segmentation effect as the classical algorithm when the number of thresholds is small, and it has the characteristics of being precarious and stable. Since the fireworks algorithm completes the optimal solution search with iteration, the number of iterations should be set according to the demand in order to improve the segmentation efficiency in practical application.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work is funded by the National Natural Science Foundation of China under grant no. 51372076, 41301371, 61502155, by State Key Laboratory of Geo-Information Engineering, no. SKLGIE2014-M-3–3 and Project of Hubei Provincial Department of Education (Q20131407).
