Posts tagged "FAVORIOT"

[Tutorial] : Automated Quality Inspection System Using AI & FAVORIOT

April 6th, 2025 Posted by BLOG, HOW-TO, Internet of Things, IOT PLATFORM, TIPS 0 thoughts on “[Tutorial] : Automated Quality Inspection System Using AI & FAVORIOT”

This guide will show you how to build an AI-powered quality inspection system using a camera and send inspection results to the FAVORIOT IoT platform in real time.


šŸ”§ Step 1: What You Need

Hardware:

  • Raspberry Pi (or any computer with a camera)
  • Camera (USB or Pi Camera)
  • Internet connection

Software:

  • Python 3
  • Libraries: opencv-python, tensorflow, numpy, requests

šŸ› ļø Step 2: Install the Required Software

Open Terminal and run:

sudo apt update && sudo apt upgrade -y
sudo apt install python3-pip -y
pip3 install opencv-python numpy requests tensorflow

šŸ§  Step 3: Train an AI Model to Detect Defects

Create a folder called dataset_defects with 2 subfolders: defect and normal.

Now, use this Python code to train the model:

import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator

dataset_path = "dataset_defects"
batch_size = 32
img_size = (224, 224)

datagen = ImageDataGenerator(rescale=1./255, validation_split=0.2)

train_data = datagen.flow_from_directory(
    dataset_path,
    target_size=img_size,
    batch_size=batch_size,
    class_mode="binary",
    subset="training"
)

val_data = datagen.flow_from_directory(
    dataset_path,
    target_size=img_size,
    batch_size=batch_size,
    class_mode="binary",
    subset="validation"
)

base_model = tf.keras.applications.MobileNetV2(input_shape=(224, 224, 3), include_top=False, weights="imagenet")
base_model.trainable = False

model = tf.keras.Sequential([
    base_model,
    tf.keras.layers.GlobalAveragePooling2D(),
    tf.keras.layers.Dense(1, activation="sigmoid")
])

model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"])
model.fit(train_data, validation_data=val_data, epochs=10)

model.save("defect_detection_model.h5")

šŸŽ„ Step 4: Real-Time Defect Detection Using Camera

Once the model is trained and saved, run this script:

import cv2
import numpy as np
import tensorflow as tf

model = tf.keras.models.load_model("defect_detection_model.h5")
cap = cv2.VideoCapture(0)

while True:
    ret, frame = cap.read()
    if not ret:
        break

    img = cv2.resize(frame, (224, 224))
    img = np.expand_dims(img, axis=0) / 255.0
    prediction = model.predict(img)[0][0]

    label = "Defect Detected!" if prediction > 0.5 else "Product OK"
    color = (0, 0, 255) if prediction > 0.5 else (0, 255, 0)

    cv2.putText(frame, label, (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, color, 2)
    cv2.imshow("Quality Inspection", frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

šŸŒ Step 5: Send Defect Results to FAVORIOT

āœ… 1. Set Up a Device in FAVORIOT

  1. Log in to Favoriot Platform
  2. Go to Devices ā†’ Add Device
  3. Note down your Device Developer ID and API Key

āœ… 2. Add Code to Send Data

Below is the function to send results:

import requests
import json

DEVICE_ID = "YOUR_DEVICE_ID"
API_KEY = "YOUR_FAVORIOT_API_KEY"
URL = "https://apiv2.favoriot.com/v2/streams"

def send_data_to_favoriot(status):
    payload = {
        "device_developer_id": DEVICE_ID,
        "data": {
            "status": status
        }
    }

    headers = {
        "Content-Type": "application/json",
        "Apikey": API_KEY
    }

    response = requests.post(URL, data=json.dumps(payload), headers=headers)
    print("Response from Favoriot:", response.json())

āœ… 3. Combine with Real-Time Detection

Add this snippet inside your prediction logic:

if prediction > 0.5:
    send_data_to_favoriot("Defect Detected!")
else:
    send_data_to_favoriot("Product OK")

šŸ“Š Step 6: View Data on FAVORIOT Dashboard

  • Go to your device on the FAVORIOT Dashboard
  • Click on Streams to view defect data
  • You can also create graphs or alert rules for monitoring

šŸš€ Bonus Tips

  • Add Telegram Alerts using Telegram Bot API
  • Add Dashboard Charts using Favoriotā€™s visualization
  • Improve accuracy with better dataset or model tuning

āœ… Summary

With this project, you have:

āœ… Built a real-time defect detection system
āœ… Displayed results on screen
āœ… Sent reports to FAVORIOT cloud platform

References

Disclaimer

This article provides a step-by-step guide and only serves as a guideline. The source code may need adjustments to fit the final project design.

Favoriot and Aswant Solution Join Forces to Revolutionize AI, IoT, and Security

March 5th, 2025 Posted by BLOG, Kaspersky, NEWS, PARTNER 0 thoughts on “Favoriot and Aswant Solution Join Forces to Revolutionize AI, IoT, and Security”

Puchong, Malaysia ā€“ March 5, 2025 ā€“ A game-changing partnership has been forged today as Favoriot Sdn Bhd and Aswant Solution Sdn Bhd officially signed a Memorandum of Understanding (MOU) at Favoriotā€™s office in Puchong, Malaysia. This strategic alliance is set to supercharge innovation in Artificial Intelligence (AI), the Internet of Things (IoT), and cybersecurity, empowering businesses with cutting-edge technology solutions.

The agreement was formalized by Dr. Mazlan Abbas, CEO of Favoriot Sdn Bhd, and Nor Asrul Mohd Noor, Managing Director of Aswant Solution Sdn Bhd, with Zura Huzali, Business Development Director of Favoriot, and Fazlirizam Mohammed Nor, Director of Aswant Solution, witnessing the milestone moment.

Powering the Future with AI-Driven IoT and Security Solutions

This collaboration is more than just a handshakeā€”itā€™s a commitment to shaping the future of AI and IoT-driven security solutions. By combining Favoriotā€™s expertise in IoT platform development with Aswant Solutionsā€™ prowess in IT security and distribution, both companies are ready to tackle emerging challenges in digital transformation.

Dr. Mazlan Abbas expressed his excitement about this partnership:
“We are on the brink of a new era in IoT and AI, and this collaboration marks a crucial step in bringing secure, intelligent solutions to businesses across industries. Aswant Solutionsā€™ strong foothold in IT security and distribution perfectly complements our IoT capabilities, making this a powerful synergy for the future.”

Nor Asrul Mohd Noor echoed the enthusiasm, stating:
“At Aswant Solutions, we believe in innovation with security at its core. Partnering with Favoriot allows us to enhance the reach of AI-powered automation and IoT efficiency while ensuring robust protection for businesses. Together, we are driving the next wave of digital transformation.”

Unlocking New Possibilities in Smart and Secure Technologies

Favoriot is widely recognized for its scalable IoT platform, which enables businesses to integrate real-time data analytics and smart applications seamlessly. As a Kaspersky Platinum Partner in Malaysia, Aswant Solutions is a leader in cybersecurity, system integration, and IT distribution, providing businesses with the tools to navigate the evolving digital landscape securely.

This partnership is a leap forward in fostering technological advancements, allowing businesses in Malaysia and beyond to embrace AI, IoT, and cybersecurity with confidence.

About Favoriot

Favoriot is a premier IoT platform provider that simplifies the deployment of IoT applications, offering real-time data insights, cloud-based solutions, and seamless device integration.

About Aswant Solutions

Aswant Solutions is a leading IT security and distribution firm in Malaysia, specializing in advanced cybersecurity, networking, and system integration to help businesses secure their digital transformation journey.

For further details, visit:
šŸ”— Favoriot: www.favoriot.com
šŸ”— Aswant Solutions: www.aswant-solution.com

Favoriot Edge Gateway Service

March 4th, 2025 Posted by BLOG, HOW-TO, Internet of Things, IOT PLATFORM 0 thoughts on “Favoriot Edge Gateway Service”

Favoriot Edge Gateway is a service that connects IoT gateways directly to the Favoriot Platform. It bridges the ā€œedgeā€ (local devices) and the Favoriot Platform, enabling data from local devices to be processed, managed, and stored. Additionally, it allows for the selection of specific parameters in the payload to be stored, providing greater control over transmitted data.

Key References

Copyright Ā© 2025 All rights reserved