Skip to main content

scirs2_ndimage/ai_driven_adaptive_processing/
config.rs

1//! Configuration and Core Types for AI-Driven Adaptive Processing
2//!
3//! This module contains configuration structures, enums, and core data types
4//! used throughout the AI-driven adaptive processing system.
5
6use crate::advanced_fusion_algorithms::AdvancedConfig;
7
8/// AI-Driven Adaptive Processing Configuration
9#[derive(Debug, Clone)]
10pub struct AIAdaptiveConfig {
11    /// Base Advanced configuration
12    pub base_config: AdvancedConfig,
13    /// Learning rate for AI adaptation
14    pub learning_rate: f64,
15    /// Experience replay buffer size
16    pub replay_buffer_size: usize,
17    /// Multi-modal learning enabled
18    pub multi_modal_learning: bool,
19    /// Continual learning enabled
20    pub continual_learning: bool,
21    /// Explainable AI features enabled
22    pub explainable_ai: bool,
23    /// Transfer learning enabled
24    pub transfer_learning: bool,
25    /// Few-shot learning threshold
26    pub few_shot_threshold: usize,
27    /// Performance optimization target
28    pub optimization_target: OptimizationTarget,
29    /// AI model complexity level
30    pub model_complexity: ModelComplexity,
31    /// Prediction horizon (for predictive processing)
32    pub prediction_horizon: usize,
33    /// Adaptation speed (how fast to adapt to new patterns)
34    pub adaptation_speed: f64,
35}
36
37impl Default for AIAdaptiveConfig {
38    fn default() -> Self {
39        Self {
40            base_config: AdvancedConfig::default(),
41            learning_rate: 0.001,
42            replay_buffer_size: 10000,
43            multi_modal_learning: true,
44            continual_learning: true,
45            explainable_ai: true,
46            transfer_learning: true,
47            few_shot_threshold: 5,
48            optimization_target: OptimizationTarget::Balanced,
49            model_complexity: ModelComplexity::High,
50            prediction_horizon: 10,
51            adaptation_speed: 0.1,
52        }
53    }
54}
55
56/// Optimization Target Preferences
57#[derive(Debug, Clone, PartialEq)]
58pub enum OptimizationTarget {
59    Speed,
60    Quality,
61    Balanced,
62    MemoryEfficient,
63    EnergyEfficient,
64    UserCustom(Vec<f64>), // Custom weights for different objectives
65}
66
67/// AI Model Complexity Levels
68#[derive(Debug, Clone)]
69pub enum ModelComplexity {
70    Low,
71    Medium,
72    High,
73    Advanced,
74    Adaptive, // Automatically adjusts complexity based on available resources
75}
76
77/// Pattern Types
78#[derive(Debug, Clone, Hash, Eq, PartialEq)]
79pub enum PatternType {
80    Natural,
81    Synthetic,
82    Medical,
83    Satellite,
84    Scientific,
85    Artistic,
86    Document,
87    Industrial,
88    Security,
89    Gaming,
90    Educational,
91    Research,
92    Unknown,
93}
94
95/// Complexity Levels
96#[derive(Debug, Clone, Hash, Eq, PartialEq)]
97pub enum ComplexityLevel {
98    VeryLow,
99    Low,
100    Medium,
101    High,
102    VeryHigh,
103    Extreme,
104}
105
106/// Noise Levels
107#[derive(Debug, Clone, Hash, Eq, PartialEq)]
108pub enum NoiseLevel {
109    Clean,
110    Low,
111    Medium,
112    High,
113    Extreme,
114}
115
116/// Algorithm Types
117#[derive(Debug, Clone)]
118pub enum AlgorithmType {
119    GaussianFilter,
120    MedianFilter,
121    BilateralFilter,
122    EdgeDetection,
123    MorphologyOperation,
124    QuantumProcessing,
125    NeuromorphicProcessing,
126    ConsciousnessSimulation,
127    AdvancedFusion,
128    CustomAI,
129}
130
131/// Feature Types
132#[derive(Debug, Clone, Hash, Eq, PartialEq)]
133pub enum FeatureType {
134    Edges,
135    Textures,
136    Shapes,
137    Colors,
138    Gradients,
139    Corners,
140    Lines,
141    Curves,
142    Patterns,
143    Objects,
144    Faces,
145    Text,
146}
147
148/// Image Pattern Recognition
149#[derive(Debug, Clone, Hash, Eq, PartialEq)]
150pub struct ImagePattern {
151    /// Pattern type
152    pub pattern_type: PatternType,
153    /// Complexity level
154    pub complexity: ComplexityLevel,
155    /// Noise level
156    pub noise_level: NoiseLevel,
157    /// Dominant features
158    pub dominantfeatures: Vec<FeatureType>,
159}