scieee Open visual document viewer

Nature inspired method for noninvasive fetal ECG extraction

Raj, Akshaya

Abstract

This paper introduces a novel algorithm for effective and accurate extraction of non-invasive fetal electrocardiogram (NI-fECG). In NI-fECG based monitoring, the useful signal is measured along with other signals generated by the pregnant women's body, especially maternal electrocardiogram (mECG). These signals are more distinct in magnitude and overlap in time and frequency domains, making the fECG extraction extremely challenging. The proposed extraction method combines the Grey wolf algorithm (GWO) with sequential analysis (SA). This innovative combination, forming the GWO-SA method, optimises the parameters required to create a template that matches the mECG, which leads to an accurate elimination of the said signal from the input composite signal. The extraction system was tested on two databases consisting of real signals, namely, Labour and Pregnancy. The databases used to test the algorithms are available on a server at the generalist repositories (figshare) integrated with Matonia et al. (Sci Data 7(1):1-14, 2020). The results show that the proposed method extracts the fetal ECG signal with an outstanding efficacy. The efficacy of the results was evaluated based on accurate detection of the fQRS complexes. The parameters used to evaluate are as follows: accuracy (ACC), sensitivity (SE), positive predictive value (PPV), and F1 score. Due to the stochastic nature of the GWO algorithm, ten individual runs were performed for each record in the two databases to assure stability as well as repeatability. Using these parameters, for the Labour dataset, we achieved an average ACC of 94.60%, F1 of 96.82%, SE of 97.49%, and PPV of 98.96%. For the Pregnancy database, we achieved an average ACC of 95.66%, F1 of 97.44%, SE of 98.07%, and PPV of 97.44%. The obtained results show that the fHR related parameters were determined accurately for most of the records, outperforming the other state-of-the-art approaches. The poorer quality of certain signals have caused deviation from the estimated fHR for certain records in the databases. The proposed algorithm is compared with certain well established algorithms, and has proven to be accurate in its fECG extractions.

Full text

1 Vol.:(0123456789) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s Na u e inspi ed me hod o nonin asi e e al ECG ex ac ion Akshaya Raj 1, Jind ich B ablik 1, Radana Kahanko a 1*, Rene Ja os 1, Ka e ina Ba no a 1, Vacla Snasel 2, Seyedali Mi jalili 3 & Radek Ma inek 1 This pape in oduces a no el algo i hm o e ec i e and accu a e ex ac ion o non-in asi e e al elec oca diog am (NI- ECG). In NI- ECG based moni o ing, he use ul signal is measu ed along wi h o he signals gene a ed by he p egnan women’s body, especially ma e nal elec oca diog am (mECG). These signals a e mo e dis inc in magni ude and o e lap in ime and equency domains, making he ECG ex ac ion ex emely challenging. The p oposed ex ac ion me hod combines he G ey wol algo i hm (GWO) wi h sequen ial analysis (SA). This inno a i e combina ion, o ming he GWO-SA me hod, op imises he pa ame e s equi ed o c ea e a empla e ha ma ches he mECG, which leads o an accu a e elimina ion o he said signal om he inpu composi e signal. The ex ac ion sys em was es ed on wo da abases consis ing o eal signals, namely, Labou and P egnancy. The da abases used o es he algo i hms a e a ailable on a se e a he gene alis eposi o ies ( igsha e) in eg a ed wi h Ma onia e al. (Sci Da a 7(1):1–14, 2020). The esul s show ha he p oposed me hod ex ac s he e al ECG signal wi h an ou s anding e icacy. The e icacy o he esul s was e alua ed based on accu a e de ec ion o he QRS complexes. The pa ame e s used o e alua e a e as ollows: accu acy (ACC), sensi i i y (SE), posi i e p edic i e alue (PPV), and F1 sco e. Due o he s ochas ic na u e o he GWO algo i hm, en indi idual uns we e pe o med o each eco d in he wo da abases o assu e s abili y as well as epea abili y. Using hese pa ame e s, o he Labou da ase , we achie ed an a e age ACC o 94.60%, F1 o 96.82%, SE o 97.49%, and PPV o 98.96%. Fo he P egnancy da abase, we achie ed an a e age ACC o 95.66%, F1 o 97.44%, SE o 98.07%, and PPV o 97.44%. The ob ained esul s show ha he HR ela ed pa ame e s we e de e mined accu a ely o mos o he eco ds, ou pe o ming he o he s a e-o - he-a app oaches. The poo e quali y o ce ain signals ha e caused de ia ion om he es ima ed HR o ce ain eco ds in he da abases. The p oposed algo i hm is compa ed wi h ce ain well es ablished algo i hms, and has p o en o be accu a e in i s ECG ex ac ions. The e al elec oca diog am ( ECG) e eals he s a e o he e us. I con ains clinically impo an in o ma ion ega ding e al well being and can be used o iden i y possible pa hological s a es, such as myoca dial ischemia, in apa um hypoxia, o me abolic acidosis. These li e h ea ening condi ions mani es hemsel es as changes in he equency bu also he mo phology o he ECG signal, whe e he la e canno be accessed using he con- en ional means o moni o ing1. Non-in asi e e al elec oca diog aphy (NI- ECG) is one o he mos p omising me hods ha has shown eliable esul s o long e m moni o ing o e al hea a e ( HR)2. This echnique eco ds elec ical po en ials using he elec odes placed on he ma e nal abdomen. The signals measu ed a e a mix u e o bo h ma e nal and e al componen s and a signi ican amoun o noise (such as noise om he ma e nal muscle and o gan ac i i y) o e lapping in ime and equency domains. Mo eo e , he magni ude o he e al componen is small compa ed o he magni udes o he es o he signals (especially ma e nal componen ), which makes he accu a e ex ac ion o clinically ele an ea u es challenging3. Howe e , he de elopmen o ad anced signal p ocessing me hods makes he ECG ex ac ion possible, and hus, his me hod could become a use ul ool in he clinical p ac ice o obs e ics and gynaecology o con inuous and non-in asi e e al moni o ing. OPEN 1Depa men o Cybe ne ics and Biomedical Enginee ing, Facul y o Elec ical Enginee ing and Compu e Science, VSB-Technical Uni e si y o Os a a, 17. lis opadu, Os a a 708 00, Czechia. 2Depa men o Compu e Science, Facul y o Elec ical Enginee ing and Compu e Science, VSB-Technical Uni e si y o Os a a, 17. lis opadu, Os a a 708 00, Czechia. 3Cen e o A i icial In elligence Resea ch and Op imisa ion, To ens Uni e si y Aus alia, 90 Bowen Te ace, B isbane, QLD 4006, Aus alia. *email: [email p o ec ed] 2 Vol:.(1234567890) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ Many di e en me hods ha e been in oduced o ECG signal ex ac ion om abdominal ECG signals1,4–6. Adap i e il e s a e known o p oduce p omising esul s1. Howe e , he e icacy o he adap i e ex ac ion sys ems s ongly depends on he quali y o he inpu signals, pa icula ly by he e e ence inpu (i.e. ho acic ma e nal ECG), ha may be a ec ed by he ma e nal mo ion, b ea hing ac i i y o unsui able con ac o he elec ode wi h he skin a he ho acic a ea. The e o e, i could be qui e complica ed o main ain he signal’s high quali y in he clinical p ac ice. Fo his eason, se e al au ho s6–8 used an al e na i e app oach o adap i e ex ac ion, whe e he e e ence ma e nal signal is es ima ed di ec ly om he abdominal inpu s by using, o example, blind sou ce sepa a ion, such as Independen componen analysis (ICA)9 o P incipal Componen Analysis (PCA)10,11. Bo h PCA and ICA me hods decompose he inpu signal in o i s sou ce componen s. These wo me hods, hough use ul in ex ac ion o ECG h ough he emo al o a i ac s and noise, ha e some d awbacks. Wi h ICA, hough highe inpu s leads o highe p ecision in esul s1, i also leads o highe dimensionali y and highe compu a- ional complexi y. In mos o he cases, he p incipal componen ound in abdominal inpu co esponds o he ma e nal componen 9. The pe o mance o he PCA me hod dec eases wi h a lowe powe a io be ween he weak sou ce ( ECG) and he s ong sou ce (mECG)9. The e o e, i s use is ideal o cases whe e ma e nal componen is dominan in he abdominal mix u e. O e he pas ew yea s, a lo o s ochas ic op imisa ion echniques ha e eme ged. They can be classi ied in se e al ways: g adien , e olu iona y, swa m based and many mo e. Amongs he mos commonly known g adien me hods a e he Leas Mean Squa e (LMS) and Recu si e Leas Squa e (RLS) algo i hms. Gene ic algo i hm is he mos popula e olu iona y based op imisa ion algo i hm. Swa m based algo i hms use he social beha iou o animals. A popula algo i hm unde swa m based algo i hm is Pa icle Swa m Op imisa ion (PSO)12. Some mo e op imisa ion me hods a e: A i icial Bee Colony (ABC)13, Cuckoo sea ch algo i hm14, Fi e ly algo i hm15, Dolphin Pa ne Op imiza ion algo i hm16. These algo i hms op imise he cos unc ion using he hun ing and sea ch pa e ns o animals. One such algo i hm, which is also inspi ed by na u e, is G ey Wol Op imise (GWO) p oposed by Seyedali Mi ajalili e al.17. In his pape , a no el hyb id algo i hm is p esen ed ha uses GWO me hod wi h a non-blind me hod called Sequen ial Analysis (SA) o ex ac he ECG. Using a na u e-based algo i hm along wi h an al eady exis ing algo i hm o op imise one o mo e pa ame e s is expanding in a ious ields. The ield o ECG ex ac ion is an a ea whe e he e is s ill as scope o conduc ex ensi e esea ch ela ed o op imisa ion using me a-heu is ics o obse e how well i pe o ms. The SA uses a p io i in o ma ion abou he signal o ex ac he ECG. The GWO p o icien ly u ilises he explo a ion/exploi a ion abili ies o op imise he a iables in SA ha would inc ease he accu acy o he esul s. Ou me hod is e alua ed on wo di e en da abases, namely, Labou and P egnancy, which we e ob ained om a publicly a ailable da a se (see “Da ase s”)18. The use o GWO wi h a non-blind me hod, such as SA, is a no el concep in he ield o ECG ex ac ion. Also, he algo i hm is es ed on eal signals and does no ely on he simplici y o he syn he ic da a. As he me hod is s ochas ic, he expe imen on each signal is conduc ed en indi idual imes o assu e epea abili y. The abo e b ie li e a u e e iew shows ha he cu en gap is in he lack o echniques ha would ensu e p ecise ECG ex ac ion o a uni e sal use. Al hough adap i e il e s a e po en ially highly accu a e, hei pe o - mance depends on he sys em se ings ha a e no adjus able acco ding o he a iable condi ions ha appea in clinical p ac ice. This mo i a ed ou a emp o employ a ecen ly p oposed algo i hm called GWO o ex ac ing non-in asi e ECG. This app oach could p o ide a highly eliable solu ion o bo h non-in asi e e al hea a e moni o ing o u he mo phological analysis. The es o he pape is o ganized as ollows: “In oduc ion” p esen s he GWO algo i hm and li e a u e e iew o ECG ex ac ion. “Ma e ials and me hods2” in oduces he p oposed algo i hm. Expe imen al se ups a e p o- ided in “Sequen ial analysis wi h g ey Wol op imisa ion”. “Resul s” p esen s he esul s om he expe imen s. Finally, “Discussion” p esen s, discusses, and analyses esul s. “Conclusion” concludes he wo k and sugges s u u e di ec ions. Ma e ials and me hods This sec ion p esen s he wo algo i hms ha a e in eg a ed. Fi s , he GWO algo i hm is p esen ed, and hen, he de ails o he SA me hod is gi en. This sec ion also p esen s he da ase s used as well as he e alua ion p o- ocol. We con i m ha all me hods we e pe o med in acco dance wi h he ele an guidelines and egula ions. G ey Wol op imise . G ey wol es a e canines ha belong o he Canidae amily. The wol es li e and hun in packs, and a e highly in elligen animals wi h a s ong sense o social hie a chy. The GWO me hod d aws om he social hie a chy and he hun ing mechanism om he ope a ion me hods o a pack o wol es, see Fig.1. The pa ame e s ha lead he me hod a e called alpha( α ), be a( β ), del a( δ ) and in some cases an addi ional pa am- e e is added, named omega( ω ). Acco ding o he ma hema ical model, α is conside ed he bes solu ion. β and δ a e conside ed second bes and hi d bes solu ions, espec i ely. Mu o e al.19 gi es us he h ee ules ha he packs ollows o ca ch he p ey o in case o op imisa ion, ge a global minima. 1. Hun ing and acking he p ey 2. Chasing and enci cling he p ey 3. A acking he p ey These phases a e implemen ed wi hin he GWO o pe o m op imisa ion. The ollowing equa ions a e he ma h- ema ical ealisa ion o he abo e men ioned concep s. The ollowing wo equa ions a e he p oposed ma hema ical model o he enci cling beha iou o he wol es17: 3 Vol.:(0123456789) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ whe e ep esen s he cu en i e a ion, A and C ep esen s he coe icien ec o s, −→ Xp ep esen s he posi ion ec o o he p ey and  X ep esen s he posi ion ec o o a g ey wol . The coe icien ec o A and C a e calcula ed using he o mulae below: whe e 1 , 2 a e andom ec o s in [0, 1] and he alues o a linea ly dec ease om 2 o 0 du ing he i e a ion using he equa ion below: A e he enci cling phase, he wol es en e he hun ing phase. The wol es now ha e a be e knowledge o he loca ion o he p ey (global minima). The alpha (bes solu ion) leads he hun and he es o he wol es a e o ollow. The posi ions o he h ee bes solu ions a e sa ed and ha leads o e e y o he sea ch agen , a.k.a wol es, upda ing hei posi ions acco dingly. The ollowing equa ions a e ma hema ical model o he hun ing beha iou : F om his poin on, he algo i hm di e ges in o wo pa s, namely, explo a ion and exploi a ion. Explo a ion. The g ey wol es (o he sea ch agen s) scan he sea ch space acco ding o he posi ions o alpha, be a and del a. They mo e ac oss he sea ch space away om each o he in sea ch o he p ey and come oge he o a ack he p ey. The ma hema ical model o di e gence o explo a ion is gi en by A wi h andom alues, i  A>1 he wol es di e ge om he p ey in o de o ind a be e p ey. The explo a ion p ocess is also aken ca e by he second coe icien  C . This coe icien gi es us andom alues om [0, 2] as Eq. (4) depic s.  C>1 p o ides a be e explo a ion o ind a be e solu ion han he p e ious. The andom assigning o weigh s helps he algo i hm wi h de ining he dis ance be ween he p ey and he wol es. This p ocess allows he algo i hm o be mo e andom du ing op imisa ion and also helps wi h a oiding local minima. To main ain his p ocess, he  C p o ides andom alues a all imes so as o main ain explo a ion no only in he ini ial i e a ions bu also he inal i e a ions. Exploi a ion. Once he g ey wol es inish he hun ing phase, hey s a he nex phase known as exploi a ion (a acking). The ma hema ical model equi es dec easing alue o a om 2 o 0 du ing he i e a ions linea ly, which means  A is a andom alue in he in e al [− 2a, 2a]. When  A is in [− 1, 1], he nex posi ion o he wol es lies be ween he cu en posi ion o he wol and he posi ion o he p ey. In such a case, � A≤1 is used o con- e ge o he posi ion o he p ey, which is p o ided by he bes h ee i ness solu ions. (1) � D =    � C· −→ Xp( )−� X( )    (2) � X ( +1)= −→ X p ( )−� A·� D (3) � A=2�a·� 1−�a, (4) � C=2·� 2, (5) a( )=2−(2× )/ MaxI e . (6) � D α=  � C1· � Xα− � X  , � D β=   � C2·� Xβ−� X  , � Dδ=   � C 3 ·� Xδ−� X   . (7) � X 1= � Xα− � A1· � Dα , � X 2=� Xβ−� A2·  � Dβ , � X3=� Xδ−� A3·  � Dδ  . (8) � X ( +1)= � X1+ � X2+ � X3 3. α β δ ω Figu e1. G ey Wol hie a chy. 4 Vol:.(1234567890) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ Sequen ial analysis. The SA is a me hod ha uses a p io i in o ma ion abou he ma e nal peaks p oposed by20. This in o ma ion is used o de ec he ma e nal signal and c ea e a empla e using a e aging and scaling me hods. An accu a e o ma ion o he mECG empla e leads o a be e mECG cancella ion. The me hod con- sis s o a scaling p ocedu e, bu ins ead o scaling he a e age o he whole mECG ca diac cycle µ , he scaling is pe o med sepa a ely on he P-wa e, QRS complex, and he T-wa e. This is done in o de o sol e he ime- a ying mo phology o he mECG ha occu s due o b ea hing and mo emen . Wi hin each mECG complex, he P-wa e, QRS complex, and T-wa e a e isola ed. The o al leng h o he mECG window is 0.70s. The mECG window is spli in o he ollowing sec ions: • µR —samples be ween 0.05 s be o e and a e an R peak de ec ed a e conside ed a QRS complexes. • µP —samples be o e 0.20 s be o e he QRS complex a e conside ed P-wa es. • µT —samples be o e 0.40 s a e he QRS complex a e conside ed T-wa es The ma ix wi h he P-wa e, QRS complex and T-wa e ec o s is de ined as: The mECG complex empla e, ˆm is gi en by ˆm=Ma , whe e a is a scaling ec o , a= ( aP aQRS aT ). The alue o a o each ec o is gi en by: The scaling is done in o de o ge he LMS e2 . A e he cons uc ion o he ma e nal empla e, i is hen used o cancel mECG. A QRS de ec o is used o de ec he e al peaks. When using he SA me hod, he scaling ac o alues used o c ea e he ma ix a e c ucial o building a ma e - nal empla e ha adap s o each ma e nal peak. These empla es lead o he elimina ion o he ma e nal peaks in he signal. The elimina ion o he ma e nal componen is only as good as he c ea ed empla e. The app oach p o ided he e adap s o he a ying na u e o he signal using he scaling ec o ha o ms he ma ix. The alue o he scaling ec o o each peak in luences he accu acy o he empla e. To achie e he desi ed accu acy, we p opose, SA combined wi h GWO o gene a e a ma e nal empla e e ec i ely. Da ase s. In his s udy, we used signals om wo eal da ase s a ailable on a public se e , and we e eco ded unde clinical condi ions as pa o esea ch p ojec s a he Depa men o Obs e ics and Gynecology o he Medical Uni e si y o Silesia in Ka owice, Poland. Resea ch was app o ed by he Uni e si y’s Bioe hics Com- mi ee (Commission app o al numbe NN-013-345/02). The subjec s ead he app o al consen o m and ga e a w i en consen o pa icipa e in he s udy. The da ase s analysed du ing he cu en s udy a e a ailable in he igsha e eposi o y in eg a ed wi h Scien i ic Da a Jou nal, de ailed in o ma ion could be ound in18. The aECG signals in bo h da ase s om he abo e men ioned public domain we e eco ded om he ma e nal abdomen using he KOMPOREL sys em. The sensing elec odes we e placed a ound he ma e nal na el line, a common e e ence elec ode was placed o e he pubic symphysis, and a e e ence elec ode was placed on he ma e nal le leg. The di ec ECG signal was eco ded om he e al head using a s e ile spi al elec ode. The signals we e digi ized wi h a 16-bi esolu ion and a sample equency o 500Hz o aECG signals and 1000 Hz o di ec ECG signals. The in o ma ion ega ding bo h o he da ase s is summa ized in Table1. The Labou da ase con ains 12 eco ds o 5 min om women in ad anced p egnancy be ween 38 and 42 weeks o p egnancy. Each eco d con- ains 4 aECG signals, and he eco d also includes a di ec ECG signal simul aneously eco ded om he head o he e us using he scalp elec ode. The P egnancy da ase con ains 10 eco ds o 20 min om women be ween (9) M =             |00 µp 00 | 00 0|0 0µQRS 0 0|0 00 | 00µT 00 |             . (10) a =  MTM −1 MTm . (11) e2=min|µa−m|2. Table 1. Summa y o he da ase s used o he expe imen s. In labou Subjec s Week o p egnancy Leng h (min) Leng h (samples) Labou Yes 12 38–42 5 × 4 × 12 150,000 × 4 × 12 P egnancy No 10 32–42 20 × 4 × 10 598,900 × 4 × 10 Summa y – 22 32–42 1040 31,156,000 5 Vol.:(0123456789) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ 32 and 42 weeks o p egnancy. Each eco d also con ains 4 aECG signals, bu in his case, no di ec e e ence ECG has been eco ded. Bo h da ase s con ain anno a ions wi h he exac posi ions o he QRS complexes de e mined by he au oma ic de ec ion o R-peaks. The accu acy o he QRS posi ions de e mined was con i med by clinical expe s. Un o una ely, he da ase does no include u he in o ma ion ega ding he es ed subjec s which p e en s u he es s o clinical dependency o he me hods wi h he anamnes ic da a o in ol ed subjec s. E alua ion p o ocols. Con a y o o he ields, i is no possible o simply use objec i e me ics such as SNR, RMSE, and o he s. This kind o assessmen is only possible when he syn he ic da a is used, whe e he ou - comes o en do no co espond o hose ob ained in expe imen s wi h eal signals. The main eason is ha he ideal ECG signal is no a ailable in case o eal signals. The only signal ha can be ob ained in he case o ECG measu emen is he di ec ECG acqui ed using he e al scalp elec ode (FSE). Howe e , his signal does no ully co espond o he e al componen in he aECG signal due o he dispe sion caused by he signal p opaga ing om he e al o he ma e nal body, which esul s in mo phological changes o he abdominal ECG componen . The e o e, he FSE signal is only accep able as e e ence (so-called sil e s anda d) o he HR-based assessmen bu no o ully assess he mo phology o he signal1. The app oach in e alua ion o he esul s in ECG ex ac ion is hus no a simple ask. In his s udy, we included di e en me hods ha a e ei he p e alen in he li e a u e o clinically ele an o he diagnos ic pu - poses. The e alua ion p o ocol consis ed o h ee pa s ha aimed a assessing he algo i hm’s abili y o eco e he ECG signal om he composi e abdominal mix u e. These h ee main pa s di e ed bo h in he pa ame e s used o he assessmen and he pu pose hey we e selec ed o as desc ibed below: 1. E alua ion o he R-peak de ec ion accu acy— o his pu pose, we used a commonly used objec i e e alua ion me ics de ined in he ollowing subsec ion. These me ics a e commonly used in he ield o ECG ex ac ion and hus allow o he compa ison wi h o he s a e-o - he-a me hods. 2. E alua ion o he clinically impo an ea u es— he clinical ea u es de i ed om he ex ac ed signals a e mo e impo an o he clinical e alua ion o he R-peak iden i ica ion and hus hey a e mo e sui able o demons a e he clinical use o he me hod. 3. E alua ion using he signal quali y indices— his is an addi ional pa ame e assessing he o e all quali y o he ou pu signal. E alua ion 1: R-peak de ec ion accu acy. De e mina ion o his pa ame e is used in a ious publica ions ocused on ECG signal ex ac ion and de e mina ion o R-peak posi ions, such as21,22. To calcula e he selec ed pa ame e s, he alues o he peaks de ec ed in he ex ac ed signals we e loca ed and compa ed wi h he e e - ence anno a ions. Based on ha , hese peaks we e ca ego ized as he ue posi i e (TP), alse posi i e (FP), o alse nega i e (FN). The TP peaks a e he R-peaks in he ex ac ed signal, which lie wi hin ± 50ms in e al om he e e ence anno a ions. De ec ed R-peaks in he ex ac ed signal, which all ou side he men ioned in e al, a e de e mined as FP. Finally, he omi ed R-peaks a e de e mined as FN, which we e o be de ec ed in he men- ioned in e al, bu we e missing he e. A e de e mining hese pa ame e s (TP, FP, and FN), i is possible o calcula e ollowing objec i e e alua ion pa ame e s: accu acy (ACC), sensi i i y (SE), posi i e p edic i e alue (PPV), and he F1 sco e (a ha monic mean o he SE and PPV) using Eqs.(12)–(15), espec i ely23. E alua ion 2: clinically impo an ea u es. Mo eo e , besides he s a is ical me ics e alua ing he accu acy o he R-peak iden i ica ion, we also compu ed he R-peak-de i ed clinical ea u es o demons a e he clinical usabili y o he me hod. To compa e he alues ob ained om he ex ac ed signal, we used he clinical pa am- e e s p o ided by he au ho s o he da abases used (see24), namely he Basal HR and HR luc ua ions, which does no co espond o he o icial nomencla u e. Addi ionally, i is unclea how hese alues we e ob ained, he au ho s only p o ide he a e age alues summa ized in a able. Ou alues we e ob ained acco ding o he de ini ions o HR cha ac e is ics and pa e ns p oposed by he Na ional Ins i u e o Child Heal h and Human De elopmen (NICHD)25: • Baseline a e— he mean bpm ( ounded o 0 o 5) o e a 10-min in e al, excluding pe iodic changes, pe iods o ma ked a iabili y, and segmen s ha di e by mo e han 25 bpm. • Va iabili y— he luc ua ions in baseline ha a e i egula in ampli ude and equency. These luc ua ions a e isually quan i a ed as he ampli ude o he peak o ough in BPM. (12) ACC = TP TP +FP +FN ·100(%) . (13) SE = TP TP +FN ·100(%) . (14) PPV = TP TP +FP ·100(%) . (15) F 1=2· SE ·PPV SE +PPV ·100(%) . 6 Vol:.(1234567890) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ Fo he sake o clea ness in e ms o he nomencla u e, we no e ha he Baseline a e and Va iabili y co espond o he Basal HR and HR luc ua ions in24, espec i ely. Finally, he accu acy o he esul s was also assessed isually using he main pa ame e used in he clinical p ac ice— he HR aces. Thus, o demons a e he clinical easibili y o he ECG echnique and he p oposed ex ac ion sys em, we depic ed he HR aces de e mined using he ex ac ed signals along wi h he HR aces ob ained om e e ence anno a ions. To plo bo h es ima ed and e e ence HR aces, i was necessa y o de e - mine he bea - o-bea HR (using he in e al be ween he indi idual R-peaks) and o use a mo ing a e age wi h a window leng h o 30 samples. E alua ion 3: signal quali y indices. The e is a a ie y o SQI me hods in he ECG domain di e ing in hei ca ego y. The SQI me hods can be ca ego ized as ime o equency based, de ec ion based o ECG speci ic app oaches. Amongs hose me ics a e adap a ions o adul ECG SQI algo i hms. The SQI me hods also di e in e ms o hei equi emen o inpu channels (single channel o mul ichannel me hods). Fo he pu pose o his s udy, we included wo me ics also included in26,27: sSQI and kSQI (skewness and ku osis, espec i ely). Sequen ial analysis wi h g ey Wol op imisa ion In his sec ion, he p oposed p ocess o SA wi h GWO (SA-GWO) algo i hm is p o ided. The p oposed algo i hm is a combina ion o he GWO and he SA me hod. Figu e2 illus a es he p ocess om ob aining he signals o inally ex ac ing he ECG. A close look also e eals he posi ioning o he abdominal elec odes ( AE1,AE2,AE3,AE4 ) ha we e used o ob ain he inpu signals. The inpu signals (abdomi- nal ECGs) i s go h ough p e-p ocessing, which emo es baseline wande and powe -line in e e ence om he inpu signals. The nex s age is o de ec he ma e nal QRS peaks o c ea e empla es ha would ma ch he indi idual pa s o he mECG cycle: P wa e, QRS complex, and T wa e, leading o hei elimina ion in he nex s age. The PCA me hod is used o selec he p inciple componen om he abdominal signals co esponding o mECG. Following s age is he in eg a ion o SA wi h GWO, which would p o ide wi h he op imal ma ix alues o c ea e a empla e ha ma ches he ime- a ying mo phology o he mECG signal. The p ocess o SA wi h GWO is u he illus a ed in Fig.3. The PCA me hod is used again o enhance he ECG componen in he es ima ed signal o u he imp o e he HR de ec ion. The quali y o he de ec ed ECG has o pass he s a is ical analysis, which is desc ibed in he ollowing sec ion. Figu e3 illus a es he in ake o he inpu signal, he de ec ion o ma e nal peaks, and he ea e he p ocess o he ECG ex ac ion. The SA me hod a e ages all he mECG cycles and a e ages hem. The windowing p o- cess sepa a es he h ee sec ions o he ma e nal cycle, which a e: P-wa e, QRS-complex, and T-wa e; a ma ix is c ea ed o s o e hese alues. As we know, each ma e nal cycle has a ime- a ying mo phology. The nex s ep, known as scaling, is pe o med o adap each c ea ed cycle o he o iginal cycles in he inpu signal. The alues gi en by he scaling ec o is c ucial o gain he adap ed mECG cycle. He ein, we used he GWO algo i hm o op imise hese alues in o de o gain a be e scaling ec o o he pa icula inpu signal. Once he signal is adap ed o he pa icula mECG cycle, i is elimina ed om he o iginal signal. This p ocess is epea ed o each de ec ed mECG cycle, hence, lea ing wi h he ECG signals. Once ex ac ed, hese ECG signal is sen o u he quali y assessmen as shown in Fig.2. The eason o in eg a e SA-GWO is o ob ain an op imal alue o he scaling ec o , a, desc ibed in he p e i- ous sec ion. Th ee op imal alues a e selec ed o he h ee sec ions o he ma e nal cycle based on he upda ed posi ion o he sea ch agen s. GWO algo i hm wi hin he SA unc ions in he ollowing manne : P ep ocessing (FIR il e ) SA me hod PCA me hod ACC, SE, PPV and F1 QRS de ec ion QRS anno a ions CWT de ec o GWO PCA me hod and CWT de ec o mQRS de ec ion AE1AE2AE4 AE0 AE3 N aECG1 aECG2 aECG3 aECG4 ECGPCA PCA + mQRS ECG1 ECG2 ECG3 ECG4 Figu e2. Block scheme o p oposed expe imen . 7 Vol.:(0123456789) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ s ep 1: The sea ch agen s a e ini ialised by assigning andom posi ion alue o he agen s o he scaling ec o , a. s ep 2: The g ey wol op imise uns o each de ec ed mECG o gi e he h ee op imal scaling ac o s, which is ob ained om he alpha posi ion o indi idual pa s o he mECG cycle: P wa e, QRS complex, and T wa e. s ep 3: The newly c ea ed empla e is hen used o elimina e he ma e nal componen in he inpu signal. s ep 4: The g ey wol op imise is gi en he ollowing objec i e o minimise: Inc easing he numbe o i e a ions and he numbe o sea ch agen s inc eases he complexi y bu can gi e a sligh ly highe accu acy a he cos o an inc ease in compu a ional ime. The compu a ional complexi y o he algo i hm in such cases can be add essed by using he p ocessing speed o a ield-p og ammable ga e a ay (FPGA), which would imp o e bo h ime and powe consump ion28. Though we ha e selec ed GWO o he pu pose o ex ac ing ECG, we canno conclude ha GWO is he only op imise i o pe o m he ask discussed in he pape . The esul s a e u he discussed in he ollowing sec ion. Resul s This sec ion shows he esul s o he expe imen s on eal da a assessed using he e alua ion p o ocols de ined abo e. The esul s o he pa ame e s ACC, SE, PPV and F1 a e summa ized in Table2 o bo h he Labou and he P egnancy da ase . Fo he Labou da ase , acco ding o he ACC pa ame e s, a highly accu a e ex ac ion was achie ed, i.e. a alue highe han 95.00% , o all eco ds excep o eco d 03. Fo eco d 03, he alue o he ACC pa ame e was low ( 58.13% ), which was caused by a high numbe o FN and FP alues (169 and 225, espec i ely). Such a low ex ac ion accu acy could p obably lead o an inaccu a e diagnosis o he e al heal h s a e. Fo he P egnancy da ase , he ACC alues we e lowe han 95.00% o eco ds 02, 06, 07 and 10, bu in his case he d op in accu acy was no so signi ican (in all ou cases he ACC alues we e ≥88.00% ), which should no a ec he esul ing diagnosis o he e al hypoxia. Rega ding SE, PPV and F1 pa ame e s, alues highe han 95.00% we e achie ed o all h ee pa ame e s o all eco ds excep 03 (SE = 76.40% , PPV = 70.85% , F1 = 73.52% ) o he Labou da ase and o all eco ds excep 10 o he P egnancy da ase . Addi ionally, no FP o FN alues we e de ec ed o eco d 10 om he Labou da ase , and all ou pa ame e s eached he alues o 100.00% . Simila ly, he 08 eco d om he same da ase de ec ed no FP alues and only one FN alue, esul ing in a PPV o 100.00% . (16) J =min N  n=1 (inpu signal −mECG empla e)2  (17) J=MSE(inpu signal −mECG empla e) De ec ed mECG cycles mECG1 mECGn A e aged mECG cycle and windowing Ma ix c ea ion Sub ac ion Ex ac ed ECG signal Inpu aECG signal mmm P epa ed mECG signal Scaling coe icien s Adap ed mECG cycle (M · a) . . . Figu e3. Block scheme o he SA wi h GWO. 8 Vol:.(1234567890) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ Since he p oposed algo i hm is o s ochas ic na u e, we an he algo i hm mul iple imes o eco d he mini- mum accu acy a e age and maximum accu acy a e age. We conduc ed 10 independen uns o he algo i hm o each combina ion in bo h da ase s o assu e i s epea abili y unde he same condi ions. Fo he Labou da ase , he minimum accu acy achie ed om he a e age o all he signal combina ions was 94.07% , and he maximum accu acy achie ed om he a e age o all he signal combina ions was 94.60% . As o he o he pa ame e s, we ob ained he a e age alues as ollows: F1 o 96.82%, SE o 97.49%, and PPV o 98.96%. The simila es was pe o med on he P egnancy da ase . The minimum accu acy achie ed om he a e age o all he signal com- bina ions was 94.88% and he maximum accu acy achie ed om he a e age o all he signal combina ions was 95.66% . Fo he es o he pa ame e s, ollowing a e age alues we e achie ed: F1 o 97.44%, SE o 98.07%, and PPV o 97.44%. The e e ence and es ima ed alues o he clinically signi ican pa ame e s o baseline HR and HR a ia ion we e de e mined o bo h da abases and summa ized in Table2. The alues o baseline HR es ima ed om he ex ac ed ECG signals in he Labou da ase de ia ed mos om he e e ence alue in eco d 03 ( he di e ence was 23.02 bpm), in eco d 10 wi h a di e ence o 6.54 bpm and o eco ding 11 wi h a di e ence o 7.37 bpm. In he P egnancy da ase , he bigges de ia ion was obse ed in he eco d 04 wi h a di e ence o 8.46 bpm and in eco d 03 wi h a di e ence o 5.68 bpm. Fo he o he eco dings, he de ia ion alues we e lowe han 5 bpm and can he e o e be conside ed negligible. The lowes di e ence was achie ed in he Labou da ase in he case o he eco d 01 wi h a di e ence o only 0.42 bpm and in he P egnancy da ase wi h eco d 05 wi h e en lowe di e ence o 0.32 bpm. Fo HR luc ua ions, he la ges de ia ion in he Labou da ase was obse ed in he case o eco d 04 wi h a alue o 6.40 bpm, ollowed by a de ia ion in he eco d 01 wi h a alue o 6.37 bpm and a de ia ion in he eco d 03 wi h a alue o 5.42 bpm. Fo he es o he eco dings, as well as o all he eco dings om he P egnancy da ase , he di e ence alues we e lowe han 5 bpm and can also be conside ed negligible. The lowes di e ence was achie ed o he Labou da ase a eco d 08 wi h a alue o 0.70 bpm and o he P egnancy da ase a eco d 06 wi h a alue o 0.4 bpm. The esul s o kSQI and sSQI o bo h da abases a e summa ized in Table3. As hese a e pa ame e s ha a e used o e alua e mainly adul ECG, he e a e no es ablished h eshold alues o anges ha could be used o ECG e alua ion. Fo hese easons, we will use he knowledge ha is used in he adul ECG. Acco ding o29, he highe he alue o he kSQI and sSQI indices, he ewe ou lie s equi alen o noise he signal con ains, and hus he signal is o be e quali y. Fo kSQI, i i s alue is highe han 5, he signal is o high quali y. Acco ding o he esul s in Table3, he alues o kSQI >5 we e achie ed o all eco dings in bo h da ase s, and acco ding o his pa ame e , all ex ac ed signals we e o high quali y. Acco ding o kSQI, he highes alue, and hus he bes ex ac ion, was achie ed o he Labou da ase wi h he 07 eco d wi h a alue o 21.12 and o he P egnancy da ase wi h he 04 eco d wi h a alue o 55.09. Con e sely, acco ding o kSQI, he lowes quali y ex ac ion was achie ed o he Labou da ase wi h eco d 03 wi h a alue o 7.73 and o he P egnancy da ase wi h eco d Table 2. E alua ion pa ame e s o he R-peak de ec ion accu acy ob ained by SA-GWO algo i hm es ed on signals om labou da ase and he p egnancy da ase . Da ase Reco ding Pa ame e s TP (–) FP (–) FN (–) ACC (%) SE (%) PPV (%) F1 (%) Labou 01 640 5 4 98.61 99.38 99.22 99.30 02 612 5 25 95.33 96.08 99.19 97.61 03 547 225 169 58.13 76.40 70.85 73.52 04 671 13 10 96.69 98.53 98.10 98.32 05 653 7 7 97.90 98.94 98.94 98.94 06 676 6 8 97.97 98.83 99.12 98.98 07 619 10 13 96.42 97.94 98.41 98.18 08 644 0 1 99.84 99.84 100.00 99.92 09 666 9 8 97.51 98.81 98.67 98.74 10 627 0 0 100.00 100.00 100.00 100.00 11 640 10 6 97.56 99.07 98.46 98.77 12 655 3 2 99.24 99.70 99.54 99.62 P egnancy 01 3101 19 17 98.85 99.45 99.39 99.42 02 2684 51 107 94.44 96.17 98.14 97.14 03 2461 21 96 95.46 96.25 99.15 97.68 04 2760 6 14 99.28 99.50 99.78 99.64 05 2762 7 2 99.68 99.93 99.75 99.84 06 2814 102 65 94.40 97.74 96.50 97.12 07 2962 117 134 92.19 95.67 96.20 95.94 08 2864 64 33 96.72 98.86 97.81 98.33 09 2787 39 29 97.62 98.97 98.62 98.79 10 2427 175 156 88.00 93.96 93.27 93.62 9 Vol.:(0123456789) Scien i ic Repo s | (2022) 12:20159 | h ps://doi.o g/10.1038/s41598-022-24733-1 www.na u e.com/scien i ic epo s/ 07 wi h a alue o 8.80. Rega ding he sSQI, he bes esul was achie ed o he Labou da ase wi h he 08 eco d wi h a alue o 1.19 and o he P egnancy da ase also wi h he 08 eco d wi h a alue o 6.33. The wo s esul s we e achie ed o he Labou da ase wi h he 10 eco d wi h a alue o − 1.94 and o he P egnancy da ase also wi h he 10 eco d wi h a alue o − 1.82. Discussion The esul s p esen ed in he p e ious sec ion demons a ed high e ec i eness o he p oposed sys em in ex ac - ing he ECG signal. In he clinical p ac ice, he HR aces a e moni o ed and isually assessed du ing he p egnancy and he labo o assess e al heal h s a e. To demons a e he applicabili y o he ECG echnique and he p oposed ex ac ion sys em in he clinical p ac ice, we plo ed he HR aces es ima ed om abdominal ECG eco ds along wi h he HR aces ob ained om e e ence anno a ions. The esul ing HR aces o all eco ds om he Labou and he P egnancy da ase a e shown in Fig.4a,c, espec i ely. In he case o he Labou da ase , he es ima ed HR aces copy he end o he e e ence HR ace o all eco ds excep eco d 3. In he case o he P egnancy da ase , he es ima ed HR aces copy he end o he e e ence HR ace o all eco ds excep o eco d 10. This co esponds o he abo e esul s— hese wo eco ds achie ed he poo es esul s in mos o he es ed pa ame e s. To in es iga e he easons why some o he ou pu s we e no as accu a e as o he s, we ca ied ou a de ailed analysis o he ex ac ed da a. Fo his in es iga ion we selec ed samples o he signals om eco dings ha achie ed poo esul s ( 3 o m Labou da ase and 10 om P egnancy da ase ) and he signals om eco dings associa ed wi h high accu acy ( 5, P egnancy da ase ). In bo h cases, we plo ed he inpu aECG signal wi h anno a ions and he SA-GWO ou pu . One can no ice ha he inpu signals om eco dings 3 and 10 we e bo h o poo quali y. They a e ei he oo noisy o he a io be ween he ma e nal and e al componen was oo low. Bo h led o he inabili y o he algo i hm o ex ac ECG signal o su icien quali y. Fo 3 eco ding, he e al peaks we e hidden in he noise, which was o he same ampli ude and hus hey we e inco ec ly de ec ed— his led o high amoun o alsely de ec ed peaks and hus highe HR han he one in he e e ence signal. This is p ominen also in he lowe alues o objec i e pa ame e s (ACC = 58.13% , SE = 76.40% , PPV = 70.85% , F1 = 73.52% ). In 10 eco ding, he ou pu signal con ained ma e nal esidue o ampli ude compa able wi h he e al peaks. These we e alsely de ec ed as e al R-peaks and, simila ly as in he p e ious case, led o highe HR in he esul ing ace. Again, his esul ed in dec eased alues o he e alua ion pa ame e s (ACC = 88.00% , SE = 93.96% , PPV = 93.27% , F1 = 93.62% ) in compa ison wi h he emaining eco ds (excep 03, which besides he ma e nal esidue also con ained signi ican amoun o noise). In con as , when inspec ing he signals on he examples om he 5 eco ding, whe e he ex ac ed signals a e o high quali y, he ma e nal componen Table 3. Resul o Basal HR, HR luc ua ions, Ku osis and skewness analysis o he labou da ase and he p egnancy da ase . Da ase Reco ding Baseline a e Va iabili y kSQI (–) sSQI (–)Re . (bpm) Es . (bpm) Re . (bpm) Es . (bpm) Labou 01 129.04 129.46 7.20 13.57 10.58 1.12 02 133.69 132.91 7.60 9.17 12.76 1.13 03 148.83 171.85 14.70 20.12 7.73 − 0.30 04 137.42 141.34 9.20 15.60 11.75 − 0.48 05 133.05 134.00 6.90 8.80 15.45 − 1.52 06 136.92 138.70 9.50 8.20 12.11 − 1.01 07 126.88 126.09 6.40 8.30 21.12 − 1.47 08 129.09 133.26 7.20 6.50 12.83 1.19 09 134.93 138.26 9.00 4.60 9.93 − 0.85 10 125.47 132.01 6.70 8.30 16.15 − 1.94 11 130.40 137.77 7.10 8.70 15.75 0.88 12 131.47 132.92 8.10 6.40 11.53 0.84 P egnancy 01 156.56 157.53 14.10 12.80 13.56 − 1.62 02 140.58 136.45 11.20 15.83 13.00 − 1.81 03 128.92 123.24 7.20 7.70 17.08 1.79 04 139.47 147.93 11.70 14.90 55.09 − 1.40 05 138.88 139.20 10.50 9.40 15.63 1.99 06 144.70 147.05 11.30 10.90 50.53 − 1.16 07 156.04 157.70 15.41 11.40 8.80 − 0.71 08 145.91 146.59 12.50 16.60 14.41 6.33 09 143.44 145.38 11.60 9.20 37.38 0.97 10 131.60 133.46 10.00 13.90 14.53 − 1.82