Artificial intelligence-based sucrose particle size distribution closed-loop detection method and system
By acquiring a sequence of microscopic images and calibrating the optimal focal plane position, combined with a particle size correction model, the problem of detection distortion in sucrose particle size detection was solved, and high-precision particle size measurement was achieved.
Patent Information
- Application Number
- CN202611041715.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-11-27
AI Technical Summary
Existing methods for detecting sucrose particle size suffer from detection distortion in microscopic imaging, making it difficult to accurately obtain three-dimensional information of the particles and resulting in inaccurate particle size measurements.
The image sensor acquires a sequence of microscopic images, extracts the edge gradient field and calibrates the optimal focal plane position, combines a pre-trained particle size correction model to perform deviation compensation, and outputs the actual particle size detection value.
It enables accurate measurement of sucrose particle size in microscopic imaging detection, improves the accuracy of particle size measurement and the consistency between particles, and solves the problem of unclear imaging caused by different spatial heights.
Smart Images

Figure CN123181533A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of particle size detection technology, and more specifically, to a distributed closed-loop detection method and system for sucrose particle size based on artificial intelligence. Background Technology
[0002] In the food, pharmaceutical, and chemical industries, particle size distribution is a key physical parameter determining product quality, dissolution rate, and bioavailability. For widely used excipients and sweeteners like sucrose, particle size directly affects subsequent mixing uniformity, tableting properties, and the final product's taste and dissolution behavior. Traditional sieving and microscopy methods have limitations such as being cumbersome, time-consuming, or having insufficient sample representativeness, making it difficult to meet the high demands of modern process analysis and quality control for real-time performance and accuracy. Therefore, introducing particle size detection technologies based on advanced principles such as laser diffraction, dynamic image analysis, or focused beam reflection measurement has become an important means to achieve accurate and efficient characterization of sucrose raw materials and intermediates, providing reliable data support for optimizing process parameters and ensuring batch consistency.
[0003] The current method for detecting sucrose particle size generally uses laser diffraction as its core principle. This technology is based on the phenomenon of particle scattering of laser beams. When a parallel laser beam irradiates sucrose particles dispersed in a gas stream or liquid, particles of different sizes will produce scattered light at different angles and intensities. Their spatial distribution strictly follows the theory of Fraunhofer diffraction or Mie scattering. By capturing these scattered light signals in real time through a multi-angle detector array located in the forward and lateral directions, and performing inversion calculations based on an optical model, the volume equivalent spherical diameter distribution of the particles can be obtained. However, in the microscopic detection of sucrose particles, the particles are not perfect spheres, nor do they always lie flat with their maximum projection surface. When the particles undergo three-dimensional spatial rotation in the flow field or are in a defocused state, the microscopic image only captures the two-dimensional projection of the particle on a certain cross section. This will cause the edge contour of the same particle to be scaled and blurred when imaged at different axial positions, directly resulting in random deviations in the equivalent circle diameter calculated based on a single frame image. This leads to detection distortion of the sucrose particle size to be detected. Therefore, how to accurately detect the sucrose particle size in microscopic imaging has become a difficult problem for the industry. Summary of the Invention
[0004] This application provides a distributed closed-loop detection method and system for sucrose particle size based on artificial intelligence, which can accurately detect sucrose particle size in microscopic imaging detection.
[0005] In a first aspect, this application provides a distributed closed-loop detection method for sucrose particle size based on artificial intelligence, comprising the following steps:
[0006] A sequence of microscopic images of the sugar granules to be tested is acquired using an image sensor. The sequence of microscopic images includes multiple grayscale images of the granules under different focal planes.
[0007] The edge gradient field of the sucrose particle region in each frame of the grayscale image is extracted, and the optimal focal plane position of each sucrose particle region is determined according to the axial response curve of the edge gradient field in the microscopic image sequence.
[0008] Based on the optimal focal plane position, a focused image of each particle region is extracted from the microscopic image sequence, and the equivalent circle diameter of each sucrose particle region is calculated in the focused image. At the same time, the grayscale fluctuation features of the same sucrose particle region at the corresponding position in the microscopic image sequence are extracted.
[0009] The equivalent circle diameter and the grayscale fluctuation feature are concatenated and input into a pre-trained particle size correction model to compensate for the deviation of the sucrose particles to be tested, and the actual particle size detection value of the sucrose particles to be tested is output.
[0010] In some embodiments, acquiring a sequence of microscopic images of the sucrose particles to be tested using an image sensor specifically includes:
[0011] The sucrose particles to be tested are dispersed on the light-transmitting bearing surface of the stage, and the sucrose particles to be tested on the stage are magnified and imaged through the objective lens. An image sensor is configured at the rear end of the optical path of the objective lens.
[0012] During the process of the objective lens performing equidistant axial scanning along the optical axis, the image sensor continuously acquires data at a fixed frame rate to obtain multiple frames of grainy grayscale images under different focal planes.
[0013] Multiple grayscale images of particles under different focal planes are combined into a microscopic image sequence containing all distribution depth information of the sucrose particles to be tested.
[0014] In some embodiments, extracting the edge gradient field of the sucrose particle region in each frame of particle grayscale image specifically includes:
[0015] For each frame of the particle grayscale image in the microscopic image sequence, a multi-scale Gaussian filter kernel is used for convolution processing to obtain a multi-scale smoothed image group. The smoothed images of each scale in the multi-scale smoothed image group form a scale space in order of scale from small to large.
[0016] In the scale space, the temporal gradient along the optical axis and the spatial gradient along the image plane are calculated for each pixel position in the smoothed image at each scale. The temporal gradient and the spatial gradient are fused to obtain a cross-scale edge intensity response map.
[0017] For each pixel location in the cross-scale edge intensity response map, the maximum value of the edge intensity response is searched along the scale axis. The scale corresponding to the maximum value is used as the feature scale of the pixel location, and the edge intensity value under the feature scale is retained to form an edge gradient field consistent with the spatial resolution of the grain grayscale image.
[0018] In some embodiments, determining the optimal focal plane position for each sucrose grain region based on the axial response curve of the edge gradient field in the microscopic image sequence specifically includes:
[0019] In each frame of the particle grayscale image of the microscopic image sequence, the sucrose particle region corresponding to each sucrose particle is segmented from the edge gradient field by connected component analysis.
[0020] For each sucrose particle region, the edge intensity value of all pixels in the sucrose particle region in the edge gradient field corresponding to each frame of the microscopic image sequence is extracted, and the statistics of the edge intensity value in the sucrose particle region are calculated to obtain the particle edge gradient response value of the sucrose particle region in each frame.
[0021] For each sucrose particle region, the gradient response values of the particle edge are arranged according to the frame order of the microscopic image sequence to construct the axial response curve of the gradient of the edge of the sucrose particle region.
[0022] Identify the peak value of the axial response curve, and mark the focal plane position associated with the frame number corresponding to the peak value as the optimal focal plane position for the sucrose particle region.
[0023] In some embodiments, extracting a focused, sharp image of each grain region from the microscopic image sequence based on the optimal focal plane position specifically includes:
[0024] Using the optimal focal plane position of each sucrose particle region as an index, a grayscale image of the particle corresponding to the optimal focal plane position is extracted from the microscopic image sequence and used as the focus frame of the corresponding sucrose particle region.
[0025] Based on the independent edge region of each sucrose particle region, the minimum bounding rectangle of the sucrose particle region is determined in the focus frame.
[0026] From the focused frame of each sugar grain region, a local image patch defined by the minimum bounding rectangle is cropped to obtain a focused, clear image of each grain region.
[0027] In some embodiments, calculating the equivalent circle diameter of each sucrose particle region in the focused, sharp image specifically includes:
[0028] For each particle region, an adaptive threshold segmentation algorithm is used to separate the sucrose particle region from the background to obtain a binarized particle mask.
[0029] Connectivity analysis is performed on the binarized particle mask to extract the connected components corresponding to the sucrose particle region, and the total number of pixels contained in the connected components is counted.
[0030] Based on the total number of pixels, the pixel size of the image sensor, and the magnification of the objective lens, the actual projected area of the sucrose particle region is calculated, and the diameter of the actual projected area is obtained by inversely calculating the diameter of the circle using the formula for the area of a circle.
[0031] In some embodiments, the microscope is a microscope objective.
[0032] Secondly, this application provides an artificial intelligence-based distributed closed-loop detection system for sucrose particle size, used to execute an artificial intelligence-based distributed closed-loop detection method for sucrose particle size. The system includes:
[0033] The acquisition module is used to acquire a sequence of microscopic images of the sucrose particles to be tested through an image sensor. The sequence of microscopic images includes multiple frames of grayscale images of the particles under different focal planes.
[0034] The processing module is used to extract the edge gradient field of the sucrose particle region in each frame of the particle grayscale image, and to calibrate the optimal focal plane position of each sucrose particle region according to the axial response curve of the edge gradient field in the microscopic image sequence.
[0035] The processing module is also used to extract a focused image of each particle region from the microscopic image sequence based on the optimal focal plane position, calculate the equivalent circle diameter of each sucrose particle region in the focused image, and extract the grayscale fluctuation features of the same sucrose particle region at the corresponding position in the microscopic image sequence.
[0036] The execution module is used to concatenate the equivalent circle diameter with the grayscale fluctuation feature and input it into the pre-trained particle size correction model to compensate for the deviation of the sucrose particles to be tested, and output the actual particle size detection value of the sucrose particles to be tested.
[0037] Thirdly, this application provides a computer device, the computer device including a memory and a processor, the memory storing code, the processor being configured to acquire the code and execute the above-described artificial intelligence-based distributed closed-loop detection method for sucrose particle size.
[0038] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned artificial intelligence-based distributed closed-loop detection method for sucrose particle size.
[0039] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects:
[0040] This application enables accurate detection of sucrose particle size in microscopic imaging. First, an image sensor acquires a sequence of microscopic images of the sucrose particles under different focal planes, containing multiple frames of grayscale images. This allows a single scan to completely record the optical imaging information of the particles across the entire depth range of the object space, providing a three-dimensional data foundation for subsequent independent focal plane calibration and sharp image extraction for each particle. Second, by extracting the edge gradient field of the sucrose particle region in each frame of grayscale image and constructing an axial response curve, the optimal focal plane position of each sucrose particle region is calibrated. This transforms the traditional strategy of unified focusing across the entire frame into distributed focal plane calibration based on individual particles. Each particle can obtain an independent optimal imaging focal plane based on its own edge sharpness and axial distribution characteristics, solving the technical problem that multiple particles within the same field of view cannot be simultaneously clearly imaged due to differences in spatial height. This significantly improves the accuracy of particle size measurement and the consistency between particles. Then, based on the independent optimal focal plane position of each particle, its focus is extracted. The process involves obtaining clear images and calculating the equivalent circle diameter. Simultaneously, grayscale fluctuation features are extracted from the microscopic image sequence. Parameters reflecting the two-dimensional projected geometric scale of the particles and parameters reflecting the three-dimensional optical scattering characteristics are acquired in parallel. This ensures that the measurement information of a single particle simultaneously encompasses two complementary dimensions: planar morphological attributes and axial optical attributes, providing comprehensive feature input for subsequent particle size deviation correction. Finally, the equivalent circle diameter and grayscale fluctuation features are concatenated and the deviation is compensated using a pre-trained particle size correction model to output the actual particle size detection value. A nonlinear regression model is used to automatically learn the complex mapping relationship between the two-dimensional projected diameter measurement and the three-dimensional true particle size, influenced by particle thickness, internal density, and surface scattering characteristics. This data-driven approach replaces the multi-factor coupled deviation compensation function, which is difficult to accurately establish in traditional physical model correction methods. This allows for high-precision particle size detection of each sucrose particle without the need for manual calibration of correction coefficients. In summary, the technical solution provided in this application can accurately detect sucrose particle size in microscopic imaging detection. Attached Figure Description
[0041] Figure 1 This is an exemplary flowchart of an artificial intelligence-based distributed closed-loop detection method for sucrose particle size, as shown in some embodiments of this application.
[0042] Figure 2This is an exemplary flowchart illustrating the determination of an edge gradient field according to some embodiments of this application;
[0043] Figure 3 This is a schematic diagram illustrating the principle of extracting a focused image from a sequence of microscopic images, as shown in some embodiments of this application;
[0044] Figure 4 This is a schematic diagram of the structure of an artificial intelligence-based distributed closed-loop detection system for sucrose particle size according to some embodiments of this application;
[0045] Figure 5 This is a schematic diagram of the structure of a computer device that implements an artificial intelligence-based distributed closed-loop detection method for sucrose particle size, according to some embodiments of this application. Detailed Implementation
[0046] To better understand the technical solution of this application, the technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] refer to Figure 1 The figure is an exemplary flowchart of an artificial intelligence-based distributed closed-loop detection method for sucrose particle size according to some embodiments of this application. The figure mainly includes the following steps:
[0048] In step S101, a sequence of microscopic images of the sucrose particles to be tested is acquired by an image sensor. The sequence of microscopic images includes multiple grayscale images of the particles under different focal planes.
[0049] It should be noted that the sucrose particles to be tested in this application refer to solid powder samples existing in a crystalline or pulverized state, with particle sizes mainly ranging from tens of micrometers to several millimeters. Their specific forms may be raw granulated sugar, pulverized powdered sugar, or semi-finished sucrose products that have undergone drying, sieving, and other treatments during the intermediate production process. These particles are mostly irregular polyhedral crystal structures, and their surface properties and internal purity vary depending on the processing technology.
[0050] In some embodiments, acquiring a sequence of microscopic images of the sucrose particles to be tested using an image sensor is achieved through the following steps:
[0051] The sucrose particles to be tested are dispersed on the light-transmitting bearing surface of the stage, and the sucrose particles to be tested on the stage are magnified and imaged through the objective lens. An image sensor is configured at the rear end of the optical path of the objective lens.
[0052] During the process of the objective lens performing equidistant axial scanning along the optical axis, the image sensor continuously acquires data at a fixed frame rate to obtain multiple frames of grainy grayscale images under different focal planes.
[0053] Multiple grayscale images of particles under different focal planes are combined into a microscopic image sequence containing all distribution depth information of the sucrose particles to be tested.
[0054] Specifically, firstly, the sucrose particles to be tested are evenly spread on the light-transmitting surface of the stage using a vibrating and dispersing method. This light-transmitting surface is made of high-transmittance optical glass, ensuring that the particles are dispersed in a single layer to avoid stacking interference. A parallel backlight is placed below the stage for transmitted illumination. The illumination light passes through the light-transmitting surface and the sucrose particles before entering the objective lens, forming a bright-field transmitted light path. The objective lens is used to magnify and image the sucrose particles on the stage. The magnification of the objective lens is selected according to the expected particle size range of the sucrose particles. For example, for sucrose particles with a particle size distribution in the range of 0.2 mm to 2.0 mm, a 5x or 10x microscope objective lens is selected. An image sensor, which is a CMOS or CCD sensor, is placed at the rear end of the objective lens's optical path to convert the optical image formed by the objective lens into a digital grayscale image. Each frame output is a particle grayscale image. The grayscale value of each pixel in the particle grayscale image represents the transmitted light intensity at the focal plane of the objective lens at that pixel position. Then, the objective lens is driven along the optical axis by a precision displacement stage. A unidirectional axial scan with equal step sizes is performed. The scan step size is determined based on the depth of field of the objective lens, with half of the objective lens's depth of field used as the step size to achieve dense coverage of the focal plane. For example, if the objective lens's depth of field is 50 micrometers, the step size is set to 25 micrometers. The scanning start position is one scan step size above the highest expected position of the sucrose particle distribution, and the scanning end position is one scan step size below the light-transmitting support surface of the stage. This ensures that the scanning range covers the entire distribution depth of the sucrose particles. During the unidirectional axial scan of the objective lens along the optical axis, the image sensor continuously acquires data at a fixed frame rate. The frame rate is matched with the scan step size and scanning speed, so that the image sensor acquires exactly one frame of particle grayscale image for every step the objective lens moves. Each frame of particle grayscale image corresponds to a specific focal plane position in the objective lens's optical path. The focal plane position is the coordinate value of the objective lens's object-side focal point along the optical axis at the time of acquisition of that frame. Finally, multiple frames of particle grayscale images under different focal planes are arranged according to the acquisition sequence and combined into a microscopic image sequence containing information on the entire distribution depth of the sucrose particles to be measured.
[0055] It should be noted that the microscopic image sequence in this application refers to multiple frames of particle grayscale images under different focal planes. The particle grayscale image refers to the spatial modulation result of the sucrose particle under test on the transmitted illumination light at the current focal plane position of the objective lens. Specifically, the particle area presents a low grayscale value due to light absorption and scattering, while the background area presents a high grayscale value due to the direct transmission of light. Thus, it reflects the projected contour shape, edge sharpness, and optical transmission characteristics distribution inside the sucrose particle on a two-dimensional plane.
[0056] In step S102, the edge gradient field of the sucrose particle region in each frame of the particle grayscale image is extracted, and the optimal focal plane position of each sucrose particle region is determined according to the axial response curve of the edge gradient field in the microscopic image sequence.
[0057] In some embodiments, reference Figure 2 As shown, this figure is an exemplary flowchart of determining the edge gradient field according to some embodiments of this application. In this embodiment, the extraction of the edge gradient field of the sucrose particle region in each frame of the particle grayscale image is achieved by the following steps:
[0058] In step S1021, each frame of the particle grayscale image in the microscopic image sequence is convolved using a multi-scale Gaussian filter kernel to obtain a multi-scale smoothed image group. The smoothed images of each scale in the multi-scale smoothed image group form a scale space in ascending order of scale.
[0059] In step S1022, in the scale space, the temporal gradient along the optical axis and the spatial gradient along the image plane are calculated for each pixel position in the smoothed image at each scale. The temporal gradient and the spatial gradient are fused to obtain a cross-scale edge intensity response map.
[0060] In step S1023, for each pixel position in the cross-scale edge intensity response map, the maximum value of the edge intensity response is searched along the scale axis direction. The scale corresponding to the maximum value is used as the feature scale of the pixel position, and the edge intensity value under the feature scale is retained to form an edge gradient field consistent with the spatial resolution of the grain grayscale image.
[0061] Specifically, firstly, for each frame of the particle grayscale image in the microscopic image sequence, a set of two-dimensional Gaussian filter kernels with scale parameters increasing geometrically are used for convolution processing. For example, the scale parameter σ takes five levels: 1.0, 1.6, 2.5, 4.0, and 6.3. Each scale's Gaussian kernel is convolved with the particle grayscale image to generate a smooth image. The convolution operation is achieved through frequency domain multiplication or weighted summation using a sliding window in the spatial domain. This results in a set of multi-scale smoothed images with different suppression intensities to eliminate noise and details. The smoothed images at each scale in the multi-scale smoothed image set are arranged in ascending order of scale to form a scale space. The scale space refers to the two-dimensional coordinate system of the image plane. A three-dimensional data volume is spanned by the coordinates of the scale and scale parameters. Then, in scale space, the first-order partial derivatives of grayscale values along the horizontal and vertical directions of the image plane are calculated pixel by pixel for the smoothed image at each scale. A central difference operator, such as a [-1,0,1] kernel, is used for convolution to obtain the spatial gradient magnitude and direction at each pixel location at that scale. The spatial gradient characterizes the degree of change in image brightness within the plane at that scale. Simultaneously, the grayscale difference is calculated at the same pixel location for smoothed images at adjacent scales along the scale axis. The grayscale difference divided by the difference in adjacent scale parameters is used as the temporal gradient along the optical axis at that pixel location. The temporal gradient characterizes the rate of change of image brightness with scale. The degree change simulates the focal plane shift effect along the optical axis. This temporal gradient indirectly reflects the axial defocus response characteristics of the pixel location. The spatial gradient magnitude and temporal gradient magnitude of each pixel location are weighted and fused pixel by pixel. The fusion weight is set according to the relative confidence of the spatial gradient and temporal gradient, for example, the spatial gradient weight is 0.6 and the temporal gradient weight is 0.4. After weighted addition, a cross-scale edge intensity response map is obtained. The cross-scale edge intensity response map refers to a data map in which a comprehensive response value is recorded at each pixel location in the two-dimensional image. This response value is formed by fusing the spatial gradient and the temporal gradient. Pixels with higher response values are more likely to be located at the actual physical boundary of the particle. Finally, For each pixel location in the cross-scale edge intensity response map, the local maxima of the edge intensity response at that pixel location in the scale dimension are searched. That is, when the response value at a certain scale is greater than the response values at its adjacent smaller and larger scales, the scale is recorded as the maximum scale at that pixel location. The maximum scale is used as the feature scale at that pixel location. The feature scale represents the feature observation scale at which the edge signal is strongest at that pixel, and the edge intensity value at the feature scale is retained. The edge intensity value corresponding to the non-maximum scale is set to zero. In this way, a definite edge intensity value is obtained at each pixel location in the image plane, forming an edge gradient field consistent with the spatial resolution of the grain grayscale image.
[0062] It should be noted that, in this application, the edge gradient field refers to the optimal edge response intensity at each pixel position in the frame grain grayscale image. This optimal edge response intensity combines the spatial grayscale change rate in the image plane with the grayscale change rate along the scale axis, which can locate the physical boundary position between the sugar grains and the background on the two-dimensional plane and quantify the sharpness of the optical contrast at the boundary.
[0063] In some embodiments, the optimal focal plane position of each sucrose grain region is determined based on the axial response curve of the edge gradient field in the microscopic image sequence using the following steps:
[0064] In each frame of the particle grayscale image of the microscopic image sequence, the sucrose particle region corresponding to each sucrose particle is segmented from the edge gradient field by connected component analysis.
[0065] For each sucrose particle region, the edge intensity value of all pixels in the sucrose particle region in the edge gradient field corresponding to each frame of the microscopic image sequence is extracted, and the statistics of the edge intensity value in the sucrose particle region are calculated to obtain the particle edge gradient response value of the sucrose particle region in each frame.
[0066] For each sucrose particle region, the gradient response values of the particle edge are arranged according to the frame order of the microscopic image sequence to construct the axial response curve of the edge gradient of the sucrose particle region.
[0067] Identify the peak value of the axial response curve, and mark the focal plane position associated with the frame number corresponding to the peak value as the optimal focal plane position for the sucrose particle region.
[0068] Specifically, firstly, in the edge gradient field corresponding to the grayscale image of each grain in the microscopic image sequence, a threshold-based binarization method is used to convert the edge gradient field into a binary edge map. The threshold is automatically determined using the Otsu method. Pixels with a value of 1 in the binary edge map form an approximately closed loop-shaped edge contour. Connectivity analysis is performed on this binary edge map. The connectivity analysis uses the 8-neighborhood connectivity criterion to traverse all pixels with a value of 1 in the binary edge map, merging spatially adjacent pixels into the same connected region. Each connected region corresponds to the region enclosed by the edge contour of a sucrose grain. Morphological hole filling is then performed on this connected region. This process involves segmenting the sucrose particle region corresponding to each sucrose particle from the edge gradient field. The sucrose particle region refers to the set of all pixels occupied by a single sucrose particle identified in the frame's grayscale image. Pixels with a mask value of 1 belong to that particle, while pixels with a mask value of 0 do not. Next, for each sucrose particle region, using its binary mask as a spatial localization template, the edge intensity values of all pixels within that mask region are extracted frame-by-frame from the edge gradient field corresponding to each frame of the microscopic image sequence. The edge intensity value is the numerical value at the corresponding coordinate in the edge gradient field. This process is repeated for each extracted pixel within the sucrose particle region. The arithmetic mean of the edge intensity values is calculated as a statistical measure. This arithmetic mean is used as the particle edge gradient response value of the sucrose particle region in the current frame. The particle edge gradient response value reflects the average gradient intensity of the edge region of the sucrose particle at the current focal plane position. When the focal plane is close to the optimal focusing position of the particle, the particle edge is sharp and the gradient response value is high. Then, for each sucrose particle region, the particle edge gradient response values of the sucrose particle region in each frame of the microscopic image sequence are arranged sequentially according to the frame order of the microscopic image sequence. The frame number is used as the horizontal axis and the particle edge gradient response value is used as the vertical axis to construct the [statistic / data]. The axial response curve of the edge gradient of the sucrose particle region is a one-dimensional function curve describing the change of the edge gradient intensity of a single sucrose particle with the position of the focal plane. The curve is unimodal, and the peak position corresponds to the focal plane with the clearest edge. Finally, the peak value of the axial response curve is identified. For example, a multi-point quadratic curve fitting is performed on the axial response curve, and the frame number corresponding to the vertex of the fitted parabola is taken as the peak position. This peak position is the frame number corresponding to the maximum gradient response value in the curve. The focal plane position associated with the frame number corresponding to the peak value is marked as the optimal focal plane position of the sucrose particle region.
[0069] It should be noted that, in this application, the optimal focal plane position refers to the objective lens focusing height corresponding to the frame in which the sucrose particles are imaged most sharply in the microscopic image sequence. At this position, the edge gradient response of the particles reaches its maximum, and the optical contrast between the particle outline and the background is the highest. This differs from the processing method commonly used in the prior art, which performs a global search based on the image sharpness evaluation function of the entire frame and uniformly assigns the same optimal focal plane to all particles in the entire image. This method first segments the independent edge region of each sucrose particle from the edge gradient field, and then constructs its own edge gradient axial response curve for each individual particle and searches for the peak value for each particle. This allows each sucrose particle to be independently labeled with an optimal focal plane position corresponding to its own spatial position and shape. In essence, this solves the defect that a single global focal plane cannot take into account the imaging sharpness of all particles when different particles are located at different object distances due to stage tilt, particle size differences, or particle stacking.
[0070] In step S103, based on the optimal focal plane position, a focused image of each particle region is extracted from the microscopic image sequence, and the equivalent circle diameter of each sucrose particle region is calculated in the focused image. At the same time, the grayscale fluctuation features of the same sucrose particle region at the corresponding position in the microscopic image sequence are extracted.
[0071] In some embodiments, extracting a focused, sharp image of each grain region from the microscopic image sequence based on the optimal focal plane position is achieved using the following steps:
[0072] Using the optimal focal plane position of each sucrose particle region as an index, a grayscale image of the particle corresponding to the optimal focal plane position is extracted from the microscopic image sequence and used as the focus frame of the corresponding sucrose particle region.
[0073] Based on the independent edge region of each sucrose particle region, the minimum bounding rectangle of the sucrose particle region is determined in the focus frame.
[0074] From the focused frame of each sugar grain region, a local image patch defined by the minimum bounding rectangle is cropped to obtain a focused, clear image of each grain region.
[0075] Specifically, firstly, using the optimal focal plane position of each sucrose particle region as an index, where the optimal focal plane position is the frame number of a particle grayscale image in the microscopic image sequence, all pixel data of that frame of particle grayscale image are located and extracted in the microscopic image sequence based on this frame number. This extracted frame of particle grayscale image is the focus frame of that sucrose particle region. The focus frame refers to the particle grayscale image in the microscopic image sequence that strictly corresponds to the optimal focal plane position of a single sucrose particle, and the image sharpness of that specific sucrose particle in this frame reaches the highest level of that particle itself in all frames of the sequence. Then, the binary mask corresponding to the independent edge region of the sucrose particle region is obtained. This binary mask is a binary image that identifies all the pixels occupied by the sucrose particle. The coordinates of the foreground pixels with a value of 1 in this binary mask are traversed. The minimum and maximum column coordinates in the horizontal direction and the minimum and maximum row coordinates in the vertical direction of the image plane are recorded respectively. The bounding rectangle formed by these four boundary coordinates is used as the minimum bounding rectangle bounding box of the sucrose particle region. The minimum bounding rectangle bounding box is a rectangle that exactly surrounds all foreground pixels within the independent edge region of the sucrose particle and whose edges are parallel to the image coordinate axes. It is used to define the rectangular range for cropping the local image of the particle from the focusing frame. Finally, based on the four corner coordinates of the minimum bounding rectangle bounding box, the rectangular pixel region defined by the row coordinates from the upper left corner to the row coordinates from the lower right corner and the column coordinates from the upper left corner to the lower right corner is extracted from the focusing frame. This rectangular pixel region is cropped and separated from the focusing frame to form an independent two-dimensional image sub-block. This two-dimensional image sub-block is the focused and clear image of each particle region.
[0076] refer to Figure 3 This figure is a schematic diagram illustrating the principle of extracting a focused image from a sequence of microscopic images according to some embodiments of this application. The left side of the figure shows microscopic grayscale images F1, F2, and F3 corresponding to different axial focal planes. First, the sucrose particle region is located in each frame of microscopic grayscale images. The corresponding region of the same sucrose particle region in different focal plane images is locked. Then, the edge gradient field of each particle region is extracted and the corresponding edge gradient response curve is plotted. The peak position of the curve is the optimal focal plane position of the particle region. Based on the optimal focal plane determination result, the clearest region segment of each sucrose particle region is selected from different focal plane images. Finally, the segments are stitched together to obtain a complete focused image on the right side labeled with different sucrose particle identifiers P1, P2, and P3. This achieves unified clear imaging of sucrose particles at different depths of field, providing a high-precision image basis for subsequent calculation of equivalent circle diameter and extraction of grayscale fluctuation features.
[0077] It should be noted that the "focused sharp image" in this application refers to a local image patch containing only the imaging result of a single sucrose particle at its optimal focal plane position. Its pixel information comes from the frame with the clearest edge of the particle in the microscopic image sequence. This differs from the depth-of-field synthesis or multi-focal image fusion methods commonly used in the prior art, which stitch together the clear regions of multiple frames of images with different focal planes into a composite image where all regions are clear. This method does not perform any cross-frame pixel mixing or fusion operations. Instead, it uses the optimal focal plane position independently calibrated by each sucrose particle region as an index to directly extract the local image patch in the corresponding focal frame of the microscopic image sequence as the focused sharp image of the particle. This ensures that the pixels of the focused sharp image of each particle come entirely from a single focal plane, maintaining the true grayscale distribution of the original optical imaging without introducing fusion artifacts or boundary stitching traces. Thus, while ensuring the optical fidelity of particle size measurement, it achieves the effect of independent extraction of each particle with optimal sharpness when multiple particles are processed in parallel.
[0078] In some embodiments, calculating the equivalent circle diameter of each sucrose particle region in the focused, sharp image is performed using the following steps:
[0079] For each particle region, an adaptive threshold segmentation algorithm is used to separate the sucrose particle region from the background to obtain a binarized particle mask.
[0080] Connectivity analysis is performed on the binarized particle mask to extract the connected components corresponding to the sucrose particle region, and the total number of pixels contained in the connected components is counted.
[0081] Based on the total number of pixels, the pixel size of the image sensor, and the magnification of the objective lens, the actual projected area of the sucrose particle region is calculated, and the diameter of the actual projected area is obtained by inversely calculating the diameter of the circle using the formula for the area of a circle.
[0082] In specific implementation, firstly, for the focused image of each particle region, the Otsu method in the adaptive threshold segmentation algorithm is used to separate the sucrose particle region from the background. The Otsu method iterates through all possible gray levels from 0 to 255, using the gray level that maximizes the inter-class variance between the foreground and background classes as the segmentation threshold. This threshold is then used to binarize the focused image. Pixels with gray values below the threshold are marked as foreground (i.e., sucrose particle regions), and pixels with gray values above the threshold are marked as background, resulting in a binarized particle mask. This binarized particle mask is a binary image of the same size as the focused image, where pixels with a value of 1 correspond to the sucrose particle projection area, and pixels with a value of 0 correspond to the background area. Then, connected component analysis is performed on this binarized particle mask, using the 8-neighborhood connectivity criterion. In the binarized particle mask, all pixels with a value of 1 are grouped into a single connected component, and spatially adjacent foreground pixels are assigned a unique integer label. Since the focused image contains only a single sugar grain, the connected component with the largest area corresponds to the sugar grain region. This connected component is extracted, and the total number of pixels contained within it is counted. The total number of pixels refers to the number of all foreground pixels with the same label value in the connected component, representing the number of sensor pixels occupied by the sugar grain's projection area in the image plane. Finally, the actual projected area of the sugar grain region is calculated based on the total number of pixels, the pixel size of the image sensor, and the magnification of the objective lens. Let the pixel size be p micrometers, the objective lens magnification be M (specifically, the linear magnification, i.e., the ratio of the image size to the object size), and the total number of pixels be N. The actual projected area is then calculated. The actual projected area refers to the true geometric area of the sugar granule projected onto a plane perpendicular to the optical axis along the optical axis in the object space. The diameter is calculated by inversely applying the formula for the area of a circle to the actual projected area S. That is, the equivalent circle diameter of the sugar granule region.
[0083] It should be noted that the equivalent circle diameter in this application refers to the diameter of a standard circle after converting the projected profile of a single irregularly shaped sucrose particle under the optimal focal plane into a circle according to the principle of equal area. This parameter abstracts the two-dimensional projection scale of the sucrose particle into a unified scalar feature, reflecting the overall size of the particle in the imaging plane, and serves as the geometric input feature for subsequent particle size correction model deviation compensation.
[0084] In some embodiments, the extraction of grayscale fluctuation features of the same sucrose particle region at corresponding positions in the microscopic image sequence is achieved through the following steps:
[0085] Based on the minimum bounding rectangle bounding box determined by the independent edge region of each sucrose particle region, the corresponding local region of the sucrose particle region is located in each frame of the particle grayscale image of the microscopic image sequence.
[0086] The mean gray value and standard deviation of all pixels in the corresponding local area are calculated frame by frame to obtain the mean gray value and standard deviation of the local gray value of the sugar grain area in each frame.
[0087] The local gray-level mean and the local gray-level standard deviation are arranged according to the frame order of the microscopic image sequence to construct the gray-level mean axial fluctuation sequence and the gray-level standard deviation axial fluctuation sequence of the sucrose particle region.
[0088] The coefficient of variation of the gray-scale mean axial fluctuation sequence and the coefficient of variation of the gray-scale standard deviation axial fluctuation sequence are used together as the gray-scale fluctuation characteristics of the sucrose particle region.
[0089] Specifically, firstly, based on the minimum bounding rectangle bounding box determined by the independent edge region of each sucrose particle region, in each frame of the particle grayscale image of the microscopic image sequence, using the row and column coordinate interval of the minimum bounding rectangle bounding box as a spatial index, the grayscale values of all pixels within this coordinate interval are extracted frame by frame, forming the corresponding local region of the sucrose particle region in the current frame. The corresponding local region refers to a subset of rectangular pixels within each frame of the particle grayscale image in the microscopic image sequence that maintains the same spatial position as the sucrose particle. Then, for all pixels within the extracted corresponding local region in each frame... The grayscale value is calculated by summing the grayscale values of all pixels within the local region and dividing by the total number of pixels to obtain the local grayscale mean of the sucrose particle region in the current frame. This local grayscale mean reflects the average attenuation of transmitted light intensity within the particle region. Simultaneously, the standard deviation of the grayscale values of all pixels within the local region is calculated to obtain the local grayscale standard deviation of the sucrose particle region in the current frame. This local grayscale standard deviation reflects the unevenness of grayscale distribution within the particle region. After completing the calculation for all frames, the local grayscale mean is then calculated according to the frame order of the microscopic image sequence, i.e., the acquisition order from low to high or high to low focal plane. The gray-scale mean axial fluctuation sequence of the sucrose particle region is formed by arranging the gray-scale mean axial fluctuation sequence in the same frame order. This sequence represents a one-dimensional signal indicating the change in the local gray-scale mean of a single sucrose particle within the same spatial region as the focal plane position, characterizing the evolution of the average intensity of transmitted light along the optical axis. Simultaneously, the local gray-scale standard deviations are arranged sequentially according to the same frame order to form the gray-scale standard deviation axial fluctuation sequence of the sucrose particle region. This sequence represents a one-dimensional signal indicating the change in the local gray-scale standard deviation of a single sucrose particle within the same spatial region as the focal plane position, characterizing the evolution of the average intensity of transmitted light along the optical axis. The evolution of gray-scale non-uniformity within the grain along the optical axis was investigated. Finally, the ratio of the standard deviation to the arithmetic mean of the gray-scale mean axial fluctuation sequence was calculated, i.e., the coefficient of variation is equal to the sequence standard deviation divided by the sequence mean. This ratio eliminates the influence of the absolute numerical dimensions of the sequence, thus obtaining the coefficient of variation of the gray-scale mean axial fluctuation sequence. Similarly, the ratio of the standard deviation to the arithmetic mean of the gray-scale standard deviation axial fluctuation sequence was calculated, thus obtaining the coefficient of variation of the gray-scale standard deviation axial fluctuation sequence. These two coefficients of variation were combined into a two-dimensional feature vector, which together serve as the gray-scale fluctuation characteristics of the sucrose grain region.
[0090] It should be noted that, in this application, the gray-scale fluctuation feature refers to a two-dimensional feature descriptor composed of the coefficients of variation of the two axial fluctuation sequences. It quantifies the relative change amplitude of the local gray-scale level and gray-scale dispersion of the sucrose particle when it is imaged along the optical axis. The gray-scale fluctuation feature can be used as an input parameter in parallel with the equivalent circle diameter to provide axial information reflecting the three-dimensional optical scattering characteristics of the sucrose particle for the pre-trained particle size correction model. This enables the model to distinguish the systematic deviation between the equivalent circle diameter and the real particle size caused by differences in particle thickness, internal light transmittance, or surface scattering characteristics based on the severity of gray-scale changes during particle defocusing. This achieves nonlinear deviation compensation from two-dimensional projection geometric parameters to three-dimensional real particle size.
[0091] In step S104, the equivalent circle diameter and the grayscale fluctuation feature are concatenated and input into the pre-trained particle size correction model to compensate for the deviation of the sucrose particles to be tested, and the actual particle size detection value of the sucrose particles to be tested is output.
[0092] In some embodiments, the equivalent circle diameter and the grayscale fluctuation feature are concatenated and input into a pre-trained particle size correction model for deviation compensation of the sucrose particles to be tested. The actual particle size detection value of the sucrose particles to be tested is output through the following steps:
[0093] For each sucrose particle region, the equivalent circle diameter and the grayscale fluctuation feature are concatenated into a one-dimensional feature vector to obtain the joint feature vector of the sucrose particle region.
[0094] The joint feature vector is input into a pre-trained particle size correction model, which is a nonlinear regression model established by supervised training with the equivalent circular diameter and gray-scale fluctuation features of sucrose particles as input and the calibrated true particle size of sucrose particles as output.
[0095] The particle size correction model performs forward inference on the joint feature vector and outputs the particle size value after bias compensation, which is used as the actual particle size detection value of the sucrose particles to be tested corresponding to the sucrose particle region.
[0096] In practice, firstly, for each sucrose particle region, the three scalar values obtained above—the equivalent circle diameter, the coefficient of variation of the gray-scale mean axial fluctuation sequence, and the coefficient of variation of the gray-scale standard deviation axial fluctuation sequence—are concatenated in a predetermined fixed order. For example, the equivalent circle diameter is used as the first dimension, the coefficient of variation of the gray-scale mean axial fluctuation sequence as the second dimension, and the coefficient of variation of the gray-scale standard deviation axial fluctuation sequence as the third dimension, forming a one-dimensional numerical array of length 3. This one-dimensional numerical array is the joint feature vector of the sucrose particle region. The joint feature vector refers to the combination of geometric features reflecting the two-dimensional projection scale of the particle and features reflecting the particle's... A multidimensional feature descriptor is formed by numerically concatenating the wave characteristics of three-dimensional optical scattering. This joint feature vector is then input into a pre-trained particle size correction model, which is a pre-trained three-layer fully connected feedforward neural network. The input layer contains three neurons corresponding to the three dimensions of the joint feature vector, the hidden layer contains 16 neurons using ReLU rectified linear units as activation functions to introduce nonlinear mapping capabilities, and the output layer contains one neuron to output the corrected particle size value. The network's weight parameters are determined through supervised training using a large number of standard sucrose particle samples with known real particle sizes. During training... The joint feature vector of standard particles is used as input, and the true particle size calibrated by econometric methods is used as the label. Mean squared error is used as the loss function, and the network weights are iteratively updated through backpropagation until the loss function converges. This particle size correction model is a nonlinear regression model established through supervised training, using the equivalent circular diameter and grayscale fluctuation features of sucrose particles as input and the calibrated true particle size of sucrose particles as output. A nonlinear regression model is a mathematical model that can fit the nonlinear functional relationship between input features and output target, unlike a linear regression model which can only fit a weighted summation of the linear relationship between input and output. The nonlinear regression model uses an activation function to guide... The nonlinear transformation can capture the interaction effects between different input features and the complex mapping rules of input features to output targets. Finally, the particle size correction model is called to perform forward inference on the joint feature vector. The forward inference process is to multiply the three values of the joint feature vector by the corresponding elements of the weight matrix from the input layer to the hidden layer and sum them. After nonlinear transformation by the ReLU activation function of the hidden layer, the output of the hidden layer is multiplied by the weight vector from the hidden layer to the output layer and a bias term is added to obtain the scalar output value of the output layer neuron. This output value is the particle size value after bias compensation, which is used as the actual particle size detection value of the sucrose particles corresponding to the sucrose particles in the sucrose particle region.
[0097] It should be noted that the actual particle size detection value in this application refers to the final measurement result of the true geometric particle size of the sucrose particles to be measured in three-dimensional space. This result has compensated for the deviation in two-dimensional projection diameter measurement caused by factors such as particle thickness, light transmittance differences and scattering characteristics.
[0098] In some embodiments, the particle size correction model is trained using the following steps:
[0099] Multiple sucrose standard particle samples with known particle size standard values are obtained. The true particle size of each sucrose standard particle sample is calibrated by an independent metrological method. The image sensor is used to acquire the microscopic image sequence of each sucrose standard particle sample and extract the equivalent circle diameter and grayscale fluctuation features of each sucrose standard particle. The equivalent circle diameter and the grayscale fluctuation features are concatenated and combined with the corresponding true particle size to form a training sample. The training sample set is composed of all the training samples of sucrose standard particles.
[0100] A nonlinear regression model based on a multilayer perceptron is constructed as an initial particle size correction model. The input layer dimension of the initial particle size correction model is consistent with the dimension of the joint feature vector, and the output layer dimension is one-dimensional.
[0101] Using the joint feature vector in the training sample set as input and the corresponding true particle size as supervision label, the initial particle size correction model is backpropagated and iteratively trained using the mean square error loss function until the mean square error loss function converges, thus obtaining the pre-trained particle size correction model.
[0102] In practice, firstly, multiple sucrose standard particle samples with known particle size standards are acquired. The true particle size of each sucrose standard particle sample is calibrated using a metrological method independent of microscopic imaging. The true particle size is recorded in micrometers and used as a label value for subsequent supervised training. Using the same image acquisition process as the sucrose particles to be tested, the equivalent circle diameter, the coefficient of variation of the gray-scale mean axial fluctuation sequence, and the coefficient of variation of the gray-scale standard deviation axial fluctuation sequence corresponding to each sucrose standard particle are acquired. These three values are concatenated into a joint feature vector of length 3 in a fixed order of equivalent circle diameter, gray-scale mean axial fluctuation sequence coefficient of variation, and gray-scale standard deviation axial fluctuation sequence coefficient of variation. This joint feature vector and the true particle size of the sucrose standard particle calibrated by the metrological method are used to form a training sample. The training sample contains a three-dimensional input. The training sample set consists of a data pair of vector and a one-dimensional output scalar, formed by the set of all training samples of all standard sucrose particles. The training sample set refers to the total set of paired input-output data used for parameter fitting of the supervised learning model. Each data pair contains a feature vector extracted from a single standard sucrose particle and its corresponding true particle size label. Then, a nonlinear regression model based on a multilayer perceptron (MLP) is constructed as the initial particle size correction model. An MLP is an artificial neural network consisting of a fully connected input layer, several hidden layers, and an output layer. The input layer dimension of the initial particle size correction model is set to 3, consistent with the dimension of the joint feature vector, accepting three feature values: the equivalent circle diameter and two coefficients of variation. The hidden layer consists of one layer containing 16 neurons and uses ReLU rectified linear units as the activation function. The mathematical form of the ReLU function is... , This refers to taking the larger of 0 and the input value, non-linearly truncating the weighted sum of the input to give the model the ability to fit non-linear mapping relationships. The output layer dimension is set to 1 to correspond to a one-dimensional corrected particle size value. The output layer does not use an activation function and directly outputs real values to support continuous particle size prediction. The connection weights and bias terms between layers are randomly initialized using the Xavier uniform distribution method to stabilize gradient propagation in the early stages of training. Finally, the joint feature vector of each training sample in the training sample set is used as input, and the corresponding true particle size is used as the supervision label. The joint feature vector is fed into the initial particle size correction model and calculated layer by layer to obtain the predicted particle size value of the model output. The mean squared error loss function value between the predicted particle size value and the true particle size label is calculated. The form of the mean squared error loss function is the sum of all training samples. The sum of the squares of the differences between the predicted and labeled values, divided by the number of samples, is used as the loss function to measure the average deviation between the model's prediction and the true particle size. Using the loss function value as the optimization objective, the Adam adaptive moment estimation optimization algorithm is employed to perform backpropagation iterative training on the weights and biases of each layer of the initial particle size correction model. The Adam algorithm adaptively adjusts the learning rate of each parameter by calculating the exponential moving average of the gradient first and second moments of the loss function with respect to each parameter. Typical training hyperparameters are set as follows: initial learning rate 0.001, first moment decay coefficient 0.9, second moment decay coefficient 0.999, and batch size 32. Each iteration of the training sample set constitutes a training cycle, which is repeated for multiple training cycles until the mean squared error loss function value decreases by less than a preset threshold over several consecutive cycles. When convergence is determined, all weights and bias parameters of the model at this point are saved to obtain the pre-trained particle size correction model.
[0103] Specifically, the mathematical expression for the pre-trained particle size correction model is as follows:
[0104] Phase 1 (from input layer to hidden layer):
[0105]
[0106] in, The input is a joint 3D feature vector. The equivalent circle diameter, is the coefficient of variation of the gray-scale mean axial fluctuation sequence. is the coefficient of variation of the grayscale standard deviation axial fluctuation sequence; This is the hidden layer weight matrix, with a dimension of 16×3, containing all connection weights between the 3 neurons in the input layer and the 16 neurons in the hidden layer; is the hidden layer bias vector with a dimension of 16×1; ReLU is the rectified linear unit activation function, which performs operations on the vector element by element. This is the output vector of the hidden layer, with a dimension of 16×1;
[0107] Phase Two (From Hidden Layer to Output Layer):
[0108]
[0109] in, This is the output layer weight vector, with a dimension of 1×16, containing all connection weights between the 16 neurons in the hidden layer and the 1 neuron in the output layer; This is the output layer bias scalar; This is the particle size value output by the model after deviation compensation, which is the actual particle size detection value of the sucrose particles to be tested.
[0110] Model parameter set: The pre-trained particle size correction model consists of a set of parameters determined after training. In full definition, these parameters are obtained by minimizing the mean squared error loss function during training. Optimization was carried out, including The number of training samples. is the true particle size label of the i-th sample.
[0111] It should be noted that the pre-trained particle size correction model in this application refers to a neural network model file that has been optimized with parameters using a large number of standard sucrose particle samples and saved. This model has the ability to map the input joint feature vector into a corrected output value that approximates the true particle size and can be directly used for forward inference of the sucrose particles to be tested.
[0112] Furthermore, in another aspect of this application, in some embodiments, this application provides an artificial intelligence-based distributed closed-loop detection system for sucrose particle size, referencing... Figure 4 The figure is a schematic diagram of the structure of an artificial intelligence-based distributed closed-loop detection system for sucrose particle size according to some embodiments of this application. The artificial intelligence-based distributed closed-loop detection system for sucrose particle size includes: an acquisition module 201, a processing module 202, and an execution module 203, which are described below:
[0113] The acquisition module 201 in this application is mainly used to acquire a sequence of microscopic images of the sucrose particles to be tested through an image sensor. The sequence of microscopic images includes multiple frames of grayscale images of the particles under different focal planes.
[0114] Processing module 202, in this application, is mainly used to extract the edge gradient field of the sucrose particle region in each frame of particle grayscale image, and to calibrate the optimal focal plane position of each sucrose particle region according to the axial response curve of the edge gradient field in the microscopic image sequence.
[0115] The processing module 202 is further configured to extract a focused image of each particle region from the microscopic image sequence based on the optimal focal plane position, calculate the equivalent circle diameter of each sucrose particle region in the focused image, and extract the grayscale fluctuation features of the same sucrose particle region at the corresponding position in the microscopic image sequence.
[0116] The execution module 203 in this application is mainly used to perform feature concatenation between the equivalent circle diameter and the grayscale fluctuation feature, and input it into the pre-trained particle size correction model to perform deviation compensation of the sucrose particles to be tested, and output the actual particle size detection value of the sucrose particles to be tested.
[0117] In addition, this application also provides a computer device, the computer device including a memory and a processor, the memory storing code, the processor being configured to acquire the code and execute the above-described artificial intelligence-based distributed closed-loop detection method for sucrose particle size.
[0118] In some embodiments, reference Figure 5 The figure is a schematic diagram of the structure of a computer device implementing an artificial intelligence-based distributed closed-loop detection method for sucrose particle size according to some embodiments of this application. The artificial intelligence-based distributed closed-loop detection method for sucrose particle size in the above embodiments can... Figure 5 The computer device shown is used to implement this, and the computer device includes at least one processor 301, a communication bus 302, a memory 303, and at least one communication interface 304.
[0119] The processor 301 can be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more devices used to control the execution of the artificial intelligence-based distributed closed-loop detection method for sucrose particle size in this application.
[0120] The communication bus 302 can be used to transmit information between the aforementioned components.
[0121] The memory 303 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.
[0122] The memory 303 stores program code for executing the scheme of this application, and its execution is controlled by the processor 301. The processor 301 executes the program code stored in the memory 303. The program code may include one or more software modules. In the above embodiments, the determination of the artificial intelligence-based distributed closed-loop detection method for sucrose particle size can be achieved by the processor 301 and one or more software modules in the program code in the memory 303.
[0123] Communication interface 304 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0124] In a specific implementation, as one example, a computer device may include multiple processors, each of which may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0125] The aforementioned computer device can be a general-purpose computer device or a special-purpose computer device. In specific implementations, the computer device can be a desktop computer, a portable computer, a network server, a handheld digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. This application does not limit the type of computer device.
[0126] In addition, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described artificial intelligence-based distributed closed-loop detection method for sucrose particle size.
[0127] Although preferred embodiments of this application have been described, those skilled in the art, once they have learned the basic inventive concept, can make other changes and modifications to these embodiments.
[0128] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application.
Claims
1. A distributed closed-loop detection method for sucrose particle size based on artificial intelligence, characterized in that, Includes the following steps: A sequence of microscopic images of the sugar granules to be tested is acquired using an image sensor. The sequence of microscopic images includes multiple grayscale images of the granules under different focal planes. The edge gradient field of the sucrose particle region in each frame of the grayscale image is extracted, and the optimal focal plane position of each sucrose particle region is determined according to the axial response curve of the edge gradient field in the microscopic image sequence. Based on the optimal focal plane position, a focused image of each particle region is extracted from the microscopic image sequence, and the equivalent circle diameter of each sucrose particle region is calculated in the focused image. At the same time, the grayscale fluctuation features of the same sucrose particle region at the corresponding position in the microscopic image sequence are extracted. The equivalent circle diameter and the grayscale fluctuation feature are concatenated and input into a pre-trained particle size correction model to compensate for the deviation of the sucrose particles to be tested, and the actual particle size detection value of the sucrose particles to be tested is output.
2. The method as described in claim 1, characterized in that, The acquisition of a sequence of microscopic images of the sucrose particles to be tested using an image sensor specifically includes: The sucrose particles to be tested are dispersed on the light-transmitting bearing surface of the stage, and the sucrose particles to be tested on the stage are magnified and imaged through the objective lens. An image sensor is configured at the rear end of the optical path of the objective lens. During the process of the objective lens performing equidistant axial scanning along the optical axis, the image sensor continuously acquires data at a fixed frame rate to obtain multiple frames of grainy grayscale images under different focal planes. Multiple grayscale images of particles under different focal planes are combined into a microscopic image sequence containing all distribution depth information of the sucrose particles to be tested.
3. The method as described in claim 1, characterized in that, Extracting the edge gradient field of the sucrose particle region in each frame of the grayscale image specifically includes: For each frame of the particle grayscale image in the microscopic image sequence, a multi-scale Gaussian filter kernel is used for convolution processing to obtain a multi-scale smoothed image group. The smoothed images of each scale in the multi-scale smoothed image group form a scale space in order of scale from small to large. In the scale space, the temporal gradient along the optical axis and the spatial gradient along the image plane are calculated for each pixel position in the smoothed image at each scale. The temporal gradient and the spatial gradient are fused to obtain a cross-scale edge intensity response map. For each pixel location in the cross-scale edge intensity response map, the maximum value of the edge intensity response is searched along the scale axis. The scale corresponding to the maximum value is used as the feature scale of the pixel location, and the edge intensity value under the feature scale is retained to form an edge gradient field consistent with the spatial resolution of the grain grayscale image.
4. The method as described in claim 1, characterized in that, Based on the axial response curve of the edge gradient field in the microscopic image sequence, determining the optimal focal plane position for each sucrose particle region specifically includes: In each frame of the particle grayscale image of the microscopic image sequence, the sucrose particle region corresponding to each sucrose particle is segmented from the edge gradient field by connected component analysis. For each sucrose particle region, the edge intensity value of all pixels in the sucrose particle region in the edge gradient field corresponding to each frame of the microscopic image sequence is extracted, and the statistics of the edge intensity value in the sucrose particle region are calculated to obtain the particle edge gradient response value of the sucrose particle region in each frame. For each sucrose particle region, the gradient response values of the particle edge are arranged according to the frame order of the microscopic image sequence to construct the axial response curve of the edge gradient of the sucrose particle region. Identify the peak value of the axial response curve, and mark the focal plane position associated with the frame number corresponding to the peak value as the optimal focal plane position for the sucrose particle region.
5. The method as described in claim 1, characterized in that, Extracting a focused, clear image of each particle region from the microscopic image sequence based on the optimal focal plane position specifically includes: Using the optimal focal plane position of each sucrose particle region as an index, a grayscale image of the particle corresponding to the optimal focal plane position is extracted from the microscopic image sequence and used as the focus frame of the corresponding sucrose particle region. Based on the independent edge region of each sucrose particle region, the minimum bounding rectangle of the sucrose particle region is determined in the focus frame. From the focused frame of each sugar grain region, a local image patch defined by the minimum bounding rectangle is cropped to obtain a focused, clear image of each grain region.
6. The method as described in claim 1, characterized in that, Calculating the equivalent circle diameter for each sucrose particle region in the focused, sharp image specifically includes: For each particle region, an adaptive threshold segmentation algorithm is used to separate the sucrose particle region from the background to obtain a binarized particle mask. Connectivity analysis is performed on the binarized particle mask to extract the connected components corresponding to the sucrose particle region, and the total number of pixels contained in the connected components is counted. Based on the total number of pixels, the pixel size of the image sensor, and the magnification of the objective lens, the actual projected area of the sucrose particle region is calculated, and the diameter of the actual projected area is obtained by inversely calculating the diameter of the circle using the formula for the area of a circle.
7. The method as described in claim 2, characterized in that, The microscope used is a microscope objective.
8. An artificial intelligence-based distributed closed-loop detection system for sucrose particle size, used to execute the artificial intelligence-based distributed closed-loop detection method for sucrose particle size as described in any one of claims 1 to 7, characterized in that, The system includes: The acquisition module is used to acquire a sequence of microscopic images of the sucrose particles to be tested through an image sensor. The sequence of microscopic images includes multiple frames of grayscale images of the particles under different focal planes. The processing module is used to extract the edge gradient field of the sucrose particle region in each frame of the particle grayscale image, and to calibrate the optimal focal plane position of each sucrose particle region according to the axial response curve of the edge gradient field in the microscopic image sequence. The processing module is also used to extract a focused image of each particle region from the microscopic image sequence based on the optimal focal plane position, calculate the equivalent circle diameter of each sucrose particle region in the focused image, and extract the grayscale fluctuation features of the same sucrose particle region at the corresponding position in the microscopic image sequence. The execution module is used to concatenate the equivalent circle diameter with the grayscale fluctuation feature and input it into the pre-trained particle size correction model to compensate for the deviation of the sucrose particles to be tested, and output the actual particle size detection value of the sucrose particles to be tested.
9. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the artificial intelligence-based distributed closed-loop detection method for sucrose particle size as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the artificial intelligence-based distributed closed-loop detection method for sucrose particle size as described in any one of claims 1 to 7.
