This project predicts CPU, Memory, Network, and Disk utilization in a cloud environment using LTSM neural networks. By leveraging AI-powered time-series forecasting, this system provides insights into cloud resource usage trends, helping cloud providers optimize performance, reduce costs, and prevent downtime.
- Multi-Resource Prediction: Forecasts CPU, Memory, Network, and Disk usage.
- Anomaly Detection: Identifies unexpected spikes in resource utilization.
- Hyperparameter Tuning: Optimized LSTM model for improved accuracy.
- Real-Time API Deployment: Uses FastAPI to serve predictions.
- Enhanced Visualizations: Provides clear insights with time-series graphs.
- Model Saving & Deployment: Enables real-world integration and inference.
The dataset consists of simulated cloud workload metrics, including:
- CPU Usage (Percentage)
- Memory Usage (Percentage)
- Network Utilization (MB/s)
- Disk Utilization (MB/s)
In real-world scenarios, data can be sourced from AWS CloudWatch, Google Cloud Metrics, or Azure Monitor.
git clone https://github.com/your-username/Cloud-Resource-Predictor.git
cd Cloud-Resource-Predictorpip install -r requirements.txtjupyter notebookOpen Cloud_Resource_Utilization_Prediction_With_Graphs.ipynb and execute the cells.
The LSTM model consists of:
- LSTM Layers: Captures time-series dependencies.
- Dropout Layers: Prevents overfitting.
- Dense Layers: Outputs multi-resource predictions.
Run the training script in the notebook:
history = model.fit(X_train, y_train, epochs=50, batch_size=32, validation_data=(X_test, y_test))predictions = model.predict(X_test)
mae = mean_absolute_error(y_test, predictions)
rmse = math.sqrt(mean_squared_error(y_test, predictions))model.save('cloud_utilization_prediction.h5')To load the model for inference:
from tensorflow.keras.models import load_model
model = load_model('cloud_utilization_prediction.h5')To compare actual vs. predicted CPU usage:
plt.plot(y_test[:, 0], label='Actual CPU Usage', color='blue')
plt.plot(predictions[:, 0], label='Predicted CPU Usage', linestyle='dashed', color='orange')
plt.xlabel('Time')
plt.ylabel('CPU Usage')
plt.title('Actual vs. Predicted CPU Utilization')
plt.legend()
plt.show()- Integrate with Real Cloud Data: AWS CloudWatch, Google Cloud Metrics.
- Deploy Model as an API: Provide real-time cloud usage forecasts.
- Extend to Additional Metrics: Include latency, IOPS, and other factors.
- Improve Anomaly Detection: Implement advanced outlier detection methods.
This project is open-source under the MIT License.
- Your Name – GitHub Profile
- TensorFlow/Keras for deep learning support.
- Open-source datasets for simulation.