Project Structure:
--------------------------------------------------
├── main.py                   # Main entry point of the project, including data loading, model initialization, training, and validation process control
├── config.py                 # Configuration file defining hyperparameters, data paths, and parameters for each module
├── mtl_feature_net.py        # Multi-task learning feature extraction network and its extended modules, which extract texture, shape, color, and depth features from 2D images
├── adaptive_nerf.py          # Improved NeRF module that incorporates adaptive scale adjustment and spectral-aware rendering techniques
├── diffusion_model.py        # Conditional diffusion model module that generates high-quality images by guiding the reverse diffusion process with high-dimensional conditional vectors
├── utils.py                  # Utility functions including data preprocessing, evaluation metric computation, and logging
└── readme.txt                # Provides project introduction, dependencies, installation instructions, and usage guidelines
--------------------------------------------------

Dependencies:
--------------------------------------------------
- Python 3.8 or higher
- PyTorch 1.8 or higher
- numpy
- pandas
- json5
- opencv-python
- Pillow
- matplotlib
- open3d
- h5py
- scipy
- tqdm
- tensorboard
- torchsummary
- requests
- socket
- zlib
- pathlib
--------------------------------------------------

Installation Steps:
--------------------------------------------------
1. Clone the project repository:
   git clone <repository link>
2. Create and activate a virtual environment (optional):
   For Linux/MacOS:
       python3 -m venv venv
       source venv/bin/activate
   For Windows:
       python -m venv venv
       venv\Scripts\activate
--------------------------------------------------

Data Preparation:
--------------------------------------------------
Please prepare your data following the directory structure below:
├── data
│   ├── train
│   │   ├── images      # Training images (e.g., .png, .jpg)
│   │   ├── gt          # Training ground truth images
│   │   └── rays        # Corresponding ray data saved in .npy format
│   └── val
│       ├── images      # Validation images
│       ├── gt          # Validation ground truth images
│       └── rays        # Validation ray data
--------------------------------------------------

Configuration:
--------------------------------------------------
All configuration parameters are stored in the config.yaml file, including:
- learning_rate: Training learning rate (e.g., 1e-4)
- lr_step, lr_gamma: Learning rate decay parameters
- train_data_path, val_data_path: Paths for training and validation data
- feature_net_params: Parameters for the MTL-FeatureNet module (e.g., number of input channels, number of Transformer layers, number of attention heads, etc.)
- nerf_params: Parameters for the improved NeRF module (e.g., number of sampling points, hidden layer dimensions, positional encoding settings, etc.)
- diffusion_params: Parameters for the conditional diffusion model (e.g., number of diffusion steps, starting and ending beta values, conditional vector dimensions, etc.)
--------------------------------------------------

Training Process:
--------------------------------------------------
1. Run the main program:
       python main.py --config config.yaml --epochs 100 --batch_size 8
2. During training, model weights will be saved to the specified checkpoint directory (default is ./checkpoints).
3. Training logs will be output to both the terminal and a log file (managed via utils.setup_logger).
--------------------------------------------------

Evaluation and Testing:
--------------------------------------------------
- After training, evaluate the model performance using the validation process. Evaluation metrics include:
   * Peak Signal-to-Noise Ratio (PSNR)
   * Structural Similarity Index (SSIM)
   * Perceptual Loss (e.g., LPIPS)
   * Chamfer Distance, etc.
- Utility functions for computing these metrics are provided in utils.py.
--------------------------------------------------

Code Structure and Module Description:
--------------------------------------------------
1. MTL-FeatureNet:
   - Based on an improved Vision Transformer architecture combined with task dynamic modulation and dynamic adapter layers for multi-task feature extraction.
   - Supports multi-scale feature fusion and strategies for integrating enhanced features from multiple models.
2. Adaptive Scale NeRF Module:
   - Introduces an adaptive scale adjustment mechanism that dynamically modulates rendering precision by analyzing local and global features.
   - Incorporates spectral-aware rendering techniques to achieve high-precision color reproduction and simulate lighting effects.
3. Conditional Diffusion Model:
   - Utilizes time embedding and conditional information to implement a reverse diffusion process via a conditional UNet that generates high-quality images.
   - Provides sampling functions and training losses, supporting gradual reconstruction from noise to images.
4. Utility Functions (utils.py):
   - Data loading and preprocessing (Toy3DDataset)
   - Logging, checkpoint saving, and loading
   - Various evaluation metrics (PSNR, SSIM, LPIPS, Chamfer Distance, etc.)
--------------------------------------------------

Example Run:
--------------------------------------------------
Ensure that your data is prepared as described above and adjust the paths in config.yaml accordingly.
Run the following command to start training:
       python main.py --config config.yaml --epochs 100 --batch_size 8
After training, check the output directory to retrieve the best model and intermediate checkpoints.
--------------------------------------------------
