Method Article
Digitalization of colourimetric sensor arrays for volatile fatty acid detection in anaerobic
digestion
Jacob J. Lamb
a,b,*, Kristian M. Lien
b, Dag Roar Hjelme
aaDepartmentofElectronicSystems&ENERSENSE,NTNU,Trondheim,Norway
bDepartmentofEnergyandProcessEngineering&ENERSENSE,NTNU,Trondheim,Norway
ABSTRACT
Duringtheprocessofconvertingtheorganicmatterintomethane,manyvolatilefattyacids(VFAs)areproduced duringacidogenesisandacetogenesisphasesoftheprocess.ThemainVFAsofinterestareaceticacid,butyricacid andpropionicacid.AlthoughtheproductionoftheseVFAsareessentialfortheproductionofmethane,theyalso playaninhibitoryroleformanyoftheorganismsinvolvedintheproductionofbiogas.Asaconsequence,the levelsofVFAsproducedinananaerobicdigestermustbemonitored.CurrentmethodologiesforVFAmonitoring areeitherunspecific,orcostly.Therefore,thedevelopmentofasensormethodthatisspecifictothedifferent VFAs,whilemaintainingalowcost,willfacilitatetheloweringofbiogasproduction,aswellasavoidingthecostly biologicalcollapseofthewholebiogasproductionprocess.Here,anarrayofcoloureddyes(colourimetricarray) hasbeenassessedfortheirabilitytodetectlowconcentrationsofVFAswithinthedigestateduringbiogas production.Thismethodologylaysthefoundationforthedevelopmentofasensorsystemforuseinbiogasplants andcouldalsobeexpandedtodetectmanyotherparameterswithinthebiogasproductionprocess.
Easytoestablish.
Lowuserinput.
Accuratemeasurement.
©2019TheAuthor(s).PublishedbyElsevierB.V.ThisisanopenaccessarticleundertheCCBYlicense(http://
creativecommons.org/licenses/by/4.0/).
ARTICLE INFO
Methodname:Digitalizationofcolourimetricsensorarrays
Keywords:Colourimetricsensor,Volatilefattyacids,Anaerobicdigestion
Articlehistory:Received15May2019;Accepted3November2019;Availableonline9November2019
*Correspondingauthor.
E-mailaddress:[email protected](J.J. Lamb).
https://doi.org/10.1016/j.mex.2019.11.002
2215-0161/©2019TheAuthor(s).PublishedbyElsevierB.V.ThisisanopenaccessarticleundertheCCBYlicense(http://
creativecommons.org/licenses/by/4.0/).
ContentslistsavailableatScienceDirect
MethodsX
journalhomepage: www.elsevier.com/locate/mex
SpecificationTable
SubjectArea: AgriculturalandBiologicalSciences
Morespecificsubjectarea: Anaerobicdigestion
Methodname: Digitalizationofcolourimetricsensorarrays
Nameandreferenceoforiginalmethod: NA
Resourceavailability: NA
Methoddetails
Chemicalsensorsappeartobeideallysuitedforbioprocessmonitoringcomparedtomorecomplex on-lineanalysistechniques.WithregardtoVFAdetectiontheyarelowcost,requirerelativelysimple instrumentationandminimalsamplepreparation,andarestraightforwardlyintegratedwithcontrol systems. Available sensor technologies for on-line monitoring of chemical variables include electrochemical,electronic,andoptical technologies[1];however, theiruseinbioreactors maybe severely challengedbylimitedselectivity,repeatability,robustness,andstability[2].Ingeneral,therecan frequentlybeatrade-offbetweensensitivityandrobustnesswhendevelopingnewsensortechnologies.
Onepatharoundthischallengeistoapplyartificialtonguetechnologiesbasedonopticalsensor arrays[1].Foropticalsensors,theanalyteinteractswiththesensormaterial,resultinginchangingthe sensormaterialsopticalproperties.Thesensorarrayisacombinationofavarietyofdyes,eachwith differentspecificitiesfordifferentanalytes.Light,inturn,probesthesensingmaterial.Awiderangeof opticaltechniques,invariousregionsoftheelectromagneticspectrum,areavailableforprobing,e.g., byrefraction,scattering,reflection,absorption,andfluorescence.Probingofmultiplepropertiescan beusedtoenhancethesensorperformance.Thus,artificialtonguesbasedonopticalsensorarrayscan utilizeabroadrangeofmolecularspecificities.Disposablesensorpatchescanbeusedasthechemical indicator-containingmatrix,allowingastraightforwardmodularsetupofthesensor.Thesecanbe placeddirectlyintotheanaerobicdigester,possiblybehinda smallwindow, allowinganexternal opticalcomponenttoanalysethechemicalindicators.Successfulapplicationofopticaltonguesto metalions,foodandbeverages,aminoacids,proteins,bacteria,cancer,anddiseasediagnostichave beenreviewed[3],andthemethodologiesforopticaltongueshaverecentlybeendemonstratedfor useinbiogasproductionmonitoring[4].Table1givesanoverviewofVFAdetectiontechnologiesfor anaerobicdigestionandcomparesthesewithcolourimetricsensorarrays.
Colourimetricsensorarray
Theconceptofacolourimetricsensorarrayisbasedonutilizationofamatrixembeddedindicator.
Theindicatorcontainseitherafluorophore(fluorophoreabsorbslightenergyofaspecificwavelength andre-emitslightatalongerwavelength)orachromophore(moleculesthatservetocaptureordetect lightenergy,wherethechromophoreisthepartthatcausesaconformationalchangeofthemolecule whenhitbylight).Whentheanalyteinteractswiththeimmobilizedindicator,theindicatorsoptical properties(e.g.,absorption, reflection, photoluminescence)change.Colourimetric changescanbe detectedbyilluminatingthewholesensorarraywhileanimagingunit(RGBdigitalcamerawillsuffice inmostsituations)ismountedabove,enablingdigitalimagingofthesensorarray.
Adifferencemapcanbegeneratedbydeterminingthecolourchangebetweenimagesbeforeand afterthechemicalofinterestispresent.TheRGBvaluesoftheindicatordyesarethensubtractedpixel bypixeltodeterminethedifferencebetweenthedyecolourbeforeandafter,yieldingdataforfurther quantitativeandstatisticalanalysis.
Designofcolourimetricsensorarrays
Thechoiceofdyestoincorporateinacolourimetricsensorarrayisdependentontheapplication, andthedyes’sensitivitytoarangeofanalytesorforamorespecificgroupofanalytes.Thedifferent
J.J.Lambetal./MethodsX6(2019)2584–2591 2585
Table 1
Overview and economic analysis of VFA detection technologies used in anaerobic digestion [4].
Sensing technology
Accuracy VFA distinction
Sample pre- processing
Human expertise
Post-sensor data computation
Overall analysis duration (minute)
Initial Cost (USD)
Ongoing costsa (USD)
Addi-tionnal varable detection
TRLb Gas
chromatography
5 5 5 5 2 60 30,000 300 2 6
Titrimetry 3 1 3 3 2 30 15,000 100 1 9
Infrared spectroscopy
4 5 5 5 5 60 50,000 100 3 4
Colourimetric sensors
3 5 2 3 3 2 2,000 100 5 2
Each technology is ranked from 1 (low) to 5 (high) for each category unless otherwise stated.
aRough estimate of consumable costs per year.
b Technology readiness level.
J.J.Lambetal./MethodsX6(2019)2584–2591
dye classesinclude;Lewisacid-base dyes,Brønstedacid-base dyes(i.e.,pHindicatordyes),large permanent dipole dyes for local polarity detection, and hydrogen bonding (i.e., solvatochromic, vapochromic,orzwitterionicdyes),redox-responsivedyesandchromogenicaggregativecolourants [3].Thecolourimetricsensorarrayreliesontheintermolecularinteractionsbetweentheindicatorand theanalyte.Onamolecularscale,allparticlesexertattractiveandrepulsiveforcesoneachother,and theforcebetweentheparticlesmustbestrongtoformachemicalbondoramolecule.Therefore, stronginteractionswillresultinahigherdimensionalityanddiscriminatingpowersforthesensoras chemicalsensingfundamentallyismolecularrecognition.
Although the choice of chemo-responsive dye or fluorophore is the primary factor for the functionalityoftheopticalsensorarray,theresultsmaybeinfluencedbythearraymaterial.Relevant propertiesforsuchmaterialare;inertnesstowardgasesandliquids,highsurfaceareaandresistance toawiderangeofpH.Therearemanydifferentsolidsupportsforthearrayconstruction,suchasacid- freepaper,porouspolymermembranes,castsiliconplatesandsilicagelonthinlayerchromatography (TLC).Independentofthesensormaterial,theanalytemusthaveaccesstotheimmobilizeddyein ordertoreact.Themanufacturingprocessofsucharraysmayinclude,roboticprinting,spincoating andmanualdepositofthedye.
Sensorarrayconstruction
Thinlayerchromatographysiliconeoxide sheets(55811-20EA, Sigma-Aldrich,Germany),were usedasthesensorarrayplates.Smallamountsofthe23dyeswerespottedontothesiliconoxide matrixplateanddriedinanovenat50C.
Illuminationtechniques
Theappearanceofthesensorarrayisalsodependentonthematerialandtheangleofthelight incidentuponit.Illuminationofanobjectcanbedividedintotwogroupsregardingtheorientationof thesource:front-lightingorback-lighting.Differentattributes(e.g.,shape,colour,surfacedefectsand transparency)oftheobjectcanbehighlightedbyalteringtheangleofthesource,whichaffectshow thelightisreflected.Forcolourimetricsensorarrays,thegoalistodetectthecoloursofthedyespots whileminimizingsurfacedetails.Therefore,thepreferredangleofthesourceisasperpendicularas possible.Anotherfactorregardinghowthelightprobesthearrayistheuseofadiffusingmaterial.If thelighthasonlyadirectpathtothearray,itwillproduceanunevendistributionoflighteranddarker spotsintheimage.Thediffusingmaterialsoftensanddispersesthelightprovidingevenlydistributed lightovertheobject.
Imagingtechniques
Imagingcanbeadelicatetaskandthequalityoftheimagedependsonmanyvariables.Amodern digitalcamerahasmanyoptionalsettings,givingtheusertheopportunitytooptimizethecamerafor anygivensituation.Theprimarythreevariablesinfluencingtheamountoflightenteringthecamerais theshutterspeed,aperture,andISO. Itisessentialtounderstandtherelationshipbetweenthese variablesandhowtobalancethemtocaptureacorrectimageoftheobject.Anover-orunder-exposed imageisaresultofapoorbalancebetweentheaperture,shutterandISO,andwillresultinbeingtoo brightortoodark.
Giventhesituationofaperfectexposureoflighthittingthecamerasensor,theformatinwhichthe dataiscapturedisnecessarytoconsider.Usually,thereisachoiceofeitherJPEGorRAWformat.By usingaJPEGfile,thequalityoftheimageiscompromisedasthecameraprocessesandcompressesthe datafromthecamerasensor(CMOSorCCD).Ontheotherhand,usingaRAWfile,thedataisnot compressedorprocessed,thus,savingasmuchdatafromtheimagesensoraspossible.UsingRAW dataisvaluableasitpreservesthedynamicrange.Thedynamicrangeisameasurementofthelight intensitiescapturedandrangesfromthedarkestshadetothebrightestshadeofgreyintheimage.
Therefore,abroaddynamicrangewillspanmorelightintensitiesandgivemorecolourtonesinthe image.Thisisvaluableforacolourimetricsensorarrayasitwillpreservethedimensionality.Unlike
J.J.Lambetal./MethodsX6(2019)2584–2591 2587
JPEGfile,arawfileneedspost-processingwithcomputersoftwaretogainacolourimage.Thisisa massiveadvantageastheusergainsfullcontroloverallthestepsoftheconversion.Furthermore,itis notrestrictedtothebitdepthof8bit/channel.Thus,theimagegainmoretonalinformationperpixel, achievingahigherdimensionalityforthecolourimetricsensorarray.
Astraight-forwardimagingrigcanbeconstructedforoptimalimagingofsensorarrays.Adigital cameraisidealforuseastheimagingunit,andstandardhalogenlightscanbeusedforillumination.
ThecameramustbesettoamanualmodewithanISOspeedof100,whitebalancesettoTungsten, focussetmanually,andallimagessavedasRAWformat.
Digitalimageprocessing
Thecontinuousflowofdigitalimageprocessing(DIP)canbedividedintothreelevels;low-,mid- andhigh-levelprocessing,wherethedifferenceischaracterizedbytheinputandoutputofthese processes. The low-level includes techniques of filtering, contrast enhancement, and image sharpeningandisconsideredasimagepre-processing,whereboththeinputandoutputareimages.
Themid-levelextractsattributefromtheimagethroughmorphologicaloperationsandsegmentation.
Thehigh-levelusestheat-tributestoperformimageanalysisandotherfunctionsrelatedtocomputer visiontogainanunderstandingoftheoutcome.
DIPwithregardstocolourimetricsensorarraysistocalculatethecolourdifferencebetweentwo imagestoproduceadifferencemap.Thisisachievedthroughsimpleimagesubtraction.However,in additiontothedifferencemap,itmustalsoprovidetheaveragevalueof100pixelsofthecentreof everydyespot.Anaturalwaytoachievethisistodetectallthedyespotsintheimageandgainasetof centrecoordinatesofallthedyespots.Thisimpliesamorecomprehensiveapproachinvolvinglow- andmid-levelimageprocessing.
AprogramwasdevelopedwithinMATLABtoprocesstheimagestakenbythecameratogiveRGB differencecoordinatesbetweenbeforeandafteradditionofaspecificVFA.TheRAWimageformat mayalsobeshownasaCR2format,dependingonthedigitalcamerainuse.Thiswasfirstconverted intoaDNGfileusingtheAdobeDNGconverterinanuncompressedformatbeforefurtherprocessing usingMATLAB(Fig.1).
TheimagebuildingphaseoftheprocessusestheCR2imagefileandapplieslinearization,white balancing,demosaicingandcolourspacecorrectiontotheimagefile[5].ThisisshowninFig.2.The nextphase establishes thelocationsofall dyespots ontheimagetogain a setofspecial (x, y) coordinates.Thesecoordinatesarethenusedonthebeforeandafterimagestoautomaticallymeasure
Fig.2.ProcessingstepsforimagebuildingfromaRAWformatimagetoaviewableCR2formatimage.
Fig.1.SchematicshowingtheprocessingstagesoftheMATLABprogramfromtheRAWDNGimagefiletoproduceadifference mapandRGBcoordinatedifferencedataforfurtheranalysis.
colourdifferencesbetweenthedyespotsinresponsetothevariableofinterest(VFAs).Asampling phasecalculatestheaverageRGBvaluesfora10by10-pixelsquareinthecentreofthedyespot.
Thisphaseresultsin2arraysof69datavalues(23dyesby3colourchannels),onefromthebefore VFAadditionimage,andonefromtheafterVFAadditionimage.TheRGBdifferenceisdeterminedby subtractingthebeforeVFAadditiondatavaluesfromtheircorrespondingafterVFAadditiondata values.Thisresultsinonearrayof69differencevalues(23dyesby3colourchannels).
Linearization
Somecamerasapplyanon-lineartransformationofthesensordata.Ascalingofthesensordatais neededastheremaybeanoffsetorarbitraryscalingofthedata.Furthermore,duetoimagenoise, pixelswithavaluelargerorsmallerthanthetheoreticalmayexist.Theequationbellowdescribesthe linearization,wheretheRAWistherawdataandBlackandSaturationisthemeasureoftheminimal andmaximalamountgreylevelrespectively.
Linearizedimage¼ RAWBlack SaturationBlack
Thevaluesarethennormalizedbetween[0–1]whileremappingtheerrorsstemmingfrompotential noise.TheimageisnowaCFApatternimagewithonlyonecolourchannelvalueateachpixellocation (R,GorB).
Whitebalancing
EverypixelintheimageisstillonlyameasuredvaluefromthecapacitorintheCMOSsensor.To obtainacorrectchromaticityforeachchannelintheCFAimage,aprocessofwhitebalancingmustbe performed.Thisprocessinvolvesmultiplicationofawhite-balancefactorwhichisaspecificvaluefor eachofthethreechannels.Thewhite-balancefactorisavectorofthreevalues([R,GandB])andcanbe foundinthemeta-data.ThecamerausedherewasaCanonEOS750Dcamera,whichusesaRGGBCFA pattern,therefore,thewhite-balancefactorsarearrangedinanarrayofthesamesizeandpatternas theCFA image.ThisensuresthateverypixelintheCFAimageismultipliedbythecorrectwhite- balancefactor.Theresultingimageisstillagrey-scaleimageasthepixelsonlyrepresentsonecolour channel(R,GorB).
Demosaicing
Togainacolour image,eachpixellocationneedsanRGBtriplet.Thisprocessisreferredtoas demosaicingandinvolvesinterpolationofthemissingchannels.MATLABhasabuilt-indemosaicing functionthatusesgradient-correctedlinearinterpolation.TheimageisnowanRGBimage;however,it isnotacorrectimageascolourspaceusedisnotwhatthemonitorexpects.
Colourspacecorrection
Toobtainanaccuratecolourimage,aconversionfromthecamera’scolourspacetothesRGBspace mustbeperformed.Thisisachievedbyapplyinga33matrixtransformation.Theprocessinvolves themultiplicationoftwotransformationmatrices,onefromthecameratotheXYZcolourspaceand onefromtheXYZtothesRGBcolourspace.However,thesematricesareoppositetothedirectionof thetransformation;therefore,theoperationmustbeinverted:
cam2rgb¼½xyz2camrgb2xyz1
Theresultingcam2rgbtransformationmatrixisa33matrixwherethecolumnsrepresentthe gainfactorfortheR,GandBchannelsrespectively.Thefirstrowincam2rgbismultipliedwiththered colourplan,thesecondwiththegreencolourplanandthethirdwiththebluecolourplanofthe demosaicedimagetoperformthetransformation.
J.J.Lambetal./MethodsX6(2019)2584–2591 2589
Dyespotdetection
Theprimarygoalofthedetectionistodetectallthedyespotsinthebefore-imageandgainasetof centres[x,y]coordinatesofthesedyespotswithouttheneedformanualinputfromtheuser.These coordinateswillbetheinputforthenextscript”SamplingImages,”wherearegionofinterestwillbe definedbasedonthesecoordinates.Theinput-imageiscontrastenhancedandfilteredinorderto analysetheimagewithedgedetectiontoachievemorphologicaloperations.Theresultingimageisa binaryimageoftheinput,withallthedetecteddyesspots.
Samplingimages
Thesamplingscriptcalculatestheaveragevalueof100pixelsaroundthecentreofeachdyespotin theimage.Thisisachievedbycreating23masks,oneforeachdyespot,whichisusedtoenclose100 pixels(1010squareinthecentreofthedyespot).Thestartcoordinatesforthemasksarebasedon thecentrecoordinatesgainedin theprevious script(Dyespotdetection).However,since amask expandsfromtoplefttobottomright,thecentrecoordinatehastobecalculatedtoalignthecentreof themasktothecentreofthedyespot.Thegeneratedmaskisa1010squareandprovides100pixel- coordinateswheretheR,GandBchannelvaluesarecapturedandaveraged.Thescriptisperformed twotimes,oneforthebeforeimageandonefortheafterimage,resultingintwoarrays(233),where therowsrepresentthedyespots,andthecolumnsrepresenttheaverageR,GandBchannelvalues.
CalculatingRGBdifference
Thered,greenandbluechanneldifferenceforeachdyeiscalculatedbysubtractingthearrayofthe beforeimagefromthearrayoftheafterimage,resultingina233difference-array.Thiswillbethe inputfortheprinciplecomponentanalysis(PCA).DuetotherequirementsofthePCA,thedifference- arrayisconvertedtoa169vectorwherethefirstthreecolumnsrepresenttheR,GandBdifference valueforthefirstdyeandthesecondthreeR,GandBvaluesrepresentstheseconddye,andsoon.
Thedifference-mapshowstheabsolutecolourdifferenceandiscreatedbysubtractingthebefore imagefromtheafterimage.Forabettervisualdifference-map,itispreferablewiththesameradiusfor everydyespotandanentirelyblackbackground.Thisisachievedbycreatingabinaryimage-mask with23identicalcircular“holes.”Thelocationofthe“holes”intheimage-maskisbasedonthecentre coordinatesgained fromthe”Detectingdye spots”script.The image-maskismultipliedwiththe difference-mapand,therefore,the“holes”inthemaskmustbesetto1(white)andthebackgroundto 0(black).Thiswillpreservethecolourofthedyespotwhilegeneratingablackbackground.
Dataanalysis
Principle component analysis (PCA) allows the reduction of high-dimensional data tofewer, linearlyindependentcomponents[1,6].Assessmentoftheprincipalcomponentscanthenbeachieved bythismethodviaassessmentofthevariancethatisinducedbythechangesoccurringwithinthe bioreactor.Plotsusingtheresultingsetofprincipalcomponentsareofteneasiertovisualizethanthe originaldataset,butonlyiftheoriginaldatasetislowdimensionalinastatisticalsense.Therefore, withPCA,classificationispossiblefortherawmaterials,batches,orthestatusofbioreactor[7].
With the RGB difference data obtained in the MATLAB program flow developed, PCA was performedusingtheprogramMinitab.Thedatawasimportedtoachievea696dataarray,inwhich therewere69variables(23dyeseachhavinganRGBdifference),from6differenceindividuals(acetic, propionicandbutyricacidsinhighandlowconcentrationsasshowninTable2).ThePCAwithinthe Minitabprogramcalculatestheprinciple componentvaluesfor eachindividual.AnEigenvalueis calculatedforeachcomponentoftheanalysis,andtheseareplottedinaScreeplot.Thisshowsthatthe firsttwocomponentsusuallycontainmajorityofthedifferentiationdataandareallthatisrequiredto bedisplayedonaScoreplottovisualisethedifferencebetweentheindividuals.
Anexperimentwitha23-dyecolourimetricsensorarraywasperformedusingdigestatefroma manure-fedanaerobicdigestor.Thisdigestatewasdividedintothreeseparatevesselsthatwerekept
anaerobic.Eachvesselwasspikedwitheitheracetic,propionicorbutyricacidtofinalconcentrations of10,5and0.3mM,respectively.Afterexposureofthesensorarraytothedigestateofaspecificvessel, thearraywasimaged.APCAanalysisofthearraysforeachvesselwereanalysedandaPCAofthedata wasperformed.AsshowninFig.3(Scoreplot),thesensorarrayscoulddifferentiatebetweenthe3 VFAswhenusingPCA.
Acknowledgements
JacobLambacknowledgesthesupportfromtheENERSENSEresearchinitiative,andhisresearch wassupportedbyfundingfromtheNorwegianUniversityofScienceandTechnology–NTNU,andthe NorwegianResearchCouncil(project295912).
References
[1]P.Biechele,C.Busse,D.Solle,T.Scheper,K.Reardon,Sensorsystemsforbioprocessmonitoring,Eng.LifeSci.15(5)(2015) 469–488.
[2]K.Boe,D.J.Batstone,I.Angelidaki,OnlineheadspacechromatographicmethodformeasuringVFAinbiogasreactor,Water Sci.Technol.52(1-2)(2005)473–478.
[3]J.R.Askim,M.Mahmoudi,K.S.Suslick,Opticalsensorarraysforchemicalsensing:theoptoelectronicnose,Chem.Soc.Rev.
42(22)(2013)8649–8682.
[4]J.J.Lamb,O.Bernard,S.Sarker,K.M.Lien,D.R.Hjelme,Perspectivesofopticalcolourimetricsensorsforanaerobicdigestion, Renew.Sustain.EnergyRev.111(2019)87–96.
[5]R.Sumner,ProcessingRAWImagesinMATLAB,DepartmentofElectricalEngineering,UniversityofCaliforniaSataCruz, 2014.
[6]S.Stewart,M.A.Ivy,E.V.Anslyn,Theuseofprincipalcomponentanalysisanddiscriminantanalysisindifferentialsensing routines,Chem.Soc.Rev.43(1)(2014)70–84.
[7]M.Defernez,E.K.Kemsley,Theuseandmisuseofchemometricsfortreatingclassificationproblems,TracTrendsAnal.Chem.
16(4)(1997)216–221.
Fig.3.AscoreplotofthePCAofa23-dyecolourimetricsensorarrayinresponsetothreeVFAs[4].
J.J.Lambetal./MethodsX6(2019)2584–2591 2591