Click4Ai

329.

Hard

Image Classification CNN

**Problem:** Train a CNN to classify images into two classes.

Example:

Given a dataset of images, train a CNN to classify the images into two classes (e.g. cats and dogs).

Constraints:

  • Use the Keras library to build the CNN model.
  • Use the NumPy library to manipulate arrays.
  • Train the model using the Adam optimizer and categorical cross-entropy loss.
  • **Note:** CNNs are often used in image classification tasks.

    Test Cases

    Test Case 1
    Input: [[1,2,3],[4,5,6]]
    Expected: [0.5, 0.6]
    Test Case 2
    Input: [[7,8,9],[10,11,12]]
    Expected: [0.7, 0.8]
    + 3 hidden test cases