Мобильная версия 1xslots — действительно ли она экономит ваше время и деньги

Да, мобильная версия 1xslots позволяет играть быстрее, но она также может увеличить ваши расходы — вот почему. Удобство доступа с телефона кажется очевидным плюсом: не нужно включать компьютер, ждать загрузки системы. Но именно эта лёгкость доступа часто играет против вашего бюджета. Мониторинг собственных расходов на маленьком экране сложнее, а импульсивные ставки случаются чаще. Это не значит, что мобильный вариант исключительно вреден — просто его экономику нужно# Artificial Intelligence Nanodegree
## Convolutional Neural Networks

—

In this project, you will design a pipeline to process real-world, user-supplied images. Given an image of a dog, your algorithm will identify an estimate of the canine’s breed. If supplied an image of a human, the code will identify the resembling dog breed.

![Sample Output](images/sample_dog_output.png)

### Instructions

1. Clone the repository and navigate to the downloaded folder.

“`
git clone https://github.com/udacity/dog-project.git
cd dog-project
“`
2. Download the [dog dataset](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/dogImages.zip). Unzip the folder and place it in the repo, at location `path/to/dog-project/dogImages`.

3. Download the [human dataset](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/lfw.zip). Unzip the folder and place it in the repo, at location `path/to/dog-project/lfw`. If you are using a Windows machine, you can use [7zip](http://www.7-zip.org/) to extract the folder.

4. Make sure you have already installed the necessary Python packages according to the README in the program repository.

5. Open a terminal window and navigate to the project folder. Open the notebook and follow the instructions.

“`
jupyter notebook dog_app.ipynb
“`

## Project Instructions

### Instructions

1. Clone the repository and navigate to the downloaded folder.

“`
git clone https://github.com/udacity/dog-project.git
cd dog-project
“`
2. Download the [dog dataset](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/dogImages.zip). Unzip the folder and place it in the repo, at location `path/to/dog-project/dogImages`.

3. Download the [human dataset](https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/lfw.zip). Unzip the folder and place it in the repo, at location `path/to/dog-project/lfw`. If you are using a Windows machine, you can use [7zip](http://www.7-zip.org/) to extract the folder.

4. Make sure you have already installed the necessary Python packages according to the README in the program repository.

5. Open a terminal window and navigate to the project folder. Open the notebook and follow the instructions.

“`
jupyter notebook dog_app.ipynb
“`

### Project Summary

This project has five steps:
– [Step 0](#step0): Import Datasets
– [Step 1](#step1): Detect Humans
– [Step 2](#step2): Detect Dogs
– [Step 3](#step3): Create a CNN to Classify Dog Breeds (from Scratch)
– [Step 4](#step4): Use a CNN to Classify Dog Breeds (using Transfer Learning)
– [Step 5](#step5): Create a CNN to Classify Dog Breeds (using Transfer Learning)
– [Step 6](#step6): Write your Algorithm
– [Step 7](#step7): Test Your Algorithm

### Step 0: Import Datasets

Download and import the datasets provided in the instructions above. Then load them in the data.

### Step 1: Detect Humans

In this section, a human face detector will be performed. This is done using OpenCV’s implementation of Haar feature based cascade classifiers. The general rule is that 100% of the images must return a detected human face.

### Step 2: Detect Dogs

In this step, a dog detector will be performed. This will use a pre-trained ResNet-50 model to detect dogs in images. Given an image, this pre-trained ResNet-50 model returns a prediction for the object that is contained in the image.

First, the ResNet-50 model is downloaded along with the weights from the Imagenet competition. Of all the output classes, those in the range from 151 to 268 correspond to different dog breeds.

Then, face_detector and dog_detector functions are designed: the first function returns True if a human is detected in the image, while the second function returns True if a dog is detected in the image.

### Step 3: Create a CNN to Classify Dog Breeds (from Scratch)

This part consists in designing and train a convolutional neural netwrok that classifies dog breeds from scratch.

For the model architecture, three convolutions are performed, with filters sizes ordered from low to high (16, 32, 64), 3×3 filters, stride of one, and relu activated. The MaxPool layer is added to each convolution in order to reduce the spatial dimention. The output of the third convolution is flattened before sending it trough two fully connected layers, with Dropout layers use for regularization.

During the training and validation of the model, the loss function is categorical cross entropy, the optimizer function is Adam, the batch size is 20 and the number of epochs is 50.

Finally, the test model performance is shown on the test dataset.

### Step 4: Use a CNN to Classify Dog Breeds (using Transfer Learning)

A model that uses transfer learning will be created and tested.Especially, the VGG16 model is used, which is a convolutional neural network model proposed by K. Simonyan and A. Zisserman.

First, the model is frozen as the feature detector is not required to be changed. Only the fully connected classifier part is changed so that the classifier works for dog images.

Then, the training and validation loops are preformed using categorical cross entropy as the criterion, Adam as the optimizer, and the batch size set to 20. The number of epochs was set to 20.

Finally, the model with the test data was tested and the test loss and test accuracy was printed.

### Step 5: Create a CNN to Classify Dog Breeds (using Transfer Learning)

Here, the ResNet50 model is used as a feature extractor to build a CNN classifier to predict dog breeds from given images.

Firstf, the model is frozen as the feature detector is not required to be changed. Only the fully connected classifier part is changed so that the classifier works for dog images.

Then, the training and validation loops are preformed using categorical cross entropy as the criterion, Adam as the optimizer, and the batch size set to 20. The number of epochs 20.

Finally, the model with the test data was tested and the test loss and test accuracy was printed.

### Step 6: Write your Algorithm

In this step an algorithm that accepts a file path to an image and first determines whether the image contains a human, dog, or neither, and then:

– if a dog is detected in the image, return the predicted breed.
– if a human is detected in the image, return the resembling dog breed.
– if neither is detected in the image, provide output that indicates an error.

### Step 7: Test Your Algorithm !

Finally, this step is testing the algorithm on at least six images samples. The results are showed as the following images:

1. ![output1](images/output1.png)
2. ![output2](images/output2.png)
3. ![output3](images/output3.png)
4. ![output4](images/output4.png)
5. ![output5](images/output5.png)
6. ![output6](images/output6.png)

From above images, we can see that the algorithm seems not be able to recognize dogs’ heads images (output1), not very sure for the dogs in the nature (output5). But it can be success in many common situations such as output2, output3, and can be correct with human faces (outpu6).

Moreover, for output4, thought the dog is resamble to some dog breeds, it cannot predict correct dog breed.

Possible cause for the imperfect performance may lay in:

– Of course, the quality and the quantity of the training and testing dataset may be one of the main reasons. There might not be enough images for the model to learn distinct features for different dogs.

– Another main reason may be the model complexity. Maybe the model is not complex enough to learn the local features and generalize them to give accurate predictions even with Transfer Learning. It could have been better to tune hyperparameters and breakdown the data to smaller groups to train individual models.

The above problems could be improved in two ways in the future:

– Collecting more and higher quality images (more diversity in the images) to train the model or preprocess the data differently.

– Making a pipeline of multi-algorithms to deal with different situations. Also, the processing steps could also tuned by covering more cases.

– Plot and analyze the misclassifed results to see which dog breeds are being confused and adjust in terms of preprocessing, data augmentation, data structure, or model structure.

## Requirements
To run this project, thoses Python packages must be available in the computer.

– numpy
– scipy
– pandas
– scikit-learn
– keras
– matplotlib
– opencv-python
– IPython
– tqdm
– pillow
– h5py

## Files

– `dog_app.ipynb` – a IPython notebook containing the analysis.
– `README.md` – a file which describes about the project and its requirements.
– `requirements.txt` – text file containing all the requierments (Optional)
– `images/` – images used in the notebook and README.md.
– `haarcascades/` – folder containing xml files of OpenCV’s Haar feature based cascade classifiers to detect human faces.
– `saved_models/` – folder containing saved weights of the trained model.

## Licensing, Authors, Acknowledgements

The data used in this project is provided by Udacity. The copyright and other rights of the data remain with the original authors. The code given is opened for anyone to modify and re-distributed under the terms of the [MIT license](https://opensource.org/licenses/MIT).

Udacity’s given in-class examples was very helpful in solving this project. Keras documentation and Stack Overflow also provided tremendous assistance.

Подробнее можно ознакомиться у 1xslots официальный сайт войти.

Leave a comment

อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องข้อมูลจำเป็นถูกทำเครื่องหมาย *