<h2 id="on-device-lighting-scene-model" class="nx-font-semibold nx-tracking-tight nx-text-slate-900 dark:nx-text-slate-100 nx-mt-10 nx-border-b nx-pb-1 nx-text-3xl nx-border-neutral-200/70 contrast-more:nx-border-neutral-400 dark:nx-border-primary-100/10 contrast-more:dark:nx-border-neutral-400">On-Device Lighting Scene Model<span className="tag_h2">On-App AI</span></h2>

### Feature Introduction

The **"Generative Lighting Scene"** feature, based on self-developed lightweight AI models, enables one-tap generation of professional lighting atmospheres **locally on mobile devices (on-device)**. Users don't need lighting design knowledge—simply select style preferences or usage scenarios (such as "movie", "party", "sleep", etc.), and the system can **batch generate multiple lighting solutions adapted to the current room and device combination**, with support for real-time preview and one-tap application.

This feature is integrated into **Smart Life App / Tuya App (v7.1.0 and above)**, and is applicable to all smart lighting devices supporting the Tuya ecosystem, including smart lights, light strips, spotlights, and other lighting equipment.

✅ **Core Value**:
- **Zero-Threshold Creation**: Say goodbye to manual lamp-by-lamp parameter adjustment—AI automatically generates coordinated and beautiful whole-home lighting effects
- **Ultra-Fast Response**: On-device inference < 10ms, operations take effect instantly
- **Offline Available**: No network dependency, works normally in weak/no network environments
- **Privacy & Security**: Generation process is entirely local, encrypted upload only when saving

> 💡 **Try It Now**: Open **Smart Life App / Tuya App (v7.1.0 or above)**, enter an SMB home, tap "+" in the top right corner of the home page → Select "Add New Lighting Scene" → Choose room → Select type → Tap "Auto Generate" to start your smart lighting journey!


### Technical Solution

<Image
  src='/images/solution/aiLightingScene/native_aiLightingScene_en.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
    maxWidth: '1000px',
    marginTop: '20px',
  }}
/>

#### 1. Overall Architecture: Cloud-Device Collaboration + On-Device Closed Loop

Adopts a **"Cloud Retraining, On-Device Light Inference"** distributed AI architecture:

- **Cloud**: Based on industry-level light recipe data + Large Language Models (LLM) to train universal lighting strategies and generate style knowledge bases.
- **On-Device (App)**: Deploys lightweight DNN models, combined with user room information, device characteristics, and home context to perform real-time inference and generate specific lighting parameters (color temperature, brightness, dynamic effects, etc.).

> 📌 All generation logic is completed locally on the phone, **unsaved data is not uploaded to the cloud**, ensuring user privacy.

#### 2. Model Deployment: TensorFlow Lite + On-Device Optimization

- **Inference Engine**: TensorFlow Lite (TFLite), supports Android NNAPI and iOS Core ML acceleration
- **Model Characteristics**:
  - Parameters < 1M, memory footprint < 3MB
  - Supports automatic scheduling for NPU/GPU/CPU multi-hardware backends
  - Average inference time **< 10ms** (10-device scenario, tested on mid-to-low-end devices)

#### 3. Dynamic Model Management (Dynamic Lifecycle)

- **On-Demand Loading**: AI model is silently downloaded in the background on first use, not increasing initial installation package size
- **Online Hot Update**: Dynamically updates models through OTA mechanism, optimizing generation effects or adding new styles without releasing new versions
- **Version Compatibility**: Supports multiple model coexistence, ensuring smooth transition for older devices

#### 4. Input and Output

##### Input

| Field | Description |
|-----|------|
| Room Metadata | Room type, area, usage tags |
| Device List | Device type, model, controllable attributes (supports RGB/CCT, etc.) |
| User Preferences (Optional) | Historical scenes, style tendencies, time context (day/night) |

##### Output

| Field | Description |
|-----|------|
| Lighting Scene Solution | Contains target color temperature, brightness, color, dynamic mode and other parameters for each light |
| Style Tags | Readable tags such as "Cinema Mode", "Morning Light Wake-Up", "Holiday Party", etc. |
| Preview Commands | Instantly sent to devices for effect preview |
