# Fileset

[s41467-024-48148-w (1).pdf](https://mdr.nims.go.jp/filesets/e1178c27-ceeb-4f6c-bc4e-a1a0bbe69125/download)

## Creator

[Olga Guselnikova](https://orcid.org/0000-0002-2594-9605), Andrii Trelin, Yunqing Kang, Pavel Postnikov, Makoto Kobashi, Asuka Suzuki, [Lok Kumar Shrestha](https://orcid.org/0000-0003-2680-6291), [Joel Henzie](https://orcid.org/0000-0002-9190-2645), Yusuke Yamauchi

## Rights

[Creative Commons BY Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)

## Other metadata

[Pretreatment-free SERS sensing of microplastics using a self-attention-based neural network on hierarchically porous Ag foams](https://mdr.nims.go.jp/datasets/396820f6-17d2-42a1-8d0c-995840d61dbf)

## Fulltext

Pretreatment-free SERS sensing of microplastics using a self-attention-based neural network on hierarchically porous Ag foamsArticle https://doi.org/10.1038/s41467-024-48148-wPretreatment-free SERS sensing ofmicroplastics using a self-attention-basedneural network on hierarchically porousAg foamsOlga Guselnikova 1,2 , Andrii Trelin3, Yunqing Kang1,4, Pavel Postnikov 2,3,Makoto Kobashi 4, Asuka Suzuki4, Lok Kumar Shrestha 1,5, Joel Henzie 1 &Yusuke Yamauchi4,6Low-cost detection systems are needed for the identification of microplastics(MPs) in environmental samples. However, their rapid identification is hinderedby the need for complex isolation and pre-treatment methods. This studydescribes a comprehensive sensing platform to identify MPs in environmentalsamples without requiring independent separation or pre-treatment protocols.It leverages the physicochemical properties ofmacroporous-mesoporous silver(Ag) substrates templated with self-assembled polymeric micelles to con-currently separate and analyze multiple MP targets using surface-enhancedRaman spectroscopy (SERS). Thehydrophobic layer onAg aids in stabilizing thenanostructures in the environment and mitigates biofouling. To monitorcomplex samples with multiple MPs and to demultiplex numerous overlappingpatterns, we develop a neural network (NN) algorithm called SpecATNet thatemploys a self-attention mechanism to resolve the complex dependencies andpatterns in SERS data to identify six common types of MPs: polystyrene, poly-ethylene, polymethylmethacrylate, polytetrafluoroethylene, nylon, and poly-ethylene terephthalate. SpecATNet uses multi-label classification to analyzemulti-componentmixtures even in the presence of various interference agents.The combination of macroporous-mesoporous Ag substrates and self-attention-based NN technology holds potential to enable field monitoring ofMPs by generating rich datasets that machines can interpret and analyze.Theplastics industry generates ≈400million tons of polymermaterialsannually1. A large portion is eventually deposited in oceans andwaterways, where it becomes divided into tiny fragments <5mm,commonly called microplastics (MPs)2. Inexpensive detection systemscapable of identifying MPs in marine and freshwater environments areneeded to locate sources of MPs and anticipate where MPs could haveconsequential effects on public health1. However, rapidly identifyingMPs in aqueous environmental samples is challenging because: (i)MPsReceived: 22 July 2023Accepted: 21 April 2024Check for updates1National Institute for Materials Science (NIMS), Tsukuba, Ibaraki, Japan. 2Research School of Chemistry and Applied Biomedical Sciences, Tomsk PolytechnicUniversity, Tomsk, Russian Federation. 3Department of Solid-State Engineering, University of Chemistry and Technology, Prague, Czech Republic. 4Departmentof Materials Process Engineering, Graduate School of Engineering, Nagoya University, Furo-cho, Chikusa-ku, Nagoya, Japan. 5Department of Materials Science,Institute of Pure and Applied Sciences, University of Tsukuba, Tsukuba, Ibaraki, Japan. 6Australian Institute for Bioengineering and Nanotechnology (AIBN), TheUniversity of Queensland, Brisbane, QLD, Australia. e-mail: guselnikovaoa@tpu.ru; henzie.joeladam@nims.go.jp; y.yamauchi@uq.edu.auNature Communications |         (2024) 15:4351 11234567890():,;1234567890():,;http://orcid.org/0000-0002-2594-9605http://orcid.org/0000-0002-2594-9605http://orcid.org/0000-0002-2594-9605http://orcid.org/0000-0002-2594-9605http://orcid.org/0000-0002-2594-9605http://orcid.org/0000-0001-9713-1290http://orcid.org/0000-0001-9713-1290http://orcid.org/0000-0001-9713-1290http://orcid.org/0000-0001-9713-1290http://orcid.org/0000-0001-9713-1290http://orcid.org/0000-0002-4743-3247http://orcid.org/0000-0002-4743-3247http://orcid.org/0000-0002-4743-3247http://orcid.org/0000-0002-4743-3247http://orcid.org/0000-0002-4743-3247http://orcid.org/0000-0003-2680-6291http://orcid.org/0000-0003-2680-6291http://orcid.org/0000-0003-2680-6291http://orcid.org/0000-0003-2680-6291http://orcid.org/0000-0003-2680-6291http://orcid.org/0000-0002-9190-2645http://orcid.org/0000-0002-9190-2645http://orcid.org/0000-0002-9190-2645http://orcid.org/0000-0002-9190-2645http://orcid.org/0000-0002-9190-2645http://crossmark.crossref.org/dialog/?doi=10.1038/s41467-024-48148-w&domain=pdfhttp://crossmark.crossref.org/dialog/?doi=10.1038/s41467-024-48148-w&domain=pdfhttp://crossmark.crossref.org/dialog/?doi=10.1038/s41467-024-48148-w&domain=pdfhttp://crossmark.crossref.org/dialog/?doi=10.1038/s41467-024-48148-w&domain=pdfmailto:guselnikovaoa@tpu.rumailto:henzie.joeladam@nims.go.jpmailto:y.yamauchi@uq.edu.auhave similar chemical structures, (ii)MPs exist at low concentrations inthe environmental matrix versus other kinds of organic and inorganicmaterials, and (iii) long-term exposure to the environment can modifythe surfaces ofMPs to obfuscate their chemical structure2,3. As a result,conventional approaches require the isolation of MPs from the envir-onmental matrix, separating them into manageable componentsthrough various preconcentration (i.e., sedimentation, sieving, etc.)and chemical pretreatment (i.e., chemical digestion, etc) methods3.These preconcentration and pretreatment procedures, henceforthabbreviated as “PCPT”, are a significant bottleneck in MP sensingthroughput because complex mixtures typically require 12–24 h4,5before analysis can begin. Eliminating PCPT steps from a sensingworkflow would accelerate the detection of MPs6. Additionally, creat-ing an inexpensive MP sensing workflow that leverages open-sourceautomatedMP classification tools and instruments would open upMPsensing even to resource-limited labs.To create a sensor that omits PCPT methods, the sensor shoulddemonstrate the ability to sense individual particles while having somebuilt-in affinity for MPs. MPs are organic macromolecules that tend toaccumulate on hydrophobic surfaces and are sufficiently large enoughto be strongly governed by capillary forces. To sample the uppermostlayer of water bodies for organisms and particles, researchers usespecialized equipment like Neuston Nets. These nets are designed topassively collect samples by combining physical sieving with capillaryforces, aiding in the study of aquatic environments7. But Neuston netshaveno inherent sensing ability, so theMPs collectedbynets andothercollectionmethods are subjected to laborious PCPTmethods and thenpassed to a method with an analytical readout like visual analysis,thermal/mass spectroscopy, or optical spectroscopy (Suppl. Table 1).Visual analysismethods canuse stereomicroscopes to sort and identifyMPs, but visual methods are susceptible to false-positive/negativeresults as particle sizes decrease8. In contrast to visual, mass spectro-scopy tools like pyrolysis-gas chromatography mass chromatography(pyr-GCMS) can provide chemical information on the polymers pre-sent but require expensive equipment that is not portable and needshighly qualified operators. Optical spectroscopymethods like Fourier-transform infrared (FTIR) or Raman spectroscopy are useful becausethey can identify the chemical structure of MPs and are relativelyinexpensive and portable compared to mass/thermal spectroscopytools (See Suppl. Table 1 for a comparison of different methods).Raman spectroscopy has better spatial resolution than FTIR2, lowerwater interference, and narrower spectral bands. However, the analy-tical identification of MPs with Raman spectroscopy is still limitedbecause their Raman peaks overlap, and the polarizability of mostpolymers is relatively weak and generates autofluorescence9. Surface-enhanced Raman spectroscopy (SERS) is a complementary techniquethat can achieve single-molecule sensitivity by coupling light into thecollective oscillations of free electrons called surface plasmons (SP) onthe surface of nanostructured noble metals10. This form of opticalconfinement enabled by themetal generates intense local electric fieldintensities (|E | 2) corresponding to strong SERS signals from adjacentmolecules. However, |E|2 decays exponentially orthogonal to themetal/dielectric interface11, thus the excitationofmicron-scale analyteslike MPs with SPs is challenging using conventional nanostructuredmetal surfaces12 because only a small section of the particle is excitedby the localized electric field (Fig. 1a). In addition, these surfacesgenerate minimal capillary forces, limiting their ability to trap largeMPs from flowing aqueous solutions. Researchers have made micro-fabricated quasi-3D plasmonic optical grating structures with featuresin the same order as the SERS excitation wavelength13. However, thesemethods are unsuitable for MPs > 1μm, which ismore typical in water-bourne particles and would still require PCPT methods for complexsamples.We hypothesized that SERS could be a viable route to a PCPT-freesensing method for MPs if the length scale of the metal substrate hasmacroscale features and physicochemical affinity to recruit MPs fromaqueous solutionswhile still supporting local electricfields to generatestrong SERS signals (Fig. 1b). In addition, the surface of the metal mustbe sufficiently hydrophobic to recruit MPs from solution and helpamplify capillary forces to trap the MPs in a tortuous macroporousnetwork. Environmental samples contain numerous charged organicand inorganic agents in addition to MPs so this structure should becapable of separating or demultiplexing the MPs from a flowing aqu-eous solution (Fig. 1c). The 3D metal structure would also create amore volumetric-like plasmonmode where the MPs can be excited onall sides by the SP and scattered light for SERS detection of adsorbedspecies. Still, complex samples containing numerous kinds of MPs andother interference agents will generate complex Raman spectra withoverlapping peaks that are difficult to interpret (Fig. 1d), thus por-ous structure alone is unlikely to enable PCPT-free SERS. Recently,researchers have applied neural networks (NNs) to various analyticaldetection techniques to make consequential decisions about themakeup of unknown samples14,15. For example, NNs have enhancedSERS detection techniques to analyze complex mixtures, includingwine and photodamaged DNA16,17. But conventional convolutional NNs(CNNs) begin to deliver lower accuracy judgments with complex andnuanced data that contains long-range dependencies. Simple CNNscan be upgraded using a self-attention mechanism borrowed fromnatural language processing (NLP) models called Transformers18. Self-attention can enable a CNN to simultaneously weigh the relationshipbetween the input data points relative to any part in the sequence andinterpret complex dependencies18,19. Adding self-attention into a CNNarchitecture for SERS (Fig. 1d) should enable the model to identifyspectra containingMPs and allocatemore significanceorweight to thisdata when determining the presence of different MPs. This paperdescribes a sensing workflow that combines porous 3D SERS sub-strates with self-attention-based CNN to physically and computation-ally demultiplex SERS spectra. We tested the workflow on complexmixtures of MPs and various environmental interference agents toaccurately determine the presence of 6-types of MPs (i.e., polystyrene,polyethylene, polymethylmethacrylate, polytetrafluoroethylene,nylon, and polyethyele terephtalate).Results and discussionMacro-mesoporous Ag foams coated with a hydrophobic layerConcave surfaces can exert strong capillary forces on microscaleobjects suspended in water20,21. We hypothesized that convolutedporous metal foams with hydrophobic surfaces could play a dual roleof trapping MPs from solution to facilitate the omission of PCPTtechniques while generating SPs to enable SERS. Light can excite SPson Ag surfaces and propagate tens to hundreds of microns11, enablingthe excitation of MPs trapped deep inside a tortuous network ofmacroporous and mesoporous metal nanostructures22. We initiallyconsidered open-cell macroporous metal foams because they arewidely available in various metals (e.g., Ag, Al, Ni, Ti, etc.) and can bemodified by electrodeposition methods to generate various 3Dmesoporous metals23. We previously developed an inexpensive andscalable method to deposit mesoporous metals (e.g., Au, Ag, Cu) onconductive 2D electrodes by co-depositing block copolymer micelles(BCM) with metal using a simple electrochemical setup23. The size ofthe mesopores can be tuned from 5 to 40 nm in diameter dependingon the diameter of the BCM, and the resulting subwavelength poresinteract strongly with light to enable SERS sensing24,25. In an adaptedprocedure, the commercial 3D silver foam (AgF) was used as theelectrode, enabling Ag+ and polystyrene18000-block-polyethyleneoxide7500 (PS18000-b-PEO7500) BCMs to be co-deposited on the 3Dsurface (Fig. 2a and Suppl. Fig. 1). According to X-ray micro-tomography (µ-CT), unmodified AgF have convoluted macroscalefeatures with an average pore diameter of 262 µmwith a void space of84.1% versus the total volume (Fig. 2b and Suppl. Fig. 2). SEM imagesArticle https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 2show the surface of the AgF at various magnifications and how it iscoated with a mesoporous Ag film (AgM) with an average pore size of28 ± 4 nm in diameter (Fig. 2c–e). This structure is called AgF@AgM toindicate that the mesoporous Ag metal encapsulates the AgF (Fig. 2).The electrochemical active surface area (ECSA) of the Ag foamincreased by 25% after the formation of the mesoporous Ag layer(Suppl. Fig. 3). This deposition method is an example of noble metalmesopores deposited directly on large macroscale 3D metalstructures.Hydrophobization of AgF@AgM could increase capillary forcesand promote hydrophobic interactions to drive the selectivity towardMPs.Moreover, the hydrophobic coating could improve the long-termstability of the Ag surface by limiting oxidation26, while also mitigatingbiofouling by small biomolecules27,28. Diazonium-based surfacechemistry was used to coat the AgF@AgM substrate with a ≈ 2.4 nmthick monolayer of hydrophobic 4-decylphenyl (C10) groups to formthe AgF@AgM@C10 sample (Suppl. Note 1). Diazonium salts sponta-neously interact with noble metal surfaces via a de-diazonationreaction, forming reactive aryl radicals that covalently attach to thesilver surface via Ag-C bonds29. We also used this diazonium reactionto form hydrophilic AgF@AgM@COOH by attaching 4-carboxyphenylgroups, as demonstratedwith x-ray photoelectron spectroscopy (XPS)and Raman spectroscopy (Suppl. Figs. 4 and 5, Suppl. Table 2, andSuppl. Note 1). The addition of the C10monolayermade the Ag surfacehydrophobic, generating a water contact angle (WCA) of 162 ± 2.8°and a surface free energy (SFE) of 30.6mJm−2 (Suppl. Fig. 6 and Suppl.Note 2). But water can still penetrate deep into hydrophobic micro-structured or pillared substrates depending on the local topographicalstructure of the surface30. We flowed solutions containing PS particlesover the substrates using a peristaltic pump to test howwater andMPsinteract with the AgF@AgM@C10 substrate. SEM images of a cross-section of the AgF@AgM@C10 structure show that the PS particlespenetrate deep into the interior of the foam and are randomly dis-tributed throughout the hydrophobic metal network (Suppl. Fig. 7).We found that the AgF@AgM@C10 substrate could capture ≈20×more PS versus the original AgF foam sample (Suppl. Fig. 8).600 800 1000 1200Raman shift (cm  )-1NseqC10H21 C10H21hνSERSTrappedMPsSERSbPhotoexcitation PhotoexcitationaSERScdPSPEPTFEPMMANylonTrained CNNPETCollection of MPs in flow modeStrongE-fieldMPHydrophobic surfaceUnknown MP sampleAttentionlevelSelf-attention mechanism applies weights to spectra01Fig. 1 | Strategy for detection of MPs using porous plasmonic substrates anda self-attention-based NN. a MPs dispersed on plasmonic metal gratings experi-ence strong electric fields, but mainly within the small contact points between theparticle and grating. Capillary forces are also relatively weak on subwavelengthgratings, limiting its ability to collect large (>1μm) MPs from flowing liquids.bMacroporousmetals have large convex/concave surfaces and anopen frameworkthat enables both light and MPs to penetrate deep into the metal network. Tex-turing the metal surfaces with mesopores enables light to excite intense localelectric field intensities that correspond to strong SERS enhancements in adjacentmolecules. Coating the surface with hydrophobic groups facilitates the trapping ofMPs versus small water-soluble molecules. c MPs in environmental samples arerelatively dilute compared to other forms of organic and inorganic matter thus,preconcentration and pretreatment methods are typically necessary before ana-lytical measurement. Our macroporous metals are designed to recruit MPs fromaqueous solution and prevent biofouling. The metal surface also promotes strongelectric field intensities for SERS. (water splash by @pch.vector reproduced withpermission from www.freepik.com, “water splashes flat icon set”; the proteinillustration is based on refs. 76,77) d batches of SERS spectra are collected on themetal sample to obtain the chemical information of the sample. Then a NN calledSpecATNet uses a self-attention mechanism to assign weights to the data. Theweights enable the NN to essentially pay more attention to MP-related spectra andignore less pertinent data, allowing the model to more accurately determine thepresence of various MPs even in complex mixtures.Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 3http://www.freepik.comSubstitution of the hydrophobic @C10 coatings with hydrophilic@COOH carboxy coatings (Suppl. Fig. 9) decreased the PS adsorptioncapacity by ≈3×. Under identical conditions, the commercial SERSsubstrate Klarite 313 captured 43× fewer PS particles thanAgF@AgM@C10. Modifying the AgF substrate with mesopores andhydrophobic groups amplifies capillary and hydrophobic forces forpreferential interactions with MP in water rather than absorbing smallcharged biomolecules31. Simulations can help explain the impact ofmesoporosity of permeability and fluid velocity to help explain theability of AgF@AgM to capture MPs. The µ-CT models of AgF wereartificially textured to mimic the mesoporous surface of AgF@AgMsince µ-CT had insufficient resolution to resolve mesoporosity. Theintroduction of texture to the surface of the model decreases perme-ability and slows fluid velocity (Suppl. Fig. 10). Smaller and more tor-tuous pore pathways are expected to decrease permeability, allowingcapillary forces to become more significant in mass transport, andleading to greater retention offluids andMPs. Slowerfluid velocity alsoenhances capillary forces because capillary forces have more oppor-tunity to distribute the fluid in the porous medium, in addition toenabling other forces like gravity to impact MP retention.Optical properties of AgF@AgM foams and SERS sensing ofMPsIntroducing short-range order in disordered structures can sig-nificantly enhance light absorption32. The resulting mesoporousstructures create short-range order on the surface of the disorderedAgF, which should enhance light coupling to SP modes and increasethe probability that an adjacentmolecule orMP couples with the SP togenerate a Raman scattered photon for SERS sensing. We measuredthe AgF and AgF@AgM samples in UV-VIS (Suppl. Fig. 11), and bothsamples have an absorbance peak at ≈315 nm that matches the inter-band transitions of Ag. The addition of themesoporous Ag generates abroad resonance with a peak at 360 nm that corresponds to the plas-mon resonance. A SEM imageof aflat sectionon theAgF@AgMsurfacewas taken and input into a 3D electromagnetic (EM) simulator (Fig. 3a).Ag-based SERS sensors frequently use λ = 532 nm excitation since itoverlaps with the plasmon resonance. At 532 nm, the electric fieldintensity (|E|2) near the surface of the mesoporous Ag film has variousEM hotspots with locations and intensities that depend on the lightpolarization (Fig. 3b and Suppl. Fig. 12). The simulated reflectancespectrum has a dip at ≈310 nm corresponding to the interband tran-sitions (ITB) of Ag, in addition to a slight dip at 370 nm, and two largerdips at 410 and 515 nm that likely correspond to SPmodes (Fig. 3c). Theaverage electric field intensity at each wavelength was plotted inFig. 3c and hadno peak corresponding to the ITB, but the peaks at 370,410 and 515 nm match the reflectance spectra indicating these areLSPRs. We also examined how the macroporous Ag foam interactedwith light by inputting a 478 µm× 560 µm×450 µm section of the µ-CTscan into the EM simulator. It was excited with a λ = 532 nm Gaussianbeam because that is most similar to a confocal SERS setup (Fig. 3d).The green circle indicates the approximate location of the Gaussianbeam. The polarization plot shows how the metal surface becomespolarized upon excitation, with charge accumulating along the con-cave and convex features of the foam. The simulations indicate that theAgF@AgM structures strongly couple with light and support SP reso-nances λ < 600nm. Using metals like gold or copper should facilitateSP resonances at longer wavelengths.Flat mesoporous Ag films coated with methylene blue (MB,λabs = 665 nm) produced SERS enhancement factors (EF) > 105 whenexcited with λ = 532 nm (Fig. 3e)33. In contrast, AgF generated negli-gible SERS signal under the same conditions. Coating the AgF withmesopores (i.e., AgF@AgM) generated an EF of 2.5×105 EF, ostensiblybecause mesopores generate strong EM hotspots and the convolutedsurface enhances coupling due to the sensitivity of the LSPR to thewavevector of light34.Wemapped the SERS intensity ofMBat 1637 cm−1and observed the strongest signals at open voids created in the foam(Suppl. Fig. 13). The AgF@AgM@C10 sample generated the strongestN2+C10H21C10H21C10H21C 10H 21  Diazonium modificationElectrochemical reduction of AgPS-b-PEO+ ++++Ag AgAgAg Ag1.25 cm0.5 cm500 µm 1 µm 250 nm20 25 30 35 4005101520253035FrequencyPore diameter (nm)28�4 nmab c d eFig. 2 | Preparation and characterization of AgF@AgM@C10. a An illustrationdescribing the electrodeposition method used to coat porous Ag foam withmesoporous Ag to make AgF@AgM. After the co-deposition of Ag and BCMs, themesoporous Ag surface is passivated with 4-decylbenzene diazonium tosylate tomake the films hydrophobic. The passivated substrates are called AgF@AgM@C10.b The AgF was imaged with µ-CT to generate 3D models of the macroporous foamnetwork. The average diameter of the pores is 262 µm, and the void space occupied84.1% of the total volume of the material. c–e SEM images of the AgF@AgMstructure at increasingmagnification. The pore size distribution of themesoporousAg was estimated using SEM and had an average pore diameter of 28 ± 4 nm.Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 4SERS EF (4.0×105) observed versus the other samples. Although the@C10decylphenyl layer increases the distance betweenMBand theAgmetal, which should reduce SERS EF due to the lower EM field furtherfrom the surface, the hydrophobic surface helps recruit hydrophobicmolecules like MB and also limits Ag oxidation35,36. The SERS signal ofMB is 12× more stable on AgF@AgM@C10 than on AgF@AgM afterstorage in air for 1month as seenonAg3dXPS region (Suppl. Fig. 14) orexposure to water for 3 days (Suppl. Fig. 15).The AgF@AgM@C10 sample supports a strong SERS responseand is compatible with hydrophobic molecules. To test theAgF@AgM@C10 as anMP detection system we selected the following6 polymers based on their role in both industrial-derived andconsumer-derived pollution sources, their ability to disperse in freshand marine environments, in addition to their diversity of chemicalstructure, size, and shape (see Suppl. Fig. 16 and Suppl. Note 3): 30 µmpolystyrene (PS), 10-90 µm polyethylene (PE), 300nm polytetra-fluoroethylene (PTFE), 27-45 µm polymethylmethacrylate (PMMA),3 µmNylon, and 20 µm thick polyethylene terephthalate (PET) fiber ofdifferent lengths37 (Fig. 3f and Suppl. Fig. 17). The MPs were quasi-spherical in shape and covered a wide size range from 300nm to90 µm (see Suppl. Fig. 17 for SEM analysis of sizes and morphology).Figure 3g shows manually collected Raman and SERS spectra for the30 µm PS particles deposited on glass versus AgF@AgM@C10. Thepeak at 1005 cm−1 appears in both the Raman (glass) and SERS(AgF@AgM@C10) spectra. We fabricated a mesoporous Ag film onSiO2 and coated itwith decylphenyl groups (AgM@C10, Suppl. Fig. 18).When using glass as the baseline, flat AgM@C10 generated 5× moreSERS signal than glass. AgF@AgM@C10 shows the highest EF of 10×because the volume of the EM-field in pores is large and generatesbigger Raman absorbance than the flat AgM@C10 surface (Fig. 3h).These findings confirm the critical role of macropores in enhancingRaman scattering of MPs. Finally, commercial Klarite substrates wereused to examine the SERS signals from PS MPs. These substrates useAu so they were excited using 785-nm excitation. Klarite generated alower EF at 785 nm than AgF@AgM@C10 at 532 nm. The EF valuesobtained for Klarite are lower compared to the results reported byZhang et al. 12 for smaller PS beads (0.36 to 5 µm), likely because the30 µm PS particles cannot fit into the inverted pyramidal gratings oftheKlarite sensor. Similarmeasurementswere conducted for PE, PTFE,PMMA, and Nylon (Suppl. Figs. 19–21 and Suppl. Table 3). Each poly-mer generates a characteristic array of peaks on theAgF@AgM@C10 substrate. Nonetheless, the same trend in EF wasobserved, with AgF@AgM@C10 showing the highest EF followed byAgM@C10, Klarite, and glass.Researchers typically collect MPs in the environment by trawlingthrough polluted water using Neuston nets or equivalent. These netswere initially designed for collecting plankton and can sieve largevolumes of flowing water38. The 3D porous structure of theAgF@AgM@C10 is intended to be like a Neuston net capable of trap-ping MPs from flowing solutions using a combination of capillary andhydrophobic forces. MPs adsorb and accumulate on the surfaces ofAgF@AgM@C10 due to hydrophobic and capillary forces. We initiallyflowed suspensions of PS (1.06 × 104 particles per liter or MPs L−1)and PE (1.9 × 104MPs L−1) through the AgF@AgM@C10 substrate(Suppl. Fig. 22) for 20min. Later the substrates were dried, andSERS was collected using a confocal Ramanmicroscope. The confocalRaman microscope generates large 2D survey maps of anAgF@AgM@C10 substrate where MPs are distributed randomlythrough the interior and exterior of the foam (Suppl. Fig. 23). The SERSpeaks associated with PS and PE vary over time due to: (i) variations inthe locations of the MPs on the Ag surface, (ii) changes in the polymerspectra due to local gyration of the molecular substituents within the20100|E|²EnnFFFFnOOHNNH nO OnPSPE PTFEPMMANylon012345AgF@AgM@C10AgFAgF@AgMAgMEF for MB (10⁵) 532 nm785 nmEF for PSAgF@AgM@C10AgM@C10Klarite20151050a ce f g hPolarizationdRaman shift (cm-1) SERS RamanPSIntensity (×10³ counts)1.00.80.60.40.20.0400 800 1200OOOO PETnb090070050030080604020Wavelength (nm)ReflectanceAverage |E|-field Intensity0.40.81000.60.21.00100 nm 100 nmFig. 3 | Optical properties and plasmonic performance of AgF@AgM@C10.a SEM image of the AgF@AgM@C10. b The simulated |E|2 distribution of the SEMimage in a atλ = 532nm. c Simulated reflectance spectra and correspondingelectricfield spectrum as a function ofwavelength. d Simulated charge polarizationmapofplasmon on one pore of AgF@AgM using Gaussian beam (indicated by the greencircle). e Comparison of the EF for MB obtained on AgF, AgF@AgM,AgF@AgM@C10, AgM. fAn illustration showing six types ofMPs used in this study:PS, PE, Nylon, PMMA, PTFE, and PET sized by 300–90 µm. g SERS spectra of PS onglass and AgF@AgM@C10 after manual focusing. h A comparison of EF for PS wasobtained on AgF@AgM@C10 and AgM@C10 (at 532 nm) and Klarite (at 785 nm).For e and h, the data represents the mean value with residual standard deviationcalculated from 3 measurements on 3 different samples (N = 3, n = 3).Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 5EM hotspots and (iii) overlapping peaks from different MP types(Fig. 4a). These dynamics make SERS data challenging to interpretbecause it requires the ability to accurately process hundreds or eventhousands of spectra to judge the composition of multi-componentMP mixtures39.Self-attention-based CNN to identify MPs in complex mixturesThe physicochemical interactions between the MPs andAgF@AgM@C10 substrate help separate or demultiplex the SERSsignal from the solvent and interference agents, but these interactionsare not specific enough to enable SERS to identify complexmixtures ofMPs and other interfering agents with a high level of confidence. DeepLearning (DL) models identify patterns in unstructured data andmakestatistical decisions based on these patterns16,17. Convolutional NNs(CNNs) are a class of DL models that can adaptively learn spatialhierarchies of features from input data by learning from examples.Previously, CNNs were used to classify the presence/absence of poly-mers based on vibrational data14,40–42. However, this work mainly usesbinary or multi-class classification, which is sufficient when the pre-diction can be one class of materials but has limited accuracy withcomplex multi-component samples collected in the environment.Multi-label classification methods are more suitable for classifyingcomplex mixtures with multiple polymers.The AgF@AgM@C10 SERS substrates act like hydrophobicsieves to collect MPs from flowing solutions (Suppl. Fig. 22). More-over, the complex surface of the metal helps capture the dynamicnature ofMPs via SERS by exposing theMP ensemble to a wide rangeof excitation conditions. This effect helps ensure that the trainingdataset given to SpecATNet minimizes time and orientation-dependent inhomogeneity of the SERS signals, giving a more rea-listic representation of the MP ensemble (Fig. 4a and Suppl. Fig. 23).In a SERS survey map, each point (S1, S2… Sn) is one spectrum andthus contains information on some unknown fraction of the totalchemical composition of the sample (Fig. 4b). In standard CNNclassification tasks, it is assumed that a class can be determined froma single spectrum43. Alternatively, the Bayesian decision rule44 cancombine information from multiple spectra.We employed an extension to the CNN architecture we call Spe-cATNet (Fig. 4b), which can consumemultiple SERS spectra and makepredictions using the combined information. Each spectrum in theSERS survey is pre-processed with a dense CNN (DenseNet) to trans-form it into hidden representations or simplified encoded pixels (Z1,Z2… Zn) that highlight the amplified chemical features and togetherprovide a condensed summary of the sample (Zsurvey). DenseNet waschosen as a typical DL NNdue to its slightly higher performance versusother DL methods (Suppl. Fig. 24). Still, any NN that helps omit PCPTmethods in SERS identification ofMPs is the primary goal of this work,so experimentation with NNs in the future could be fruitful. Somelocations on the sample contain no MPs or multiple MPs, thus themodel must be trained to apply a weight (W1, W2… Wn) to each cor-responding encoded pixel to reflect the importance of the underlyingchemical information. In other words, applying weights to the datatrains SpecATNet to pay more attention to some data and effectivelyignore less relevant data—this is a guiding principle of the self-attention mechanism used more prominently for NLP18. We modifiedthe self-attention mechanism to assign weights (W1, W2…Wn) to everymeasured survey point (Z1, Z2… Zn) for proper averaging of spectraand generating a reliable Zsurvey to make decisions about the presenceof each MP. Assigning weight via self-attention within SpecATNettraining is advantageous compared to previously described manualaveraging and post-CNN statistical approaches43,44 due to adaptivity todifferent samples. The output of SpecATNet is the probabilities [0 to 1]of the presence of eachMP in the unknown sample visualized later as aconfusion matrix.SpecATNet for MP samples with increasing multiplexityTo evaluate the predictive performance of SpecATNet, we tested itusing samples with increasing multiplexity. In this context, multi-plexity refers to the increasing number and types of MPs present ineach sample (Suppl. Fig. 25). The lowestmultiplexity sample contains a×W1Z1 ×W2Z2 ×WnZn● ● ●surveyZPSPEPTFE PMMANylon OutputSelf-attentionWeightZ1 Z2Z3ZnDenseNetZ1 ZnDecisionDense layerClassificationS1S2S3SnUnknown  sampleZ2 SERS survey dataseta bweightedPETSpectraRaman shift (cm-1)60801004020400 600 1400800 1000 1200Intensity (×10⁴ counts)21.51.00.50Intensity (a.u.) S�S� Sn● ● ●AveragingPSPEFig. 4 | SpecATNet for the analysis of MPs mixtures. a Waterfall plot of sequen-tial SERS spectra for a PE/PS mixture (the violet trace represents the typical spec-trum of PS, while the orange trace represents the typical spectrum of PE). b Thearchitecture of developed convolutional NN SpecATNet, with a self-attentionfunction used to solve amulti-label classification task for 6 polymers (frombottomto top). SERS spectra from unknown samples are collected in the survey dataset.These surveys are pre-processed, submitted to a DenseNet, and converted intoencoded pixels (Z1, Z2… Zn) for pattern extraction. Self-attention is used to weight(W1, W2…Wn) the encoded pixels to generate Zsurvey (averaged summary). A DenseLayermakes themulti-label classification decisions (theprotein illustration is basedon refs. 76,77).Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 6singleMP.Weflowed6different solutions containing oneof theMPs inwater over the AgF@AgM@C10 substrates and collected the SERSsurvey maps (see concentrations in Suppl. Table 4). The SERS surveyswere input into SpecATNet, which assigned a probability with 100%accuracy that each MP was present (Suppl. Figs. 26 and 27a). Forcomparison, ML-based methods using vibrational spectroscopy, suchas support vector machines, have ≈94% accuracy42,45, or 96% accuracyfor CNNs analyzing single MP samples (Suppl. Table 5)46. Lower accu-racy is likely explained by dataset quality; SERS provides high sensi-tivity and intensity of spectra compared to Raman and FT-IR42,45,46. Thestructure of the AgF@AgM substrates combined with SpecATNetenables high accuracy and the ability to collect and identify MPswithout PCPT methods.Next, we examined the AgF@AgM@C10 substrates at low con-centrations of PSMPs to determine under what conditions SpecATNetcan detectMPs in concentrations found in real environmental samples(i.e., 104MPs L−1)47. We flowed a range of PS suspensions in101–104MPs L−1 concentrations through AgF@AgM@C10 and col-lected SERS surveys at each concentration. We increased the numberof spectra input into SpecATNet gradually to find the minimumrequired for a high-accuracy predictions (Fig. 5a). This capability ofSpecATNet to handle varying numbers of spectra and process themconcurrently is an advantage of self-attention-based architectures overcommon CNNs that process single spectrum inputs16,17. Lower con-centrations of PSMPs requiremore spectra to achieve high accuracy. Itis also important to note the tradeoff between computational load andaccuracy because processing more spectra to obtain a high level ofaccuracy requires more resources. Only 3 to 4 spectra are required toidentify PS in a 104 MPs L−1 suspension, in contrast to 10 requiredspectra for 102 MPs L−1. In the case of lower concentrations such as 50to 10MPs L−1, more than 15 spectra are required to achieve highaccuracy. We also collected SERS spectra from a single PS particle—6–8 spectra are required to identify the single particle (Fig. 5b).Importantly, all leading SpecATNet indicators, such as precision, recalland F1 increase with more input spectra, reaching a plateau at10 spectra, with an average accuracy of 96%. (Fig. 5c).Next, we increased the multiplexity of the experiments by exam-ining 2-componentMPmixtures (Suppl. Fig. 25 and Suppl. Table 6). Allpermutations of the 5-MPs in 2-component mixtures are plotted asconfusion matrices to identify cases where the system mislabels thetwo polymer classes (Fig. 5d). SpecATNet has an accuracy of >95%withthese samples; however it is less accurate with polymers that haveIncreasing level of multiplexityd e50 μma bSize of survey set (spectra)0.510.820.940.94110.9811111111111111234567891011121314151617181920Probability0.40.50.60.80.910 0 0 0 0 1 0.680 0 0 0 0.1 1 11 0 1 0 1 0 10 0 0 1 1 1 10 1 1 0.8 1 0.067 11 0 0 0 0 0 0PTFENylonPTFE/NylonNylon/PSNylon/PS/PTFEPMMA/PS/PEPE/PTFE/Nylon/PS/PMMAc1 0.8 0.99 1 0.94 0.91 0.7 0.64 0.631 0.92 1 1 1 0.99 0.7 0.75 0.681 0.95 1 1 0.99 1 0.8 0.8 0.721 0.99 1 1 1 1 0.81 0.81 0.751 0.99 1 1 1 1 0.85 0.85 0.781 1 1 1 1 1 0.87 0.89 0.811 1 1 1 1 1 0.87 0.9 0.821 1 1 1 1 1 0.84 0.91 0.81 1 1 1 1 1 0.94 0.92 0.841 1 1 1 1 1 0.88 0.91 0.871 1 1 1 1 1 0.92 0.95 0.911 1 1 1 1 1 0.91 0.97 0.881 1 1 1 1 1 0.95 0.94 0.921 1 1 1 1 1 0.95 0.95 0.961 1 1 1 1 1 0.95 0.97 0.91 1 1 1 1 1 0.95 0.98 0.911 1 1 1 1 1 0.93 0.97 0.941 1 1 1 1 1 0.93 0.99 0.921 1 1 1 1 1 0.91 0.96 0.981 1 1 1 1 1 0.96 0.99 0.951234567891011121314151617181920Concentration (MPs L-1)10⁴ 10³ 5010² 1025 0 5 10 15 208090100AccuracyPrecisionRecallF1 scoreParameter (%)Input size (spectra)2-component mixtures0 1 1 1 1 0 0 0 0 01 0 1 0 0 1 0 0 0 00 0 0 0 1 0 1 0 1 00 0 0 1 0 0 0 1 0 11 1 0 0 0 0 0 0 1 0.80 0 0 0 0 1 1 1 0 0PE/NylonPE/PMMAPE/PSPE/PTFEPET/PMMAPET/PTFEPET/PSPTFE/NylonPS/NylonPEPMMAPTFEPSNylonPETPredcitedlabelNylon/PMMA0.40.60.8100.2ProbabilityFig. 5 | AgF@AgM@C10 and SpecATNet for analysis of MPs of different com-plexity. a SpecATNet predictions as a function of concentration and number ofspectra for a PS suspension (101–104MPs L−1), and b for the detection of a single PSparticle. c A chart showing how the accuracy, precision, recall and F1 change as thenumber of input spectra is increased for a single PS particle. d SpecATNetpredictions presented in a confusion matrix showing the classification of two-componentmixtures ofMPs and emulti-componentmixtureswith varying levels ofmultiplexity. The row and column indices correspond to the ground truth andpredicted label, respectively.Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 7similar spectral features (Suppl. Fig. 27b). Thus the average accuracy ofthe two-component mixture was 93.7% (Suppl. Fig. 27b). Despite thedifferent structures and sizes of the MP and differences in SERS EFs(Suppl. Figs. 17 and 19), SpecATNet is capable of identifying each typeofMP independent of size and structure. Increasing themultiplexity ofthe samples to up to 5-component MPmixtures (Fig. 5e) resulted in anaverage accuracy of 93.1% (Suppl. Fig. 27b). The lower accuracy withincreasing multiplexity is expected as the number of possible classesincreases. The importance of self-attention in the analysis of multi-component samples is visualized in Suppl. Fig. 27c. Applying self-attention to complex MP samples increased prediction accuracy by≈10% due to better identification of distinct spectral patterns. Nospectroscopic studies have successfully analyzed multi-MP mixtures,especially at low concentrations without PCPT methods. For instance,T. Serizawa et al. analyzed multiple polymer species by peptide-basedfluorescence sensing combinedwith linear discriminant analysis48. Themain limitation was its applicability only to uncommon water-solublepolymers in high concentrations (10mgL−1). In contrast, theAgF@AgM@C10 can detect PS at ≈6000× lower concentration(0.0015mgL−1).In-situ sensing of MPs in unprocessed environmental samplesMPs found in the environment begin as components of plastic pro-ducts that are increasingly pulverized into smaller pieceswith irregularshapes. Physical and biological processes can alsomodify their surfacechemistry49. To generate such realistic MPs, we artificially agedcommercial polymers using a photo-Fenton procedure using oxidantsand UV light50 (Suppl. Fig. 28). Besides beads and fibers, MP shapecan vary widely among fragments, films, and foams (Suppl. Table 6).The size and shape of the MPs changed significantly (Suppl. Fig. 28).Degrading theMPs hadminimal effect on the SERS EFs of the polymers(Suppl. Fig. 29). Environmental MPs samples can originate from dif-ferent sources; therefore the degradedMPs were detected in differentmatrices, namely, simulated matrix (common inorganic (0.5 wt.%,NaCl)51 and organic (0.3mgmL−1 BSA)52 materials, humic acid(10mg L−1)53, algae (3mg L−1, Suppl. Fig. 30), reference groundwatersample ERM-CA616 from Belgium (Suppl. Table 7), synthetic seawater,reference marine sediment enriched by organochlorine pesticides(CRM 7304-a, Japan), and reference soil enriched with Cr (CRM041).Firstly, a mixture of PS, BSA and NaCl was flowed throughAgF@AgM@C10, SiO2, Klarite and flat AgM substrates (Suppl. Fig. 31).The porous structure of the AgF@AgM@C10 sample trapped theMPs,whereas the other substrates did not. If matrix components (BSA andNaCl) are attached to Ag surface, then their SERS peaks would overlapwith the peaks of the MPs and create more complex SERS spectra(Suppl. Fig. 32). To examine the antifouling effect, we flowedfluorescein-conjugated BSA (BSA-FITC) on the AgF, AgF@AgM,AgF@AgM@C10, and AgF@AgMCOOH samples and then imagedthem using fluorescence microscopy (Fig. 6a and Suppl. Fig. 33).Unprotected AgF adsorbed BSA-FITC and generated strong fluores-cence. Fluorescence on AgF@AgM@C10 was suppressed, indicatinglittle BSA fouling. SEM and fluorescence imaging prove that thebd100 μmPSfr/Nylon + algae + sedimentsPS/PET+algaeProbability00.20.40.60.811 0 1 0 00 0 0 1 00 0 1 1 00 1 0 0 10 0 0 0 11 1 0 0.9 0PET/PEfr (sediment)PS/PET (algae)PEfr/PTFE (sewater,algae)PET/PMMA (soil, humic acid)PS/Nylon (alage, sediment)PEPMMAPTFEPSNylonPETPredicted labelacAgFAgF@AgM250 μmAgF@AgM@C10Probability00.20.40.60.810.7 0 0.8 1 10 1 1 0 10 0 0 1 01 0 0 0 00 1 0 0 00 0 0 0 0PE/PS (sim matrix)PMMA/Nylon (sim matrix)PE/PMMA (wastewater)PE/PTFE (seawater)PE/PMMA (humic acid)Predicted labelPEPMMAPTFEPSNylonPETFig. 6 | Analysis of realistic samples containing degraded MPs in differentmatrices. a Fluorescence microscopy images of AgF, AgF@AgM, andAgF@AgM@C10 following protein adhesion tests using BSA-FITC, scalebar is250 µm.bMicroscope images of samples containing algae (3mg L−1), soil (1 g L−1) (asan example of environmental matrix) and degraded MPs and SEM images ofAgF@AgM@C10 after flowing MPs in environmental matrices. Scalebar is 100 µm.c A confusion matrix visualizing the performance of SpecATNet for the analysis ofmultiplexed environmental samples, wastewater, seawater and samples containinghumic acid.dA confusionmatrix visualizing the performance of SpecATNet for theanalysis of the multiplexed samples, containing MPs (PEfr refers to PE fragments),algae, soil, sediments, and humic acid.Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 84-decylphenyl coating of the SERS sensor preferentially attracts MPsand rejectsmatrix components, likely because the absolutemagnitudeof the capillary forces imposed on molecules is small comparedto MPs.Next, we examined the AgF@AgM@C10 samples using the pho-tocatalytically agedMPswithdifferent sizes and shapes in thepresenceof simulated matrix, humic acid, wastewater, seawater, algae, soil, andsediments and analyzed with SERS and then processed through Spe-cATNet (Fig. 6b–d).These samples have thehighest level of complexitydue to their diverse size, shape, and chemical composition. The het-erogeneity of the matrix components further complicates analysis(Fig. 6b). The Raman signals of MPs and the environmental matricesoverlap with each other (Suppl. Fig. 32). However, all samples testedwere identified with an average accuracy of 94% (Fig. 6c, d and Suppl.Fig. 34a). Two 5-component environmental mixtures (Fig. 6c, d) wereidentified correctly; for example, the sample containing aged PET andPS in the presence of algae (Fig. 6d) was identifiedwith 100% accuracy.The sample containing aged PS fragments from foam and Nylon(Fig. 6d) was identified with 97% accuracy. To test the performance ofSpecATNet with a negative control experiment, AgF@AgM@C10 wastreated with BSA/NaCl, wastewater, sediments, soil, algae, and sea-water without any MPs. According to Suppl. Fig. 34b, SpecATNet haslow false-positive performance.The importance of processing multiple spectra simultaneouslywith the self-attention architecture can be understood by evaluatinghow the number of spectra impacts accuracy (Suppl. Fig. 35). Forexample, if SpecATNet is served SERS data in batches with <5 spectra,the accuracy drops to ≈80-90% (Suppl. Fig. 35a). With every additionalspectrum input into SpecATNet, the NN learns proper averaging andreaches maximum accuracy with a minimum 10 spectra. The othertypes of vibrational spectroscopy methods—including methods assis-ted by NNs— have not demonstrated similar performance on MPs incomplex matrices, especially without PCPT methods. More specifi-cally, AgF@AgM@C10 coupled with SpecATNet was compared withother recently reported SERS platforms (Suppl. Table 5).AgF@AgM@C10 outperforms noble metal NP sensors54,55 and com-mercial Klarite12 in its ability to sense diverse MPs (structure, size,shape), complexity of samples, and accuracy at realistic low con-centrations. In a recent report, a SERS substrate basedonporous paperdemonstrated the simultaneous detection of PS and PE at high con-centrations (down to 10mgL−1 or ≈ 1010MPs L −1)56. They used logisticregression to interpret spectra, but binary classification falls short forcomplex samples, as it does not account for nonlinear relationshipsbetween the independent variables, such as multiplexity of data. Incontrast, we analyzed 6 types of MPs with different sizes and shapeswhile suspended in various organic matrices and interference agents.Combining hierarchical macroporous-mesoporous metal foams withthe self-attention-based CNN SpecATNet allowed us to analyze downto 0.00015mgL−1 or 10MPs L −1, allowing our workflow to accessconcentrations found in marine and freshwater samples withoutrequiring PCPT methods.The main alternative method to detect multiplexed samples ispyr-GCMS, which requires PCPT methods57. Timelines were pro-posed for both methods to compare the throughput of pyr-GCMSversus SpecATNet coupled with AgF@AgM@C10 (see Suppl. Fig. 36and Suppl. Note 4). The pyr-GCMSmeasurement itself is relatively fast,but the PCPT methods and spectral analysis require the most time,resulting in ≈0.1 predictions per h (Suppl. Table 1). In contrast, SERS-SpecATNet can generate 2–4 predictions per h, mainly by omittingPCPT methods, resulting in a 20 times faster workflow.Previous reports use multi-class classification to recognize dif-ferent MPs, so we initially used accuracy to compare their perfor-mance with SpecATNet (Suppl. Fig. 27). However, the accuracy ofmulti-label classification models does not account for the specificnature of multi-label problems, where samples can have many labelssimultaneously40,45. Precision and recall are more relevant in thiscontext because they provide deeper insights into model perfor-mance (Suppl. Fig. 37). The level of precision for SpecATNet is from82 to 98%, indicating that it makes many correct positive classifi-cations and a low number of incorrect positive classifications. Recallmeasures the ability of SpecATNet to detect only positive samples.The recall of SpecATNet is 62-95%. Precision-recall curves (PRC)show the precision and recall values at various thresholds (Suppl.Fig. 38a). High precision indicates that positive predictions arereliable, while high recall indicates that the model can capture mostof the positive samples in the dataset. We further generated thereceiver operating characteristic curve (ROC) by plotting the sen-sitivity against the false-positive rate (Suppl. Fig. 38b). The ROCcurve shows sensitivities and specificities significantly higher thanrandom classification. By varying the classification threshold, it ispossible to examine trade-offs between sensitivity (true positiverate) and specificity (true negative rate). A noninformative threshold0.5 was set here since no assumption about price of type I/type IIerrors was made. However, the threshold can be chosen based onenvironmental threat, location of the sample probe, regulatoryrequirements etc. Of the 6 polymers examined, PS and PET have thehighest area under PRC, representing both high recall and highprecision, and there is a tendency in MP recognition reliability:PET > PS > PMMA > PE > PTFE>nylon. The smallest MPs are less pre-cisely recognized versus micron-sized MPs due to their lowerprobability of being measured in the SERS survey. The smaller MPsmay also hide underneath and overlap with the larger MPs. Finally,the balanced parameter F1 score is used to compare SpecATNet withother NN-based systems. The F1 scores for tested MP are within85–96%, within the same level as other NN systems used for binaryclassification of single MPs with FTIR45 or Raman40.We compared averaged F1 scores for all MPs with the F1 scoreobtained from other common machine-learning methods, such as alogistic regression model, decision tree, and support vectormachine (SVM) using our dataset (Suppl. Fig. 39). The linear logisticregression has the lowest F1 score (69.2%) due to its inability tocapture complex, nonlinear relationships in MP mixtures. Thedecision tree method has a higher F1 score (74.6%) due to non-linearity; however, it could have a limited ability to capture andrepresent complex or intricate relationships within the data, leadingto suboptimal predictive performance. The nonlinear SVM model iscapable of recognizing complex mixtures with a F1 score of 82.7%.However, the ability of SpecATNet to combine information frommultiple spectra gives the highest F1 score (89.3%) compared toother prediction approaches.Despite the high performance of the developed sensing proce-dure, there are some features that could be improved with furtheriterations of the SERS sensor, NN and analytical setup. They are: (1) themicropore size of the Ag foam used in this work determines themaximumsizeofMPs–262 µm.However,macroporous templateswithlarger pore sizes or more complex networks could be generated usingadditive manufacturing58. And much larger MPs are commonly deter-mined by visual methods59,60. (2) Ag does not have an indefinite shelf-life. Despite preliminary results show the accuracy in identifying MPmixtures remains consistent after onemonthof air storage for PTFE/PEand PMMA/PS (Suppl. Fig. 40), additional stability studies are needed.Using mesoporous Au would improve stability and enable measure-ments at near-infrared wavelengths. (3) Small Raman spectrometerscan be made inexpensively using off-the-shelf parts (<3600 $ accord-ing to OpenRAMAN)61 but more work must be done to design com-plete optical setups that are easier to deploy even for the mostresource-limited labs. (4) Upgrading of SpecATNet as with any otherNNs requires the collection of a large dataset. For example, aminimum≈4000 spectra are required to introduce additionalMPs with differentchemical structures. Collecting a large and diverse dataset of spectralArticle https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 9data for training CNNs can be challenging, while limited data can leadto overfitting and poor generalization to unseen spectra.In conclusion, we described a SERS sensing platform capable ofidentifying MPs in multi-component samples without onerous PCPTprotocols. The SERS substrate uses physicochemical interactions fromthe macroporous-mesoporous structure and the hydrophobic4-decylphenyl protecting layer to favor the trapping of MPs over smallwater-soluble molecules while stabilizing the metal surface from oxi-dation. Themacroporous-mesoporousmetal foam also enhances lightcoupling and formation of EM hotspots that can generate strong SERSscattering fromMPs trapped inside the porous network. The economiccost of these macroporous networks are ≈10−20× lower than com-mercial SERS substrates and may be further optimized for MP sensingby adapting the deposition method to work on cheaper foam sub-strates such as nickel, conductive polymers or custom 3D printedsubstrates that could also enhance both light absorbance and MPtrapping (Suppl. Fig. 41, Suppl. Table 8, and Suppl. Note 5).To demultiplex information about MP chemical structure fromthe dataset, we designed a NN called SpecATNet to analyze patterns inthe SERS survey spectra and identify MPs. SpecATNet borrows image-like processing algorithms from CNNs that use pixels as input. In ourexperiments, inputs are SERS spectra collected during the survey ofunknown samples. The self-attentionmechanism, borrowed fromNLP,independently assigns weights to each spectrum and then averagesthem to make a final prediction about the presence and structure ofMP. In principle, self-attention-based CNNs can be used with anysource of spectroscopic data—evenmultiple types of spectroscopy—toanalyze multi-component samples to increase accuracy. The porousmetal substrates have sufficient affinity forMPs. The tortuous networkof macropores and mesopores traps MPs from a flowing solution andavoids onerous and time-consuming PCPTmethods. Themetal surfacesurrounds the MPs, enabling the plasmon resonance of the metal togenerate strong SERS signals and convert that data into machine-readable chemical information. The long-term goal of this work is toenable measurements of MPs directly at pollution sources, which canbe analyzedon-sitewith a localNNonaPCor uploaded to the cloud foranalysis. Researchers could further upgrade SpecATNet by training itto identify other hydrophobic MPs, common organic contaminants,polycyclic aromatic hydrocarbons, drugs, and dyes. By mer-ging porous metal structures with self-attention-based NNs into aPCPT-free sensing workflow, people can rapidly identify MPswith varying structures, sizes, and levels of degradation.MethodsMaterialsA 1-mm thick sheet of silver foam with an average pore diameter of0.16mm was purchased from Axel. Silver nitrate (ACS reagent,≥99.0%), 4-decylaniline (97%), p-toluenesulfonic acid monohydrate,bovine serum albumin (≥98%), ethanol, wastewater (ERM-CA616), soil(Chromium VI – Soil, RTC CRM041-030), synthetic seawater(SSWS30) and tetrahydrofuran ( ≥ 99.9%) were purchased from SigmaAldrich and used without additional purification. Tert-butyl nitrite(>90.0%) was purchased from TCI Chemicals. Humic acid (practicalgrade) was purchased from Fujifilm Wako. Marine sediments withpolychlorinated biphenyls and organochlorine pesticides (NMIJ CRM-7304-a) was purchased from the National Metrology Institute of Japan.Polystyrene-b-poly(ethylene oxide) diblock copolymers with Mw18,000 gmol−1(PS) and Mw 7500gmol−1(PEO) molecular weight sub-units were acquired from Polymer Source (PS18000-b-PEO7500). Com-mercial SERS surfaces were used in this study: Klarite® 313 (RenishawDiagnostics, Ltd). PS beads (30μm)and free-flowingPTFEbeads (1μm)were purchased from Sigma Aldrich. Nylon−12 beads (5 µm) werepurchased from Toray Plastics. PMMA beads (27–45μm) and PE beads(10–90μm)werepurchased fromCosperic. PET fiber and expandedPSfoam (polymer kit 1.0) were purchased from Hawaii Pacific UniversityCenter for Marine Debris Research. For the flow experiments, we usedμ-Slide I Luer cell with a channel height of 0.8mm, width of 0.5mm,and length of 50mm (Ibidi). Spirulina powder was purchased fromTree of Life (Japan). To convert MP concentration from mg L−1 to MPsL−1, the size distribution was considered (Suppl. Fig. 17) following Eq. 1,according to ref. 62:CMPs per L =Cmg per L*109π6� �×ρ×PDn × Pn� �3 , ð1ÞWhere ρ is the density of polymer in g cm−1, Dn is the diameter of theMP bead in µm, and Pn is the percent content of this frac-tion. Recalculated values are given in Suppl. Table 4.Preparation of degraded MP. Photo-Fenton oxidation of MPs wascarried out in a photoreactor equippedwith an EvoluChemPhotoRedOxBox (HepatoChem, USA). The average light intensity was ≈1.0mWcm−2(at 365nm). 0.40mL of 20mM FeCl3 and 0.45mL of 30% H2O2 wereadded to 19mL water containing 0.15mgL−1 MPs under vigorous stir-ring. The irradiation time was different for each polymer: PE (3 h), PS(24h), Nylon (24h), PTFE (72h), PMMA (24h), PET (24h), 3 to 5mmdiameter PS pieces were grated with a nickel foam (pore size ≈ 180 µm)to obtainmicrosized pieces, PE film pieces (preliminary ground to ≈150-500 µm). After irradiation, the MPs were centrifuged (7000×g, 15min)two times: washing with water in the first step, then methanol in thesecond step, and finally dispersing the MPs in 20mL ofwater (Suppl. Fig. 28).Preparation of MP solutions that mimic environmental samples.Real environmental samples contain protein and salt. To mimic thesesamples, we mixed 1.6mL of bovine serum albumin (BSA; 30 mg L−1)and 1.6mL of 0.5% NaCl with 0.4mL of an MP solution (0.15mgL−1).Thismixturewas sonicated in awater bath for 1min to homogenize thesample and then used for analysis. The algae sample was grown inGuillard’s (F/2) Marine Water Enrichment Solution for 7 days, washedby water via centrifugation (3000×g, 3min, 3 cycles), and used in3mg L−1 concentration (dried algae). Humic acid was used in 10mgL−1according to ref. 53. Soil and sediments were used in 1 g L−1 con-centrations. The following ratios were used to prepare the complexmixtures: algae/seawater – 1:1; humic acid/soil (Cr) – 1:1; algae/sediments – 1:1.Preparation of AgF@AgM. The procedure was adapted from an ear-lier report63. 5mg of PS18,000-b-PEO7,500 block copolymer wasmixed in1mL of THF and stirred in a water bath at 40 °C for 1 h to fully dissolvethe polymer. Micelle formation was previously examined with TEM63.Then 0.5mL of EtOH, 0.5mL of aqueous AgNO3 (40mM), 0.5mL ofHNO3 (0.5M), and 3mL of dionized water were added to the polymersolution in this order, and then the solution was maintained at 0 °C inan ice water bath. All electrochemistry experiments were performedusing an electrochemical workstation (CH Instruments 660E). Imme-diately before the electrodeposition experiments, the Ag foam(0.5 × 0.7 cm2) was placed in a solution of 3.5M HNO3 for 15min toremove the surface oxide layer and thenbrieflywashedwithwater. Theelectrodeposition process was performed using a 3-electrode setupthat included a working electrode of Ag foam, a reference electrode ofAg/AgCl, and a counter electrode composed of Pt wire. During theentire electrodeposition experiment, the 3-electrode setup was keptice-cold (0 °C). Electrodeposition proceeded at -0.25 V for 1000 s.After the deposition, the AgF@AgM substrates were rinsed with THFovernight to remove residual PS-b-PEOandother solvents. Suppl. Fig. 5confirms the absence of PS-b-PEO-related peaks after washing. Afterthe removal of micelles, well-defined porous structures can beobserved in SEM. The deposition temperature was held at 0 °C toprevent the Ag+ ions from spontaneously reducing in solution withoutArticle https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 10applied potential. SEM images indicate that the AgM coats 95% of theAgF surface. Some patches of missing pores are likely due to the non-uniform potential caused by the convoluted surface duringelectrodeposition.Preparation of AgF@AgM@C10. 4-decylbenzenediazonium tosylate(ADT-C10) and 4-carboxybenzenediazonium tosylate (ADT-COOH)wereprepared according to an earlier report64. The AgF@AgMwas immersedin a freshly prepared MeOH:H2O (3:2) solution containing 1mM ADT-C10 for 1 h. The freshly passivated AgF@AgM@C10 substrate waswashed with water (2 times) and EtOH (2 times).Deposition of MPs on AgF@AgM@C10. In the typical experiments,the AgF@AgM@C10 (0.5×0.5 cm2) substrate was placed inside the μ-Slide I Luer cell (Ibidi, USA), which is typically used for flow experi-ments. 100mL of the MP solution was cycled through the cell using aperistaltic pump at 5mLmin−1. To determine the sensitivity ofAgF@AgM@C10 to MP concentration, different PS suspensions con-taining 101 to 104 particles per liter (MPs L −1) were cycled through thecell at 5mLmin−1. For the experiments with low concentrations of PS(<100MPs L −1), the circulation time was 1 h. The MP suspension wasinitially prepared by weight concentrations (mgL−1) and furtherrecalculated as particles per liter (MPs L −1) considering the size dis-tribution based on ref. 62. For example, the 15mg L−1 sample wasinitially prepared by adding 3mg of PS powder to 200mL of solution(198mL of water and 2mL of EtOH) and then sonicated for 30min toprevent adsorption to themixing vessel. Lower-concentration sampleswere prepared by diluting the 15mgL−1 solution. For example, the0.15mgL−1 PS suspension was prepared by diluting the 15mg L−1 sus-pension ×100 to generate a final volume of 200mL. 100mL of thissolution was flowed over the metal foam sensors via recirculation.Further dilutions were performed in a similar manner. Afterward,AgF@AgM@C10 was removed, dried in air, and analyzed.Optical simulations of mesoporous Ag films and macroporousAg foams. A 500 nm× 500 nm section of the mesoporous Ag surfacewas taken from a SEM image and converted into a 2D mesh by repre-senting the pores and surrounding environment as air (refractiveindex, RI = 1) and the Ag metal using optical constants described byMcPeak. The mesh was imported in an EM modeler (Lumerical-Ansys)as a 50-nm thickmesoporous film and placed on a thick slab of Ag. Themesoporous film was illuminated with a plane wave, and reflectancewas monitored from a location 1000 nm above and parallel to thesurface of the mesoporous metal film, while the local intensity of theEM field was monitored 3 nm above the film. Ag foams measured byX-ray CT were converted into STL files. A 478 µm× 560 µm×450 µmsection of the Ag foam was input into the EM modeler as a 3D meshobject. The surface charge distribution of the foam surface was mod-eled to observe how light coupled to the surface and formed gradientsthat suggest the presence of surface plasmon polariton modes.Ramanspectroscopymeasurements. Ramanspectraof theMPswerecollected on an old JASCO NRS3100 spectrometer (produced 2005)with 532nm laser excitation (laser power at sample, 6mW) and aresolution of 2 cm−1 (600 gmm−1 grating) spanning 1400 to 400 cm−1.SERS survey spectra are measured using mapping mode with a ×20objective (Olympus UMPlanFl ×20/0.46 NA BD objective, 3.0mmworking distance). In mapping mode, the objective is parked over thesubstrate and then scanned over various areas from 0.1 × 0.1mm2 to0.3 × 0.5mm2 with a collection time of 10 s per point. For the calcula-tions of EFs, a minimum of three values have been measured andintensities were used with standard deviation (SD) calculated from Nspectra according to the relation SD=ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiP x��xN�� ��q, where x is the inten-sity of the Raman signal, �x is the mean of the intensities, and N is thenumber of spectra used.Raman spectra on gold-based Klarite substrates were collected ona Renishaw inVia Reflex Raman Microscope with 785 nm laser excita-tion (laser power at sample, 20mW) and a 1200gmm−1 grating. Thespectra were acquired using a ×20 objective and a 10 s collection time.3D mapping measurements were performed on inVia™ confocalRaman microscope (Renishaw, United Kingdom) with 532 nm (6mW,10 s for each exposure). The map of one selected area (584μm× 584μm×60μm) was acquired with a resolution of 8μm×8μm×20μm inX, Y, and Z.EFcalculation. Calculation of the SERS EFwasperformed according tothe standard relation: EF = ISERS=CSERSIRS=CRS, where the ISERS and IRS representthe Raman scattering intensities on SERS-active and reference siliconsurfaces, and CSERS and CRS are the corresponding concentra-tions of R6G.Formeasuring of IRS on silicon 10−1 Mof R6Gaqueous solutionwasused. To accurately estimate the number of molecules excited by theconfocal microscope, a ×20 objective lens with a 1.1mm beam waistwas illuminated through a container with a depth of 3mm. Assumingthe Gaussian beam excites a volume that is roughly the shape of acylinder, we can estimate the volume excited by the beam using theEq. 2:V =0:5 ×D×π×h ð2Þwhere D is the beam waist, and h is the height of the container. Bymultiplying the concentration of the solution (in molecules µm−2) bythe beam volume, we can estimate the number ofmolecules excited inthe Raman reference measurement (CRS).µ-CT 3D images. The 3D models of the Ag foam material wereobtained with an X-ray μCT system SKYSCAN1275 (Bruker, USA) with acurrent of 85 kV and a voltage of 114mA. The rotation step was 0.2°.Electrocatalytically active surface measurements. Electro-catalytically active surface areas (ECSAs) of the samples were obtainedin N2-saturated 0.5M H2SO4 with a scan rate of 50mV s−1 based on thepeaks of reduction of Au/Ag oxides in the potential range of -0.4 to0.4 V vs. Ag/AgCl from cyclic voltammetry65,66. The electrochemicallyactive surface areas (ECSAs) were calculated using the charge asso-ciated with the reduction of oxide by integration by Eq. 3:ECSA=QQrefð3Þwhere,Q is specific capacitanceof the electrodeof electrode in cm2 perscan rate V s−1 and Qref is reference specific capacitance of gold.Scanning electronmicroscopy. Themorphology of the samples werecharacterized using a Hitachi SU-8000 field-emission scanning elec-tron microscope at an accelerating voltage of 10 kV.Wettability measurements. The surface energies of the Ag substrateswere measured using the OWRKmodel via the contact angles of waterand ethylene glycol. All measurements were performed at room tem-perature on a VCA Optima-XE at ten positions with a dropvolume of 2μL.X-ray photoelectron spectroscopy. XPS was performed using aThermo Fisher Scientific XPS NEXSA spectrometer with a mono-chromated Al Kα X-ray source operating at 1486.6 eV. XPS surveymeasurements used a pass energy of 200 eV and an energy resolutionof 1 eV.High-resolution XPS spectrawere collected using a pass energyof 50 eV and an energy resolution of 0.1 eV. The analyzed area was 200µm2, and a flood gun was used for charge compensation.Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 11Optical measurements. The absorbance spectra of AgF andAgF@AgM were collected using a JASCO V-770 spectrophotometer.Fluorescence microscopy. To test antifouling properties the AgF,AgF@AgM, and AgF@AgM@C10 were each placed separately inside aLuer cell, then a 1mgmL−1 BSA–FITC solution was cycled through thecell at 5mLmin−1 for 10min. Afterward, the sampleswere removed fromthe cell and thoroughly rinsed with deionized water. Fluorescenceimaging was performed on a confocal microscope (Leica TCS SP5) andan appropriate light filter (450nm excitation; 550nm emission).Adsorption capacity measurements. For adsorption capacity mea-surements AgF, AgF@AgM, AgF@AgM@C10 and AgF@AgM@COOHsubstrates were placed inside the μ-Slide I Luer cell, typically used forflow applications. 100mL of the PS suspension (1mgL−1) was cycledthrough the cell at 5mLmin−1 using a peristaltic pump. The adsorptioncapacity was calculated as a difference in mass before and afterexposure to PS suspension adsorption divided by substrate mass.Calculation of SD for wettability, surface free energy, and adsorp-tion capacitymeasurement. For the calculations, aminimumof threevalues have been measured, and they were used with SD calculatedfrom N measurements according to relation SD=ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiP x��xN�� ��q, where x isthemeasured value, �x is themean of themeasured values, and N is thenumber of measurements used.SpecATNet architecture. SpecATNet is a combination of commonlyused CNNs and Transformers. A DenseNet-like architecture was usedas the CNN component due to its successful application in therecognition of Raman spectra67,68, providing good performance andfast convergence while being relatively simple. DenseNet is a type ofdeep-learning NN where sequences of input data are processed step-wise. The convolutional backbone size was restricted to a single Den-seNet block. The network parameters were optimized by grid searchwith a HyperBand pruning strategy69.The SERS survey dataset from each sample has been collected in amappingmode consisting of points (S1, S2… Sn) over the scanned area.DenseNet served as an encoder for SERS data. Each spectrum (S1, S2…Sn) was transformed into a hidden representation (Z1, Z2… Zn) toreduce the sequence dimension. Further, SpecATNet combinesrepresentations of all spectra; that is, it reduces the sequence dimen-sion followed by weighting the reduced representation to generatefinal predictions with the fully connected layer. For the weighting, theself-attention layer was implemented after DenseNet. Attention dyna-mically adjusts the weights of individual elements in a sequence set,where the importance of each element is determined by its relation-ship to the others. After passing the self-attention layer, the data isreduced by simply averaging along the sequence axis. The output ofthe convolutional backbone for every input spectrum is reduced to thesize 64 by a single fully connected layer and is passed to a scaled dot-product attention18 with a single head. The output of the attentionlayer is averaged and directly connected to the last fully-connectedlayer, which outputs logits (i.e. predictions).Dataset and trainingThe list of collected spectra is in Suppl. Table 6 and availablefrom ref. 70.Data pre-processing. Raw Raman spectra were background-subtracted with the arPLS algorithm71, then cosmic spikes wereremoved by detecting them based on derivative value and removingthemvia interpolation. Finally, spectrawerenormalized by subtractingthe mean and dividing by the standard deviation. Since multiplespectra are available for a single sample, splitting them into trainingand validation sets is unnecessary. Instead, the splitting should bedone on a sample level, with all the spectra of a sample put in the samesplit. Additionally, it wasnecessary to generate sequences of spectraofthe desired length using the following algorithm:Given: samples Sp1…SpN, set of spectra for every sample,sequence length L, batch size B1. Randomly choose a single sample Spi from available samples.2. Randomly sample (with replacement) L spectra from the set of Spispectra3. Repeat steps 1 and 2 until B sequences are collectedIn this way, we inherently guarantee that the probability of beingselected is the same for each sample, even though different numbersof spectra are available for different samples. We also use samplingwith replacement, which ensures that it is always possible to get asequence of the desired length even if there is an insufficient numberof spectra.Data balancing. Although the sampling algorithm balances the con-tributions of individual samples, the relative abundance of polymersdiffers between samples, which might to data imbalance. The multi-label classification can be considered asmultiple binary classifierswithshared weights, therefore, every polymer would have approximatelythe same abundance (0.5 in the best case) to guarantee that all of themwill be equally important for the NN. The most straightforward strat-egy is random oversampling, i.e., repeating minority class to balancethe data. Despite being trivial for multi-class classification, searchingfor oversampling coefficients becomes an NP-complete task of integerprogramming. The task is formulated as:Given the binary matrix A (with dimension Nsamples x Nclas), con-taining multi-hot encoded labels for every sample in the dataset, findthe integer vector x, such that ATx=Nsamples ≈ 0:5,0:5,:::½ �, 8xi ≥ 1.This task has been reformulated as optimization and solvedusing SCIP solver72. Precisely, the objective is: min jjATx �bjj+0:1maximum xð Þ where b= 0:5,0:5,:::½ �*Nclas under constraint8xi ≥ 1 ^ xi ≤ 5 The constraint and penalty on maximum value of x isadded to force the solver to select dense solution (near all samplesare oversamples with small coefficient) rather then sparse solution(only several sample are oversampled with high coefficient). Afterobtaining the solution, fictitious samples were generated by copyingexisting ones and adding them to the dataset.NN training. The data was split into training and test sets in a 10-foldcross-validationmanner to train the network. The networkwas trainedusing sharpness-aware minimization73 with a stochastic optimizationmethod called AdamW74 as the base optimizer (learning rate = 1 × 10−3,weight decay =0.1). The data sequence length was randomly chosenfrom 4 to 32 for every training iteration. The network was alwaystrained for one epoch; any further training was found to destabilizevalidation metrics. Increasing regularization does not influence vali-dation metrics destabilization.Ablation studyWe studied the influence of self-attention block and sharpness-awareminimization on network performance. For the former case, the self-attention was removed so that the averaging was performed directlyon every spectrum embedding. This led to a ≈ 3% decrease in the finalcross-validated accuracy. Replacing the sharpness-aware optimizerwith a simple AdamW led to a ≈ 1% decrease in accuracy.Machine learning methods for comparisonFor comparison, we used classical algorithms such as logistic regres-sion (LogReg), SVM, and decision trees (DT) to classify individualspectra. We transformed it into multiple binary classification tasksusing the MultiOutputClassifier from scikit-learn to handle multi-labelclassification. We pre-processed the spectral data by normalizing andArticle https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 12reducing its dimensionality to 32 components throughPCA, optimizedvia grid search. The evaluation was performed using a 10-fold cross-validation approach.Reporting summaryFurther information on research design is available in the NaturePortfolio Reporting Summary linked to this article.Data availabilityThe data that support the findings of this study are available fromKaggle70, Zenodo75, and from the corresponding authorsupon request.Code availabilityCodes are deposited at Zenodo75 and are available from the corre-sponding authors upon request.References1. Lim, X. Z. Microplastics are everywhere - but are they harmful?Nature 593, 22–25 (2021).2. Ivleva, N. P. Chemical analysis of microplastics and nanoplastics:challenges, advanced methods, and perspectives. Chem. Rev. 121,11886–11936 (2021).3. Nguyen, B. et al. Separation and analysis of microplastics andnanoplastics in complex environmental samples. Acc. Chem. Res.52, 858–866 (2019).4. Zhao, S., Danley,M.,Ward, J. E., Li, D. &Mincer, T. J. An approach forextraction, characterization and quantitation of microplastic innatural marine snow using Raman microscopy. Anal. Methods 9,1470–1478 (2017).5. Dehaut, A. et al. Microplastics in seafood: Benchmark protocol fortheir extraction and characterization. Environ. Pollut. 215,223–233 (2016).6. Adhikari, S., Kelkar, V., Kumar, R. & Halden, R. U. Methods andchallenges in the detection of microplastics and nanoplastics: amini-review. Polym. Int. 71, 543–551 (2022).7. Tokai, T., Uchida, K., Kuroda, M. & Isobe, A. Mesh selectivity ofneuston nets for microplastics. Mar. Pollut. Bull. 165, 112111 (2021).8. Kotar, S. et al. Quantitative assessment of visual microscopy as atool for microplastic research: recommendations for improvingmethods and reporting. Chemosphere 308, 136449 (2022).9. Lenz, R., Enders, K., Stedmon, C. A., MacKenzie, D. M. A. & Nielsen,T. G. A critical assessment of visual identification of marine micro-plastic using Raman spectroscopy for analysis improvement. Mar.Pollut. Bull. 100, 82–91 (2015).10. Blackie, E. J., Le Ru, E. C. & Etchegoin, P. G. Single-molecule sur-face-enhanced raman spectroscopy of nonresonant molecules. J.Am. Chem. Soc. 131, 14466–14472 (2009).11. Barnes, W. L., Dereux, A. & Ebbesen, T. W. Surface plasmon sub-wavelength optics. Nature 424, 824–830 (2003).12. Xu, G. et al. Surface-enhanced raman spectroscopy facilitates thedetection of microplastics <1 μm in the environment. Environ. Sci.Technol. 54, 15594–15603 (2020).13. Stewart, M. E. et al. Quantitative multispectral biosensing and 1Dimaging using quasi-3D plasmonic crystals. Proc. Natl. Acad. Sci.USA. 103, 17143–17148 (2006).14. Kedzierski, M. et al. A machine learning algorithm for highthroughput identification of FTIR spectra: application on micro-plastics collected in the Mediterranean Sea. Chemosphere 234,242–251 (2019).15. Ballard, Z., Brown, C., Madni, A. M. & Ozcan, A. Machine learningand computation-enabled intelligent sensor design. Nat. Mach.Intell. 3, 556–565 (2021).16. Leong, Y. X. et al. Surface-Enhanced Raman Scattering (SERS)Taster: a machine-learning-driven multireceptor platform for mul-tiplex profiling of wine flavors. Nano Lett. 21, 2642–2649 (2021).17. Guselnikova, O. et al. Label-free surface-enhanced Raman spec-troscopy with artificial neural network technique for recognitionphotoinduced DNA damage. Biosens. Bioelectron. 145, 111718(2019).18. Vaswani, A. et al. Attention is all you need. Adv. Neural Inf. Process.Syst. 30, 5999–6009 (2017).19. Chen, J. et al. Transformer for one stop interpretable cell typeannotation. Nat. Commun. 14, 223 (2023).20. Saito, S., Motokado, T., Obata, K. J. & Takahashi, K. Capillary forcewith a concave probe-tip for micromanipulation. Appl. Phys. Lett.87, 1–3 (2005).21. Fan, Z. et al. Capillary forces between concave gripper and sphericalparticle for micro-objects gripping. Micromachines 12, 285 (2021).22. Galinski, H. et al. Light manipulation in metallic nanowire networkswith functional connectivity. Adv. Opt. Mater. 5, 1600580 (2017).23. Lim, H. et al. A universal approach for the synthesis of mesoporousgold, palladium and platinum films for applications in electro-catalysis. Nat. Protoc. 15, 2980–3008 (2020).24. Li, C. et al. Electrochemical synthesis of mesoporous gold filmstowardmesospace-stimulated optical properties. Nat. Commun. 6,1–8 (2015).25. Lim, H. et al. A mesopore-stimulated electromagnetic near-field:electrochemical synthesis of mesoporous copper films by micelleself-assembly. J. Mater. Chem. A 8, 21016–21025 (2020).26. Wang, C. B., Deo, G. & Wachs, I. E. Interaction of polycrystallinesilver with oxygen, water, carbon dioxide, ethylene, and methanol:in situ raman and catalytic studies. J. Phys. Chem. B 103,5645–5656 (1999).27. Beykal, B., Herzberg, M., Oren, Y. & Mauter, M. S. Influence of sur-face charge on the rate, extent, and structure of adsorbed bovineserum albumin to gold electrodes. J. Colloid Interface Sci. 460,321–328 (2015).28. Hughes, Z. E.,Wright, L. B. &Walsh, T. R. Biomolecular adsorption ataqueous silver interfaces: First-principles calculations, polarizableforce-field simulations, and comparisons with gold. Langmuir 29,13217–13229 (2013).29. Ahmad, R. et al. Tailoring the surface chemistry of gold nanorodsthrough Au-C/Ag-C covalent bonds using aryl diazonium salts. J.Phys. Chem. C 118, 19098–19105 (2014).30. Koishi, T., Yasuoka, K., Fujikawa, S., Ebisuzaki, T. & Xiao, C. Z.Coexistence and transition between Cassie and Wenzel state onpillared hydrophobic surface. Proc. Natl. Acad. Sci. USA. 106,8435–8440 (2009).31. Magin, C. M., Cooper, S. P. & Brennan, A. B. Non-toxic antifoulingstrategies. Mater. Today 13, 36–44 (2010).32. Wang, B. X., Liu, M. Q., Zhao, C. Y. & Fang, X. Role of short-rangeorder in manipulating light absorption in disorderedmedia. JOSA B35, 504–513 (2018).33. Guselnikova, O. et al. Surface filtration in mesoporous Au filmsdecorated by Ag nanoparticles for solving SERS sensing smallmolecules in living cells. ACS Appl. Mater. Interfaces 14,41629–41639 (2022).34. Henzie, J., Shuford, K. L., Kwak, E. S., Schatz, G. C. & Odom, T. W.Manipulating the optical properties of pyramidal nanoparticlearrays. J. Phys. Chem. B 110, 14028–14031 (2006).35. He, X. et al. Ultrasensitive detection of explosives via hydrophobiccondensation effect onbiomimetic SERSplatforms. J.Mater. Chem.C 5, 12384–12392 (2017).36. Han, Y. et al. Effect of oxidation on surface-enhanced raman scat-tering activity of silver nanoparticles: A quantitative correlation.Anal. Chem. 83, 5873–5880 (2011).37. Geyer, R., Jambeck, J. R. & Law, K. L. Production, use, and fate of allplastics ever made. Sci. Adv. 3, e1700782 (2017).38. Barrows, A. P. W., Neumann, C. A., Berger, M. L. & Shaw, S. D. Grabvs. neuston tow net: a microplastic sampling performanceArticle https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 13comparison and possible advances in the field. Anal. Methods 9,1446–1453 (2017).39. Lindquist, N. C. & Brolo, A. G. Ultra-high-speed dynamics in surface-enhanced Raman scattering. J. Phys. Chem. C 125, 7523–7532(2021).40. Zhang, W. et al. A deep one-dimensional convolutional neuralnetwork formicroplastics classification using Raman spectroscopy.Vib. Spectrosc. 124, 103487 (2023).41. Paul, A., Wander, L., Becker, R., Goedecke, C. & Braun, U. High-throughput NIR spectroscopic (NIRS) detection of microplastics insoil. Environ. Sci. Pollut. Res. 26, 7364–7374 (2019).42. de Back, H. M., Vargas Junior, E. C., Alarcon, O. E. & Pottmaier, D.Training and evaluating machine learning algorithms for oceanmicroplastics classification through vibrational spectroscopy.Chemosphere 287, 131903 (2022).43. Soares-Filho, W., Manoel De Seixas, J. & Pereira Calôba, L. Aver-aging spectra to improve the classification of the noise radiated byships using neural networks. Proc. - Brazilian Symp. Neural Netw. 1,156–161 (2000).44. Skvortsova, A. et al. SERS and advanced chemometrics – utilizationof Siamese neural network for picomolar identification of beta-lactam antibiotics resistance gene fragment.Anal. Chim. Acta 1192,339373 (2022).45. Yan, X., Cao, Z., Murphy, A. & Qiao, Y. An ensemble machinelearning method for microplastics identification with FTIR spec-trum. J. Environ. Chem. Eng. 10, 108130 (2022).46. Ren, L. et al. Identification of microplastics using a convolutionalneural network based on micro-Raman spectroscopy. Talanta 260,124611 (2023).47. Isobe, A., Iwasaki, S., Uchida, K. & Tokai, T. Abundance of non-conservative microplastics in the upper ocean from 1957 to 2066.Nat. Commun. 10, 1–13 (2019).48. Suzuki, S., Sawada, T. & Serizawa, T. Identification of water-solublepolymers through discrimination of multiple optical signals from asingle peptide sensor. ACS Appl. Mater. Interfaces 13,55978–55987 (2021).49. Huang, S. et al. Recent advances in sampling and sample pre-paration for effect-directed environmental analysis. TrAC TrendsAnal. Chem. 154, 116654 (2022).50. Liu, P. et al. Effect of aging on adsorption behavior of polystyrenemicroplastics for pharmaceuticals: adsorptionmechanism and roleof aging intermediates. J. Hazard. Mater. 384, 121193 (2020).51. Pernetti, M. & Di Palma, L. Experimental evaluation of inhibitioneffects of saline wastewater on activated sludge. Environ. Technol.26, 695–704 (2010).52. Westgate, P. J. & Park, C. Evaluation of proteins and organic nitro-gen in wastewater treatment effluents. Environ. Sci. Technol. 44,5352–5357 (2010).53. Rodrigues, A., Brito, A., Janknecht, P., Proena, M. F. & Nogueira, R.Quantification of humic acids in surface water: effects of divalentcations, pH, and filtration. J. Environ. Monit. 11, 377–382 (2009).54. Chaisrikhwun, B., Ekgasit, S. & Pienpinijtham, P. Size-independentquantification of nanoplastics in various aqueous media usingsurfaced-enhanced Raman scattering. J. Hazard. Mater. 442,130046 (2023).55. Lv, L. et al. In situ surface-enhanced Raman spectroscopy fordetecting microplastics and nanoplastics in aquatic environments.Sci. Total Environ. 728, 138449 (2020).56. Kim, J. Y. et al. 3D plasmonic gold nanopocket structure for SERSmachine learning-based microplastic detection. Adv. Funct. Mater.34, 2307584 (2023).57. Picó, Y. & Barceló, D. Pyrolysis gas chromatography-mass spec-trometry in environmental analysis: Focus on organic matter andmicroplastics. TrAC Trends Anal. Chem. 130, 115964 (2020).58. Saccone, M. A., Gallivan, R. A., Narita, K., Yee, D. W. & Greer, J. R.Additive manufacturing of micro-architected metals via hydrogelinfusion. Nature 612, 685–690 (2022).59. Han, X.-L. et al. Deep learning based approach for automatedcharacterization of large marine microplastic particles. Mar.Environ. Res. 183, 105829 (2023).60. Huang, H. et al. Proceeding the categorization of microplasticsthrough deep learning-based image segmentation. Sci. TotalEnviron. 896, 165308 (2023).61. OpenRAMAN. https://www.open-raman.org/ (2024).62. Leusch, F. D. L. & Ziajahromi, S. Converting mg/L to Particles/L:reconciling the occurrence and toxicity literature on microplastics.Environ. Sci. Technol. 55, 11470–11472 (2021).63. Lim, H. et al. Synthesis of uniformly sized mesoporous silver filmsand their SERS application. J. Phys. Chem. C 124, 23730–23737(2020).64. Guselnikova, O. et al. SERS platform for detection of lipids anddisease markers prepared using modification of plasmonic-activegold gratings by lipophilic moieties. Sens. Actuat. B Chem. 265,182–192 (2018).65. Park, H. et al. Mesoporous gold–silver alloy films towardsamplification-free ultra-sensitive microRNA detection. J. Mater.Chem. B 8, 9512–9523 (2020).66. Fang, J. et al. A general soft-enveloping strategy in the templatingsynthesis of mesoporous metal nanostructures. Nature 9, 1–9(2018).67. Skvortsova, A. et al. SERS-CNN approach for non-invasive and non-destructivemonitoring of stem cell growth on a universal substratethrough an analysis of the cultivation medium. Sens. Actuat. BChem. 375, 132812 (2023).68. Li, X., Bu, Y., Xie, J., Liang, J. & Xu, J. Determine themasses and agesof red giant branch stars from low-resolution LAMOST SpectraUsing DenseNet. arXiv https://doi.org/10.48550/arXiv.2106.04945 (2021).69. Li, L., Jamieson, K., Rostamizadeh, A. & Talwalkar, A. Hyperband: anovel bandit-based approach to hyperparameter optimization. J.Mach. Learn. Res. 18, 1–52 (2018).70. Trelin, A.Microplastics-raman-spectra.Kaggle https://www.kaggle.com/datasets/andriitrelin/microplastics-raman-spectra (2023).71. Baek, S. J., Park, A., Ahn, Y. J. & Choo, J. Baseline correction usingasymmetrically reweighted penalized least squares smoothing.Analyst 140, 250–257 (2014).72. Bestuzheva, K. et al. The SCIP Optimization Suite 8.0. arXiv https://doi.org/10.48550/arXiv.2112.08872 (2021).73. Foret, P., Kleiner, A., Mobahi, H. & Neyshabur, B. Sharpness-AwareMinimization for Efficiently Improving Generalization. arXiv https://doi.org/10.48550/arXiv.2010.01412 (2020).74. Loshchilov, I. & Hutter, F. Decoupled Weight Decay Regularization.7th Int. Conf. Learn. Represent. ICLR 2019 (2017).75. Trelin, A. Trel725/SpecATNet: First public release (1.0). Zenodohttps://doi.org/10.5281/ZENODO.10571618 (2024).76. Bujacz, A. Structuresof bovine, equine and leporine serumalbumin.Acta Cryst. D68, 1278–1289 (2012).77. Bujacz, A. & Bujacz, G. Crystal Structure of Bovine Serum Albumin,PDB ID: 4F5S. https://doi.org/10.2210/pdb4F5S/pdb (2012).AcknowledgementsThe authors gratefully acknowledge the assistance of Dr. LambardGuillaume for discussion andMr. ShotaMitani for X-ray CT observations.This research was supported by the JST-ERATO Yamauchi MaterialsSpaceTectonics Project (JPMJER2003) and the Japan Society for thePromotion of Science (JSPS) Grants-in-Aid for Scientific ResearchKakenhi Program (20K05453). J.H. acknowledges the LaSensA projectunder the M-ERA.NET scheme funded by the Research Council ofArticle https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 14https://www.open-raman.org/https://doi.org/10.48550/arXiv.2106.04945https://doi.org/10.48550/arXiv.2106.04945https://www.kaggle.com/datasets/andriitrelin/microplastics-raman-spectrahttps://www.kaggle.com/datasets/andriitrelin/microplastics-raman-spectrahttps://doi.org/10.48550/arXiv.2112.08872https://doi.org/10.48550/arXiv.2112.08872https://doi.org/10.48550/arXiv.2010.01412https://doi.org/10.48550/arXiv.2010.01412https://doi.org/10.5281/ZENODO.10571618https://doi.org/10.2210/pdb4F5S/pdbLithuania (LMTLT, agreement no. S-M-ERA.NET-21−2), Saxon State Min-istry for Science, Culture and Tourism (Germany), and the NationalScience Centre (Poland). OG acknowledges JSPS Postdoctoral Fellow-ship, and the Korea Institute of Industrial Technology (KITECH,JE210028). PS and OG acknowledge RSF 23–73-00117 (the design, pre-paration and characterization of plasmonic nanostructure). A part of thiswork was supported by the Advanced Research Infrastructure forMaterials and Nanotechnology in Japan (ARIM) of the Ministry of Edu-cation, Culture, Sports, Science and Technology (MEXT) proposalnumber JPMXP1224NM5002.Author contributionsO.G. developed the concept, performedmost of the experimental work,collected data, and wrote the manuscript. A.T. developed and trainedCNN algorithm, and wrote the manuscript. Y.K. performed electro-chemical experiments. P.P. assisted in concept development. M.K. andA.S. performed X-ray CT experiments and described them. L.K.Sh.contributed to Raman measurements. J.H. developed the concept,performed EM simulations, wrote the manuscript, and supervised theproject. Y.Y. revised the manuscript, contributed to the discussion, andsupervised the project.Competing interestsThe authors declare no competing interests.Additional informationSupplementary information The online version containssupplementary material available athttps://doi.org/10.1038/s41467-024-48148-w.Correspondence and requests for materials should be addressed toOlga Guselnikova, Joel Henzie or Yusuke Yamauchi.Peer review information Nature Communications thanks Qing Wangand the other, anonymous, reviewer(s) for their contribution to the peerreview of this work. A peer review file is available.Reprints and permissions information is available athttp://www.nature.com/reprintsPublisher’s note Springer Nature remains neutral with regard to jur-isdictional claims in published maps and institutional affiliations.Open Access This article is licensed under a Creative CommonsAttribution 4.0 International License, which permits use, sharing,adaptation, distribution and reproduction in any medium or format, aslong as you give appropriate credit to the original author(s) and thesource, provide a link to the Creative Commons licence, and indicate ifchanges were made. The images or other third party material in thisarticle are included in the article’s Creative Commons licence, unlessindicated otherwise in a credit line to the material. If material is notincluded in the article’s Creative Commons licence and your intendeduse is not permitted by statutory regulation or exceeds the permitteduse, you will need to obtain permission directly from the copyrightholder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.© The Author(s) 2024Article https://doi.org/10.1038/s41467-024-48148-wNature Communications |         (2024) 15:4351 15https://doi.org/10.1038/s41467-024-48148-whttp://www.nature.com/reprintshttp://creativecommons.org/licenses/by/4.0/http://creativecommons.org/licenses/by/4.0/ Pretreatment-free SERS sensing of microplastics using a self-attention-based neural network on hierarchically porous Ag�foams Results and discussion Macro-mesoporous Ag foams coated with a hydrophobic�layer Optical properties of AgF@AgM foams and SERS sensing�of MPs Self-attention-based CNN to identify MPs in complex mixtures SpecATNet for MP samples with increasing multiplexity In-situ sensing of MPs in unprocessed environmental samples Methods Materials Preparation of degraded�MP Preparation of MP solutions that mimic environmental samples Preparation of AgF@AgM Preparation of AgF@AgM@C10 Deposition of MPs on AgF@AgM@C10 Optical simulations of mesoporous Ag films and macroporous Ag�foams Raman spectroscopy measurements EF calculation µ-CT 3D�images Electrocatalytically active surface measurements Scanning electron microscopy Wettability measurements X-ray photoelectron spectroscopy Optical measurements Fluorescence microscopy Adsorption capacity measurements Calculation of SD for wettability, surface free energy, and adsorption capacity measurement SpecATNet architecture Dataset and training Data pre-processing Data balancing NN training Ablation�study Machine learning methods for comparison Reporting summary Data availability Code availability References Acknowledgements Author contributions Competing interests Additional information