Physics-Informed Neural Network-Assisted Imaging for Oil Palm Fruit Ripeness Classification
Abstract
1. Introduction
2. Methods
2.1. Dataset Acquisition
2.2. Data Preprocessing and Feature Extraction
2.3. Model Architectures
2.3.1. Convolutional Neural Network (Pure CNN)
2.3.2. Physics-Informed Neural Network (PINN)
2.4. Training and Validation
| Category | Details |
|---|---|
| CNN Architecture | Input: Image (128, 128, 3) Layers: 1. Conv2D (8 filters, 3 × 3, ReLU) → MaxPooling2D (2 × 2) 2. Conv2D (16 filters, 3 × 3, ReLU) → MaxPooling2D (2 × 2) 3. Conv2D (32 filters, 3 × 3, ReLU) → MaxPooling2D (2 × 2) 4. GlobalAveragePooling2D 5. Dense (32 units, ReLU, L2 reg) 6. Dropout (0.4) 7. Output Dense (Softmax) |
| PINN Architecture | Inputs: Image (128, 128, 3) and Scalar Value (1) Structure: • Image branch identical to CNN • Concatenates image features with the scalar input • Followed by same Dense block (32 units) → Dropout → Output |
| Optimizer | Adam (used for both CNN and PINN) |
| Learning Rate | 0.001 (used for both CNN and PINN) |
| Batch Size | 16 |
| Epochs | 500 (maximum; early stopping triggered for all training sets before this limit was reached) |
| Augmentation | None |
| Regularization | • L2 Regularization: Factor of 0.01 on 32-unit Dense layer • Dropout: Rate of 0.4 • Early Stopping: Patience of 10 epochs, restoring best weights. • Physics Loss: Weighted regularization applied to PINN predictions based on linear regression constraints |
| Linear Model Equations | m ∈ [2.04, 2.53], c ∈ [−2.65, −1.84] |
| R2 | R2 ∈ [0.61, 0.71] |
3. Results and Discussion
3.1. The Impact of Physics Loss Weighting Coefficient
3.2. CNN vs. PINN Per-Class Performance
3.3. CNN vs. PINN Under Different Lighting Conditions
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
| CNN | Convolutional Neural Network |
| PINN | Physics-Informed Neural Network |
| FFB | Fresh Fruit Bunch |
References
- Hassan, M.A.; Farid, M.A.A.; Zakaria, M.R.; Ariffin, H.; Andou, Y.; Shirai, Y. Palm oil expansion in Malaysia and its countermeasures through policy window and biorefinery approach. Environ. Sci. Policy 2024, 153, 103671. [Google Scholar] [CrossRef]
- Rizzo, M.; Marcuzzo, M.; Zangari, A.; Gasparetto, A.; Albarelli, A. Fruit ripeness classification: A survey. Artif. Intell. Agric. 2023, 7, 44–57. [Google Scholar] [CrossRef]
- Lai, J.W.; Ramli, H.R.; Ismail, L.I.; Hasan, W.Z.W. Real-Time Detection of Ripe Oil Palm Fresh Fruit Bunch Based on YOLOv4. IEEE Access 2022, 10, 95763–95770. [Google Scholar] [CrossRef]
- Rosbi, M.; Omar, Z.; Khairuddin, U.; Majeed, A.P.; Bakar, S.A. Machine learning for automated oil palm fruit grading: The role of fuzzy C-means segmentation and textural features. Smart Agric. Technol. 2024, 9, 100691. [Google Scholar] [CrossRef]
- Yamashita, R.; Nishio, M.; Do, R.K.G.; Togashi, K. Convolutional neural networks: An overview and application in radiology. Insights Imaging 2018, 9, 611–629. [Google Scholar] [CrossRef] [PubMed]
- Oyedare, T.; Park, J.-M.J. Estimating the Required Training Dataset Size for Transmitter Classification Using Deep Learning. In Proceedings of the 2019 IEEE International Symposium on Dynamic Spectrum Access Networks (DySPAN), Newark, NJ, USA, 11–14 November 2019; pp. 1–10. [Google Scholar] [CrossRef]
- Zhao, C.; Zhang, F.; Lou, W.; Wang, X.; Yang, J. A comprehensive review of advances in physics-informed neural networks and their applications in complex fluid dynamics. Phys. Fluids 2024, 36, 101301. [Google Scholar] [CrossRef]
- Kharazmi, E.; Cai, M.; Zheng, X.; Zhang, Z.; Lin, G.; Karniadakis, G.E. Identifiability and predictability of integer- and fractional-order epidemiological models using physics-informed neural networks. Nat. Comput. Sci. 2021, 1, 744–753. [Google Scholar] [CrossRef] [PubMed]
- Alkhadhr, S.; Liu, X.; Almekkawy, M. Modeling of the Forward Wave Propagation Using Physics-Informed Neural Networks. In Proceedings of the 2021 IEEE International Ultrasonics Symposium (IUS), Xi’an, China, 11–16 September 2021; pp. 1–4. [Google Scholar] [CrossRef]
- Sabri, N.; Ibrahim, Z.; Isa, D. Evaluation of Color Models for Palm Oil Fresh Fruit Bunch Ripeness Classification. Indones. J. Electr. Eng. Comput. Sci. 2018, 11, 346–353. [Google Scholar] [CrossRef]
- Fadilah, N.; Mohamad-Saleh, J.; Abdul Halim, Z.; Ibrahim, H.; Syed Ali, S.S. Intelligent Color Vision System for Ripeness Classification of Oil Palm Fresh Fruit Bunch. Sensors 2012, 12, 14179–14195. [Google Scholar] [CrossRef]
- Makky, M.; Soni, P. In situ quality assessment of intact oil palm fresh fruit bunches using rapid portable non-contact and non-destructive approach. J. Food Eng. 2014, 120, 248–259. [Google Scholar] [CrossRef]
- Tzuan, G.T.H.; Hashim, F.H.; Raj, T.; Huddin, A.B.; Sajab, M.S. Oil Palm Fruits Ripeness Classification Based on the Characteristics of Protein, Lipid, Carotene, and Guanine/Cytosine from the Raman Spectra. Plants 2022, 11, 1936. [Google Scholar] [CrossRef] [PubMed] [PubMed Central]
- Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar] [CrossRef]





| Ripeness Class | Halogen Lamp | With Red Filter | With Blue Filter | Total |
|---|---|---|---|---|
| Unripe | 6 | 5 | 7 | 18 |
| Underripe | 14 | 18 | 17 | 49 |
| Ripe | 16 | 15 | 14 | 45 |
| Symbol | Definition |
|---|---|
| Median of red-to-green ratio from raw image | |
| Total loss | |
| Sparse categorical cross-entropy loss | |
| Physics loss weighting coefficient | |
| Deterministic class index predicted by γRG for i-th sample | |
| Expected class index predicted by PINN for i-th sample | |
| Probability assigned to class for i-th sample |
| Model | Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|---|
| CNN | Class 1 | 0.41 ± 0.11 | 0.76 ± 0.22 | 0.51 ± 0.12 | 5.00 ± 0.00 |
| Class 2 | 0.69 ± 0.08 | 0.68 ± 0.08 | 0.68 ± 0.05 | 23.60 ± 2.12 | |
| Class 3 | 0.87 ± 0.07 | 0.67 ± 0.12 | 0.75 ± 0.07 | 21.40 ± 2.12 | |
| PINN (λ = 0.6) | Class 1 | 0.59 ± 0.21 | 0.64 ± 0.26 | 0.56 ± 0.15 | 5.00 ± 0.00 |
| Class 2 | 0.69 ± 0.07 | 0.79 ± 0.10 | 0.73 ± 0.06 | 23.60 ± 2.12 | |
| Class 3 | 0.88 ± 0.07 | 0.68 ± 0.12 | 0.76 ± 0.07 | 21.40 ± 2.12 | |
| PINN (λ = 5) | Class 1 | 0.52 ± 0.21 | 0.61 ± 0.20 | 0.53 ± 0.16 | 5.00 ± 0.00 |
| Class 2 | 0.66 ± 0.06 | 0.73 ± 0.12 | 0.69 ± 0.07 | 23.60 ± 2.12 | |
| Class 3 | 0.85 ± 0.09 | 0.67 ± 0.12 | 0.74 ± 0.06 | 21.40 ± 2.12 | |
| PINN (λ = 50) | Class 1 | 0.26 ± 0.07 | 0.93 ± 0.12 | 0.40 ± 0.07 | 5.00 ± 0.00 |
| Class 2 | 0.33 ± 0.37 | 0.12 ± 0.15 | 0.17 ± 0.21 | 23.60 ± 2.12 | |
| Class 3 | 0.70 ± 0.06 | 0.87 ± 0.06 | 0.77 ± 0.04 | 21.40 ± 2.12 |
| Halogen Lamp (Original) | ||||||
|---|---|---|---|---|---|---|
| PINN (λ = 0.6) | CNN | |||||
| Class | Precision | Recall | F1-Score | Precision | Recall | F1-Score |
| 1 | 0.36 ± 0.47 | 0.33 ± 0.45 | 0.33 ± 0.43 | 0.46 ± 0.47 | 0.47 ± 0.48 | 0.44 ± 0.44 |
| 2 | 0.69 ± 0.10 | 0.92 ± 0.08 | 0.78 ± 0.08 | 0.68 ± 0.13 | 0.84 ± 0.12 | 0.75 ± 0.12 |
| 3 | 0.93 ± 0.09 | 0.78 ± 0.15 | 0.84 ± 0.09 | 0.89 ± 0.11 | 0.78 ± 0.16 | 0.82 ± 0.11 |
| Halogen Lamp with Blue Filter | ||||||
|---|---|---|---|---|---|---|
| PINN (λ = 0.6) | CNN | |||||
| Class | Precision | Recall | F1-Score | Precision | Recall | F1-Score |
| 1 | 0.47 ± 0.29 | 0.83 ± 0.31 | 0.54 ± 0.25 | 0.32 ± 0.15 | 0.98 ± 0.09 | 0.46 ± 0.17 |
| 2 | 0.63 ± 0.12 | 0.71 ± 0.18 | 0.65 ± 0.12 | 0.60 ± 0.16 | 0.52 ± 0.18 | 0.53 ± 0.13 |
| 3 | 0.98 ± 0.06 | 0.46 ± 0.21 | 0.59 ± 0.19 | 0.99 ± 0.04 | 0.47 ± 0.18 | 0.61 ± 0.16 |
| Halogen Lamp with Red Filter | ||||||
|---|---|---|---|---|---|---|
| PINN (λ = 0.6) | CNN | |||||
| Class | Precision | Recall | F1-Score | Precision | Recall | F1-Score |
| 1 | 0.52 ± 0.43 | 0.57 ± 0.46 | 0.52 ± 0.40 | 0.49 ± 0.39 | 0.67 ± 0.45 | 0.52 ± 0.36 |
| 2 | 0.76 ± 0.13 | 0.77 ± 0.13 | 0.75 ± 0.08 | 0.80 ± 0.15 | 0.74 ± 0.11 | 0.76 ± 0.07 |
| 3 | 0.77 ± 0.13 | 0.77 ± 0.21 | 0.75 ± 0.14 | 0.79 ± 0.14 | 0.74 ± 0.21 | 0.73 ± 0.13 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Ng, K.-H.; Azaman, M.I.H.; Udos, W.; Khalid, M.R.M.; Mohd Bakri, M.A.; Lim, K.-S. Physics-Informed Neural Network-Assisted Imaging for Oil Palm Fruit Ripeness Classification. Electronics 2026, 15, 671. https://doi.org/10.3390/electronics15030671
Ng K-H, Azaman MIH, Udos W, Khalid MRM, Mohd Bakri MA, Lim K-S. Physics-Informed Neural Network-Assisted Imaging for Oil Palm Fruit Ripeness Classification. Electronics. 2026; 15(3):671. https://doi.org/10.3390/electronics15030671
Chicago/Turabian StyleNg, Kuan-Huei, Mohd Ikmal Hafizi Azaman, Waldo Udos, Mohd Ramdhan Mohd Khalid, Mohd Azwan Mohd Bakri, and Kok-Sing Lim. 2026. "Physics-Informed Neural Network-Assisted Imaging for Oil Palm Fruit Ripeness Classification" Electronics 15, no. 3: 671. https://doi.org/10.3390/electronics15030671
APA StyleNg, K.-H., Azaman, M. I. H., Udos, W., Khalid, M. R. M., Mohd Bakri, M. A., & Lim, K.-S. (2026). Physics-Informed Neural Network-Assisted Imaging for Oil Palm Fruit Ripeness Classification. Electronics, 15(3), 671. https://doi.org/10.3390/electronics15030671

