**1. Introduction**

Crystallization is an important process to obtain crystalline solids from mixed solutions in pharmaceutical and chemical industries [1]. The cooling crystallization process usually includes the formation of a supersaturated solution, nucleation and crystal growth, etc. Crystal size distribution (CSD) is one of key indicators to evaluate the crystallization production quality [2,3]. It is necessary to measure the growth parameters of the crystal population for process optimization and feedback control [4–6]. In recent years, researchers have made significant advances in process analytical technology (PAT) for monitoring crystallization processes, e.g., ATR-FTIR spectroscopy, Raman spectroscopy, focused beam reflectance measurement (FBRM), ultrasound spectroscopy, etc.

With the development of optical imaging sensors, crystallization process detection strategies using image measurement have been promoted for crystal defects, sizes, and shapes [7–12]. Larsen et al. [13] analyzed the high concentration crystal image effectively and processed the needle crystal, making a detailed analysis of various characteristics of the crystal from different application values, striving to achieve a comprehensive description of the crystal. Zhou et al. [14] proposed some parameter optimization approaches for image processing applied to extract useful information from microscopy images regarding the distribution monitoring of particle shape and size. Lins et al. [15] developed a detection method of crystal defects, including crystal contour detection and defect quantification for evaluating and optimizing crystallization processes. For the measurement of crystal agglomeration, Ferreira et al. [16] proposed a novel image analysis technique which combined discriminant factorial analysis to assess the agglomeration of crystals. Lu et al. [17] developed a valid crystal segmentation approach based on background difference and local threshold to overcome the negative effect of particle shadow. In previous work [10], an online image measuring method was presented to analyze two-dimension (2D) crystal sizes during cooling crystallization. Gao et al. [18] developed a valid image analysis technology based on deep learning to detect crystals and measure their sizes. Ma et al. [19] applied a novel online image monitoring system to measure

**Citation:** Huo, Y.; Li, X.; Tu, B. Image Measurement of Crystal Size Growth during Cooling Crystallization Using High-Speed Imaging and a U-Net Network. *Crystals* **2022**, *12*, 1690. https://doi.org/10.3390/ cryst12121690

Academic Editors: Mingyang Chen, Jinbo Ouyang and Dandan Han

Received: 4 November 2022 Accepted: 20 November 2022 Published: 22 November 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

the growth rate for mean crystal size during LGA crystallization processes. Traditionally, the growth rate was measured based on the mean sizes for β-form L-glutamic acid [20–23], but the changes of the crystal population size distribution were not quantized and estimated roundly in the previous literature.

In this work, in order to eliminate the influence of continuous motion in a stirred reactor, an effective strategy is presented for the growth of crystal population sizes using the imaging measurement method based on a deep learning model. Firstly, for the online crystal images influenced by solution turbulence, uneven illumination, and noise, image preprocessing is used. Secondly, the valid crystals are extracted by an effective image segmentation method using a U-net network model. Thirdly, the CSDs are computed with the measured 2D sizes and probability density function. An indicator for describing the growth of crystal 2D size distribution is estimated with a statics method. Experimental results for the case of the cooling crystallization of β-form L-glutamic acid (LGA) show the effectiveness of the proposed imaging measurement method.

The article is organized as follows. Section 2 introduces the basic algorithms. The Section 3 is dedicated to the experimental set-up. Section 4 demonstrates in detail the method of image measurement based on the U-net network. The experimental case is made for the validity of the method in the Section 5. Finally, conclusions are given in the Section 6.

#### **2. Preliminaries**

#### *2.1. Classical Convolution Neural Network*

Convolutional neural network (CNN) is a basic deep neural network with a convolution structure. In 1998, Lecun et al. [24] designed and trained a CNN model (called LeNet-5), which is a classical CNN structure. The basic structure of CNN is composed of an input layer, a convolution layer, a pooling layer, a full connection layer and an output layer, as shown in Figure 1. Generally, a convolution layer is connected with a pooling layer, and the last few layers near the output layer are usually fully connected networks. The training process of CNN is to learn the convolution kernel parameters of convolution layer and the connection weight between layers. In image recognition, the prediction process is mainly based on the input image and network parameters to calculate the category label.

**Figure 1.** Architecture of convolutional neural network.

#### *2.2. U-Net Network*

U-net network [25] is a full convolutional network improved based on fully convolutional networks (FCN) [25], which is similar to U-type. Compared with other convolutional neural networks, this network requires smaller training set size and has higher segmentation accuracy. A basic U-net network structure consists of a down-sampling path (encoder) and an up-sampling path (decoder). The down-sampling path is used to obtain the context information, and the up-sampling path is used to pinpoint the location. The down-sampling path is in the left of the network, which consists of 3 × 3 convolution layers and 2 × 2 max pool layers. The activation function *f*(*x*) uses ReLU [26], which is defined with *τ* > 0 as

$$f(\mathbf{x}) = \begin{cases} \ x, & \mathbf{x} > \mathbf{0} \\ \ \pi(e^{\mathbf{x}} - 1), & \mathbf{x} \le \mathbf{0} \end{cases} \tag{1}$$

The up-sampling path is in the right of the network. The deconvolution is used to halve the number of channels, then the deconvolution result is spliced with the corresponding feature map, and the spliced feature map is then convolved with a 3 × 3 kernal. The last layer uses a 1 × 1 convolution to map each 2-bit feature vector to the output layer of the network.

#### **3. Experimental Set-Up**

The experimental setup with an imaging system for measuring crystal size distribution is shown in Figure 2. Experiments were carried out with a crystallizer includinga1L glass jacketed reactor and a PTFE four-paddle agitator. The temperature control device used a Julabo-CF41 thermostatic circulator (JULABO, Seelbach, Germany). A Pt100 temperature probe was used to measure the solution temperature. A camera device (UI-2280SEC-HQ, IDS, Obersulm, Germany) was adopted to record online crystallization images in cooling crystallization processes. The imaging system includes the following functions: image acquisition, image storage, image compression, image output, etc., which was connected to an industrial personal computer. An LED light and controller (Gardasoft -RT260-20, Gardasoft Vision, Cambridge, UK) were employed to provide illumination.

**Figure 2.** Schematic drawing of the experimental setup.

The material used in this experiment was L-glutamic acid (LGA) (Sigma Chemicals, St Louis, MO, USA), which has two forms, the α form and β form. This experiment mainly focused on the study of needle-like β-form LGA. The growth of β-form crystals is statistically analyzed by image analysis in the reactor. The stirring rate was maintained at 200 rpm. Firstly, 0.6 L LGA solution with a concentration of 30 g/L was used in the reactor. The solution was heated to 70 ◦C and then cooled to 30 ◦C after 1 h of constant temperature. When the temperature dropped to 55 ◦C, β-form seeds were added into the reactor, and the online crystal images were recorded with the imaging system.
