Skip to main content
. 2021 Apr 18;21(8):2855. doi: 10.3390/s21082855
Algorithm 1. PSO for breast mass bounding box refinement.
 Input:
Number of particles, maximum iteration number, classification model of breast mass based
on CNN: Prediction_Model, rough bounding box of breast mass X(x,y,w,h)
 Output:
bestX
  for i=1 to number of particles do
    Xi=X
    Vi=[0,0,0,0]
    pbesti=Prediction_Model(Xi)
  if gbest<pbesti then
    gbest=pbesti
  bestx=X
  for p=1 to Maximum iteration number do
    for i=1 to Number of particles do
        1. Update Vi
        Vi=Vi(1)+cp×rand()×pbestiXi(1))+cg×rand()×(gbestXi(1))
        2. Update Xi
        Xi=Xi(1)+Vi
        3. Get fitness from Xi by Prediction_Model
        fitness=Prediction_Model(Xi)
        4. Update pbesti
        if pbesti<fitness then
           pbesti=fitness
        5. Update tbest and bestx
        for j=1 to number of particles do
           if gbest<pbestj then
               gbest=pbestj
               bestx=Xi