A C++ application for recombinant detection prediction using neural networks with ONNX Runtime.
RDP++ is a tool that uses a trained neural network model to predict recombinant classes based on a set of input features. The system consists of two main components:
- PSNN (Prediction System Neural Network): Processes standardized input data and runs inference using an ONNX model.
- Tester: Prepares test data and interacts with PSNN to generate predictions.
The system reads feature data from a shared file, processes it, and outputs classification probabilities for different recombinant classes.
- C++17 compatible compiler (g++, MSVC, etc.)
- ONNX Runtime (version 1.21.1 or compatible)
- For GPU acceleration: CUDA compatible GPU with appropriate drivers
PSNN.cppandPSNN.h: Main prediction system that processes input data and runs the neural network modeltester.cpp: Tool for generating test data and running the prediction systemRDP_TripleNN.onnx: The trained neural network modelsharedData.txt: Input data file shared between componentsprediction_result.txt: Output file containing prediction results
# Compile PSNN
g++ -std=c++17 PSNN.cpp -o PSNN -I./onnxruntime-linux-x64-gpu-1.21.1/include -L./onnxruntime-linux-x64-gpu-1.21.1/lib -lonnxruntime
# Compile tester
g++ -std=c++17 tester.cpp -o tester# Compile PSNN
cl /std:c++17 PSNN.cpp /Fe:PSNN.exe /I"path\to\onnxruntime\include" /link "path\to\onnxruntime\lib\onnxruntime.lib"
# Compile tester
cl /std:c++17 tester.cpp /Fe:tester.exe- Create input data in
sharedData.txtor use the tester to generate sample data - Run the prediction:
# Linux
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./onnxruntime-linux-x64-gpu-1.21.1/lib
./tester
# Windows
.\tester.exeThe input data file (sharedData.txt) uses a comma-separated format:
FeatureName1,FeatureValue1
FeatureName2,FeatureValue2
...
The prediction results are stored in prediction_result.txt:
Class 0,Class 1,Class 2,
0.628235,0.326715,0.0450506,
Predicted: Class 0 with 62.8235% confidence
The system is designed to be integrated with other applications through file-based communication:
- External application generates input data in
sharedData.txt - External application runs
tester(or uses the functionality intester.cpp) - External application reads prediction results from
prediction_result.txt
The prediction model (RDP_TripleNN.onnx) is a neural network that classifies inputs into three recombinant classes. The model expects standardized input features.
- Read raw input data from
sharedData.txt - Drop features with no variance
- Standardize features using pre-calculated means and standard deviations
- Run inference through the ONNX model
- Generate classification results and save to
prediction_result.txt
MIT
- ONNX Runtime for providing the neural network execution environment# RdpLink