I am trying to predict disease based on image. image size is 224*224…i am getting error WARNING:tensorflow:Model was constructed with shape (None, 224, 224, 3) for input KerasTensor(type_spec=TensorSpec(shape=(None, 224, 224, 3), dtype=tf.float32, name=‘input_1’), name=‘input_1’, description=“created by layer ‘input_1’”), but it was called on an input with incompatible shape (None, 1).

# Define the CNN model

model = Sequential()

model.add(Conv2D(32, kernel_size=(3, 3), activation=‘relu’, input_shape=(224, 224, 1

)))

model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Conv2D(64, kernel_size=(3, 3), activation=‘relu’))

model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Flatten())

model.add(Dense(128, activation=‘relu’))

model.add(Dense(1)) # Assuming you want to predict a continuous hemoglobin level

# Compile the model

model.compile(loss=‘mean_squared_error’, optimizer=‘adam’)

X = dataset.iloc[:, :-1]

y = dataset.iloc[:, -1]

# Perform LOOCV

predictions = []

for i, j in loo.split(X):

X_train, X_test = X.iloc[i,:], X.iloc[j,:]

```
y_train, y_test = y[i], y[j]
model.compile(
optimizer=keras.optimizers.Adam(1e-3),
loss="binary_crossentropy",
metrics=["accuracy"],
)
model.fit(X_train, y_train, batch_size=10, epochs=10, verbose=1)
prediction = model.predict(X_test)
predictions.append(prediction)
```