Difference between revisions of "PSD Sensor"

From BoSL Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
    <h2>Introduction</h2>
+
== Introduction ==
    <p>The PSD Sensor is a novel, low-cost camera-based sensor designed for near-continuous in-situ measurements of Particle Size Distribution (PSD) in stormwater. This sensor addresses the limitations of traditional PSD measurement methods, which are often expensive, labour-intensive, or unable to provide real-time data.</p>
+
The PSD Sensor is a novel, low-cost camera-based sensor designed for near-continuous in-situ measurements of Particle Size Distribution (PSD) in stormwater. This sensor addresses the limitations of traditional PSD measurement methods, which are often expensive, labour-intensive, or unable to provide real-time data.
   
 
    <h2>Key Features</h2>
 
    <ul>
 
        <li>Utilizes a self-developed and highly customised compact camera with a 25x macro lens</li>
 
        <li>Employs image processing techniques for particle size estimation</li>
 
        <li>Provides affordable (less than $100), low-power, and mini-sized solution</li>
 
        <li>Capable of near-continuous measurements</li>
 
        <li>Designed for field deployment in stormwater systems (work in progress)</li>
 
    </ul>
 
   
 
    <h2>Methodology</h2>
 
    <h3>Image Acquisition</h3>
 
    <p>The core of the PSD sensor is the [[BoSLcam|BoSLCam]], a self-developed camera logger. Key features of the BoSLCam include:</p>
 
    <ul>
 
        <li>Custom-designed PCB measuring 70 mm by 15 mm</li>
 
        <li>Powered by a single 3.7V Li-ion battery</li>
 
        <li>OV7675 colour camera module capable of capturing VGA (640x480) resolution images</li>
 
        <li>nRF9160 chip for main microcontroller functions and LTE-M1 cellular connectivity</li>
 
        <li>GPS location and time data acquisition capability</li>
 
        <li>23LCV1024 SRAM buffer for image data processing</li>
 
        <li>SD card storage for captured images, and SIM card capability to upload images to FTP servers</li>
 
        <li>Power-efficient design with sleep mode reducing current consumption to less than 400 µA</li>
 
        <li>UART port for communication with external sensors and dataloggers</li>
 
    </ul>
 
   
 
    <h3>Image Processing</h3>
 
    <p>The image processing workflow consists of the following detailed steps:</p>
 
   
 
    <h4>1. Image Pre-Processing</h4>
 
    <ol>
 
        <li>RGB to Grayscale Conversion:
 
            <ul>
 
                <li>The RGB image is converted to grayscale using the following equation:
 
                    <pre>Grayscale = 0.299 × Red + 0.587 × Green + 0.114 × Blue</pre>
 
                </li>
 
                <li>This equation is commonly used in camera-based measurement of turbidity.</li>
 
            </ul>
 
        </li>
 
        <li>Fourier Transform and High-Pass Filter:
 
            <ul>
 
                <li>A Fast Fourier Transform (FFT) is applied to convert the image from the spatial domain to the frequency domain.</li>
 
                <li>A high-pass filter with a cutoff frequency of 2 is used to mitigate background noise and enhance image contrast.</li>
 
                <li>The process involves:
 
                    <ol>
 
                        <li>Applying 2D Fourier transform to the grayscale image</li>
 
                        <li>Shifting the zero-frequency component to the center of the spectrum</li>
 
                        <li>Creating a high-pass filter mask</li>
 
                        <li>Applying the mask to the shifted Fourier transform</li>
 
                        <li>Performing inverse Fourier transform to obtain the filtered image</li>
 
                    </ol>
 
                </li>
 
            </ul>
 
        </li>
 
    </ol>
 
  
    <h4>2. Image Segmentation (Thresholding)</h4>
+
== Key Features ==
    <ol>
+
[[File:BoSLCam front and back.png|thumb|right|300px|Front and back of BoSLCam. Orange: OV7575 camera module, light blue: SIM card slot, yellow: UART connection, grey: battery connector, dark blue: LTE and GPS antenna, red: nRF9160, purple: 23LCV1024 SRAM chip, mint: SD card slot.]]
        <li>Threshold Determination:
+
* Utilizes a self-developed and highly customised compact camera with a 25x macro lens
            <ul>
+
* Employs image processing techniques for particle size estimation
                <li>A threshold grayscale value of 241 was determined to be adequate for the BoSLCam sample images.</li>
+
* Provides affordable (less than $100), low-power, and mini-sized solution
                <li>This threshold distinguishes pixels representing particles (darker) from the background (brighter).</li>
+
* Capable of near-continuous measurements
            </ul>
+
* Designed for field deployment in stormwater systems (work in progress)
        </li>
+
<br><br><br><br>
        <li>Binary Image Creation:
+
== Methodology ==
            <ul>
+
=== Image Acquisition ===
                <li>The grayscale image is converted to a binary image where:
+
The core of the PSD sensor is the [[BoSLcam|BoSLCam]], a self-developed camera logger. Key features of the BoSLCam include:
                    <ul>
 
                        <li>1 represents particle (foreground)</li>
 
                        <li>0 represents background</li>
 
                    </ul>
 
                </li>
 
            </ul>
 
        </li>
 
    </ol>
 
  
    <h4>3. Feature Extraction</h4>
+
* Custom-designed PCB measuring 70 mm by 15 mm
    <ol>
+
* Powered by a single 3.7V Li-ion battery
        <li>Connected Component Labelling:
+
* OV7675 colour camera module capable of capturing VGA (640x480) resolution images
            <ul>
+
* nRF9160 chip for main microcontroller functions and LTE-M1 cellular connectivity
                <li>8-connectivity is used to perform connected component labelling on the binary image.</li>
+
* GPS location and time data acquisition capability
                <li>This process identifies and labels patches of pixels that are grouped together, representing individual particles.</li>
+
* 23LCV1024 SRAM buffer for image data processing
            </ul>
+
* SD card storage for captured images, and SIM card capability to upload images to FTP servers
        </li>
+
* Power-efficient design with sleep mode reducing current consumption to less than 400 µA
        <li>Particle Size Estimation:
+
* UART port for communication with external sensors and dataloggers
            <ul>
 
                <li>For each labeled pixel patch (particle):
 
                    <ol>
 
                        <li>The pixel size is multiplied by the theoretical area-per-pixel value (e.g., 30x30µm for BoSLCam).</li>
 
                        <li>Assuming spherical particles, the equivalent spherical diameter is calculated.</li>
 
                        <li>Particle surface area and volume are also calculated based on this diameter.</li>
 
                    </ol>
 
                </li>
 
            </ul>
 
        </li>
 
    </ol>
 
  
    <h4>4. Data Cleaning and Preparation</h4>
+
=== Image Processing ===
    <ul>
+
[[File:PSD image processing steps.png|thumb|right|300px|Image processing steps of a 75-90µm sample. (a) Original image captured by BoSLCam, (b) converted grayscale image, (c) image treated by Fourier Transform and high-pass filter, (d) binary mask created after applying threshold.]]
        <li>Particles larger than 500 µm (exceeding the proposed detection range) are excluded.</li>
+
The image processing workflow consists of the following detailed steps:
        <li>Histogram bins containing fewer than 2 particle counts are removed to mitigate potential noise effects, such as those caused by bubbles.</li>
+
 
    </ul>
+
==== 1. Image Pre-Processing ====
   
+
# RGB to Grayscale Conversion:
    <h3>PSD Analysis</h3>
+
#* The RGB image is converted to grayscale using the following equation:
    <p>The sensor produces the following outputs:</p>
+
#*: <code>Grayscale = 0.299 × Red + 0.587 × Green + 0.114 × Blue</code>
    <ul>
+
#* This equation is commonly used in camera-based measurement of turbidity.
        <li>Number-based (count-based) and volume-weighted particle size distribution histograms</li>
+
# Fourier Transform and High-Pass Filter:
        <li>Cumulative distribution curves</li>
+
#* A Fast Fourier Transform (FFT) is applied to convert the image from the spatial domain to the frequency domain.
        <li>Statistical parameters such as D10, D50 (median diameter), and D90</li>
+
#* A high-pass filter with a cutoff frequency of 2 is used to mitigate background noise and enhance image contrast.
    </ul>
+
#* The process involves:
   
+
## Applying 2D Fourier transform to the grayscale image
    <h2>Validation Results</h2>
+
## Shifting the zero-frequency component to the center of the spectrum
    <p>Laboratory validation tests using standard particles of various sizes (38-355 µm) demonstrated:</p>
+
## Creating a high-pass filter mask
    <ul>
+
## Applying the mask to the shifted Fourier transform
        <li>Strong linear relationships (R² > 0.99) between the sensor's measurements and those obtained by a traditional laboratory analyser for key PSD parameters (volume-weighted D10, D50, and D90)</li>
+
## Performing inverse Fourier transform to obtain the filtered image
        <li>No significant differences in central tendency measurements for most size ranges, with some limitations observed for very small (&lt;50 µm) and very large (>300 µm) particles</li>
+
 
    </ul>
+
==== 2. Image Segmentation (Thresholding) ====
   
+
# Threshold Determination:
    <h2>Future Work</h2>
+
#* A threshold grayscale value of 241 was determined to be adequate for the BoSLCam sample images.
    <p>Planned improvements and future research directions include:</p>
+
#* This threshold distinguishes pixels representing particles (darker) from the background (brighter).
    <ul>
+
# Binary Image Creation:
        <li>Trialing a 100x microscopy lens to improve measurement accuracy for smaller particles</li>
+
#* The grayscale image is converted to a binary image where:
        <li>Optimizing the image processing algorithm and calibration method</li>
+
#** 1 represents particle (foreground)
        <li>Investigating the underestimation issue for larger particle sizes</li>
+
#** 0 represents background
        <li>Developing a field-ready sensor and testing with real-world stormwater samples</li>
+
 
        <li>Exploring machine learning algorithms for improved particle detection</li>
+
==== 3. Feature Extraction ====
        <li>Investigating simultaneous measurement of other water quality parameters such as turbidity and TSS</li>
+
# Connected Component Labelling:
    </ul>
+
#* 8-connectivity is used to perform connected component labelling on the binary image.
   
+
#* This process identifies and labels patches of pixels that are grouped together, representing individual particles.
    <h2>References</h2>
+
# Particle Size Estimation:
    <p>For a complete list of references, please refer to the original research paper (currently not available, but contact Canwei if you are interested).</p>
+
#* For each labeled pixel patch (particle):
 +
## The pixel size is multiplied by the theoretical area-per-pixel value (e.g., 30x30µm for BoSLCam).
 +
## Assuming spherical particles, the equivalent spherical diameter is calculated.
 +
## Particle surface area and volume are also calculated based on this diameter.
 +
 
 +
==== 4. Data Cleaning and Preparation ====
 +
* Particles larger than 500 µm (exceeding the proposed detection range) are excluded.
 +
* Histogram bins containing fewer than 2 particle counts are removed to mitigate potential noise effects, such as those caused by bubbles.
 +
 
 +
=== PSD Analysis ===
 +
The sensor produces the following outputs:
 +
* Number-based (count-based) and volume-weighted particle size distribution histograms
 +
* Cumulative distribution curves
 +
* Statistical parameters such as D10, D50 (median diameter), and D90
 +
 
 +
== Validation Results ==
 +
Laboratory validation tests were conducted to assess the performance of the PSD Sensor against traditional laboratory analysis methods. The tests used standard particles of various sizes ranging from 38 to 355 µm, providing a comprehensive evaluation across different size ranges relevant to stormwater sediment analysis.
 +
 
 +
=== Experimental Setup ===
 +
The laboratory validation test setup, as shown in Figure 1, consisted of the following components:
 +
* A 3D-printed black, closed container with an openable lid for sample changing
 +
* An LED backlight module (white, 3.3V, 20mA, 110cd/m²) at the bottom of the container
 +
* A clear acrylic plate above the LED module to hold a shallow depth (<5 mm) of water sample
 +
* The BoSLCam coupled with a 25x macro lens, mounted on top of the container
 +
* The shallow sample depth was chosen to prevent particle overlapping and minimize distance-related distortions
 +
 
 +
=== Standard Particles and Sample Preparation ===
 +
The following standard particle size ranges were used in the validation tests:
 +
* 38-45 µm
 +
* 53-63 µm
 +
* 75-90 µm
 +
* 125-150 µm
 +
* 300-355 µm
 +
 
 +
Samples were prepared using deionized (DI) water dosed with these artificial particles. To ensure proper dispersion of hydrophobic particles, surfactant and anti-foam agents were added to the samples.
 +
 
 +
=== Comparison with Laboratory Analyzer ===
 +
The PSD Sensor's performance was evaluated against the Accusizer 780 (Entegris), a traditional laboratory particle sizing system. The comparison revealed:
 +
 
 +
* Strong correlations (R² > 0.99) between the two methods for key PSD parameters (volume-weighted D10, D50, and D90)
 +
* Consistent performance across various particle sizes, with some systematic differences:
 +
** Slight overestimation for particles smaller than 50 µm
 +
** Accurate measurements for mid-range particles (50-300 µm)
 +
** Some underestimation for particles larger than 300 µm
 +
 
 +
Figure 2 demonstrates this performance using a 75-90 µm sample, showing similar histogram shapes and peak locations in the volume-weighted particle size distribution and cumulative distribution plots for both methods.
 +
 
 +
Figure 3 further illustrates the correlation between the PSD Sensor and Accusizer 780A measurements across all tested size ranges. The graph shows strong linear relationships for D10 (red), D50 (blue), and D90 (green) values, with slopes around 0.70-0.75.
 +
 
 +
=== Performance Considerations ===
 +
While the PSD Sensor showed excellent overall performance, some limitations were observed:
 +
 
 +
* The slight overestimation for smaller particles (<50 µm) is likely due to the current image resolution and quality limitations of the BoSLCam
 +
* The underestimation for larger particles (>300 µm) may be partially attributed to the upper detection limit of the Accusizer 780, rather than solely a limitation of the PSD Sensor
 +
 
 +
These findings highlight areas for future optimization, particularly in improving resolution for smaller particles and extending the accurate measurement range for larger particles.
 +
 
 +
<gallery>
 +
File:PSD sensor lab test setup.png|Figure 1: Laboratory validation test setup for image acquisition.
 +
File:PSD results comparison example.png|Figure 2: Comparison example: volume-weighted particle size distribution and cumulative distribution plots for a 75-90µm sample analysed by (a) Accusizer 780A, and (b) proposed PSD sensor.
 +
File:PSD results D-values comparison.png|Figure 3: Comparison and linear relationships of the averaged volume-weighted D10, D50, and D90 reported by the proposed PSD sensor and Accusizer 780A. Red: D10, blue: D50, green: D90.
 +
</gallery>
 +
 
 +
== Future Work ==
 +
Planned improvements and future research directions include:
 +
* Trialing a 100x microscopy lens to improve measurement accuracy for smaller particles
 +
* Optimizing the image processing algorithm and calibration method
 +
* Investigating the underestimation issue for larger particle sizes
 +
* Developing a field-ready sensor and testing with real-world stormwater samples
 +
* Exploring machine learning algorithms for improved particle detection
 +
* Investigating simultaneous measurement of other water quality parameters such as turbidity and TSS
 +
 
 +
== References ==
 +
For a complete list of references, please refer to the original research paper (currently not available, but contact Canwei if you are interested).
 +
A presentation slide on this PSD sensor is avilable at: https://docs.google.com/presentation/d/1nz9B4ax-7Trgf9BWI-0MAw2LRiOo3SrO/edit?usp=sharing&ouid=118015437923291707850&rtpof=true&sd=true

Latest revision as of 02:07, 2 October 2024

Introduction

The PSD Sensor is a novel, low-cost camera-based sensor designed for near-continuous in-situ measurements of Particle Size Distribution (PSD) in stormwater. This sensor addresses the limitations of traditional PSD measurement methods, which are often expensive, labour-intensive, or unable to provide real-time data.

Key Features

Front and back of BoSLCam. Orange: OV7575 camera module, light blue: SIM card slot, yellow: UART connection, grey: battery connector, dark blue: LTE and GPS antenna, red: nRF9160, purple: 23LCV1024 SRAM chip, mint: SD card slot.
  • Utilizes a self-developed and highly customised compact camera with a 25x macro lens
  • Employs image processing techniques for particle size estimation
  • Provides affordable (less than $100), low-power, and mini-sized solution
  • Capable of near-continuous measurements
  • Designed for field deployment in stormwater systems (work in progress)





Methodology

Image Acquisition

The core of the PSD sensor is the BoSLCam, a self-developed camera logger. Key features of the BoSLCam include:

  • Custom-designed PCB measuring 70 mm by 15 mm
  • Powered by a single 3.7V Li-ion battery
  • OV7675 colour camera module capable of capturing VGA (640x480) resolution images
  • nRF9160 chip for main microcontroller functions and LTE-M1 cellular connectivity
  • GPS location and time data acquisition capability
  • 23LCV1024 SRAM buffer for image data processing
  • SD card storage for captured images, and SIM card capability to upload images to FTP servers
  • Power-efficient design with sleep mode reducing current consumption to less than 400 µA
  • UART port for communication with external sensors and dataloggers

Image Processing

Image processing steps of a 75-90µm sample. (a) Original image captured by BoSLCam, (b) converted grayscale image, (c) image treated by Fourier Transform and high-pass filter, (d) binary mask created after applying threshold.

The image processing workflow consists of the following detailed steps:

1. Image Pre-Processing

  1. RGB to Grayscale Conversion:
    • The RGB image is converted to grayscale using the following equation:
      Grayscale = 0.299 × Red + 0.587 × Green + 0.114 × Blue
    • This equation is commonly used in camera-based measurement of turbidity.
  2. Fourier Transform and High-Pass Filter:
    • A Fast Fourier Transform (FFT) is applied to convert the image from the spatial domain to the frequency domain.
    • A high-pass filter with a cutoff frequency of 2 is used to mitigate background noise and enhance image contrast.
    • The process involves:
    1. Applying 2D Fourier transform to the grayscale image
    2. Shifting the zero-frequency component to the center of the spectrum
    3. Creating a high-pass filter mask
    4. Applying the mask to the shifted Fourier transform
    5. Performing inverse Fourier transform to obtain the filtered image

2. Image Segmentation (Thresholding)

  1. Threshold Determination:
    • A threshold grayscale value of 241 was determined to be adequate for the BoSLCam sample images.
    • This threshold distinguishes pixels representing particles (darker) from the background (brighter).
  2. Binary Image Creation:
    • The grayscale image is converted to a binary image where:
      • 1 represents particle (foreground)
      • 0 represents background

3. Feature Extraction

  1. Connected Component Labelling:
    • 8-connectivity is used to perform connected component labelling on the binary image.
    • This process identifies and labels patches of pixels that are grouped together, representing individual particles.
  2. Particle Size Estimation:
    • For each labeled pixel patch (particle):
    1. The pixel size is multiplied by the theoretical area-per-pixel value (e.g., 30x30µm for BoSLCam).
    2. Assuming spherical particles, the equivalent spherical diameter is calculated.
    3. Particle surface area and volume are also calculated based on this diameter.

4. Data Cleaning and Preparation

  • Particles larger than 500 µm (exceeding the proposed detection range) are excluded.
  • Histogram bins containing fewer than 2 particle counts are removed to mitigate potential noise effects, such as those caused by bubbles.

PSD Analysis

The sensor produces the following outputs:

  • Number-based (count-based) and volume-weighted particle size distribution histograms
  • Cumulative distribution curves
  • Statistical parameters such as D10, D50 (median diameter), and D90

Validation Results

Laboratory validation tests were conducted to assess the performance of the PSD Sensor against traditional laboratory analysis methods. The tests used standard particles of various sizes ranging from 38 to 355 µm, providing a comprehensive evaluation across different size ranges relevant to stormwater sediment analysis.

Experimental Setup

The laboratory validation test setup, as shown in Figure 1, consisted of the following components:

  • A 3D-printed black, closed container with an openable lid for sample changing
  • An LED backlight module (white, 3.3V, 20mA, 110cd/m²) at the bottom of the container
  • A clear acrylic plate above the LED module to hold a shallow depth (<5 mm) of water sample
  • The BoSLCam coupled with a 25x macro lens, mounted on top of the container
  • The shallow sample depth was chosen to prevent particle overlapping and minimize distance-related distortions

Standard Particles and Sample Preparation

The following standard particle size ranges were used in the validation tests:

  • 38-45 µm
  • 53-63 µm
  • 75-90 µm
  • 125-150 µm
  • 300-355 µm

Samples were prepared using deionized (DI) water dosed with these artificial particles. To ensure proper dispersion of hydrophobic particles, surfactant and anti-foam agents were added to the samples.

Comparison with Laboratory Analyzer

The PSD Sensor's performance was evaluated against the Accusizer 780 (Entegris), a traditional laboratory particle sizing system. The comparison revealed:

  • Strong correlations (R² > 0.99) between the two methods for key PSD parameters (volume-weighted D10, D50, and D90)
  • Consistent performance across various particle sizes, with some systematic differences:
    • Slight overestimation for particles smaller than 50 µm
    • Accurate measurements for mid-range particles (50-300 µm)
    • Some underestimation for particles larger than 300 µm

Figure 2 demonstrates this performance using a 75-90 µm sample, showing similar histogram shapes and peak locations in the volume-weighted particle size distribution and cumulative distribution plots for both methods.

Figure 3 further illustrates the correlation between the PSD Sensor and Accusizer 780A measurements across all tested size ranges. The graph shows strong linear relationships for D10 (red), D50 (blue), and D90 (green) values, with slopes around 0.70-0.75.

Performance Considerations

While the PSD Sensor showed excellent overall performance, some limitations were observed:

  • The slight overestimation for smaller particles (<50 µm) is likely due to the current image resolution and quality limitations of the BoSLCam
  • The underestimation for larger particles (>300 µm) may be partially attributed to the upper detection limit of the Accusizer 780, rather than solely a limitation of the PSD Sensor

These findings highlight areas for future optimization, particularly in improving resolution for smaller particles and extending the accurate measurement range for larger particles.

Future Work

Planned improvements and future research directions include:

  • Trialing a 100x microscopy lens to improve measurement accuracy for smaller particles
  • Optimizing the image processing algorithm and calibration method
  • Investigating the underestimation issue for larger particle sizes
  • Developing a field-ready sensor and testing with real-world stormwater samples
  • Exploring machine learning algorithms for improved particle detection
  • Investigating simultaneous measurement of other water quality parameters such as turbidity and TSS

References

For a complete list of references, please refer to the original research paper (currently not available, but contact Canwei if you are interested). A presentation slide on this PSD sensor is avilable at: https://docs.google.com/presentation/d/1nz9B4ax-7Trgf9BWI-0MAw2LRiOo3SrO/edit?usp=sharing&ouid=118015437923291707850&rtpof=true&sd=true