Fluorescence image segmentation method, system and storage medium for mitochondria
Through frequency band decomposition and deep learning technology, the mitochondrial fluorescence image is filtered and contour adjusted, which solves the problem of poor mitochondrial segmentation with unclear boundaries in the existing technology and achieves more accurate mitochondrial segmentation and identification.
Patent Information
- Application Number
- CN202411075365.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-08-07
AI Technical Summary
Existing mitochondrial fluorescence image segmentation technology does not perform well on mitochondria with unclear boundaries or weak fluorescence, making it difficult to provide highly accurate segmentation results.
Obtain high-frequency images through frequency band decomposition, generate standard images and perform filtering processing. Use gradient information to generate initial contours, compare them with the standard contours in the database to obtain the contour with the smallest deviation value, and combine deep learning technology to perform loss values at the fluorescent point positions. Calculated to adjust contours for more precise segmentation.
It enhances the clarity and recognition of mitochondrial contours, obtains a more complete and accurate mitochondrial contour, and achieves more precise segmentation and identification effects.
Smart Images

Figure CN118608546B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image processing, and in particular relates to a method, system and storage medium for segmenting mitochondrial fluorescence images. Background Art
[0002] As important organelles in cells, mitochondria play a vital role in key physiological processes such as cell energy metabolism, cell death and cell signal transduction. With the deepening of biomedical research, the demand for quantitative analysis of mitochondrial morphology and quantity is increasing.
[0003] Existing segmentation technologies such as threshold-based segmentation, for example, Chinese patent application with publication number CN117934516A proposes a method and system for automatic segmentation of mitochondrial fluorescence images, including: obtaining a mitochondrial fluorescence image; constructing a local area for each pixel; obtaining the local aggregation degree of each pixel according to the number and grayscale value of the pixels in the local area of each pixel; obtaining a neighborhood area for the local area of each pixel; obtaining an adjustment coefficient of the local aggregation degree of each pixel according to the grayscale value of the local area and the neighborhood area of each pixel, and the distribution of each pixel and the pixels in the neighborhood area; obtaining the comprehensive density of each pixel according to the local aggregation degree of each pixel and the adjustment coefficient of the local aggregation degree, and performing local threshold segmentation on the mitochondrial fluorescence image.
[0004] However, the above-mentioned prior art segments mitochondria by combining local feature analysis and clustering technology, but the segmentation effect may be poor for mitochondria with unclear boundaries or weak fluorescence. Therefore, a new mitochondrial fluorescence image segmentation method is needed, which can provide highly accurate segmentation results. Summary of the invention
[0005] To solve the above problems, the present invention provides a method, system and storage medium for mitochondrial fluorescence image segmentation to solve the problems in the prior art.
[0006] In order to achieve the above-mentioned object of the invention, the present invention proposes a method for segmenting a fluorescent image of mitochondria, comprising:
[0007] S1: acquiring a fluorescence image of mitochondria, decomposing the fluorescence image into a low-frequency image and a high-frequency image, and defining pixels in the low-frequency image and the high-frequency image as first pixels and second pixels, respectively;
[0008] S2: Processing the high-frequency image to generate a first grayscale image, numbering the second pixels in the first grayscale image using a preset rule, wherein a maximum value of the numbering is a first value, generating a first region of interest of a preset size with each second pixel as the center, determining a first coefficient within the first region of interest, and filtering the high-frequency image based on the first coefficient to generate a standard image of the mitochondria;
[0009] S3: Obtaining gradient information of the standard image, generating an initial contour of the mitochondria based on the gradient information, comparing the initial contour with a plurality of standard contours in the first database, obtaining the standard contour with the smallest deviation value as the first contour of the mitochondria, setting a plurality of fluorescent points on the first contour, generating a second region of interest around each of the fluorescent points, defining pixel points within the second region of interest as candidate points, and calculating a loss value of each of the candidate points;
[0010] S4: Generate a second contour based on the candidate point with the smallest loss value, and segment the mitochondria based on the second contour.
[0011] Further, determining a first coefficient in the first region of interest comprises the following steps:
[0012] Define two adjacent pixels in the first focus area in the horizontal direction as neighbor pixel pairs, count the first occurrence number of each neighbor pixel pair in the first focus area, establish a first matrix, the first matrix is a square matrix whose row vector is the first value, fill the first number of times into the first matrix, the position of the first number of times in the first matrix is M and N, M and N are the numbers of the second pixels corresponding to the left and right sides of the neighbor pixel pairs, respectively, normalize the first matrix to obtain a second matrix, and calculate the first eigenvalue of the second pixel in the first focus area based on the first formula , the first formula is: , wherein n is the first value, is the element value of the i-th row and j-th column in the second matrix;
[0013] Calculate the first coefficient of each pixel in the first area of interest based on the second formula , the second formula is: ,in, The coordinates are the pixel value of the second pixel, The coordinates of the pixels outside the first focus area except the second pixel are The pixel values of other pixels, , , , is the preset constant, The first pixel has coordinates The pixel value at is the first eigenvalue.
[0014] Further, generating the initial outline of the mitochondria based on the gradient information comprises the following steps:
[0015] The gradient information is the gradient change value of the pixel point in the standard image, and the gradient change value is calculated based on the third formula , the third formula is: ,in, The position coordinates are The pixel value of the pixel point, is the pixel value of the adjacent pixel to the right of the pixel point, is the pixel value of the adjacent pixel below the pixel point. If the gradient change value is greater than the first threshold, the corresponding pixel point is defined as the first pixel point, otherwise it is defined as the second pixel point, and the outline formed by the first pixel point is defined as the initial outline of the mitochondria.
[0016] Further, obtaining the standard contour with the minimum deviation value as the first contour of the mitochondria comprises the following steps:
[0017] A plurality of continuous first pixel points on the initial contour are obtained to form a pixel set, and the correlation values of all the first pixel points in the pixel set are calculated. If the absolute value of the correlation value is greater than a second threshold, the first pixel points in the pixel set are fitted with a straight line to form a straight line. Otherwise, the first pixel points located at the endpoints in the pixel set are removed, and the correlation value of the pixel set is updated. When the number of the first pixel points in the pixel set is less than a third threshold, and the correlation value is still less than or equal to the second threshold, the first pixel points in the pixel set are fitted with a curve to form a curve. A combination of a straight line and a curve formed by fitting all the first pixel points on the initial contour is defined as a first combination of the initial contour. The standard contour in the first database and the second combination corresponding to the standard contour are obtained, and a deviation value between the first combination and each of the second combinations is calculated. The deviation value is the sum of the absolute value of the difference in the number of straight lines and the absolute value of the difference in the number of curves in the first combination and the second combination. If the deviation value is less than or equal to a fourth threshold, the standard contour corresponding to the second combination is defined as the first contour of the mitochondria.
[0018] Further, calculating the loss value of each candidate point includes the following steps:
[0019] The loss value of each candidate point is calculated based on the fourth formula , the fourth formula is: ,in, and are respectively the line value and edge value of the first contour obtained based on the dynamic contour method, is the preset line weight coefficient, is the edge weight coefficient, which is calculated based on the fifth formula , the fifth formula is: ,in, and is the preset constant, is the average value of all pixels in the first contour, is the first standard deviation of the pixels within the first contour, and the first standard deviation is calculated based on the sixth formula , the sixth formula is: ,in, is the set of pixels within the first contour, is the number of pixels within the first contour, is the pixel value of the kth pixel in the first contour.
[0020] Further, generating the second contour comprises the following steps:
[0021] In the second area of interest, the candidate point with the smallest loss value is selected as the optimal candidate point of the fluorescence point, and the distance between the optimal candidate point and the fluorescence point is obtained. If the distance is less than a fifth threshold, it is determined that the first contour at the fluorescence point has converged, otherwise the fluorescence point is adjusted to the position of the optimal candidate point, and the positions of the optimal candidate points of all the fluorescence points are connected to form a second contour.
[0022] Furthermore, generating the standard image of the mitochondria comprises the following steps:
[0023] A second eigenvalue of the high-frequency image is calculated based on the first coefficient, where the second eigenvalue is the sum of the first coefficients of all the second pixels in the high-frequency image, a third pixel value is obtained by dividing the pixel value of each second pixel by the second eigenvalue, and an image composed of pixels composed of the third pixel values is defined as the standard image.
[0024] The present invention also provides a fluorescent image segmentation system for mitochondria, which is used to implement the above-mentioned method. The system mainly comprises:
[0025] An acquisition module, used for acquiring a fluorescent image of mitochondria, decomposing the fluorescent image into a low-frequency image and a high-frequency image, and defining pixels in the low-frequency image and the high-frequency image as first pixels and second pixels, respectively;
[0026] a generating module, configured to process the high-frequency image to generate a first grayscale image, number the second pixels in the first grayscale image using a preset rule, wherein a maximum value of the numbering is a first value, generate a first region of interest of a preset size with each second pixel as the center, determine a first coefficient within the first region of interest, and perform filtering processing on the high-frequency image based on the first coefficient to generate a standard image of the mitochondria;
[0027] a comparison module, used for acquiring gradient information of the standard image, generating an initial contour of the mitochondria based on the gradient information, comparing the initial contour with a plurality of standard contours in a first database, acquiring the standard contour with the smallest deviation value as the first contour of the mitochondria, setting a plurality of fluorescent points on the first contour, generating a second region of interest around each of the fluorescent points, defining pixel points within the second region of interest as candidate points, and calculating a loss value of each of the candidate points;
[0028] A segmentation module is used to generate a second contour based on the candidate point with the smallest loss value, and segment the mitochondria based on the second contour.
[0029] The present invention also provides a computer storage medium, which stores program instructions, wherein when the program instructions are executed, the device where the computer storage medium is located is controlled to execute the above-mentioned method.
[0030] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0031] This solution obtains a high-frequency image containing contour boundaries as a standard image for segmenting mitochondria by performing frequency band decomposition and optimized filtering on the fluorescence image, thereby enhancing the contour features of the mitochondria to make them clearer and easier to identify. Secondly, the initial contour of the mitochondria is generated by obtaining the gradient information in the standard image. When the initial contour is not very continuous or overlaps with other contours, the standard contour with the smallest deviation value from the initial contour is selected from the first database, and the standard contour is defined as the first contour. The known standard contour is used to assist in identification and segmentation, thereby obtaining a more complete mitochondrial contour. Although the first contour is already a relatively accurate contour line after optimizing the fluorescence image, the present invention also uses deep learning technology to extract fluorescent points on the first contour, calculates the loss values of multiple candidate points of the fluorescent points in the second area of interest, and adjusts the position of the fluorescent points by obtaining the candidate point with the smallest loss value, thereby obtaining a second contour that is closer to the actual position of the mitochondrial edge in the image, thereby achieving more accurate segmentation and identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flow chart of the steps of the fluorescent image segmentation method for mitochondria of the present invention;
[0033] Figure 2 A schematic diagram of generating a first region of interest in the present invention;
[0034] Figure 3 A schematic diagram of generating a first matrix in the present invention;
[0035] Figure 4 It is a structural diagram of the fluorescent image segmentation system for mitochondria of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0037] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0038] like Figure 1 As shown, a fluorescent image segmentation method for mitochondria comprises:
[0039] S1: Acquire a fluorescence image of mitochondria, decompose the fluorescence image into a low-frequency image and a high-frequency image, and define pixels in the low-frequency image and the high-frequency image as first pixels and second pixels, respectively.
[0040] Specifically, the fluorescence image is a high-resolution image captured by a fluorescence microscope after staining with a specific fluorescent dye. A predetermined smoothing filter, such as a Gaussian filter, is used to smooth the fluorescence image, and the low-frequency component of the fluorescence image is extracted as a low-frequency image. The low-frequency image is removed from the fluorescence image to obtain a high-frequency image. The low-frequency image contains details inside the mitochondria, and the high-frequency image contains lines and halo effects on the edges of the mitochondria, but may also contain details inside the mitochondria. Therefore, in order to further perform segmentation, the present invention further proposes the following steps.
[0041] S2: Process the high-frequency image to generate a first grayscale image, use a preset rule to number the second pixels in the first grayscale image, the maximum value of the number is a first value, generate a first region of interest of a preset size with each second pixel as the center, determine a first coefficient within the first region of interest, filter the high-frequency image based on the first coefficient, and generate a standard image of mitochondria.
[0042] Specifically, the high-frequency image is a color image, and the high-frequency image is converted into a first grayscale image. The first grayscale image is an image containing 0-255 grayscale levels. In order to reduce the computational complexity, the first grayscale image is simplified and numbered. The numbering starts from 0 and is numbered from 0 to 4. The maximum value of the number, i.e., 4, is used as the first value. The specific rule is: pixels with grayscale values between 0 and 50 are numbered 0, and pixels with grayscale values between 51 and 101 are numbered 1, and the same applies to the remaining numbers.
[0043] The first area of interest is a square pixel area, assuming it is a 7*7 pixel area, such as Figure 2 As shown, it is a schematic diagram of the first region of interest, which is the region of interest of the second pixel numbered "1" (shaded part), the first eigenvalue of each second pixel is determined based on the distribution of pixels in the first region of interest, the first coefficient is determined based on the first eigenvalue and the first pixel in the low-frequency image, the first coefficient is the filter coefficient of the high-frequency image, the high-frequency image is filtered based on the first coefficient, the pixel value of the low-frequency image is used as a reference, the noise in the high-frequency image and the unnecessary high-frequency components in the internal microstructure are suppressed, the high-frequency components of the contour details are retained, and the remaining high-frequency image constitutes the standard image of the mitochondria.
[0044] S3: Obtain the gradient information of the standard image, generate the initial contour of the mitochondria based on the gradient information, compare the initial contour with multiple standard contours in the first database, obtain the standard contour with the smallest deviation value as the first contour of the mitochondria, set multiple fluorescent points on the first contour, generate a second region of interest around each fluorescent point, define the pixel points in the second region of interest as candidate points, and calculate the loss value of each candidate point.
[0045] Specifically, gradient information refers to the gradient change value of each pixel in the standard image. The gradient change value can be used to identify pixels with significant brightness changes in the image. The area formed by these pixels usually corresponds to the edges of mitochondria. The initial contour is generated by tracing these edges. When the initial contour is not very continuous or overlaps with other contours, the standard contour with the smallest deviation from the initial contour is selected from the first database, and this contour is defined as the first contour. The first contour is the standard contour that is closest to the initial contour. In this way, when the initial contour is imperfect, the known standard contour can be used for auxiliary identification and segmentation, thereby obtaining a more complete mitochondrial contour.
[0046] Based on the convolutional neural network, potential feature points are automatically determined as fluorescent points. By moving these fluorescent points to adjust the shape of the contour, the contour segmentation of the mitochondria is more accurate. The more fluorescent points are set, the finer the contour adjustment will be, but at the same time the amount of calculation will increase. When the fluorescence is set less, the amount of calculation will decrease, and the contour adjustment may not be fine enough, resulting in a weakened tracking effect. Therefore, it is necessary to regularly sample and compare the fluorescent points on the first contour to obtain the optimal number of fluorescent points and make adjustments according to the morphological changes of the mitochondria.
[0047] The size of the second region of interest is set based on the size of the mitochondria and the distance between the fluorescent spots. It is generally set to a smaller area to ensure the accuracy of the boundary. It can be a circular area or a square area. By calculating the loss values of multiple candidate points in the second region of interest, the candidate point with the smallest loss value is found as the optimal candidate point, and the position of the fluorescent spot is moved to the position of the optimal candidate point, so that the contour line fits the edge of the mitochondria as much as possible, and a more accurate segmentation effect is obtained.
[0048] S4: Generate a second contour based on the candidate point with the smallest loss value, and segment the mitochondria based on the second contour.
[0049] Specifically, the second contour is a more accurate contour representation obtained after minimizing the loss value. According to the generated second contour of the mitochondria, the mitochondria are clearly distinguished from the background and other cells or overlapping parts.
[0050] This solution obtains a high-frequency image containing contour boundaries as a standard image for segmenting mitochondria by performing frequency band decomposition and optimized filtering on the fluorescence image, thereby enhancing the contour features of the mitochondria to make them clearer and easier to identify. Secondly, the initial contour of the mitochondria is generated by obtaining the gradient information in the standard image. When the initial contour is not very continuous or overlaps with other contours, the standard contour with the smallest deviation value from the initial contour is selected from the first database, and the standard contour is defined as the first contour. The known standard contour is used to assist in identification and segmentation, thereby obtaining a more complete mitochondrial contour. Although the first contour is already a relatively accurate contour line after optimizing the fluorescence image, the present invention also uses deep learning technology to extract fluorescent points on the first contour, calculates the loss values of multiple candidate points of the fluorescent points in the second area of interest, and adjusts the position of the fluorescent points by obtaining the candidate point with the smallest loss value, thereby obtaining a second contour that is closer to the actual position of the mitochondrial edge in the image, thereby achieving more accurate segmentation and identification.
[0051] As a preferred technical solution of the present invention, determining the first coefficient in the first region of interest includes the following steps:
[0052] The pixels adjacent to each other at two positions in the horizontal direction of the first focus area are defined as neighbor pixel pairs, and the first occurrence number of each neighbor pixel pair in the first focus area is counted to establish a first matrix, which is a square matrix whose row vector is a first value. The first occurrence number is filled into the first matrix, and the position of the first occurrence number in the first matrix is M and N, where M and N are the numbers of the second pixels corresponding to the left and right sides of the neighbor pixel pairs, respectively. The first matrix is normalized to obtain the second matrix, and the first eigenvalue of the second pixel in the first focus area is calculated based on the first formula. , the first formula is: , where n is the first value, is the element value in the i-th row and j-th column of the second matrix.
[0053] Calculate the first coefficient of each pixel in the first area of interest based on the second formula , the second formula is: ,in, The coordinates are The pixel value of the second pixel, The coordinates of the pixels outside the first area of interest are The pixel values of other pixels, , , , is the preset constant, is the first pixel at coordinates The pixel value at is the first eigenvalue.
[0054] Specifically, Figure 2 As shown in , neighbor pixel pairs such as (0, 4), (4, 3), (3, 1), etc., have first order numbers of 1, 1, 3, etc. Figure 3 As shown, it is the first matrix diagram. The first matrix is a 5-order matrix. The position of the neighbor pixel pair (0, 4) in the first matrix is M=0, N=4, that is, the element (1) located at the 0th row and the 4th column in the first matrix indicates that the first occurrence of the neighbor pixel pair (0, 4) in the first focus area is 1. Similarly, according to this method, the first matrix is constructed and the second matrix is obtained after normalizing the first matrix. For example, the element values in the matrix are multiplied by 0.1, and the first eigenvalue of the second pixel in the first focus area, that is, "1", is calculated. , ,Will Substitute into the second formula to calculate the first coefficient of each pixel in the first area of interest For example, the pixel with a calculated pixel value of 2 is defined as pixel Q here. Pixel Q is located one pixel unit to the left of the second pixel 1 in the first focus area. Then a=0, b=-1, and each pixel in the first focus area will obtain a first coefficient.
[0055] The first coefficient is set based on the first eigenvalue and the pixel value of the low-frequency image, reflecting the local characteristics of the high-frequency image, such as the complexity, randomness, uniformity and contrast with the background of the pixels in the first region of interest. When the first eigenvalue is large, it means that the first region of interest may contain more details or edge information. In this case, it is necessary to retain these high-frequency information. When the pixel value in the low-frequency image is small, it means that the pixels in the image are located in relatively smooth areas. These areas may correspond to the internal microstructure of the cell. These high-frequency information may be discarded. By adjusting , , to set different weights for the first eigenvalue and the pixel value of the low-frequency image, for example Set larger to increase the weight of the first eigenvalue, The value is set smaller to reduce the weight of the first pixel in the low-frequency image, so that the first coefficient obtained can suppress unnecessary high-frequency components, retain the high-frequency components of contour details, and achieve the best filtering effect.
[0056] Generating the initial outline of mitochondria based on the gradient information includes the following steps:
[0057] The gradient information is the gradient change value of the pixel in the standard image, and the gradient change value is calculated based on the third formula , the third formula is: ,in, The position coordinates are The pixel value of the pixel point, is the pixel value of the adjacent pixel to the right of the pixel point, is the pixel value of the adjacent pixel below the pixel point. If the gradient change value is greater than the first threshold, the corresponding pixel point is defined as the first pixel point, otherwise it is defined as the second pixel point, and the outline formed by the first pixel point is defined as the initial outline of the mitochondria.
[0058] Specifically, the position coordinates of all pixels in the standard image and the corresponding pixel values are obtained, and the gradient change value of each pixel in the standard image is calculated based on the third formula: The gradient change value reflects the brightness change of the image position where the pixel is located. If the gradient change value is greater than the first threshold, it means that the pixel is an edge pixel, that is, the first pixel. The first threshold can be set with reference to the pixel value of the previous mitochondrial edge pixel. The contour formed by the first pixel is defined as the initial contour of the mitochondria. When the initial contour may be discontinuous or overlap with other contours, the initial contour needs to be further processed to obtain more accurate contour information.
[0059] Acquiring the standard contour with the smallest deviation value as the first contour of the mitochondria includes the following steps:
[0060] A plurality of continuous first pixel points on the initial contour are obtained to form a pixel set, and the correlation values of all the first pixel points in the pixel set are calculated. If the absolute value of the correlation value is greater than a second threshold value, the first pixel points in the pixel set are fitted to form a straight line, otherwise the first pixel points located at the endpoints in the pixel set are removed, and the correlation value of the pixel set is updated. When the number of first pixel points in the pixel set is less than a third threshold value, and the correlation value is still less than or equal to the second threshold value, curve fitting is performed on the first pixel points in the pixel set to form a curve, and a combination of a straight line and a curve formed by fitting all the first pixel points on the initial contour is defined as a first combination of the initial contour, a standard contour in a first database and a second combination corresponding to the standard contour are obtained, and a deviation value between the first combination and each second combination is calculated, and the deviation value is the sum of the absolute value of the difference in the number of straight lines and the absolute value of the difference in the number of curves in the first combination and the second combination. If the deviation value is less than or equal to a fourth threshold value, the standard contour corresponding to the second combination is defined as the first contour of the mitochondria.
[0061] Specifically, the initial contour is an irregular mitochondrial contour, which may be composed of multiple curves and straight lines. Assuming that 10 consecutive first pixel points are a pixel set, the Pearson correlation coefficient formula is used to calculate the degree of change of the Y coordinate of each first pixel point in the pixel set with the X coordinate. The range of the absolute value of the correlation value is greater than or equal to 0 and less than or equal to 1. If the correlation value is greater than 0.6, it means that the degree of change of the Y coordinate of any first pixel point in the pixel set with the X coordinate relative to other pixel points is similar, and all first pixel points are close to being on the same straight line. Then, the first pixel points in the pixel set are straight-line fitted to form a straight line. If the correlation value is greater than 0 and less than or equal to 0.6, the first pixel points located at the endpoints of the pixel set are removed, leaving 9 pixel points, and the correlation values of the 9 pixel points are recalculated. When the number of first pixel points in the pixel set is less than 4, the first pixel points located in the pixel set are removed so that the number of pixel points in the pixel set is 3. If the correlation value is still less than or equal to 0.6, it means that the first pixel points in the pixel set are in a relatively scattered position, and it is necessary to perform curve fitting on the first pixel points in the pixel set to form a curve.
[0062] The straight lines and curves are formed into a first combination according to the positions of the corresponding first pixel points, and compared with the second combination of the standard contour in the first database. The standard contour refers to the complete and continuous contour of the mitochondria in various states. The second combination is a combination of curves and straight lines about the standard contour obtained according to the above method. The smaller the deviation value between the first combination and the second combination is, for example, the number of straight lines in the first combination is 10 and the number of curves is 20, and the number of straight lines in the second combination is 11 and the number of curves is 19, then the deviation value is equal to , set the fourth threshold to 0, and when the deviation value is less than or equal to 0, the standard contour corresponding to it is defined as the first contour of the mitochondria.
[0063] Calculating the loss value for each candidate point includes the following steps:
[0064] Calculate the loss value of each candidate point based on the fourth formula , the fourth formula is: ,in, and are the line value and edge value of the first contour obtained based on the dynamic contour method, is the preset line weight coefficient, is the edge weight coefficient, which is calculated based on the fifth formula , the fifth formula is: ,in, and is the preset constant, is the average value of all pixels in the first contour, is the first standard deviation of the pixels within the first contour, and the first standard deviation is calculated based on the sixth formula , the sixth formula is: ,in, is the set of pixels within the first contour, is the number of pixels within the first contour, is the pixel value of the kth pixel in the first contour.
[0065] Specifically, the loss value reflects the degree of match between the location of the candidate point and the edge contour of the mitochondria in the image. The smaller the loss value, the higher the alignment between the candidate point contour and the edge, that is, the closer the contour line is to the actual edge in the image. The loss value is determined by the line value and the edge value and their different weights. The line value and the edge value are calculated based on the dynamic contour method. is the preset line weight coefficient, That is, the edge weight coefficient represents the sensitivity to the edge of the image. The loss value becomes more sensitive to the edge as the edge weight coefficient increases. The edge weight coefficient is obtained by calculating the average brightness and brightness standard deviation of the pixels in the first contour. An accurate edge weight coefficient helps to divide the image area more accurately, thereby improving the quality of the segmentation result.
[0066] Generating the second contour comprises the following steps:
[0067] In the second area of interest, a candidate point with the smallest loss value is selected as the optimal candidate point of the fluorescence point, and the distance between the optimal candidate point and the fluorescence point is obtained. If the distance is less than the fifth threshold, it is determined that the first contour at the fluorescence point has converged, otherwise the fluorescence point is adjusted to the position of the optimal candidate point, and the positions of the optimal candidate points of all fluorescence points are connected to form a second contour.
[0068] Specifically, the loss value in the present invention corresponds to the external edge energy in the dynamic contour method. The dynamic contour method is based on the principle of energy minimization. Its goal is to find a contour line that minimizes the global energy related to the image features. When the loss value is the smallest, the external edge energy is also the smallest, so that the energy at the location of the candidate point is also the smallest, thereby accelerating the speed of contour convergence. The present invention sets a second area of interest, calculates the loss values of all candidate points, continuously searches for candidate points with the smallest loss value and updates the position of the contour. The final second contour is a contour optimized through a series of iterative steps. It reflects the true boundary of the mitochondria in the image, is smoother than the first contour, and can make adaptive adjustments following the changes in the mitochondrial morphology, thereby improving the accuracy of segmentation.
[0069] Generating a standard image of mitochondria involves the following steps:
[0070] The second eigenvalue of the high-frequency image is calculated based on the first coefficient, the second eigenvalue is the sum of the first coefficients of all second pixels in the high-frequency image, the pixel value of each second pixel is divided by the second eigenvalue to obtain a third pixel value, and an image composed of pixels consisting of the third pixel value is defined as a standard image.
[0071] Specifically, the image is normalized by dividing by the sum of the first coefficients of all the second pixels in the first area of interest, i.e., the second eigenvalue, so that the average brightness of the image no longer changes, and the final standard image is obtained for output. This filtering process helps to suppress the high-frequency components of the internal details of the mitochondria while retaining the high-frequency components based on the contour lines.
[0072] like Figure 4 As shown, the present invention also provides a fluorescent image segmentation system for mitochondria, which is used to implement the above method. The system mainly includes:
[0073] The acquisition module is used to acquire the fluorescence image of mitochondria, decompose the fluorescence image into a low-frequency image and a high-frequency image, and define pixels in the low-frequency image and the high-frequency image as first pixels and second pixels respectively.
[0074] A generation module is used to process the high-frequency image to generate a first grayscale image, use a preset rule to number the second pixels in the first grayscale image, the maximum value of the number is a first value, generate a first region of interest of a preset size with each second pixel as the center, determine a first coefficient within the first region of interest, filter the high-frequency image based on the first coefficient, and generate a standard image of mitochondria.
[0075] A comparison module is used to obtain gradient information of a standard image, generate an initial contour of mitochondria based on the gradient information, compare the initial contour with a plurality of standard contours in a first database, obtain the standard contour with the smallest deviation value as the first contour of mitochondria, set a plurality of fluorescent points on the first contour, generate a second region of interest around each fluorescent point, define the pixel points in the second region of interest as candidate points, and calculate the loss value of each candidate point.
[0076] The segmentation module is used to generate a second contour based on the candidate point with the smallest loss value, and segment the mitochondria based on the second contour.
[0077] The present invention also provides a computer storage medium, which stores program instructions. When the program instructions are executed, the device where the computer storage medium is located is controlled to execute the above method.
[0078] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0079] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0080] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0081] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0082] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for segmenting mitochondrial fluorescence images, characterized in that: The method comprises the following steps: S1: acquiring a fluorescence image of mitochondria, decomposing the fluorescence image into a low-frequency image and a high-frequency image, and defining pixels in the low-frequency image and the high-frequency image as first pixels and second pixels, respectively; S2: Processing the high-frequency image to generate a first grayscale image, numbering the second pixels in the first grayscale image using a preset rule, wherein a maximum value of the numbering is a first value, generating a first region of interest of a preset size with each second pixel as the center, determining a first coefficient within the first region of interest, and filtering the high-frequency image based on the first coefficient to generate a standard image of the mitochondria; S3: Obtaining gradient information of the standard image, generating an initial contour of the mitochondria based on the gradient information, comparing the initial contour with a plurality of standard contours in the first database, obtaining the standard contour with the smallest deviation value as the first contour of the mitochondria, setting a plurality of fluorescent points on the first contour, generating a second region of interest around each of the fluorescent points, defining pixel points within the second region of interest as candidate points, and calculating a loss value of each of the candidate points; S4: Generate a second contour based on the candidate point with the smallest loss value, and segment the mitochondria based on the second contour.
2. The method according to claim 1, characterized in that Determining a first coefficient within the first region of interest comprises the following steps: Define two adjacent pixels in the first focus area in the horizontal direction as neighbor pixel pairs, count the first occurrence number of each neighbor pixel pair in the first focus area, establish a first matrix, the first matrix is a square matrix whose row vector is the first value, fill the first number of times into the first matrix, the position of the first number of times in the first matrix is M and N, M and N are the numbers of the second pixels corresponding to the left and right sides of the neighbor pixel pairs, respectively, normalize the first matrix to obtain a second matrix, and calculate the first eigenvalue of the second pixel in the first focus area based on the first formula , the first formula is: , wherein n is the first value, is the element value of the i-th row and j-th column in the second matrix; Calculate the first coefficient of each pixel in the first area of interest based on the second formula , the second formula is: ,in, The coordinates are the pixel value of the second pixel, The coordinates of the pixels outside the first focus area except the second pixel are wherein a is the difference between the horizontal coordinate position of the other pixels in the first region of interest and the second pixel, and b is the difference between the vertical coordinate position of the other pixels in the first region of interest and the second pixel, , , , is the preset constant, The first pixel has coordinates The pixel value at is the first eigenvalue.
3. The method according to claim 1, characterized in that Generating the initial outline of the mitochondria based on the gradient information comprises the following steps: The gradient information is the gradient change value of the pixel point in the standard image, and the gradient change value is calculated based on the third formula , the third formula is: ,in, The position coordinates are The pixel value of the pixel point, is the pixel value of the adjacent pixel to the right of the pixel point, is the pixel value of the adjacent pixel below the pixel point. If the gradient change value is greater than the first threshold, the corresponding pixel point is defined as the first pixel point, otherwise it is defined as the second pixel point, and the outline formed by the first pixel point is defined as the initial outline of the mitochondria.
4. The method according to claim 3, characterized in that Acquiring the standard contour with the minimum deviation value as the first contour of the mitochondria comprises the following steps: A plurality of continuous first pixel points on the initial contour are obtained to form a pixel set, and the correlation values of all the first pixel points in the pixel set are calculated. If the absolute value of the correlation value is greater than a second threshold, the first pixel points in the pixel set are fitted with a straight line to form a straight line. Otherwise, the first pixel points located at the endpoints in the pixel set are removed, and the correlation value of the pixel set is updated. When the number of the first pixel points in the pixel set is less than a third threshold, and the correlation value is still less than or equal to the second threshold, the first pixel points in the pixel set are fitted with a curve to form a curve. A combination of a straight line and a curve formed by fitting all the first pixel points on the initial contour is defined as a first combination of the initial contour. The standard contour in the first database and the second combination corresponding to the standard contour are obtained, and a deviation value between the first combination and each of the second combinations is calculated. The deviation value is the sum of the absolute value of the difference in the number of straight lines and the absolute value of the difference in the number of curves in the first combination and the second combination. If the deviation value is less than or equal to a fourth threshold, the standard contour corresponding to the second combination is defined as the first contour of the mitochondria.
5. The method according to claim 4, characterized in that Calculating the loss value of each candidate point includes the following steps: The loss value of each candidate point is calculated based on the fourth formula , the fourth formula is: ,in, and are respectively the line value and edge value of the first contour obtained based on the dynamic contour method, is the preset line weight coefficient, is the edge weight coefficient, which is calculated based on the fifth formula , the fifth formula is: ,in, and is the preset constant, is the average value of all pixels in the first contour, is the first standard deviation of the pixels within the first contour, and the first standard deviation is calculated based on the sixth formula , the sixth formula is: ,in, is the set of pixels within the first contour, is the number of pixels within the first contour, is the pixel value of the kth pixel in the first contour.
6. The method according to claim 5, characterized in that Generating the second contour comprises the following steps: In the second area of interest, the candidate point with the smallest loss value is selected as the optimal candidate point of the fluorescence point, and the distance between the optimal candidate point and the fluorescence point is obtained. If the distance is less than a fifth threshold, it is determined that the first contour at the fluorescence point has converged, otherwise the fluorescence point is adjusted to the position of the optimal candidate point, and the positions of the optimal candidate points of all the fluorescence points are connected to form a second contour.
7. The method according to claim 2, characterized in that Generating the standard image of the mitochondria comprises the following steps: A second eigenvalue of the high-frequency image is calculated based on the first coefficient, where the second eigenvalue is the sum of the first coefficients of all the second pixels in the high-frequency image, a third pixel value is obtained by dividing the pixel value of each second pixel by the second eigenvalue, and an image composed of pixels composed of the third pixel values is defined as the standard image.
8. A mitochondrial fluorescence image segmentation system, used to implement the method according to any one of claims 1 to 7, characterized in that: The system includes the following modules: An acquisition module, used for acquiring a fluorescent image of mitochondria, decomposing the fluorescent image into a low-frequency image and a high-frequency image, and defining pixels in the low-frequency image and the high-frequency image as first pixels and second pixels, respectively; a generating module, configured to process the high-frequency image to generate a first grayscale image, number the second pixels in the first grayscale image using a preset rule, wherein a maximum value of the numbering is a first value, generate a first region of interest of a preset size with each second pixel as the center, determine a first coefficient within the first region of interest, and perform filtering processing on the high-frequency image based on the first coefficient to generate a standard image of the mitochondria; a comparison module, used for acquiring gradient information of the standard image, generating an initial contour of the mitochondria based on the gradient information, comparing the initial contour with a plurality of standard contours in a first database, acquiring the standard contour with the smallest deviation value as the first contour of the mitochondria, setting a plurality of fluorescent points on the first contour, generating a second region of interest around each of the fluorescent points, defining pixel points within the second region of interest as candidate points, and calculating a loss value of each of the candidate points; A segmentation module is used to generate a second contour based on the candidate point with the smallest loss value, and segment the mitochondria based on the second contour.
9. A computer storage medium, characterized in that The computer storage medium stores program instructions, wherein when the program instructions are executed, the device where the computer storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Mitochondrial fluorescence image automatic segmentation method and system
CN117934516A
Complicated background bar code image automatic partitioning method based on gradient direction consistency
CN104636706A
Linear contour detection method and device, medium and equipment
CN117495886A
Method for detecting orientation of contours
US20110164831A1
