'keras-applications-3D' is 3D-image deep learning models based on popular 2D models. (Based on the Keras)
pip install Keras-Applications-3D
### Prepare your 3D data [Ex. (64,64,64,1) shape]
# ...
X = np.zeros((128, 64, 64, 64, 1))
y = np.zeros((128, 10))
y[:,0] = 1
# ...
### Oriinal channel of model is '64->128->256->...'
### But it takes a lot of memory, So we reduce first channel 64 to 16
model = vgg19.VGG19(
input_shape=(64,64,64,1), classes=10,
base_channel=16
)
# model.summary()
### Training
model.compile(
loss='categorical_crossentropy',
optimizer=Adam(learning_rate=1e-4),
metrics=['acc']
)
history = model.fit(
x=X, y=y,
)
### Inference
pred = model.predict(X).squeeze()
real = y
pred = pred.argmax(axis=1)
real = real.argmax(axis=1)
accr = (pred == real).sum() / len(real)
print('Accuracy: {:04f}'.format(accr))
- Major 2D CNN architecture for 3D ([V]: Complete, []: In progress)
- VGG (16, 19)
- ResNet (50, 101, 152)
- ResNetV2 (50, 101, 152)
- DenseNet (121, 169, 201)
- ResNext
- InceptionV3
- Inception_Resnet_V2
- Xception
- EfficientNet (B0, B1, ..., B7)
- Mobilenet (V1, V2)
- SE-ResNet
- NFNet
- Convolution function for 3D (keras_applications_3d/custom_layers.py)
- DepthwiseConv3D
- SeparableConv3D
- Documentation
- Documentation
- Exmaple
- Classification
- Regression
- Visualize trained model
- Visualization
- Saliency map (Simple gradient)
- Class Activation Map (GradCAM)
- Activation Maximization
- Pretrained weight
- ModelNet10
- ModelNet40
- (Please recommand any 3D dataset)
Model | ModelNet10 accuracy | Number of parameters |
---|---|---|
VGG16 (16) | 0.9001 | 23,780,058 |
VGG19 (16) | 0.9075 | 24,775,706 |
ResNet50 (16) | 0.8062 | 2,923,818 |
ResNet101 (16) | 0.7467 | 5,393,578 |
ResNet152 (16) | 0.7588 | 7,429,418 |
ResNet50V2 (16) | 0.8194 | 2,918,090 |
ResNet101V2 (16) | 0.8128 | 5,385,674 |
ResNet152V2 (16) | 0.8007 | 7,419,594 |
DenseNet121 (16) | 0.9042 | 2,884,010 |
DenseNet169 (16) | 0.8855 | 4,768,298 |
DenseNet201 (16) | 0.8998 | 6,519,594 |
- So We prepare some custom model to handle this.
- Please check base_channel or growth_rate option.
- So We also prepare some option to exclude batch-norm.
If you interested in this project, feel free and suggest anything.