Data Pipeline & Model Architecture
A complete explanation of the data processing pipeline (dataset split, augmentation, generator) and the neural network architecture used by InsCure.
๐ 1. Data Processing Pipeline & Preprocessing
Steps for preparing, splitting, and augmenting data before training.
Dataset Split
- Split ratio: 80% Training and 20% Validation.
- Dataset parameter: `validation_split=0.2` with random seed `123`.
- Goal: Ensure objective model performance evaluation on unseen data.
Image Data Augmentation
- Overfitting prevention: Generates real-time image variation for training.
- Supporting library: TensorFlow Keras `ImageDataGenerator`.
- Config: Rotation (40ยฐ), width/height shift (20%), shear (20%), zoom (20%), and horizontal flip.
Training Data
- Batch size: 32 images per iteration.
- Target input dimension: 224x224 pixels (RGB).
- Pixel normalisation: Division by 255.0 (`rescale=1./255`) to range [0.0, 1.0].
Validation Data
- Clean processing: No augmentation to preserve metric integrity.
- Target input dimension: 224x224 pixels (RGB).
- Pixel normalisation: Division by 255.0 (`rescale=1./255`).
๐ง 2. Neural Network Model Architecture
Data flow visualisation through each layer of the neural network architecture during the training process.
Model Processing Workflow Pipeline
Click a block below to see detailed layer parameter information.
Input Layer
Input image sized 224ร224 with 3 colour channels (RGB).
Base Model (MobileNetV2)
CNN backbone pre-trained on the ImageNet dataset. Weights frozen (trainable=False) for transfer learning.
Global Average Pooling 2D
Reduces the spatial dimensions of the 2D feature map (7ร7) to a 1D vector by averaging feature values.
Dense (Hidden) Layer
Fully Connected Layer with 256 neurons for custom skin disease feature classification.
Dropout Layer (50%)
Regularisation technique that randomly disables 50% of neurons during the training phase.
Output (Softmax) Layer
Final Dense layer with 11 units producing probability values for each skin disease class.
Model Training Metadata
- OptimiserAdam (learning_rate=0.001)
- Loss Functionsparse_categorical_crossentropy
- Epoch LimitMax 100 Epochs
- Custom CallbackStop if train & val acc > 92%
- Batch Size32
Final Performance Metrics
The training process was automatically stopped at Epoch 43 as the model met the optimal performance criteria with high accuracy.
*Performance metrics are evaluated independently using a random validation dataset (20% split).