בינה מאלכותית RB14-07 : זיהוי בגד בתמונה

this A.i   program is doing image classification using ANN model .

ANN mainly learns statistical correlations between pixel values without understanding the spatial structure

CNN learns both statistical patterns and visual structures (edges, shapes, curves),

🔹 ANN (MLP – Multilayer Perceptron)

  • Best for:

    • Tabular data (Excel sheets, databases, financial records, medical measurements).

    • Problems where features are independent values (age, income, temperature, etc.).

  • Why:

    • ANN just takes numbers as input and finds correlations between them.

    • There’s no spatial or sequential structure that it needs to preserve.


🔹 CNN (Convolutional Neural Network)

  • Best for:

    • Images (clothes, faces, traffic signs).

    • Video frames (action recognition, surveillance).

    • Sound (often converted to spectrogram images, so CNN can analyze patterns).

    • Handwriting / documents (OCR, sign recognition).

  • Why:

    • CNNs detect spatial patterns: edges, shapes, curves, textures, objects.

    • They preserve the structure of the data (2D for images, 1D for sound waves).

It learns how to look at a picture of clothing (like a shirt, shoe, or bag) and then decide which category it belongs to

  • Input (the picture):

    • The AI gets a 28×28 grayscale image of clothing.

  • Processing (hidden layers):

    • Inside the AI (the neural network), there are many “neurons.”

    • Each layer transforms the image data into more useful patterns:

      • First layer finds basic shapes (edges, curves).

      • Next layer combines them into bigger features (like sleeves, soles).

      • Last layer uses these features to make a decision.

  • Output (the guess):

    • The final layer produces 10 probabilities (one for each clothing type).

    • Example output:

 

 

 

1. Training Loss

  • What it is:
    How well the model is doing on the training data it sees during learning.

  • How it behaves:

    • Should go down steadily as the model learns.

    • If it stays high, the model is not learning well.


2. Validation Loss

  • What it is:
    How well the model is doing on new data it has never seen before (the validation set).

  • Why important:
    It shows if the model is generalizing or just memorizing.

 


3. Comparing Training vs Validation

  • Both decrease together:
    → Model is learning well and generalizing.

  • Training loss keeps going down, but validation loss goes up:
    → Model is overfitting (memorizing training data, not generalizing).

  • Both losses are high and don’t improve much:
    → Model is underfitting (too simple or not enough training).

 

 

Problem:
A big neural network can memorize the training data instead of learning patterns. This is called overfittin

  • Solution (Dropout):
    During training, Dropout randomly turns off some neurons.
    Example: In a layer with 10 neurons, maybe only 5 work each step.

  • Effect:

    • The network must learn backup detectors.

      If neuron A is off, neuron B must still catch the feature (like detecting an edge).

    • It stops the model from depending on a few strong neurons only.

    • Feels like you’re training many smaller networks and combining them.

👉 Result: The model works better on new, unseen data (not just training data).

 

 

 

 


Prediction :

It loads your trained Fashion-MNIST model, opens a new image (like a shirt or shoe), resizes it to 28×28, preprocesses it so it matches the training format, and then asks the model to predict which clothing category it belongs to.


 :CNN

 

 

Prediction cnn :

 

=== Prediction Result ===
Category number: 0
Category name: T-shirt/top
Confidence: 0.8358

 

 

כתיבת תגובה