--- library_name: keras-hub --- ### Model Overview # Model Summary Xception introduces a novel CNN architecture that reinterprets Inception modules as a step toward depthwise separable convolutions — operations consisting of a depthwise convolution followed by a pointwise convolution. By replacing Inception modules with these more efficient separable convolutions, Xception achieves superior performance, slightly surpassing Inception V3 on the ImageNet dataset and significantly outperforming it on a larger dataset with 350 million images and 17,000 classes. These improvements are achieved without increasing the number of model parameters, indicating a more effective utilization of the network's capacity. Weights are released under the [MIT License](https://www.mit.edu/~amini/LICENSE.md) . Keras model code is released under the [Apache 2 License](https://github.com/keras-team/keras-hub/blob/master/LICENSE). ## Links * [Xception Quickstart Notebook](https://www.kaggle.com/code/laxmareddypatlolla/xception-quick-start-notebook) * [Xception API Documentation](coming soon) * [Xception Model Card](https://arxiv.org/abs/1610.02357) * [KerasHub Beginner Guide](https://keras.io/guides/keras_hub/getting_started/) * [KerasHub Model Publishing Guide](https://keras.io/guides/keras_hub/upload/) ## Installation Keras and KerasHub can be installed with: ``` pip install -U -q keras-hub pip install -U -q keras ``` Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the [Keras Getting Started](https://keras.io/getting_started/) page. ## Presets The following model checkpoints are provided by the Keras team. Full code examples for each are available below. | Preset name | Parameters | Description | |---------------------------------------|------------|--------------------------------------------------------------------------------------------------------------| | xception_41_imagenet | 23 M | 41-layer Xception model with 23 million parameters trained on ImageNet | ## Example Usage ```python # Pretrained Xception backbone. model = keras_hub.models.XceptionBackbone.from_preset("xception_41_imagenet") input_data = np.random.uniform(0, 1, size=(2, 299, 299, 3)) model(input_data) # Randomly initialized Xception backbone with a custom config. model = keras_hub.models.XceptionBackbone( stackwise_conv_filters=[[32, 64], [64, 128], [256, 256]], stackwise_pooling=[True, True, False], ) model(input_data) # Use Xception for image classification model = keras_hub.models.ImageClassifier.from_preset("xception_41_imagenet") ``` ## Example Usage with Hugging Face URI ```python # Pretrained Xception backbone. model = keras_hub.models.XceptionBackbone.from_preset("hf://keras/xception_41_imagenet") input_data = np.random.uniform(0, 1, size=(2, 299, 299, 3)) model(input_data) # Randomly initialized Xception backbone with a custom config. model = keras_hub.models.XceptionBackbone( stackwise_conv_filters=[[32, 64], [64, 128], [256, 256]], stackwise_pooling=[True, True, False], ) model(input_data) # Use Xception for image classification model = keras_hub.models.ImageClassifier.from_preset("hf://keras/xception_41_imagenet") ```