TL;DR
Researchers have developed a portable, low-cost device that uses fluorescence imaging and a deep learning model (YOLOv4-Tiny) to rapidly and accurately detect fish freshness. This innovation addresses the limitations of existing methods, offering a practical solution for ensuring food safety.
What Problem Does This Paper Address?
Ensuring the freshness of fish products is crucial for food safety and consumer health. Traditional methods for assessing fish freshness, such as microbiological and chemical analyses, are often time-consuming, labor-intensive, and not suitable for rapid, on-site evaluation. While optical detection methods like hyperspectral imaging (HSI) offer promise, they are typically expensive, bulky, and lack real-time processing capabilities, hindering their widespread adoption. This paper aims to bridge this gap by developing a portable, cost-effective fluorescence imaging device that can quickly and accurately determine fish freshness.
Methods
The core of this research lies in the development of a portable fluorescence imaging device and the integration of a deep learning model for freshness detection.
- Hardware Development: The device utilizes a low-cost Field-Programmable Gate Array (FPGA) board (ZYNQ XC7Z020) as the master control unit. This FPGA integrates a processing system (PS) and programmable logic (PL) for efficient data handling and hardware acceleration. For excitation, four 10W UV-LED lamp beads (365 nm) are employed, and image acquisition is performed by a low-cost CMOS camera (OV5640). The system is powered by a 12V lithium battery and includes an LCD touchscreen for user interaction.
- Deep Learning Model: The YOLOv4-Tiny model, a lightweight version of YOLOv4, was chosen for its balance of accuracy and computational efficiency, making it suitable for deployment on embedded FPGA platforms. This model is designed to extract features from fluorescence images and classify fish freshness.
- FPGA Implementation: The YOLOv4-Tiny model's circuit was designed and coded using high-level synthesis (HLS) language. To optimize performance on the FPGA, several strategies were employed:
- For-Loop Optimization: Techniques like for-loop unrolling and pipelining were used to increase parallelism and reduce latency in computations.
- Fixed-Point Quantization: Converting 32-bit floating-point weights to fixed-point representations reduces computational complexity and resource usage.
- Array Partitioning: Splitting large memory blocks into smaller ones improves parallel data access.
- Ping-Pong Operation: Utilizing dual buffers for data processing masks data transmission time, enhancing throughput.
Datasets
The study used grass carp fillets as the experimental object. Fluorescence images were collected over 8 days from 565 samples. These samples were categorized into three freshness grades: freshness (days 0-2), secondary freshness (days 3-4), and rot (days 5-7), based on TVB-N values. The dataset was split into training (424 samples) and testing (141 samples) sets in a 3:1 ratio for model training and performance evaluation.
Key Insights and Ideas
- Fluorescence as a Freshness Indicator: The research leverages the principle that as fish spoils, fluorescent substances are produced and accumulate, leading to changes in fluorescence intensity and patterns under UV light. This provides a visual cue for freshness.
- FPGA for Real-time Embedded AI: The use of an FPGA with optimized deep learning circuits demonstrates a viable pathway for deploying complex AI models on low-power, portable devices for real-time analysis, overcoming the limitations of traditional cloud-based or high-performance computing solutions.
- YOLOv4-Tiny's Suitability: The YOLOv4-Tiny model proved to be an effective choice, offering a good trade-off between detection accuracy and computational requirements for an embedded system.
- Cost-Effectiveness: By combining low-cost components like CMOS cameras and an FPGA with an efficient deep learning model, the developed device achieves a significantly lower price point compared to existing advanced optical inspection systems.
Key Results
- High Accuracy: The developed device achieved an average detection accuracy of 97.10% for grass carp fillets across three freshness grades.
- Rapid Detection: The detection time for each sample is less than 1 second, making it suitable for on-site applications.
- Low Power Consumption: The overall power consumption of the device is approximately 47.1 W, with the excitation light source accounting for the majority (42.4 W). Excluding the light source, the core processing unit consumes a mere 4.7 W, indicating good energy efficiency for embedded applications.
- Performance Metrics: Precision, Recall, and F1-Score for the "freshness" and "rot" classes were particularly high (e.g., 100% recall for freshness). The mean Average Precision (mAP) reached 97.10%.
- FPGA Optimization: The optimized YOLOv4-Tiny circuit on the FPGA achieved a significant reduction in latency (from 28.24 M cycles to 3.52 M cycles), albeit with increased resource utilization.
Limitations and Future Work
- Environmental Factors: The authors acknowledge that environmental factors like temperature and humidity can influence the rate of spoilage and thus affect detection accuracy. They recommend controlling these variables during experiments and for future applications.
- Generalization Performance: The current training dataset size might limit the generalization performance on entirely new samples. Increasing the training dataset is suggested to improve robustness.
- Physicochemical Indicators: While the device accurately classifies freshness grades, it doesn't directly measure specific physicochemical indicators like TVB-N. Future work could focus on optimizing the device to provide high-precision estimations of these indicators.
- Broader Applicability: While tested on grass carp, further validation on a wider variety of fish species and under diverse storage conditions would be beneficial.
Summary updated