In bit-patterned media recording (BPMR), the magnetic islands are adjusted closer together to increase the areal density. This makes the bit-error rate (BER) performance of BPMR worse by inter-symbol interference (ISI) and inter-track interference (ITI) from cross-and down-track directions, respectively. To solve the ISI and ITI issues, the data is modulated into non-isolated patterns before storing on the medium of BPMR systems. Furthermore, for improving the non-isolated patterned modulation code, we introduced a method to create the non-isolated patterned code with a minimum Hamming distance (MHD) of 3 instead of 2 as in the previous studies. In our proposed method, firstly, we considered the generator matrix of the Hamming code to create one-dimensional codewords with an MHD of 3. Further, these codewords were converted into two-dimensional codewords, mitigating the isolated pattern. Finally, to create a fast encoder and decoder, we used the multi-layer perceptron to encode the original data into the non-isolated codewords with an MHD of 3. The results show that our proposed model improved the BER performance of the BPMR system.