Block-based compressive sensing in deep learning using AlexNet for vegetable classification

View article
PeerJ Computer Science

Main article text

 

Introduction

Materials and Methods

  1. Read an RGB image and resize to a certain resolution (N×N) obtaining x(n,m).

  2. Generate random normal distributed A(M×L) matrix for CS acquisition where L=B2, B is the size of segmented image and ML.

  3. Apply segmentation of the image into B×B pixels obtaining xi(B×B) where i is a block number of the block-based image.

  4. Transform xi into DCT domain by 2-D DCT obtaining Xi(B×B).

  5. Reshape 2-D matrix Xi into 1-D vector obtaining vi with size B2×1.

  6. Apply CS acquisition Aviobtaining Yi with size M×1.

  7. Reconstruct Yi by OMP using A obtaining ˆvi with size B2×1.

  8. Reshape 1-D vector ˆvi into 2-D matrix ˆXi with size B×B.

  9. Apply 2-D IDCT to ˆXi obtaining ˆxi with size B×B.

  10. Repeat steps 4–9 until all blocks are processed.

  11. Combine all blocks from step 10 obtaining the reconstructed image ˆx(n,m) with size N×N.

  12. Repeat steps 1–11 until we have 400 reconstructed images for training. These images are ready to go to the deep learning training stage.

  13. Train the dataset consisting of 400 images using the AlexNet technique in CNN model to obtain the trained network. Save the trained network.

  1. Read an RGB image and resize to the certain resolution (N×N) obtaining x(n,m).

  2. Generate random normal distributed A(M×L) matrix for CS acquisition where L=B2,B is the size of segmented image and ML.

  3. Apply segmentation of the image into B×B pixels obtaining xi(B×B) where i is a block number of the block-based image.

  4. Transform xi into DCT domain using 2-D DCT to obtain Xi(B×B).

  5. Reshape 2-D matrix Xi into 1-D vector obtaining vi with size B2×1.

  6. Apply CS acquisition Avi obtaining Yi with size M×1.

  7. Reconstruct Yi by OMP using A obtaining ˆvi with size B2×1.

  8. Reshape 1-D vector ˆvi into 2-D matrix ˆXi with size B×B.

  9. Apply 2-D IDCT to ˆXi obtaining ˆxi with size B×B.

  10. Repeat steps 4–9 until all blocks are processed.

  11. Combine all blocks from step 10 to obtain the reconstructed image ˆx(n,m) with size N×N.

  12. Load the trained network and apply testing to the reconstructed image using AlexNet technique and the trained network. Save the testing result.

  13. Repeat steps 1–12 for the next testing of the reconstructed image. Calculate the deep learning performance of all testing images according to accuracy, precision, recall and F1-score.

Results

Conclusion

Additional Information and Declarations

Competing Interests

The authors declare that they have no competing interests.

Author Contributions

Indrarini Dyah Irawati conceived and designed the experiments, analyzed the data, prepared figures and/or tables, authored or reviewed drafts of the article, and approved the final draft.

Gelar Budiman conceived and designed the experiments, performed the computation work, authored or reviewed drafts of the article, and approved the final draft.

Sofia Saidah performed the computation work, authored or reviewed drafts of the article, and approved the final draft.

Suci Rahmadiani performed the experiments, prepared figures and/or tables, and approved the final draft.

Rohaya Latip analyzed the data, authored or reviewed drafts of the article, and approved the final draft.

Data Availability

The following information was supplied regarding data availability:

The code is available at GitHub and Zenodo:

- https://github.com/gelar1978/CS_vegetables_Alexnet/tree/main/CS_vegetables_Alexnet.

- Irawati, Indrarini Dyah, Budiman, Gelar, Saidah, Sofia, Rahmadiani, Suci, & Latip, Rohaya. (2023). Block-based compressive sensing in deep learning using AlexNet for vegetable classification (Final). Zenodo. https://doi.org/10.5281/zenodo.8358537.

The data are available at: M. I. Ahmed, S. Mahmud Mamun and A. U. Zaman Asif, “DCNN-Based Vegetable Image Classification Using Transfer Learning: A Comparative Study,” 2021 5th International Conference on Computer, Communication and Signal Processing (ICCCSP), Chennai, India, 2021, pp. 235-243, DOI 10.1109/ICCCSP52374.2021.9465499.

Funding

This research was funded by Telkom University through the 2022 International research scheme (No: KWR4.072/PNLT3/PPM-LIT/2022) in collaboration with University of Putra Malaysia. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

3 Citations 760 Views 44 Downloads