Adaptive threshold segmentation method and device for astrocyte dynamic calcium events

An adaptive threshold segmentation method was used to enhance and denoise astrocyte calcium signals. A dynamic temporal mask was constructed and Gaussian mixture model was used for segmented estimation. This solved the problem of noise interference in astrocyte calcium signal imaging and achieved efficient calcium signal segmentation in low signal-to-noise ratio environments.

CN121544658BActive Publication Date: 2026-03-27TIANJIN POLYTECHNIC UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-20
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Astrocyte calcium signal imaging is difficult to accurately capture weak calcium signals in high noise and low signal-to-noise ratio environments, and existing technologies struggle to achieve a balance between spatiotemporal fidelity and noise reduction performance.

Method used

An adaptive threshold segmentation method is adopted, including calcium signal enhancement and denoising preprocessing, dynamic temporal mask construction, piecewise estimation based on Gaussian mixture model and adaptive threshold update. By constructing a temporal mask, noise is effectively suppressed, and weak calcium signals are identified and extracted.

Benefits of technology

It significantly improves the detection capability of weak calcium events under high noise and low signal-to-noise ratio conditions, accurately segments dynamic calcium events, improves the spatial and temporal resolution of the signal, and enhances the degree of automation and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544658B_ABST
    Figure CN121544658B_ABST
Patent Text Reader

Abstract

The application discloses a kind of astrocyte dynamic calcium event adaptive threshold segmentation method and device, it is related to cell calcium signal identification technical field, including: original video is carried out calcium signal enhancement denoising, constructs time sequence mask dynamic tracking calcium active event, based on Gaussian mixture model, gray distribution is fitted as multiple Gaussian components superposition and segmented estimation extracts active calcium signal, calculate highlight pixel proportion and interframe similarity index, adaptive dynamic update global threshold and local threshold, generate calcium signal image by window function transformation.Can be in high noise, low signal-to-noise ratio astrocyte calcium imaging video, effectively suppress random imaging noise and preserve weak signal, significantly improve the transient calcium event detection capability of astrocyte, adaptively identify the brightest active calcium signal peak, dynamically adapt the brightness distribution change of each frame image, stably and accurately segment out dynamic calcium event, robustness is strong, degree of automation is high.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cell calcium signal recognition, and particularly relates to a self-adaptive threshold segmentation method and device for dynamic calcium events of astrocytes. BACKGROUND

[0002] Astrocytes are widely distributed in various regions of the brain, and together with neurons, other glial cells and blood vessels, they form a complex interaction network. Astrocytes are generally considered to be passive participants in neural information transmission, although they lack electrical excitability, they can also communicate with adjacent neurons and local microenvironments through intracellular Ca 2+ signals. Astrocyte calcium activity is a key window for analyzing brain network function and disease mechanism. Through two-photon microscopy, near-infrared femtosecond laser is used to accurately excite two-photon in the focal plane, which can generate second harmonic or fluorescence signals in the plane, with subcellular resolution and millisecond-level time response, providing an important technical means for monitoring calcium transient events of astrocytes in vivo.

[0003] However, cell calcium event imaging is often limited by low signal-to-noise ratio, as well as the high frequency, multi-morphology and transient characteristics of calcium events. Imaging often has difficulty in clearly presenting the spatial details of small calcium signals. Through time and space processing strategies such as prolonged exposure, Gaussian filtering and ROI (region of interest) analysis, the details of rapid calcium signals are easily lost, especially in the case of weaker calcium signals of astrocytes and high coupling with background and noise, it is difficult to balance the spatiotemporal fidelity and noise reduction performance. SUMMARY

[0004] The embodiments of the present application provide a self-adaptive threshold segmentation method and device for dynamic calcium events of astrocytes, to solve the technical problem that weak calcium signals of astrocytes are difficult to capture with high spatiotemporal fidelity in the background and noise.

[0005] In a first aspect, the embodiments of the present application provide a self-adaptive threshold segmentation method for dynamic calcium events of astrocytes, comprising:

[0006] S101, acquiring an original calcium imaging video sequence and performing calcium signal enhancement and denoising preprocessing to obtain an enhanced time sequence image sequence;

[0007] S102, constructing a time sequence mask according to the enhanced time sequence image sequence to dynamically track calcium active event signal regions that appear continuously therein, to obtain a dynamic time sequence mask sequence;

[0008] S103, fitting the gray scale distribution of each single frame image into a probability density function superimposed by multiple Gaussian components based on the dynamic time sequence mask sequence, performing piecewise estimation on each Gaussian component by using an expectation maximization algorithm, and extracting an active calcium signal component therefrom;

[0009] S104, calculating a highlight pixel proportion of each single frame image according to the dynamic time sequence mask sequence, performing adaptive dynamic update on a global threshold, and calculating an interframe similarity index to perform adaptive dynamic update on a local threshold;

[0010] S105, performing window function transformation on the active calcium signal component to generate a calcium signal image adapted for display.

[0011] In a second aspect, an embodiment of the present application provides an adaptive threshold segmentation device for dynamic calcium events of astrocytes, comprising:

[0012] An image preprocessing module configured to perform calcium signal enhancement and denoising preprocessing on an original calcium imaging video sequence to obtain an enhanced time sequence image sequence;

[0013] A dynamic tracking module configured to construct a time sequence mask according to the enhanced time sequence image sequence to dynamically track calcium active event signal regions appearing continuously in the time sequence mask to obtain a dynamic time sequence mask sequence;

[0014] A Gaussian mixture model module configured to fit a gray scale distribution of each single frame image into a probability density function superimposed by multiple Gaussian components based on a Gaussian mixture model, perform piecewise estimation on each Gaussian component by using an expectation maximization algorithm, and extract an active calcium signal component therefrom;

[0015] An adaptive dynamic update module configured to calculate a highlight pixel proportion of each single frame image and an interframe similarity index according to the dynamic time sequence mask sequence to perform adaptive dynamic update on a global threshold and a local threshold, respectively;

[0016] An image generation module configured to perform window function transformation on the active calcium signal component to generate a calcium signal image adapted for display.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising:

[0018] One or more processors;

[0019] A storage device configured to store one or more programs,

[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the adaptive threshold segmentation method for dynamic calcium events of astrocytes described above.

[0021] In a fourth aspect, the embodiments of the present application provide a storage medium containing computer executable instructions for performing the adaptive threshold segmentation method of dynamic calcium events of astrocytes when executed by a computer processor.

[0022] The adaptive threshold segmentation method and device of dynamic calcium events of astrocytes provided by the embodiments of the present application can effectively suppress noise and retain weak signals by constructing a time sequence mask in the astrocyte calcium imaging video with high noise and low signal-to-noise ratio, accurately filter out random imaging noise that appears as isolated points in space or time, and significantly improve the detection ability of weak and transient calcium events in a low signal-to-noise ratio environment. By using the Gaussian mixture model to unsupervisedly fit and segmentally estimate the gray scale distribution of each image, the "active calcium signal peak" representing the brightest area can be adaptively identified, instead of relying on a fixed threshold, which can dynamically adapt to the specific brightness distribution changes of each image, stably and accurately segment the dynamic calcium events, and only a few key parameters need to be set, so that the robustness is high and the automation degree is high. BRIEF DESCRIPTION OF DRAWINGS

[0023] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. In the drawings:

[0024] Figure 1 A flowchart of the adaptive threshold segmentation method of dynamic calcium events of astrocytes according to the first embodiment of the present application;

[0025] Figure 2 A flowchart of the adaptive threshold segmentation method of dynamic calcium events of astrocytes according to the second embodiment of the present application;

[0026] Figure 3 A flowchart of the adaptive threshold segmentation method of dynamic calcium events of astrocytes according to the third embodiment of the present application;

[0027] Figure 4 A structural schematic diagram of the adaptive threshold segmentation device of dynamic calcium events of astrocytes according to the fourth embodiment of the present application;

[0028] Figure 5 A structural diagram of the electronic device according to the fifth embodiment of the present application. DETAILED DESCRIPTION

[0029] The application will be described in further detail below with reference to the drawings and embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not to be used to limit the application. In addition, it should be noted that, for the sake of brevity, only structures related to the application are shown and described in the drawings.

[0030] Embodiment one

[0031] Figure 1 A flowchart of the adaptive threshold segmentation method of the astrocyte dynamic calcium event according to the embodiment one of the application, and the specific steps include the following steps:

[0032] S101, obtaining the original calcium imaging video sequence, and performing calcium signal enhancement and denoising preprocessing to obtain the enhanced time sequence image sequence.

[0033] The astrocyte calcium imaging video is collected by a two-photon microscope, and specifically, the astrocyte calcium imaging video of a living mouse collected by a two-photon microscope forms the original calcium imaging video sequence. Exemplarily, the video sequence is usually a gray sequence with 8-bit or 16-bit depth, and the imaging parameters are as follows: excitation wavelength 920 nm, acquisition frequency 40 Hz, single-frame resolution 512x512 pixels, original bit depth 8-bit (0-255), imaging depth 80-180 μm, and recording time 1 minute (2400 frames). Then, the collected original calcium imaging video sequence is preprocessed to suppress noise, enhance weak calcium signals, and separate static background. After preprocessing, the enhanced time sequence image sequence with a bit depth of 16 bits is obtained , wherein represents the frame number, represents the pixel coordinate.

[0034] S102, constructing a time sequence mask according to the enhanced time sequence image sequence to dynamically track the calcium active event signal region appearing continuously therein, and obtaining a dynamic time sequence mask sequence.

[0035] The calcium event of astrocytes usually appears as a continuous region in space and a brightness enhancement lasting for several to dozens of frames in time. Random noise appears as an isolated point in both time and space. By constructing a time sequence mask, the signals appearing continuously in the time dimension can be effectively screened, and the transient noise points can be filtered out. By introducing a time continuity constraint, a dynamic time sequence mask sequence as long as the video sequence is finally output , wherein represents that the pixel is determined to possibly belong to a continuous calcium active event in the frame. By dynamically tracking the signal region of the calcium active event, a dynamic time sequence mask sequence reflecting the duration of the calcium active event is formed.

[0036] S103, according to the dynamic timing mask sequence, the gray scale distribution of each single frame image is fitted into a probability density function superimposed by multiple Gaussian components based on the Gaussian mixture model, the expectation maximization algorithm is used for segment estimation of each Gaussian component, and the active calcium signal component is extracted.

[0037] By regarding the gray scale histogram of each frame image as being superimposed by multiple Gaussian components, the brightest Gaussian component corresponds to the brightest object in the image, i.e. the active calcium signal region, and other darker Gaussian components correspond to static background, noise base, etc. in the form of probability density function. By fitting the Gaussian mixture model and identifying the brightest Gaussian component, the "highlight" standard of each frame can be adaptively determined, so that the active calcium signal component can be accurately extracted , wherein represents the frame number, represents the pixel coordinate.

[0038] S104, the highlight pixel proportion of each single frame image is calculated according to the dynamic timing mask sequence, so as to adaptively and dynamically update the global threshold value, and the inter-frame similarity index is calculated, so as to adaptively and dynamically update the local threshold value.

[0039] In the imaging process, due to factors such as focus drift, tissue motion or fluorescent dye photobleaching, the overall brightness and contrast of the image may change, and the fixed threshold parameter is difficult to adapt to such changes. By using the highlight pixel proportion and the overlap degree (Jaccard index) of the detection region between consecutive frames, the adaptive "highlight" standard, i.e. the global threshold value (used to distinguish whether it is an active calcium signal) and the local threshold value (used to distinguish whether it is a sustained period of active calcium signal), is dynamically adjusted, so as to dynamically adapt to the changes of the imaging conditions and ensure the stable detection performance of the calcium signal.

[0040] S105, performing window function transformation on the active calcium signal component to generate a calcium signal image suitable for display.

[0041] The extracted active calcium signal component is usually 16-bit depth. In order to facilitate observation, analysis and subsequent processing, it needs to be mapped to an 8-bit (256 color) display range suitable for general display. By performing transformation through a window function (such as linear compression), while retaining the relative intensity relationship and morphological characteristics of the signal, a calcium signal image sequence for final display is generated , wherein represents the frame number, represents the pixel coordinate.

[0042] The embodiment performs calcium signal enhancement and denoising preprocessing on the original calcium signal image, constructs a dynamic timing mask for tracking, extracts active calcium signals based on Gaussian mixture model segmentation estimation, adaptively updates the global threshold and the local threshold, and performs window function transformation on the extracted active calcium signals, and finally outputs the display. In the astrocyte calcium imaging video with high noise and low signal-to-noise ratio, the noise can be effectively suppressed and the weak signal can be retained by constructing a timing mask, the random imaging noise which appears as an isolated point in space or time can be accurately filtered out, and the detection ability of weak and transient calcium events in a low signal-to-noise ratio environment can be significantly improved. By using the Gaussian mixture model to unsupervisedly fit and segmentally estimate the gray scale distribution of each frame of image, the 'active calcium signal peak' representing the brightest area can be adaptively identified, instead of relying on a fixed threshold, and the dynamic calcium event can be stably and accurately segmented, only a few key parameters need to be set, and the robustness and automation degree are high.

[0043] Embodiment two

[0044] Figure 2 The flowchart of the adaptive threshold segmentation method for astrocyte dynamic calcium events according to the second embodiment of the application is based on the above-mentioned embodiment and is optimized in the present embodiment. In the present embodiment, S102 is specifically optimized as follows:

[0045] According to the enhanced timing image sequence, the gray mean value and the standard deviation of the current frame image are calculated;

[0046] According to the gray mean value and the standard deviation of the current frame image, an instantaneous active mask is generated based on a preset initial global threshold;

[0047] According to the instantaneous active mask, a counting matrix is used to count the number of continuous frames in which each pixel is marked as active;

[0048] Based on the preset initial local threshold and the counting matrix, a dynamic timing mask sequence is generated using a plurality of continuous instantaneous active masks.

[0049] Correspondingly, the adaptive threshold segmentation method for astrocyte dynamic calcium events provided by the present embodiment specifically comprises:

[0050] S201, an original calcium imaging video sequence is obtained, and calcium signal enhancement and denoising preprocessing are performed on the original calcium imaging video sequence to obtain an enhanced timing image sequence.

[0051] An optional implementation of the present embodiment is that the obtained original calcium imaging video sequence is subjected to frame accumulation processing to obtain an accumulated video sequence.

[0052] In the images captured by two-photon microscope, there is often accompanied by additive noise, which is mutually independent distribution in spatial domain, due to the calcium ion concentration changes is a relatively slow process, so in the short time (such as hundreds of milliseconds) of continuous frames, calcium signal spatial distribution is basically stable, and the imaging noise is independent and random between frames. In order to improve the signal-to-noise ratio of weak calcium signal image, by accumulating the original calcium imaging video sequence, the accumulated video sequence is formed without changing the sensor settings, compared with the overexposure and dynamic range limitation caused by simply prolonging the exposure time, which can significantly enhance the signal-to-noise ratio of weak calcium signal. For example, in the first frame of the original calcium imaging video sequence, set as the image signal of the frame, while the signal in the field of view in the continuous frames has no significant change, denoted as . That is, the premise of frame accumulation is that the target signal has no significant fluctuation in continuous multiple frames, so the image signal of each frame in a period of time is expressed as . .

[0053] Taking the original video sequence as the continuous frames in the original video sequence, the accumulated video sequence is generated, using to represent the random noise in the figure, and each frame noise is independent of each other, the signal-to-noise ratio of a single frame image can be expressed as , the total noise after accumulation is , according to the noise variance and the noise standard deviation , the signal-to-noise ratio of the accumulated image is:

[0054]

[0055] Due to the frame accumulation operation of accumulating continuous frames, the signal is linearly enhanced by times, while the noise grows about times due to its randomness, so the signal-to-noise ratio (SNR) is improved by about times. According to the average shortest duration of astrocyte calcium event is 333 ms, so at the typical imaging frame rate of 40 Hz, the theoretical window of frame accumulation window M = 40 x 0.333 ≈ 13.33 frames, so M = 13 frames are taken in this embodiment, and the step is 1 frame to retain all time information. Then the gray value of 13 frames is accumulated pixel by pixel, and the 8-bit video is expanded to 16-bit depth to prevent pixel value overflow.

[0056] The accumulated video sequence is subjected to background subtraction and normalization processing to obtain a dynamic signal video sequence. ​​

[0057] The frame-accumulated image still contains a large amount of static structures that do not change over time, such as cytoskeleton and blood vessels. In order to decouple the static background from the dynamic calcium signal, background subtraction and normalization are performed. The background image can be obtained by calculating the time average of all frames of the frame-accumulated video sequence:

[0058]

[0059] wherein, is the gray value (16 bit) of the pixel point in the i-th frame, x represents the i-th frame, and T is the total number of frames. Since the calcium event has a high-frequency characteristic and the noise has a symmetric characteristic, the background image mainly retains the static tissue signal, and the static background is removed from each frame and normalized to obtain a dynamic signal video sequence containing only dynamic changes and noise, and the formula is:

[0060]

[0061] wherein, represents a gray unit used to prevent division by zero, is a single-frame result, and the processing needs to be performed on each frame. Normalization can be a de-dimensioning process.

[0062] Gaussian filtering is performed on the dynamic signal video sequence to obtain an enhanced time sequence image sequence.

[0063] In order to suppress high-frequency noise and reduce baseline fluctuation, Gaussian filtering is performed on the 16-bit dynamic signal video sequence to complete spatial and temporal smoothing. The dynamic signal video sequence of the i-th frame is convolved with an isotropic Gaussian kernel for each frame image, and the convolution kernel function can be represented as:

[0064]

[0065] wherein, is a pixel coordinate offset, is a standard deviation of each frame image used to control the smoothing intensity, is a normalization constant to ensure , is the integral of the element in . In addition, in order to avoid truncation error, the convolution window radius is a hyperparameter, covering pixels. The discrete convolution formula is:

[0066] ​​​​

[0067] wherein, denotes the relative offset of the pixel, to ensure the kernel normalization, denote the row and column direction offset for traversing the kernel during normalization, respectively. The image boundary is handled by mirror padding, which expands the image boundary outward by symmetric mapping, ensuring that the convolution kernel can also take pixel values consistent with the internal gray scale distribution at the edge, to avoid edge artifacts. Through frame accumulation, static background removal and Gaussian filtering, the pre-processed enhanced time series image sequence is obtained.

[0068] S202, according to the enhanced time series image sequence, the gray mean and standard deviation of the current frame image are calculated.

[0069] For the first frame image of the enhanced time series image sequence , its global gray mean and standard deviation are calculated, and the formula is as follows:

[0070]

[0071] wherein, X and Y are the width and height (pixels) of the video, are the horizontal and vertical coordinates of the pixel, is the first frame image.

[0072] S203, according to the gray mean and standard deviation of the current frame image, the instantaneous active mask is generated based on the preset initial global threshold.

[0073] A global threshold is used to preliminarily determine whether each pixel is "active" or not: the global threshold can be regarded as a candidate calcium transient activity intensity judgment standard, and the initial global threshold is preset to 3, i.e. 3 brightness units, indicating that the brightness of calcium transient activity is higher than that of the current frame by 3 brightness units. Using the global threshold and the gray mean and the standard deviation , the instantaneous mask of each frame image is generated, which captures all pixels in the current frame that are significantly brighter than the average level, and the formula is as follows:

[0074]

[0075] S204, according to the instantaneous active mask, the count matrix is used to count the number of consecutive frames in which each pixel is marked as active.

[0076] maintain a count matrix with the same size as the image, update for each frame, record each pixel( ) the number of consecutive frames marked as active:

[0077]

[0078] S205, based on the initial local threshold and the statistical results of the count matrix, a plurality of continuous instantaneous active masks are used to generate a dynamic timing mask sequence.

[0079] Using a local threshold to determine the continuity of calcium signals in time, according to the statistical results of the count matrix, a plurality of continuous instantaneous active masks are combined to generate a dynamic timing mask sequence :

[0080]

[0081] wherein, is a local threshold (a timing length threshold), the initial value is preset to 5 frames (1 frame =0.025s, 40Hz), which can be regarded as a criterion for judging calcium transient events according to the duration, indicating the minimum duration of calcium transient time, only those pixel regions that appear in time for a long enough time will be retained in the timing mask, and those less than the minimum time will be considered as noise or fluctuation, thereby effectively filtering out isolated noise points.

[0082] S206, according to the dynamic timing mask sequence, the gray scale distribution of each single frame image is fitted as a probability density function superimposed by multiple Gaussian components based on Gaussian mixture model, and the expectation maximization algorithm is used to segmentally estimate each Gaussian component to extract the active calcium signal component.

[0083] S207, according to the dynamic timing mask sequence, the highlight pixel proportion of each single frame image is calculated to adaptively and dynamically update the global threshold, and the interframe similarity index is calculated to adaptively and dynamically update the local threshold.

[0084] S208, the window function transformation is performed on the active calcium signal component to generate a calcium signal image suitable for display.

[0085] The detected active calcium signal gray scale is mapped from 16bit to 8bit (256 colors), and the display bit depth is adapted to avoid detail loss caused by directly displaying 16bit video. First, the background is set to zero: , wherein is the spatiotemporal range of the target event mask, is the horizontal and vertical coordinate point position in the image sequence, ∈X, ∈Y. X and Y correspond to the maximum dimensions of the image, respectively. Then, linear compression is applied to the grayscale of the active calcium signal, using the following formula:

[0086]

[0087] in, For the first Target pixel value in the frame, This represents the theoretical upper limit of the positional value of a single pixel during frame accumulation. Accumulate the window length for each frame (i.e., for consecutive frames) (Accumulate each frame) This indicates rounding (because integers are needed after bit depth compression). The final calcium signal image is then obtained and adapted for display.

[0088] This embodiment improves the image signal-to-noise ratio by using frame accumulation operations, leveraging the short-term stability of the signal and the random and independent nature of noise. This is achieved without altering hardware exposure parameters. By calculating and subtracting the time-averaged background image of the entire sequence, interference from nearly unchanging static structures such as the cytoskeleton and blood vessels can be efficiently removed. Bright areas are initially screened using a global threshold to generate a transient active mask, and then a dynamic temporal mask is generated using a counting matrix and local thresholds. This ensures that the identified calcium signal regions are not only significantly bright in a single frame but also continuous over time, thus matching the spatiotemporal characteristics of real calcium events, suppressing transient noise interference, and improving the specificity of calcium activity event detection.

[0089] Example 3

[0090] Figure 3 This is a flowchart of an adaptive threshold segmentation method for dynamic calcium events in astrocytes according to Embodiment 3 of the present invention. This embodiment is based on the above embodiment and optimized. In this embodiment, S103 is specifically optimized as follows:

[0091] Flatten all pixel grayscale values ​​of a single frame image into a one-dimensional vector, and initialize the weight parameters of multiple Gaussian components of grayscale distribution to ensure that the sum of all weight parameters is 1, thus forming the input sample set;

[0092] Based on the initial weight parameters of each Gaussian component of the gray-level distribution, the probability density is calculated and the distribution is normalized to form the expected responsibility of each Gaussian component of the gray-level distribution.

[0093] The weight parameters of each Gaussian component of the gray-level distribution are updated according to the expected responsibility, and the probability density value is iteratively calculated until the log-likelihood function converges or the preset maximum number of iterations is reached, so as to obtain the probability density distribution of a single frame image.

[0094] According to the probability density distribution of each single frame image, the gray scale distribution Gaussian components are sorted and segmented, and the active calcium signal peak is determined, and the active calcium signal component is extracted in the gray scale interval corresponding to the active calcium signal peak.

[0095] Correspondingly, the adaptive threshold segmentation method for dynamic calcium events of astrocytes provided in the embodiment specifically comprises the following steps.

[0096] S301, an original calcium imaging video sequence is obtained, and calcium signal enhancement and denoising preprocessing are performed on the original calcium imaging video sequence to obtain an enhanced time sequence image sequence.

[0097] S302, a time sequence mask is constructed according to the enhanced time sequence image sequence to dynamically track the calcium active event signal region appearing continuously in the enhanced time sequence image sequence, and a dynamic time sequence mask sequence is obtained.

[0098] S303, according to the dynamic time sequence mask sequence, the gray scale values of all pixels of a single frame image are flattened into a one-dimensional vector, and the parameters of a plurality of Gaussian components are randomly initialized to ensure that the weight parameters of all Gaussian components are summed to 1, and an input sample set is formed.

[0099] For the first frame image , first, according to its dynamic time sequence mask sequence , only the pixel region (i.e., the region that may contain signals) of is subjected to Gaussian mixture model (GMM) fitting to reduce the interference of background pixels. Exemplarily, the gray scale values of all pixels of the single frame image are flattened into a one-dimensional sample data set , and its probability density is formed by superimposing at most Gaussian components to describe the constitutive attribute parameters of the frame image, wherein is a weight coefficient, and are mean and standard deviation, respectively, and can be expressed as the following formula:

[0100]

[0101] wherein, N() represents a normal distribution, represents one gray scale value after each frame image is flattened into a one-dimensional vector, represents the th Gaussian component, represents the probability of the pixel with the gray scale value appearing under the normal distribution with the mean and the variance . The probability density parameters of each Gaussian component are randomly initialized while ensuring that the weight sum of all Gaussian components is 1.

[0102] S304, according to the initialized weight parameters of each Gaussian component, the probability density is weighted and calculated, and the distribution is normalized to form the expected responsibility of each Gaussian component.

[0103] According to the established model, for each sample and each Gaussian component, the maximum likelihood algorithm (Expectation-Maximization) is used to estimate If the pixel gray scale is unique, it is automatically degraded to a single Gaussian component model Under the current parameters of random initialization, the probability density parameters of a single pixel under each Gaussian component are calculated; then these probability density parameters are weighted according to their respective weights and normalized to a distribution; finally, the "expected responsibility" of each pixel to each Gaussian component is obtained, that is, the relative possibility of the pixel generated by the Gaussian component.

[0104] S305, according to the expected responsibility, the weight parameters of each gray scale distribution Gaussian component are updated, and the probability density value is iteratively fitted until the log-likelihood function converges or reaches a preset maximum iteration number, to obtain the probability density distribution of a single frame image.

[0105] The calculated "expected responsibility" is used to update the probability density parameters of all Gaussian components, wherein the weight: equal to the total responsibility of all pixels to the Gaussian component, divided by the total number of pixels, indicating the proportion of the Gaussian component in the whole; the mean: equal to the weighted average of all pixel gray scale values, the weight being the responsibility of the pixel to the Gaussian component; the variance: equal to the weighted sum of squares of the difference between all pixel gray scale values and the mean of the Gaussian component, divided by the total responsibility, indicating the dispersion degree of the component. The calculation of the "expected responsibility" and the update process (fitting) of the Gaussian component probability density parameters are iterated until the log-likelihood function value of the model changes less than a preset tolerance (such as 1e-6) or reaches a maximum iteration number (such as 100 times), to obtain the probability density distribution of a single frame image.

[0106] S306, according to the probability density distribution of each single frame image, each gray scale distribution Gaussian component is sorted and segmented to estimate and determine the active calcium signal peak, and the active calcium signal component is extracted in the gray scale interval corresponding to the active calcium signal peak.

[0107] After fitting is completed, according to the mean of each Gaussian component updated, the mean value of the component is arranged in ascending order, the component with the largest mean value, that is, the rightmost component, is identified as the "active calcium signal peak". The probability density parameters of the Gaussian component describe the typical gray scale level and distribution range of the calcium signal in the current frame. Specifically, according to the mean in the probability density distribution of each single frame image, each gray scale distribution Gaussian component is sorted in ascending order, and the rightmost component is identified as the active calcium signal peak.

[0108] Specifically, a binary mask is generated within the grayscale range corresponding to the active calcium signal peak.

[0109] First, a binary mask is generated in the gray-scale range corresponding to the active calcium signal peak. This range can be defined as 20% to 120% of the active calcium signal peak, covering approximately 95% of the signal pixels.

[0110] Connectivity analysis is performed on the binary mask, and regions with an area greater than a preset minimum area threshold and a gray-level gradient change greater than a preset gradient threshold are retained as active calcium signal components.

[0111] An 8-connected component analysis was performed on the binary mask to identify all independent connected regions. Then, morphological and intensity constraints were applied for filtering: all regions with an area greater than a preset minimum area threshold (29 pixels, 1 pixel = 0.187 μm, approximately corresponding to an actual area of ​​5.4 μm) were retained. 2 Independent connected regions with an average gray-level gradient change greater than a preset gradient threshold are considered as active calcium signal components constituting the image frame.

[0112] For example, for the mean After sorting in ascending order, define the rightmost component ( The peak value represents the active calcium signal, and the rest are classified as background. Each component is segmented, as shown in the following formula:

[0113]

[0114] in, For grayscale range, by Cut off to the actual extreme value. Let be the standard deviation of the nth Gaussian component, representing the "width" of the grayscale distribution of that component. To extract the grayscale range of the component, ensuring that only the main part of the component is processed; It is the gradient threshold, and Active calcium signaling components Background component ; As an area threshold, a minimum area of ​​29 pixels is strictly applied to active calcium signal peaks. The area threshold used in the background peak signal is then amplified multiple times to eliminate large areas of low-intensity artifacts. The formula can be expressed as:

[0115]

[0116] Next, active calcium signals are extracted, and a binary mask is generated within the peak region of the active calcium signals:

[0117]

[0118] Then 8-connected region labeling is done in the binary mask, and the region with area greater than and corresponding gray value gradient change greater than is reserved to ensure that the detected active calcium signal is large enough and bright enough, and the one less than the two thresholds is regarded as noise and excluded, and finally the active calcium signal region mask and the corresponding original gray are obtained.

[0119] S307, according to the dynamic timing mask sequence, the proportion of highlight pixels in each single frame image is calculated to adaptively and dynamically update the global threshold, and the inter-frame similarity index is calculated to adaptively and dynamically update the local threshold.

[0120] Optionally, according to the dynamic timing mask sequence, the proportion of highlight pixels in each single frame image is calculated, and the global threshold is dynamically updated based on the preset initial value.

[0121] For the update of the global threshold with each frame of the video, the proportion of pixels marked as 1 by the transient active mask in the i-th frame is calculated:

[0122]

[0123] Wherein, X and Y respectively correspond to the width and height of the video image; are the horizontal and vertical coordinates of the pixel point, respectively; is the dynamic timing mask sequence of the i-th frame. Then the fluctuation amount is calculated, and the global threshold is updated accordingly. That is, when the overall brightness of the image changes, the proportion of highlight pixels will dynamically change, so that the global threshold can be adaptively adjusted according to the overall brightness of the picture, and the formula is as follows:

[0124] According to the dynamic timing mask sequence, the inter-frame Jaccard index is calculated, and the local threshold is dynamically updated based on the preset initial value.

[0125] For the update of the global threshold with each frame of the video, the dynamic timing mask of the i-th frame and the j-th frame are calculated:

[0126] ​​​The Jaccard inter-frame similarity index between dynamic temporal masks measures the degree of overlap of detected active regions between consecutive frames. When the signal is continuous and stable, the inter-frame Jaccard index is close to 1, and the local threshold remains stable. When the signal is intermittent or there is significant noise interference, the inter-frame Jaccard index decreases, and the local threshold is moderately increased to require stricter continuity. The formula is expressed as follows:

[0127]

[0128] in, Indicates the first Frame. The local threshold is then updated accordingly:

[0129]

[0130] in, For inter-frame Jaccard exponents, The local threshold before the update. Indicates the first Frame. Based on the dynamic temporal mask sequence, the average gray level of the pixels within the mask and the standard deviation of the pixels outside the mask are calculated, and the ratio of the two is used as the signal-to-noise ratio. Combined with the smoothing coefficient, the piecewise estimation period of each Gaussian component is dynamically updated.

[0131] For the piecewise estimation period update of the Gaussian Mixture Model (GMM), it is not necessary to refit the computationally intensive GMM for every frame. First, based on the dynamic temporal mask sequence, the average gray level of the pixels within the mask and the standard deviation of the pixels outside the mask are calculated, and their ratio is used as the signal-to-noise ratio. The formula is expressed as follows:

[0132]

[0133] The numerator is the average gray level of the pixels within the mask, and the denominator is the standard deviation of the pixels outside the mask. Then, the smoothing coefficient is calculated. According to its update estimation cycle:

[0134]

[0135] During updates, the process begins after the initial period and repeats after each estimated period. This allows for a longer estimation period to reduce computation when the signal-to-noise ratio (SNR) is high (resulting in good image quality); conversely, a shorter period allows for more frequent model adjustments to adapt to changes when the SNR decreases.

[0136] S308 performs window function transformation on the active calcium signal components to generate a calcium signal image adapted for display.

[0137] The embodiment fits a single frame gray scale distribution into superposition of multiple Gaussian components by a Gaussian mixture model, and automatically estimates parameters of each component by using an expectation maximization algorithm, adaptively determines a "highlight signal" by identifying a component with the largest mean value as a signal peak, and has stronger robustness in dealing with complex and variable imaging backgrounds; by generating a binary mask in the signal peak gray scale interval and performing connected domain analysis, and combining a minimum area and a gray scale gradient threshold for screening, the real spatial form and boundary of a calcium active event are accurately restored; by adaptive updating of a global threshold, a local threshold and an estimated period, internal key parameters can be adjusted in real time according to a detection result (such as a highlight pixel ratio, an interframe overlap degree and a signal-to-noise ratio) of a previous frame or a previous period, so that the calcium active event segmentation method has a dynamic self-optimization capability, can continuously adapt to non-steady-state conditions such as light drift and noise fluctuation in the imaging process, and long-term maintains excellent segmentation performance.

[0138] Embodiment four

[0139] Figure 4 A structural schematic diagram of the adaptive threshold segmentation device for astrocyte dynamic calcium events according to Embodiment Four of the application, in the embodiment, the adaptive threshold segmentation device for astrocyte dynamic calcium events comprises:

[0140] The image preprocessing module 810 is configured to perform calcium signal enhancement and denoising preprocessing on the original calcium imaging video sequence to obtain an enhanced time sequence image sequence.

[0141] The dynamic tracking module 820 is configured to construct a time sequence mask according to the enhanced time sequence image sequence to dynamically track calcium active event signal regions that continuously appear in the time sequence mask to obtain a dynamic time sequence mask sequence.

[0142] The Gaussian mixture model module 830 is configured to fit a gray scale distribution of each single frame image into a probability density function superimposed by multiple Gaussian components based on a Gaussian mixture model, and perform segmented estimation on each Gaussian component by using an expectation maximization algorithm to extract an active calcium signal component.

[0143] The adaptive dynamic updating module 840 is configured to calculate a highlight pixel ratio and a frame-to-frame similarity index of each single frame image according to the dynamic time sequence mask sequence to respectively perform adaptive dynamic updating on a global threshold and a local threshold.

[0144] The image generation module 850 is configured to perform window function transformation on the active calcium signal component to generate a calcium signal image suitable for display.

[0145] The embodiment enhances calcium signal and denoises the original calcium imaging video sequence through an image preprocessing module, dynamically tracks the calcium active event signal region through a dynamic tracking module, fits the gray scale distribution of each single frame image into a probability density function superimposed by multiple Gaussian components to extract the active calcium signal component through a Gaussian mixture model module, calculates the highlight pixel proportion and interframe similarity index of each single frame image to respectively adaptively and dynamically update the global threshold and local threshold through an adaptive dynamic updating module, and generates calcium signal images through window function transformation of the active calcium signal component through an image generation module. In the astrocyte calcium imaging video with high noise and low signal-to-noise ratio, the noise can be effectively suppressed and the weak signal can be retained through the construction of a timing mask, the random imaging noise appearing as isolated points in space or time can be accurately filtered out, and the detection capability of weak and transient calcium events in a low signal-to-noise ratio environment can be significantly improved. Through the unsupervised fitting and segmented estimation of the gray scale distribution of each frame image through the Gaussian mixture model, the “active calcium signal peak” representing the brightest region can be adaptively identified, instead of relying on a fixed threshold, the specific brightness distribution change of each frame image can be dynamically adapted, the dynamic calcium event can be stably and accurately segmented, only a few key parameters need to be set, and the robustness is high and the automation degree is high.

[0146] The adaptive threshold segmentation device for astrocyte dynamic calcium events provided in the embodiment of the application can execute the adaptive threshold segmentation method for astrocyte dynamic calcium events provided in any embodiment of the application, has the function modules and beneficial effects corresponding to the execution method.

[0147] Embodiment five

[0148] Figure 5 A structural diagram of an electronic device according to the fifth embodiment of the application, Figure 5 A block diagram of an exemplary electronic device 12 suitable for implementing embodiments of the application is shown. Figure 5 The electronic device 12 shown is merely an example and should not impose any limitations on the functions and use range of the embodiments of the application.

[0149] As Figure 5 shown, the electronic device 12 is in the form of a general computing device. The components of the electronic device 12 can include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components, including the system memory 28 and the processing unit 16.

[0150] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration bus, a processor or local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0151] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that is accessible by electronic device 12 and includes both volatile and non-volatile media, removable and non-removable media.

[0152] System memory 28 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (e.g., a "hard drive"). Figure 5 not shown, is typically provided as residual storage across electronic device 12, and can be used for storing data that is both received as well as data that is generated by the processor 20. Although Figure 5 not shown, is typically provided as residual storage across electronic device 12, and can be used for storing data that is both received as well as data that is generated by the processor 20. Although

[0153] Program / utility 40 having a set (at least one) of program modules 42 can be stored in, for example, system memory 28 by way of example, such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination thereof, which can include implementation of the network environment. Program modules 42 generally carry out the functions and / or methodologies of embodiments of the present application as described herein.

[0154] The electronic device 12 can also be in communication with one or more external devices 14 such as a keyboard, a pointing device, a display 24, etc.; can also be in communication with one or more devices that enable a user to interact with the electronic device 12 / server / computer; and / or can be in communication with any devices (such as a network card, a modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication can be facilitated by an Input / Output (I / O) interface 22. Further, the electronic device 12 can communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or the public network, such as the Internet) through a network adapter 20. As Figure 5 illustrated, the network adapter 20 is in communication with the other modules of the electronic device 12 through the bus 18. As will be appreciated, although not explicitly illustrated, other mobile computing devices, such as laptops, handheld computers, palmtop computers, netbooks, smartphones, etc., can typically include a bus, a processor, memory, I / O ports, a network adapter, and various other modules. ​ It will be appreciated that other hardware and / or software modules can be used in conjunction with the electronic device 12, such as, for example, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

[0155] The processing unit 16 executes various functions applications and data processing by running programs stored in the system memory 28, such as implementing the adaptive threshold segmentation method of astrocyte dynamic calcium events as provided by the embodiments of the present application.

[0156] Embodiment Six

[0157] The embodiment six of the present application also provides a storage medium containing computer executable instructions, which when executed by a computer processor, are used to perform the adaptive threshold segmentation method of astrocyte dynamic calcium events as provided by the above embodiments.

[0158] The computer storage media of the embodiments of the present application can employ any combination of one or more computer readable medium or media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, the computer readable storage medium can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

[0159] A computer readable signal medium can include a propagated data signal with computer executable code embodied therein. The computer readable signal medium can be any medium that can be used to carry computer executable code for use by or in connection with an instruction execution system, apparatus, or device.

[0160] The computer readable medium can include any medium that can store or transfer information for use by or in connection with an instruction execution system, apparatus, or device.

[0161] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0162] Note that the foregoing are merely preferred embodiments and the principles of the present application. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, modifications and substitutions can be made without departing from the scope of the present application. Therefore, although the present application has been described in detail with reference to the above embodiments, the present application is not limited to the above embodiments, and can include other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. An adaptive threshold segmentation method for astrocyte dynamic calcium events, characterized in that, The method comprises the following steps: S101, obtaining an original calcium imaging video sequence, and performing calcium signal enhancement and denoising preprocessing on the original calcium imaging video sequence to obtain an enhanced time sequence image sequence; S102, constructing a time sequence mask according to the enhanced time sequence image sequence to dynamically track calcium active event signal regions that continuously appear in the enhanced time sequence image sequence, and obtaining a dynamic time sequence mask sequence; The S102 comprises: According to the enhanced time sequence image sequence, the gray mean and standard deviation of the current frame image are calculated; According to the gray mean and standard deviation of the current frame image, an instantaneous active mask is generated based on a preset initial global threshold value; According to the instantaneous active mask, a counting matrix is used to count the number of continuous frames in which each pixel is marked as active; Based on the preset initial local threshold value and the counting matrix, a dynamic time sequence mask sequence is generated using a plurality of continuous instantaneous active masks. S103, according to the dynamic time sequence mask sequence, the gray distribution of each single frame image is fitted as a probability density function superimposed by a plurality of Gaussian components based on a Gaussian mixture model, and an expectation maximization algorithm is used to segmentally estimate each Gaussian component to extract an active calcium signal component; S104, according to the dynamic time sequence mask sequence, the highlight pixel proportion of each single frame image is calculated to adaptively and dynamically update the global threshold value, and the interframe similarity index is calculated to adaptively and dynamically update the local threshold value; S105, performing window function transformation on the active calcium signal component to generate a calcium signal image suitable for display.

2. The method of claim 1, wherein, The S101 comprises: Frame accumulation processing is performed on the obtained original calcium imaging video sequence to obtain an accumulated video sequence; Background subtraction and normalization processing is performed on the accumulated video sequence to obtain a dynamic signal video sequence; Gaussian filtering processing is performed on the dynamic signal video sequence to obtain the enhanced time sequence image sequence.

3. The method of claim 1, wherein, The S103 comprises: According to the dynamic time sequence mask sequence, all pixel gray values of the single frame image are flattened into a one-dimensional vector, and parameters of a plurality of Gaussian components are randomly initialized to ensure that the weight parameters of all Gaussian components sum to 1, forming an input sample set; According to the weight parameters of the initialized Gaussian components, probability density weighted calculation is performed, and the distribution is normalized to form the expected responsibility of each Gaussian component; According to the expected responsibility, the weight parameters of each gray distribution Gaussian component are updated, and the probability density value is iteratively fitted until the log-likelihood function converges or the preset maximum iteration number is reached, to obtain the probability density distribution of each single frame image; According to the probability density distribution of each single frame image, each gray distribution Gaussian component is sorted and segmentally estimated to determine the active calcium signal peak, and the active calcium signal component is extracted in the gray interval corresponding to the active calcium signal peak.

4. The method of claim 3, wherein, The sorting and segmental estimation of each gray distribution Gaussian component to determine the active calcium signal peak comprises: According to the mean in each single frame image probability density distribution, the gray distribution Gaussian components are sorted in ascending order, and the rightmost component is identified as the active calcium signal peak.

5. The method of claim 3, wherein, The active calcium signal component is extracted in the gray interval corresponding to the active calcium signal peak, comprising: A binary mask is generated in the gray interval corresponding to the active calcium signal peak. The binary mask is subjected to connected domain analysis, and regions with an area greater than a preset minimum area threshold and a gray gradient change greater than a preset gradient threshold are reserved as active calcium signal components.

6. The method of claim 1, wherein, The S104 comprises: According to the dynamic timing mask sequence, the proportion of highlighted pixels in each single-frame image is calculated, and the global threshold is dynamically updated on the basis of a preset initial value; According to the dynamic timing mask sequence, the inter-frame Jaccard index is calculated, and the local threshold is dynamically updated on the basis of a preset initial value; According to the dynamic timing mask sequence, the average gray scale of pixels within the mask and the standard deviation of pixels outside the mask are calculated, and the ratio of the two is used as a signal-to-noise ratio to dynamically update the segmented estimation period of each Gaussian component in combination with a smoothing coefficient.

7. An apparatus for adaptive threshold segmentation of astrocytic dynamic calcium events, for implementing the method of adaptive threshold segmentation of astrocytic dynamic calcium events according to any one of claims 1 to 6, characterized in that, It comprises: An image preprocessing module is configured to perform calcium signal enhancement and denoising preprocessing on an original calcium imaging video sequence to obtain an enhanced timing image sequence; A dynamic tracking module is configured to calculate the gray mean and standard deviation of a current frame image according to the enhanced timing image sequence, and generate an instantaneous active mask based on a preset initial global threshold according to the gray mean and standard deviation of the current frame image; According to the instantaneous active mask, a counting matrix is used to count the number of consecutive frames in which each pixel is marked as active; and a dynamic timing mask sequence is generated by using a plurality of consecutive instantaneous active masks based on a preset initial local threshold and the counting matrix. A Gaussian mixture model module is configured to fit the gray scale distribution of each single-frame image into a probability density function superimposed by a plurality of Gaussian components based on a Gaussian mixture model, and perform segmented estimation of each Gaussian component by using an expectation maximization algorithm to extract active calcium signal components. An adaptive dynamic updating module is configured to calculate the proportion of highlighted pixels and the inter-frame similarity index of each single-frame image according to the dynamic timing mask sequence, so as to adaptively and dynamically update the global threshold and the local threshold, respectively. An image generation module is configured to perform window function transformation on the active calcium signal components to generate calcium signal images suitable for display.

8. An electronic device, comprising: The electronic device comprises: One or more processors; A storage device configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the adaptive threshold segmentation method for dynamic calcium events of astrocytes as claimed in any one of claims 1-6.

9. A storage medium containing computer executable instructions for performing the adaptive threshold segmentation method for dynamic calcium events of astrocytes as claimed in any one of claims 1-6 when executed by a computer processor.

Citation Information

Patent Citations

  • Automatic cell body identification and segmentation method and device based on two-photon calcium imaging data

    CN116681685A

  • Calcium imaging neural signal extraction method based on self-supervised pre-training and product

    CN120216960A