Skip to content

About

HybridMind(开源版)——一个AI/ML驱动的IMDb/TMDB数据库分析及预测系统。UIC DPW Project小组作业,若在此项目基础上进行修改建议注明原项目,防止代码雷同。

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

HybridMind

Warning: This Readme is generated by GLM. There may be some CRITICAL mistakes.

Note: If you want our PPT, please send me an e-mail.

IMDB Movie Data Analysis & Prediction System

Course: Software Development Workshop II — Group Project Dataset: IMDB Movie Dataset (Kaggle)

HybridMind is an AI and ML driven universal movie data analysis platform that integrates data cleaning, exploratory analysis, visualization, machine learning, and AI-powered summarization. It ships as a cross-platform desktop application (Electron), and a Docker-deployed web application (FastAPI + Next.js).


Screenshots


Table of Contents

  1. Quick Start
  2. Project Structure
  3. Features & Deliverables
  4. Data Exploration & Cleaning
  5. Data Analysis & Visualization
  6. Machine Learning
  7. Desktop Application
  8. Docker Web Deployment
  9. AI Summary

Quick Start

*Python Package Requirements / npm Requirements: see respective Requirements.md files(for Python: requirements.txt)

Prerequisites

  • Python 3.11+ (with Conda recommended)
  • Node.js 18+ (for desktop app)
  • Docker (optional, for web deployment)
  • PostgreSQL (optional, for database)

Method 1 — Quick Start (Windows)

  1. Learn Git and clone:
git clone https://github.com/yourusername/HybridMind.git
  1. Download the Extra file (Dataset, Binary and Models) from Github Release
  2. *This file has trial AI config. I will shut this down in July 2026. you can config your own AI platform by modifying AIGC.yaml
  3. Directly unzip the file to the project directory. For example, "Models/" should be in the same directory as "Model-Script/"
  4. pip install -r requirements.txt
  5. Run HybridMind.exe in Apps-Neo folder.

Method 2 — Manual Installation

cd Program
npm install
npm start

Method 3 — Docker Compose

cd Docker
docker-compose up -d

Project Structure

HybridMind/
├── Dataset-Modified/           # Cleaned dataset (generated by DB/clean_dataset.py)
├── DB/                         # Database layer
│   ├── CleanBase-v5.py         # Database rebuild & clean (PostgreSQL, 10-thread)
│   ├── clean_dataset.py        # Generate cleaned CSVs → Dataset-Modified/
│   ├── db_import.py            # PostgreSQL import script
│   ├── database_backup_26.4.19.sql  # Database backup
│   ├── ER Diagram FIN.drawio   # ER diagram source
│   ├── ER Diagram-26.4.20.png  # ER diagram image
│   ├── DB-Guide.md             # Database schema & connection guide
│   └── data_cleaning_report.md # Cleaning report
├── Analysis-Script/            # Data analysis engine
│   ├── analyze.py              # Main analysis orchestrator
│   ├── charts/                 # 37 modular chart scripts
│   │   ├── __init__.py         # Auto-discovery registry
│   │   ├── _common.py          # Shared imports & utilities
│   │   └── chart_01_*.py … chart_40_*.py
│   └── Modular Script Specification.md  # Chart API specification
├── Model-Script/               # Machine learning scripts
│   ├── regression.py           # Box office prediction
│   ├── classification.py       # Binary success + multi-class rating
│   ├── clustering.py           # Movie & user clustering
│   ├── recommendation.py       # Collaborative filtering
│   ├── deep_learning.py        # DL models (NLP, Autoencoder, NCF, TimeSeries, Fusion)
│   ├── predict.py              # Unified CLI prediction interface
│   └── ai_summary.py           # AI-powered PDF report generator
├── Models/                     # Trained model files & evaluation results
│   ├── Regression/             # Linear, RandomForest, XGBoost, LightGBM
│   ├── Classification/         # BinarySuccess, MultiClassRating
│   ├── Clustering/             # MovieClustering, UserClustering
│   ├── Bonus/                  # UserCF, ItemCF, MatrixFactorization
│   └── DeepLearning/           # NLP, Autoencoder, NCF, TimeSeries, Fusion, Stacking, ContentBased
├── Program/                    # Electron desktop application (TypeScript)
│   ├── src/                    # Main process source
│   │   ├── main.ts             # Electron entry point
│   │   ├── ipc.ts              # IPC handlers (Python spawn, ML, AI summary)
│   │   ├── preload.ts          # Context bridge
│   │   ├── renderer/renderer.ts # Frontend logic
│   │   ├── python-finder.ts    # Cross-platform Python auto-detection
│   │   ├── search.ts           # Fuzzy search engine
│   │   └── AIGC.yaml           # AI API configuration
│   ├── renderer/               # Static frontend (HTML/CSS)
│   └── package.json
├── Docker/                     # Web deployment (FastAPI + Next.js)
│   ├── backend/                # FastAPI + Celery + Redis
│   ├── frontend/               # Next.js + Tailwind + shadcn/ui + Recharts
│   ├── docker-compose.yml
│   └── build.sh
├── Apps-Neo/                   # Pre-built application binaries & analysis output
│   ├── HybridMind 1.0.0.exe   # Windows portable binary
│   ├── HybridMind-1.0.0.AppImage  # Linux AppImage
│   ├── AIGC.yaml               # AI configuration (placed next to binary)
│   └── Analysis-Report/        # Generated analysis output (charts, JSON, PDF)
├── Guide/                      # Course project guide & requirements
├── requirements.txt            # Python dependencies (all pinned)
├── Python Package Requirement.md  # Python package documentation
├── npm Requirement.md          # npm package documentation
├── CHANGELOG
└── Readme.md

Features & Deliverables

The project fulfills all required deliverables from the course specification:

Requirement Implementation
Data Exploration & Cleaning 10-thread ETL pipeline, 140k+ corrections, PostgreSQL schema with 12 indexes
Data Analysis 37 analysis charts across 9 categories, structured JSON output
Data Visualization Professional matplotlib/seaborn charts, interactive Recharts in web version
Advanced ML (Optional) Regression, Classification, Clustering, Recommendation, Deep Learning, Time Series, NLP

Data Exploration & Cleaning

Warning: The PostgreSQL database in this project was abandoned at an early stage of development, and no one can guarantee that the relevant configurations are still correct and usable. Due to the extremely large size of the dataset, we strongly advise DO NOT using any self-hosted or locally installed databases as the persistence layer; otherwise, it will result in significant performance degradation. If your teacher requires you to use DB and provide an ER diagram in your project plan, you can refer to our Drawio and database initialization files. Generally speaking, the teacher will allow the use of CSV data sets at the mid-stage of the project to enhance efficiency.

Workflow

Raw CSV → CleanSet-v3.py → Dataset-Modified/ → db_import.py → PostgreSQL (optional)

Cleaning Operations (140,931 corrections total)

Operation Count Description
Zero budget/revenue → NULL 74,588 Budget=0 / Revenue=0 set to NULL ("unknown")
Anomalous runtime → NULL 1,821 Runtime < 1min or > 1000min removed
NULL normalization 64,149 "", "nan", "None", "null", "NIL" → SQL NULL
JSON empty → [] 17,525 credits/keywords NULL/empty → standard empty array
Invalid ratings deleted — Rating < 0.5 or > 5.0 removed
Duplicate ratings deduped — Same user, same movie: keep one
Boolean field cleanup — Non-standard adult/video → NULL
Date normalization — Truncate oversized release_date strings

Database Schema (PostgreSQL)

Table Rows Key Columns
movies 45,433 id, title, budget, revenue, genres, runtime, vote_average, release_date
credits 45,432 id, cast_data (JSONB), crew_data (JSONB)
keywords 45,432 id, keywords (JSONB)
links 45,843 movie_id, imdb_id, tmdb_id
links_small 9,125 movie_id, imdb_id, tmdb_id
ratings 26,024,289 user_id, movie_id, rating, timestamp
ratings_small 100,004 user_id, movie_id, rating, timestamp

Data Analysis & Visualization

Analysis Engine

The analysis pipeline (analyze.py) auto-discovers chart modules from charts/ and executes them in parallel using a contract-based architecture. Each chart script declares its data requirements, metadata, and output via a CHART_META dictionary.

Analysis Categories (37 Charts)

Category Charts Description
Genre Analysis 01–03, 26, 36 Genre distribution, average rating by genre, genre trends by decade, stacked area, balance analysis
Rating Analysis 04–07, 32, 33, 40 Rating distribution, vote count vs average, top rated movies, rating activity timeline, polarization
Time Trends 08, 09, 27, 35 Movies per year/month, runtime violin by decade, time series decomposition
Revenue & ROI 12, 13, 25, 28–30 Top ROI/revenue movies, budget vs revenue by decade, inflation-adjusted trends
Cast & Crew 15, 16, 31, 38, 39 Top actors/directors, actor gender distribution, director effect, collaboration networks
Language & Country 17–19 Language/country distribution, English vs non-English rating comparison
Keywords 20, 21 Top keywords bar chart, keyword word cloud
Feature Correlation 22, 24, 34 Correlation matrix, pairplot, rating-budget-revenue bubble chart
Collections 23, 37 Collection/franchise analysis, sequel diminishing returns

Output

  • 37+ PNG charts — publication-quality 150 DPI
  • analysis_summary.json — structured data consumed by desktop app and web frontend
  • search_index.json — fuzzy search index for movies, actors, directors, and keywords

Machine Learning (Advanced)

Regression — Box Office Prediction

Goal: Predict revenue from 41 engineered features (budget, genres, runtime, popularity, vote data, temporal features).

Model R² RMSE
Random Forest 0.646 1.509
XGBoost 0.643 1.515
LightGBM 0.641 1.519
Ridge Regression 0.319 2.092

Key finding: budget (r=0.73) and vote_count (r=0.77) are the most important predictors.

Model files: Models/Regression/

Classification

Binary Success — Predict if revenue exceeds budget.

Model AUC Accuracy
XGBoost 0.855 0.789
LightGBM 0.848 0.782

Multi-Class Rating — Predict rating tier (Low/Medium/High).

Model Accuracy
LightGBM 0.789
XGBoost 0.783

Model files: Models/Classification/

Clustering

Movie Clustering (K-Means, 15 clusters) — Group movies by features (budget, revenue, rating, runtime, popularity). Visualized via PCA and t-SNE.

User Clustering (K-Means, 4 clusters) — Group users by rating behavior (count, mean, variety).

Model files: Models/Clustering/

Recommendation System (Collaborative Filtering)

Method RMSE Precision@10
User-based CF 0.911 0.054
Item-based CF 0.892 0.055
Matrix Factorization (SVD) 1.021 —

Model files: Models/Bonus/

Deep Learning

Module Model Note
NLP LSTM (PyTorch) Genre & sentiment classification from overview text
Autoencoder MLP Autoencoder Anomaly detection on movie features
NCF Neural CF (PyTorch) Deep learning recommendation
Time Series SARIMAX Multi-metric forecasting (revenue, count, rating) to 2035
Fusion RF/XGB TF-IDF + Numerical + Rolling Text-augmented regression
Stacking Meta-learner (LinearRegression) Ensemble of RF + XGBoost base models
Content-Based TF-IDF + Cosine Similarity Similar movie recommendations

Model files: Models/DeepLearning/

Desktop Application

Warning: Please make sure that your teacher allow you to use other GUIs instead of Tkinter. Otherwise, go to other projects' App.

Tech Stack: Electron (Node.js) + TypeScript + Python ( + Tailwind + shadcn/ui + Recharts)

Features

  • One-Click Analysis — Select dataset directory, run full 37-chart pipeline with progress tracking
  • Interactive Charts — Section-based navigation with lazy-loaded images
  • Fuzzy Search — Search movies, actors, directors, keywords with dropdown suggestions
  • ML Predictions — GUI for regression, classification, clustering, recommendation, time series
  • AI Summary — Generate PDF report with AI analysis of charts (Doubao-Seed-2.0)
  • Auto Python Detection — Cross-platform dynamic discovery (Conda, system, venv)
  • AIGC Configuration — External AIGC.yaml file placed next to the executable for easy API key updates

Building from Source

cd Program
npm install
npm run build:win      # Windows portable .exe
npm run build:linux    # Linux AppImage
npm run build:mac      # macOS DMG
npm run build:all      # All platforms

Warning: ONLY WINDOWS is verified and recommended. Many of the imported packages in this project are not compatible with other systems, especially on macOS. Forcibly constructing may fail.


Docker Web Deployment (Not verified)

**Note: ** This part is added to the program only in order to push the UIC-IT to release the docker image site for class. If I still remember this project in summer vacation 2026, I will fix and verify it. Or you can do it by yourself and contribute to this repo. This note is here until I do the thing.

Tech Stack: FastAPI + Celery + Redis + Next.js 15 + Tailwind + shadcn/ui + Recharts

The web version replicates all desktop app features with real-time SSE progress streaming.

Service Technology Port
frontend Next.js 15 + Tailwind + shadcn/ui + Recharts 20000
backend FastAPI + Celery 8000
worker Celery worker —
broker Redis 7 6379

API Endpoints

Prefix Description
/api/analysis Dataset info, start analysis, SSE progress streaming
/api/report Report data, figures, structured results
/api/search Fuzzy search movies/keywords, movie detail
/api/ml ML prediction endpoints
/api/ai-summary AI summary generation with SSE progress

Management

sudo docker-compose logs -f           # Follow logs
sudo docker-compose restart worker    # Restart worker
sudo docker-compose down              # Stop all
sudo docker-compose down -v           # Stop and remove volumes

AI Summary

Model: Doubao-Seed-2.0 (Default)

Sends analysis chart images to a vision-capable LLM for multimodal analysis. Results are cached incrementally and compiled into a professional PDF report.

Configuration: Place AIGC.yaml alongside the executable or binary directory. The app searches in this priority order:

  1. Executable directory / PORTABLE_EXECUTABLE_DIR
  2. resources/AIGC.yaml (bundled with app)
  3. Program/src/AIGC.yaml (development mode)
api_key: "your-api-key"
api_url: "https://ark.cn-beijing.volces.com/api/v3"
model_endpoint: "ep-xxxxxxxxxxxx"
model_display_name: "Doubao-Seed-2.0"
prompt: "..."

About

HybridMind(开源版)——一个AI/ML驱动的IMDb/TMDB数据库分析及预测系统。UIC DPW Project小组作业,若在此项目基础上进行修改建议注明原项目,防止代码雷同。

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages