CN108389211B - Image segmentation method based on improved whale optimized fuzzy clustering - Google Patents

Image segmentation method based on improved whale optimized fuzzy clustering Download PDF

Info

Publication number
CN108389211B
CN108389211B CN201810218340.XA CN201810218340A CN108389211B CN 108389211 B CN108389211 B CN 108389211B CN 201810218340 A CN201810218340 A CN 201810218340A CN 108389211 B CN108389211 B CN 108389211B
Authority
CN
China
Prior art keywords
whale
image
clustering
iteration
gray level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810218340.XA
Other languages
Chinese (zh)
Other versions
CN108389211A (en
Inventor
孙永军
陈亚环
刘祖军
王曦璐
汪凡力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CN201810218340.XA priority Critical patent/CN108389211B/en
Publication of CN108389211A publication Critical patent/CN108389211A/en
Application granted granted Critical
Publication of CN108389211B publication Critical patent/CN108389211B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an image segmentation method based on improved whale optimized fuzzy clustering, which mainly solves the problems of serious loss and long segmentation time after image information segmentation in the prior art. The method comprises the following implementation steps: 1. inputting an image and acquiring gray levels of all pixel points; 2. c clustering centers are selected to divide the image into c types; 3. generating n whales, wherein each whale has a c-dimensional vector and represents a group of possible solutions of a clustering center; 4. searching an optimal clustering center by using the reciprocal of the fast fuzzy C-mean clustering target function as an adaptive value; 5. and realizing image segmentation according to a group of clustering centers corresponding to the searched maximum fitness value, classifying pixel points with the same gray level in the same membership range into one class, and outputting the segmented image. The invention improves the image segmentation effect by combining the optimization result with the fuzzy clustering image segmentation, and can be used for target detection, video monitoring and medical imaging.

Description

Image segmentation method based on improved whale optimized fuzzy clustering
Technical Field
The invention belongs to the technical field of image processing, and further relates to an image segmentation method for improving whale optimized fuzzy clustering, which can be used for target detection, video monitoring and medical imaging.
Background
Image segmentation is one of the important techniques in image processing and computer vision, which divides an image into a plurality of non-overlapping regions according to characteristics such as gray level, shape and texture, the same region has similar characteristics, but different regions do not have similar characteristics. Image segmentation is an important step from image processing to image analysis, and the purpose of the image segmentation is to divide an image into a plurality of meaningful areas, so that subsequent processing procedures, such as feature extraction, target recognition and the like, are facilitated. There are many methods for image segmentation, such as a clustering center-based segmentation method, a region-based segmentation method, and a segmentation method that incorporates a specific theory. The fuzzy clustering algorithm based on the fuzzy set theory is used for a labeling process after unsupervised fuzzy clustering when the image is segmented, can reduce human intervention in an application process, accords with the actual conditions of uncertainty and fuzziness in the image, and effectively improves the precision of image segmentation.
The fuzzy C-mean FCM clustering algorithm is simple and efficient, is widely applied to image segmentation at present, and can effectively avoid the multi-branch problem in clustering and centering segmentation. The FCM algorithm is a local optimization algorithm, is sensitive to selection of an initial value and is easy to fall into local optimization, so that the FCM has many defects in image segmentation, wherein the main difficulty and key point are selection of an initial clustering center and how to avoid the algorithm from falling into the local optimization.
The whale algorithm is one of swarm intelligence algorithms, the swarm intelligence algorithm is mainly based on an optimization algorithm for simulating living behaviors of organisms in the nature, a swarm is composed of a plurality of individuals, each individual in the swarm is used as a potential solution of an optimization problem, an initial solution is selected for all the individuals, then the current solution is continuously updated, and the method is finished when an optimal solution is searched or the maximum searching frequency is reached. Blum in the article "Swarm interference in optimization," Swarm interference in spring Berlin Heidelberg,2008.43-85 mentions that each individual in a population intelligent algorithm has a simple function, but through information interaction between individuals, the entire population can solve complex problems, while having greater efficiency and robustness compared to conventional algorithms. Yang in the article "Swarm applied based algorithms" a clinical analysis, "evolution Intelligent Intelligence 7.1(2014):17-28 mentions that the initial value selection is more likely and the degree of freedom is greater due to the larger population size in the group Intelligence algorithm. Each individual in the group intelligent algorithm can be regarded as a group of different possible solutions, so that the whole group has strong solution diversity, and the group intelligent algorithm can optimize complex problems without excessive prior knowledge.
Therefore, more and more researchers combine the group intelligence algorithm with the Fuzzy clustering image segmentation, for example, Yang proposes a Fuzzy C-means clustering image segmentation method based on the simulated annealing algorithm in the paper "Fuzzy C-means image segmentation and optimization based on the Fuzzy C-means clustering image segmentation [ C ]," International Conference on mechanics, materials and manufacturing. chengdu 2014:536-539, which solves the defect of easy falling into local optimization to some extent, but the simulated annealing algorithm is sensitive to the initial temperature and the cooling coefficient, and the algorithm is hard to reach the balance in convergence speed and convergence accuracy. The Fuzzy C-means clustering Image segmentation of the artificial bee colony algorithm is proposed by Ankita in 'Fuzzy-based identification bee colony optimization for gray Image segmentation'. Signal, Image and Video processing.2016/02/02. The artificial bee colony algorithm has strong exploration capability but weak development capability, so that the optimization efficiency in the iteration process is poor. According to a fuzzy set theory, clustering image segmentation is realized, compared with the traditional image segmentation method, the time required by the computing process of the fuzzy clustering image segmentation algorithm based on the group intelligent algorithm is greatly shortened, but because the fuzzy clustering image segmentation based on the group intelligent algorithm is difficult to well balance the exploration capability and the development capability in the optimizing process, the problem that the optimal clustering center can not be found is caused, the obtained image information after clustering segmentation is seriously lost, the segmentation effect is not good enough, and the process of computer vision analysis is further influenced.
Disclosure of Invention
The invention aims to provide an image segmentation method based on improved whale optimized fuzzy clustering to overcome the defects of the prior art, so that the loss condition of image information is reduced, the time for searching an optimal clustering center is shortened, and the image segmentation effect is improved.
The technical scheme of the invention is as follows: firstly, each individual in a whale population respectively represents a possible solution of a group of different clustering centers, and corresponding fitness is calculated according to a fitness function; iteration and updating are carried out through different behavior modes in the whale algorithm, and finally a cluster center combination solution corresponding to the searched maximum fitness is output; and classifying the pixel points in the image according to the cluster center combination, wherein the implementation steps comprise the following steps:
in order to achieve the purpose, the technical scheme of the invention is as follows:
(1) inputting an image, graying the image and extracting the number M × N and the dimension D of pixel points in the gray image, wherein the gray level of each pixel point is k, and the gray level value range is [0, L-1 ]]Wherein M and N respectively represent the row and column of pixel points in the image, and the number of pixels with gray level k is set as hkL represents the number of gray levels;
(2) initializing whale colony scale n, fuzzy factor omega and clustering number c, setting iteration time t as 0, and setting the maximum iteration time as MaxT and termination error sigma;
(3) setting the cluster number c, randomly selecting c different gray levels from all gray levels as possible solutions of a group of cluster centers, and selecting n groups of possible solutions in total, wherein the possible solutions of each group of cluster centers are represented as
Figure BDA0001599040230000031
a, b.. p ∈ c and a ≠ b.. noteq.p, i ∈ [1, n ≠ p];
(4) Taking n groups of cluster center possible solutions selected in the step (3), and rearranging the gray levels in each group of possible solutions according to the sequence from small to large to obtain the ordered possible solutions:
Figure BDA0001599040230000032
and will be
Figure BDA0001599040230000033
As an initial solution for the ith whale in a whale population, wherein
Figure BDA0001599040230000034
To represent
Figure BDA0001599040230000035
Corresponding to the m-th cluster in the set of possible solutionsHeart, m ∈ [1, c ]];
(5) Computing the gray level k and the initial solution
Figure BDA0001599040230000036
C cluster centers of
Figure BDA0001599040230000037
(6) Acquiring a gray level histogram h of the image, and setting the number of pixel points with gray level j as hj,j∈[0,L-1];
(7) Initializing membership matrix U0Combined with (5)
Figure BDA0001599040230000038
H in (6) tojCalculating the initial solution of each whale
Figure BDA0001599040230000039
Is adapted to
Figure BDA00015990402300000310
And storing a group of clustering center possible solutions X with maximum fitness in the initial solutions of the n whalesbestTo obtain the maximum value f (X) of fitnessbest);
(8) Iteratively calculating n whale solutions:
(8a) let t be the current iteration number, t ∈ [0, MaxT]Wherein t-0 represents the initial state before starting iteration, and the fitness of the ith iteration is set as
Figure BDA00015990402300000311
i∈[1,n]Let t be 1;
(8b) selecting n with higher t-1 iteration fitness1Root of single whale
Figure BDA00015990402300000312
And n with low fitness3Root of single whale
Figure BDA00015990402300000313
And n will remain2Root of single whale
Figure BDA00015990402300000314
Is updated to
Figure BDA00015990402300000315
i∈[1,n]And n is1+n2+n3=n;
(8c) N in (8b)1Root of single whale
Figure BDA00015990402300000316
Is updated by cross-over behavior
Figure BDA00015990402300000317
(8d) Randomly generating a number r, r ∈ [0,1]]If r is>0.5, mixing n3Root of single whale
Figure BDA00015990402300000318
Updated using a levi flight strategy to
Figure BDA00015990402300000319
Otherwise, using local variant behavior will
Figure BDA00015990402300000320
Is updated to
Figure BDA00015990402300000321
(8e) Based on all updated whale fish solutions
Figure BDA00015990402300000322
C cluster centers in the process, and calculating the Euclidean distance between the t-th iteration gray level k and the c cluster centers
Figure BDA00015990402300000323
And membership matrix
Figure BDA00015990402300000324
(8f) The method according to (8e)
Figure BDA00015990402300000325
And
Figure BDA00015990402300000326
calculating solutions of each whale for the t-th iteration
Figure BDA00015990402300000327
Is adapted to
Figure BDA0001599040230000041
i∈[1,n];
(8g) All fitness in (8f)
Figure BDA0001599040230000042
Maximum value of fitness f (X) in (7)b) And (3) comparison:
if it is not
Figure BDA0001599040230000043
The fitness maximum is updated to
Figure BDA0001599040230000044
Updating the optimal cluster center possible solution to
Figure BDA0001599040230000045
Otherwise, not updating;
(8h) judging the termination condition, if t>MaxT, iteration termination, output f (X)best) And XbestIf not, executing the step (9), and if t is t +1, returning to the step (8 b);
(9) updating and calculating membership degree matrix UtAnd a cluster center;
(10) if | | | Ut-Ut-1||<Sigma, stopping the algorithm, and executing the step (11); otherwise, skipping to the step (9);
(11) finishing the clustering segmentation of the images according to the principle of maximum membership degree Ck=arg{max(uik) In which C iskRepresenting the degree to which the kth grey level belongs to the ith class.
Compared with the prior art, the invention has the following advantages:
first, the present invention introduces a crossover operation, aiming at the top n with the highest fitness in the population1The individuals are crossed, and through information interaction among excellent small-scale groups, a more excellent possible solution is reserved, and the exploration capability in the group optimizing process is improved.
Secondly, the invention introduces the Levy flight characteristic search strategy, balances the proportion of local search and global search, and accelerates the search speed, thereby shortening the time for determining the optimal clustering center and accelerating the image segmentation rate.
Thirdly, the improved whale algorithm is combined with the fuzzy clustering segmentation idea, the image is segmented by utilizing the advantage that the algorithm can further balance the exploration capacity and the development capacity in the optimizing process, the maximum value of the fitness function is met by solving the proper clustering center according to the improved fuzzy C-mean criterion, and the image segmentation precision is improved.
Simulation results show that the method can improve the exploration capability of the group, enhance the diversity of the whole group, avoid falling into local extreme values, and better balance the development capability and the exploration capability in the optimization process, so that the optimal clustering center can be selected, the segmented image is prevented from losing too much information, and the image segmentation performance is better.
Drawings
FIG. 1 is a flow chart of an implementation of the present invention.
Fig. 2 is an input original image in the present invention.
Fig. 3 is a graph of the segmentation results of fig. 2 using the present invention and a prior art method.
Fig. 4 is a fitness maximum curve during an iteration process of the present invention and the prior art method.
Detailed Description
The present invention will be described in further detail below with reference to the accompanying drawings.
The invention improves the optimizing capability of the original whale swarm algorithm, introduces the cross behavior and the variation behavior, enables each individual whale in the swarm to represent the possible solutions of a group of segmented clustering centers by selecting a proper gray level as the segmented clustering center, and updates all the possible solutions based on the cross variation whale swarm algorithm through the set iteration times. In each iteration process, each whale updates self information by selecting different behavior modes, when the maximum iteration times are reached, the searched optimal clustering center solution corresponding to the maximum fitness function value is output, and finally the image is segmented according to the optimal clustering center solution.
Referring to fig. 1, a specific implementation of the present invention is as follows.
Step 1, inputting a gray image.
Obtaining and inputting a gray image from a gallery, extracting M × N pixel points and dimension D in the gray image, wherein the gray level of each pixel point is k, and the value range of the gray level k is [0, L-1 ]]Wherein M and N respectively represent the row and column of pixel points in the image, and the number of pixels with gray level k is set as hkAnd L is expressed as the number of gray levels.
Step 2: initializing whale colony scale n and fuzzy factor omega, setting iteration time t as 0 and maximum iteration time as MaxT and
the termination error σ;
and step 3: and setting the number c of the clustering centers of the segmented images.
Because the number of the targets of the image segmentation depends on the number c of the clustering centers, the image can be segmented into c targets through the c clustering centers, and therefore the number c of the clustering centers of the segmented image needs to be set before segmentation, and the implementation steps are as follows:
2.1) randomly selecting c gray levels from the gray level range as c clustering centers, and then using the c clustering centers as a group of clustering centers to possibly solve the problem;
2.2) selecting n groups of possible solutions of the clustering centers, and representing the possible solutions of each group of clustering centers as
Figure BDA0001599040230000051
Wherein k isa,kb,...,kpRepresenting the gray levels a, b,. p ∈ [1, M × N ] of the a, b,. p pixels in the image]And a ≠b≠...≠p,i∈[1,n]And M × N represents the total number of pixels in the image.
And 4, step 4: the whale algorithm is initialized.
The whale algorithm is a population-based optimization algorithm, each individual in a population can be used as a solution for solving a problem, n whales are set in the population, each whale represents a group of clustering centers and can be solved, whale initialization means that initial solutions of the n whales are obtained, and the process is as follows:
taking the n groups of possible solutions of the cluster centers selected in the step 2, rearranging the gray levels in the possible solutions of each group of the cluster centers according to a sequence from small to large, wherein the ordered possible solutions of the cluster centers are represented as:
Figure BDA0001599040230000061
wherein
Figure BDA0001599040230000062
i∈[1,n];
Will be provided with
Figure BDA0001599040230000063
As an initial solution for the ith whale in a whale population, wherein
Figure BDA0001599040230000064
To represent
Figure BDA0001599040230000065
Corresponding to the mth cluster center in the set of possible solutions, m ∈ [1, c]。
And 5: computing the gray level k and the initial solution
Figure BDA0001599040230000066
C cluster centers of
Figure BDA0001599040230000067
Figure BDA0001599040230000068
Wherein v isiThe ith cluster center is represented, k represents the gray level, and | | · | | | represents solving a two-norm of the distance.
Step 6: and acquiring a gray histogram h of the image.
According to all the pixel points and the gray level d of each pixel point obtained in the step 1kAll h of gray level j from 0 to L-1 are obtainedjWherein h isjNumber of pixels representing gray level j, j ∈ [0, L-1](ii) a By using hjThe vertical axis represents the gray level j as the horizontal axis, and the obtained diagram is the gray histogram h.
And 7: initializing membership matrix U0And calculating the fitness value of the initial solution of the whale, and storing the maximum fitness value and the possible solution of the clustering center.
7.1) taking the product of step 5
Figure BDA0001599040230000069
Obtaining a membership matrix U according to the following calculation formula0Each membership element u inik
Figure BDA00015990402300000610
Wherein u isikRepresenting the degree to which the gray level k belongs to the i-th class, djk(k,vj) Representing gray level k to cluster center vjThe Euclidean distance of;
7.2) combining the above uik,
Figure BDA00015990402300000611
And h in step 6jCalculating the fitness of the initial solutions of the n whales and the ith whale
Figure BDA00015990402300000612
Is expressed as
Figure BDA00015990402300000613
The calculation steps are as follows:
first, a matrix U about membership is calculated0And polyClass center matrix V0Is the objective function J ofFFCM(U0,V0) The smaller the value is, the better the clustering effect is represented, and the calculation formula is as follows:
Figure BDA0001599040230000071
wherein c represents the number of clusters, L-1 represents the number of gray levels, hkThe number of pixel points with the gray level k is shown, and omega represents a fuzzy factor;
then, the fitness of the initial solutions of the n whales and the i whale is calculated
Figure BDA0001599040230000072
Is expressed as
Figure BDA0001599040230000073
The calculation formula is as follows:
Figure BDA0001599040230000074
7.3) calculating the maximum value f (X) of the fitnessbest):
Figure BDA0001599040230000075
Wherein XbestAnd representing a group of clustering center possible solutions with the highest fitness in the n whale solutions, which is also called an optimal clustering center possible solution. The adaptability can measure the capability of segmenting the image, and the larger the adaptability value is, the better the image segmentation effect is.
And 8: and (5) iteratively calculating the solutions of the n whales.
Let t denote the current iteration number, MaxT denote the total number of iterations, t ∈ [0, MaxT]Wherein t-0 represents the initial state before starting iteration, and the fitness of the ith iteration is set as
Figure BDA0001599040230000076
i∈[1,n]The iteration steps are as follows:
8.1) let t be 1;
8.2) selecting n with higher t-1 iteration fitness1Root of single whale
Figure BDA0001599040230000077
And n with low fitness3Root of single whale
Figure BDA0001599040230000078
And n will remain2Root of single whale
Figure BDA0001599040230000079
Is updated to
Figure BDA00015990402300000710
i∈[1,n]And n is1+n2+n3=n;
8.3) updating n in 8.2)1Root of single whale
Figure BDA00015990402300000711
Updating n in 8.2) using cross-behavior1Root of single whale
Figure BDA00015990402300000712
The update procedure is calculated as follows:
Figure BDA00015990402300000713
where the cross-over behavior is a way to update the solution, pcRepresents the cross probability and takes the value pc=0.5,
Figure BDA00015990402300000714
Represents n1The position of the ith whale in the tth iteration,
Figure BDA00015990402300000715
and
Figure BDA00015990402300000716
is selected n1One of whales, i, j ∈ [1, n1],i≠j;
8.4) updating n in 8.2)3Root of single whale
Figure BDA0001599040230000081
The specific process is as follows:
8.4.1) randomly generating a number r, wherein r belongs to [0,1 ];
8.4.2) selecting a location update policy according to the value of r:
if r>0.5, then n is3Root of single whale
Figure BDA0001599040230000082
Updated using a levi flight strategy to
Figure BDA0001599040230000083
The Levis flight strategy update formula is as follows:
Figure BDA0001599040230000084
wherein the content of the first and second substances,
Figure BDA0001599040230000085
represents n3The position of the ith whale in the tth iteration,
Figure BDA0001599040230000086
point-to-point multiplication is shown, α represents step control quantity, the value of which is subject to normal distribution, L (lambda) is Levy random search path, and the random step size is in accordance with L (s, lambda) -sIs the random step size obtained by Levy flight, and λ is the power number, 0<λ<3。
If r is less than or equal to 0.5, then local variation behavior is used
Figure BDA0001599040230000087
Is updated to
Figure BDA0001599040230000088
The update formula is as follows:
Figure BDA0001599040230000089
wherein rand (0,1) represents a random number between 0 and 1,
Figure BDA00015990402300000810
represents n3The ith iteration of the ith whale in the whale X-decomposingiM-th cluster center of (2), Xbest,mRepresents XbestThe mth cluster center in (1);
8.5) based on all updated whales
Figure BDA00015990402300000811
C cluster centers in the process, and calculating the Euclidean distance between the t-th iteration gray level k and the c cluster centers
Figure BDA00015990402300000812
And membership matrix UtThe calculation process is as follows:
8.5.1) according to the formula
Figure BDA00015990402300000813
i∈[1,c]Calculating Euclidean distance from the gray level k to the ith cluster center
Figure BDA00015990402300000814
8.5.2) according to 8.5.1)
Figure BDA00015990402300000815
Calculating a membership matrix
Figure BDA00015990402300000816
Each degree of membership u inikThe calculation formula is as follows:
Figure BDA00015990402300000817
wherein u isikRepresenting the degree to which the gray level k belongs to the ith class;
8.6) according to (8.5)
Figure BDA0001599040230000091
And UtCalculating the solution of each whale in the t-th iteration
Figure BDA0001599040230000092
Is adapted to
Figure BDA0001599040230000093
i∈[1,n]The calculation process is as follows:
first, a matrix U about membership is calculatedtAnd a cluster center matrix VtIs the objective function J ofFFCM(Ut,Vt) The smaller the value is, the better the clustering effect is, and the calculation formula is as follows:
Figure BDA0001599040230000094
wherein c represents the number of clusters, L-1 represents the number of gray levels, hkThe number of pixels with a gray level k is, and ω represents a blurring factor.
Then, each whale solution of the t-th iteration is calculated
Figure BDA0001599040230000095
Is adapted to
Figure BDA0001599040230000096
The calculation formula is as follows:
Figure BDA0001599040230000097
8.7) judging whether to update the fitness maximum value and the optimal clustering center solution:
taking n fitness degrees f (X) in the step 8.6)t) Wherein the ith fitness is expressed as
Figure BDA0001599040230000098
Comparison
Figure BDA0001599040230000099
And the maximum value f (X) of the fitness in the step 7)best) The size of (2):
if it is not
Figure BDA00015990402300000910
The fitness is maximized f (X)best) Is updated to
Figure BDA00015990402300000911
And solving the optimal clustering center in the step 7) into a possible solution XbIs updated to
Figure BDA00015990402300000912
Otherwise, no update is performed.
8.8) judging whether the iteration process is ended:
comparing t with MaxT, if t<MaxT, let t be t +1, return to step 8.2), otherwise, output f (X) in step 7)best) And XbestAnd (5) ending the iteration process, and executing the step (9), wherein t represents the current iteration number, and MaxT represents the total number of iterations.
And step 9: calculating a membership degree matrix U according to the result output by 7)tAnd a cluster center matrix Vt
9.1) calculating the gray levels k to XbEuclidean distance of ith cluster center
Figure BDA00015990402300000913
Updating the degree of membership u according to the following formulaik
Figure BDA0001599040230000101
Then the membership matrix Ut={uikI is 1,2, 1, c, k is 0,1, c, L-1 is the number of gray levels, c is the number of cluster centers;
9.2) after update according to 9.1)Is given as a membership matrix U ═ UikI 1, 2., c, k 0, 1.,. L-1} calculating a clustering center matrix V as follows:
Figure BDA0001599040230000102
wherein v isiDenotes the ith cluster center, hkIs the number of pixels with a gray level of k, omega represents a blurring factor, xkRepresenting gray values, then clustering the center matrix Vt={vi,i=1,2,...,c}。
Step 10: judging the termination condition, if | | | Ut-Ut-1||<Sigma, stopping the algorithm, and executing the step (11); otherwise, jumping to step 9.
Step 11: finishing the clustering segmentation of the images according to the principle of maximum membership degree Ck=arg{max(uik) In which C iskRepresenting the degree to which the kth grey level belongs to the ith class.
The results of the present invention can be further illustrated by the following simulation results:
1. simulation environment and conditions:
using simulation software Matlab2013b, a piece of data with the size of 512x512x3 is input from the gallery, as shown in fig. 2; setting the iteration total MaxT as 150, the population size n as 20, the fuzzy factor omega as 2, and the error sigma as 10-3The parameters of the artificial bee colony fuzzy C-means clustering algorithm and the simulated annealing fuzzy C-means clustering algorithm are set according to corresponding references in the background technology.
2. Simulation content:
simulation one:
and (3) respectively carrying out 1-time segmentation simulation on the image 2 by using the artificial bee colony fuzzy C-means clustering algorithm and the simulated annealing fuzzy C-means clustering algorithm, wherein the number C of the clustering centers is 5, and the segmented image is shown as the image 3, wherein the image obtained by segmenting the image 2 by using the artificial bee colony fuzzy C-means clustering algorithm is shown as a graph in fig. 3(a), the image obtained by segmenting the image 2 by using the artificial bee colony fuzzy C-means clustering algorithm is shown as a graph in fig. 3(b), and the image obtained by segmenting the image 2 by using the artificial bee colony fuzzy C-means clustering algorithm is shown as a graph in fig. 3 (C). The simulation curve result of the fitness maximum value in the simulation iteration process is shown in fig. 4.
Simulation II:
the number C of the clustering centers is respectively set to be 2, 3, 4 and 5, the artificial bee colony fuzzy C-mean clustering algorithm AFCM and the simulated annealing fuzzy C-mean clustering algorithm SFCM are used for carrying out segmentation simulation on the graph 2, the segmentation simulation is carried out for 30 times for each clustering center number value, and each segmentation simulation has corresponding data results which comprise the maximum fitness value and the possible solution of the optimal clustering center. Showing the data result corresponding to the first time with the best segmentation effect in the 30-time segmentation simulation and the mean value of the maximum value of the fitness in the 30-time data result
Figure BDA0001599040230000111
The results are shown in Table 1 with the standard deviation std.
TABLE 1
Figure BDA0001599040230000112
3. And (3) simulation result analysis:
the evaluation criteria of the fuzzy clustering image segmentation algorithm are as follows: the closer the divided image is to the original image, the better the division effect. It can be seen from fig. 3(b) that the image segmented by the fuzzy C-means clustering algorithm simulating the annealing algorithm loses the most information, and it can be seen from fig. 3(C) that the image segmented by the fuzzy C-means clustering algorithm of the artificial bee colony algorithm loses more information, and the content in fig. 2 cannot be shown comprehensively, and it can be seen from fig. 3(a) that the image information segmented by the present invention loses less information, and is closer to the original image, which shows that the segmentation effect of the present invention is better, because the present invention improves the accuracy of the group searching to the optimal result, enhances the diversity of the whole group and the ability of jumping out the local extreme point, so that a more suitable clustering center can be selected, and the segmented image can overcome the defect of losing too much information.
As can be seen from fig. 4, in the iterative process, although the fitness curve of the fuzzy C-means clustering algorithm of the simulated annealing algorithm is continuously increased, the searched fitness maximum value is too poor, which indicates that the fuzzy C-means clustering algorithm of the simulated annealing algorithm has strong exploratory ability but weak development ability; the fitness curve of the artificial bee colony fuzzy C-means clustering algorithm keeps a fast increasing trend before the 10 th iteration time, but quickly tends to be stable, which indicates that the artificial bee colony fuzzy C-means clustering algorithm has strong development capability and weak exploration capability and falls into local optimum; the maximum value of the fitness searched in a longer iteration process keeps a larger slope increase, which shows that the development capability of the method is stronger, and meanwhile, the method can search the maximum value of the fitness in a short-term iteration process, which shows that the overall search capability of the method is stronger, and the development capability and the exploration capability in the optimization process can be better balanced, so that the segmentation effect is better.
Fitness maximum value from table 1, mean value of fitness maximum values
Figure BDA0001599040230000121
And the standard deviation std shows that under the condition of the same number of clustering centers, the maximum value of the fitness of the method is larger, the average value is largest, and the standard deviation is minimum, so that the segmentation effect of the method is better, and the effect in multi-segmentation simulation is more stable.

Claims (8)

1. An image segmentation method based on improved whale optimized fuzzy clustering comprises the following steps:
(1) inputting an image, graying the image and extracting the number M × N and the dimension D of pixel points in the gray image, wherein the gray level of each pixel point is k, and the gray level value range is [0, L-1 ]]Wherein M and N respectively represent the row and column of pixel points in the image, and the number of pixels with gray level k is set as hkL represents the number of gray levels;
(2) initializing a whale colony scale n and a fuzzy factor omega, setting the iteration time t as 0, and setting the maximum iteration time as MaxT and a termination error sigma;
(3) setting the number c of clusters, randomly selecting c different gray levels from all gray levels as possible solutions of a group of cluster centers, and selecting n groups of possible solutions in total, wherein each group of clustersThe possible solution of class center is represented as
Figure FDA0002528630900000011
a,b,...p∈[1,c]And a ≠ b ≠ p, i ∈ [1, n ≠ p];
(4) Taking n groups of cluster center possible solutions selected in the step (3), and rearranging the gray levels in each group of possible solutions according to the sequence from small to large to obtain the ordered possible solutions:
Figure FDA0002528630900000012
and will be
Figure FDA0002528630900000013
As an initial solution for the ith whale in a whale population, where vmTo represent
Figure FDA0002528630900000014
Corresponding to the mth cluster center in the set of possible solutions, m ∈ [1, c];
(5) Calculating Euclidean distance d between the gray level k and c clustering centersmk(k,vm);
(6) Acquiring a gray level histogram h of the image, and setting the number of pixel points with gray level j as hj,j∈[0,L-1];
(7) Initializing membership matrix U0Incorporation of d in (5)mk(k,vm) H in (6) tojCalculating the initial solution of each whale
Figure FDA0002528630900000015
Is adapted to
Figure FDA0002528630900000016
And storing a group of clustering center possible solutions X with maximum fitness in the initial solutions of the n whalesbestTo obtain the maximum value f (X) of fitnessbest);
(8) Iterative computation of solutions for n whales, where t is the current iteration number, t ∈ [0, MaxT]Wherein t-0 represents the initial state before starting iteration, and the ith iteration is the t iterationHas a fitness of
Figure FDA0002528630900000017
i∈[1,n];
(8a) Let t be 1;
(8b) selecting n with higher t-1 iteration fitness1Root of single whale
Figure FDA0002528630900000018
And n with low fitness3Root of single whale
Figure FDA0002528630900000019
And n will remain2Root of single whale
Figure FDA00025286309000000110
Is updated to
Figure FDA00025286309000000111
i∈[1,n]And n is1+n2+n3=n;
(8c) N in (8b)1Root of single whale
Figure FDA0002528630900000021
Is updated by cross-over behavior
Figure FDA0002528630900000022
(8d) Randomly generating a number r, r ∈ [0,1]]If r > 0.5, n is3Root of single whale
Figure FDA0002528630900000023
Updated using a levi flight strategy to
Figure FDA0002528630900000024
Otherwise, using local variant behavior will
Figure FDA0002528630900000025
Is updated to
Figure FDA0002528630900000026
(8e) Based on all updated whale fish solutions
Figure FDA0002528630900000027
C cluster centers in the process, and calculating Euclidean distance d between the t-th iteration gray level k and the c cluster centersmk(k,vm) And membership matrix Ut
(8f) According to d obtained in (8e)mk(k,vm) And UtCalculating the solution of each whale in the t-th iteration
Figure FDA0002528630900000028
Is adapted to
Figure FDA0002528630900000029
i∈[1,n];
(8g) All fitness in (8f)
Figure FDA00025286309000000210
Maximum value of fitness f (X) in (7)best) And (3) comparison:
if it is not
Figure FDA00025286309000000211
The fitness maximum is updated to
Figure FDA00025286309000000212
Updating the optimal cluster center possible solution to
Figure FDA00025286309000000213
Otherwise, not updating;
(8h) judging a termination condition, if t is more than MaxT, terminating iteration and outputting f (X)best) And XbestExecuting the step (9); otherwise, let t be t +1, return to (8 b);
(9) updating and calculating membership degree matrix UtAnd a cluster center;
(10) if | | | Ut-Ut-1If | < σ, the algorithm is terminated, and step (11) is executed; otherwise, skipping to the step (9);
(11) finishing the clustering segmentation of the images according to the principle of maximum membership degree Ck=arg{max(umk) In which C iskRepresenting the clustering center to which the kth gray level belongs; u. ofmkIndicating the degree to which the gray level k belongs to the mth class.
2. The method of claim 1, wherein the Euclidean distance d between the gray level k and c cluster centers is calculated in step (5)mk(k,vm) Calculated according to the following formula:
dmk(k,vm)=||k-vm||m∈[1,c]
wherein v ismThe mth clustering center is represented, k represents the gray level, and | | · | | | represents solving a two-norm of the distance.
3. A method as claimed in claim 1, wherein in step (8) the ith whale solution X of the tth iteration is calculatedi tIs adapted to
Figure FDA00025286309000000214
Calculated according to the following formula:
Figure FDA0002528630900000031
wherein, JFFCM(Ut,Vt) Is a function of the membership matrix U and the cluster center matrix V, which is defined as follows:
Figure FDA0002528630900000032
wherein c represents the number of clusters, L-1 represents the number of gray levels, hkThe number of pixels with a gray level of k, ω represents a blurring factor, umkAnd expressing the degree of the membership of the gray level k to the mth class, wherein the membership matrix function is as follows:
Figure FDA0002528630900000033
wherein d isjk(k,vj) Representing gray level k to cluster center vjThe euclidean distance of (c).
4. The method of claim 1, wherein a fitness maximum f (X) is calculated in step (7)best) Calculated according to the following formula:
Figure FDA0002528630900000034
wherein, XbestThe center of the best cluster is represented,
Figure FDA0002528630900000035
represents the ith whale solution of the tth iteration.
5. The method of claim 1, wherein n is added in step (8c)1Root of single whale
Figure FDA0002528630900000036
Is updated by cross-over behavior
Figure FDA0002528630900000037
The method is carried out by the following formula:
Figure FDA0002528630900000038
wherein p iscRepresents the cross probability and takes the value pc=0.5,
Figure FDA0002528630900000039
Represents n1Of whales the ith iterationThe position of the mobile phone is determined,
Figure FDA00025286309000000310
and
Figure FDA00025286309000000311
is selected n1One of whales, i, j ∈ [1, n1],i≠j。
6. The method of claim 1, wherein the use of the levey flight behavior in step (8d) is to
Figure FDA00025286309000000312
Is updated to
Figure FDA00025286309000000313
The update formula is as follows:
Figure FDA0002528630900000041
wherein the content of the first and second substances,
Figure FDA0002528630900000042
represents n3The position of the ith whale in the tth iteration,
Figure FDA0002528630900000043
point-to-point multiplication is shown, α represents step control quantity, the value of which is subject to normal distribution, L (lambda) is Levy random search path, and the random step size is in accordance with L (s, lambda) -sThe Levy distribution of (1), s is the random step length obtained by Levy flight, and lambda is the power number, wherein lambda is more than 0 and less than 3.
7. The method of claim 1, wherein the local mutation behavior used in step (8d) is selected from the group consisting of
Figure FDA0002528630900000044
Is updated to
Figure FDA0002528630900000045
The update formula is as follows:
Figure FDA0002528630900000046
wherein rand (0,1) represents a random number between 0 and 1,
Figure FDA0002528630900000047
represents n3The ith iteration of the ith whale in the whale X-decomposingiM-th cluster center of (2), Xbest,mRepresents XbestThe mth cluster center in (1).
8. The method of claim 1, wherein the step (9) of updating the cluster center is calculated as follows:
Figure FDA0002528630900000048
wherein v ismDenotes the m-th cluster center, xkRepresenting the gray value of the pixel point, and omega represents the blurring factor.
CN201810218340.XA 2018-03-16 2018-03-16 Image segmentation method based on improved whale optimized fuzzy clustering Active CN108389211B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810218340.XA CN108389211B (en) 2018-03-16 2018-03-16 Image segmentation method based on improved whale optimized fuzzy clustering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810218340.XA CN108389211B (en) 2018-03-16 2018-03-16 Image segmentation method based on improved whale optimized fuzzy clustering

Publications (2)

Publication Number Publication Date
CN108389211A CN108389211A (en) 2018-08-10
CN108389211B true CN108389211B (en) 2020-08-11

Family

ID=63066570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810218340.XA Active CN108389211B (en) 2018-03-16 2018-03-16 Image segmentation method based on improved whale optimized fuzzy clustering

Country Status (1)

Country Link
CN (1) CN108389211B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109931903B (en) * 2019-02-26 2021-07-06 上海大学 Cylindricity evaluation method based on improved whale optimization algorithm
CN110136165A (en) * 2019-05-17 2019-08-16 河南科技学院 A kind of mutation movement method for tracking target based on the optimization of adaptive whale
CN110222878B (en) * 2019-05-17 2022-09-06 广东工业大学 Short-term load prediction method based on artificial fish swarm neural network
CN110263834B (en) * 2019-06-13 2022-07-05 东华大学 Method for detecting abnormal value of new energy power quality
CN110796173B (en) * 2019-09-27 2023-05-16 昆明电力交易中心有限责任公司 Load curve morphology clustering algorithm based on improved kmeans
CN112613550A (en) * 2020-12-17 2021-04-06 平安科技(深圳)有限公司 Data classification method, device and related equipment
CN113177954B (en) * 2021-04-28 2022-07-26 中南大学 Image processing method and device
CN113344426B (en) * 2021-06-28 2023-06-06 杭州市电力设计院有限公司余杭分公司 Energy storage station planning method, device and equipment
CN114489061B (en) * 2022-01-17 2023-05-16 湖北工业大学 Smooth path planning method based on whale optimization algorithm
CN114755586B (en) * 2022-04-27 2023-08-01 电子科技大学 Lithium ion battery residual life prediction method
CN115661467B (en) * 2022-12-28 2023-05-05 中国科学院自动化研究所 Cerebrovascular image segmentation method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853509B (en) * 2010-06-11 2012-05-09 西安电子科技大学 SAR (Synthetic Aperture Radar) image segmentation method based on Treelets and fuzzy C-means clustering
CN103824279A (en) * 2013-12-24 2014-05-28 西安电子科技大学 Image segmentation method based on organizational evolutionary cluster algorithm
CN105976379A (en) * 2016-05-11 2016-09-28 南京邮电大学 Fuzzy clustering color image segmentation method based on cuckoo optimization

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8107710B2 (en) * 2008-05-23 2012-01-31 University Of Rochester Automated placental measurement

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853509B (en) * 2010-06-11 2012-05-09 西安电子科技大学 SAR (Synthetic Aperture Radar) image segmentation method based on Treelets and fuzzy C-means clustering
CN103824279A (en) * 2013-12-24 2014-05-28 西安电子科技大学 Image segmentation method based on organizational evolutionary cluster algorithm
CN105976379A (en) * 2016-05-11 2016-09-28 南京邮电大学 Fuzzy clustering color image segmentation method based on cuckoo optimization

Also Published As

Publication number Publication date
CN108389211A (en) 2018-08-10

Similar Documents

Publication Publication Date Title
CN108389211B (en) Image segmentation method based on improved whale optimized fuzzy clustering
CN107169983B (en) Multi-threshold image segmentation method based on cross variation artificial fish swarm algorithm
CN107392919B (en) Adaptive genetic algorithm-based gray threshold acquisition method and image segmentation method
Abdel-Basset et al. HWOA: A hybrid whale optimization algorithm with a novel local minima avoidance method for multi-level thresholding color image segmentation
CN111984817B (en) Fine-grained image retrieval method based on self-attention mechanism weighting
CN110443257B (en) Significance detection method based on active learning
CN113408605A (en) Hyperspectral image semi-supervised classification method based on small sample learning
CN106874862B (en) Crowd counting method based on sub-model technology and semi-supervised learning
CN110738662A (en) Pituitary tumor texture image grading method based on fine-grained medical image segmentation and truth value discovery data amplification
CN112329784A (en) Correlation filtering tracking method based on space-time perception and multimodal response
CN111242971B (en) Target tracking method based on improved double-center particle swarm optimization algorithm
CN113610767A (en) Medical image multi-threshold segmentation method based on improved goblet sea squirt group algorithm
CN113435108A (en) Battlefield target grouping method based on improved whale optimization algorithm
Chen et al. Learning to segment object candidates via recursive neural networks
CN109886984B (en) Image accurate segmentation method using foreground and background gray difference and deep learning network
CN114332166A (en) Visible light infrared target tracking method and device based on modal competition cooperative network
Jiao et al. An improved cuckoo search algorithm for multithreshold image segmentation
Qiao et al. A multi-level thresholding image segmentation method using hybrid Arithmetic Optimization and Harris Hawks Optimizer algorithms
CN108280845B (en) Scale self-adaptive target tracking method for complex background
CN112509017A (en) Remote sensing image change detection method based on learnable difference algorithm
CN116523877A (en) Brain MRI image tumor block segmentation method based on convolutional neural network
CN110796198A (en) High-dimensional feature screening method based on hybrid ant colony optimization algorithm
CN115563519A (en) Federal contrast clustering learning method and system for non-independent same-distribution data
CN116433690A (en) Otsu threshold segmentation method based on gray wolf and particle swarm collaborative optimization algorithm
CN116342466A (en) Image matting method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant