Low illumination phase contrast cell microscopy image enhancement method based on multi-scale transformer
Through the low-light phase contrast cell microscopy image enhancement method based on multi-scale Transformer, combined with the feature pre-enhancement network and the generative adversarial network, the problem of poor low-light image enhancement effect is solved, the contrast and brightness of the image are significantly improved, and noise is avoided. The artifacts and structural distortion caused by magnification improve the visual effect and feature learning ability of the image.
Patent Information
- Application Number
- CN202410899763.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-05
AI Technical Summary
The existing technology is less effective in enhancing low-illumination phase contrast cell microscopy images, making it difficult to effectively improve the contrast and overall brightness of the image. At the same time, it may amplify noise, making it difficult to improve detailed features and contrast.
A low-light phase contrast cell microscopy image enhancement method based on multi-scale Transformer is adopted. By constructing a feature pre-enhancement network, a combined network of generator and discriminator, multi-scale Transformer module and convolution layer are used to extract multi-scale features, combined with bright gray and dark grayscale priors for pre-enhancement, and a generative adversarial network to ensure the authenticity and quality of the enhanced image.
It significantly improves the visual effect of phase contrast cell microscopy images, increases contrast and overall brightness, avoids artifacts and structural distortion during the enhancement process, and improves feature learning and perception capabilities.
Smart Images

Figure CN118485592B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a low-illumination phase-contrast cell microscopic image enhancement method based on a multi-scale transformer. Background Art
[0002] Cell image analysis (detection, segmentation, and counting, etc.) is an important strategy to reveal the biological functions of cells and organelles in phase contrast cell microscopy images. However, due to problems such as low contrast and overall dim brightness, the visual effect of the image and the benchmark for subsequent cell image analysis are affected. The task of image enhancement aims to enhance the contrast of the image, make the blurred details clearly visible, and weaken some interference information to improve the visual effect of the image and improve the performance of subsequent image analysis tasks. In the past few decades, many traditional image enhancement methods have been proposed. These include grayscale histogram, filtering-based, frequency domain-based, and spatial domain-based image enhancement methods, which enhance the visual effect of the image by pixel analysis or filtering and using corresponding prior knowledge. However, these methods not only enhance the foreground and background indiscriminately, but also amplify the noise, resulting in the grayscale values of adjacent areas being close to the same, resulting in difficulty in improving detailed features and contrast.
[0003] The paper (S. Sun, H. Song, D. He, Y. Long, An adaptive segmentation methodcombining MSRCR and mean shift algorithm with K-means correction of greenapples in natural environment, Information Processing in Agriculture. 200–215(2019).) trains a low-light network by using synthetic darkened and noisy images to achieve contrast enhancement and denoising. The paper (C. Wei, W. Wang, W. Yang, J. Liu, Deep Retinex Decomposition for Low-Light Enhancement, arXiv.Org (2018).) proposes a Retinex network, which includes a Decom network for decomposition and an Enhance network for illumination adjustment, to enhance low-light images. The literature (L. Shen, Z. Yue, F. Feng, Q. Chen, S. Liu, J. Ma, MSR-net: Low-light Image Enhancement Using Deep Convolutional Network, arXiv.Org. (2017). ) uses a sparse gradient minimization subnetwork, an enhancement network, and a restoration network to enhance the contrast of illumination and stretched images. Although fully supervised learning methods have achieved remarkable results in the field of image enhancement, these methods require training of low-quality and high-quality images, and the enhancement effect depends on the quality of the training data set. Chinese Patent 202311645210.1 A Phase Contrast Cell Microscopic Image Clarity Enhancement Method and System discloses a phase contrast microscopic image enhancement method based on a combination of sliding windows and multi-scale guided filtering. Although it enhances phase contrast microscopic images obtained in multiple imaging modes, the image enhancement effect for low illumination is poor. Summary of the invention
[0004] The purpose of the present invention is to solve the problem that the prior art has a poor enhancement effect on low-illuminance images.
[0005] The technical solution adopted by the present invention to solve the technical problem is: to provide a low-illumination phase contrast cell microscopic image enhancement method based on a multi-scale transformer, comprising the following steps:
[0006] Acquire a phase contrast cell microscopic image collected in a microscopic imaging system as a data set;
[0007] Construct a low-illumination phase-contrast cell microscopic image enhancement network;
[0008] Use the dataset to train a low-light phase-contrast cell microscopy image enhancement network;
[0009] The phase contrast cell microscopy images are enhanced using the trained low-illumination phase contrast cell microscopy image enhancement network;
[0010] The low-illumination phase-contrast cell microscopic image enhancement network comprises a feature pre-enhancement network, a generator and a discriminator which are connected in sequence. The feature pre-enhancement network pre-enhances the input phase-contrast cell microscopic image and outputs the pre-enhanced image to the generator; the generator extracts multi-scale features through a plurality of alternately connected multi-scale Transformer modules and convolutional layers and outputs the generated image to the discriminator; the discriminator ensures that the generated image is not distorted and outputs the generated image as an enhanced image.
[0011] Preferably, the feature pre-enhancement network is an encoder-decoder structure using a 1×1 depth-separable convolution kernel, and the encoder-decoder structure is a 4-layer non-pooled ResNet34 backbone network.
[0012] Preferably, the feature pre-enhancement network pre-enhances the input phase contrast cell microscopy image, comprising the following steps:
[0013] After the phase contrast cell microscopy image is input into the feature pre-enhancement network, it first enters the encoder for encoding to obtain the encoded features;
[0014] The coding features are input into the bright grayscale prior and the dark grayscale prior for pre-enhancement respectively to obtain the pre-enhancement coding features;
[0015] The pre-enhancement coding features are input into the decoder to obtain the pre-enhancement prior features as the pre-enhancement image.
[0016] Preferably, the loss function of the feature pre-enhancement network is expressed as:
[0017] ;
[0018] L BRGP = ‖ I − [ ( I MAX − I ) + ( I μ + I avg ) 2 ] ‖ 1 ;
[0019] L BLGP = ‖ I − [ ( I − I MIN ) + ( I μ − I avg ) 2 ] ‖ 1 ;
[0020] Among them, L E represents the loss function of the feature pre-enhancement network, λ a and λ b Both represent constraint weights; LBRGP and L BLGP They represent the bright grayscale prior loss term and the dark grayscale prior loss term respectively; I represents the input phase contrast cell microscopy image, I max ,I min ,I μ and I avg They represent the maximum, minimum, variance and mean of the input phase contrast cell microscopy images respectively.
[0021] Preferably, the generator adopts a U-shaped structure network consisting of 6 layers of deeply separable convolutional layers, and adds a multi-scale Transformer module after each convolutional layer to enhance the feature extraction and fusion of the network. The convolutional layer is used to increase the feature dimension, and the multi-scale Transformer module is used to extract features of the convolutional layer output; the discriminator is composed of 6 layers of deeply separable convolution.
[0022] Preferably, the multi-scale Transformer module is used to extract features of the convolutional layer output, comprising the following steps:
[0023] S1, uses horizontal average pooling and vertical average pooling methods to encode each channel, captures the spatial long-range dependencies with precise location information, and integrates the two spatial directions into a channel descriptor , and then use the channel descriptor Extract feature maps containing different receptive fields , expressed as:
[0024] y c = L i n e a r ( N o r m [ Z 1 ,..., Z n ] ) ;
[0025] ;
[0026] in, represents the value of the position (i, j) in the image input to the c-th layer multi-scale Transformer, H and W represent the length and width of the input phase contrast cell microscopy image, respectively. Express Features obtained by global average pooling; Represents features of different scales; Linear represents linear operations, and Norm represents normalization operations;
[0027] S2, using average pooling and maximum pooling operations to reduce the increase in the variance of the estimated value due to the limited neighborhood size, and obtain feature information , expressed as:
[0028] y f ( i , j ) = σ ( β [ x c ( i , j ) ] ) ;
[0029] Among them, σ and β are average pooling operation and maximum pooling operation respectively;
[0030] S3 uses global pooling and fully connected layers to integrate feature information of different scales through different receptive fields to obtain global spatial information y s , expressed as:
[0031] y s ( i , j ) = α ( concat [ x 1 ,..., x n ] ) ;
[0032] Among them, α represents the global pooling operation, Represent feature information at different scales;
[0033] S4, combine the results of the three attention channels to obtain the feature map , expressed as:
[0034] ;
[0035] Among them, Y C(i,j) Represents the output feature map of the c-th layer multi-scale Transformer.
[0036] Preferably, the generator and the discriminator form a generative adversarial network, and the loss function of the generative adversarial network is It is expressed as:
[0037] L GAN = min G e max D e ℒ ( G e , D e ) = E y [ log G e ( y ) ] + E y , z [ log ( 1 − G e ( x ∧ ) ) ] ;
[0038] Among them, L GAN represents the loss function of the generative adversarial network, represents the minimum value of the generator and the maximum value of the discriminator; Ge (•) represents the enhanced result, with the input image and the enhanced image z, De (•) distinguishes the difference between the input image x and the real image y; Indicates that all x are real data expectations, Indicates that the data are all generated data expectations; Represents arbitrary random data with the same data structure as real images.
[0039] Preferably, the method of enhancing the phase contrast cell microscopic image by using a trained low-illumination phase contrast cell microscopic image enhancement network comprises the following steps:
[0040] Input the phase contrast cell microscopic image into the feature enhancement network, and obtain the encoded features after passing through the encoder; after the encoded features are pre-enhanced by bright grayscale priori and dark grayscale priori, the pre-enhanced feature information is obtained; the pre-enhanced feature information is decoded by the decoder to obtain the pre-enhanced priori features as the pre-enhanced image;
[0041] The pre-enhanced image is input to the generator, and after being trained in a 6-layer multi-scale Transformer module and a 6-layer convolution to extract multi-scale features, the generated image is output; the generated image is input to the discriminator to obtain an enhanced image with enhanced overall brightness and contrast.
[0042] The present invention has the following beneficial effects:
[0043] (1) The present invention combines the feature enhancement network and the multi-scale Transformer module to improve the contrast and overall brightness of phase contrast cell microscopy images, significantly improving the visual effect of phase contrast cell microscopy images;
[0044] (2) The feature pre-enhancement network of the present invention uses bright grayscale prior and dark grayscale prior to pre-enhance the contrast and overall brightness of the phase contrast cell microscopy image;
[0045] (3) The present invention designs a multi-scale Transformer module in the generator, which can significantly improve the feature learning and perception capabilities of the enhancement network while avoiding artifacts and structural distortion during the enhancement process.
[0046] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A method step diagram of an embodiment of the present invention;
[0048] Figure 2 A low-illumination phase-contrast cell microscopic image enhancement network structure diagram according to an embodiment of the present invention;
[0049] Figure 3 This is a structural diagram of a multi-scale Transformer module according to an embodiment of the present invention;
[0050] Figure 4(a) is the input phase contrast cell microscopy image;
[0051] Figure 4 (b) is the pre-enhanced image;
[0052] Figure 4 (c) is the enhanced image. DETAILED DESCRIPTION
[0053] See also Figure 1 FIG. 1 is a diagram showing steps of a method according to an embodiment of the present invention, comprising the following steps:
[0054] S101, acquiring a phase contrast cell microscopic image collected in a microscopic imaging system as a data set;
[0055] S102, constructing a low-illumination phase-contrast cell microscopy image enhancement network;
[0056] S103, using the dataset to train a low-light phase-contrast cell microscopy image enhancement network;
[0057] S104, enhancing the phase contrast cell microscopic image using the trained low illumination phase contrast cell microscopic image enhancement network;
[0058] For details, see Figure 2 As shown, the low-illumination phase-contrast cell microscopic image enhancement network includes a feature pre-enhancement network, a generator and a discriminator connected in sequence. The feature pre-enhancement network pre-enhances the input phase-contrast cell microscopic image and outputs the pre-enhanced image to the generator; the generator extracts multi-scale features through a number of alternately connected multi-scale Transformer modules and convolutional layers, and outputs the generated image to the discriminator; the discriminator ensures that the generated image is not distorted, and outputs the generated image as an enhanced image.
[0059] Specifically, the feature pre-enhancement network is an encoder-decoder structure using a 1×1 depth-separable convolution kernel, and the encoder-decoder structure is a 4-layer non-pooled ResNet34 backbone network.
[0060] Specifically, the feature pre-enhancement network is composed of a 1×1 depth-separable convolution kernel encoder-decoder structure, the encoder and decoder have the same structure, and are composed of a 4-layer non-pooled ResNet34 backbone network; the loss function of the feature pre-enhancement network is obtained by the following steps:
[0061] The phase contrast cell microscopy image is pre-enhanced using the bright grayscale prior and dark grayscale prior, expressed as:
[0062] L BRGP = ‖ I − [ ( I MAX − I ) + ( I μ + I avg ) 2 ] ‖ 1 ;
[0063] L BLGP = ‖ I − [ ( I − I MIN ) + ( I μ − I avg ) 2 ] ‖ 1 ;
[0064] Among them, L BRGP and L BLGP They represent the bright grayscale prior loss term and the dark grayscale prior loss term respectively, I represents the input phase contrast cell microscopy image, and I max ,I min , I μ and I avg They represent the maximum, minimum, variance and mean of the input phase contrast cell microscopy images respectively.
[0065] Then the loss function of the feature preprocessing module is:
[0066]
[0067] Among them, L E represents the loss function of the feature pre-enhancement network, λ a and λ b Represents the constraint weight.
[0068] Specifically, the generator is a U-shaped structure network composed of 6 layers of deep separable convolution, and each convolution layer is combined with a multi-scale Transformer module to enhance the feature extraction and fusion of the network. The convolution layer is used to increase the feature dimension, and the multi-scale Transformer module is used to extract features from the output of the convolution layer; the discriminator is composed of 6 layers of deep separable convolution.
[0069] Specifically, the structure of the multi-scale Transformer module can be found in Figure 3 As shown in the figure, after the input feature is input to the multi-scale Transformer module, it undergoes 3×3 convolution, and further fuses the feature information through normalization and weighted fusion operations to obtain fused features. After the Gelu activation function and linear operation, the deep fusion feature containing edge features and detail features is obtained, and then the following steps are performed on the deep fusion feature:
[0070] First, the irregular features and sizes in phase contrast cell microscopy images easily affect the image enhancement effect, resulting in insufficient learning of the unlabeled microscopy image features by the enhancement network. Therefore, in order to suppress unnecessary noise and impurities in the background, the horizontal average pooling and vertical average pooling methods are used to encode each channel, capture the spatial long-range dependency with precise position information, and integrate the two spatial directions into a channel descriptor, thereby obtaining a direction-aware attention map, which is expressed as:
[0071] ;
[0072] Among them, Z C represents the feature obtained by global average pooling, x crepresents the value of the position (i, j) in the image input to the c-th layer multi-scale Transformer module, H and W represent the length and width of the input phase contrast cell microscopy image respectively; then the linear layer and normalization layer are used to avoid destroying the manifold of interest and enhance the network's attention to cell features; in order to improve the nonlinear expression and feature extraction capabilities of the module, 1×1 and 3×3 depthwise separable convolutions can map the channel correlation and spatial correlation of the features respectively; through the superposition of convolutions with holes of different scales, feature maps containing different receptive fields are extracted, which are expressed as:
[0073] y c = L i n e a r ( N o r m [ Z 1 ,..., Z n ] ) ;
[0074] Among them, Linear represents linear operation, Norm represents normalization operation, and Z n Represents feature information of different scales.
[0075] Secondly, the average pooling and maximum pooling operations are used to reduce the increase in the variance of the estimated value due to the limited neighborhood size, suppress unnecessary noise and impurities in the background, and retain more image feature information, which is expressed as:
[0076] y f ( i , j ) = σ ( β [ x c ( i , j ) ] ) ;
[0077] Among them, y f represents feature information, σ and β represent average pooling operation and maximum pooling operation respectively;
[0078] Thirdly, for the irregular features and sizes in phase contrast cell microscopy images, global pooling and fully connected layers are used to integrate global spatial information of different scales through different receptive fields, which can be expressed as:
[0079] y s ( i , j ) = α ( concat [ x 1 ,..., x n ] ) ;
[0080] Among them, y s represents the global spatial information, and α represents the global pooling of the cth convolutional layer;
[0081] Finally, the results of the three attention channels are combined by the reweighting factor to obtain the output of the feature map, which is expressed as:
[0082] ;
[0083] Among them, Y C(i,j) represents the output feature map of the c-th layer multi-scale Transformer module, which integrates the local channel information x c , global space information x s and feature information x f .
[0084] Specifically, the generator and the discriminator form a generative adversarial network, and the loss function of the generative adversarial network is It is expressed as:
[0085] L GAN = min G e max D e ℒ ( G e , D e ) = E y [ log G e ( y ) ] + E y , z [ log ( 1 − G e ( x ∧ ) ) ] ;
[0086] Among them, L GAN represents the loss function of the generative adversarial network, represents the minimum value of the generator and the maximum value of the discriminator; Ge (•) represents the enhancement result, conditioned on the input image x and the enhanced image z, and De (•) distinguishes the difference between the input image x and the real image y; Indicates that all x are real data expectations, Indicates that the data are all generated data expectations; Represents arbitrary random data with the same data structure as real images.
[0087] Specifically, the S104 includes the following steps:
[0088] Input the phase contrast cell microscopic image into the feature enhancement network, and obtain the encoded features after passing through the encoder; after the encoded features are pre-enhanced by bright grayscale priori and dark grayscale priori, the pre-enhanced feature information is obtained; the pre-enhanced feature information is decoded by the decoder to obtain the pre-enhanced priori features as the pre-enhanced image;
[0089] The pre-enhanced image is input to the generator, and after being trained in a 6-layer multi-scale Transformer module and a 6-layer convolution to extract multi-scale features, the generated image is output; the generated image is input to the discriminator to obtain an enhanced image with enhanced overall brightness and contrast.
[0090] The images involved in S104 are shown in FIG4 , where FIG4 (a) is an input phase contrast cell microscopy image, FIG4 (b) is a pre-enhanced image, and FIG4 (c) is an enhanced image. It can be seen from the figure that the embodiment of the present invention solves the problem of overall dark brightness and low contrast in phase contrast cell microscopy images, and the network model used does not require high-quality image-guided training.
[0091] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A low-illumination phase contrast cell microscopic image enhancement method based on a multi-scale transformer, characterized in that: The steps include: Acquire a phase contrast cell microscopic image collected in a microscopic imaging system as a data set; Construct a low-illumination phase-contrast cell microscopic image enhancement network; Use the dataset to train a low-light phase-contrast cell microscopy image enhancement network; The phase contrast cell microscopy images are enhanced using the trained low-illumination phase contrast cell microscopy image enhancement network; The low-illumination phase-contrast cell microscopic image enhancement network comprises a feature pre-enhancement network, a generator and a discriminator which are connected in sequence. The feature pre-enhancement network pre-enhances the input phase-contrast cell microscopic image and outputs the pre-enhanced image to the generator. The generator extracts multi-scale features through alternately connected multi-scale Transformer modules and convolutional layers and outputs the generated image to the discriminator. The discriminator ensures that the generated image is not distorted and outputs the generated image as an enhanced image. The feature pre-enhancement network pre-enhances the input phase contrast cell microscopy image, comprising the following steps: After the phase contrast cell microscopy image is input into the feature pre-enhancement network, it first enters the encoder for encoding to obtain the encoded features; The coding features are input into the bright grayscale prior and the dark grayscale prior for pre-enhancement respectively to obtain the pre-enhancement coding features; The pre-enhancement coding features are input into the decoder to obtain the pre-enhancement prior features as the pre-enhancement image; The generator adopts a U-shaped structure network consisting of 6 layers of deep separable convolutional layers, and adds a multi-scale Transformer module after each convolutional layer to enhance the feature extraction and fusion of the network. The convolutional layer is used to increase the feature dimension, and the multi-scale Transformer module is used to extract features from the output of the convolutional layer; the discriminator is composed of 6 layers of deep separable convolution; The multi-scale Transformer module is used to extract features from the features output by the convolutional layer, and includes the following steps: S1, uses horizontal average pooling and vertical average pooling methods to encode each channel, captures the spatial long-range dependency with precise position information, and integrates the two spatial directions into Z C , and then use Z C Extract feature maps y containing different receptive fields c , expressed as: y c =Linear(Norm[Z1,...,Z n ]); Among them, x c (i, j) represents the value of the position (i, j) in the image input to the c-th layer multi-scale Transformer, H and W represent the length and width of the input phase contrast cell microscopy image, respectively, and Z C Indicates x c (i,j) is the feature obtained by global average pooling; Z1,...,Z n Represents features of different scales; Linear represents linear operations, and Norm represents normalization operations; S2, using average pooling and maximum pooling operations to reduce the increase in the variance of the estimated value due to the limited neighborhood size, obtain feature information y f (i,j), expressed as: y f (i,j)=σ(β[x c (i,j)]); Among them, σ and β are average pooling operation and maximum pooling operation respectively; S3 uses global pooling and fully connected layers to integrate feature information of different scales through different receptive fields to obtain global spatial information y s (i,j), expressed as: y s (i,j)=α(concat[x1,...,x n ]); Among them, α represents the global pooling operation, x1,...,x n Represent feature information at different scales; S4, combine the results of the three attention channels to obtain the feature map Y c (i,j), expressed as: Y c (i,j)=y c (i,j)×y s (i,j)×y f (i,j); Among them, Y c (i,j) represents the output feature map of the c-th layer multi-scale Transformer.
2. The multi-scale transformer-based low-illumination phase contrast cell microscopic image enhancement method according to claim 1, characterized in that: The feature pre-enhancement network is an encoder-decoder structure using a 1×1 depth-separable convolution kernel, and the encoder-decoder structure is a 4-layer non-pooled ResNet34 backbone network.
3. The low-illumination phase contrast cell microscopic image enhancement method based on multi-scale transformer according to claim 1, characterized in that: The loss function of the feature pre-enhancement network is expressed as: L E =λ a L BRGP -l b L BLGP ; Among them, L E represents the loss function of the feature pre-enhancement network, λ a and λ b Both represent constraint weights; L BRGP and L BLGP They represent the bright grayscale prior loss term and the dark grayscale prior loss term respectively; I represents the input phase contrast cell microscopy image, I MAX ,I MIN ,I μ and I avg They represent the maximum, minimum, variance and mean of the input phase contrast cell microscopy images respectively.
4. The multi-scale transformer-based low-illumination phase contrast cell microscopic image enhancement method according to claim 1, characterized in that: The generator and the discriminator form a generative adversarial network, and the loss function L of the generative adversarial network is GAN It is expressed as: Among them, L GAN represents the loss function of the generative adversarial network, represents the minimum value of the generator and the maximum value of the discriminator; G e (·) represents the enhancement result, which is conditioned on the input image x and the enhanced image z. e (·) distinguish the difference between the input image x and the real image y; E y log G means that all x are real data e (y) expectation, E y,z Indicates that the data are all generated data expectations; Represents arbitrary random data with the same data structure as real images.
5. The low-illumination phase contrast cell microscopic image enhancement method based on multi-scale transformer according to claim 1, characterized in that: The method of enhancing the phase contrast cell microscopic image by using the trained low illumination phase contrast cell microscopic image enhancement network comprises the following steps: Input the phase contrast cell microscopic image into the feature enhancement network, and obtain the encoded features after passing through the encoder; after the encoded features are pre-enhanced by bright grayscale priori and dark grayscale priori, the pre-enhanced feature information is obtained; the pre-enhanced feature information is decoded by the decoder to obtain the pre-enhanced priori features as the pre-enhanced image; The pre-enhanced image is input to the generator, and after being trained in a 6-layer multi-scale Transformer module and a 6-layer convolution to extract multi-scale features, the generated image is output; the generated image is input to the discriminator to obtain an enhanced image with overall brightness enhancement and contrast enhancement.
