Skip to content

Proposed a pipeline to generate a classification model that can classify samples without any training data. The approach uses generative models to create weights for new models. New models can classify images with 88% accuracy without any prior training.

Notifications You must be signed in to change notification settings

Jain-Karan/mlusingml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

๐Ÿง  Generating Machine Learning Models Using Machine Learning Models

Learning new tasks without new data.
This project explores how machine learning models themselves can be generated using other machine learning models, without direct task-specific supervision.


๐Ÿš€ Overview

This project introduces an unconventional but powerful idea:
using generative models to create new classifiers by fusing existing ones.

Specifically, we leverage CycleGANs to merge the learned feature representations of two independently trained Convolutional Neural Networks (CNNs):

  • One CNN trained to recognize cats
  • One CNN trained to recognize the color black

By translating and combining their feature spaces, we generate a new CNN capable of detecting black cats โ€” without ever being trained on a single black cat image.

๐Ÿ“Š Result:
The generated model achieves 88% classification accuracy on black cat detection, despite zero direct exposure to black cat data.

This work opens new directions for:

  • Learning under data scarcity
  • Automated model generation
  • Knowledge transfer beyond traditional fine-tuning

โœจ Key Contributions

  • ๐Ÿ” CycleGAN-based Model Fusion
    Uses CycleGANs to translate and align feature kernels between CNNs trained on unrelated domains.

  • ๐Ÿงฌ Generated CNNs (Zero-shot Task Creation)
    Constructs a task-specific classifier purely from pre-trained models.

  • ๐Ÿ“‰ Feature Space Validation
    Employs UMAP, K-Means, and DBSCAN to analyze and validate learned representations.

  • ๐Ÿงช Unsupervised Generalization
    Demonstrates black cat recognition without labeled black cat data.


๐Ÿง  Core Idea (Intuition)

Instead of training a model on data, we train a model on other models.

  1. Train two CNNs on separate concepts

    • Object: cat
    • Attribute: black
  2. Extract convolutional kernels from both networks.

  3. Train CycleGANs to translate kernels between these feature domains.

  4. Initialize a new CNN using the CycleGAN-generated kernels.

  5. Evaluate whether this synthesized CNN can recognize black cats.

โžก๏ธ It can.


๐Ÿงช Methodology

๐Ÿ“‚ Datasets

Dataset Samples
Black / Random Images 1,826 (1,745 black, 81 random)
Cat / Random Images 30,405 (29,843 cats, 562 random)
Kernel Sets for CycleGAN 4,498 per convolutional layer

๐Ÿ—๏ธ Model Architectures

CNNs

  • 2 Convolutional layers
  • Kernel size: 5ร—5
  • Activation: ReLU
  • Max-pooling layers
  • Trained independently on separate domains

CycleGANs

  • Generatorโ€“Discriminator architecture
  • Learns kernel-space translation, not image translation
  • Operates directly on convolutional filters

Generated CNN

  • Initialized entirely using CycleGAN-generated kernels
  • No gradient updates using black cat images

๐Ÿ“Š Evaluation Metrics

  • Accuracy
  • Precision & Recall
  • Cluster Entropy
  • Cluster Purity
  • Cosine Similarity
  • UMAP Visualization

๐Ÿ“ˆ Results

  • โœ… The generated CNN successfully clusters black cat images
  • ๐Ÿ“‰ UMAP projections show clear separation of semantic concepts
  • ๐Ÿ“ Cosine similarity confirms meaningful feature alignment
  • ๐Ÿง  Demonstrates unsupervised semantic composition

The model learns โ€œblack AND catโ€ without ever seeing a black cat.


๐Ÿงฉ Why This Matters

Traditional ML assumes:

New task โ‡’ new labeled data

This project challenges that assumption by showing:

  • Tasks can be composed
  • Models can be generated, not trained
  • Generative models can operate in parameter space, not just data space

This has implications for:

  • Low-resource domains
  • Privacy-sensitive data
  • Automated ML systems
  • Foundation model composition

๐Ÿ”ฎ Future Work

  • ๐Ÿ”ง Hyperparameter optimization for clustering and feature fusion
  • ๐Ÿ“ Alternative feature-space similarity metrics
  • ๐Ÿง  Semantic-aware end-to-end pipelines
  • ๐Ÿงช Scaling to deeper CNNs and transformers
  • ๐Ÿ” Multi-attribute model composition

โš™๏ธ Setup & Execution

๐Ÿ–ฅ๏ธ Hardware Requirements

  • GPU with โ‰ฅ 6GB VRAM (recommended)

๐Ÿงช Software Requirements

  • Python 3.11
  • PyTorch 2.5
  • torchvision
  • numpy
  • scikit-learn
  • seaborn
  • matplotlib
  • tqdm

Install dependencies:

pip install -r requirements.txt

###๐Ÿ“„ License MIT

๐Ÿงช Research focus

Generative models, representation learning, and non-traditional ML paradigms.

โ€œWhy train on more data when you can train on more models?โ€

About

Proposed a pipeline to generate a classification model that can classify samples without any training data. The approach uses generative models to create weights for new models. New models can classify images with 88% accuracy without any prior training.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published