CN107045717A - The detection method of leucocyte based on artificial bee colony algorithm - Google Patents
The detection method of leucocyte based on artificial bee colony algorithm Download PDFInfo
- Publication number
- CN107045717A CN107045717A CN201710169481.2A CN201710169481A CN107045717A CN 107045717 A CN107045717 A CN 107045717A CN 201710169481 A CN201710169481 A CN 201710169481A CN 107045717 A CN107045717 A CN 107045717A
- Authority
- CN
- China
- Prior art keywords
- ellipse
- source
- search
- nectar
- white blood
- 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.)
- Pending
Links
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 46
- 238000001514 detection method Methods 0.000 title claims abstract description 46
- 235000012907 honey Nutrition 0.000 claims abstract description 52
- 210000000265 leukocyte Anatomy 0.000 claims abstract description 39
- 238000000034 method Methods 0.000 claims abstract description 30
- 241000257303 Hymenoptera Species 0.000 claims abstract description 28
- 239000013598 vector Substances 0.000 claims abstract description 23
- 238000003708 edge detection Methods 0.000 claims abstract description 10
- 235000013305 food Nutrition 0.000 claims abstract description 4
- 230000006870 function Effects 0.000 claims description 24
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000010187 selection method Methods 0.000 claims description 5
- 238000005457 optimization Methods 0.000 description 18
- 239000002245 particle Substances 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 2
- 210000004940 nucleus Anatomy 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 210000004369 blood Anatomy 0.000 description 1
- 239000008280 blood Substances 0.000 description 1
- 210000004027 cell Anatomy 0.000 description 1
- 238000002059 diagnostic imaging Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 210000002865 immune cell Anatomy 0.000 description 1
- 210000000987 immune system Anatomy 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000000386 microscopy Methods 0.000 description 1
- 230000001575 pathological effect Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0012—Biomedical image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial 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]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- Molecular Biology (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Medical Informatics (AREA)
- Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
- Radiology & Medical Imaging (AREA)
- Quality & Reliability (AREA)
- Investigating Or Analysing Biological Materials (AREA)
Abstract
本发明公开了基于人工蜂群算法的白细胞的检测方法,首先采用边缘检测处理图像,并且提取所有的边缘像素存储在矢量P中,然后对种群进行初始化。计算蜜源的适应度值;雇佣蜂进行搜索产生新蜜源,计算其适应值并采用贪婪法选择较好的蜜源;雇佣蜂分享信息,跟随蜂采用轮盘赌原则计算蜜源被选择的概率,同时根据搜索公式在附近精细搜索;判断是否有食物源连续limit代没有更新,如果有则雇佣蜂变为侦查蜂,侦查蜂搜索产生新蜜源;记忆最优的蜜源位置;判断是否达到最大迭代次数,如果达到则终止输出最优解,最后实现白细胞的图像被检测出。本发明将人工蜂群算法用于白细胞的检测,在保持较好的检测速度的同时,提高了白细胞检测的精度。
The invention discloses a white blood cell detection method based on an artificial bee colony algorithm. Firstly, an edge detection is used to process an image, and all edge pixels are extracted and stored in a vector P, and then the population is initialized. Calculate the fitness value of the nectar source; hire bees to search for new nectar sources, calculate their fitness value and use the greedy method to select a better nectar source; hire bees to share information, and follow the bees to calculate the probability of the nectar source being selected according to the roulette principle. The search formula performs a fine search in the vicinity; judges whether there is a continuous limit generation of food sources that has not been updated, and if so, employs bees to become scout bees, and scout bees search to generate new honey sources; memorizes the optimal honey source location; judges whether the maximum number of iterations is reached, if When the optimal solution is reached, the output of the optimal solution is terminated, and finally the image of white blood cells is detected. The invention uses the artificial bee colony algorithm for the detection of white blood cells, and improves the detection accuracy of white blood cells while maintaining a good detection speed.
Description
技术领域technical field
本发明属于图像处理领域,特别涉及一种基于人工蜂群算法的白细胞检测的方法。The invention belongs to the field of image processing, in particular to a method for detecting white blood cells based on an artificial bee colony algorithm.
背景技术Background technique
人体血液白细胞通常又称为免疫细胞,在人体免疫系统起着重要的作用,在临床医学上可以通过观察不同类别的白细胞的数量和形态上的变化,从而判断人体机能的病理情况。因此,白细胞的检测是血常规检测的一项重要指标。目前,白细胞检测主要以显微镜和自动化血细胞分析仪为主,但是他们都有各自的缺点,例如人工镜检耗费的时间长、工作量大且乏味;自动化仪器不能检测白细胞形态的变化等缺点。Human blood leukocytes, also known as immune cells, play an important role in the human immune system. In clinical medicine, the changes in the number and morphology of different types of leukocytes can be used to judge the pathological conditions of human body functions. Therefore, the detection of white blood cells is an important indicator of blood routine detection. At present, microscopes and automated hematology analyzers are the main methods for leukocyte detection, but they all have their own disadvantages, such as manual microscopy, which takes a long time, heavy workload, and tedious; automated instruments cannot detect changes in the shape of leukocytes.
随着图像处理和模式识别等领域的不断进步与发展,这些技术可以应用到医学影像中,也可以应用在白细胞的检测。白细胞检测可以分为成边缘检测和椭圆检测两个步骤。椭圆检测的方法大致可以分为两类,一类为投票法,例如,Hough变换法和RANSAC算法等;另一类为优化算法,例如最小二乘拟合、遗产算法、人工蜂群算法等;在目前的实际应用中,最经典的方法是利用Hough变换来检测椭圆形的图像物体,Hough变换方法对于椭圆的部分缺失和噪声不敏感,具有很高的检测精度和鲁棒性,但是由于椭圆有五个自有参数,需要在五维参数空间进行积累,导致这种做法因为计算量和内存需求量过大而不切合实际,所以经典的Hough变换并不合适。而优化算法可以克服这些问题。求解最优化问题的方法可分为经典优化方法和智能优化算法。经典的优化算法包括梯度下降、单纯行法、共轭方向法、牛顿法等。经典优化算法对于一些复杂的、离散的或者多目标的系统很难有理想的优化结果。与经典的优化方法相比,人工蜂群算法对目标函数和约束几乎没有要求,在搜索过程中几乎不利用外部信息,仅以适应度函数作为进化依据,形成了以“生成+检验”为特征的人工智能技术。智能优化算法包括蚁群优化算法、粒子群优化算法、蜂群算法、差分算法等。粒子群算法虽然收敛速度快,但容易陷入局部最优解;差分算法虽然不易陷入局部最优解,但是收敛速度慢。人工蜂群算法具有操作简单、控制参数小、搜索精度高和鲁棒性较强的特点。With the continuous progress and development of image processing and pattern recognition, these technologies can be applied to medical imaging, and can also be applied to the detection of white blood cells. White blood cell detection can be divided into two steps: edge detection and ellipse detection. The methods of ellipse detection can be roughly divided into two categories, one is voting method, such as Hough transform method and RANSAC algorithm, etc.; the other is optimization algorithm, such as least square fitting, legacy algorithm, artificial bee colony algorithm, etc.; In current practical applications, the most classic method is to use the Hough transform to detect elliptical image objects. The Hough transform method is not sensitive to the part missing and noise of the ellipse, and has high detection accuracy and robustness. However, due to the ellipse There are five own parameters, which need to be accumulated in the five-dimensional parameter space, which makes this approach impractical due to the large amount of calculation and memory requirements, so the classic Hough transform is not suitable. The optimization algorithm can overcome these problems. The methods for solving optimization problems can be divided into classical optimization methods and intelligent optimization algorithms. Classical optimization algorithms include gradient descent, simple row method, conjugate direction method, Newton method, etc. Classical optimization algorithms are difficult to achieve ideal optimization results for some complex, discrete or multi-objective systems. Compared with the classic optimization method, the artificial bee colony algorithm has almost no requirements on the objective function and constraints, hardly uses external information in the search process, and only uses the fitness function as the basis for evolution, forming an algorithm characterized by "generation + inspection". artificial intelligence technology. Intelligent optimization algorithms include ant colony optimization algorithm, particle swarm optimization algorithm, bee colony algorithm, difference algorithm, etc. Although the particle swarm optimization algorithm has a fast convergence speed, it is easy to fall into the local optimal solution; the difference algorithm is not easy to fall into the local optimal solution, but the convergence speed is slow. The artificial bee colony algorithm has the characteristics of simple operation, small control parameters, high search precision and strong robustness.
发明内容Contents of the invention
本发明针对以上传统白细胞检测存在问题,提出一种基于人工蜂群算法的白细胞的检测方法,人工蜂群算法既能跳出局部最优解,也能很好地搜索到全局最优解的性能,有效提高了运行的速度与精度。Aiming at the problems existing in the above traditional white blood cell detection, the present invention proposes a white blood cell detection method based on the artificial bee colony algorithm. The artificial bee colony algorithm can not only jump out of the local optimal solution, but also search for the performance of the global optimal solution. Effectively improve the speed and precision of operation.
为实现上述目的,本发明提出的技术方案为基于人工蜂群算法的白细胞的检测方法,包括以下步骤:In order to achieve the above object, the technical solution proposed by the present invention is the detection method of white blood cells based on the artificial bee colony algorithm, comprising the following steps:
步骤1:采用边缘检测处理图像,并且提取所有的边缘像素存储在矢量P中;Step 1: Process the image using edge detection, and extract all edge pixels and store them in the vector P;
步骤2:初始化种群:初始化蜜源xid,设定蜜源总数NP、控制参数limit、最大迭代次数,t=1;Step 2: Initialize the population: initialize the honey source x id , set the total number of honey sources NP, the control parameter limit, the maximum number of iterations, t=1;
步骤3:计算蜜源的适应度值;Step 3: Calculate the fitness value of the honey source;
步骤4:雇佣蜂进行搜索产生新蜜源,计算其适应值并采用贪婪法选择较好的蜜源;Step 4: Hire bees to search for new nectar sources, calculate their fitness value and use greedy method to select better nectar sources;
步骤5:雇佣蜂分享信息,跟随蜂采用轮盘赌原则计算蜜源被选择的概率,同时根据搜索公式在附近精细搜索;Step 5: Hire bees to share information, follow the bees to calculate the probability of the honey source being selected according to the roulette principle, and search nearby according to the search formula;
步骤6:判断是否有食物源连续limit代没有更新,如果有则雇佣蜂变为侦查蜂,侦查蜂搜索产生新蜜源;如果没有则转到步骤8;Step 6: Determine whether there is a continuous limit generation of food sources that has not been updated. If so, the hired bees will become scout bees, and the scout bees will search for new honey sources; if not, go to step 8;
步骤7:记忆最优的蜜源位置;Step 7: memorize the optimal nectar source location;
步骤:8:t=t+1;判断是否达到最大迭代次数,如果达到则终止输出最优解,否则重复步骤3-7;Step: 8: t=t+1; Judging whether to reach the maximum number of iterations, if reached then terminate the output optimal solution, otherwise repeat steps 3-7;
步骤9:白细胞的图像被检测出。Step 9: An image of white blood cells is detected.
进一步,上述步骤1中的边缘检测具体包括提取图片中白细胞细胞核椭圆形的边缘轮廓,然后进行椭圆检测,提取所有的边缘像素存储到矢量P中,P=(P1,P2,…,Pn),n为图像上所有边缘像素的总和。Further, the edge detection in the above step 1 specifically includes extracting the elliptical edge contour of the white blood cell nucleus in the picture, and then performing ellipse detection, extracting all edge pixels and storing them in the vector P, P=(P 1 ,P 2 ,...,P n ), where n is the sum of all edge pixels on the image.
上述步骤2中每一个蜜源的位置都代表着一个可行的解的椭圆,每产生一个新的候选蜜源代表着一种新的候选椭圆,初始化所有蜜源的向量椭圆的基本方程可以表示为:The position of each nectar source in the above step 2 represents an ellipse of a feasible solution, each new candidate nectar source represents a new candidate ellipse, and the vectors of all nectar sources are initialized The basic equation of an ellipse can be expressed as:
ax2+bxy+cy2+dx+ey+1=0ax 2 +bxy+cy 2 +dx+ey+1=0
当五个自由参数a,b,c,d,e,的值满足b2-4ac<0时构成椭圆,所以每一个椭圆都可以由五个自由参数来表示,为了构建椭圆,在矢量P中任意抽出五个边缘像素点pi1,pi2,pi3,pi4,pi5,其中任意三个点都不在一条直线上,相结合都可以构成一个椭圆,所以把每一个蜜源都编码为一个椭圆Xi,当进行椭圆检测时,由矢量P中任意的五个边缘像素点分别构成的五个关于参数的线性方程组,对其求解,若得到的解满足条件,则采用人工蜂群算法对解进行选择优化。An ellipse is formed when the values of the five free parameters a, b, c, d, e satisfy b 2 -4ac<0, so each ellipse can be represented by five free parameters. In order to construct an ellipse, in the vector P Randomly extract five edge pixel points p i1 , p i2 , p i3 , p i4 , p i5 , any three of which are not on a straight line, and can be combined to form an ellipse, so each nectar source is coded as a Ellipse X i , when performing ellipse detection, five linear equations about parameters are composed of any five edge pixels in the vector P, respectively, and solve them. If the obtained solution meets the conditions, the artificial bee colony algorithm is used Select and optimize the solution.
上述步骤2中初始化蜜源的位置为:The position of initializing the honey source in the above step 2 is:
xid=Ld+rand(0,1)(Ud-Ld)x id =L d +rand(0,1)(U d -L d )
式中:Ld与Ud分别表示搜索空间最小值和最大值,d=1,2,…D,D为解的维数,由于向量解由五个参数决定,所以D=5,蜂群的数量、蜜源规模NP和最大迭代次数根据实际情况设置。In the formula: L d and U d represent the minimum value and maximum value of the search space respectively, d=1, 2,...D, D is the dimension of the solution, since the vector solution is determined by five parameters, so D=5, the bee colony The number of nectar source scale NP and the maximum number of iterations are set according to the actual situation.
作为优选,上述对蜂群的数量、蜜源规模和最大迭代次数分别设置为:蜂群总数=60,蜜源规模NP=30,最大迭代次数=50。As a preference, the above-mentioned number of bee colonies, size of honey sources and maximum number of iterations are respectively set as: total number of bee colonies=60, size of honey sources NP=30, maximum number of iterations=50.
上述步骤3中适应度值的计算方法为:The calculation method of the fitness value in the above step 3 is:
fiti为蜜源的适应度值,fi为目标函数的解即椭圆边缘点的匹配程度,候选椭圆像素点的集合可以表示为Xi=(s1,s2,…,sN),N是候选椭圆上存在的所有边缘点的数量,目标函数可以表示为椭圆边缘点的匹配程度为:fit i is the fitness value of the nectar source, fi is the solution of the objective function, that is, the matching degree of the edge points of the ellipse, and the set of candidate ellipse pixel points can be expressed as X i = (s 1 ,s 2 ,…,s N ), N is the number of all edge points existing on the candidate ellipse, and the objective function can be expressed as the matching degree of ellipse edge points:
Xi(s1x,s1y)定义为 X i (s 1x ,s 1y ) is defined as
式中(s1x,s1y)是候选椭圆中像素点集合S中任一像素点的坐标。where (s 1x , s 1y ) is the coordinates of any pixel in the pixel set S in the candidate ellipse.
上述步骤4中雇佣蜂进行搜索产生新蜜源,计算其适应值并采用贪婪法选择较好的蜜源具体包括:在初始化的蜜源附近搜索产生新的蜜源,如下式所示:In the above step 4, employing bees to search for new honey sources, calculating their fitness value and using the greedy method to select a better honey source specifically includes: searching and generating new honey sources near the initialized honey source, as shown in the following formula:
式中:xid为在搜索空间随机产生的蜜源i的位置,d是在[1,D]中的一个随机整数,表示雇佣蜂随机的选择一维进行搜索;j∈{1,2,…,NP},j≠i,xjd表示在NP个蜜源中随机选择一个不等于i的蜜源;是在[-1,1]的范围中均匀分布的随机数,决定扰动幅度,当蜜源vid的适应度优于xid时,采用贪婪选择的方法用vid代替xid,否则保留xid,即产生新的候选椭圆,贪婪原则表示为:In the formula: x id is the position of the nectar source i randomly generated in the search space, d is a random integer in [1,D], which means that the hired bee randomly selects one dimension to search; j∈{1,2,… ,NP}, j≠i, x jd means randomly selecting a honey source not equal to i among NP honey sources; It is a random number evenly distributed in the range of [-1,1], which determines the magnitude of the disturbance. When the fitness of the nectar source v id is better than x id , use the greedy selection method to replace x id with v id , otherwise keep x id , that is to generate a new candidate ellipse, the greedy principle is expressed as:
其中,f(vi)为新产生位置的目标函数值,f(xi)为当前蜜源的目标函数值,当且仅当新产生位置的目标函数值比原蜜源位置的目标函数值小时,更新当前蜜源的位置。Among them, f(v i ) is the objective function value of the newly generated location, f( xi ) is the objective function value of the current honey source, if and only if the objective function value of the newly generated location is smaller than the objective function value of the original honey source location, Update the location of the current honey source.
上述步骤5中每个蜜源被选择的概率公式为:The probability formula for each nectar source to be selected in the above step 5 is:
跟随蜂根据上式所确定的选择概率,根据轮盘赌原则选择蜜源并在其附近进行精细搜索,搜索公式为:According to the selection probability determined by the above formula, the following bee selects the nectar source according to the roulette principle and conducts a fine search near it. The search formula is:
式中:xid为在搜索空间随机产生的蜜源i的位置,d是在[1,D]中的一个随机整数,表示雇佣蜂随机的选择一维进行搜索。In the formula: x id is the position of the nectar source i randomly generated in the search space, d is a random integer in [1, D], which means that the hired bee randomly selects one dimension to search.
上述步骤6中蜜源xid经过阈值limit次迭代而没有找到更好的蜜源,则该蜜源将会被放弃,与之对应的雇佣蜂的角色变为侦查蜂,侦查蜂将在搜索空间随机产生一个新的蜜源代替xid,即更新了候选椭圆,上述过程可表示为:In the above step 6, the nectar source x id has passed the threshold limit iterations and no better nectar source is found, then the nectar source will be abandoned, and the role of the corresponding hired bee becomes a scout bee, and the scout bee will randomly generate a nectar in the search space The new nectar source replaces x id , that is, the candidate ellipse is updated. The above process can be expressed as:
上述步骤7中所述记忆最优的蜜源的位置是根据以上各搜索公式得到最优解即最接近目标椭圆的候选椭圆。The position of the best memorized nectar source in step 7 above is the candidate ellipse that is the closest to the target ellipse to obtain the optimal solution according to the above search formulas.
与现有技术相比,本发明的有益效果在于:Compared with prior art, the beneficial effect of the present invention is:
1,本发明将人工蜂群算法用于白细胞的检测,在保持较好的检测速度的同时,提高了白细胞检测的精度。1. The present invention uses the artificial bee colony algorithm for the detection of white blood cells, which improves the detection accuracy of white blood cells while maintaining a good detection speed.
2,本发明具有检测速度快、检测效果好、算法鲁棒性强的优点,较好地解决了经典的Hough变换内存不足和运算量较大以及粒子群算法容易陷入局部最优解等问题。2. The present invention has the advantages of fast detection speed, good detection effect, and strong algorithm robustness, and better solves the problems of insufficient memory and large calculation amount of the classic Hough transform, and the particle swarm algorithm is easy to fall into a local optimal solution.
3,本发明解决了粒子群算法容易陷入局部最优解以及其他优化算法检测精度不够,检测速度不快等问题。3. The present invention solves the problems that the particle swarm optimization algorithm is easy to fall into a local optimal solution and other optimization algorithms have insufficient detection accuracy and slow detection speed.
附图说明Description of drawings
图1为本发明基于人工蜂群算法的白细胞检测的方法的流程图。FIG. 1 is a flow chart of the method for detecting white blood cells based on the artificial bee colony algorithm of the present invention.
图2为本发明应用于白细胞检测的细胞的参考图像。Fig. 2 is a reference image of cells applied to leukocyte detection in the present invention.
图3为本发明对白细胞参考图像边缘检测后的结果。Fig. 3 is the result of edge detection of the white blood cell reference image according to the present invention.
图4为粒子群算法对白细胞参考图像的检测后果。Figure 4 shows the detection results of the particle swarm optimization algorithm on the white blood cell reference image.
图5为本发明对白细胞参考图像的检测结果。Fig. 5 is the detection result of the white blood cell reference image according to the present invention.
具体实施方式detailed description
为了使发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施案例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施案例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and examples of implementation. It should be understood that the specific implementation cases described here are only used to explain the present invention, and are not intended to limit the present invention.
如图1所示,该方法包括以下步骤:As shown in Figure 1, the method includes the following steps:
步骤1:采用边缘检测处理图像并且提取所有的边缘像素存储在矢量P中Step 1: Process the image with edge detection and extract all edge pixels and store them in vector P
首先对原始图片(如图2所示)进行边缘检测(边缘检测是白细胞检测的首要条件),如图3所示提取图片中白细胞细胞核椭圆形的边缘轮廓,然后进行椭圆检测,把提取所有的边缘像素存储到矢量P中,P=(P1,P2,…,Pn),n为图像上所有边缘像素的总和。First, edge detection is performed on the original picture (as shown in Figure 2) (edge detection is the primary condition for white blood cell detection), as shown in Figure 3, extract the elliptical edge contour of the white blood cell nucleus in the picture, then perform ellipse detection, and extract all The edge pixels are stored in a vector P, where P=(P 1 , P 2 ,...,P n ), and n is the sum of all edge pixels on the image.
步骤2:初始化种群:初始化蜜源xid,设定蜜源总数NP、控制参数limit、最大迭代次数,t=1Step 2: Initialize the population: initialize the nectar source x id , set the total number of nectar sources NP, the control parameter limit, the maximum number of iterations, t=1
每一个蜜源的位置都代表着一个可行的解的椭圆,每产生一个新的候选蜜源代表着一种新的候选椭圆。初始化所有蜜源的向量椭圆的基本方程可以表示为:The position of each nectar source represents a feasible solution ellipse, and each new candidate nectar source represents a new candidate ellipse. Initialize the vector of all honey sources The basic equation of an ellipse can be expressed as:
ax2+bxy+cy2+dx+ey+1=0ax 2 +bxy+cy 2 +dx+ey+1=0
当五个自由参数a,b,c,d,e,的值满足b2-4ac<0时构成椭圆。所以每一个椭圆都可以由五个自由参数来表示,为了构建椭圆(蜜源),在矢量P中任意抽出五个边缘像素点pi1,pi2,pi3,pi4,pi5(其中任意三个点都不在一条直线上)相结合都可以构成到一个椭圆,所以把每一个蜜源都编码为一个椭圆Xi。当进行椭圆检测时,由矢量P中任意的五个边缘像素点分别构成的五个关于参数的线性方程组,对其求解,若得到的解满足条件,则采用人工蜂群算法对解进行选择优化。本发明的目的就是对这些向量进行优化处理,得到最优的解向量。向量初始化候选椭圆(蜜源)的位置:An ellipse is formed when the values of the five free parameters a, b, c, d, e satisfy b 2 -4ac<0. Therefore, each ellipse can be represented by five free parameters. In order to construct an ellipse (honey source), five edge pixel points p i1 , p i2 , p i3 , p i4 , p i5 (any three points are not on a straight line) can form an ellipse, so each honey source is coded as an ellipse X i . When performing ellipse detection, the five linear equations about parameters composed of any five edge pixels in the vector P are solved. If the obtained solution meets the conditions, the artificial bee colony algorithm is used to select the solution. optimization. The purpose of the present invention is to optimize these vectors to obtain the optimal solution vector. The vector initializes the position of the candidate ellipse (honey source):
xid=Ld+rand(0,1)(Ud-Ld)x id =L d +rand(0,1)(U d -L d )
式中:Ld与Ud分别表示搜索空间最小值和最大值,d=1,2,…D。D为解的维数,由于向量解由五个参数决定,所以D=5。蜂群的数量、蜜源规模和最大迭代次数根据实际情况设置,包括设置为蜂群总数=60,蜜源规模NP=30,最大迭代次数=50。In the formula: L d and U d represent the minimum value and maximum value of the search space respectively, d=1, 2,...D. D is the dimension of the solution. Since the vector solution is determined by five parameters, D=5. The number of bee colonies, the size of the nectar source and the maximum number of iterations are set according to the actual situation, including setting the total number of bee colonies = 60, the size of the nectar source NP = 30, and the maximum number of iterations = 50.
步骤3:计算蜜源的适应度值Step 3: Calculate the fitness value of the honey source
适应度值的计算方法为:The calculation method of fitness value is:
fiti为蜜源的适应度值,fi为目标函数的解即椭圆边缘点的匹配程度。本发明把优化得到的候选椭圆上与矢量P中重合的边缘点的数量和矢量P中所有的边缘点的数量比叫做椭圆边缘点的匹配程度。优化是指从所有的可行解中得到最优候选椭圆(目标椭圆)。如果目标椭圆真实存在,为了计算椭圆边缘点的匹配程度,我们应该先计算实际得到的候选椭圆的边缘像素点的坐标。候选椭圆像素点的集合可以表示为Xi=(s1,s2,…,sN),N是候选椭圆上存在的所有边缘点的数量。目标函数可以表示为椭圆边缘点的匹配程度为:fit i is the fitness value of the nectar source, and fi is the solution of the objective function , that is, the matching degree of the edge points of the ellipse. In the present invention, the ratio of the number of edge points on the optimized candidate ellipse coincident with the vector P to the number of all edge points in the vector P is called the matching degree of the ellipse edge points. Optimization refers to obtaining the best candidate ellipse (target ellipse) from all feasible solutions. If the target ellipse really exists, in order to calculate the matching degree of the edge points of the ellipse, we should first calculate the coordinates of the edge pixel points of the actually obtained candidate ellipse. The set of candidate ellipse pixel points can be expressed as X i =(s 1 , s 2 ,...,s N ), where N is the number of all edge points existing on the candidate ellipse. The objective function can be expressed as the matching degree of ellipse edge points as:
Xi(s1x,s1y)定义为 X i (s 1x ,s 1y ) is defined as
式中(s1x,s1y)是候选椭圆中像素点集合S中任一像素点的坐标。本发明的椭圆检测的方法是属于最大值的问题,目的是使fi的值最大。根据适应度计算函数fiti,为了得到最大解,贪婪选择法选择适应度较小的蜜源,因此搜索找到新的蜜源vid之后,根据适应度值的大小,在vid与xid之间利用贪婪选择法选择适应度值较小的蜜源,产生新的蜜源(候选椭圆)。where (s 1x , s 1y ) is the coordinates of any pixel in the pixel set S in the candidate ellipse. The ellipse detection method of the present invention belongs to the problem of maximum value, and the purpose is to maximize the value of fi. According to the fitness calculation function fit i , in order to obtain the maximum solution, the greedy selection method selects the nectar source with a small fitness, so after searching and finding a new nectar source v id , according to the size of the fitness value, use between v id and x id The greedy selection method selects the nectar source with a smaller fitness value to generate a new nectar source (candidate ellipse).
步骤4:雇佣蜂进行搜索产生新蜜源,计算其适应值并采用贪婪法选择较好的蜜源Step 4: Hire bees to search for new nectar sources, calculate their fitness value and use greedy method to select better nectar sources
在初始化的蜜源(候选椭圆)附近搜索产生新的蜜源(新的候选椭圆)公式:Searching around the initialized honey source (candidate ellipse) generates a new honey source (new candidate ellipse) formula:
式中:xid为在搜索空间随机产生的蜜源i的位置,d是在[1,D]中的一个随机整数,表示雇佣蜂随机的选择一维进行搜索;j∈{1,2,…,NP},j≠i,xjd表示在NP个蜜源中随机选择一个不等于i的蜜源;是在[-1,1]的范围中均匀分布的随机数,决定扰动幅度。当蜜源vid的适应度优于xid时,采用贪婪选择的方法用vid代替xid,否则保留xid,即产生新的候选椭圆。贪婪原则表示为:In the formula: x id is the position of the nectar source i randomly generated in the search space, d is a random integer in [1,D], which means that the hired bee randomly selects one dimension to search; j∈{1,2,… ,NP}, j≠i, x jd means randomly selecting a honey source not equal to i among NP honey sources; Is a uniformly distributed random number in the range of [-1,1], which determines the magnitude of the disturbance. When the fitness of the nectar source v id is better than x id , use greedy selection method to replace x id with v id , otherwise keep x id , that is, generate a new candidate ellipse. The greedy principle is expressed as:
其中,f(vi)为新产生位置的目标函数值,f(xi)为当前蜜源的目标函数值,当且仅当新产生位置的目标函数值比原蜜源位置的目标函数值小时,更新当前蜜源的位置。Among them, f(v i ) is the objective function value of the newly generated location, f( xi ) is the objective function value of the current honey source, if and only if the objective function value of the newly generated location is smaller than the objective function value of the original honey source location, Update the location of the current honey source.
步骤5:雇佣蜂分享信息,跟随蜂采用轮盘赌原则计算蜜源被选择的概率,同时根据搜索公式在附近精细搜索每个蜜源被选中的概率公式为:Step 5: Hire bees to share information, and follow the bees to calculate the probability of the nectar source being selected by using the roulette wheel principle, and at the same time search for each nectar source in the vicinity according to the search formula. The probability formula for each nectar source is:
跟随蜂根据上市所确定的选择概率,根据轮盘赌原则选择蜜源并在其附近进行精细搜索,搜索公式为:According to the selection probability determined by the listing, the following bee selects the nectar source according to the roulette wheel principle and conducts a fine search near it. The search formula is:
式中:xid为在搜索空间随机产生的蜜源i的位置,d是在[1,D]中的一个随机整数,表示雇佣蜂随机的选择一维进行搜索。In the formula: x id is the position of the nectar source i randomly generated in the search space, d is a random integer in [1, D], which means that the hired bee randomly selects one dimension to search.
步骤6:判断是否有食物源连续limit代没有更新,如果有则雇佣蜂变为侦查蜂,侦查蜂搜索产生新蜜源如果没有则转步骤8Step 6: Determine whether there is a continuous limit generation of food sources that has not been updated. If so, the hired bees will become scout bees. The scout bees search for new honey sources. If not, go to step 8
蜜源xid经过trial次迭代搜索到达阈值limit而没有找到更好的蜜源,则该蜜源xid将会被放弃,与之对应的雇佣蜂的角色变为侦查蜂。侦查蜂将在搜索空间随机产生一个新的蜜源代替xid,即更新了候选椭圆。上述过程可表示为:When the nectar source x id reaches the threshold limit after trial times of iterative search and no better nectar source is found, the nectar source x id will be abandoned, and the corresponding hired bees will become scout bees. The scout bees will randomly generate a new honey source in the search space to replace x id , that is, the candidate ellipse is updated. The above process can be expressed as:
步骤7:记忆最好的蜜源位置Step 7: Memorize the location of the best honey source
记忆最优的蜜源的位置,根据以上各搜索得带公式得到最优解即最接近目标椭圆的候选椭圆。Memorize the position of the optimal nectar source, and get the optimal solution, that is, the candidate ellipse closest to the target ellipse, according to the above search band formulas.
步骤:8:t=t+1;判断是否达到最大迭代次数,如果达到则终止输出最优解,否则重复步骤3-7Step: 8: t=t+1; judge whether to reach the maximum number of iterations, if reached then terminate the output optimal solution, otherwise repeat steps 3-7
根据步骤2已设定的迭代算法,判定迭代次数是否达到:若达到迭代次数max=50,则停止迭代,得到最优蜜源的位置和目标函数值,该蜜源的位置对应的是目标椭圆。若没有达到迭代次数则重复步骤3-7,直至达到步骤2所设定的最大迭代次数。According to the iterative algorithm set in step 2, determine whether the number of iterations has reached: if the number of iterations reaches max=50, then stop the iteration, and obtain the position of the optimal honey source and the value of the objective function. The position of the honey source corresponds to the target ellipse. If the number of iterations is not reached, repeat steps 3-7 until the maximum number of iterations set in step 2 is reached.
步骤9:椭圆的图像被检测出Step 9: The image of the ellipse is detected
目标函数越高说明椭圆匹配程度越高,越接近目标椭圆,检测白细胞的结果越正确。如图4和图5作比较,很明显图5的检测结果更理想。The higher the objective function is, the higher the matching degree of the ellipse is, and the closer to the target ellipse, the more correct the white blood cell detection result is. Comparing Figure 4 with Figure 5, it is obvious that the detection result in Figure 5 is more ideal.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710169481.2A CN107045717A (en) | 2017-03-21 | 2017-03-21 | The detection method of leucocyte based on artificial bee colony algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710169481.2A CN107045717A (en) | 2017-03-21 | 2017-03-21 | The detection method of leucocyte based on artificial bee colony algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107045717A true CN107045717A (en) | 2017-08-15 |
Family
ID=59545601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710169481.2A Pending CN107045717A (en) | 2017-03-21 | 2017-03-21 | The detection method of leucocyte based on artificial bee colony algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107045717A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108513234A (en) * | 2018-03-14 | 2018-09-07 | 南京邮电大学 | Based on the loud speaker volume optimization method for improving artificial bee colony algorithm |
CN109002923A (en) * | 2018-07-23 | 2018-12-14 | 宁波大学 | A kind of intercity multimode travel route planing method |
CN109919963A (en) * | 2019-03-14 | 2019-06-21 | 吉林大学 | A method for detecting the location of car paint defects |
CN111276981A (en) * | 2020-05-08 | 2020-06-12 | 广东电网有限责任公司佛山供电局 | Voltage sag comprehensive treatment method for power grid side |
CN111985705A (en) * | 2020-08-13 | 2020-11-24 | 复旦大学 | Multipoint position shortest path calculation method |
CN112202538A (en) * | 2020-09-21 | 2021-01-08 | 齐齐哈尔大学 | Artificial bee colony OFDMA resource allocation method for guaranteeing fairness threshold value |
CN113066096A (en) * | 2021-04-06 | 2021-07-02 | 长沙证通云计算有限公司 | Edge detection method and system based on improved ant colony clustering algorithm |
CN113208569A (en) * | 2020-01-21 | 2021-08-06 | 复旦大学 | Pulse wave curve fitting method based on group algorithm |
CN114078174A (en) * | 2020-08-11 | 2022-02-22 | 复旦大学 | Pulse wave curve fitting method based on improved ABC algorithm |
CN119784816A (en) * | 2025-03-07 | 2025-04-08 | 四川思极科技有限公司 | UAV wildfire wide-area monitoring method and system based on transmission space geographic mapping |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101894273A (en) * | 2010-05-26 | 2010-11-24 | 北京航空航天大学 | A UAV Target Recognition Method Based on Artificial Bee Colony Optimization Edge Potential Field Function |
CN104835151A (en) * | 2015-04-24 | 2015-08-12 | 南京邮电大学 | Improved artificial bee colony algorithm-based image registration method |
CN105956706A (en) * | 2016-05-09 | 2016-09-21 | 苏州泛能电力科技有限公司 | Distribution network reactive power optimization method based on improved artificial bee colony algorithm |
-
2017
- 2017-03-21 CN CN201710169481.2A patent/CN107045717A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101894273A (en) * | 2010-05-26 | 2010-11-24 | 北京航空航天大学 | A UAV Target Recognition Method Based on Artificial Bee Colony Optimization Edge Potential Field Function |
CN104835151A (en) * | 2015-04-24 | 2015-08-12 | 南京邮电大学 | Improved artificial bee colony algorithm-based image registration method |
CN105956706A (en) * | 2016-05-09 | 2016-09-21 | 苏州泛能电力科技有限公司 | Distribution network reactive power optimization method based on improved artificial bee colony algorithm |
Non-Patent Citations (3)
Title |
---|
APRINALDI 等: "ArcPSO: Ellipse Detection Method using Particle Swarm Optimization andArc Combination", 《ICACSIS 2014》 * |
ERIK CUEVAS 等: "Multi-circle detection on images using artificial bee colony (ABC) optimization", 《SOFT COMPUTING》 * |
陈阿慧 等: "人工蜂群算法综述", 《智能计算机与应用》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108513234A (en) * | 2018-03-14 | 2018-09-07 | 南京邮电大学 | Based on the loud speaker volume optimization method for improving artificial bee colony algorithm |
CN108513234B (en) * | 2018-03-14 | 2020-03-20 | 南京邮电大学 | Loudspeaker volume optimization method based on improved artificial bee colony algorithm |
CN109002923A (en) * | 2018-07-23 | 2018-12-14 | 宁波大学 | A kind of intercity multimode travel route planing method |
CN109919963A (en) * | 2019-03-14 | 2019-06-21 | 吉林大学 | A method for detecting the location of car paint defects |
CN113208569A (en) * | 2020-01-21 | 2021-08-06 | 复旦大学 | Pulse wave curve fitting method based on group algorithm |
CN113208569B (en) * | 2020-01-21 | 2022-06-10 | 复旦大学 | Pulse wave curve fitting method based on group algorithm |
CN111276981B (en) * | 2020-05-08 | 2020-09-25 | 广东电网有限责任公司佛山供电局 | Voltage sag comprehensive treatment method for power grid side |
CN111276981A (en) * | 2020-05-08 | 2020-06-12 | 广东电网有限责任公司佛山供电局 | Voltage sag comprehensive treatment method for power grid side |
CN114078174A (en) * | 2020-08-11 | 2022-02-22 | 复旦大学 | Pulse wave curve fitting method based on improved ABC algorithm |
CN111985705A (en) * | 2020-08-13 | 2020-11-24 | 复旦大学 | Multipoint position shortest path calculation method |
CN111985705B (en) * | 2020-08-13 | 2024-06-28 | 复旦大学 | A method for calculating the shortest path of multiple points |
CN112202538A (en) * | 2020-09-21 | 2021-01-08 | 齐齐哈尔大学 | Artificial bee colony OFDMA resource allocation method for guaranteeing fairness threshold value |
CN112202538B (en) * | 2020-09-21 | 2023-08-22 | 齐齐哈尔大学 | An Artificial Bee Colony OFDMA Resource Allocation Method with Guaranteed Fairness Threshold |
CN113066096A (en) * | 2021-04-06 | 2021-07-02 | 长沙证通云计算有限公司 | Edge detection method and system based on improved ant colony clustering algorithm |
CN119784816A (en) * | 2025-03-07 | 2025-04-08 | 四川思极科技有限公司 | UAV wildfire wide-area monitoring method and system based on transmission space geographic mapping |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107045717A (en) | The detection method of leucocyte based on artificial bee colony algorithm | |
JP6672371B2 (en) | Method and apparatus for learning a classifier | |
Aldoma et al. | A global hypotheses verification method for 3d object recognition | |
GB2581758A (en) | Human hair style generation method based on multi-feature search and deformation | |
CN107633226B (en) | Human body motion tracking feature processing method | |
Ghesu et al. | Marginal space deep learning: Efficient architecture for detection in volumetric image data | |
CN104835151A (en) | Improved artificial bee colony algorithm-based image registration method | |
Dong et al. | An improved YOLOv5 network for lung nodule detection | |
CN109671055B (en) | Pulmonary nodule detection method and device | |
WO2024028616A1 (en) | Image segmentation | |
CN111242971A (en) | A Target Tracking Method Based on Improved Double Center Particle Swarm Optimization Algorithm | |
Zhou et al. | Model uncertainty guides visual object tracking | |
CN105956581B (en) | A Fast Initialization Method of Facial Feature Points | |
CN110298399B (en) | Fault Diagnosis Method of Pumping Well Based on Freeman Chain Code and Moment Feature Fusion | |
CN111127532A (en) | Medical image deformation registration method and system based on deep learning characteristic optical flow | |
CN119580985A (en) | Robot-assisted wound treatment method and system based on multimodal image analysis | |
Fu et al. | An efficient method of white blood cells detection based on artificial bee colony algorithm | |
CN116630867B (en) | Mask R-CNN-based leucorrhea trichomonas detection and tracking method | |
Gholamalinejad et al. | Whitened gradient descent, a new updating method for optimizers in deep neural networks | |
Bai et al. | A unified deep learning model for protein structure prediction | |
Zheng et al. | Improvement of grayscale image segmentation based on PSO algorithm | |
Tong et al. | A joint multi-scale convolutional network for fully automatic segmentation of the left ventricle | |
Kostrykin et al. | Segmentation of cell nuclei using intensity-based model fitting and sequential convex programming | |
Jiang et al. | Superpixel segmentation based gradient maps on RGB-D dataset | |
Wu et al. | Real-time visual tracking via incremental covariance model update on Log-Euclidean Riemannian manifold |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170815 |