This repository contains code implementing a dense neural network with a tree-like architecture for feature extraction from images. Inspired by the Inception architecture, this model aims to use a functional interface from the Keras library to construct a tree structure.
The primary function add_module
constructs a tree structure by defining branches, each comprising various dense layers. This design allows for multiple paths for feature extraction at different levels of detail.
- Branching: The branches are added to the neural network using the defined modules.
- Common Layers: Both before and after branching, common layers such as Reshape, BatchNormalization, and Average pooling are applied.
- This code requires Keras library to be installed (
pip install keras.utils
).
- Ensure the necessary dependencies are installed.
- Execute the code in a Python environment that supports Keras, such as Jupyter Notebook.
- The code provides functionality to visualize the network structure using
plot_model
.
# Assuming necessary imports and input_tensor definition
# ... (code snippet from the provided notebook)
# Branching:
output_tensor = add_module(input_tensor)
# Common layers (after merging branches):
output_tensor = Average()(output_tensor)
model1 = Model(inputs=input_tensor, outputs=output_tensor)
model1.compile(loss='categorical_crossentropy', metrics='accuracy', optimizer='adam')
# Visualizing network structure
from tensorflow.keras.utils import plot_model
plot_model(model1, show_shapes=True)
This code is provided under LICENSE.md, specifying the terms and conditions for its usage. Contributors
Robert Neat - Initial implementation (GitHub)
For any inquiries or issues regarding this code, please contact the contributors.
To run the project, you have a couple of options:
Access the project through Google Colab using the Gist website. You can import the necessary data from the GitHub project resources. Use the following Gist link: gist link here
If you prefer to run the project on your local machine, follow these steps:
- Clone the Repository: Download the repository branch from GitHub.
- Local Environment:
- DataSpell or PyCharm: Open the project using DataSpell or PyCharm by JetBrains.
- Spyder IDE: Alternatively, you can use Spyder IDE to work with the project.
- Dataset Requirements:
- Ensure that the dataset files are available and stored inside your project directory. This step is crucial to prevent any issues related to missing data.
Running the project locally allows you to explore the code and execute it in your preferred Python environment. If you encounter any problems, make sure to check the dataset's presence in your project directory.