ngocminhta/FALCON

FALCON: Fine-grained AI-generated Text Detection Using Multi-task Auxiliary, Multi-Level Contrastive Learning

Python

0

2 commits

updated May 6, 2025

See the code

README

FALCON

Fine-grained AI-generated Text Detection using Multi-task Auxiliary and Multi-level Contrastive Learning.

license last-commit repo-top-language repo-language-count

Built with the tools and technologies:

GNU%20Bash Python


πŸ”— Table of Contents


πŸ“ Overview

The FALCON project revolutionizes the detection of deepfake content through advanced text analysis. By leveraging state-of-the-art machine learning techniques, it offers robust tools for generating, managing, and evaluating text embeddings to accurately classify content as human, AI-generated, or mixed. Ideal for tech companies and cybersecurity experts, FALCON enhances digital trust and integrity across various media platforms.


πŸ‘Ύ Features

FeatureSummary
βš™οΈArchitecture
  • Utilizes a modular approach with separate scripts for training, inference, and database management.
  • Incorporates distributed processing capabilities to enhance scalability.
  • Employs FAISS for efficient indexing and vector search operations.
πŸ”©Code Quality
  • Adheres to modern Python practices with clear modular separation in scripts and utility functions.
  • Includes comprehensive script files for training, testing, and inference to maintain operational clarity and separation.
  • Uses advanced machine learning libraries and frameworks for robust algorithm development.
πŸ“„Documentation
  • Documentation includes detailed command guides for installation, usage, and testing.
  • Code comments and structured documentation are present in critical scripts such as train_classifier.py and infer.py.
  • Utilizes Markdown badges and links for easy navigation and reference in documentation.
πŸ”ŒIntegrations
  • Integrates with Python's pip for dependency management as seen in requirements.txt.
  • Supports various machine learning and data processing libraries.
  • Capable of utilizing both CPU and GPU resources for processing.
🧩Modularity
  • Highly modular design with separate components for different functionalities like training, inference, and database management.
  • Scripts such as train.sh and infer.sh enhance modularity by encapsulating functionality.
  • Easy to extend or modify individual components without affecting others.
πŸ§ͺTesting
  • Includes specific scripts for testing like test_from_database.sh.
  • Utilizes pytest for running tests, ensuring code reliability and functionality.
  • Testing scripts are adaptable to various datasets and configurations.
⚑️Performance
  • Optimized for high performance with support for distributed computing and GPU acceleration.
  • FAISS integration for efficient large-scale vector handling and searches.
  • Performance metrics such as accuracy, precision, recall, and F1 score are meticulously tracked and optimized.
πŸ›‘οΈSecurity
  • Focuses on robust data handling and processing to ensure integrity of machine learning models.
  • Implements checks and balances in data serialization and deserialization processes.
  • Secure handling of text data to prevent data leakage or misuse.
πŸ“¦Dependencies
  • Managed through pip and a well-defined requirements.txt file.
  • Dependencies include essential libraries for neural network modeling, natural language processing, and data visualization.
  • Ensures compatibility and functionality across various environments.

πŸ“ Project Structure

└── FALCON/
    β”œβ”€β”€ README.md
    β”œβ”€β”€ algorithm
    β”‚   β”œβ”€β”€ gen_database.py
    β”‚   β”œβ”€β”€ infer.py
    β”‚   β”œβ”€β”€ requirements.txt
    β”‚   β”œβ”€β”€ script
    β”‚   β”‚   β”œβ”€β”€ gen_database.sh
    β”‚   β”‚   β”œβ”€β”€ infer.sh
    β”‚   β”‚   β”œβ”€β”€ test.sh
    β”‚   β”‚   β”œβ”€β”€ test_from_database.sh
    β”‚   β”‚   └── train.sh
    β”‚   β”œβ”€β”€ src
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   β”œβ”€β”€ index.py
    β”‚   β”‚   β”œβ”€β”€ simclr.py
    β”‚   β”‚   └── text_embedding.py
    β”‚   β”œβ”€β”€ test_from_database.py
    β”‚   β”œβ”€β”€ train_classifier.py
    β”‚   └── utils
    β”‚       β”œβ”€β”€ __init__.py
    β”‚       β”œβ”€β”€ load_dataset.py
    β”‚       └── utils.py
    └── data
        β”œβ”€β”€ FALCONSet
        β”‚   β”œβ”€β”€ deepseek-text
        β”‚   β”œβ”€β”€ gemini-2.0-text
        β”‚   β”œβ”€β”€ gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---deepseek-text
        β”‚   β”œβ”€β”€ human---gemini-2.0-text
        β”‚   β”œβ”€β”€ human---gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---llama-text
        β”‚   β”œβ”€β”€ human-text
        β”‚   └── llama-text
        β”œβ”€β”€ Unseen_Domain
        β”‚   β”œβ”€β”€ deepseek-text
        β”‚   β”œβ”€β”€ gemini-2.0-text
        β”‚   β”œβ”€β”€ gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---deepseek-text
        β”‚   β”œβ”€β”€ human---gemini-2.0-text
        β”‚   β”œβ”€β”€ human---gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---llama-text
        β”‚   β”œβ”€β”€ human-text
        β”‚   └── llama-text
        β”œβ”€β”€ Unseen_Domain_and_Unseen_Generator
        β”‚   β”œβ”€β”€ gemma-text
        β”‚   β”œβ”€β”€ human---gemma-text
        β”‚   β”œβ”€β”€ human---mistral-text
        β”‚   β”œβ”€β”€ human---qwen-text
        β”‚   β”œβ”€β”€ human-text
        β”‚   β”œβ”€β”€ mistral-text
        β”‚   └── qwen-text
        └── Unseen_Generator
            β”œβ”€β”€ gemma-text
            β”œβ”€β”€ human---gemma-text
            β”œβ”€β”€ human---mistral-text
            β”œβ”€β”€ human---qwen-text
            β”œβ”€β”€ human-text
            β”œβ”€β”€ mistral-text
            └── qwen-text

πŸ“‚ Project Index

FALCON/
__root__
algorithm
test_from_database.py- Evaluates the performance of text embedding models on test datasets, both in-domain and out-of-domain, using fuzzy k-nearest neighbors classification
- It measures accuracy, precision, recall, F1 score, MSE, and MAE across different values of K, optimizing model parameters and visualizing results to identify the best configuration.
infer.py- `algorithm/infer.py` serves as the inference module, utilizing a pre-trained text embedding model to process input text, generate embeddings, and perform k-nearest neighbors search against a serialized index
- It classifies the text based on the proximity of its embeddings to known labeled data, determining if the source is human, AI, or mixed.
gen_database.py- Generates and manages embeddings for textual data, facilitating the creation and updating of searchable databases
- It supports distributed processing for scalability and includes functionality to handle both in-domain and out-of-domain datasets, ensuring robustness across different data types
- The script also provides tools for serialization and deserialization of indexed data.
requirements.txt- Specifies the dependencies required for the algorithm component of the project, ensuring compatibility and functionality across various machine learning and data processing libraries
- It includes essential libraries for data manipulation, progress tracking, neural network modeling, natural language processing, and visualization, facilitating a robust environment for algorithm development and experimentation.
train_classifier.py- The `train_classifier.py` file is a critical component of the project's machine learning pipeline, specifically designed for training classification models
- This script integrates various machine learning and deep learning libraries and frameworks to set up, train, and evaluate classifiers using textual data
- Its primary function is to orchestrate the training process, which includes data loading, model initialization, setting up the training loop, and logging the training progress.

Key functionalities of this script include: 1
- Data Preparation: It loads and preprocesses text data, ensuring it is in the correct format for training using utilities like load_dataset and tokenization processes. 2
- Model Setup: It initializes models for text classification, leveraging pre-trained models and custom classifier layers, which are crucial for handling the specifics of the text data. 3
- Training Loop: The script manages the training process, including setting random seeds for reproducibility, configuring data loaders for batch processing of data, and defining the optimization strategy. 4
- Logging and Metrics: Utilizes SummaryWriter for TensorBoard to log training metrics and progress, which is vital for monitoring the training process and outcomes. 5
- Evaluation: Implements functions to compute and calculate metrics, aiding in the assessment of the classifier's performance during and after training.

In the broader scope of the project, train_classifier.py serves as the executable script that directly impacts the model's performance by handling the training operations efficiently
- It interacts with various modules of the project such as src for model definitions, utils for utility functions, and lightning for leveraging PyTorch Lightning capabilities, indicating its integral role in the machine learning workflow of the codebase.

src
text_embedding.py- TextEmbeddingModel, defined in algorithm/src/text_embedding.py, serves as a core component for generating normalized text embeddings using pre-trained transformer models
- It supports various pooling strategies and can handle different transformer architectures, adapting its behavior based on the model's specific characteristics to optimize text representation within the broader system.
index.py- Indexer, a core component within the algorithm module, manages the indexing, searching, and serialization of vector data using FAISS
- It supports operations on GPU, handles large-scale vector searches efficiently, and maintains a mapping between internal and external identifiers, facilitating quick retrieval and robust data management across the system's architecture.
simclr.py- Defines and implements a SimCLR-based classifier for text embeddings, integrating a classification head for sentence-level tasks
- It utilizes cosine similarity for contrastive learning, supports distributed computing with fabric, and handles various classification scenarios including cross-entropy loss calculations for different label types, enhancing model training and evaluation flexibility within the project's architecture.
script
test_from_database.sh- Executes testing of deepfake detection models using a specified dataset and model checkpoint
- It configures the test environment for different modes including deepfake, TuringBench, and M4 challenges, both monolingual and multilingual, adjusting parameters like device number and batch size to optimize performance.
train.sh- Train.sh initiates the training of a classifier for detecting deepfakes using a pre-trained RoBERTa model from Princeton NLP
- It configures the model to process data from a specified path, setting parameters like device number, batch size, learning rate, and epochs, focusing on optimizing performance across different datasets within the broader architecture.
infer.sh- Executes a deep learning model for detecting deepfake content by leveraging a pre-trained model and a specified database
- The script processes a given text input to assess and output the likelihood of the content being a deepfake, using the top 5 predictions
- This functionality is crucial for maintaining the integrity and trustworthiness of digital media within the system.
test.sh- Executes a Python script for testing a deepfake detection model using a K-nearest neighbors algorithm
- It configures the script to process data from a specified path, utilizing a pre-trained model, and saves the resulting database for further analysis
- The script is adaptable for various datasets but is currently set for the deepfake domain.
gen_database.sh- Generates a training database for detecting deepfake content by executing a Python script configured for high-throughput processing on multiple devices
- It specifically prepares a dataset using a pre-trained model, targeting the deepfake detection domain, and stores the results in a structured database format for further use in model training and evaluation.
utils
load_dataset.pyManages the loading and preprocessing of datasets for machine learning models, supporting various dataset configurations including "falconset," "llmdetectaive," and "hart." It categorizes text data into human, human+AI, or AI-generated content, enriching each entry with labels and indices for further processing and analysis in model training and evaluation phases.
utils.py- Provides utility functions for evaluating and reporting machine learning model performance across various metrics such as accuracy, precision, recall, and F1 score
- It includes specialized functions for handling multi-class scenarios, binary outcomes, and specific use cases involving embeddings and unique identifiers, enhancing the interpretability of model results in diverse contexts.


πŸš€ Getting Started

β˜‘οΈ Prerequisites

Before getting started with FALCON, ensure your runtime environment meets the following requirements:

  • Programming Language: Python
  • Package Manager: Pip

βš™οΈ Installation

Install FALCON using one of the following methods:

Build from source:

  1. Clone the FALCON repository:
❯ git clone https://github.com/ngocminhta/FALCON
  1. Navigate to the project directory:
❯ cd FALCON
  1. Install the project dependencies:

Using pip Β 

❯ pip install -r algorithm/requirements.txt

πŸ€– Usage

Run FALCON using the following command: Using pip Β 

To train the model

❯ python algorithm/train_classifier.py <your parameter goes here>

To generate the vector database after training

❯ python algorithm/gen_database.py <your parameter goes here>

πŸ§ͺ Testing

Run the test suite using the following command: Using pip Β 

❯ python algorithm/test_from_database.py <your parameter goes here>

πŸ“Œ News

[2025.05.06] Our project is publicly accessible.


πŸ”° Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/ngocminhta/FALCON
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
    
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


πŸŽ— License

This project is protected under the MIT License.


πŸ™Œ Acknowledgments

  • List any resources, contributors, inspiration, etc. here.

ngocminhta/FALCON

FALCON: Fine-grained AI-generated Text Detection Using Multi-task Auxiliary, Multi-Level Contrastive Learning

Python

0

2 commits

updated May 6, 2025

See the code

README

FALCON

Fine-grained AI-generated Text Detection using Multi-task Auxiliary and Multi-level Contrastive Learning.

license last-commit repo-top-language repo-language-count

Built with the tools and technologies:

GNU%20Bash Python


πŸ”— Table of Contents


πŸ“ Overview

The FALCON project revolutionizes the detection of deepfake content through advanced text analysis. By leveraging state-of-the-art machine learning techniques, it offers robust tools for generating, managing, and evaluating text embeddings to accurately classify content as human, AI-generated, or mixed. Ideal for tech companies and cybersecurity experts, FALCON enhances digital trust and integrity across various media platforms.


πŸ‘Ύ Features

FeatureSummary
βš™οΈArchitecture
  • Utilizes a modular approach with separate scripts for training, inference, and database management.
  • Incorporates distributed processing capabilities to enhance scalability.
  • Employs FAISS for efficient indexing and vector search operations.
πŸ”©Code Quality
  • Adheres to modern Python practices with clear modular separation in scripts and utility functions.
  • Includes comprehensive script files for training, testing, and inference to maintain operational clarity and separation.
  • Uses advanced machine learning libraries and frameworks for robust algorithm development.
πŸ“„Documentation
  • Documentation includes detailed command guides for installation, usage, and testing.
  • Code comments and structured documentation are present in critical scripts such as train_classifier.py and infer.py.
  • Utilizes Markdown badges and links for easy navigation and reference in documentation.
πŸ”ŒIntegrations
  • Integrates with Python's pip for dependency management as seen in requirements.txt.
  • Supports various machine learning and data processing libraries.
  • Capable of utilizing both CPU and GPU resources for processing.
🧩Modularity
  • Highly modular design with separate components for different functionalities like training, inference, and database management.
  • Scripts such as train.sh and infer.sh enhance modularity by encapsulating functionality.
  • Easy to extend or modify individual components without affecting others.
πŸ§ͺTesting
  • Includes specific scripts for testing like test_from_database.sh.
  • Utilizes pytest for running tests, ensuring code reliability and functionality.
  • Testing scripts are adaptable to various datasets and configurations.
⚑️Performance
  • Optimized for high performance with support for distributed computing and GPU acceleration.
  • FAISS integration for efficient large-scale vector handling and searches.
  • Performance metrics such as accuracy, precision, recall, and F1 score are meticulously tracked and optimized.
πŸ›‘οΈSecurity
  • Focuses on robust data handling and processing to ensure integrity of machine learning models.
  • Implements checks and balances in data serialization and deserialization processes.
  • Secure handling of text data to prevent data leakage or misuse.
πŸ“¦Dependencies
  • Managed through pip and a well-defined requirements.txt file.
  • Dependencies include essential libraries for neural network modeling, natural language processing, and data visualization.
  • Ensures compatibility and functionality across various environments.

πŸ“ Project Structure

└── FALCON/
    β”œβ”€β”€ README.md
    β”œβ”€β”€ algorithm
    β”‚   β”œβ”€β”€ gen_database.py
    β”‚   β”œβ”€β”€ infer.py
    β”‚   β”œβ”€β”€ requirements.txt
    β”‚   β”œβ”€β”€ script
    β”‚   β”‚   β”œβ”€β”€ gen_database.sh
    β”‚   β”‚   β”œβ”€β”€ infer.sh
    β”‚   β”‚   β”œβ”€β”€ test.sh
    β”‚   β”‚   β”œβ”€β”€ test_from_database.sh
    β”‚   β”‚   └── train.sh
    β”‚   β”œβ”€β”€ src
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   β”œβ”€β”€ index.py
    β”‚   β”‚   β”œβ”€β”€ simclr.py
    β”‚   β”‚   └── text_embedding.py
    β”‚   β”œβ”€β”€ test_from_database.py
    β”‚   β”œβ”€β”€ train_classifier.py
    β”‚   └── utils
    β”‚       β”œβ”€β”€ __init__.py
    β”‚       β”œβ”€β”€ load_dataset.py
    β”‚       └── utils.py
    └── data
        β”œβ”€β”€ FALCONSet
        β”‚   β”œβ”€β”€ deepseek-text
        β”‚   β”œβ”€β”€ gemini-2.0-text
        β”‚   β”œβ”€β”€ gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---deepseek-text
        β”‚   β”œβ”€β”€ human---gemini-2.0-text
        β”‚   β”œβ”€β”€ human---gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---llama-text
        β”‚   β”œβ”€β”€ human-text
        β”‚   └── llama-text
        β”œβ”€β”€ Unseen_Domain
        β”‚   β”œβ”€β”€ deepseek-text
        β”‚   β”œβ”€β”€ gemini-2.0-text
        β”‚   β”œβ”€β”€ gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---deepseek-text
        β”‚   β”œβ”€β”€ human---gemini-2.0-text
        β”‚   β”œβ”€β”€ human---gpt-4o-mini-text
        β”‚   β”œβ”€β”€ human---llama-text
        β”‚   β”œβ”€β”€ human-text
        β”‚   └── llama-text
        β”œβ”€β”€ Unseen_Domain_and_Unseen_Generator
        β”‚   β”œβ”€β”€ gemma-text
        β”‚   β”œβ”€β”€ human---gemma-text
        β”‚   β”œβ”€β”€ human---mistral-text
        β”‚   β”œβ”€β”€ human---qwen-text
        β”‚   β”œβ”€β”€ human-text
        β”‚   β”œβ”€β”€ mistral-text
        β”‚   └── qwen-text
        └── Unseen_Generator
            β”œβ”€β”€ gemma-text
            β”œβ”€β”€ human---gemma-text
            β”œβ”€β”€ human---mistral-text
            β”œβ”€β”€ human---qwen-text
            β”œβ”€β”€ human-text
            β”œβ”€β”€ mistral-text
            └── qwen-text

πŸ“‚ Project Index

FALCON/
__root__
algorithm
test_from_database.py- Evaluates the performance of text embedding models on test datasets, both in-domain and out-of-domain, using fuzzy k-nearest neighbors classification
- It measures accuracy, precision, recall, F1 score, MSE, and MAE across different values of K, optimizing model parameters and visualizing results to identify the best configuration.
infer.py- `algorithm/infer.py` serves as the inference module, utilizing a pre-trained text embedding model to process input text, generate embeddings, and perform k-nearest neighbors search against a serialized index
- It classifies the text based on the proximity of its embeddings to known labeled data, determining if the source is human, AI, or mixed.
gen_database.py- Generates and manages embeddings for textual data, facilitating the creation and updating of searchable databases
- It supports distributed processing for scalability and includes functionality to handle both in-domain and out-of-domain datasets, ensuring robustness across different data types
- The script also provides tools for serialization and deserialization of indexed data.
requirements.txt- Specifies the dependencies required for the algorithm component of the project, ensuring compatibility and functionality across various machine learning and data processing libraries
- It includes essential libraries for data manipulation, progress tracking, neural network modeling, natural language processing, and visualization, facilitating a robust environment for algorithm development and experimentation.
train_classifier.py- The `train_classifier.py` file is a critical component of the project's machine learning pipeline, specifically designed for training classification models
- This script integrates various machine learning and deep learning libraries and frameworks to set up, train, and evaluate classifiers using textual data
- Its primary function is to orchestrate the training process, which includes data loading, model initialization, setting up the training loop, and logging the training progress.

Key functionalities of this script include: 1
- Data Preparation: It loads and preprocesses text data, ensuring it is in the correct format for training using utilities like load_dataset and tokenization processes. 2
- Model Setup: It initializes models for text classification, leveraging pre-trained models and custom classifier layers, which are crucial for handling the specifics of the text data. 3
- Training Loop: The script manages the training process, including setting random seeds for reproducibility, configuring data loaders for batch processing of data, and defining the optimization strategy. 4
- Logging and Metrics: Utilizes SummaryWriter for TensorBoard to log training metrics and progress, which is vital for monitoring the training process and outcomes. 5
- Evaluation: Implements functions to compute and calculate metrics, aiding in the assessment of the classifier's performance during and after training.

In the broader scope of the project, train_classifier.py serves as the executable script that directly impacts the model's performance by handling the training operations efficiently
- It interacts with various modules of the project such as src for model definitions, utils for utility functions, and lightning for leveraging PyTorch Lightning capabilities, indicating its integral role in the machine learning workflow of the codebase.

src
text_embedding.py- TextEmbeddingModel, defined in algorithm/src/text_embedding.py, serves as a core component for generating normalized text embeddings using pre-trained transformer models
- It supports various pooling strategies and can handle different transformer architectures, adapting its behavior based on the model's specific characteristics to optimize text representation within the broader system.
index.py- Indexer, a core component within the algorithm module, manages the indexing, searching, and serialization of vector data using FAISS
- It supports operations on GPU, handles large-scale vector searches efficiently, and maintains a mapping between internal and external identifiers, facilitating quick retrieval and robust data management across the system's architecture.
simclr.py- Defines and implements a SimCLR-based classifier for text embeddings, integrating a classification head for sentence-level tasks
- It utilizes cosine similarity for contrastive learning, supports distributed computing with fabric, and handles various classification scenarios including cross-entropy loss calculations for different label types, enhancing model training and evaluation flexibility within the project's architecture.
script
test_from_database.sh- Executes testing of deepfake detection models using a specified dataset and model checkpoint
- It configures the test environment for different modes including deepfake, TuringBench, and M4 challenges, both monolingual and multilingual, adjusting parameters like device number and batch size to optimize performance.
train.sh- Train.sh initiates the training of a classifier for detecting deepfakes using a pre-trained RoBERTa model from Princeton NLP
- It configures the model to process data from a specified path, setting parameters like device number, batch size, learning rate, and epochs, focusing on optimizing performance across different datasets within the broader architecture.
infer.sh- Executes a deep learning model for detecting deepfake content by leveraging a pre-trained model and a specified database
- The script processes a given text input to assess and output the likelihood of the content being a deepfake, using the top 5 predictions
- This functionality is crucial for maintaining the integrity and trustworthiness of digital media within the system.
test.sh- Executes a Python script for testing a deepfake detection model using a K-nearest neighbors algorithm
- It configures the script to process data from a specified path, utilizing a pre-trained model, and saves the resulting database for further analysis
- The script is adaptable for various datasets but is currently set for the deepfake domain.
gen_database.sh- Generates a training database for detecting deepfake content by executing a Python script configured for high-throughput processing on multiple devices
- It specifically prepares a dataset using a pre-trained model, targeting the deepfake detection domain, and stores the results in a structured database format for further use in model training and evaluation.
utils
load_dataset.pyManages the loading and preprocessing of datasets for machine learning models, supporting various dataset configurations including "falconset," "llmdetectaive," and "hart." It categorizes text data into human, human+AI, or AI-generated content, enriching each entry with labels and indices for further processing and analysis in model training and evaluation phases.
utils.py- Provides utility functions for evaluating and reporting machine learning model performance across various metrics such as accuracy, precision, recall, and F1 score
- It includes specialized functions for handling multi-class scenarios, binary outcomes, and specific use cases involving embeddings and unique identifiers, enhancing the interpretability of model results in diverse contexts.


πŸš€ Getting Started

β˜‘οΈ Prerequisites

Before getting started with FALCON, ensure your runtime environment meets the following requirements:

  • Programming Language: Python
  • Package Manager: Pip

βš™οΈ Installation

Install FALCON using one of the following methods:

Build from source:

  1. Clone the FALCON repository:
❯ git clone https://github.com/ngocminhta/FALCON
  1. Navigate to the project directory:
❯ cd FALCON
  1. Install the project dependencies:

Using pip Β 

❯ pip install -r algorithm/requirements.txt

πŸ€– Usage

Run FALCON using the following command: Using pip Β 

To train the model

❯ python algorithm/train_classifier.py <your parameter goes here>

To generate the vector database after training

❯ python algorithm/gen_database.py <your parameter goes here>

πŸ§ͺ Testing

Run the test suite using the following command: Using pip Β 

❯ python algorithm/test_from_database.py <your parameter goes here>

πŸ“Œ News

[2025.05.06] Our project is publicly accessible.


πŸ”° Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/ngocminhta/FALCON
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
    
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


πŸŽ— License

This project is protected under the MIT License.


πŸ™Œ Acknowledgments

  • List any resources, contributors, inspiration, etc. here.