| Input: Image Input Directory, Sample Image Count, Batch Size. |
| Output: Extracted Features of the input black fungus dataset image. |
| Step-1: Define the function named ‘feature_extract’ with required input parameters. |
| Step-2: Specify the input parameters such as input directory, total number of images and batch size to the function called ‘feature_extract' |
| Step-3: Generate the given image data by using data-Generator() function. |
| Step-4: Provide the required parameters to manipulate the data_generator function such as directory, batch size, target image size and image shuffle status. |
| Pseudocode: |
| define feature_extract(img_directory, sampleCount, batchSize): |
| data_gen = Image_DataGenerator {scale = 1./255} |
| data_gen_1←data_gen.flow (from_directory{img_directory, batch_Size = batchSize, targetSize:[32,32], shuffle:False}); |
| Step-5: Initialize the variable called img_cnt and set a constant value to that for the loop initiation. |
| Step-6: Declare X and Y batches to identify the input and associated labels. |
| Step-7: Generate the ‘for' loop to process the features of the images presented into the dataset. |
| Step-8: Concatenate the X and Y batches to the temporary variable called X and Y. |
| Step-9: Return the class names with respect to X and Y. |
| Pseudocode: |
| img_cnt = 0; |
| x_batches = []; |
| y_batches = []; |
| for (inputs_batch, labels_batch in generator) |
| { |
| x_batches_append{inputs_batch}; y_batches_append{labels_batch}; |
| img_cnt+ = inputs_batch{shape(0)}; |
| if (img_cnt ≥ generator.n) |
| { |
| break; |
| } |
| X.assign(np_concatenate{x_batches}); |
| Y.assign(np_concatenate{Y_batches}); |
| } |
| Return X, Y, class_names; |
| Step-10: Image Features extracted and set to an object called train_features. |