Skip to main content

A Python package for adaptive task execution and machine learning integration.

Project description

ATEM - Adaptive Task Execution Model


ATEM (Adaptive Task Execution Model) is a machine learning-based project designed to determine the optimal sequence of tasks to maximize points in the autonomous phase of FTC robotics competitions. The project utilizes TensorFlow and TensorFlow Lite for efficient model deployment.

Features

  • Model Training:

    • Train a TensorFlow model to optimize task sequences for maximum points.
    • Tasks and their respective points are dynamically loaded from a JSON file.
    • Outputs a TensorFlow Lite model for lightweight deployment.
  • Model Interpretation:

    • Given a list of tasks, predicts the optimal sequence and total points.
    • Outputs human-readable task orders and scores.

How It Works

1. Task JSON File

The tasks.json file defines the tasks available for the autonomous phase:

{
  "tasks": [
    { "name": "High Basket", "points": 10, "time": 5 },
    { "name": "Low Basket", "points": 5, "time": 3 },
    "..."
  ]
}

Training the Model

The model uses task data to train on sequences of tasks for maximizing points within a time limit:

  • Loads tasks from the tasks.json file.
  • Generates random task sequences within the given time constraint.
  • Encodes tasks and trains a model to predict scores based on sequences.
  • Outputs a TensorFlow Lite model for deployment.

Interpreting the Model

The interpreter script takes a sequence of tasks, predicts the total points, and outputs the best sequence in human-readable format.

Technical Details

Model Architecture

Input:

  • Task indices (embedded into dense vectors).

  • Task times (numeric values).

  • Hidden Layers:

  • Dense layers for feature extraction and sequence analysis.

  • Output

  • Predicted total points for a given task sequence.

Data Encoding

  • Task names are encoded as numerical indices.
  • Task times are padded to a fixed length for uniform input.

Adaptive Task Prediction Model


Overview

The Adaptive Task Prediction Model is designed to enable real-time decision-making for autonomous robots. It processes sensor data after each task completion, predicts the next optimal task, and adjusts its strategy based on the robot’s current state and environmental feedback.

This dynamic approach ensures the robot maximizes performance, conserves resources, and adapts to unexpected changes in real-world scenarios.


Workflow

1. Sensor Data Collection

After completing each task, the robot gathers sensor data to provide a snapshot of its current state:

  • Time Elapsed: Time taken to complete the task.
  • Distance to Target: The robot's proximity to the next goal.
  • Gyro Angle: Orientation relative to the reference.
  • Battery Level: Remaining energy for task prioritization.
  • Additional sensor inputs like vision or LIDAR can be incorporated.

2. Feature Encoding

Sensor data and the current task ID are encoded into a format compatible with the machine learning model:

  • Continuous values are normalized for consistent input ranges.
  • Categorical values are converted to embeddings or indices.

3. Real-Time Model Inference

The model processes the encoded input to:

  1. Predict the Next Task:
    • Outputs the most likely task to maximize performance.
  2. Provide Task Scores:
    • Confidence levels for all possible tasks.

Example:

Input:
- Current Task: "Observation Zone"
- Sensor Data: {time_elapsed: 20, distance_to_target: 0.5, gyro_angle: 45, battery_level: 70}

Output:
- Predicted Next Task: "High Basket"
- Task Scores: [0.1, 0.8, 0.1]

Model Inferencing

The Adaptive Task Prediction Model utilizes a TensorFlow Lite (TFLite) model for efficient inference. This lightweight, optimized model is specifically designed for resource-constrained environments like robotics systems, ensuring fast and accurate predictions in real time.


The model requires encoded inputs representing:

  • Current Task: Encoded as a numerical ID using the task_to_index mapping.
  • sensor Data: Real-time inputs such as:
  • time_elapsed: Normalized elapsed time.
  • distance_to_target: Scaled distance to the next target.
  • gyro_angle: Angle, normalized to a fixed range.
  • battery_level: Percentage value normalized between 0 and 1.

*The inputs are padded to match the model’s expected dimensions if needed.

Once the input data is prepared, it is passed into the TFLite interpreter:

  • The interpreter runs the input through the pre-trained model.
  • The output includes:
  • Predicted Task Scores: Confidence scores for each possible task.
  • Selected Task: The task with the highest score.

How the AI Adapts in Real-Time

  • After completing a task, the robot feeds its current state (task + sensor data) into the model.
  • The AI processes the input and:
  • Predicts the next task to perform.
  • Scores all potential tasks to indicate confidence levels.
  • The robot executes the predicted task with the highest score.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atem-1.2.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

atem-1.2.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file atem-1.2.2.tar.gz.

File metadata

  • Download URL: atem-1.2.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for atem-1.2.2.tar.gz
Algorithm Hash digest
SHA256 892a603575f8c9b001bf97205149aa2c1a52dfed7ddb6e21109ba9c70c83f649
MD5 4589de22220dc8c01181d0b238ec32f9
BLAKE2b-256 a2e16ab78be5ea434540ccf50e1b0ea79134664bddd5c5540d55c19a43b62919

See more details on using hashes here.

File details

Details for the file atem-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: atem-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for atem-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3bb7f4c864d9843ecf3e901d36a0697ecdcd1a29760096a2590d7faf5ecafd0
MD5 fda3d7b01ea7d029372d36577ef22d0a
BLAKE2b-256 1f35dfc37fdb26e0b4d78f69b00333e08879f2829ad61228e969ba36f03ea4d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page