MULTI-THRESHOLD SEGMENTATION METHOD FOR MEDICAL IMAGES BASED ON IMPROVED SALP SWARM ALGORITHM

20230023963 · 2023-01-26

Assignee

Inventors

Cpc classification

International classification

Abstract

The invention discloses a multi-threshold segmentation method for medical images based on an improved salp swarm algorithm. A two-dimensional histogram is established by means of a grayscale image of a medical image and a non-local mean image, then a salp swarm algorithm is used to determine thresholds selected by a Kapur entropy-based threshold method, and the salp swarm algorithm is improved and mutated by an individual-linked mutation strategy during the threshold selection process to avoid local optimization, so that the segmentation effect on the medical image is optimized; and the method has the advantages of good robustness and high accuracy.

Claims

1. A multi-threshold segmentation method for medical images based on an improved salp swarm algorithm, comprises the following steps: S1: marking a to-be-segmented medical image as I, marking the size of the to-be-segmented medical image as m×n, marking a pixel in the i.sup.th row and j.sup.th column of the medical image I as (i,j), marking a grayscale of the pixel (i,j) in the medical image I as a.sub.i,j, and setting the number of thresholds for segmenting the medical image as L=20, wherein i=1, 2, . . . , m, and j=1, 2, . . . , n; S2: performing non-local mean filtering on the medical image I to obtain a non-local mean image with the size of m×n, marking a pixel in the i.sup.th row and j.sup.th column of the non-local mean image as (i.sub.n,j.sub.n), and marking a grayscale of the pixel (i.sub.n,j.sub.n) in the non-local mean image as b wherein i.sub.n−1, 2, . . . , m, and j.sub.n=1, 2, . . . , n; wherein the pixel in the i.sup.th row and j.sup.th column of the medical image I corresponds to the pixel in the i.sup.th row and j.sup.th column of the non-local mean image, and the two pixels constitute a pixel pair; the medical image I corresponds to the non-local mean image to form m×n pixel pairs; the grayscales of the two pixels of each pixel pair constitute a grayscale pair, so that m×n grayscale pairs are obtained; a two-dimensional histogram is established with the grayscales of the pixels of the medical image I as an x-axis and the grayscales of the pixels of the non-local mean image as a y-axis, wherein coordinates of the (i×j).sup.th grayscale pair is (a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n), that is x=a.sub.i,j, y=b.sub.i.sub.n.sub.,j.sub.n, and the number of times of appearance of the coordinates (a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n) of the grayscale pair in coordinates of the (i×j) grayscale pairs is marked as f.sub.i,j, so that the numbers of times of appearance f.sub.1,1˜f.sub.m,n of the coordinates (a.sub.1,1,b.sub.1.sub.n.sub.,1.sub.n) of the first grayscale pair to the coordinates (a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n) of the (i×j).sup.th grayscale pair in the coordinates of the (i×j) grayscale pairs are obtained; a joint probability density of the grayscale a.sub.i,j of the pixel (i,j) in the medical image I and the grayscale b.sub.i.sub.n.sub.,j.sub.n of the pixel (i.sub.n,j.sub.n) in the non-local mean value image is marked as p(a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n), wherein p(a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n) is calculated according to formula (1): p ( a i , j , b i n , j n ) = f i , j m × n ( 1 ) S3: segmenting the medical image by an improved salp swarm algorithm, specifically as follows: S3.1: defining a mother salp population and two filial salp populations X.sup.1 and X.sup.2, wherein population sizes of the mother salp population and the two filial salp populations X.sup.1 and X.sup.2 are all M=30, that is, the mother salp population includes M individuals, and each filial salp population includes M individuals; each individual in the two filial salp populations is represented by a data matrix constituted by dim=L dimension values in one row and dim columns, each individual in the mother salp population is represented by a data matrix constituted by 2dim=L dimension values in one row and 2dim columns, and the data matrices are called dimension matrices; a lower boundary matrix of the mother salp population is set as lb, and an upper boundary matrix of the mother salp population is set as ub, wherein, lb is a matrix [0, 0, 0, . . . , 0] including one row and 2dim columns, ub is a matrix [254, 254, 254, . . . , 254] including one row and 2dim columns, lb.sub.D represents the D.sup.th element in the lower boundary matrix lb, ub.sub.D represents the D.sup.th element in the upper boundary matrix ub, and D=1, 2, . . . , 2dim; S3.2: initializing the filial salp population X.sup.1 and the filial salp population X.sup.2 respectively to obtain 0-generation filial salp populations X.sup.1,0 and X.sup.2,0, specifically as follows: S3.2.1: assigning each individual in the filial salp population X.sup.1 and each individual in the filial salp population X.sup.2 respectively according to formula (2) and formula (3):
X.sub.l,d.sup.1=rand *(ub.sub.d−lb.sub.d)+lb.sub.d  (2)
X.sub.l,d.sup.2=rand *(ub.sub.d−lb.sub.d)+lb.sub.d  (3) wherein, lb.sub.d represents the d.sup.th element in the lower boundary matrix lb, ub.sub.d represents the d.sup.th element in the upper boundary matrix ub, and d=1, 2, . . . , dim; X.sub.l,d.sup.1 represents the d.sup.th dimension value of the l.sup.th individual in the filial salp population X.sup.1, X.sub.l,d.sup.2 represents the d.sup.th dimension value of the l.sup.th individual in the filial salp population X.sup.2, and l=1, 2, . . . , 30; rand represents a random number between 0 and 1 generated by a random function, and rand is regenerated by the random function before each calculation performed according to formula (2) and formula (3); S3.2.2: rearranging the dimensional values of each assigned individual in the filial salp population X.sup.1 in an increasing order to obtain a 0-generation salp population X.sup.1,0, marking the d.sup.th dimension value of the l.sup.th individual in the 0-generation salp population X.sup.1,0, as X.sub.l,d.sup.1,0, rearranging the dimensional values of each assigned individual in the filial salp population X.sup.2 in an increasing order to obtain a 0-generation salp population X.sup.2,0, marking the d.sup.th dimension value of the l.sup.th individual in the 0-generation salp population X.sup.2,0, as X.sub.l,d.sup.2,0; S3.3: setting a global optimum fitness value best, initially assigning best with a minus infinity, setting a global optimum individual bestposition, and initially setting bestposition as a matrix [0, 0, 0, . . . , 0] including one row and 2dim columns; S3.4: setting a maximum number of iterations of the mother salp population as T=100, setting an iteration variable t, and initially setting t as 1; S3.5: performing a t.sup.th iteration on the mother salp population, specifically as follows: S3.5.1: setting two threshold vectors h.sup.l,t ∧s.sup.l,t capable of storing one row and (L−1) columns of data, rounding off the first dimension value to the (L−1).sup.th dimension value of the l.sup.th individual in the (t−1).sup.th-generation filial salp population X.sup.1,t−1 to obtain integers which are put into h.sup.l,t, and marking H.sup.th data in h.sup.l,t as h.sub.H.sup.l,t, wherein H=1, 2, . . . , (L−1); rounding off the first dimension value to the (L−1).sup.th dimension value of the l.sup.th individual in the (t−1).sup.th-generation filial salp population X.sup.2,t−1 to obtain integers which are put into s.sup.l,t, and marking H.sup.th data in s.sup.l,t as s t, and constituting a threshold vector (h.sub.H.sup.l,t,s.sub.H.sup.l,t) by h.sub.H.sup.l,t and s.sub.H.sup.l,t, so that (L−1) pairs of threshold vectors are obtained; segmenting the medical image I into L regions, which are [0,h.sub.1.sup.l,t, [h.sub.1.sup.l,t, h.sub.2.sup.l,t, . . . , [h.sub.L−1.sup.l,t, h.sub.L−1.sup.l,t and [h.sub.L−1.sup.l,t,255 respectively, according to h.sup.l,t pairs of grayscales of the medical image I in the two-dimensional histogram, wherein [represents the inclusion of a lower boundary, and the exclusion of an upper boundary; segmenting the medical image I into L regions, which are [0,s.sub.1.sup.l,t, [s.sub.1.sup.l,t,s.sub.2.sup.l,t, . . . , [s.sub.L−2.sup.l,t,s.sub.L−1.sup.l,t and [s.sub.L−1.sup.l,t,255 respectively, according to s.sup.l,t pairs of grayscales of the medical image I in the two-dimensional histogram, forming L grayscale pair segmentation regions {N.sub.1, N.sub.2 . . . N.sub.L} by the L regions obtained by segmentation according to the grayscales of the medical image I in the two-dimensional histogram and L regions obtained by segmentation according to grayscales of the non-local mean image in the two-dimensional histogram, representing the probability of appearance of the kth grayscale pair segmentation region N.sub.k by I.sub.N.sub.k(h.sub.k.sup.l,t,s.sub.k.sup.l,t), and marking a Kapur entropy of the current kth grayscale pair segmentation region N.sub.k as K.sub.N.sub.k.sup.t(h.sub.k.sup.l,t,s.sub.k.sup.l,t), wherein k=1, 2, . . . , (L−1), and the Kapur entropy K.sub.N.sub.k.sup.t(h.sub.k.sup.l,t,s.sub.k.sup.l,t) is expressed by formula (4): { K N k t ( h k l , t , s k l , t ) = - .Math. g = h k - 1 l , t h k l , t .Math. b = s k - 1 l , t s k l , t p ( g , b ) w L - 1 ln p ( g , b ) w L - 1 w L - 1 = .Math. g = h k - 1 l , t h k l , t .Math. b = s k - 1 l , t s k l , t p ( g , b ) ( 4 ) Wherein, when k=1, s.sub.0.sup.l,t=0, h.sub.0.sup.l,t=0, g is an integer, g=0, 1, . . . , h.sub.k.sup.l,t, b is an integer, and b=0, 1, . . . , s.sub.k.sup.l,t; and when the value of (g,b) is not within the m×n grayscale pairs obtained in S2, p(g,b)=0; In represents a natural logarithm; S3.5.2: obtaining a (t−1).sup.th mother salp population Y.sup.t−1 by using the dimension values of one row and dim columns of the l.sup.th individual of the (t−1).sup.th-generation filial salp population X.sup.1,t−1 as dimension values from the first column to the dim.sup.th column of the first row of the mother salp population and using the dimension values of one row and dim columns of the (t−1).sup.th-generation filial salp population X.sup.2,t−1 as dimension values from the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the mother salp population, and marking the D.sup.th dimension value of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 as Y.sub.l,D.sup.t−1, wherein D=1, 2, . . . , 2dim; S3.5.3: setting an objective function of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 as R.sup.l,t−1{(h.sub.1.sup.l,t,s.sub.1.sup.l,t),(h.sub.2.sup.l,t,s.sub.2.sup.l,t), . . . (h.sub.L−1.sup.l,t,s.sub.L−1.sup.l,t)}, and expressing the objective function by formula (5): R l , t - 1 { ( h 1 l , t , s 1 l , t ) , ( h 2 l , t , s 2 l , t ) , .Math. ( h L - 1 l , t , s L - 1 l , t ) } = K N 1 t ( h 1 l , t , s 1 l , t ) + K N 2 t ( h 2 l , t , s 2 l , t ) + .Math. + K N L - 1 t ( h L - 1 l , t , s L - 1 l , t ) ( 5 ) S3.5.4: substituting the Kapur entropy K.sub.N.sub.k(h.sub.k.sup.l,t,s.sub.k.sup.l,t) of the current kth grayscale pair segmentation region N.sub.k obtained by calculation into the objective function of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 to obtain an objective function value of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 by calculation, and using the objective function value as a fitness value fitness (l).sup.t−1 of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1, so that the fitness values of M individuals in the (t−1).sup.th mother salp population Y.sup.t−1 are obtained by calculation; S3.5.5: rearranging the fitness values of the M individuals in the (t−1).sup.th mother salp population Y.sup.t−1 in an increasing order, marking a maximum fitness value of the (t−1).sup.th mother salp population Y.sup.t−1 as bF.sup.t−1, marking a minimum fitness value of the (t−1).sup.th mother salp population Y.sup.t−1 as wF.sup.t−1, marking the individual corresponding to the maximum fitness value as bP.sup.t−1, and using the individual corresponding to the maximum fitness value as an optimum individual of the (t−1).sup.th mother salp population Y.sup.t−1; S3.5.6: updating the first individual to the (M/2).sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 according to formula (6) to obtain a first individual to an (M/2).sup.th individual in a t.sup.th-generation initial mother salp population F.sup.t: F l , D t = { b P D t - 1 + c t ( ( u b D - l b D ) r 1 t + l b D ) r 2 t 0 b P D t - 1 - c t ( ( u b D - l b D ) r 1 t + l b D ) r 2 t < 0 ( 6 ) c t = 2 e - ( 4 * t T ) 2 ( 7 ) wherein, r1.sup.t and r2.sup.t represent random numbers between 0 and 1 generated by a random function, c.sup.t is a control parameter and is expressed by formula (7), bP.sub.D.sup.t−1 represents the D.sup.th dimension value of the optimum individual of the (t−1).sup.th mother salp population Y.sup.t−1, F.sub.l,D.sup.t represents the D.sup.th dimension value of the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t, ub.sub.D and lb.sub.D represent the D.sup.th dimension value of an upper boundary and the D.sup.th dimension value of a lower boundary, and e is a natural constant; S3.5.7: updating the (M/2).sup.th individual to the M.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 according to formula (8) to obtain the (M/2).sup.th individual to the M.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t:
F.sub.l.sup.t=½(Y.sub.l.sup.t−1+Y.sub.l−1.sup.t−1)  (8) wherein, Y.sub.l.sup.t−1 represents the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1, Y.sub.l−1.sup.t−1 represents the (l−1).sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1, and F.sub.l represents the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t; S3.5.8: developing and exploring the t.sup.th-generation initial mother salp population F.sup.t according to formulas (9)-(12) to obtain a t.sup.th-generation intermediate mother salp population G.sup.t: { G l t = F A t - r 3 t × Levy t × ( F B t - F C t ) , θ < 0 G l t = F D t - r 4 t × .Math. "\[LeftBracketingBar]" F D t - 2 r 5 t × F l t .Math. "\[RightBracketingBar]" , θ 0 r 7 t < 0 . 5 G l t = ( b P t - 1 - mean ( F t ) ) - r 4 t × , ( ( ub - l b ) × r 6 t + l b ) θ 0 r 7 t 0 . 5 ( 9 ) Levy t φ × μ t .Math. "\[LeftBracketingBar]" v t .Math. "\[RightBracketingBar]" 1 / δ ( 10 ) φ = [ Γ ( 1 + δ ) × sin ( π × δ / 2 ) Γ ( ( δ + 1 2 ) × δ × 2 ( δ - 1 ) / 2 ) ] 1 / δ ( 11 ) θ = tan ( pi × ( r 8 t - 0 . 5 ) ) - ( 1 - t / T ) ( 12 ) wherein, G.sub.l.sup.t represents the l.sup.th individual in the t.sup.th-generation intermediate mother salp population G.sup.t generated after updating, Levy.sup.t is a step parameter and is expressed by formulas (10)-(11), F.sub.A.sup.t, F.sub.B.sup.t, F.sub.C.sup.t and F.sub.D.sup.t represent four non-repetitive individuals A, B, C and D randomly selected from in the t.sup.th-generation initial mother salp population F.sup.t, r3.sup.t, r4.sup.t, r5.sup.t, r6.sup.t, r7.sup.t and r8.sup.t are random numbers between 0 and 1 generated by a random function, and μ.sup.t is a random number between 0 and 1 generated by a random function, v.sup.t is a random number following normal distribution and is between 0 and 1, δ is a constant and is set as 1.5, Γ is a standard gamma function, θ is a probability selection coefficient and is expressed by formula (12), pi is π, mean(F.sup.t) represents a mean value of the dimension values of the M individuals in the t.sup.th-generation initial mother salp population F.sup.t, tan represents a tangent function, and sin represents a sine function; S3.5.9: obtaining two initial filial salp populations by using a dimension matrix constituted by dimension values of the first column to the dim.sup.th column of the first row of the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t as an l.sup.th individual of one initial filial salp population and using a dimension matrix constituted by dimension values of the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t as a l.sup.th individual of the other initial filial salp population, and obtaining fitness values of the M individuals in the t.sup.th-generation initial mother salp population F.sup.t by calculation through a method the same as Step 3.5.1-Step 3.5.4; obtaining two intermediate filial salp populations by using a dimension matrix constituted by dimension values of the first column to the dim.sup.th column of the first row of the l.sup.th individual in the t.sup.th-generation intermediate mother salp population G t as a l.sup.th individual of one intermediate filial salp population and using a dimension matrix constituted by dimension values of the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the l.sup.th individual in the t.sup.th-generation intermediate mother salp population G.sup.t as a l.sup.th individual of the other intermediate filial salp population, and obtaining fitness values of the M individuals in the t.sup.th-generation intermediate mother salp population G.sup.t by calculation through a method the same as Step 3.5.1-Step 3.5.4; rearranging the 2 M individuals, including the M individuals in the t.sup.th-generation initial mother salp population F.sup.t and the M individuals in the t.sup.th-generation intermediate mother salp population G.sup.t, in an increasing order according to the fitness values of the 2 M individuals, selecting M individuals with larger fitness values, and randomly arranging the M selected individuals to form a new population; comparing a maximum fitness value of the new population with the global optimum fitness value best; if the maximum fitness value of the new population is greater than the global optimum fitness value best, updating the global optimum fitness value best with the maximum fitness value, and using the individual corresponding to the maximum fitness value as the global optimum individual bestposition; or, if the maximum fitness value of the new population is not greater than the global optimum fitness value best, keeping the global optimum fitness value best and the global optimum individual bestposition unchanged; obtaining two t.sup.th-generation filial salp populations X.sup.1,t and X.sup.2,t by using a dimension matrix constituted by dimension values of the first column to the dim.sup.th column of the first row of the l.sup.th individual in the new population as a l.sup.th individual of the t.sup.th-generation filial salp population X.sup.1,t and using a dimension matrix constituted by dimension values of the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the l.sup.th individual in the new population as a l.sup.th individual of the t.sup.th-generation filial salp population X.sup.2,t, and ending the t.sup.th iteration; S6: determining whether a current value of t is equal to T; if not, updating the value of t with the sum of the current value of t and 1, and then returning to S3.5.1 to perform a next iteration; if so, ending the iteration process, using the first dimension value to the dim.sup.th dimension value of the current global optimum individual bestposition as L thresholds for Renyi entropy-based multi-threshold segmentation of the medical image; arranging the L thresholds in an increasing order, and then marking the L thresholds as Th.sub.1, Th.sub.2, Th.sub.3, . . . , Th.sub.dim; setting (L+1) segmentation intervals [0, Th.sub.1), [Th.sub.1, Th.sub.2), [Th.sub.2, Th.sub.3), . . . , [Th.sub.dim, 255], determining the segmentation interval into which the grayscale of each pixel of the medical image I falls, amending the grayscale of the pixel to a lower boundary of the corresponding segmentation interval into which the pixels falls, obtaining a segmentation grayscale map based on the amended grayscales of the pixels of the medical image I after all grayscales of all the pixels of the medical image I are amended, and obtaining a finally segmented medical image according to the segmentation grayscale map.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0038] FIG. 1 is a grayscale image of a medical image I in Step S1 of a multi-threshold segmentation method for medical images based on an improved salp swarm algorithm according to the invention.

[0039] FIG. 2 is a two-dimensional histogram generated by a non-local mean image and a grayscale image of the medical image I in Step 2 of the multi-threshold segmentation method for medical images based on an improved salp swarm algorithm according to the invention.

[0040] FIG. 3 is a threshold segmentation region chart generated by the non-local mean image and the grayscale image in Step S3.5.1 of the multi-threshold segmentation method for medical images based on an improved salp swarm algorithm according to the invention.

[0041] FIG. 4 is a grayscale map of medical image segmentation in Step S6 of multi-threshold segmentation method for medical images based on an improved salp swarm algorithm according to the invention.

DETAILED DESCRIPTION OF THE INVENTION

[0042] The invention will be described in further detail below in conjunction with the accompanying drawings and embodiments.

[0043] Embodiment 1: a multi-threshold segmentation method for medical images based on an improved salp swarm algorithm comprises the following steps:

[0044] S1: a to-be-segmented medical image is marked as I, the size of the to-be-segmented medical image is marked as m×n, a pixel in the i.sup.th row and j.sup.th column of the medical image I is marked as (i,j), a grayscale of the pixel (i,j) in the medical image I is marked asa.sub.i,j, and the number of thresholds for segmenting the medical image is set as L=20, wherein i=1, 2, . . . , m, and j=1, 2, . . . , n; a grayscale image of the medical image I is shown in FIG. 1.

[0045] S2: non-local mean filtering is performed on the medical image I to obtain a non-local mean image with the size of m×n, a pixel in the i.sup.th row and j.sup.th column of the non-local mean image is marked as (i.sub.n,j.sub.n), and a grayscale of the pixel (i.sub.n,j.sub.n) in the non-local mean image is marked as b.sub.i.sub.n.sub.,j.sub.n, wherein i.sub.n−1, 2, . . . , m, and j.sub.n=1, 2, . . . , n.

[0046] The pixel in the i.sup.th row and j.sup.th column of the medical image I corresponds to the pixel in the i.sup.th row and j.sup.th column of the non-local mean image, and the two pixels constitute a pixel pair; the medical image I corresponds to the non-local mean image to form m×n pixel pairs; the grayscales of the two pixels of each pixel pair constitute a grayscale pair, so that m×n grayscale pairs are obtained; a two-dimensional histogram is established with the grayscales of the pixels of the medical image I as an x-axis and the grayscales of the pixels of the non-local mean image as a y-axis, and the two-dimensional histogram is shown in FIG. 2, wherein coordinates of the (i×j).sup.th grayscale pair are (a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n), that is x=a.sub.i,j, y=b.sub.i.sub.n.sub.,j.sub.n, and the number of times of appearance of the coordinates (a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n) of the grayscale pair in coordinates of the (i×j) grayscale pairs is marked as f.sub.i,j, so that the numbers of times of appearance f.sub.1,1˜f.sub.m,n of the coordinates (a.sub.1,1,b.sub.1.sub.n.sub.,1.sub.n) of the first grayscale pair to the coordinates (a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n) of the (i×j).sup.th grayscale pair in the coordinates of the (i×j) grayscale pairs are obtained; a joint probability density of the grayscale a.sub.i,j of the pixel (i,j) in the medical image I and the grayscale b.sub.i.sub.n.sub.,j.sub.n of the pixel (i.sub.n,j.sub.n) in the non-local mean value image is marked as p(a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n), wherein p(a.sub.i,j, b.sub.i.sub.n.sub.,j.sub.n) is calculated according to formula (1):

[00006] p ( a i , j , b i n , j n ) = f i , j m × n ( 1 )

[0047] S3: the medical image is segmented by an improved salp swarm algorithm, specifically as follows:

[0048] S3.1: a mother salp population and two filial salp populations X.sup.1 and X.sup.2 are defined, wherein population sizes of the mother salp population and the two filial salp populations X.sup.1 and X.sup.2 are all M=30, that is, the mother salp population includes M individuals, and each filial salp population includes M individuals; each individual in the two filial salp populations is represented by a data matrix constituted by dim=L dimension values in one row and dim columns, each individual in the mother salp population is represented by a data matrix constituted by 2dim=L dimension values in one row and 2dim columns, and the data matrices are called dimension matrices; a lower boundary matrix of the mother salp population is set as lb, and an upper boundary matrix of the mother salp population is set as ub, wherein, lb is a matrix [0, 0, 0, . . . , 0] including one row and 2dim columns, ub is a matrix [254, 254, 254, . . . , 254] including one row and 2dim columns, lb.sub.D represents the D.sup.th element in the lower boundary matrix lb, ub.sub.D represents the D.sup.th element in the upper boundary matrix ub, and D=1, 2, . . . , 2dim.

[0049] S3.2: the filial salp population X.sup.1 and the filial salp population X.sup.2 are initialized respectively to obtain 0-generation filial salp populations X.sup.1,0 and X.sup.2,0, specifically as follows:

[0050] S3.2.1: each individual in the filial salp population X.sup.1 and each individual in the filial salp population X.sup.2 are assigned respectively according to formula (2) and formula (3):


X.sub.l,d.sup.1=rand *(ub.sub.d−lb.sub.d)+lb.sub.d  (2)


X.sub.l,d.sup.2=rand *(ub.sub.d−lb.sub.d)+lb.sub.d  (3)

[0051] Wherein, lb.sub.d represents the d.sup.th element in the lower boundary matrix lb, ub.sub.d represents the d.sup.th element in the upper boundary matrix ub, and d=1, 2, . . . , dim; X.sub.l,d.sup.1 represents the d.sup.th dimension value of the l.sup.th individual in the filial salp population X.sup.1, X.sub.l,d.sup.2 represents the d.sup.th dimension value of the l.sup.th individual in the filial salp population X.sup.2, and l=1, 2, . . . , 30; rand represents a random number between 0 and 1 generated by a random function, and rand is regenerated by the random function before each calculation performed according to formula (2) and formula (3).

[0052] S3.2.2: the dimensional values of each assigned individual in the filial salp population X.sup.1 are rearranged in an increasing order to obtain a 0-generation salp population X.sup.1,0, the d.sup.th dimension value of the l.sup.th individual in the 0-generation salp population X.sup.1,0 is marked as X.sub.l,d.sup.1,0, the dimensional values of each assigned individual in the filial salp population X.sup.2 are rearranged in an increasing order to obtain a 0-generation salp population X.sup.2,0, the d.sup.th dimension value of the l.sup.th individual in the 0-generation salp population X.sup.2,0 is marked as X.sub.l,d.sup.2,0.

[0053] S3.3: a global optimum fitness value best is set, best is initially assigned with a minus infinity, a global optimum individual bestposition is set, and bestposition is initially set as a matrix [0, 0, 0, . . . , 0] including one row and 2dim columns.

[0054] S3.4: a maximum number of iterations of the mother salp population is set as T=100, an iteration variable t is set, and t is initially set as 1.

[0055] S3.5: a t.sup.th iteration is performed on the mother salp population, specifically as follows:

[0056] S3.5.1: two threshold vectors h.sup.l,t ∧s.sup.l,t capable of storing one row and (L−1) columns of data are set, the first dimension value to the (L−1).sup.th dimension value of the l.sup.th individual in the (t−1).sup.th-generation filial salp population X.sup.1,t−1 are rounded off to obtain integers which are put into h.sup.l,t, and H.sup.th data in h.sup.l,t is marked as h.sub.H.sup.l,t, wherein H=1, 2, . . . , (L−1); the first dimension value to the (L−1).sup.th dimension value of the l.sup.th individual in the (t−1).sup.th-generation filial salp population X.sup.2,t−1 are rounded off to obtain integers which are put into s.sup.l,t, and H.sup.th data in s.sup.l,t is marked as s.sub.H.sup.l,t, and a threshold vector (h.sub.H.sup.l,t,s.sub.H.sup.l,t) is constituted by h.sub.H.sup.l,t and s.sub.H.sup.l,t, so that (L−1) pairs of threshold vectors are obtained; the medical image I is segmented into L regions, which are [0,h.sub.1.sup.l,t, [h.sub.1.sup.l,t, h.sub.2.sup.l,t, . . . , [h.sub.L−1.sup.l,t, h.sub.L−1.sup.l,t and [h.sub.L−1.sup.l,t,255 respectively, according to h.sup.l,t pairs of grayscales of the medical image I in the two-dimensional histogram, wherein [represents the inclusion of a lower boundary, and the exclusion of an upper boundary; segmenting the medical image I into L regions, which are [0,s.sub.1.sup.l,t, [s.sub.1.sup.l,t,s.sub.2.sup.l,t, . . . , [s.sub.L−2.sup.l,t,s.sub.L−1.sup.l,t and [s.sub.L−1.sup.l,t,255 respectively, according to s.sup.l,t pairs of grayscales of the medical image I in the two-dimensional histogram, forming L grayscale pair segmentation regions {N.sub.1, N.sub.2 . . . N.sub.L} by the L regions obtained by segmentation according to the grayscales of the medical image I in the two-dimensional histogram and L regions obtained by segmentation according to grayscales of the non-local mean image in the two-dimensional histogram, as shown in FIG. 3, the probability of appearance of the kth grayscale pair segmentation region N.sub.k is represented by I.sub.N.sub.k(h.sub.k.sup.l,t,s.sub.k.sup.l,t), and a Kapur entropy of the current kth grayscale pair segmentation region N.sub.k is marked as K.sub.N.sub.k.sup.t(h.sub.k.sup.l,t,s.sub.k.sup.l,t), wherein k=1, 2, . . . , (L−1), and the Kapur entropy K.sub.N.sub.k.sup.t(h.sub.k.sup.l,t,s.sub.k.sup.l,t) is expressed by formula (4):

[00007] { K N k t ( h k l , t , s k l , t ) = - .Math. g = h k - 1 l , t h k l , t .Math. b = s k - 1 l , t s k l , t p ( g , b ) w L - 1 ln p ( g , b ) w L - 1 w L - 1 = .Math. g = h k - 1 l , t h k l , t .Math. b = s k - 1 l , t s k l , t p ( g , b ) ( 4 )

[0057] Wherein, when k=1, s.sub.0.sup.l,t=0, h.sub.0.sup.l,t=0, g is an integer, g=0, 1, . . . , h.sub.k.sup.l,t, b is an integer, and b=0, 1, . . . , s.sub.k.sup.l,t; and when the value of (g,b) is not within the m×n grayscale pairs obtained in S2, p(g,b)=0; In represents a natural logarithm.

[0058] S3.5.2: a (t−1).sup.th mother salp population Y.sup.t−1 is obtained by using the dimension values of one row and dim columns of the l.sup.th individual of the (t−1).sup.th-generation filial salp population X.sup.1,t−1 as dimension values from the first column to the dim.sup.th column of the first row of the mother salp population and using the dimension values of one row and dim columns of the (t−1).sup.th-generation filial salp population X.sup.2,t−1 as dimension values from the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the mother salp population, and the D.sup.th dimension value of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 is marked as Y.sub.l,D.sup.t−1, wherein D=1, 2, . . . , 2dim.

[0059] S3.5.3: an objective function of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 is set as R.sup.l,t−1{(h.sub.1.sup.l,t,s.sub.1.sup.l,t),(h.sub.2.sup.l,t,s.sub.2.sup.l,t), . . . (h.sub.L−1.sup.l,t,s.sub.L−1.sup.l,t)}, and the objective function is expressed by formula (5):

[00008] R l , t - 1 { ( h 1 l , t , s 1 l , t ) , ( h 2 l , t , s 2 l , t ) , .Math. ( h L - 1 l , t , s L - 1 l , t ) } = K N 1 t ( h 1 l , t , s 1 l , t ) + K N 2 t ( h 2 l , t , s 2 l , t ) + .Math. + K N L - 1 t ( h L - 1 l , t , s L - 1 l , t ) ( 5 )

[0060] S3.5.4: the Kapur entropy K.sub.N.sub.k(h.sub.k.sup.l,t,s.sub.k.sup.l,t) of the current kth grayscale pair segmentation region N.sub.k obtained by calculation is substituted into the objective function of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 to obtain an objective function value of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 by calculation, and the objective function value is used as a fitness value fitness(l).sup.t−1 of the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1, so that the fitness values of M individuals in the (t−1).sup.th mother salp population Y.sup.t−1 are obtained by calculation.

[0061] S3.5.5: the fitness values of the M individuals in the (t−1).sup.th mother salp population Y.sup.t−1 are rearranged in an increasing order, a maximum fitness value of the (t−1).sup.th mother salp population Y.sup.t−1 is marked as bF.sup.t−1, a minimum fitness value of the (t−1).sup.th mother salp population Y.sup.t−1 is marked as wF.sup.t−1, the individual corresponding to the maximum fitness value is marked as bP.sup.t−1, and the individual corresponding to the maximum fitness value is used as an optimum individual of the (t−1).sup.th mother salp population Y.sup.t−1.

[0062] S3.5.6: the first individual to the (M/2).sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 are updated according to formula (6) to obtain a first individual to an (M/2).sup.th individual in a t.sup.th-generation initial mother salp population F.sup.t:

[00009] F l , D t = { b P D t - 1 + c t ( ( u b D - l b D ) r 1 t + l b D ) r 2 t 0 b P D t - 1 - c t ( ( u b D - l b D ) r 1 t + l b D ) r 2 t < 0 ( 6 ) c t = 2 e - ( 4 * t T ) 2 ( 7 )

[0063] Wherein, r1.sup.t and r2.sup.t represent random numbers between 0 and 1 generated by a random function, c.sup.t is a control parameter and is expressed by formula (7), bP.sub.D.sup.t−1 represents the D.sup.th dimension value of the optimum individual of the (t−1).sup.th mother salp population Y.sup.t−1, F.sub.l,D.sup.t represents the D.sup.th dimension value of the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t, ub.sub.D and lb.sub.D represent the D.sup.th dimension value of an upper boundary and the D.sup.th dimension value of a lower boundary, and e is a natural constant.

[0064] S3.5.7: the (M/2).sup.th individual to the M.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1 are updated according to formula (8) to obtain the (M/2).sup.th individual to the M.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t:


F.sub.l.sup.t=½(Y.sub.l.sup.t−1+Y.sub.l−1.sup.t−1)  (8)

[0065] Wherein, Y.sup.t−1 represents the l.sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1, Y.sub.l−1.sup.t−1 represents the (l−1).sup.th individual in the (t−1).sup.th mother salp population Y.sup.t−1, and F.sub.l.sup.t represents the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t.

[0066] S3.5.8: the t.sup.th-generation initial mother salp population F.sup.t is developed and explored according to formulas (9)-(12) to obtain a t.sup.th-generation intermediate mother salp population G.sup.t:

[00010] { G l t = F A t - r 3 t × Levy t × ( F B t - F C t ) , θ < 0 G l t = F D t - r 4 t × .Math. "\[LeftBracketingBar]" F D t - 2 r 5 t × F l t .Math. "\[RightBracketingBar]" , θ 0 r 7 t < 0 . 5 G l t = ( b P t - 1 - mean ( F t ) ) - r 4 t × , ( ( ub - l b ) × r 6 t + l b ) θ 0 r 7 t 0 . 5 ( 9 ) Levy t φ × μ t .Math. "\[LeftBracketingBar]" v t .Math. "\[RightBracketingBar]" 1 / δ ( 10 ) φ = [ Γ ( 1 + δ ) × sin ( π × δ / 2 ) Γ ( ( δ + 1 2 ) × δ × 2 ( δ - 1 ) / 2 ) ] 1 / δ ( 11 ) θ = tan ( pi × ( r 8 t - 0 . 5 ) ) - ( 1 - t / T ) ( 12 )

[0067] Wherein, G.sub.l.sup.t represents the l.sup.th individual in the t.sup.th-generation intermediate mother salp population G.sup.t generated after updating, Levy.sup.t is a step parameter and is expressed by formulas (10)-(11), F.sub.A.sup.t, F.sub.B.sup.t, F.sub.C.sup.t and F.sub.D.sup.t represent four non-repetitive individuals A, B, C, and D randomly selected from in the t.sup.th-generation initial mother salp population F.sup.t, r3.sup.t, r4.sup.t, r5.sup.t, r6.sup.t, r7.sup.t and r8.sup.t are random numbers between 0 and 1 generated by a random function, and μ.sup.t is a random number between 0 and 1 generated by a random function, v.sup.t is a random number following normal distribution and is between 0 and 1, δ is a constant and is set as 1.5, Γ is a standard gamma function, θ is a probability selection coefficient and is expressed by formula (12), pi is π, mean(F.sup.t) represents a mean value of the dimension values of the M individuals in the t.sup.th-generation initial mother salp population F.sup.t, tan represents a tangent function, and sin represents a sine function.

[0068] S3.5.9: two initial filial salp populations are obtained by using a dimension matrix constituted by dimension values of the first column to the dim.sup.th column of the first row of the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t as an l.sup.th individual of one initial filial salp population and using a dimension matrix constituted by dimension values of the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the l.sup.th individual in the t.sup.th-generation initial mother salp population F.sup.t as a l.sup.th individual of the other initial filial salp population, and fitness values of the M individuals in the t.sup.th-generation initial mother salp population F.sup.t are obtained by calculation through a method the same as Step 3.5.1-Step 3.5.4.

[0069] Two intermediate filial salp populations are obtained by using a dimension matrix constituted by dimension values of the first column to the dim.sup.th column of the first row of the l.sup.th individual in the t.sup.th-generation intermediate mother salp population G.sup.t as a l.sup.th individual of one intermediate filial salp population and using a dimension matrix constituted by dimension values of the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the l.sup.th individual in the t.sup.1th-generation intermediate mother salp population G.sup.t as a l.sup.th individual of the other intermediate filial salp population, and fitness values of the M individuals in the t.sup.th-generation intermediate mother salp population G.sup.t are obtained by calculation through a method the same as Step 3.5.1-Step 3.5.4.

[0070] The 2 M individuals, including the M individuals in the t.sup.th-generation initial mother salp population F.sup.t and the M individuals in the t.sup.th-generation intermediate mother salp population G.sup.t, are rearranged in an increasing order according to the fitness values of the 2 M individuals, M individuals with larger fitness values are selected, and the M selected individuals are randomly arranged to form a new population.

[0071] A maximum fitness value of the new population is compared with the global optimum fitness value best; if the maximum fitness value of the new population is greater than the global optimum fitness value best, the global optimum fitness value best is updated with the maximum fitness value, and the individual corresponding to the maximum fitness value is used as the global optimum individual bestposition; or, if the maximum fitness value of the new population is not greater than the global optimum fitness value best, the global optimum fitness value best and the global optimum individual bestposition are kept unchanged.

[0072] Two t.sup.th-generation filial salp populations X.sup.1,t and X.sup.2,t are obtained by using a dimension matrix constituted by dimension values of the first column to the dim.sup.th column of the first row of the l.sup.th individual in the new population as a l.sup.th individual of the t.sup.th-generation filial salp population X.sup.1,t and using a dimension matrix constituted by dimension values of the (dim+1).sup.th column to the 2dim.sup.th column of the first row of the l.sup.th individual in the new populations a l.sup.th individual of the t.sup.th-generation filial salp population X.sup.2,t, and the t.sup.th iteration is ended.

[0073] S6: whether a current value of t is equal to T is determined; if not, the value of t is updated with the sum of the current value of t and 1, and then S3.5.1 is performed to perform a next iteration; if so, the iteration process is ended, the first dimension value to the dim.sup.th dimension value of the current global optimum individual bestposition are used as L thresholds for Renyi entropy-based multi-threshold segmentation of the medical image; the L thresholds are arranged in an increasing order, and then the L thresholds are marked as Th.sub.1, Th.sub.2, Th.sub.3, . . . , Th.sub.dim; (L+1) segmentation intervals [0, Th.sub.1), [Th.sub.1, Th.sub.2), [Th.sub.2, Th.sub.3), . . . , [Th.sub.dim, 255] are set, the segmentation interval into which the grayscale of each pixel of the medical image I falls is determined, the grayscale of the pixel is amended to a lower boundary of the corresponding segmentation interval into which the pixels falls, a segmentation grayscale map is obtained based on the amended grayscales of the pixels of the medical image I after all grayscales of all the pixels of the medical image I are amended, and a finally segmented medical image is obtained according to the segmentation grayscale map.