Skip to main content
. 2024 Oct 30;24(21):6983. doi: 10.3390/s24216983
Algorithm 2 Wind Speed Prediction and Tropical Cyclone Classification using Pre-Trained CNN

Libraries Required: TensorFlow, OpenCV, Python Imaging Library (PIL), NumPy

Input: Image I

Output: Predicted wind speed and tropical cyclone category

  •   1:

    Step 1: Load Pre-Trained Model

  •   2:

    Step 2: Image Retrieval and Preprocessing

  •   3:

    Retrieve the image I

  •   4:

    Convert the image to grayscale

  •   5:

    Resize the image to 250×250 pixels

  •   6:
    Reshape the image to (1,250,250,1) for model input:
    Ireshaped←reshape(Iresized,(1,250,250,1))
  •   7:
    Normalize the pixel values by dividing by 255:
    Inorm=Ireshaped255.0
  •   8:

    Step 3: Wind Speed Prediction Using CNN Model

  •   9:
    Feed the normalized image into the CNN model:
    y^←model.predict(Inorm)
    where y^ is the predicted wind speed.
  • 10:

    Step 4: Wind Speed Scaling

  • 11:
    Scale the predicted wind speed y^ by a factor of 10:
    y^scaled=10×y^
  • 12:

    Step 5: Cyclone Category Classification

  • 13:
    Categorize the wind speed based on the Saffir–Simpson scale:
    Category1:74≤y^scaled<95mph
    Category2:96≤y^scaled<110mph
    Category3:111≤y^scaled<129mph
    Category4:130≤y^scaled<156mph
    Category5:y^scaled≥157mph
  • 14:

    Step 6: Visualize Results

  • 15:

    Display the original resized image along with the predicted wind speed and cyclone category