Microscopic image enhancement detection method for chuzhou carassius auratus spore disease based on deep learning

By combining deep learning methods with techniques such as local variance distribution, multi-scale morphological gradients, and phase-consistent diffusion, the robustness and visualization problems of sporozoite detection under non-uniform illumination were solved, achieving high-precision sporozoite enhanced detection and improving the interpretability and accuracy of the detection results.

CN122636620APending Publication Date: 2026-08-25ANHUI AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611124701.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing technologies cannot effectively adapt to non-uniform lighting interference, have low robustness in locating candidate regions of spores, are easily damaged at the edges of small targets, and have poor visualization effects in fusion of detection results, making it difficult to achieve high-precision enhancement and detection under complex microscopic backgrounds.

Method used

A deep learning-based approach is employed, which utilizes non-uniform illumination compensation based on local variance distribution, coarse localization of sporozoite candidate regions using multi-scale morphological gradients, anisotropic diffusion filtering with phase consistency, texture feature extraction based on grayscale run-length matrix, and fine segmentation based on local entropy differences. Combined with Poisson image editing, image fusion is performed to generate high-precision sporozoite enhanced detection results.

Benefits of technology

It achieves high-precision enhancement and detection of spores under non-uniform lighting conditions, significantly enhances fine edges and texture structures, generates clear and visualized detection results that blend naturally with the original background without any stitching marks, and improves the interpretability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122636620A_ABST
    Figure CN122636620A_ABST
Patent Text Reader

Abstract

The application discloses a microimage enhancement detection method for Chuzhou Carassius auratus spore worm disease based on deep learning, and belongs to the field of microimage analysis. The method comprises the following steps: obtaining an initial microimage and performing non-uniform illumination compensation based on local variance distribution to obtain an illumination balanced image; performing spore worm candidate region rough positioning based on a multi-scale morphological gradient to obtain a binary mask image; performing anisotropic diffusion filtering based on phase consistency in the candidate region to obtain an edge-preserving enhanced image; extracting a spore worm texture feature vector set based on a gray run-length matrix; performing spore worm target fine segmentation based on local entropy difference according to the texture feature and the mask to obtain a spore worm segmentation image; and performing image fusion based on Poisson image editing on the segmentation image and the initial microimage to generate a spore worm enhanced detection result image. The method solves the problem of spore worm detection under non-uniform illumination, and realizes high-precision enhancement and visualization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microscopic image analysis technology, specifically to a deep learning-based method for enhancing and detecting microscopic images of crucian carp cysticercosis in Chuzhou. Background Technology

[0002] Microscopic examination of crucian carp spore disease in Chuzhou is a crucial diagnostic method. However, due to limitations in microscopic imaging conditions and the inherent differences in light transmittance within biological tissues, the acquired microscopic images commonly exhibit severe uneven illumination, manifesting as localized overexposure, vignetting, and gradual halos. This severely compresses the contrast between the spore-forming organisms and the tissue background. The spore-forming organisms are tiny, morphologically diverse, and often encased in tissue fragments, cellular debris, and other impurities, creating complex scenes with low contrast and numerous distractions. Existing illumination correction schemes for microscopic images primarily employ homomorphic filtering, histogram equalization, or background subtraction based on fixed templates. These methods rely on global statistical assumptions or pre-defined illumination models, failing to adaptively analyze the varying local illumination distribution within the image. When processing complex biological samples, they are prone to erasing or distorting already subtle spore-forming details while eliminating uneven illumination, and may even introduce reverse halo artifacts.

[0003] In the detection of sporozoites, conventional threshold segmentation, edge detection, and single-scale morphological operations often fail to adapt to the size range of sporozoites, resulting in missed detections of small sporozoites with indistinct boundaries and numerous false detections of larger impurity clusters. Regarding segmentation strategies, these methods do not fully utilize the unique texture arrangement information of sporozoites, making it difficult to accurately distinguish sporozoites from the background in regions with similar tissue structures. Furthermore, existing detection results are mostly output as outlines or binary masks, failing to clearly display the internal structural information of sporozoites, resulting in a harsh visualization that hinders subsequent manual verification.

[0004] Therefore, it is necessary to solve the problems of how to adaptively compensate for illumination and robustly locate multi-scale spore candidate regions under non-uniform illumination conditions, and how to enhance the subtle edges and textures of spores while suppressing background interference, and generate an enhanced detection image that preserves the original microscopic features and highlights the spore target. Summary of the Invention

[0005] The purpose of this invention is to provide a deep learning-based method for enhancing and detecting microscopic images of crucian carp spore disease, which solves the problems of existing technologies being unable to effectively adapt to non-uniform lighting interference, having low robustness in locating candidate regions of spores, having small target edges that are easily damaged, and having poor visualization effects in the fusion of detection results, thereby achieving high-precision enhancement and detection of spores under complex microscopic backgrounds.

[0006] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a deep learning-based method for enhancing and detecting microscopic images of crucian carp cysticercosis, comprising:

[0007] An initial microscopic image of a crucian carp tissue sample from Chuzhou was acquired. Non-uniform illumination compensation based on local variance distribution was then performed on the initial microscopic image to obtain an illuminated image. Specifically, the initial microscopic image was divided into multiple local sub-blocks, and the pixel gray-level variance of each sub-block was calculated. After sorting in ascending order, the local sub-blocks at a predetermined proportion of the sorted sequence were selected as background illumination reference sub-blocks. A two-dimensional illumination background surface was constructed using the pixel gray-level mean of these reference sub-blocks. This surface was then expanded to the original image size using bicubic interpolation to obtain an estimated illumination background image. Finally, a pixel-by-pixel difference operation was performed between the initial microscopic image and the estimated illumination background image to effectively eliminate non-uniform illumination interference in microscopic imaging, making the image background brightness more uniform.

[0008] Coarse localization of sporozoite candidate regions based on multi-scale morphological gradients is performed on the illumination-equalized image to obtain a binary mask image containing the sporozoite candidate regions. Preferably, morphological dilation and erosion operations are performed on the illumination-equalized image using structuring elements of different sizes to obtain morphological gradient images at each size. The maximum value of each pixel in all gradient images is used to construct a multi-scale morphological gradient peak image. An adaptive threshold is determined based on the valley position of its gray-level histogram for binarization, and connected components with an area smaller than the preset lower limit of sporozoite area are removed. This allows for the rapid and accurate delineation of regions of interest where sporozoites may exist while suppressing interference from tissue debris and impurities.

[0009] Based on the binary mask image, anisotropic diffusion filtering based on phase consistency is performed on the pixels corresponding to the spore candidate region in the illumination equalization image to obtain an edge-preserving enhanced image. Specifically, a diffusion tensor matrix of the pixels is constructed based on the phase consistency response value of the illumination equalization image, such that the direction of the principal eigenvector of the diffusion tensor is perpendicular to the direction of the maximum phase consistency response. During the iterative diffusion process, anisotropic diffusion updates are only performed on pixels inside the candidate region defined by the binary mask, while the gray values ​​of pixels outside the candidate region remain fixed. In this way, after multiple iterations, the weak edges and fine structures of the spores are significantly enhanced, while avoiding the background region from being incorrectly enhanced, resulting in a prominent edge-preserving effect.

[0010] The edge-preserving enhanced image is subjected to sporozoite texture feature extraction based on the gray-level run-length matrix to obtain a sporozoite texture feature vector set. As a technical solution of this invention, the gray-level run-length of pixels within each candidate sporozoite region is traversed along a preset direction to establish a gray-level run-length matrix. Based on this matrix, the run-length non-uniformity feature value and gray-level non-uniformity feature value of each candidate region are calculated, thereby obtaining the texture complexity and gray-level distribution dispersion. These are then combined according to the spatial arrangement order of the candidate regions to form a sporozoite texture feature vector set, providing a discriminative texture representation for subsequent fine segmentation.

[0011] Based on the sporozoite texture feature vector set and the binary mask image, fine segmentation of the sporozoite target based on local entropy difference is performed on the edge-preserving enhanced image to obtain a sporozoite segmentation image. A local entropy map is obtained by calculating the local neighborhood entropy value of each pixel within the candidate region. A corresponding local entropy adjustment factor is determined based on the texture attributes of each candidate region in the texture feature vector set, and this factor is then weighted pixel-by-pixel with the local entropy map to obtain an adjusted local entropy difference map. Finally, the maximum inter-class variance criterion is used for binarization segmentation, thereby achieving accurate separation of the sporozoite target from the background, with clear segmentation boundaries and strong false target removal capability.

[0012] The sporozoite segmentation image and the initial microscopic image are fused using Poisson image editing to obtain the sporozoite enhanced detection result image. Preferably, the boundary of the target region in the sporozoite segmentation image is used as the guide field boundary. The gradient field of the corresponding region in the initial microscopic image is extracted and weighted with the gradient field of the corresponding target region in the edge-preserving enhanced image to form a fused gradient field. The pixel values ​​of the initial microscopic image on the guide field boundary are used as Dirichlet boundary conditions to construct a discrete Poisson equation system. The fused pixel values ​​of the reconstructed sporozoite target region are solved using the successive over-relaxation iteration method, and the original pixel values ​​of the corresponding region in the initial microscopic image are replaced. The fused image significantly highlights the morphology and texture details of the sporozoites while seamlessly integrating with the original background without any stitching marks, greatly improving the visual recognizability and detection accuracy of the sporozoites.

[0013] The technical effects and advantages provided by the present invention in the above technical solution are as follows:

[0014] A strategy combining non-uniform illumination compensation based on local variance distribution and coarse localization using multi-scale morphological gradients is employed. In the illumination compensation stage, the initial microscopic image is divided into dense local sub-blocks, and the pixel gray-level variance is calculated. By selecting low-fluctuation sub-blocks with variances at a predetermined proportion prior to the sorting sequence as reliable background sampling points, the background estimation is entirely driven by the real background region, avoiding interference from high-contrast areas of the sporozoites. A sparse background surface is constructed using the gray-level mean of these background reference sub-blocks, and then expanded through bicubic interpolation into a fine-grained illumination-background estimation image matching the original image size. Pixel-by-pixel difference calculations between the original image and this background image yield a globally uniform illumination-balanced image. This method accurately fits the surface trend of illumination, effectively removes halos and shadows, while completely preserving the original contrast of the sporozoite region, thus revealing faint targets hidden in dark areas or bright spots. In the coarse localization stage of candidate regions, morphological dilation and erosion operations are performed in parallel on the illumination-equalized image using structuring elements of different sizes to obtain multiple morphological gradient images. The maximum value of each pixel in all gradient images is then taken to generate a multi-scale morphological gradient peak image. The valley positions of the gray-level histogram of this peak image are used to determine an adaptive threshold for binarization. Then, morphological connected component area filtering is used to retain only connected components with an area greater than the preset lower limit of the sporozoite area as binary masks for the sporozoite candidate regions. Multi-scale gradient peak fusion ensures that the edges of sporozoites of various sizes produce strong responses, while large background areas and small noise points are effectively suppressed, thus significantly improving the completeness and accuracy of candidate region extraction without overlooking low-contrast targets. In the edge preservation enhancement and fine segmentation stage, an anisotropic diffusion filter based on phase consistency is introduced to specifically enhance the sporozoite candidate regions. The phase consistency response value of the illumination-equalized image is calculated, and a diffusion tensor is constructed based on the direction of the maximum phase response of each pixel, ensuring that its principal feature vector direction is parallel to the edge direction, i.e., the main diffusion direction is consistent with the perpendicular direction of the edge, allowing the diffusion process to proceed along the edge tangent direction. In the anisotropic diffusion iteration driven by the diffusion tensor, pixels in non-spore candidate regions are forced to remain fixed, thus concentrating the filtering energy entirely within the candidate target. Phase consistency is insensitive to gray-level translation and only responds to structural features. Therefore, while smoothing internal tissue noise and enhancing texture consistency, the diffusion process not only avoids blurring weak edges such as spore cyst walls but also gradually enhances their continuity, resulting in a high-resolution edge-preserving enhanced image. Subsequently, a gray-level run-length matrix is ​​constructed by traversing pixels within the candidate region. Run-length non-uniformity feature values ​​and gray-level non-uniformity feature values ​​are extracted, thereby defining the texture complexity and gray-level distribution dispersion of each candidate region, forming a spore texture feature vector set.During fine segmentation, the local neighborhood entropy value corresponding to each candidate region is calculated, and a local entropy adjustment factor is adaptively generated using information from the texture feature vector set. The local entropy map is then weighted pixel-by-pixel, enhancing the entropy value of regions with significant sporozoite features while relatively suppressing tissue regions similar to the background. Binarization segmentation based on the maximum inter-class variance criterion is performed on the adjusted local entropy difference map, accurately separating sporozoite segments with rounded boundaries and intact interiors. Finally, the sporozoite segmented image is fused with the initial microscopic image using Poisson image editing. The gradient field inside the initial image is extracted and weighted averaged with the corresponding gradient field of the edge-preserving enhanced image to obtain the fused gradient field. Using the original pixel values ​​at the segmentation boundary as Dirichlet boundary conditions, the Poisson equation is solved iteratively using successive over-relaxation to reconstruct the fused pixel values ​​of the sporozoite target region and replace the original pixels. This fusion method allows the enhanced sporozoan structure to be seamlessly embedded into the original microscopic background, which not only presents the enhanced internal texture details of the sporozoan to the greatest extent, but also ensures a natural transition in brightness and color with the surrounding tissue, greatly improving the interpretability of the detection result image. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0016] Figure 1 This is a flowchart of a deep learning-based method for enhancing microscopic images of crucian carp cysticercosis in Chuzhou.

[0017] Figure 2 This is a flowchart of non-uniform illumination compensation based on local variance distribution;

[0018] Figure 3 This is a flowchart of coarse localization of candidate regions for sporozoites based on multi-scale morphological gradients;

[0019] Figure 4 This is a flowchart of an anisotropic diffusion filtering method based on phase consistency;

[0020] Figure 5 This is a flowchart of sporozoite texture feature extraction based on grayscale run-length matrix;

[0021] Figure 6 This is a flowchart of the method for enhancing the detection of spores;

[0022] Figure 7 This is a schematic diagram showing the ascending order of pixel grayscale variance of local sub-blocks and the background reference threshold;

[0023] Figure 8 It is a multi-scale morphological gradient peak map adaptive threshold determination map;

[0024] Figure 9 It is a map showing the cumulative distribution of local entropy differences and the optimal segmentation threshold for the maximum inter-class variance. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] See Figure 1 This invention provides a deep learning-based method for enhancing and detecting microscopic images of crucian carp spore disease in Chuzhou. The method involves acquiring an initial microscopic image of a Chuzhou crucian carp tissue sample, performing non-uniform illumination compensation based on local variance distribution to obtain an illumination-balanced image, and then performing coarse localization of spore candidate regions based on multi-scale morphological gradients on the illumination-balanced image to obtain a binary mask image containing these candidate regions. Based on the binary mask image, anisotropic diffusion filtering based on phase consistency is applied to the pixels corresponding to the spore candidate regions in the illumination-balanced image to obtain an edge-preserving enhanced image. The edge-preserving enhanced image is then subjected to spore texture feature extraction based on gray-level run-length matrix to obtain a spore texture feature vector set. Based on the spore texture feature vector set and the binary mask image, the edge-preserving enhanced image is then subjected to fine segmentation of the spore targets based on local entropy differences to obtain a spore segmentation image. Finally, the spore segmentation image and the initial microscopic image are fused using Poisson image editing to obtain the spore enhancement detection result image.

[0027] Example 1: In specific implementation, please refer to Figure 2After obtaining the initial microscopic image of the Chuzhou crucian carp tissue sample, non-uniform illumination compensation based on local variance distribution is performed on the initial microscopic image. The initial microscopic image is divided into multiple local sub-blocks. The division method can be to use a fixed-size rectangular sliding window to divide the initial microscopic image sequentially from the upper left corner in a row-to-column order. Some overlap between adjacent local sub-blocks is allowed. The overlap width is determined according to the size of the initial microscopic image and the degree of uneven illumination change. For example, the overlap width can be set to one-third of the side length of the local sub-block to ensure the spatial continuity of the subsequent background illumination estimation. For each local sub-block, the pixel gray-level variance value of the local sub-block is calculated. The pixel gray-level variance value is calculated by first obtaining the gray-level values ​​of all pixels in the local sub-block and calculating the gray-level mean of the local sub-block. Then, the sum of squares of the differences between the gray-level values ​​of each pixel in the local sub-block and the gray-level mean of the local sub-block is calculated. Finally, the sum of squares is divided by the total number of pixels in the local sub-block to obtain the pixel gray-level variance value of the local sub-block. The expression is as follows:

[0028]

[0029] in, This represents the pixel grayscale variance value of a local sub-block. This represents the total number of pixels within a local sub-block. Indicates the first sub-block within the local sub-block grayscale value of each pixel. This represents the average pixel grayscale value of a local sub-block.

[0030] After obtaining the pixel grayscale variance values ​​of all local sub-blocks, these values ​​are arranged in ascending order. Several local sub-blocks at a predetermined percentage position before the sorted sequence are selected as background illumination reference sub-blocks. The predetermined percentage is set based on the proportion of non-uniform illumination covering the image area during microscopic imaging, and is set to 20%. This means that the top 20% of local sub-blocks with the smallest pixel grayscale variance values ​​are selected as background illumination reference sub-blocks. The image areas corresponding to these background illumination reference sub-blocks are less affected by spore structures or impurities, and can more accurately reflect the gradual change trend of the illumination background.

[0031] A two-dimensional (2D) illuminated background surface is constructed based on the average pixel grayscale values ​​of all background illumination reference sub-blocks. Specifically, the center pixel coordinates of each selected background illumination reference sub-block are used as sampling points, and the average pixel grayscale value of that sub-block is used as the attribute value of that sampling point, forming a sparse set of sampling points. Using this set of sampling points, a 2D illuminated background surface with the same size as the initial microscopic image is generated through bicubic interpolation. Bicubic interpolation utilizes the attribute values ​​and rate of change information of sampling points within a 4×4 neighborhood around each sampling point, and fits the surface using a piecewise cubic polynomial to ensure that the generated 2D illuminated background surface has a continuous second derivative, eliminating interpolation artifacts. After the 2D illuminated background surface is constructed, it is expanded to the same size as the initial microscopic image, i.e., background grayscale values ​​are generated pixel by pixel, resulting in an estimated illuminated background image.

[0032] A pixel-by-pixel difference operation is performed between the initial photomicrograph and the estimated illumination-background image to obtain an illumination-equalized image. The pixel-by-pixel difference operation involves subtracting the corresponding background grayscale value in the estimated illumination-background image from the initial grayscale value of each pixel in the initial photomicrograph. After the difference operation, values ​​exceeding the upper limit of the effective grayscale range are truncated to the upper limit value, and values ​​below the lower limit are truncated to the lower limit value, ensuring that the illumination-equalized image remains within a preset effective grayscale range. For example, for an 8-bit grayscale image, the upper limit is 255 and the lower limit is 0.

[0033] See Figure 7 In the figure, the horizontal axis represents the index of the local sub-blocks in the initial microscopic image, arranged sequentially in row-first, column-second order. The vertical axis represents the pixel gray-level variance value of the corresponding local sub-block. The curve represents the sequence after arranging the pixel gray-level variance values ​​of all local sub-blocks in ascending order of value, reflecting the distribution characteristics of the gray-level variance of each local sub-block. The dashed line in the figure represents the set 20% quantile threshold, corresponding to approximately 20% of all local sub-blocks. That is, the top 20% of local sub-blocks with the smallest pixel gray-level variance values ​​are selected as background illumination reference sub-blocks. As can be seen from the figure, the variance values ​​remain low and relatively stable within the top 20% quantile, indicating that these local sub-blocks are less affected by sporozoan structures or impurities, making them suitable as reference areas to accurately reflect non-uniform illumination backgrounds. Beyond this threshold, the variance values ​​show a significant increasing trend, reflecting the enhanced influence of sporozoans and other structures on image gray levels, thus making them unsuitable as a basis for background illumination estimation.

[0034] Example 2: In specific implementation, please refer to Figure 3After obtaining the illumination-equalized image, coarse localization of the spore candidate region based on multi-scale morphological gradients is performed on the illumination-equalized image. Morphological dilation and morphological erosion operations are performed on the illumination-equalized image using structuring elements of different sizes to obtain the morphological gradient image under each structuring element size. The shape of the structuring element is set to circular, and the size of the circular structuring element is controlled by a radius parameter. A set of structuring element radius values ​​is selected, with the radius values ​​set from smallest to largest as 3 pixels, 5 pixels, 7 pixels, 9 pixels, and 11 pixels, forming a structuring element size sequence to capture the spore boundary contour information at different scales. For each radius value in the structuring element size sequence, a corresponding circular structuring element is generated. Morphological dilation is then performed on the illumination-equalized image using this circular structuring element to obtain a dilated image. The morphological dilation operation translates the circular structuring element pixel by pixel on the illumination-equalized image, and the maximum grayscale value of the pixels within the area covered by the circular structuring element is taken as the dilation result. Then, using the same circular structuring element, a morphological erosion operation is performed on the illumination-equalized image to obtain an eroded image. The morphological erosion operation translates the circular structuring element pixel by pixel on the illumination-equalized image, and takes the minimum gray value of the pixels within the area covered by the circular structuring element as the erosion result. The eroded image is then subtracted from the dilated image, and the difference is calculated pixel by pixel to obtain the morphological gradient image under the structuring element of that size.

[0035] The morphological gradient images under all structuring elements are maximized pixel-wise to obtain a multi-scale morphological gradient peak image. The pixel-maximization operation involves iterating through the corresponding morphological gradient image pixel values ​​under all structuring elements for each pixel coordinate in the image plane, and selecting the maximum pixel value as the pixel value of the multi-scale morphological gradient peak image at that coordinate. By maximizing the pixel value, edge signals with strong gradient responses at any structuring element size are preserved in the multi-scale morphological gradient peak image, enhancing the integrity and continuity of the sporozoan outline.

[0036] Binarization based on an adaptive threshold is performed on the multi-scale morphological gradient peak image to obtain an initial binary image. The adaptive threshold is determined based on the valley positions of the gray-level histogram of the multi-scale morphological gradient peak image. The gray-level histogram of the multi-scale morphological gradient peak image is calculated, where the horizontal axis represents the gray level and the vertical axis represents the pixel frequency of each gray level. Gaussian smoothing is then applied to the gray-level histogram using a Gaussian kernel function with a standard deviation of 2.0 convolved with the gray-level histogram sequence to eliminate spikes and local fluctuations in the histogram. A bimodal structure is searched on the smoothed grayscale histogram. If two distinct peaks exist, the gray level with the lowest vertical value between the two peaks is identified as the trough, and the gray level corresponding to the trough is set as the adaptive threshold. If no distinct bimodal structure exists in the smoothed grayscale histogram, the gray level corresponding to a cumulative distribution reaching a preset proportion is used as the adaptive threshold. The preset proportion is set to 85%, which is the gray level corresponding to the cumulative pixel frequency in the direction of increasing grayscale levels. The gray level corresponding to the cumulative frequency reaching 85% of the total pixel frequency is determined as the adaptive threshold. The adaptive threshold is used to binarize the multi-scale morphological gradient peak image, setting pixels greater than or equal to the adaptive threshold as foreground pixels and pixels less than the adaptive threshold as background pixels, forming an initial binary image.

[0037] Morphological connected component area filtering is performed on the initial binary image, deleting connected components with areas smaller than a preset lower limit for the area of ​​spores, resulting in a binary mask image. Connected components in the initial binary image are labeled using the 8-adjacent connectivity criterion, grouping adjacent pixels in the foreground into the same connected component and assigning a unique identifier to each component. The area of ​​each connected component is calculated; the area is the total number of pixels contained within the component. The preset lower limit for the spore area is determined based on the minimum imaging size of the spore to be detected in the microscopic image, set to 80 pixels, meaning the minimum pixel area of ​​a single spore in the image is estimated to be 80 pixels. The connected component areas are compared with the preset lower limit; connected components with an area greater than or equal to 80 pixels are retained, while those with an area less than 80 pixels are deleted by setting all foreground pixels within the deleted component to background pixels. The resulting binary mask image, obtained after morphological connected component area filtering, contains the foreground region as the candidate region for spores.

[0038] See Figure 8 This figure shows the analysis results of the gray-level histogram of the multi-scale morphological gradient peak image in Example 2. The horizontal axis represents the gray level (gray value), ranging from 0 to 255; the vertical axis represents the pixel frequency of the corresponding gray level. The dashed curve in the figure is the original gray-level histogram, the solid curve is the gray-level histogram after Gaussian smoothing, and the dashed vertical line represents the adaptive threshold determined by the histogram valley localization algorithm.

[0039] The image shows a distinct bimodal structure in the grayscale histogram. The first peak is concentrated around gray level 30, with a peak pixel frequency exceeding 5000, representing a large proportion of low grayscale pixels in the image. The second peak is concentrated around gray level 170, with a peak pixel frequency of approximately 3500, reflecting the pixel density in high grayscale areas. A clear trough appears between the two peaks at approximately gray level 80, marked by a dashed vertical line in the image. The gray level corresponding to this trough is determined as the adaptive threshold.

[0040] This threshold is used to binarize the multi-scale morphological gradient peak image, effectively distinguishing the foreground sporozoite candidate region from the background region. Gaussian smoothing eliminates spikes and local fluctuations in the gray-level histogram, ensuring the accuracy of valley detection and avoiding noise interference in threshold selection. The threshold position is located in the low-frequency region between two gray-level peaks, which meets the requirements of the adaptive threshold determination method based on the valley position of the gray-level histogram in Example 2.

[0041] Example 3: In specific implementation, please refer to Figure 4 After obtaining the binary mask image, anisotropic diffusion filtering based on phase consistency is performed on the pixels corresponding to the spore candidate region in the illumination equalization image to obtain an edge-preserving enhanced image. The phase consistency response value of each pixel in the illumination equalization image is calculated to obtain the phase consistency response map. Phase consistency measures whether there are significant edge or corner features at the corresponding pixel position by calculating the degree of phase consistency of the Fourier components in the local frequency domain of the illumination equalization image. The calculation of the phase consistency response value uses a Log-Gabor filter bank to convolve the illumination equalization image in multiple directions and at multiple scales. The Log-Gabor filter bank is constructed by defining a set of two-dimensional Log-Gabor bandpass filters in the frequency domain. The center frequency of the filter is determined by the scale index, the direction is determined by the direction index, the filter bandwidth is twice the frequency band, and the filter direction angle is divided at equal intervals. The direction index ranges from 1 to 6, representing 6 directions, with adjacent directions spaced 30 degrees apart. The scale index ranges from 1 to 4, representing 4 scales. The smallest scale corresponds to a filter center wavelength of 3 pixels, and the center wavelength increases by octaves for each scale level. A Fourier transform is performed on the illumination equalization image to obtain its frequency domain representation. This frequency domain representation is then multiplied element-wise by a Log-Gabor filter at each scale for each direction. An inverse Fourier transform is then performed on the product to obtain the complex-valued response image at the corresponding scale for that direction. The real part of the complex-valued response image represents the even-symmetric filter response component, and the imaginary part represents the odd-symmetric filter response component.

[0042] For each pixel location in the illumination-equalized image, obtain the complex response values ​​at all directions and scales, and calculate the local energy and local amplitude spectrum at each pixel location. The local energy is the weighted sum of the magnitudes of the complex responses at all directions and scales, and the local amplitude spectrum is the sum of the amplitudes of the complex responses at all directions and scales. The formula for calculating the phase-consistent response value is:

[0043]

[0044] In the formula for calculating the phase consistency response value Indicates pixel position Phase consistency response value at the location; This represents the total number of directions, with a value of 6. This represents the total number of scales, with a value of 4. Indicates pixel position First The direction weighting factor is calculated by the proportion of the local energy in that direction to the total local energy in all directions. Indicates pixel position At scale direction Complex response amplitude; Indicates pixel position At scale direction The phase deviation function is taken as the cosine of the difference between the actual phase of the Fourier component and the local average phase. This represents the noise compensation threshold, which is determined based on the statistical characteristics of the Log-Gabor filter bank's response to a purely noisy image, and has a value of 0.15. This indicates a non-negative truncation operation, which takes zero when the value of the internal expression is negative, and otherwise takes the original value. This represents a small constant to prevent division by zero, and its value is... After calculating the phase consistency response value pixel by pixel, the phase consistency response values ​​of all pixels constitute a phase consistency response map.

[0045] Based on the phase-consistency response map, a diffusion tensor matrix is ​​constructed for each pixel. For each pixel location in the illumination-equalized image, the maximum phase-consistency response direction at that pixel location is calculated based on the phase-consistency response map. The maximum phase-consistency response direction is determined by vector synthesis of the complex response amplitudes of that pixel location in different directions. The direction angle of the synthesized vector is the maximum phase-consistency response direction, expressed in radians. The diffusion tensor matrix is ​​a second-order real symmetric matrix. In the image plane coordinate system, its elements are determined by the maximum phase-consistency response direction angle and two eigenvalues. The eigenvalues ​​of the diffusion tensor matrix include a first eigenvalue and a second eigenvalue. The first eigenvalue corresponds to the direction perpendicular to the edge, and the second eigenvalue corresponds to the direction parallel to the edge. The direction of the principal eigenvector of the diffusion tensor matrix is ​​perpendicular to the maximum phase-consistency response direction of the pixel, and the direction of the secondary eigenvector is parallel to the maximum phase-consistency response direction. The first eigenvalue is set to 1.0, and the second eigenvalue is set to a small positive number 0.001 to ensure that diffusion proceeds along the edge parallel direction while diffusion across the edge direction is significantly suppressed. The four elements of the diffusion tensor matrix are determined based on the maximum phase-consistency response direction angle. First eigenvalue and the second eigenvalue Build, location Elements of the diffusion tensor matrix Values ,element and Values ,element Values .

[0046] Based on the diffusion tensor matrix, anisotropic diffusion iterative updates are performed on pixels within the corresponding sporozoite candidate regions of the binary mask image in the illumination-equalized image, while keeping the grayscale values ​​of pixels in non-sporozoite candidate regions unchanged in each iteration. The anisotropic diffusion iterative update uses a discretized anisotropic diffusion equation, with the form: [Equation omitted for brevity]. In the next iteration, for any pixel within the candidate region of the sporozoite... In its first The gray value of the next iteration step Equal to the current grayscale value Add the sum of the diffusion flux in the four neighboring directions of that pixel multiplied by the time step. The diffusion flux is determined by the product of the diffusion tensor matrix and the image gradient. Time step. The value is set to 0.15 to ensure numerical stability during the iteration process. Before each iteration step, the phase consistency response map of each pixel is recalculated based on the grayscale value of the current iteration step in the illumination equalization image, and the diffusion tensor matrix is ​​updated.

[0047] The specific operation of the anisotropic diffusion iterative update is as follows: The illumination equalization image is used as the initial iteration image, and the iteration count counter is set to 0. In each iteration, it is checked whether the iteration count counter is less than the preset iteration count, which is set to 200. The preset iteration count is determined based on the blurring degree and noise level of the spore edges in the microscopic image. The blurring radius of the spore edges is approximately 3 to 5 pixels. Analysis shows that 200 iterations can achieve a smoothing effect where diffusion is fully implemented within the blurred edge area without excessively weakening the edge contour. For pixels within the spore candidate area, the updated grayscale value is calculated according to the discretized anisotropic diffusion equation; for pixels outside the spore candidate area, their grayscale value is kept exactly the same as the grayscale value of the current iteration step. After one traversal, the iteration count counter is incremented by 1. The above iterative update process is repeated until the iteration count counter reaches the preset iteration count of 200, at which point the iteration stops, and the current iteration image is used as the edge-preserving enhancement image.

[0048] Example 4: In specific implementation, please refer to Figure 5 After obtaining the edge-preserving enhanced image, sporozoan texture feature extraction based on the gray-level run-length matrix is ​​performed on the edge-preserving enhanced image. In the edge-preserving enhanced image, the gray-level run-length of each pixel in the corresponding sporozoan candidate region of the binary mask image is traversed along a preset direction to construct a gray-level run-length matrix. The preset directions include four directions: 0°, 45°, 90°, and 135°. In the 0° direction, the pixel sequence in the sporozoan candidate region is scanned row by row from left to right; in the 45° direction, the pixel sequence is scanned along the diagonal direction from the lower left to the upper right; in the 90° direction, the pixel sequence is scanned column by column from top to bottom; and in the 135° direction, the pixel sequence is scanned along the diagonal direction from the upper left to the lower right. For each preset direction and each sporozoan candidate region, the number of consecutive pixels with the same gray value is recorded as the run length. The run length and the corresponding gray level are paired, and the frequency of each pair of gray level and run length in the sporozoan candidate region is counted to generate the gray-level run-length matrix under that preset direction.

[0049] In a grayscale run-length matrix, each row corresponds to a grayscale level, each column corresponds to a run length, and the matrix elements represent the frequency of occurrence. (Using symbols...) Indicates direction The lower gray level is And the length of the journey is The frequency of the journey occurring within the candidate region of sporozoites, among which The values ​​can be 0°, 45°, 90°, or 135°. For grayscale indexing, The value range is from 1 to , This represents the number of different gray levels appearing within the candidate region of sporozoites. For run length index, The value range is from 1 to , This represents the maximum travel length that appears within the candidate region for sporozoites.

[0050] Based on the gray-scale run-length matrix, calculate the run-length non-uniformity eigenvalue and gray-scale non-uniformity eigenvalue for each candidate region of sporozoites. The run-length non-uniformity eigenvalue reflects the uniformity of the run-length distribution, while the gray-scale non-uniformity eigenvalue reflects the degree of frequency difference of runs occurring at different gray levels. For each preset direction, use the gray-scale run-length matrix under that direction to calculate the run-length non-uniformity eigenvalue according to the following formula:

[0051]

[0052] In the formula for calculating the characteristic value of run length non-uniformity Indicates direction Characteristic values ​​of run length non-uniformity; Indicates direction The lower gray level is And the length of the journey is The frequency of the journey occurring within the candidate region of the sporozoite; This indicates the number of different gray levels appearing within the candidate region for spore-forming organisms; Indicates the maximum travel length appearing within the candidate region of the sporozoite; denominator Indicates direction Total frequency of all journeys within the candidate region of Hyposporium.

[0053] For each preset direction, the gray-level non-uniformity eigenvalue is calculated as follows: First, for each row of the gray-level run-length matrix, the sum of the frequencies of all run lengths corresponding to that gray level is calculated along the run-length direction. This yields the total number of occurrences of the given gray level; then, the row sums of all obtained gray levels are squared, i.e., the total number of occurrences is calculated. Finally, sum the squared values ​​of all gray levels to obtain the direction. The grayscale non-uniformity feature value is obtained by taking the arithmetic mean of the run length non-uniformity feature values ​​in the four directions. The grayscale non-uniformity feature value is obtained by taking the arithmetic mean of the grayscale non-uniformity feature values ​​in the four directions.

[0054] Based on the run-length non-uniformity eigenvalues ​​and gray-level non-uniformity eigenvalues, the texture complexity and gray-level distribution dispersion of each spore candidate region are calculated. Texture complexity is taken as the reciprocal of the run-length non-uniformity eigenvalue. Gray-level distribution dispersion is defined as the normalized value of the gray-level non-uniformity eigenvalues. The normalization method is as follows: for each direction, calculate the total frequency of all elements in the gray-level run-length matrix in that direction, i.e. Divide the gray-level non-uniformity characteristic value by The square of the value is used to obtain the normalized directional gray-scale distribution dispersion, and then the arithmetic mean of the four directions is taken as the gray-scale distribution dispersion of the candidate region of the spore.

[0055] The texture complexity and gray-level distribution dispersion of all candidate spore regions are combined according to their spatial arrangement to obtain the spore texture feature vector set. The spatial arrangement order is determined as follows: the centroid coordinates of each candidate spore region in the binary mask image are calculated, with the row coordinates of the centroids taken as the average of the row indices of all pixels within the candidate spore region, and the column coordinates taken as the average of the column indices of all pixels within the candidate spore region; all candidate spore regions are arranged in ascending order of their centroid row coordinates, and if the centroid row coordinates are the same, they are then arranged in ascending order of their centroid column coordinates; according to the arranged order, the texture complexity and gray-level distribution dispersion of each candidate spore region are extracted sequentially to form a two-dimensional vector. The set of two-dimensional vectors of all candidate spore regions arranged in order is the spore texture feature vector set.

[0056] Example 5: In specific implementation, please refer to Figure 6 After obtaining the sporozoite texture feature vector set and binary mask image, fine segmentation of sporozoite targets based on local entropy difference is performed on the edge-preserving enhanced image. The local neighborhood entropy value of each pixel within each candidate region of a sporozoite in the binary mask image of the edge-preserving enhanced image is calculated to obtain a local entropy map. The local neighborhood entropy value is calculated by taking a rectangular neighborhood window centered on the pixel to be calculated in the edge-preserving enhanced image, with the window size set to 5 pixels × 5 pixels. The number of pixels appearing at each gray level within the rectangular neighborhood window is counted, and the probability of each gray level appearing within the rectangular neighborhood window is calculated. The probability of appearance is the number of pixels belonging to the same gray level divided by the total number of pixels within the rectangular neighborhood window. The formula for calculating the local neighborhood entropy value is:

[0057]

[0058] In the formula for calculating the local neighborhood entropy value This indicates that the edge-preserving enhanced image is located at the th Liede The local neighborhood entropy value at the row pixel; Represented in pixels The total number of different gray levels appearing within a 5-pixel × 5-pixel rectangular neighborhood window centered on the target; Represented in pixels Within the rectangular neighborhood window centered on the first The probability of occurrence of the i-th gray level is calculated by considering the number of gray levels within a rectangular neighborhood window. Divide the number of pixels at each gray level by 25; This represents a base-2 logarithmic operation. The local neighborhood entropy value is calculated point-by-point for all pixels within the candidate region of the sporozoite, resulting in a local entropy map.

[0059] Based on the sporozoite texture feature vector set, a local entropy adjustment factor is determined for each candidate sporozoite region. Each two-dimensional vector in the sporozoite texture feature vector set contains the texture complexity and gray-level distribution dispersion of a candidate sporozoite region. The local entropy adjustment factor is calculated from the texture complexity and gray-level distribution dispersion using a predefined mapping function, which is a linear weighted sum, i.e., the local entropy adjustment factor. The value is equal to 1 plus the product of texture complexity and a first preset coefficient, plus the product of grayscale distribution dispersion and a second preset coefficient. The first preset coefficient is set to 0.3, and the second preset coefficient is set to 0.5. The setting of the first preset coefficient to 0.3 and the second preset coefficient to 0.5 is based on the typical distribution range of texture complexity and grayscale distribution dispersion of sporozoites in microscopic images, so that the value of the local entropy adjustment factor is between 1.0 and 2.5. When the texture of the candidate region of sporozoites is more complex and the grayscale distribution is more discrete, the value of the local entropy adjustment factor is larger, thereby enhancing the response of the fine internal structure of sporozoites in the local entropy difference map.

[0060] A pixel-by-pixel weighted operation is performed on the local entropy adjustment factor and the local entropy value map to obtain the adjusted local entropy difference map. Specifically, for each sporozoan candidate region marked in the binary mask image, the corresponding local entropy adjustment factor is determined. Then, the entropy value of each pixel within that candidate region in the local entropy value map is multiplied by this adjustment factor to obtain the weighted entropy value. After performing this pixel-by-pixel weighted operation on all sporozoan candidate regions, the entropy value of pixels outside the candidate regions remains unchanged, forming the adjusted local entropy difference map.

[0061] Binarization segmentation based on the maximum inter-class variance criterion is performed on the adjusted local entropy difference map to obtain the sporozoan segmentation image. The maximum inter-class variance criterion is implemented by traversing all gray values ​​appearing in the adjusted local entropy difference map as candidate thresholds. For each candidate threshold, pixels with gray values ​​greater than or equal to the candidate threshold are classified as foreground pixels, and pixels with gray values ​​less than the candidate threshold are classified as background pixels. The inter-class variance between the foreground and background classes is calculated. The inter-class variance is calculated by multiplying the proportion of foreground pixels to the total number of pixels by the proportion of background pixels to the total number of pixels, and then multiplying by the square of the difference between the average gray values ​​of the foreground and background classes. The candidate threshold that maximizes the inter-class variance is selected as the optimal segmentation threshold. The adjusted local entropy difference map is then binarized using the optimal segmentation threshold. Foreground pixels form the target region of the sporozoan, and background pixels form the non-target region, resulting in the sporozoan segmentation image.

[0062] The boundary of the sporozoite target region in the sporozoite segmentation image is used as the guide field boundary. The sporozoite target region boundary is obtained through morphological boundary extraction, specifically by subtracting the region after 3×3 structuring element erosion from the foreground region of the sporozoite segmentation image, resulting in the boundary pixel set. The source image gradient field corresponding to the region inside the guide field boundary in the initial microscopic image is extracted. The source image gradient field includes horizontal and vertical gradient components. The horizontal gradient component is obtained by calculating the difference in gray values ​​between adjacent pixels row-by-row in the initial microscopic image, and the vertical gradient component is obtained by calculating the difference in gray values ​​between adjacent pixels column-by-column in the initial microscopic image. The source image gradient field and the gradient field of the corresponding sporozoite target region in the edge-preserving enhanced image are weighted and averaged to obtain the fused gradient field. The gradient field of the corresponding sporozoite target region in the edge-preserving enhanced image is also obtained by calculating the difference in gray values ​​between adjacent pixels row-by-row and column-by-column. In the weighted averaging operation, the gradient fields of the source image and the edge-preserving enhanced image are each assigned a fusion weight coefficient. The fusion weight coefficient for the gradient field of the source image is 0.4, and the fusion weight coefficient for the gradient field of the edge-preserving enhanced image is 0.6. The horizontal gradient components and the vertical gradient components are weighted and summed according to the fusion weight coefficients to obtain the fused gradient field.

[0063] Based on the pixel values ​​of the initial microscopic image at the boundaries of the fused gradient field and the guiding field, the Poisson equation is solved to reconstruct the fused pixel values ​​of the sporozoite target region. The original pixel values ​​of all pixels at the guiding field boundary in the initial microscopic image are set as Dirichlet boundary conditions. The divergence value of the fused gradient field is calculated as follows: The backward difference is calculated column-by-column for the horizontal gradient components of the fused gradient field, i.e., the horizontal gradient component of the current pixel is subtracted from the horizontal gradient component of the pixel to its left, resulting in the second difference component in the horizontal direction; the backward difference is calculated row-by-row for the vertical gradient components, i.e., the vertical gradient component of the current pixel is subtracted from the vertical gradient component of the pixel above, resulting in the second difference component in the vertical direction; the second difference components in the horizontal and vertical directions are added together to obtain the divergence value at that pixel location.

[0064] Based on the Dirichlet boundary conditions and the divergence value of the fused gradient field, a discrete Poisson equation system is constructed for the region inside the guide field boundary. Each pixel inside the guide field boundary is treated as an unknown node. For each unknown node, an equation is established where the sum of the gray values ​​of its four neighboring pixels minus the gray value of that unknown node equals the divergence value at that node. The four neighboring pixels include the upper neighbor, lower neighbor, left neighbor, and right neighbor. For pixels located within the guide field boundary, the gray values ​​of the pixels belonging to the guide field boundary in its four neighboring regions are substituted with the original pixel values ​​fixed in the Dirichlet boundary conditions. The equations corresponding to all unknown nodes are then combined with the Dirichlet boundary conditions to form a discrete Poisson equation system.

[0065] Numerical solutions based on successive over-relaxation iterations are applied to the discrete Poisson equations. Initial grayscale guesses are set for each pixel within the boundary of the guiding field, directly taken from the original pixel values ​​at the corresponding pixel locations in the initial microscopic image. A relaxation factor is calculated based on the diagonal elements of each equation in the discrete Poisson equations. Since the diagonal element of each equation is 4, the relaxation factor is set to 1.5. The rationale for setting the relaxation factor to 1.5 is that, for linear equations discretized from the two-dimensional Poisson equations, a relaxation factor around 1.5 can effectively improve the convergence speed and maintain numerical stability during the iteration process.

[0066] Within each iteration step, all unknown nodes within the boundary region of the guiding field are traversed in row-major order. For the currently visited unknown node, the gray values ​​of its four neighboring pixels are extracted. Neighboring pixels spatially located before the current unknown node and already updated use the updated gray values, while those spatially located after the current unknown node and not yet updated use the gray values ​​from the previous iteration step. The sum of the four neighboring gray values ​​is combined with the divergence value at the current unknown node, and combined with the gray value from the previous iteration step and the relaxation factor, to calculate the updated gray value of the current unknown node in the next iteration step. This iterative update of the gray values ​​of all unknown nodes is repeated, with each full region traversal counted as one iteration step. The root mean square error of the updated gray values ​​of all unknown nodes between adjacent iteration steps is the square root of the mean of the squared differences between the gray values ​​of the previous and current iteration steps. The root mean square error (RMSE) is calculated as follows: for all unknown nodes within the boundary of the guiding field, sum the squares of the differences between the grayscale values ​​of the previous iteration and the current iteration, divide by the total number of unknown nodes, and then take the square root. The preset tolerance threshold is 0.5. This threshold is set based on the grayscale level accuracy requirements of an 8-bit grayscale image. When the RMSE of the grayscale value change between adjacent iterations is less than 0.5 grayscale levels, the iteration result meets the requirement of being visually indistinguishable. Iteration stops when the RMSE is less than 0.5.

[0067] When the iteration stops, the updated grayscale value of each unknown node in that iteration step is used as the reconstructed grayscale value of the corresponding pixel. All reconstructed grayscale values ​​are arranged according to pixel position to obtain the fused pixel values ​​for the sporozoite target region. The fused pixel values ​​replace the original pixel values ​​of the corresponding sporozoite target region in the initial microscopic image. The replacement method is to assign the fused pixel values ​​to the same coordinate positions in the initial microscopic image pixel by pixel. Pixels outside the sporozoite target region retain their original pixel values ​​from the initial microscopic image, resulting in the enhanced sporozoite detection image.

[0068] See Figure 9In the figure, the vertical axis represents the empirical cumulative distribution of local entropy differences, expressed as a percentage, indicating the proportion of pixels with local entropy differences less than or equal to the corresponding horizontal axis value. The horizontal axis represents the local entropy difference value, dimensionless, ranging from approximately 1.0 to 5.5. The solid curve depicts the cumulative distribution of local entropy differences among pixels in the edge-preserving enhanced image region corresponding to the spore candidate area in the binary mask image. The curve generally exhibits three distinct stages: in the range of approximately 1.0 to 2.0 local entropy differences, the cumulative proportion rises slowly, indicating that pixels with low entropy differences account for a small proportion in this range; in the range of approximately 2.0 to 3.0 local entropy differences, the cumulative proportion increases rapidly, and the curve shows an inflection point at approximately 2.8, indicating that a large number of pixel entropy differences are concentrated in this range; above 3.0 local entropy differences, the cumulative proportion tends to level off, reaching nearly 100% at 5.5, indicating that pixels with high entropy differences are relatively few. The optimal segmentation threshold marked by the dashed line in the figure is approximately 2.8, corresponding to a cumulative proportion of approximately 70%. This threshold is the optimal segmentation point automatically determined based on the maximum inter-class variance criterion, used to account for adjusted local entropy differences. Figure 2 Value-based segmentation is used to distinguish the target region of sporozoites from the background region. This optimal segmentation threshold effectively captures the entropy difference features of the local structure within the candidate region of sporozoites, thereby achieving fine-grained sporozoite target segmentation.

[0069] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for enhancing and detecting microscopic images of crucian carp cystidia based on deep learning, characterized in that, include: Initial microscopic images of tissue samples from Chuzhou crucian carp were obtained, and non-uniform illumination compensation based on local variance distribution was performed on the initial microscopic images to obtain an illumination-equalized image. The illumination-equalized image is subjected to coarse localization of the sporozoite candidate region based on multi-scale morphological gradient to obtain a binary mask image containing the sporozoite candidate region; Based on the binary mask image, an anisotropic diffusion filter based on phase consistency is performed on the pixels corresponding to the spore candidate region in the illumination equalization image to obtain an edge-preserving enhanced image; Perform sporozoite texture feature extraction based on grayscale run-length matrix on the edge-preserving enhanced image to obtain a sporozoite texture feature vector set; Based on the sporozoite texture feature vector set and the binary mask image, perform fine segmentation of sporozoite targets based on local entropy difference on the edge-preserving enhanced image to obtain a sporozoite segmentation image; The sporozoite segmentation image is fused with the initial microscopic image using Poisson image editing to obtain the sporozoite enhanced detection result image.

2. The method for enhancing and detecting microscopic images of crucian carp cystidia based on deep learning according to claim 1, characterized in that, Performing non-uniform illumination compensation based on local variance distribution on the initial microscopic image to obtain an illumination-equalized image includes: The initial microscopic image is divided into multiple local sub-blocks, and the pixel grayscale variance value of each local sub-block is calculated; Arrange the pixel grayscale variance values ​​of all the local sub-blocks in ascending order, and select a number of the local sub-blocks located at a preset proportion position before the sorting sequence as background lighting reference sub-blocks; A two-dimensional illumination background surface is constructed based on the average pixel grayscale values ​​of all the background illumination reference sub-blocks, and the two-dimensional illumination background surface is extended to the same size as the initial microscopic image by bicubic interpolation to obtain the illumination background estimation image. The initial microscopic image and the estimated illumination background image are subjected to a pixel-by-pixel difference operation to obtain the illumination equalization image.

3. The method for enhancing and detecting microscopic images of crucian carp cysticercosis based on deep learning according to claim 2, characterized in that, The process of obtaining a binary mask image containing candidate regions of sporozoites includes: Morphological dilation and morphological erosion operations are performed on the illumination equalization image using structuring elements of different sizes to obtain morphological gradient images under each structuring element of the size. The morphological gradient images under all the size structuring elements are maximized by taking the maximum value of each pixel to obtain a multi-scale morphological gradient peak image. The multi-scale morphological gradient peak image is subjected to binarization processing based on an adaptive threshold to obtain an initial binary image. The adaptive threshold is determined according to the valley position of the gray-level histogram of the multi-scale morphological gradient peak image. Morphological connected component area filtering is performed on the initial binary image to delete connected components with areas smaller than the preset lower limit of the area of ​​the spore worm, thereby obtaining the binary mask image.

4. The method for enhancing and detecting microscopic images of crucian carp cystidia based on deep learning according to claim 3, characterized in that, The obtained edge-preserving enhanced image includes: Calculate the phase consistency response value of each pixel in the illumination equalization image to obtain a phase consistency response map; Based on the phase consistency response map, a diffusion tensor matrix is ​​constructed for each pixel, wherein the direction of the principal eigenvector of the diffusion tensor matrix is ​​perpendicular to the direction of the maximum phase consistency response of the pixel; Based on the diffusion tensor matrix, anisotropic diffusion iterative updates are performed on the pixels in the binary mask image corresponding to the spore candidate region in the illumination equalization image, and the gray values ​​of pixels outside the spore candidate region are kept unchanged in each iteration. Repeat the anisotropic diffusion iteration update until the preset number of iterations is reached to obtain the edge-preserving enhanced image.

5. The method for enhancing and detecting microscopic images of crucian carp cystidia disease based on deep learning according to claim 4, characterized in that, The obtained sporozoite texture feature vector set includes: In the edge-preserving enhanced image, the gray-level run length of each pixel in the binary mask image corresponding to the spore candidate region is traversed along a preset direction to construct a gray-level run length matrix; Based on the grayscale run-length matrix, calculate the run-length non-uniformity characteristic value and grayscale non-uniformity characteristic value for each of the sporozoite candidate regions; Based on the run length non-uniformity feature value and the gray level non-uniformity feature value, calculate the texture complexity and gray level distribution dispersion of each of the spore candidate regions; The texture complexity and grayscale distribution dispersion of all the candidate spore regions are combined according to the spatial arrangement order of the candidate spore regions to obtain the spore texture feature vector set.

6. The method for enhancing and detecting microscopic images of crucian carp cystidia disease based on deep learning according to claim 5, characterized in that, The process of obtaining the sporozoite segmentation image includes: Calculate the local neighborhood entropy value of each pixel in the binary mask image corresponding to each of the spore candidate regions in the edge-preserving enhanced image to obtain a local entropy value map; Based on the sporozoite texture feature vector set, determine the local entropy adjustment factor corresponding to each of the sporozoite candidate regions; The local entropy adjustment factor and the local entropy value map are subjected to a pixel-by-pixel weighted operation to obtain the adjusted local entropy difference map. Binarization segmentation based on the maximum inter-class variance criterion is performed on the adjusted local entropy difference map to obtain the sporozoite segmentation image.

7. The method for enhancing and detecting microscopic images of crucian carp cystidia disease based on deep learning according to claim 6, characterized in that, The obtained image of the enhanced detection result of the sporozoites includes: Using the boundary of the target region of the sporozoan in the segmented sporozoan image as the guide field boundary, the source image gradient field corresponding to the region inside the guide field boundary in the initial microscopic image is extracted; The gradient field of the source image is weighted and averaged with the gradient field of the edge-preserving enhanced image corresponding to the target region of the spore, to obtain the fused gradient field; Based on the pixel values ​​of the initial microscopic image at the boundary of the fused gradient field and the guiding field, the Poisson equation is solved to reconstruct the fused pixel values ​​of the sporozoite target region; The fused pixel values ​​are used to replace the original pixel values ​​in the initial microscopic image corresponding to the target region of the spore, to obtain the enhanced detection result image of the spore.

8. The method for enhancing and detecting microscopic images of crucian carp cystidia disease based on deep learning according to claim 7, characterized in that, The step of reconstructing the fused pixel values ​​of the sporozoite target region by solving the Poisson equation based on the pixel values ​​of the initial microscopic image at the boundary of the fused gradient field and the guiding field includes: Set the original pixel values ​​of the initial microscopic image of all pixels on the boundary of the guiding field to the Dirichlet boundary condition; Based on the Dirichlet boundary conditions and the divergence value of the fused gradient field, a discrete Poisson equation system is constructed for the internal region of the guiding field boundary. The discrete Poisson equations are solved numerically using a successive over-relaxation iterative method to obtain the reconstructed grayscale value of each pixel in the region inside the boundary of the guiding field. Arrange all the reconstructed grayscale values ​​according to pixel position to obtain the fused pixel values ​​of the target region of the sporozoan.

9. The method for enhancing and detecting microscopic images of crucian carp cysticercosis based on deep learning according to claim 8, characterized in that, The construction of the discrete Poisson equation system within the boundary region of the guiding field includes: Calculate the partial derivatives of the fused gradient field in the horizontal and vertical directions, and add the partial derivatives in the horizontal and vertical directions to obtain the divergence value of the fused gradient field. Each pixel in the region inside the boundary of the guiding field is taken as an unknown node, and the sum of the differences between the gray value of the unknown node and the gray values ​​of the four neighboring pixels of the unknown node is set to be equal to the divergence value at the unknown node. By combining the equations corresponding to all the unknown nodes and the Dirichlet boundary conditions, the discrete Poisson equations are formed.

10. The method for enhancing and detecting microscopic images of crucian carp cystidia disease based on deep learning according to claim 9, characterized in that, Obtaining the reconstructed grayscale value of each pixel within the boundary of the guiding field includes: Set the initial grayscale guess value for each pixel in the region inside the boundary of the guiding field, and calculate the relaxation factor of the successive over-relaxation iterative format based on the main diagonal elements of each equation in the discrete Poisson equation system. Substitute the gray values ​​of the four neighboring pixels of each unknown node in the current iteration step into the successive over-relaxation iteration format to calculate the updated gray value of the unknown node in the next iteration step. Repeatedly update the grayscale values ​​of all the unknown nodes iteratively until the root mean square error of the updated grayscale values ​​of all the unknown nodes between adjacent iteration steps is less than a preset tolerance threshold. The updated grayscale value of each unknown node when the iteration stops is used as the reconstructed grayscale value of that pixel.