Evidence type: hands_on. Results are limited to the documented conditions.
Summary A team at the University of Colima in Mexico has published a study in the analytical chemistry journal Talanta. They clamped a smartphone to a stereomicroscope to photograph filtered salt samples, then used two free, open-source programs, ilastik and Fiji/ImageJ, to detect, count and measure microplastic-like particles automatically. The authors report an average of 1,950 ± 354 detectable particles per kilogram of sea salt from Cuyutlán, Mexico, mostly filaments, and confirmed common plastics among selected particles by infrared spectroscopy. This article explains how the two free tools helped solve real problems in the study, and describes what happened when ZIRULAB ran the same software on the authors' published images and models.
Figure 1. Workflow of the study, redrawn by ZIRULAB from the paper's methods (schematic, not data).
Figure 1. Workflow schematic drawn independently by ZIRULAB from the paper's methods; not a photograph or measured data. Steps 4 (ilastik) and 5 (Fiji) are the focus of this article.
1. The science behind a grain of salt
Kitchen salt looks clean and white, and it is hard to imagine plastic in it. But sea salt comes from seawater, and plastic litter in the ocean slowly breaks apart under sunlight, waves and abrasion. Fragments between 1 µm and 5 mm across are usually called microplastics. Traditional sea salt is made by letting seawater or brine evaporate in shallow ponds, so some of the particles carried by the water can end up in the crystals. The authors also point out that local salt-making uses plastic liners and plastic-bristled tools, which could be further sources, although this has not been traced.
The hard part is seeing the particles clearly and counting them reliably. Micro-spectroscopic imaging, such as µ-FTIR and µ-Raman, reveals both shape and chemical identity, but the instruments are expensive and each sample takes a long time. Counting by eye under an ordinary microscope is cheap, but it depends heavily on experience: hours of staring at a field of view are tiring, and two analysts may judge the same particle differently.
The paper asks a practical question: can ordinary laboratory equipment and free software deliver a fast, repeatable screening method?
One point up front: the study measures the number of detectable particles. It does not assess health risk, particle counts cannot be translated directly into effects on people, and this article makes no such inference.
2. A smartphone as a research instrument
Sample preparation is simple. Twenty grams of sea salt is dissolved in 100 mL of pre-filtered ultrapure water, vortexed until fully dissolved, and vacuum-filtered through a 47 mm glass-fibre filter with 1.5 µm pores. To keep particles intact, the authors avoided chemical digestion such as hydrogen peroxide. Each sampling site was measured three times, alongside blank samples. Cotton lab coats, metal and glass equipment only, and filtration in a laminar-flow cabinet all helped keep airborne and clothing fibres out.
Image capture is where the low-cost idea shows most clearly. A OnePlus 12 phone was held on the stereomicroscope eyepiece by a bracket and used at 20× magnification. The filtered area of each filter is about 1,520 mm², covered by 15 fixed fields of about 100 mm² each.
Magnification is a trade-off. Higher magnification reveals smaller particles, but it needs many more photographs and much longer processing. The authors therefore set lower detection limits of 300 µm for filaments and 200 µm for fragments: the study counts particles above these sizes that can be identified reliably.
With the photographs taken, the real challenge begins. How do you get a computer to find, count and measure particles across hundreds of images?
3. ilastik: teaching a computer what a microplastic looks like
Why a single brightness cut-off fails
The simplest form of automatic counting is to pick a brightness or colour cut-off and call anything darker than the background a particle. On a salt filter that does not work. The filter has its own fibrous texture; undissolved mineral grains, shadows and the filter edge can all be darker than the background; and a translucent plastic fragment may be almost as bright as its surroundings. A single threshold cannot reliably separate "looks like plastic" from "is not plastic".
Teaching the software as you would a new colleague
ilastik was built for exactly this kind of problem. It is free, open-source software (GPL licence) developed by a team at the European Molecular Biology Laboratory (EMBL), originally for biological microscopy of cells and tissues.
Working with ilastik is a bit like showing a new colleague the samples. The researcher opens a few photographs and paints a few strokes over microplastics ("this is the target"), then a few more over background, shadows and the filter edge ("these are not"). Learning from examples supplied by a person in this way is called supervised learning.
For every pixel, the software computes a set of image features: smoothed brightness and colour around that point, how strong the edges are, which way the texture runs, each at several scales. It then trains a random forest classifier on the painted pixels. Think of a random forest as a panel of many judges. Each judge asks a short chain of simple questions ("Is there a strong edge here? Is the colour bluish or yellowish? Is this part of a thin, elongated structure?"), and the panel votes on which class the pixel belongs to.
The prediction appears on screen straight away. Wherever it is wrong, the researcher adds a stroke and the software retrains. This label–look–correct loop is what makes ilastik interactive, and the researcher never writes a line of machine-learning code.
A random forest is a classical machine-learning method. It is not a deep neural network, and it is certainly not generative AI. It needs relatively little training data, runs on an ordinary laptop, and its basis for decisions is comparatively easy to inspect.
Why two separate models?
Plastic turns up in salt in different shapes. Thin filaments are recognised mainly by lines and edges, while irregular fragments depend more on colour and overall outline. The authors found that asking one model to do both caused interference, so they trained two models, each on 100 images. The filament model relies mainly on edge and shape features; the fragment model also uses colour and intensity. Each model has five classes: besides the target particles, background, shadows, borders or sediment, and stones, so that the model also learns what is not a microplastic.
Probability maps: how much does it look like the target?
A trained model does not say "there is a plastic particle here". Its output is a probability map: every pixel gets a value between 0 and 1 for each class. Values near 1 look very much like the target, values near 0 hardly at all, and values around 0.5 mean the model is unsure.
So a probability map answers "where does it look like the target?", not "how many?" or "how big?". Several decisions still lie between probability and count. Fiji makes them, and a person still needs to check them.
Once saved as a project file, a model can be applied to new images in batch mode without further labelling. The authors report processing batches of up to 50 images in under 15 minutes.
4. Fiji: turning images into scientific data
Fiji is a "batteries-included" distribution of ImageJ. ImageJ was developed at the US National Institutes of Health (NIH), and its original core is in the public domain. Fiji bundles many plugins, is released under the GPL, and is one of the most widely used image-analysis platforms in the life sciences. In this study it handles the work before and after ilastik.
Putting a ruler into the image
How large is one pixel in the real world? Answering that is spatial calibration. Using a reference photograph of the microscope's built-in scale, the authors found that 1,000 µm corresponds to about 202 pixels, so one pixel is about 4.95 µm and covers about 24.5 µm². After calibration, Fiji reports length, perimeter and Feret diameter in µm and area in µm². At this scale a 2280-pixel field is about 11.3 mm across and about 100 mm² in area, matching the authors' description of each field.
Before that, the authors' pre-treatment macro resizes every photograph to 2280 × 2280 pixels, clears the dark area outside the filter, applies light sharpening and denoising, and saves it in HDF5 format, which ilastik reads efficiently.
From probabilities to particles
With ilastik's probability map in hand, Fiji works through these steps:
- Thresholding: an automatic threshold method (MaxEntropy for filaments; IsoData in the fragment macro) decides how high a probability must be to count as target, producing a black-and-white binary mask.
- Region of interest (ROI): the analyst draws a circle so that only the filter area is analysed and the edge or background is not mistaken for particles.
- Clean-up: isolated specks are removed and, where needed, morphological operations such as dilation or closing rejoin broken pieces.
- Particle detection: Analyze Particles finds groups of touching white pixels, called connected regions, and filters them by area and circularity.
- Measurement and export: area, perimeter, circularity and Feret diameter are measured for each object, outlines are overlaid on the original image for checking, and the data are exported as a CSV table.
One detail is easy to overlook: a connected region is not necessarily one real particle. Two fragments lying side by side can merge into one region, and a nylon fibre broken in the image can be counted as several pieces. The paper uses the second case to explain some of the filament model's false positives. Overlaying outlines and having a person review them is how such problems are caught.
What each measurement means
- Area (µm²): number of pixels in the object multiplied by the real area of one pixel.
- Perimeter (µm): length of the object's outline.
- Circularity (dimensionless, 0–1): close to 1 for round objects, close to 0 for elongated ones. The authors kept 0–0.40 for filaments and 0–0.90 for fragments.
- Feret diameter (µm): the greatest distance between any two points on the outline, like the longest calliper reading. For a curved fibre, the true path length along the fibre can be much greater than its Feret diameter.
Note too that the paper's text describes the size filters as a "minimum length" of 300 µm for filaments and 200 µm for fragments, whereas the published macros actually filter by area: at least 7,000 µm² for filaments and 20,000 µm² for fragments. Area and length are not interchangeable. A 40 µm-wide fibre with an area of 7,000 µm² is about 175 µm long, and a round particle of 20,000 µm² has an equivalent diameter of about 160 µm. When the paper estimates mean fibre length, it likewise assumes a mean width of 40 µm and derives about 889 µm from a mean area of 35,545 µm².
Macros: turning the procedure into a repeatable recipe
All of these steps are written into Fiji macros. A macro records a sequence of operations so it can be applied to a batch of images, reducing differences between operators and letting other researchers see exactly what was done.
Figure 2. How ilastik and Fiji divide the work (synthetic, computer-generated illustration).
Figure 2. How ilastik and Fiji divide the work. The images are computer-generated, not microscopy results.
The division of labour fits in one sentence: ilastik recognises; Fiji counts and measures. Starting from a real sample, the chain runs: sample → microscope photograph → ilastik recognition → probability map → Fiji thresholding and filtering → particle measurement → statistics → human review and chemical identification. Both programs are free and connect through plugins or the command line, so researchers need neither commercial image-analysis software nor machine-learning code written from scratch.
5. What did the scientists find?
Particles in sea salt
The authors collected sea salt at eight sites (A, B, C, C1, D, E, F, G) spread over about 10 km² around the Cuyutlán lagoon, analysing three separate 20 g portions from each site. The abstract and results report an average of 1,950 ± 354 detectable microplastic-like particles/kg, of which 1,235 ± 263 particles/kg were filaments and 715 ± 167 particles/kg fragments. Site means ranged from 1,583 to 2,400 particles/kg.
Figure 3. Sea-salt particle concentrations reported by Hernández-Covarrubias et al. (2027), replotted; ± as printed, meaning not stated.
Figure 3. Data from Section 3.6 and the abstract of the paper, replotted by ZIRULAB. Error bars are the "±" values as printed; that section does not state what they represent, so we do not treat them as standard deviations, standard errors or confidence intervals.
We checked these numbers. The mean of the eight site means is 1,949.9; filaments plus fragments equal exactly 1,950; filaments make up about 63%. The paper's conclusions phrase it slightly differently, as "1,900 ± 30.3% (relative standard deviation)" with roughly 65% filaments and 35% fragments. Here we use the results section, which corresponds directly to the data discussed.
That works out to only about 39 detectable particles on a filter holding 20 g of salt. With so few particles per sample, a difference of a few particles shifts the per-kilogram value noticeably, which is worth bearing in mind when comparing sites. The authors also list salt studies from other countries, with reported values ranging from under one to several thousand particles per kilogram; because size limits and identification methods vary widely, those figures should not be ranked against each other.
What are they made of?
Photographs show only shape and colour. The authors analysed selected particles by attenuated-total-reflectance infrared spectroscopy (ATR-FTIR) against the Hummel polymer library and identified polypropylene (PP, 87% match), polyethylene (PE, 80%), polyvinyl chloride (PVC, 70%) and cellophane (regenerated cellulose, 63%). Cellophane is made from cellulose and is not usually classed as a synthetic plastic, a reminder that not every counted particle is necessarily plastic.
How well did the software recognise them?
The models were tested on 15 images of a spiked salt sample that were not used in training, with an experienced analyst's judgement as the reference. The results are shown in Figure 4.
Figure 4. Model performance from the paper's confusion matrices (Tables 3–4), recomputed by ZIRULAB.
Figure 4. Confusion matrices from Tables 3 and 4 of the paper; all metrics recomputed independently by ZIRULAB. Sensitivity, precision, specificity and accuracy are shown in percent; F1 is on a 0–1 scale. The recomputed filament F1 is 0.649 (paper: 0.64); all other values match the paper after rounding.
- Filament model: sensitivity 100%, specificity 76.4%, precision 48%, F1 0.64.
- Fragment model: sensitivity 76.5%, specificity 72.2%, precision 81.3%, F1 0.79.
The fragment model missed more particles. The authors attribute this mainly to translucent PET and LDPE particles having too little contrast against the background, a limitation of ordinary optical microscopy. Section 7 looks at what these metrics mean.
How many spiked particles came back?
The authors added 10 particles each of seven plastics (PVC, LDPE, HDPE, PET, PS, nylon and PP), 70 in all, to 20 g of analytical-grade sodium chloride and processed it the same way. They counted 76 particles, a recovery of 108.6%. Plastics differed markedly: PP reached 170%, PET only 60%. The authors attribute this to brittle large PP and PVC particles breaking up during vortexing and being counted more than once, while transparent PET is hard to see and may also be lost during handling.
Figure 5. Spike-recovery results from Table 2 of the paper (single spiked sample, manual count).
Figure 5. Data from Table 2 of the paper. According to Section 3.5.1, the recovery counts were made manually by an experienced analyst. Each size class contained only 5 particles, so one particle equals 20 percentage points.
The recovery test used a single spiked sample and manual counting, so it mainly reflects sample preparation rather than the accuracy of automated counting.
Beyond salt
The same procedure was applied to sugar, meat tenderiser, a flavoured drink mix, non-dairy creamer, an electrolyte drink and soy milk, and particles were found in each. The authors note that the method was validated mainly on salt and that foods rich in fat, protein or organic matter need further validation. These results demonstrate feasibility; they are not general contamination levels for those foods.
6. We ran the two programs ourselves
Reading a paper is one thing; running the software is another. ZIRULAB downloaded the 15 validation images, the two trained ilastik models and the Fiji macros from the authors' Mendeley Data repository and ran the whole software workflow on a Windows computer on 28 November 2026.
Figure 6. ZIRULAB's actual software run (final RC3 run), drawn from run logs and metadata.
Figure 6. Drawn from the logs and metadata of the final (RC3) run. No third-party image is shown.
It did not work first time. Our own batch-processing script went through two fixes. The first version (RC1) exported an unexpected number of output channels, and the second (RC2) produced probability values whose range failed the script's validation check. The third version (RC3) resolved these output-compatibility problems and completed batch inference with both models. The full development and failure record is kept in the research archive.
In the final RC3 run:
- ilastik 1.4.2 ran in headless batch mode. Each model was first tried on one image and, once the output was confirmed, run on the remaining 14. All four invocations exited with code 0. Processing 15 images took about 355 s with the filament model and about 219 s with the fragment model, including program start-up.
- This produced 30 probability maps (15 images × 2 models), each 2280 × 2280 pixels with five class channels. For every pixel we checked that the five class probabilities summed to 1; all were within 1 ± 10⁻⁷.
- Using Fiji 2.18.0 (ImageJ 1.54p), we wrote a batch diagnostic macro applying the scale, threshold methods and area and circularity limits from the authors' macros, and exported area, perimeter, Feret diameter and circularity for every candidate object.
The run shows that the authors' published models load and perform batch inference in a newer version of ilastik, and that the output passes straight into Fiji to produce quantitative tables. The whole free-software workflow runs on an ordinary computer in a few minutes.
Our analysis conditions were not identical to the paper's, however. We did not hand-draw an ROI on each image, applied no optional morphological operations, passed 8-bit versions of the probability maps to Fiji, and used newer software versions (the paper used ilastik 1.4.0 post GPU and Fiji 2.16.0). As a result, our particle counts differ clearly from the paper's. The whole-frame diagnostic flagged 7 filament candidates and 382 fragment candidates, whereas the authors' validation on the same images reports 25 and 80 positive calls. Some fragment candidates even have a Feret diameter above 5 mm and probably come from the field edge or background structures, which is exactly what the manual ROI and human review are meant to remove.
These candidates have not been chemically identified. They cannot be treated as real microplastics, and no microplastic concentration for any food can be calculated from them. Without controlled experiments we cannot say how much each condition contributed to the difference, and the result does not show that the authors' models are wrong. What this run demonstrates is the software workflow itself; it is not an independent verification of the paper's scientific conclusions.
7. Why computer output still needs human judgement
Finding every target is not the same as everything found being a target
The filament model shows this neatly. All 12 filaments confirmed by the analyst were found, with none missed: sensitivity = 12/12 = 100%. But the model reported 25 positives, 13 of them wrong, so precision was only 12/25 = 48%. In other words, about half of what it reported was not a spiked filament. According to the paper, the false positives came mainly from nylon fibres being split into segments and counted more than once, incomplete segmentation, and fibre-like debris.
- High sensitivity (recall) means few misses.
- High precision means few false alarms.
- The F1 score is the harmonic mean of the two, on a 0–1 scale, and balances both kinds of error.
The fragment model shows the opposite pattern: higher precision (81.3%), lower sensitivity (76.5%), and an F1 of 0.79. Each model makes different trade-offs, and any single metric can give a one-sided impression. The validation set is also small, 15 images from one spiked experiment, and the authors themselves describe it as a controlled proof of concept.
From pixels to particles, every step shapes the result
Between a probability map and a count lie at least four decisions: the threshold, the analysis region, morphological operations, and size and shape filters. Too low a threshold lets weak background signal merge into blobs. Without an analysis region, a bright ring at the filter edge may be counted as one large particle. Dilation can reconnect a broken fibre, but it can also fuse two neighbouring particles. A small change in the size limit can include or exclude particles near the boundary.
Figure 7. Why threshold, ROI and size filter change counts (synthetic illustration, not an experiment).
Figure 7. Conceptual illustration using a computer-generated probability map; not a parameter comparison from our run.
The differences seen in Section 6 show why these settings must be recorded in full and checked by a person. Without controlled experiments, however, we draw no conclusion about the size of each factor's effect.
Similar shape does not mean the same material
Photographs plus machine learning can find candidates whose shape and colour look like microplastics, but they cannot tell plastic from cotton fibre or mineral fragments. Confirming chemical identity still requires spectroscopy such as FTIR or Raman. The authors position their method as a screening tool: narrow the field quickly and cheaply, then spend expensive spectroscopy on the particles that matter.
Where the method applies
- Size range: the method cannot cover particles below the reported detection limits (300 µm for filaments, 200 µm for fragments), so the results do not represent microplastics across all sizes. The workflow may also produce false detections, missed particles and merged particles, and the available evidence is not enough to determine the direction or size of any net bias in the overall result.
- Imaging conditions: microscope, illumination angle, phone model and exposure all affect the images, so a model may not perform the same on other equipment.
- Training scope: the models saw a limited range of plastics, colours and sizes and may perform poorly on unfamiliar materials or matrices.
- Sample size and validation: 15 images from one spiked experiment leave considerable statistical uncertainty; independent datasets and inter-laboratory comparisons are needed.
- Food type: the method was validated mainly on salt; other foods need their own validation.
8. Beyond microplastics: what else can free tools do?
The pairing of "ilastik for pixel classification, Fiji for measurement and statistics" is not limited to microplastics. The following are reasonable applications, but they are not experiments carried out in this study:
- Biomedical imaging: ilastik was built for cells and tissues and is often used for nucleus segmentation and tissue mapping; Fiji is used very widely across the life sciences.
- Environmental monitoring: particles on sediment or water filters, plankton, pollen counts.
- Materials science: grains, pores and second phases in micrographs; coating-defect inspection.
- Food and agriculture: surface defects in grain, foreign-matter screening, seed morphology.
- Teaching: with a phone and a basic microscope, students can follow the whole path from labelling and training to statistics.
For laboratories on tight budgets, the practical value is a workflow that can be saved, reused and handed to others for checking, without buying commercial software or programming from scratch.
9. Try it yourself
- ilastik: https://www.ilastik.org/. Pixel classification guide: https://www.ilastik.org/documentation/pixelclassification/pixelclassification. Headless batch mode: https://www.ilastik.org/documentation/basics/headless
- Fiji: https://imagej.net/software/fiji/
- Original paper: https://doi.org/10.1016/j.talanta.2026.130467
- Authors' data, models and macros: https://doi.org/10.17632/5c4wfd99w8.2
Getting started:
- Open one of your own micrographs in Fiji and calibrate it with a scale of known length via Analyze › Set Scale.
- In ilastik, create a Pixel Classification project with at least "target" and "background" classes, label a few strokes on several images, switch on live prediction, and add labels where it is wrong.
- Export the target-class probability map, threshold it in Fiji, and count with Analyze › Analyze Particles.
- Record the threshold method, ROI and size and shape filters, and check each outline against the original image.
- Before using the authors' data and models, read the licence on the dataset page. The model files are large, so make sure you have enough storage before downloading.
10. Conclusion
What makes this study appealing is not only the number of particles in sea salt but the method it demonstrates: a stereomicroscope, a smartphone and two free programs are enough to build an image-analysis workflow that others can reproduce. ilastik lets researchers who do not program train a classifier, and Fiji turns the model's judgements into measurements that can be analysed, exported and checked.
Software lowers the barrier to use; it does not replace scientific judgement. How thresholds and analysis regions are set, whether a model holds up on new data, and what a counted object really is still have to be answered through careful experimental design, instrument calibration, human checking and chemical identification. Free research software delivers its full value when every step is recorded so that others can check and repeat it.
References and resources
- Hernández-Covarrubias C.M., Ceballos-Magaña S.G., Aguayo-Villarreal I.A., Muñiz-Valencia R. Microplastic quantification and chemical characterization in salt samples, using stereomicroscopy, smartphone camera and supervised machine learning tools. Talanta 312 (2027) 130467. https://doi.org/10.1016/j.talanta.2026.130467 (published online 18 August 2026)
- Research data for Microplastic quantification and chemical characterization in salt samples, using stereomicroscopy, smartphone camera and supervised machine learning tools. Mendeley Data, Version 2 (2026). https://doi.org/10.17632/5c4wfd99w8.2
- Berg S. et al. ilastik: interactive machine learning for (bio)image analysis. Nature Methods 16 (2019) 1226–1232. https://doi.org/10.1038/s41592-019-0582-9
- Schindelin J. et al. Fiji: an open-source platform for biological-image analysis. Nature Methods 9 (2012) 676–682. https://doi.org/10.1038/nmeth.2019
- Schneider C.A., Rasband W.S., Eliceiri K.W. NIH Image to ImageJ: 25 years of image analysis. Nature Methods 9 (2012) 671–675. https://doi.org/10.1038/nmeth.2089
- Breiman L. Random forests. Machine Learning 45 (2001) 5–32. https://doi.org/10.1023/A:1010933404324
All figures are original ZIRULAB drawings. No figure from the paper and no microscopy image from the authors' dataset is reproduced. Charts are based on numbers published in the paper; images in the schematics are computer-generated.