I A E S  I n t e r n at io n al  Jou r n al  of  A r t if ic ia l  I n t e ll ig e n c e  ( I J - AI )   V ol . 14, No. 5, O c to be r  2025 , pp.  4279 ~ 4289   I S S N :  2252 - 8938 ,   D O I :  10.11591/ ij a i. v 14 .i 5 .pp 4279 - 4289          4279     Jou r n al  h om e page :  ht tp : // ij ai . ia e s c or e .c om   A u t om at e d   vi al  d e f e c t  i n sp e c t i on  u si n g  G ab or   w ave l e t s  an d     k - m e an s  c l u st e r i n g       V is h w an at h a C . R . 1 ,  V .  A s h a 2 , C h an n ab as ava 1 , S r e e k an t h   R al la p al li 1   1 D e pa r t m e nt   of   M a s t e r  of   C om put e r  A ppl i c a t i ons ,  N i t t e   M e e na ks hi  I ns t i t ut e  of   T e c hnol ogy,  N i t t e  ( D e e m e d t o be  U ni ve r s i t y) ,  B e nga l ur u, I ndi a   2 D e pa r t m e nt   of   M a s t e r  of   C om put e r  A ppl i c a t i ons , N e w  H or i z on C ol l e g e  of  E ngi ne e r i ng, B e nga l ur u, I ndi a       A r t ic le  I n f o     A B S T R A C T   A r ti c le  h is to r y :   R e c e iv e d  O c t  10, 2024   R e vi s e d  J ul  1, 2025   A c c e pt e d  J ul  13, 2025       This  study  proposes  a  machine  vision - based  defect  inspection  system  for  pharmaceutical  vials,  aiming  to  ensure  the  quality  and  safety  of  me dicinal  fluids.  The  system  employs  a   series  of  image   processing  tech niques,  including  denoising,  feature   extractio n  using  the   Gabor  wavelet  tran sform,  segmentation,  clustering  with   the  K - means   algorithm,  and   precise   defect  identifica tion  using  the  Canny  edge  operator.   Experimental  results  demonstrate high performance , with recall, precision, accur acy, and F1 - score  exceeding  98%.  Additi onally,   the  proposed  method  achieves   area  un der  the  curve - receiver - operating  characteristic  curve  ( AUC - ROC )   and   AUC - precision - recall  ( PR )   values  of  approximately  98%.  The  system' s  a verage  computat ional t ime is  355 mi croseconds,  indicat ing it s potent ial for real - time  defect  detection.  Overall,  this  approach  offers  an  effective  solution  for  identifying  various  cosmetic  defects  such  as  scratche s,  bruises,  cracks,   and  black  spots,  in  pharmaceutical  vials   without  the  need   for  vial  clas sif ication  training.     K e y w o r d s :   G a bor  w a ve le ts   K - m e a ns  c lu s te r in g   M a c hi ne  vi s io n   S e gm e nt a ti on   V ia l  de f e c t   This is an  open  acce ss artic le unde r the  CC BY - SA   license.     C or r e s pon di n g A u th or :   V .  A s ha   D e pa r tm e nt   of   M a s te r  of   C om put e r  A ppl ic a ti ons , N e w  H or iz on C ol le ge  of  E ngi ne e r in g   B e nga lu r u - 560103, Ka r na ta ka , I ndi a   E m a il :  a s ha .gur uda th @ gm a il .c om       1.   I N T R O D U C T I O N   S a f e ,  hi gh - qua li ty   vi a ls   a r e   vi ta l  f or   m a in ta in in g  s te r il e   c ondi ti ons   a nd  pr e s e r vi ng  m e di c in e   in te gr it y  in   pha r m a c e ut ic a ls .  T he y  s hi e ld   f lu id s   f r om   c ont a m in a ti on,  l e a ks ,  a nd   de gr a da ti on.  A dva n c e d  in s p e c ti on  m e th ods   li ke   m a c hi ne   vi s io n,  opt ic a l  in s pe c ti on,  a nd  a ut om a te d  de f e c t  de te c ti on  e ns ur e   c om pl ia nc e   w it h  qua li ty   s ta nda r ds   li ke   good  m a nuf a c tu r in g  pr a c ti c e s   ( G M P )   a nd  good  la bor a to r y  pr a c ti c e s   ( G L P ) .  B y   le ve r a gi ng  te c hnol ogy,  th e s e   m e th ods   d e te c t  s ubt le   de f e c ts ,   e na bl in g  c or r e c ti ve   a c ti on s   a nd  pr e ve nt in g   de f e c ti ve   vi a ls   f r om   e nt e r in g  th e   m a r ke t.   E vol vi ng  qua li ty   a s s ur a nc e   ( QA )   pr ot oc ol s   a nd  te c hnol ogy   in te gr a ti on,  pa r ti c ul a r ly   m a c hi ne   le a r ni ng  ( ML )   w it h  c om put e r   vi s io n  ( CV ) ,  e nha nc e   pha r m a c e ut ic a l  c ont a in e r   r e li a bi li ty   a nd  s a f e ty   by  id e nt if yi ng  is s ue s   li ke  c r a c ks ,  bl a c k  s pot s , s c r a tc he s ,  a nd  bubble s .  F ig ur e   1   s how s  a  t ypi c a l  vi a l  us e d i n  pha r m a c e ut ic a l   pa c ki ng.             F ig ur e  1. C om m onl y us e d  pha r m a c e ut ic a l   vi a l   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I S S N :   2252 - 8938   I nt  J  A r ti f   I nt e ll ,  V ol . 14, No. 5, O c to be r  2025 :  4279 - 4289   4280   V a r io u s  m e th o dol ogi e s  ha ve  be e n   a ppl ie d  to   d e t e c t  f l a w s   i n  g la s s   v ia ls   a nd bot tl e s . T h e   l ow - a n gl e   a nd   la r g e   di v e r ge nc e   a n gl e  ( L A L D A )   vi s i on  s ys te m   [ 1]   e nh a n c e s  ph a r m a c e ut i c a l  b ot t le  c a p  i n s p e c ti on  by  im pr ov in g   de f e c t  c o nt r a s t  a nd   m i ti g a t in g   o ve r e x po s ur e ,   a ddr e s s in g  o c c lu s i on s   a nd   in c on s i s t e nt   il lu m in a ti on .  u s i ng   H S V - ba s e d   m u lt i - c h a n ne l   s e g m e nt a ti on   ( M C S ) ,   it   a c hi e v e s   ov e r   9 5 %   a c c ur a c y.   X - r a y - b a s e d   in s pe c ti on   s y s t e m   [ 2]   de t e c t s   n on - m e t a ll ic   c o nt a m i na nt s   b ut   r e li e s   on  c o s tl y  de f e c ti ve   s a m pl e s .  T hi s   s tu dy  a c hi e v e s   97 .4%   a c c u r a c y   f or   gl a s s   f r a gm e nt s ,  im pr o vi n g  s e ns it i vi t y  to   1. 0  a nd  F 1 - s c or e   t o  0. 980 .  H e u r i s ti c   s e gm e nt a t io n   f or   vi a l  d e f e c t  de t e c ti on   [ 3]   s h ow e d   h ig h   a c c ur a c y   b ut   r e qui r e d  va li d a t io n   o n   la r g e r   d a t a s e ts .   F a r ha ng i  e t   a l .  [ 4]   pr op os e d   a   th r e s hol di n g - b a s e d  s ys te m   f or   de te c t in g   c a p  de f e c t s ,   s e a l   in te gr i ty ,   a nd   li qui d  le ve l  v a r ia t io ns   i n  e d ib l e   oi l   a nd   be v e r a g e   bo tt l e s ,   a c h ie vi n g   95 .6%   a c c ur a c y   u s i ng   a   c om pl e m e n ta r y  m e ta l  oxi de   s e m i c o ndu c t or   ( C M O S )   c a m e r a .   H o w e v e r , w or n  l a b e l s  a n d w e a k s e a l s   p o s e  c h a l le ng e s . L iu   e t  a l .  [ 5]   a c hi e v e d m or e   t ha n  9 8%  a c c u r a c y   in   d e te c t in g  vi a l   d e f e c t s ,   bu t  f a c e d   c ha ll e ng e s   in   a d a p ti n g  to   d if f e r e n t  li g ht i ng   c on di t io n s .  T he   bl a c k  to p - h a t   tr a n s f or m   a lg or it h m   [ 6]   c o m bi ne d  w it h  hybr id   im a g e   pr o c e s s i ng  a d dr e s s e d   lo c a li z a ti on  i s s ue s   b ut   ha d  hi g h  c om put a t io n a l  c os ts ,  i m p a c ti n g  r e a l - ti m e   d e pl o ym e nt .  O th e r   a pp r oa c h e s ,  s u c h   a s   C a nn y  e dg e   d e t e c ti on  [ 7]   a nd   c lu s t e r i ng   m e th od s   [ 8] ,   p e r f or m e d  w e ll   bu t  s tr ug gl e d  w i th   s pe c i f ic   d e f e c t s ,   w hi l e   a dv a n c e d  m ul t iv i e w   s y s t e m s   [ 9]   e n c o un te r e d   s e gm e n ta ti o n  c ha l le ng e s   du e   to   un e v e n   l ig h ti n g .  P la s t ic   bot tl e   de f e c t   d e t e c ti o n   [ 10 ]   pr e s e n te d  c h a ll e n ge s   w it h  d a t a   a nd  c o m p ut a ti o na l  n e e d s ,  w hi le   z o n a l  a nd   ti m e - s h a r in g  c om put a ti on a l  im a gi ng  ( Z T S C I )   te c hn iq u e s   [ 11]   l a i d  a   f ou nd a ti on   f or   gr a y   im a g e   f l a w   d e t e c ti o n.  C o nv ol u ti o na l  ne ur a l  ne two r k s   ( C N N s )   a nd   de e p   l e a r ni ng   m o de l s   [ 12] ,  [ 13]   i m pr ov e d   d e t e c ti o n   c a p a b il i ti e s   on   l a r ge   d a t a s e t s ,   w hi l e   f i e ld - pr o gr a m m a bl e   ga t e   a r r a y  ( F P G A ) - ba s e d  s y s t e m s   [ 14]   a c c e l e r a t e d  bot tl e   c a p i n s p e c ti o n,  th oug h  s t il l  f a c e d  s e r v e r   s tr a in .     X u  e t  al .  [ 15]   pr opos e d  a   de f e c t  de te c ti on  s ys te m   f or   f il le d  vi a ls   th a t  in te gr a te s   tr a di ti ona l  im a ge   pr oc e s s in g  a nd  de e p  le a r ni ng.  D e f e c t  de te c ti on  of   s ur f a c e   a nd  c ont e nt s   in   vi a ls   ( D D S C N e t ) ,  bui lt   on   Y O L O v8  w it h  qua dr a   f us io n  a nd  a tt e nt io n  ( Q U F U A tt )   f or   f e a tu r e   f us io n,  A C m ix   f or   de f e c t  f oc us ,  a nd     li ne a r   de f or m a bl e   c onvolut io n   f or   w e a k  f e a tu r e   e xt r a c ti on,   a c hi e ve s   76.7%   m A P   on   V ia lG 1_D E T ,  65.9%   o n   V ia lG 2_D E T ,  a nd  86.9%   on   V ia lG 3_D E T   w it h  9.3  G F L O P S ,  out pe r f or m in g  Y O L O v11  by  3.5% .     Y O L O - ba s e d  m ode ls   [ 16] – [ 22]   de m ons tr a te d  e f f ic ie nt   de f e c t  de te c ti on  a c r os s   di f f e r e nt   s ur f a c e s ,  but   s om e   s tr uggl e d  w it h  s m a ll   ta r ge ts   or   hi gh  c om put a ti ona l  c os ts .  L a s tl y,  m e th ods   us in g  r obot ic   te c hnol ogi e s   a nd  A I   [ 23] ,  [ 24 ]   e nha nc e d  in s pe c ti on  a c c ur a c y,  th ough  c ha ll e nge s   w i th   s e ns or   c a li br a ti on  a nd  s c a la bi li ty   pe r s is te d.   T he   pr opos e d  s tu dy  a ddr e s s e s   th e s e   ga ps   by  a im in g  f or   c om pr e he ns iv e   de f e c t  de te c ti on  a c r o s s   th e   e nt ir e   vi a l  s ur f a c e ,  e nha n c in g  r e li a bi li ty   w it hout   r e ly in g  on   c om pl e x  de e p  le a r ni ng  a r c hi te c tu r e s .   T h e   c ur a te d   da ta s e t  ta il or e d f or  vi a l  de f e c t  in s pe c ti on ove r c om e s  l im it a ti ons  s e e n i n  e xi s ti ng me th ods .   T he   m ot iv a ti on  f or   us in g  G a bor   w a ve le t s   is   th e ir   a bi li ty   to   d e te c t  vi a l  de f e c ts   vi a   m a c hi ne   vi s io n  w it hout   hum a n  in te r ve nt io n  [ 25] .  I n  th is   s tu dy,  G a bor   w a ve le ts   de noi s e   a nd   e xt r a c t  vi a l  im a ge   f e a tu r e s ,   w hi c h a r e  t he n s e gm e nt e d by the  K - m e a ns  c lu s te r in g a lg or it hm  ba s e d on f e a tu r e  s im il a r it ie s . T he  C a nny  e dge   ope r a to r   hi ghl ig ht s   de f e c ts   a c r os s   th e   vi a l' s   s ur f a c e ,  n e c k,  to p, a nd  bot to m   w it h  hi gh  pr e c is io n.  P yt hon,  a lo ng   w it h  th e   s c ik it   im a ge   li br a r y,  is   us e d  f or   im pl e m e nt a ti on.  K e y  f e a tu r e s   of   th e   m e th od  in c lu de   it s   a ppl ic a bi li ty   to   a ny  de f e c t  in   a ny  vi a l  r e gi on,  m a ki ng  it   hi ghl y  ve r s a ti le .  I t  doe s   not   r e qui r e   a   tr a in in g  s ta ge   or   de f e c t - f r e e   s a m pl e s ,  th e r e by  e li m in a ti ng  th e   ne e d  f or   th r e s hol di ng.  T he   de f e c t  de te c ti on  pr oc e s s   is   f ul ly   a ut om a te d   th r ough  K - m e a ns   c lu s te r in g,  a ll ow in g  f or   th e   s pe c if ic   d e te c ti on   of   va r io us   de f e c ts  s uc h  a s   s c r a tc h e s ,  bubble s ,  a nd c r a c ks , r a th e r  t ha n m e r e ly  c a t e gor iz in g vi a ls .    T he   pa p e r   is   or ga ni z e d   in   th e   f ol lo w in g  w a y:   s e c ti on  2   br ie f ly   e xpl a in s   th e   pr opo s e d  m ode l   f or   de f e c t  de te c ti on   us in g  G a bor   w a ve le t s   a nd   K - m e a ns   c lu s t e r in g.  S e c ti on  3  pr e s e nt s   e xpe r im e nt   on   va r io us   r e a l   de f e c ti ve  vi a l  im a ge s .  T he  c onc lu s io ns  a r e  di s c us s e d i n  s e c ti on  4.       2.   M E T H O D   M a c hi ne   vi s io n  is   us e d  in   pl a c e   of   hum a n  vi s io n  to   de te c t  de f e c ts   us in g  c om put e r   a lg or it hm s   a nd   pr oc e s s or s .   T he   pr opos e d   m a c hi ne   vi s io n  s y s te m   c om pr is e s   f our   s te ps .  F ir s t,   a n  im a ge   is   a c qui r e d  u s in g  a   hi gh - r e s ol ut io n  in dus tr ia l  c a m e r a .  I n  th e   s e c ond  s te p,  th e   im a ge   unde r goe s   pr e pr oc e s s in g,  w he r e   it   is     de - noi s e d, a nd f e a tu r e s  s u c h a s   e ne r gy, c ont r a s t,  a nd va r ia nc e  i n m ul ti pl e  or ie nt a ti ons  a nd s c a le s   a r e  e xt r a c te d   us in g  th e   G a bor   w a ve le t  tr a ns f or m .  T he   th ir d  s te p  in vol ve s   c lu s te r in g  a nd  s e gm e nt a ti on  of   th e   e xt r a c te d  f e a tu r e s   to   hi ghl ig ht   de f e c ts .  F in a ll y,  a   de c is io n  is   m a de   ba s e d   on  th e   s e gm e nt e d  out put .  F ig ur e   2  s how s   th e   bl oc k di a gr a m  of  t he s e  s te p s .       2.1.  Gab or  w ave le t s   T he   G a bor   w a ve le t  is   a  m a th e m a ti c a l  f unc ti on  us e d  to   a na ly z e   im a ge s   in   bot h  s pa ti a l  a nd  f r e que nc y   dom a in s ,  f il te r in g  im a ge s   vi a   r e a l  pa r ts   to   e xt r a c t  pa tt e r ns   [ 26] .  I n  vi a l  de f e c t  de te c ti on,  G a bor   w a ve le ts   a r e   a ppl ie d  to   vi a l  im a ge s   f or   f e a tu r e   e xt r a c ti on.  T he   f il te r   s c a ns   pi xe l  va lu e s   in   a ll   di r e c ti ons ,  id e nt if yi ng  e dge   da ta   poi nt s   by  de te c ti ng  m a xi m um   va lu e s   in   gr a di e nt   in te ns it y  m a tr ix ,  e na bl in g  pa tt e r n  id e nt if ic a ti on  a nd   de f e c t  de te c ti on.   Evaluation Warning : The document was created with Spire.PDF for Python.
I nt  J  A r ti f   I nt e ll     I S S N :   2252 - 8938       A ut om at e d v ia l  de fe c t  in s pe c ti on us in g  G abo r  w av e l e ts  and  k - m e ans  c lu s te r in g   ( V is hw anat ha C . R .)   4281   F iv e   f a c to r s   c a n  a f f e c t  f il te r in g  w he n  u s in g  G a bor   w a ve le ts .  T o  c om pr e he nd  th is ,   c ons id e r   a   s in e   w a ve   ove r la id   on  a   two - di m e ns io na l  G a us s ia n  b e ll   c ur ve .  S in c e   it ' s   a   two - di m e ns io n a l  be ll   c ur ve ,  th e   s in e   w a ve  i s  di r e c ti ona l  a nd c a n pos s e s s  va r io us  or ie nt a ti ons , t hus  i n f lu e nc in g t he  f il te r  w it h t he  f ol lo w in g  f a c to r s :   i)   D ir e c ti on   ( θ ) :  it  i ndi c a te s  t he  di r e c ti on of  t he  s in e  w a ve     ii)   O f f s e t   ( φ) :  in di c a te s  t he  pha s e  of f s e t  of  t he  s in e   w a ve   iii)   S ta nda r d de vi a ti on   ( σ ) :  th e  s m a ll e r  t he  va lu e s  of  t hi s  a tt r ib ut e , t he  c lo s e r  t he  va lu e s  a r e  t o t he  c e nt e r   iv )   E ll ip ti c it y   ( γ ) :  de te r m in e s  t he  e ll ip ti c it y of  t he  2D  i m a ge     v)   W a ve le ngt h   ( λ ) :  in di c a te s  t he  di s ta nc e  be twe e n t he  hi gh e s t  poi n ts   T he   w a ve le t s   a r e   a ppl ie d  a t  di f f e r e nt   or ie nt a ti ons   a nd  s c a le s .  F e a tu r e s   s uc h  a s   e ne r gy,  c ont r a s t,   a nd  va r ia nc e   a r e   obt a in e d.  T h e   out put   of   th e   G a bor   w a ve le t  tr a ns f o r m a ti on  is   a   s e t  of   f e a tu r e   ve c to r s   us e d  in   th e   c lu s te r in g  s te p  f or   de f e c t  de te c ti on.  B e c a u s e   of   th e   bi ol ogi c a l  r e le va nc e   of   G a bor   w a ve s ,  th e y  a r e   us e d   f r e que nt ly , a nd t he ir  m a th e m a ti c a l  pr ope r ti e s  a r e  de f in e d a s  i n ( 1) :     , ( ) = , 2 2 e x p ( − , 2 2 2 2 ) [ e x p (  , ) − e x p ( − 2 2 ) ]     ( 1)     W he r e   th e   or ie nt a ti on  of   th e   G a bor   w a ve le t  a nd  th e   s c a le   a r e   gi ve n  by  θ   a nd     r e s pe c ti ve ly ,  by  x = ( p , q )   r e pr e s e nt in g t he  s pa ti a l  dom a in  of  t he  G a bor  w a ve le t   k θ ,   is  t he  w a ve  ve c to r  a nd i s  gi ve n a s  i n ( 2) :     , = e x p (  )     ( 2)     w he r e   =  , = 2 , = √ 2 .     G a bor   w a ve le ts   a r e   u s e d  due   to   th e ir   s im il a r it y  to   th e   hum a n  vi s ua l  s y s te m   a nd   be c a u s e   th e y   don’ t  r e qui r e   de f e c t - f r e e   s a m pl e s   or   th r e s hol d  s e tt in gs   [ 10] .  T h e y  e x tr a c t  im a ge   f e a tu r e s   li ke   e dge s   a nd  poi nt s   f or   c la s s if ic a ti on  ba s e d  on  s p a ti a l,   s pe c tr a l,   or   te xt ur e   pr ope r t ie s ,  r e duc in g  di m e ns io na li ty   a nd  r e m ovi ng   unne c e s s a r y  da ta   f or   e a s ie r   pr oc e s s in g.  F ig ur e   3  il lu s tr a te s   th e   a ppl ic a ti on  of   G a bor   w a ve le ts   to   a   2D   im a ge .  F ig ur e   3( a )   de pi c ts   th e   r e a l  w a ve le ts ,  w hi le   F ig ur e   3( b)   pr e s e nt s   th e   im a gi na r y  w a ve le ts   a t  or ie nt a ti ons   of   0,  π /4 , π /2 , a nd 3π /4  r a di a ns , a nd s c a le s  r a ngi ng f r om  0.2 to 0.6.           F ig ur e  2. B lo c k di a gr a m  of  t he  pr opos e d m e th od           ( a )   ( b)     F ig ur e  3. G a bor  w a ve le ts  f or  a  2D  i m a ge   of   ( a )   r e a l  w a ve le ts   a nd   ( b)   i m a gi na r y w a ve le ts       2.2 .     K - m e an s   c lu s t e r in g   K - m e a ns   c lu s te r in g  is   a n  uns upe r vi s e d  a lg or it hm   th a t  di vi de s   da ta   in to   s ubgr oups   c a ll e d  c lu s te r s   ba s e d  on  c ha r a c te r is ti c s   li ke   s iz e ,  s h a pe ,  or ie nt a ti on,  a nd  s c a le .  T he   num be r   of   c lu s te r s   ( K )   is   de te r m in e d   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I S S N :   2252 - 8938   I nt  J  A r ti f   I nt e ll ,  V ol . 14, No. 5, O c to be r  2025 :  4279 - 4289   4282   us in g  th e   E lb ow   m e th od.  K - m e a ns   m in im iz e s   th e   s um   of   di s ta nc e s   be tw e e n  da ta   poi nt s   a nd  th e ir   ne a r e s t  c e nt r oi ds ,  gr oupi ng  s im il a r   da ta   poi nt s   in to   c lu s te r s   w it hout   r e qui r in g  tr a in in g.  T he   pr oc e s s   r e pe a ts   unt il   no  f ur th e r  c lu s te r in g i s  pos s ib le , e ns ur in g t ha t  e a c h da ta s e t  be lo ngs  t o t he  c lu s te r  w it h t he  ne a r e s t  c e nt r oi d.     2.3 .     D e s c r ip t io n  of  t h e  al gor it h m   I n  K - m e a ns   c lu s te r in g,  th e   va lu e   of   K   in di c a te s   th e   num be r   of   c lu s te r s .  F or   in s ta nc e ,   if   th e   va lu e   of   K   is   s e t  to   2,  two  c lu s te r s   w il l  be   c r e a te d;   if   it   is   s e t  to   3,  th r e e   c lu s te r s   w il l  be   c r e a te d.  T he   f or m a ti on  of     K   c lu s te r s   e ns ur e s   th a t   a   d a ta s e t   is   di vi de d   in to   gr oups   ba s e d   on  th e   s im il a r it y  of   a tt r ib ut e s .  T he   K - m e a ns   c lu s te r in g a lg or it hm  ope r a te s  a s   s how n i n A lg or it hm  1.     A lg or it hm  1. K - m e a ns  c lu s te r in g   1)   C hoos e  t he  numbe r  of  K  c lu s te r s  you wa nt  t o c r e a te .   2)   I ni ti a li z e  K  c e nt r oi ds  r a ndoml y f r om  t he   da ta  poi nt s .   3)   A s s ig n  e a c h  pi xe l  to   th e   c lo s e s t  c e nt r oi d  on  th e   ba s is   of   it s   E uc li de a n  di s ta nc e .  T he   E uc li de a n  di s ta n c e   is  c a lc ul a te d u s in g t he  f or m ul a  gi ve n i n ( 3) .       Euc l id e a n   d is t a n c e = √ ∑ ( x i − y i n i = 1 ) 2     ( 3)     4)   R e c a lc ul a te  t h e  c e nt r oi d a s  t he  m e a n of  a ll  pi xe ls  a s s ig ne d t o i t.   5)   R e pe a t  s t e ps  3 a nd 4 unti l  c onve r ge n c e  ( w he n t he  c e nt r oi d pos it io ns  s to p c ha ngi ng s ig ni f ic a nt ly ) .   6)   A s s ig n e a c h pi xe l  to  t he  c lu s te r  t o w hi c h i ts   c e nt r oi d be lo ngs .   7)   Re - s ha pe  t he   c lu s te r e d da ta  b a c k i nt o t he  or ig in a l  im a ge  s ha pe .   8)   O pt i on a l ly ,  a ppl y  po s t - pr o c e s s i ng  t o  t h e   s e g m e nt e d  im a g e  ( e . g.,   s m oot hi n g  or  m or p hol ogi c a l  op e r a ti on s ) .   9)   U s e  t he  s e gm e nt e d i m a ge  t o de te c t  a nd c la s s if y de f e c ts  i n t he  vi a l.     I n  th is   pr oc e s s ,  th e   in put   s a m pl e   is   de f in e d  a s   S = { p 1 , p 2 , . . . , p m } .  T h e   va r ia bl e   K   de not e s   th e   num be r   of   c lu s te r s ,  a nd  N   s ig ni f ie s   th e   m a xi m um   num be r   of   r e pe ti ti ons   a ll ow e d.  T he   out put   is   d e not e d  by   C = { C 1 , C 2 , . . . , C K } . T he  pr oc e dur e  i nvol ve s  t he  f ol lo w in g s t e ps :   i)   F r om   s a m pl e   S ,   s e le c t  r a ndoml y  k  num be r s   of   s a m pl e s   w hi c h  a r e   in it ia l   c e nt e r   ve c to r s   of   k   c lu s te r s   r e pr e s e nt e d a s :  { μ 1 , μ 2 , . . . , μ k } .   ii)   F or  t he  numbe r  n= 1, 2, ..., N, a ppl y t he  f ol lo w in g.    a)   C  i s  i ni ti a li z e d a s   C t = ∅ ii j N t = 1 , 2 , … . k   w he r e   C  i s   c la s s  di vi s io n   b)   D is ta nc e   be tw e e n  p i   ( f or   a ll   i= 1,  2,  ...,  m )   a nd  e ve r y  c lu s te r   c e nt e r   μ j   ( f or   a ll   j= 1,  2,  ...,  k)   is   c a lc ul a te d   a s  i n ( 4)  a nd ( 5) .       s ij =   p i −   μ j2 2   ( 4)     C α i =   C α i ∪ { p i }   ( 5)     F or   th e   s a m pl e   p i   ha vi ng  th e   s m a ll e s t  di s ta nc e   f r om   μ j   is   te r m e d  a s   s ij   a nd  it s   c a t e gor y  is   r e pr e s e nt e d  a s   α i , s o t ha t  th e  out put  c a te gor y i s  upda te d  a s  i n ( 6) :  C α i =   C α i ∪ { p i } ,      μ j = 1 | C j | ∑ p p ϵ C j   ( 6)     c)   F or   th e   out put   c la s s   C j ,  di vi de   a ll   th os e   s a m pl e   poi nt s   by   ( 4)   f or   a ll   j= 1,  2,   3....,  k   to   obt a in   th e   ne w   c lu s te r  c e nt e r s  a s  i n ( 7) .     μ j = 1 | C j | ∑ p p ϵ C j     ( 7)     d)   R e pe a t  s t e p ( c )  f or  a ll  k s a m pl e s .    N ow   f or   p i   th e   s m a ll e s t  di s ta nc e   f r om   th e   c e nt e r   of   th e   c lu s te r   c e nt e r   is   m a r ke d  a s   s ij   w hos e   c a te gor y  is   gi ve n by  α i , w it h t hi s  upda te  out put  a s  i n ( 8) :  C α i =   C α i ∪ { p i }     μ j = 1 | C j | ∑ p p ϵ C j     ( 8)     iii)   T he   pr oc e dur e   is   r e pe a te d   f or   a ll   th e   v a lu e s   of   j= 1,  2,   3....,  k   f or   a ll   th e   va lu e s   of   th e   k   s a m pl e s ,  th e   c e nt e r   ve c to r s   of   th e   gr oup  ha ve   not   c ha nge d,  a nd  th e   f in a l  c la s s   di vi s io n   out put   C = { C 1 , C 2 , . . . , C K }     is  obt a in e d.   Evaluation Warning : The document was created with Spire.PDF for Python.
I nt  J  A r ti f   I nt e ll     I S S N :   2252 - 8938       A ut om at e d v ia l  de fe c t  in s pe c ti on us in g  G abo r  w av e l e ts  and  k - m e ans  c lu s te r in g   ( V is hw anat ha C . R .)   4283   T he   s u c c e s s   of   th e   K - m e a n s   a lg or it hm   de pe nds   on  th e   va lu e   of   k  th a t  w e   c hoo s e .  T h e r e   a r e   va r io us   w a ys   to   de r iv e   a n  opt im a l  num be r   of   c lu s te r s .  O ne   s uc h  w a y  is   to   us e   th e   E lb ow   m e th od.   T hi s   m e th od  us e s   w it hi n - c lu s te r  s um  of  s qua r e s  ( W C S S )  t o ge t  th e  opt im a l  num be r  of  c lu s te r s .  W C S S   is  de f in e d a s  i n ( 9) :     ∑ P i   in   C l u s te r 1 d is t a n c e ( P i C 1 ) 2 + ∑ P i   in   C l u s te r 2 d is t a n c e ( P i C 2 ) 2 +     ∑ P i   in   C l u s te r 3 d is t a n c e ( P i C 3 ) 2   ( 9)       3.   R E S U L T S  A N D  D I S C U S S I O N   D a ta s e t  de s c r ip ti on,   th e   s tu dy  us e s   a   c us to m - c ur a te d  da ta s e t  s pe c if ic a ll y  de s ig ne d  f or   vi a l  de f e c t  in s pe c ti on,  a ddr e s s in g  li m it a ti ons   of   publ ic ly   a va il a bl e   da ta s e ts ,  a s   not e d  by  H u  e t  al .  [ 24 ] .  T hi s   ta il or e d   da ta s e t  e nha nc e s   de f e c t  de te c ti on  a c c ur a c y  by  c lo s e ly   r e f le c ti ng  r e a l - w or ld   s c e na r io s .  A ugm e nt a ti on  te c hni que s   li ke   r ot a ti on  a nd  s c a li ng  e xpa nde d  th e   da ta s e t,   w hi le   r ig or ous   va li da ti on  e ns ur e d  r obus tn e s s   w it hout  t r a di ti ona l  tr a in in g.   T he   im a ge   a c qui s it io n  s e tu p  a s   s how n  in   F ig ur e   4  in c lu de s   a   N e bul a   L E D   ba c kl ig ht   ( N e bul a - 80R )   f or   a dj us ta bl e   br ig ht ne s s ,   a   T a m r on  m a c hi n e   vi s io n  c a m e r a   ( 5  M P ,  V C X G - 52M R )   w it h  a   50   m m   B a um e r   le ns   ( M 118F M 50) ,  a nd  a   c onve yor   s ys te m .  F ig ur e   4( a )   s how s   th e   c a m e r a   pos it io ne d  to   c a pt ur e   th e   vi a l   s ur f a c e  r e gi on, while  F ig ur e  4( b )  i ll us tr a te s  t he  c a m e r a  s e tu p f o r  c a pt ur in g t he  vi a l  bo tt om  r e gi on.  F ig ur e  4 ( c )   de pi c ts   th e   vi a l  pl a c e d  w it h  th e   ba c kl ig ht   f or   im a ge   a c qui s it io n.  T he   c om put e r   f e a tu r e s   a   2.8  G H z   5t h  ge n  c or e   i5   pr oc e s s or ,  8  G B   R A M ,  N vi di a   R T X   3070  G P U ,  a n d  1  T B   s to r a ge .   T hi s   c onf ig ur a ti on  s uppor ts   pr e c is e  i m a ge  c a pt ur e   a nd e f f e c ti ve  de f e c t  de te c ti on.             ( a )   ( b)   ( c )     F ig ur e  4. S ys te m  s e tu p f or  i m a ge  a c qui s it io n   of   ( a )   ca m e r a  pos i ti one d f or  c a pt ur in g vi a l  s ur f a c e  r e gi on ,     ( b)   c a m e r a   po s i ti o ne d f or   c a pt ur in g v ia l  b ot t om   r e gi o n ,   a nd ( c )   v i a l  pl a c e d  w it h  b a c kl i ght  f or  i m a g e   a c q ui s it io n       T he   s tu dy  us e s   vi a ls   w it h   de f e c ts   s uc h   a s   bl a c k   s pot s ,   dus t,   s c r a tc he s ,  d e nt s ,  bubbl e s ,  m out h   c r a c ks ,   ne c k  c r a c ks ,  a nd  m out h  a nd  r im   c hi ppi ng.  M os t  of   th e s e   de f e c ts   a r e   c a us e d  dur in g  th e   vi a l  m a nuf a c tu r in g   pr oc e s s . T o de m ons tr a te  t he  a lg or it hm , a  s a m pl e  vi a l  im a ge  w it h a  m out h c r a c k a s  a  de f e c t  is  t a ke n, a s  s how n   in   F ig ur e   5.  T he   r e s ul ta nt   im a ge s   of   th e   vi a l  a f te r   th e   a ppl i c a ti on  of   G a bor   w a ve le ts   w it h  a   k e r ne l  s iz e   of   256 × 256  a r e   s how n  in   F ig ur e   6.  F ig ur e   6( a )   de pi c ts   th e   r e a l  w a ve le t  r e s pons e ,  w hi le   F ig ur e   6( b)   s how s   th e   im a gi na r y  w a ve le t  r e s pons e .  I n  bot h  s ubf ig ur e s ,  th e   o r ie nt a ti on s   a r e   0,  π /4 ,  π /2 ,   a nd  3π /4   r a di a ns   f r om   le f t   to   r ig ht  a nd t he  di f f e r e nt  s c a le s  a r e  0.2, 0.3, 0.4, 0.5, a nd 0.6 f r om  t op t o bott om .     T he   E lb ow   m e th od  in vol ve s   e xe c ut in g  K - m e a ns   c lu s te r in g  on  th e   da ta s e t  f or   K   va lu e s   r a ngi ng  f r om   1  to   10,  f ol lo w e d  by  c a lc ul a ti ng  th e   W C S S   f or   e a c h  K   va lu e .  A   c ur ve   is   th e n  pl ot te d  be twe e n  th e   c a lc ul a te d  W C S S   va lu e s   a nd  th e   c or r e s ponding  K   va lu e s .  T he   opt im a l  K   f or   c lu s te r in g  is   de te r m in e d  by   id e nt if yi ng  th e   s ha r p  be nd,  or   " E lb ow ,"   in   th e   pl ot te d  c ur ve ,  w hi c h   in di c a te s   th e   poi nt   a t  w hi c h   a ddi ng  m or e   c lu s te r s   doe s   not  s ig ni f ic a nt ly  i m pr ove  t he  m ode l' s  pe r f or m a nc e .   T he   im a ge   w it h  s c r a tc he s   in   th e   bot to m   ( or   ba s e )   r e gi on   u nde r goe s   noi s e   r e m ova l  a nd   f e a tu r e   e xt r a c ti on  us in g  G a bor   w a ve le ts ,   a s   il lu s tr a te d  in   F ig ur e   7.   F ig ur e   7( a )   s how s   th e   in put   im a ge   w it h  s c r a t c he s   in  t he  bot to m  r e gi on. F ig ur e  7( b )  pr e s e nt s  t he  pr oc e s s e d i m a ge   a f te r  f e a tu r e  e xt r a c ti on, whe r e  f e a tu r e s  s uc h a s   e ne r gy,  c ont r a s t,   a nd  va r ia nc e   a r e   e xt r a c te d.  A   G a bor   w a ve le t  ke r ne l  s iz e   of   32  c a pt ur e s   f e a tu r e s   a t  m ul ti pl e   s c a le s ,  w hi le   16  or ie nt a ti ons   e nha nc e   de f e c t  de te c ti on  f r om   va r io us   a ngl e s .  T he   im a ge   is   th e n  s e gm e nt e d   us in g  K - m e a ns   c lu s te r in g  w it h  k= 3   c lu s te r s ,   a s   s how n  in   F ig u r e   7( c ) .  T hi s   pa r ti ti oni ng  di s ti ngui s he s   a c tu a l  de f e c ts   f r om   noi s e .  A lt hough  in c r e a s in g  th e   num be r   of   c lu s te r s   c oul d  im pr ove   s e gm e nt a ti on,  it   a ls o  r a i s e s   c om put a ti ona l  c om pl e xi ty . T he r e f or e , s e le c ti ng a n opti m a l  k va lu e  i s  c r uc ia l  f or  ba la nc in g e f f ic ie nc y a nd da ta   va r ia ti on  c a pt ur e .  F in a ll y,  th e   C a nny  e dge   ope r a to r   is   a ppl ie d  to   hi ghl ig ht   de f e c ts   in   th e   s e gm e nt e d  vi a l   im a ge , a s  de pi c te d i n F ig ur e  7( d) .    Evaluation Warning : The document was created with Spire.PDF for Python.
                      I S S N :   2252 - 8938   I nt  J  A r ti f   I nt e ll ,  V ol . 14, No. 5, O c to be r  2025 :  4279 - 4289   4284       F ig ur e  5. A  s a m pl e  vi a l  im a ge  w it h a  m out h c r a c k de f e c t           ( a )   ( b)     F ig ur e  6. R e s ul ti ng via l  im a ge s  a f te r  a ppl yi ng G a bor  w a ve le ts   of   ( a )   r e a l  a nd  ( b)   i m a gi na r y               ( a )   ( b)   ( c )   ( d)     F ig ur e  7. S te pw is e  pr oc e s s in g of  a  vi a l  im a ge  w it h  s c r a tc he s  i n t he  bot to m  r e gi on   of   ( a )   i nput  i m a ge  w it h  s c r a tc he s  i n t he  bot to m  r e gi on ,   ( b)   d e noi s in g a nd f e a tu r e   e xt r a c t io n us in g G a bor  w a ve le t ,   ( c )   s e gm e nt e d  im a ge  us in g K - m e a ns , a nd   ( d)   i de nt if ie d c lu s te r  e dge s  i n t he  ou tp ut  i m a ge       T he   pr opos e d  m e th od   in s pe c t s   v a r io us   de f e c t s   c om m onl y  f ound  in   pha r m a c e ut ic a l  vi a l s   to   e ns ur e   c om pr e he ns iv e   qua li ty   a s s e s s m e nt .  A   to ta l  of   254  de f e c ti ve   vi a ls   w e r e   a na ly z e d ,  e nc om pa s s in g  a   di ve r s e   r a nge   of   de f e c ts ,  in c lu di ng  bl a c k  s pot s   ( 35  oc c ur r e nc e s ) ,  c r a c ks   ( 60  oc c ur r e nc e s ) ,  s c r a tc he s   ( 80  oc c ur r e nc e s ) ,   c hi ppi ngs   ( 65  oc c ur r e nc e s ) ,  a s   w e ll   a s   ot he r   le s s   f r e que nt   d e f e c ts   s uc h  a s   bubble s   ( 10  o c c ur r e nc e s )   a nd  m is c e ll a ne ous   ty pe s   li ke   f la t  s li m   r in gs ,  de nt s ,  a nd  ot he r s   ( 4  oc c ur r e nc e s ) .  T hi s   da ta s e t  a ll ow s   f or   a   th or ough   e xa m in a ti on of  de f e c t  de te c ti on c a pa bi li ti e s  a c r os s  di f f e r e nt  c a te gor ie s .   T he   a lg or it hm s   im pl e m e nt e d  e xhi bi t  va r yi ng  ti m e   a nd   s pa c e   c om pl e xi ti e s .  C a nny  e dge   de te c ti on  ope r a te s   in   ( )   ti m e ,  w he r e     is   th e   num be r   of   pi xe l s ,  w hi le   th e   G a bor   w a ve le t  a nd  K - m e a ns   c lu s te r in g   e xhi bi t  ti m e   c om pl e xi ti e s   of   ( . 2 . )   a nd  ( . . . )   r e s pe c ti v e ly ,  w he r e     r e pr e s e nt s   th e   num be r   of   G a bor   f il te r s ,    de not e s   th e   num be r   of   it e r a ti ons ,  a nd    s ig ni f ie s   th e   num be r   of   di m e ns io ns .  T he   s pa c e   c om pl e xi ti e s   f or   m os t  ope r a ti ons   a r e   ( ) ,  e xc e pt   f or   K - m e a n s   c lu s te r in g,  w hi c h  ha s   a   s pa c e   c om pl e xi ty   of   ( . ) ,  w he r e     is   th e   num be r   of   di m e ns io ns .  T he   pe r f or m a nc e   of   t he   im pl e m e nt e d  s ys te m   is   e va lu a te d  us in g  a   c onf us io n  m a tr ix ,  w hi c h  is   one   of   th e   popula r   m e a s ur e s   us e d   f or   th e   a n a ly s is   of   pe r f or m a nc e   pa r a m e te r s   s u c h  a s   r e c a ll ,  pr e c is io n,  a c c ur a c y,   a nd  F 1 - s c or e .  P e r f or m a nc e   pa r a m e te r s   a r e   c om put e d  u s in g  te r m in ol ogi e s   s uc h  a s   tr ue   pos it iv e   ( TP ) ,  t r ue   ne ga ti ve   ( TN ) ,  f a ls e   pos it iv e   ( FP ) ,  a nd  f a ls e   ne ga ti ve   ( FN ) .  Evaluation Warning : The document was created with Spire.PDF for Python.
I nt  J  A r ti f   I nt e ll     I S S N :   2252 - 8938       A ut om at e d v ia l  de fe c t  in s pe c ti on us in g  G abo r  w av e l e ts  and  k - m e ans  c lu s te r in g   ( V is hw anat ha C . R .)   4285   F ig ur e   8  pr e s e nt s   th e  c onf us io n  m a tr ix   s um m a r iz in g  th e  e xpe r im e nt a l  r e s ul ts . T he   r e c a ll ,  pr e c is io n,  a c c ur a c y,   a nd F 1 - s c or e  c a n be  c a lc ul a te d a s  i n ( 10)  t o ( 15) .       =       +     ( 10)      =       +     ( 11)      =     +       ( 12)     1 −  =   2 × ∗ +     ( 13)           F ig ur e  8. C onf us io n m a tr ix   of   e xpe r im e nt a l  r e s ul ts       T he   a r e a   unde r   th e   c ur ve - r e c e iv e r   ope r a ti ng  c h a r a c te r is ti c   ( AUC - R O C )   c ur ve   a nd   th e   AUC   th e   pr e c is io n - r e c a ll   ( P R )   c ur ve   a r e   c om m on  m e tr ic s   us e d   to   e v a lu a te   th e   p e r f or m a nc e   of   bi na r y  c la s s if ic a ti on   m ode ls  a s  gi ve n i n ( 14)  a nd ( 15) .     _  = ∫  (  − 1 ( ) )  1 0   ( 14)     _  = ∫  ( ) 1 0 ∙ ( )    ( 15)     W he r e   K   r e pr e s e nt s   th e   num be r   of   c lu s te r s .  T h e   A U C - R O C   i s   c a lc ul a t e d  c on s id e r in g  th e   TP   r a te   ( s e ns it iv it y)   a nd  th e   FP   r a te .  T he   TP   r a te   w ou ld   r e pr e s e nt   th e   pr opor ti on  of  c or r e c tl y   id e n ti f ie d   de f e c ti v e   vi a l s ,  w he r e a s   th e   FP   r a te   w o ul d  r e pr e s e nt   th e   pr opor t io n  of   no n - de f e c ti v e   vi a ls   i n c or r e c tl y  id e nt if ie d a s   de f e c ti v e . T he  A U C - P R   m e a s ur e s  t h e  ba l a nc e  b e tw e e n pr e c i s io n  a nd r e c a ll . P r e c i s io n w o ul d r e pr e s e nt  t h e  a c c ur a c y of   th e  i de nt if i c a ti on  of   th e   de f e c t  a m on g  a l l  th e   vi a ls   id e nt if ie d  a s   de f e c ti v e ,  w hi le   r e c a ll   ( or   s e n s it iv i ty )   w o ul d  r e pr e s e n t  th e   pr opor ti on  of   a c tu a l  d e f e c ti ve   v ia l s   c or r e c tl y  id e nt if ie d.  T he   p r opos e d  m e th od  ha s   pr odu c e d  9 8.81%   r e c a ll ,   98.03%   pr e c i s io n,  9 8.28%   a c c ur a c y,   a nd  th e   F 1 - s c or e   obt a in e d  i s   98.42% .   T he   A U C - R O C   a n d  A U C - P R   va lu e s  o bt a in e d  a r e  9 8.30  a nd  98.9 6% , r e s pe c ti v e ly ,  w he n t he  v a lu e   of  k i s   s e t  t o 3  a nd i s   s ho w n i n F i gur e   9.     T he   pe r f or m a nc e   of   th e   pr opos e d   m e th odol ogy  a c r o s s   v a r io us   s e gm e nt a ti on  s e tt in gs   is   a s s e s s e d     by  in te gr a ti ng  di f f e r e nt   k  va lu e s ,  a s   s how n  in   F ig ur e   10.  F ig ur e   10( a )   pr e s e nt s   th e   R O C   c ur ve ,  w hi le     F ig ur e   10( b)   il lu s tr a te s   th e   P R   c ur ve   f or   di f f e r e nt   k  va lu e s .   T he   a n a ly s is   r e v e a ls   th a t  va r yi ng  K   im pa c t s   m ode l  pe r f or m a nc e ,  w it h  K = 3  yi e ld in g  op ti m a l  s e ns it iv it y,  s pe c if ic it y,  pr e c is io n,  a nd  r e c a ll .  T hi s   in di c a te s   th a t  de f e c t  de te c ti on  is   m os t  e f f e c ti ve   w h e n  K   is   s e t  to   3,  hi ghl ig ht in g  th e   im por ta nc e   of   s e le c ti ng  a n  a ppr opr ia te  K  va lu e  f or  s upe r io r  pe r f or m a nc e .   T he   pr opos e d  m e th od  f or   vi a l  de f e c t  de te c ti on  ta k e s   a n   a v e r a ge   c om put a ti ona l  ti m e   of   a r ound    355  m ic r os e c onds   f or   a ll   ty pe s   of   de f e c ts ,  a nd   s ugge s ts   a   r e la ti ve ly   e f f ic ie nt   pr oc e s s in g  s pe e d.  T he   c om pa r is on  of   va r io us   te c hni que s   or   m e th odol ogi e s   a nd  th e   one   us e d  in   th is   s tu dy  is   gi ve n  in   T a bl e   1,  w hi c h   pr ovi de s  e m pi r ic a l  e vi de nc e  t ha t  de m ons tr a te s  t he  s upe r io r  pe r f or m a nc e  of  t he  p r opos e d m e th od c om pa r e d t o   a lt e r na ti ve   de f e c t  de te c ti on  a lg or it hm s .  T he   pa pe r   pr e s e nt s   r e s ul ts   f r om   c om pa r a ti ve   e xpe r im e nt s   th a t   hi ghl ig ht  t he  m e th od' s  h ig he r  a c c ur a c y. O ve r a ll , t he  p r e f e r e nc e   f or  t he  p r opos e d m e th od us in g  G a bor  w a ve le t  c lu s te r in g  a nd  K - m e a n s   c lu s te r in g  is   ju s ti f ie d  by   it s   a bi li ty   to   e f f e c ti ve ly   e xt r a c t  r e le v a nt   f e a tu r e s   th a t  Evaluation Warning : The document was created with Spire.PDF for Python.
                      I S S N :   2252 - 8938   I nt  J  A r ti f   I nt e ll ,  V ol . 14, No. 5, O c to be r  2025 :  4279 - 4289   4286   di s ti ngui s h  be twe e n  de f e c ti ve   a nd  non - de f e c ti ve   r e gi ons   of   vi a ls .  T he   gr a ph  of   th e   c om pa r is on   of   a c c ur a c y  a c r os s  di f f e r e nt  m e th ods  i s   s how n i n F ig ur e  11.            F ig ur e  9. T he  A U C - R O C   a nd A U C - P R  c ur ve s           ( a )   ( b)     F ig ur e  10. P e r f or m a nc e   e va lu a ti on me tr ic s   of   ( a )   r e c e iv e r  ope r a ti ng c ha r a c te r is ti c  c ur ve  a nd     ( b)   pr e c is io n - r e c a ll  c ur ve           F ig ur e  11. C om pa r is on of   pr e c is io n a c r os s  di f f e r e nt  m e th ods   Evaluation Warning : The document was created with Spire.PDF for Python.
I nt  J  A r ti f   I nt e ll     I S S N :   2252 - 8938       A ut om at e d v ia l  de fe c t  in s pe c ti on us in g  G abo r  w av e l e ts  and  k - m e ans  c lu s te r in g   ( V is hw anat ha C . R .)   4287   T a bl e  1.  T he  pe r f or m a nc e  of  va r io us  m e th ods   S l . N o.   M e t hodol ogy    A c c ur a c y   (%)   1   M ul t i - c ha nne l  s e gm e nt a t i on  [ 1]   95   2   X - r a y a nom a l y de t e c t i on [ 2]   97.4   3   H e ur i s t i c  m e t hod [ 3]   94.9   4   T hr e s hol di ng [ 4]   95.6   5   H or i z ont a l   i nt e r c e pt  pr oj e c t i on  [ 5]   98   6   F T A D S P  a nd W T M F  [ 6]   95.00   7   C a nny e dge  de t e c t i on [ 7 ]   95.33   ( a vg)   8   C l us t e r i ng [ 8]   94.12   9   H A M V  [ 9]   95.00   10   C a nny e dge  de t e c t or  [ 10]   95.00   11   D D S C N e t  [ 15]   86.9 ( hi ghe s t )   12   Y O L O v3 [ 16]   97.66   13   Y O L O v5s  [ 17 ]   67.5   14   LF - Y O L O v4 [ 18]   97.83   15   I m pr ove d Y O L O v3 [ 19]   91.12   16   P r opos e d m e t hod   98.28       4.   C O N C L U S I O N   T hi s   s tu dy  a dopt s   a   nove l  a ppr oa c h  by  f oc u s in g  on  th e   de ve lo pm e nt   a nd  e v a lu a ti on  of   a n   a lg or it hm   f or   de f e c t  de te c ti on  in   v ia ls .  T he   a lg or it hm   is   de s ig ne d  to   a na ly z e   in di vi dua l  vi a l  im a ge s   to   id e nt if y  a n d   lo c a li z e   th e   pr e s e nc e   of   de f e c ts ,  w it hout   tr a in in g  a   m ode l  f or   vi a l  c la s s if ic a ti on.  G a bor   w a ve le ts   a r e   a   pow e r f ul   to ol   in   im a ge   p r oc e s s in g  th a t  c a n  be   us e d  to   de te c t  de f e c ts   in   vi a ls   by  e xt r a c ti ng   m e a ni ngf ul   f e a tu r e s   f r om   th e   im a ge   da ta .   C om bi ni ng  G a bor   w a ve le ts   w it h  c lu s te r in g  of   K - m e a ns   e na bl e s   a c c ur a te   a nd   e f f ic ie nt   de te c ti on  of   de f e c ti ve   vi a ls ,  ut il iz in g   f e a tu r e s   s uc h  a s   e ne r gy,  c ont r a s t,   a nd   va r ia nc e   f or   s upe r io r   r e s ul ts .  R obus t  to   va r ia ti ons   in   il lu m in a ti on,  o r ie nt a ti on,  a nd  s c a le ,  G a bor   w a ve le ts   e ns ur e   r e li a bi li ty   a c r os s   di ve r s e   m a nuf a c tu r in g  e nvi r onm e nt s .  U nl ik e   pr e d e f in e d  m ode ls ,  K - m e a ns   c lu s te r in g  a d a pt s   to   va r yi ng   c ha r a c te r is ti c s ,  ope r a te s   in   a n  uns upe r vi s e d  m a nn e r ,  a nd  a c c o m m oda te s   c ha nge s   in   m a nuf a c tu r in g  pr oc e s s e s   or   pr oduc t  s pe c if ic a ti ons .   T hi s   hol is ti c   a ppr oa c h  e nh a nc e s   th e   m e th od' s   a bi li ty   to   id e nt if y  va r io us   ty pe s   of   de f e c ts ,  in c lu di ng  s ubt le   a nom a li e s   th a t  m a y  be   c ha ll e ngi ng  t o  de te c t  us in g  tr a di ti ona l  a lg or it hm s .  W it h  a n  a ve r a ge   c om put a ti ona l  ti m e   of   355  m ic r os e c onds ,  th e   pr op os e d  m e th od  d e m ons tr a te s   th e   pot e nt ia l  f or     r e a l - ti m e   de f e c t  de te c ti on,  d e te c ti ng  s c r a tc he s ,  de nt s ,   bl a c k   s p ot s ,  c hi ppi ng,  c r a c k s ,  a nd   m or e .  C om pa r a ti ve   a na ly s is   in di c a te s   be tt e r   a c c ur a c y  in   a ll   r e gi ons   of   th e   vi a l  te s te d  f or   de f e c ts ,  hi ghl ig ht in g  th e   m e th od' s   pot e nt ia l  f or   a dopt io n  in   th e   pha r m a c e ut ic a l  in dus tr y.  T he   m e th od  de s c r ib e d  ope r a te s   on  in di vi dua l  vi a l   im a ge s   s e que nt ia ll y.  F or   hi gh - th r oughput  m a nuf a c tu r in g  e nvi r onm e nt s ,  w he r e   m ul ti pl e   vi a ls   a r e   in s pe c te d  s im ul ta ne ous ly ,  th is   a ppr oa c h  m a y  not   be   s c a la bl e .  F ut ur e   r e s e a r c h  c oul d  in ve s ti ga t e   pa r a ll e l  pr oc e s s in g  or   ba tc h  in s pe c ti on   te c hni que s   to   im pr ove   th r oughput  a nd  a im   a t  e xpl or in g  th e   in te gr a ti on  of   opt im iz e d   ML   a lg or it hm s ,  s uc h  a s   C N N s ,  S V M s ,  r a ndom  f or e s ts ,  a nd  de e p  le a r ni ng  m e th ods   s uc h  a s   R - C N N s ,  U - N e t,   a nd   G A N s , t o i m pr ove  a ut om a te d de f e c t  c la s s if ic a ti on.       A C K N O WL E D G M E N T S   T he   a ut hor s   w is h  to   e xt e nd  th e ir   s in c e r e   gr a ti tu de   to   M r .  S unda r e s h  N a ya k,  S a a tv ik   S ol ut io ns ,   B e nga lu r u  f or   hi s   va lu a bl e   a s s is t a nc e   in   s e tt in g  up   th e   ha r dw a r e   c onf ig ur a ti on  r e qui r e d  f or   th e   e xpe r im e nt s .   H is  t e c hni c a l  e xpe r ti s e  a nd s uppor t  in  t he  a r r a nge m e nt s  s ig ni f ic a nt ly  c ont r ib ut e d t o t he  s uc c e s s f ul  c om pl e ti on  of  t hi s  r e s e a r c h w or k.       F U N D I N G  I N F O R M A T I O N   N o f undi ng i s  obt a in e d f or  t hi s  r e s e a r c h.        A U T H O R  C O N T R I B U T I O N S  S T A T E M E N T   T hi s   jo ur na l  us e s   th e   C ont r ib ut or   R ol e s   T a xonomy  ( C R e d iT )   to   r e c ogni z e   in di vi dua l  a ut hor   c ont r ib ut io ns , r e duc e  a ut hor s hi p di s put e s ,  a nd f a c il it a te  c ol la bo r a ti on.      N am e  o f  A u t h or   C   M   So   Va   Fo   I   R   D   O   E   Vi   Su   P   Fu   V is hw a na th a  C .  R .   ✓   ✓   ✓     ✓   ✓   ✓   ✓   ✓   ✓           V .  A s ha   ✓   ✓     ✓           ✓   ✓   ✓   ✓   ✓     C ha nna ba s a va   ✓     ✓     ✓     ✓       ✓           S r e e ka nt h R a ll a pa ll i     ✓     ✓     ✓         ✓       ✓       Evaluation Warning : The document was created with Spire.PDF for Python.
                      I S S N :   2252 - 8938   I nt  J  A r ti f   I nt e ll ,  V ol . 14, No. 5, O c to be r  2025 :  4279 - 4289   4288   C   :    C onc e pt ua l i z a t i on   M   :    M e t hodol ogy   So   :    So f t w a r e   Va   :    Va l i da t i on   Fo   :    Fo r m a l  a na l ys i s   I   :    I nve s t i ga t i on   R   :    R e s our c e s   D   :   D a t a  C ur a t i on   O   :   W r i t i ng  -   O r i gi na l  D r a f t   E   :   W r i t i ng  -   R e vi e w  &   E di t i ng   Vi   :    Vi s ua l i z a t i on   Su   :    Su pe r vi s i on   P   :    P r oj e c t  a dm i ni s t r a t i on   Fu   :    Fu ndi ng a c qui s i t i on         C O N F L I C T  O F  I N T E R E S T  S T A T E M E N T   T he  a ut hor s  de c la r e  no c onf li c t  of  i nt e r e s t.         D A T A  A V A I L A B I L I T Y   T he   da ta   th a t  s uppor t  th e   f in di ngs   of   th is   s tu dy  a r e   a va il a bl e   f r om   th e   f ir s t  a ut ho r   [ V C R ] ,  upo n   r e a s ona bl e  r e que s t.         R E F E R E N C E S   [ 1]   B .  C he n,  C .   L i ,  P .  Y ua n,   Y .  Y a n,  a nd   Y .  Y i n,  “ R e s e a r c h  on  de f e c t   de t e c t i on  of   bot t l e   c a p  i nt e r i or   ba s e d  on  l ow - a ngl e   a nd  l a r g e   di ve r ge nc e  a ngl e  vi s i on s y s t e m ,”   P L oS O N E , vol . 19, no. 5 ,   M a y, 2024, doi :  10 .1371/ j our na l .pone .0303744.   [ 2]   J . R a pc e w i c z  a nd  M . M a l e s a , “ A c t i ve  l e a r ni ng i n f e a t ur e  e xt r a c t i on f or  gl a s s - in - gl a s s  de t e c t i on,”   E l e c t r oni c s   vol . 13, no. 11, 2024 ,   doi :  10.3390/ e l e c t r oni c s 13112049.   [ 3]   M .  E s hke va r i ,  M .  J .   R e z a e e ,  M .  Z a r i nba l ,  a nd  H .   I z a dba khs h,  “ A ut om a t i c   di m e ns i ona l   de f e c t   de t e c t i on  f or   gl a s s   vi a l s   ba s e d  on  m a c hi ne   vi s i on:   a   he ur i s t i c   s e gm e nt a t i on  m e t hod,”   J our nal   of   M anuf ac t ur i ng  P r oc e s s e s ,  vol .  68,  pp.  973 – 989,  2021,    doi :  10.1016/ j .j m a pr o.2021.06.018.   [ 4]   O .   F a r ha ngi ,  E .   S he i da e e ,  a nd  A.   K i s a l a e i ,   “ M a c hi ne   vi s i on   f or   de t e c t i ng  de f e c t s   i n  l i qui d  bot t l e s :   a n   i ndus t r i a l   a ppl i c a t i on  f or   f ood a nd pa c ka gi ng s e c t or ,”   C l oud  C om put i ng and D at a Sc i e nc e , pp. 242 – 254,  2024, doi :  10.37256/ c c ds .5220244756.   [ 5]   X .  L i u,  Q .  Z hu,  Y .   W a ng,  X .  Z hou,   K .  L i ,  a nd  X .  L i u,  “ M a c hi ne   vi s i on  ba s e d  de f e c t   de t e c t i on  s ys t e m   f or   o r a l   l i qui d   vi a l ,”   2018  13t h W or l d C ongr e s s  on I nt e l l i ge nt  C ont r ol  and A ut om at i on ( W C I C A ) , pp. 945 – 950, 2018, doi :  10.1109/ W C I C A .2018.8630441.   [ 6]   X .  Z hou  e t   al . ,  “ A   s ur f a c e   de f e c t   de t e c t i on  f r a m e w or k  f or   gl a s s   bot t l e   b ot t om   us i ng  vi s ua l   a t t e nt i on  m ode l   a nd  w a ve l e t   t r a ns f or m ,”   I E E E  T r ans ac t i ons  on I ndus t r i al  I nf or m at i c s , vol . 16, no. 4, pp. 21 89 – 2201, 2020, doi :  10.1109/ T I I .2019.2935153.   [ 7]   L .  F u,  S .  Z ha ng,  Y .   G ong,  a nd  Q .  H ua ng,  “ M e di c i ne   gl a s s   bot t l e   de f e c t   de t e c t i on  ba s e d  on  m a c hi ne   vi s i on,”   i n  2019  C hi ne s e   C ont r ol   a nd D e c i s i on  C onf e r e n c e  ( C C D C ) , 2019, pp. 5681 – 5685, doi :  10.1109/ C C D C .2019.8832688.   [ 8]   R .  K ul ka r ni ,  S .  K ul ka r ni ,  S .  D a bha ne ,  N .  L e l e ,  a nd  R .  S .  P a s w a n,  “ A n   a ut o m a t e d  c om put e r   vi s i on - ba s e d  s y s t e m   f or   bot t l e   c a p   f i t t i ng  i ns pe c t i on,”   2019  T w e l f t h  I nt e r nat i onal   C onf e r e nc e   on  C ont e m por ar y   C om put i ng  ( I C 3) ,  N oi da ,  I ndi a ,  2019,  pp.  1 - 5,  doi :   10.1109/ I C 3.2019.8844942.   [ 9]   C .  H e ,  C .  L i ,  B .  C he n,  B .  Y ua n,  a nd  Y .  Y i n,  “ R e s e a r c h  on  de f e c t   de t e c t i on  of   t he   out e r   s i de   of   bot t l e   c a p  ba s e d  on  hi gh  a ngl e   a nd   m ul t i - vi e w  vi s i on s ys t e m ,”   I E E E  A c c e s s , vol . 11, pp. 65798 – 65809, 2023, doi :  10.1109/ A C C E S S .2023.3290616.   [ 10]   M .  K a z m i ,  B .  H a f e e z ,  H .  R .  K ha n,  a nd  S .  A .  Q a z i ,  “ M a c hi ne - vi s i on - ba s e d  pl a s t i c   bot t l e   i ns p e c t i on  f or   qua l i t y  a s s ur a nc e ,”   i n   E ngi ne e r i ng P r oc e e di ngs , 2022, vol . 20, no. 1, doi :  10.3390/ e ngpr oc 20220200 09.   [ 11]   C .  L i ,  Y .   Y i n,  B .  Y u a n,  a nd  X .   L i ,  “ R e s e a r c h  on  s ur f a c e   de f e c t   de t e c t i on  t e c hnol ogy  ba s e d   on  t he   z on a l   a nd  t i m e - s ha r i n g   c om put a t i ona l  i m a gi ng,”   I E E E  A c c e s s , vol . 10, pp. 79574 – 79583, 2022, doi :  10.1109/ A C C E S S .2022.3163726.   [ 12]   S .  B .  J ha   a nd  R .  F .  B a bi c e a nu,  “ D e e p  C N N - ba s e d  vi s ua l   de f e c t   de t e c t i on:   s u r ve y  of   c ur r e nt   l i t e r a t ur e ,”   C om put e r s   i n  I ndus t r y ,  vol . 148, 2023, doi :  10.1016/ j .c om pi nd.2023.103911.   [ 13]   T .  A .  K or z he bi n  a nd  A .  D .  E gor ov,  “ C om pa r i s on  of   c om bi na t i ons   o f   da t a   a ugm e nt a t i on  m e t hods   a nd  t r a ns f e r   l e a r ni ng  s t r a t e gi e s   i n  i m a ge   c l a s s i f i c a t i on  us e d   i n  c onvol ut i on  de e p   ne ur a l   ne t w or ks ,”   2021  I E E E   C onf e r e nc e   of   R us s i an  Y oung  R e s e a r c he r s   i n   E l e c t r i c al  and E l e c t r oni c  E ngi ne e r i ng ( E l C onR us ) , pp. 479 – 482, 2021, doi :  10.1109/ E l C onR us 51938.2021.9396724.   [ 14]   K .  L i u,  Y .  L i u,  C .  P e ng,  Y .  C ha ng,  a nd  Y .  Z ha o,  “ D e s i gn  of   ha r dw a r e   a c c e l e r a t i on  i n  e dge   c om put i ng  de vi c e   f or   bot t l e   c a p  hi gh - s pe e d i ns pe c t i on,”   W i r e l e s s  C om m uni c at i on s  and M obi l e  C om put i ng , vol . 2022, 2022, doi :  10.1155/ 2022/ 5270887.   [ 15]   H .  X u,  Y .  X u,  a nd  K .  H u,  “ A   vi s i on - ba s e d  i ns pe c t i on  s ys t e m   f or   pha r m a c e ut i c a l   pr oduc t i on  l i ne ,”   J our nal   of   Supe r c om put i ng ,  vol . 81, no. 4, 2025, doi :  10.1007/ s 11227 - 025 - 07135 - 8.   [ 16]   H .  L v,  S .  H ua ng,  W .  X i e ,  Z .  C he n,  Z .  G uo,  a nd  X .  Z ha ng,  “ M ul t i - s c a l e   ba s e d   de f e c t   de t e c t i on  f or   a ut om ot i ve   g l a s s ,”   J our nal   of   P hy s i c s :  C onf e r e nc e  Se r i e s , vol . 2303, no. 1, 2022, doi :  10.1088/ 1742 - 6596/ 2303/ 1/ 012068.   [ 17]   Y .  Z ha ng,  S .   S hu,  X .  L a ng,  H .  L i a ng,  Z .   Y u,  a nd  Z .  Y a ng,  “ A   r e a l - t i m e   m e t h od  f or   de t e c t i ng   bot t om   de f e c t s   of   l i t hi um   ba t t e r i e s   ba s e d  on  a n  i m pr ove d  Y O L O v5  m ode l ,”   M e as ur e m e nt   Sc i e nc e   and  T e c hn ol ogy ,  vol .  34,  no.  12,  2023,  do i :   10.1088/ 1361 - 6501/ a c f 9bf .   [ 18]   X .  C he n,  Z .  J i a ng,  H .  C he ng,  H .   Z he ng,  a nd   Y .  D u,  “ L F - Y O L O v4:   a   l i ght w e i ght   de t e c t i on  m ode l   f o r   e nha nc i ng  t he   f us i on  of   i m a ge   f e a t ur e s   of   s ur f a c e   de f e c t s   i n  l i t hi um   ba t t e r i e s ,”   M e as ur e m e nt   S c i e nc e   and  T e c hnol ogy ,  vol .  35,  no.  2,  2024,    doi :  10.1088/ 1361 - 6501/ a d0690.   [ 19]   J .  L i u  a nd  D .  Z ha ng,  “ R e s e a r c h  on  ve hi c l e   obj e c t   de t e c t i on  a l gor i t hm   ba s e d   on  i m pr ove d  Y O L O v3  a l gor i t hm ,”   i n  J our nal   o f   P hy s i c s :  C onf e r e nc e  Se r i e s , 2020, vol .  1575, no. 1, doi :  10.1088/ 1742 - 6596/ 1575/ 1/ 012150.   [ 20]   L .  S he n,  H .  T a o,  Y .   N i ,  Y .  W a ng,  a nd  V .  S t oj a novi c ,  “ I m pr ove d  Y O L O v3  m o de l   w i t h  f e a t ur e   m a p  c r oppi ng  f or   m ul t i - s c a l e   r oa d   obj e c t  de t e c t i on,”   M e as ur e m e nt  Sc i e nc e  and T e c hnol ogy , vol . 34, no. 4, 2023,  doi :  10.1088/ 1361 - 6501/ a c b075.   [ 21]   Z .  H ua ng,  H .  H u,  Z .  S he n,  Y .  Z ha ng,  a nd  X .  Z ha ng,  “ L i ght w e i ght   e dg e - a t t e nt i on  ne t w or k  f or   s ur f a c e - de f e c t   de t e c t i on  of   r ubbe r   s e a l  r i ngs ,”   M e as u r e m e nt  Sc i e n c e  and T e c hnol ogy , vol . 33, no. 8, 2022, doi :  10 .1088/ 1361 - 6501/ a c 6663.   [ 22]   H .  W a ng,  X .  X u,   Y .  L i u,  D .   L u,   B .  L i a ng,  a nd  Y .   T a ng,  “ R e a l - t i m e   de f e c t   d e t e c t i on  f or   m e t a l   c om pone nt s :   a   f us i on  of   e nh a nc e d   c a nny – de ve r na y a nd Y O L O v6 a l gor i t hm s ,”   A ppl i e d Sc i e nc e s , vol . 13, no. 12, 2023, doi :  10.3390/ a pp13126898.   [ 23]   M .  S t a s e vyc h  a nd  V .  Z va r yc h,  “ I nnova t i ve   r obot i c   t e c hnol ogi e s   a nd  a r t i f i c i a l   i nt e l l i ge nc e   i n  pha r m a c y  a nd  m e di c i ne :   pa vi ng  t h e  w a y  f or   t he   f ut ur e   of   he a l t h  c a r e - a   r e vi e w ,”   B i g  D at a  and  C ogni t i v e   C om put i ng ,  vol .  7,  no.  3,  A ug.  2023,   doi :   10.3390/ bdc c 7030147.   Evaluation Warning : The document was created with Spire.PDF for Python.