This repository presents TCRNet-2, an improved deep-learning model for detecting vehicular targets in infrared imagery. By processing target and clutter information in parallel and optimizing the Target-to-Clutter Ratio (TCR), TCRNet-2 outperforms conventional CNNs and the original TCRNet. Additionally, a boosted version further enhances target-clutter discrimination, reducing false alarms. Performance is evaluated on a public infrared dataset, showing significant improvements across various distances and lighting conditions.
This repository contains scripts and instructions to preprocess data, train models, and test TCRNet-2 booster models. Below is a detailed guide to understanding and running the scripts and using the data files.
- Scripts
- Script Descriptions and Sequence
- Supporting Scripts
- Folders and Files
- Train
- Test
- Dependencies
Run the scripts in the following sequence for proper execution:
-
extract_chip.py
- Creates 40x80 chips to train the networks.
-
center_crop_chip.py
- Crops 40x80 chips to 20x40 to generate the QCF filters for the first layer.
-
hard_clutter_tcrnet2_chip.py
- Creates hard clutter for the booster TCRNet-2.
-
qcf_basis.py
- Generates the QCF filters.
-
train_tcr2.py
- Trains both TCRNet-2 and TCRNet-2 booster models.
-
test_tcr2.py
- Tests the TCRNet model.
-
roc_multiple_TCRNets.py
- Plots the ROC curves.
The following scripts are called within the above scripts:
-
tcr_cnn_2streams.py
- Contains the model architecture.
-
imresize.py
- Scales images to a 2500m range.
-
crop.py
- Crops images.
-
weights_filters/
- Contains trained models and filters.
-
data/
- Contains JSON files with test image information for various ranges (2.5 km, 3.0 km, and 3.5 km). It also includes training and testing datasets.
test_25to35all.json
: Both day and night images.test_25to35day.json
: Day images.test_25to35night.json
: Night images.
- Contains JSON files with test image information for various ranges (2.5 km, 3.0 km, and 3.5 km). It also includes training and testing datasets.
-
requirements.txt
- Lists all Python libraries required for this project.
To train the TCRNet-2 and TCRNet-2 booster models:
- Ensure the required datasets are available in the
data/
directory. - Generate QCF filters by running:
python qcf_basis.py
- Train the models using:
python train_tcr2.py
- During the training process, the trained weights and filters will be saved in the
weights_filters/
directory.
To test the trained TCRNet models:
- Ensure that the trained model weights and filters are available in the
weights_filters/
directory. - Run the testing script:
python test_tcr2.py
- To visualize the performance of multiple TCRNets, generate ROC curves using:
python roc_multiple_TCRNets.py
To set up the environment, install the required dependencies by running:
pip install -r requirements.txt
Ensure that the data and required files are correctly placed in the respective directories before running the scripts. Follow the sequence mentioned above for the smooth execution of the project pipeline.