For borderline circumstances, we use an Autoencoder skilled solely on clear SAR photos. It learns to compress and reconstruct photos. If it fails, which means one thing is off.
from tensorflow.keras.fashions import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, UpSampling2Dautoencoder = Sequential([
Conv2D(32, (3, 3), activation='relu', padding='same', input_shape=(128, 128, 1)),
MaxPooling2D((2, 2), padding='same'),
Conv2D(32, (3, 3), activation='relu', padding='same'),
UpSampling2D((2, 2)),
Conv2D(1, (3, 3), activation='sigmoid', padding='same')
])
autoencoder.compile(optimizer='adam', loss='mse')
After coaching, you calculate reconstruction error:
reconstructed = autoencoder.predict(picture[np.newaxis, ..., np.newaxis])
error = np.imply((picture - reconstructed[0,...,0]) ** 2)