Skip to content

husamhamu/ML_Anomaly_detection

Repository files navigation

⚙️ Anomaly Detection in Pneumatic Cylinder Production

This repository contains the solution for the Data Challenge, focusing on detecting anomalies in the manufacturing of pneumatic cylinder bottom parts using machine learning models.


📑 Table of Contents


🎯 Motivation and Goals

  • Background: CNC-milling process of pneumatic cylinders.

  • Goal: Develop a machine learning model to classify bottom parts as:

    • False: Anomaly
    • True: No anomaly

This ensures quality control before further production steps and helps guarantee product functionality early on. 📷

image

📊 Data and Feature Exploration

  • Separation of true and false parts.
  • Time series analysis across multiple sensors.
  • Computation of statistical features: mean, RMS, kurtosis, skewness, etc.
  • Generated 900 features per data point. 📷 image

🛠️ Concept and Methodology

The data pipeline consists of:

  1. Feature Extraction
  2. Feature Selection 🔍 (correlation-based, reduced 900 → 161 features)
  3. Data Split ✂️ (80% train / 20% validation, stratified)
  4. Class Imbalance Handling ⚖️ (SMOTE)
  5. Feature Scaling 📏 (StandardScaler)

📷 image


🤖 Machine Learning Models

We experimented with the following models:

  • MLP (Multilayer Perceptron) 🧠
  • SVM (Support Vector Machine) 📐
  • Random Forest (RF) 🌲

Each model’s hyperparameters were optimized based on trial and error.


📈 Model Evaluation

  • Models evaluated on 20% test set.
  • Primary metric: F1-score. 📷 image

✅ Final Model and Applicability

  • Uses all data channels.

  • Fast training but requires heavy preprocessing.

  • Models are accurate but not fully reliable for real-world deployment yet. 📷

    image

🚀 Future Improvements

  • Stronger oversampling of anomaly parts (SMOTE tuning).
  • Collection of more sensor data to improve reliability.

⚡ How to Run

# Clone this repository
git clone https://github.com/<your-username>/<repo-name>.git

# Install dependencies
pip install -r requirements.txt

# Train the model
python train.py

# Evaluate the model
python evaluate.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors